Skip to content

Commit ad1d102

Browse files
authored
Merge pull request #742 from janosh/run-vasp-custodian
RunVaspCustodian add optional_param jobs: list[VaspJob]
2 parents c443b71 + f7a9ecd commit ad1d102

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

atomate/vasp/firetasks/run_calc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,30 @@ class RunVaspCustodian(FiretaskBase):
7676
vasp_cmd (str): the name of the full executable for running VASP. Supports env_chk.
7777
7878
Optional params:
79-
job_type: (str) - choose from "normal" (default), "double_relaxation_run" (two consecutive
79+
jobs (list[VaspJob]): VaspJobs to run.
80+
job_type (str): choose from "normal" (default), "double_relaxation_run" (two consecutive
8081
jobs), "full_opt_run" (multiple optimizations), and "neb"
8182
handler_group: (str | list[ErrorHandler]) - group of handlers to use. See handler_groups dict in the code or
8283
the groups and complete list of handlers in each group. Alternatively, you can
8384
specify a list of ErrorHandler objects.
8485
max_force_threshold: (float) - if >0, adds MaxForceErrorHandler. Not recommended for
8586
nscf runs.
86-
scratch_dir: (str) - if specified, uses this directory as the root scratch dir.
87+
scratch_dir (str): if specified, uses this directory as the root scratch dir.
8788
Supports env_chk.
8889
gzip_output: (bool) - gzip output (default=T)
8990
max_errors: (int) - maximum # of errors to fix before giving up (default=5)
9091
ediffg: (float) shortcut for setting EDIFFG in special custodian jobs
9192
auto_npar: (bool) - use auto_npar (default=F). Recommended set to T
9293
for single-node jobs only. Supports env_chk.
93-
gamma_vasp_cmd: (str) - cmd for Gamma-optimized VASP compilation.
94+
gamma_vasp_cmd (str): cmd for Gamma-optimized VASP compilation.
9495
Supports env_chk.
9596
wall_time (int): Total wall time in seconds. Activates WalltimeHandler if set.
9697
half_kpts_first_relax (bool): Use half the k-points for the first relaxation
9798
"""
9899

99100
required_params = ["vasp_cmd"]
100101
optional_params = [
102+
"jobs",
101103
"job_type",
102104
"handler_group",
103105
"max_force_threshold",
@@ -164,7 +166,8 @@ def run_task(self, fw_spec):
164166
vasp_cmd = shlex.split(vasp_cmd)
165167

166168
# initialize variables
167-
job_type = self.get("job_type", "normal")
169+
jobs = self.get("jobs", [])
170+
job_type = self.get("job_type", "normal" if jobs == [] else None)
168171
scratch_dir = env_chk(self.get("scratch_dir"), fw_spec)
169172
gzip_output = self.get("gzip_output", True)
170173
max_errors = self.get("max_errors", CUSTODIAN_MAX_ERRORS)

atomate/vasp/fireworks/core.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
sequences of VASP calculations.
44
"""
55
import warnings
6+
from typing import Any, Dict, List, Union
67

78
from fireworks import Firework
89
from pymatgen.core import Structure
@@ -583,20 +584,20 @@ def __init__(
583584
class DFPTFW(Firework):
584585
def __init__(
585586
self,
586-
structure=None,
587-
prev_calc_dir=None,
588-
name="static dielectric",
589-
vasp_cmd=VASP_CMD,
590-
copy_vasp_outputs=True,
591-
lepsilon=True,
592-
db_file=DB_FILE,
593-
parents=None,
594-
user_incar_settings=None,
595-
pass_nm_results=False,
587+
structure: Structure = None,
588+
prev_calc_dir: str = None,
589+
name: str = "static dielectric",
590+
vasp_cmd: str = VASP_CMD,
591+
copy_vasp_outputs: bool = True,
592+
lepsilon: bool = True,
593+
db_file: str = DB_FILE,
594+
parents: Union[Firework, List[Firework]] = None,
595+
user_incar_settings: Dict[str, Any] = None,
596+
pass_nm_results: bool = False,
596597
**kwargs,
597598
):
598599
"""
599-
Static DFPT calculation Firework
600+
Static DFPT calculation Firework
600601
601602
Args:
602603
structure (Structure): Input structure. If copy_vasp_outputs, used only to set the

0 commit comments

Comments
 (0)