Commit bb0090c6 authored by ext-neveu_n's avatar ext-neveu_n
Browse files

cleaning a few print statements. Still need to finish fixing commands

parent 34a0aeea
......@@ -29,11 +29,11 @@ class Simulation:
# If there's already a directory remove it...
if os.path.isdir(self.dirname):
if doKeep:
print( 'KEEP existing directory ', self.dirname)
print( 'KEEP existing directory {}'.format(self.dirname))
print( self.dirname)
return False
else:
print( 'REMOVE existing directory ', self.dirname)
print( 'REMOVE existing directory {}'.format(self.dirname))
shutil.rmtree(self.dirname)
# create directory
......@@ -102,7 +102,7 @@ class Simulation:
else:
opalexe = 'opal'
print( 'Simulation directory is ' + self.dirname + ' using OPAL at ', os.environ.get('OPAL_EXE_PATH'))
print( 'Simulation directory is {} using OPAL at {}'.format(self.dirname, os.environ.get('OPAL_EXE_PATH')))
print( 'Using templatefile at ' + inputfilePath)
print( 'Using fieldmaps at ' + fieldmapPath)
print( 'Parameter set in ' + oinpFile + ' are:')
......@@ -189,11 +189,12 @@ class Simulation:
return qid
if doNobatch:
print( 'Done with setup of the OPAL simulation and executing the job on ' + str(CORES) + ' cores...\n\n\n')
print( 'Done with setup of the OPAL simulation and executing the job on {} cores...\n\n\n'.format(CORES))
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'
qid = subprocess.check_output(execommand)
#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])
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