1111from atomate2 import SETTINGS
1212from 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