I have two different executable (run1
and run2
). I want to run them simultaneously. They share one readonly input file, but otherwise, they are different process.
Is it possible to call the call
's simultaneously?
Currently, as I have coded, cmd2
's call wait for cmd1
's call to complete.
with open(dosout, "w") as dout, open(jijout, "w") as jout:
cmd1 = ["mpirun", "-np", "8", "~/WORK/run1", dosinp]
cmd2 = ["mpirun", "-np", "8", "~/WORK/run2", jijinp]
call(cmd1, stdout=dout)
call(cmd2, stdout=jout)
dout.close()
jout.close()
Is it possible with call
? or Popen
from this answer is the only (or better) way out?