Commit c68aa395 authored by snuverink_j's avatar snuverink_j
Browse files

fix subprocess call: no longer printing to screen in nobatch mode

parent daf14a47
......@@ -193,8 +193,11 @@ class Simulation:
ofn, fileExtension = os.path.splitext(oinpFile)
print( 'STD output is written to {}.out'.format(ofn))
#execommand = 'mpirun -np ' + str(CORES) + ' ' + opalexe + ' ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out'
outfile = ofn +'.out'
qid = subprocess.call(['mpirun', '-np ', str(CORES), opalexe, oinpFile, '2>&1','|','tee',outfile])
outfileName = ofn +'.out'
# Currently not writing to screen anymore
# There is a solution described at https://stackoverflow.com/questions/15535240/python-popen-write-to-stdout-and-log-file-simultaneously
with open(outfileName,'w') as outfile:
qid = subprocess.call(['mpirun', '-np', str(CORES), opalexe, oinpFile], stdout=outfile, stderr=outfile)
os.chdir('..')
return -1
else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment