Skip to content

Commit

Permalink
Auto-create the batch job list for sampling tasks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bismarrck committed Jul 30, 2024
1 parent 4d4700e commit 183d240
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/tensordb
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ class TensorDB:
"""
workdir = self.root / "sampling"
workdir.mkdir(exist_ok=True)
batch_jobs = []

# The NVT vasp parameters
self.setup_vasp_sampling_parameters(npt=False)
Expand Down Expand Up @@ -526,6 +527,9 @@ class TensorDB:
json.dump(metadata, fp, indent=2)
fp.write("\n")
print(f"[VASP/nvt/sampling/gen]: {taskdir}")
batch_jobs.append(str(taskdir.relative_to('sampling')))
with open(workdir / "batch_jobs", "a") as fp:
fp.write("\n".join(batch_jobs) + "\n")

@staticmethod
def _get_npt_sampling_task(
Expand Down Expand Up @@ -557,6 +561,7 @@ class TensorDB:
"""
workdir = self.root / "sampling"
workdir.mkdir(exist_ok=True)
batch_jobs = []

# The NPT vasp parameters
self.setup_vasp_sampling_parameters(npt=True)
Expand Down Expand Up @@ -621,6 +626,9 @@ class TensorDB:
json.dump(metadata, fp, indent=2)
fp.write("\n")
print(f"[VASP/npt/sampling/gen]: {taskdir}")
batch_jobs.append(str(taskdir.relative_to('sampling')))
with open(workdir / "batch_jobs", "a") as fp:
fp.write("\n".join(batch_jobs) + "\n")

# --------------------------------------------------------------------------
# Check the status of sampling jobs
Expand Down

0 comments on commit 183d240

Please sign in to comment.