Skip to content

Commit

Permalink
autoparal 1 GS
Browse files Browse the repository at this point in the history
  • Loading branch information
VicTrqt committed Feb 10, 2024
1 parent ff1ac26 commit 05c3472
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
10 changes: 6 additions & 4 deletions src/atomate2/abinit/flows/dfpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ def make(
static_job = update_user_kpoints_settings( static_job, {"grid_density": 3000})
static_job = update_user_abinit_settings( static_job, { 'nstep': 500,
'toldfe': 1e-22,
'chksymbreak': '0'}) # TO DO: modify to 500
'autoparal': 1,
'npfft': 1,
'chksymbreak': '0'})
jobs = [static_job]

if self.ddk_maker:
# generate the perturbations for the DDK calculations
ddk_perts = generate_ddk_perts(
gsinput=static_job.output.abinit_input, # TODO: is that possible?
gsinput=static_job.output.abinit_input,
use_symmetries=self.use_ddk_sym,
)
jobs.append(ddk_perts)
Expand All @@ -131,7 +133,7 @@ def make(
if self.dde_maker:
# generate the perturbations for the DDE calculations
dde_perts = generate_dde_perts(
gsinput=static_job.output.abinit_input, # TODO: is that possible?
gsinput=static_job.output.abinit_input,
use_symmetries=self.use_dde_sym,
)
jobs.append(dde_perts)
Expand All @@ -147,7 +149,7 @@ def make(
if self.dte_maker:
# generate the perturbations for the DTE calculations
dte_perts = generate_dte_perts(
gsinput=static_job.output.abinit_input, # TODO: is that possible?
gsinput=static_job.output.abinit_input,
skip_permutations=self.dte_skip_permutations,
phonon_pert=self.dte_phonon_pert,
ixc=self.dte_ixc,
Expand Down
2 changes: 2 additions & 0 deletions src/atomate2/abinit/jobs/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ def generate_dte_perts(
from pseudos.
"""
# Call Abinit to get the list of irreducible perturbations
gsinput = gsinput.deepcopy()
gsinput.pop_vars(['autoparal', 'npfft'])
perts = gsinput.abiget_irred_dteperts(
phonon_pert=phonon_pert, ixc=ixc
) # TODO: quid manager?
Expand Down
20 changes: 14 additions & 6 deletions src/atomate2/abinit/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from atomate2 import SETTINGS
from atomate2.abinit.utils.common import (
INPUT_FILE_NAME,
MRGDDB_INPUT_FILE_NAME,
LOG_FILE_NAME,
MRGDDB_INPUT_FILE_NAME,
STDERR_FILE_NAME,
)

Expand All @@ -34,8 +34,11 @@ def run_abinit(
"""Run ABINIT."""
abinit_cmd = abinit_cmd or SETTINGS.ABINIT_CMD
mpirun_cmd = mpirun_cmd or SETTINGS.ABINIT_MPIRUN_CMD
command = []
if mpirun_cmd:
command.extend(mpirun_cmd.split())
command.append(abinit_cmd)
start_time = start_time or time.time()
command = [mpirun_cmd, abinit_cmd] if mpirun_cmd is not None else [abinit_cmd]

max_end_time = 0.0
if wall_time is not None:
Expand Down Expand Up @@ -78,9 +81,12 @@ def run_mrgddb(
"""Run mrgddb."""
mrgddb_cmd = mrgddb_cmd or SETTINGS.ABINIT_MRGDDB_CMD
mpirun_cmd = mpirun_cmd or SETTINGS.ABINIT_MPIRUN_CMD
command = []
if mpirun_cmd:
command.extend(mpirun_cmd.split())
command.extend(["-n", "1"])
command.extend([mrgddb_cmd, "--nostrict"])
start_time = start_time or time.time()
command = [mpirun_cmd, "-n", "1", mrgddb_cmd, "--nostrict"] if mpirun_cmd is not None else [mrgddb_cmd]


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

#command.append("< "+MRGDDB_INPUT_FILE_NAME)
# command.append("< "+MRGDDB_INPUT_FILE_NAME)

status = "completed"

with open(MRGDDB_INPUT_FILE_NAME, "r") as stdin, open(LOG_FILE_NAME, "w") as stdout, open(STDERR_FILE_NAME, "w") as stderr:
with open(MRGDDB_INPUT_FILE_NAME) as stdin, open(
LOG_FILE_NAME, "w"
) as stdout, open(STDERR_FILE_NAME, "w") as stderr:
process = subprocess.Popen(command, stdin=stdin, stdout=stdout, stderr=stderr)

if wall_time is not None:
Expand Down

0 comments on commit 05c3472

Please sign in to comment.