Skip to content

Commit

Permalink
update basic test of mpi functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
bcdaniels committed Apr 13, 2022
1 parent 53258a5 commit d81bb80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion SirIsaac/mpi_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#

import sys
from .simplePickle import load,save
from SirIsaac.simplePickle import load,save

from mpi4py import MPI
comm = MPI.COMM_WORLD
Expand Down
13 changes: 7 additions & 6 deletions test/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,13 @@ def test_basic_mpi_functionality(self):

input_data = {'test':123,'output_filename':temp_output_filename}
save(input_data,temp_input_filename)
stdoutFile = open(temp_stdout_filename,'w')
subprocess.call([ "mpirun","-np",str(NUMPROCS),"python",
os.path.join(SIRISAACDIR, "mpi_basic.py"),
temp_input_filename ],
stderr=stdoutFile,stdout=stdoutFile,
env=os.environ)
with open(temp_stdout_filename,'w') as stdoutFile:
subprocess.call([ "mpirun","-np",str(NUMPROCS),"python",
os.path.join(SIRISAACDIR, "mpi_basic.py"),
temp_input_filename ],
stderr=stdoutFile,stdout=stdoutFile,
env=os.environ,
cwd=SIRISAACDIR)
output_data = load(temp_output_filename)
os.remove(temp_input_filename)
os.remove(temp_output_filename)
Expand Down

0 comments on commit d81bb80

Please sign in to comment.