Skip to content

Commit 70de862

Browse files
committed
Merge branch 'abinit_workflows_dfpt_shg' of github.com:VicTrqt/atomate2 into abinit_workflows_dfpt_shg
srun with options + autoparal 1
2 parents 573e151 + 05c3472 commit 70de862

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

Diff for: src/atomate2/abinit/flows/dfpt.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,15 @@ def make(
109109
static_job = update_user_kpoints_settings( static_job, {"grid_density": 3000})
110110
static_job = update_user_abinit_settings( static_job, { 'nstep': 500,
111111
'toldfe': 1e-22,
112-
'chksymbreak': '0'}) # TO DO: modify to 500
112+
'autoparal': 1,
113+
'npfft': 1,
114+
'chksymbreak': '0'})
113115
jobs = [static_job]
114116

115117
if self.ddk_maker:
116118
# generate the perturbations for the DDK calculations
117119
ddk_perts = generate_ddk_perts(
118-
gsinput=static_job.output.abinit_input, # TODO: is that possible?
120+
gsinput=static_job.output.abinit_input,
119121
use_symmetries=self.use_ddk_sym,
120122
)
121123
jobs.append(ddk_perts)
@@ -131,7 +133,7 @@ def make(
131133
if self.dde_maker:
132134
# generate the perturbations for the DDE calculations
133135
dde_perts = generate_dde_perts(
134-
gsinput=static_job.output.abinit_input, # TODO: is that possible?
136+
gsinput=static_job.output.abinit_input,
135137
use_symmetries=self.use_dde_sym,
136138
)
137139
jobs.append(dde_perts)
@@ -147,7 +149,7 @@ def make(
147149
if self.dte_maker:
148150
# generate the perturbations for the DTE calculations
149151
dte_perts = generate_dte_perts(
150-
gsinput=static_job.output.abinit_input, # TODO: is that possible?
152+
gsinput=static_job.output.abinit_input,
151153
skip_permutations=self.dte_skip_permutations,
152154
phonon_pert=self.dte_phonon_pert,
153155
ixc=self.dte_ixc,

Diff for: src/atomate2/abinit/jobs/response.py

+2
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,8 @@ def generate_dte_perts(
256256
from pseudos.
257257
"""
258258
# Call Abinit to get the list of irreducible perturbations
259+
gsinput = gsinput.deepcopy()
260+
gsinput.pop_vars(['autoparal', 'npfft'])
259261
perts = gsinput.abiget_irred_dteperts(
260262
phonon_pert=phonon_pert, ixc=ixc
261263
) # TODO: quid manager?

Diff for: src/atomate2/abinit/run.py

+14-6
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
from atomate2 import SETTINGS
1212
from atomate2.abinit.utils.common import (
1313
INPUT_FILE_NAME,
14-
MRGDDB_INPUT_FILE_NAME,
1514
LOG_FILE_NAME,
15+
MRGDDB_INPUT_FILE_NAME,
1616
STDERR_FILE_NAME,
1717
)
1818

@@ -34,8 +34,11 @@ def run_abinit(
3434
"""Run ABINIT."""
3535
abinit_cmd = abinit_cmd or SETTINGS.ABINIT_CMD
3636
mpirun_cmd = mpirun_cmd or SETTINGS.ABINIT_MPIRUN_CMD
37+
command = []
38+
if mpirun_cmd:
39+
command.extend(mpirun_cmd.split())
40+
command.append(abinit_cmd)
3741
start_time = start_time or time.time()
38-
command = [mpirun_cmd, abinit_cmd] if mpirun_cmd is not None else [abinit_cmd]
3942

4043
max_end_time = 0.0
4144
if wall_time is not None:
@@ -78,9 +81,12 @@ def run_mrgddb(
7881
"""Run mrgddb."""
7982
mrgddb_cmd = mrgddb_cmd or SETTINGS.ABINIT_MRGDDB_CMD
8083
mpirun_cmd = mpirun_cmd or SETTINGS.ABINIT_MPIRUN_CMD
84+
command = []
85+
if mpirun_cmd:
86+
command.extend(mpirun_cmd.split())
87+
command.extend(["-n", "1"])
88+
command.extend([mrgddb_cmd, "--nostrict"])
8189
start_time = start_time or time.time()
82-
command = [mpirun_cmd, "-n", "1", mrgddb_cmd, "--nostrict"] if mpirun_cmd is not None else [mrgddb_cmd]
83-
8490

8591
max_end_time = 0.0
8692
if wall_time is not None:
@@ -92,11 +98,13 @@ def run_mrgddb(
9298
command.extend(["--timelimit", time2slurm(mrgddb_timelimit)])
9399
max_end_time = start_time + wall_time
94100

95-
#command.append("< "+MRGDDB_INPUT_FILE_NAME)
101+
# command.append("< "+MRGDDB_INPUT_FILE_NAME)
96102

97103
status = "completed"
98104

99-
with open(MRGDDB_INPUT_FILE_NAME, "r") as stdin, open(LOG_FILE_NAME, "w") as stdout, open(STDERR_FILE_NAME, "w") as stderr:
105+
with open(MRGDDB_INPUT_FILE_NAME) as stdin, open(
106+
LOG_FILE_NAME, "w"
107+
) as stdout, open(STDERR_FILE_NAME, "w") as stderr:
100108
process = subprocess.Popen(command, stdin=stdin, stdout=stdout, stderr=stderr)
101109

102110
if wall_time is not None:

0 commit comments

Comments
 (0)