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: ...@@ -29,11 +29,11 @@ class Simulation:
# If there's already a directory remove it... # If there's already a directory remove it...
if os.path.isdir(self.dirname): if os.path.isdir(self.dirname):
if doKeep: if doKeep:
print( 'KEEP existing directory ', self.dirname) print( 'KEEP existing directory {}'.format(self.dirname))
print( self.dirname) print( self.dirname)
return False return False
else: else:
print( 'REMOVE existing directory ', self.dirname) print( 'REMOVE existing directory {}'.format(self.dirname))
shutil.rmtree(self.dirname) shutil.rmtree(self.dirname)
# create directory # create directory
...@@ -102,7 +102,7 @@ class Simulation: ...@@ -102,7 +102,7 @@ class Simulation:
else: else:
opalexe = 'opal' 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 templatefile at ' + inputfilePath)
print( 'Using fieldmaps at ' + fieldmapPath) print( 'Using fieldmaps at ' + fieldmapPath)
print( 'Parameter set in ' + oinpFile + ' are:') print( 'Parameter set in ' + oinpFile + ' are:')
...@@ -189,11 +189,12 @@ class Simulation: ...@@ -189,11 +189,12 @@ class Simulation:
return qid return qid
if doNobatch: 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) ofn, fileExtension = os.path.splitext(oinpFile)
print( 'STD output is written to {}.out'.format(ofn)) print( 'STD output is written to {}.out'.format(ofn))
execommand = 'mpirun -np ' + str(CORES) + ' ' + opalexe + ' ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out' #execommand = 'mpirun -np ' + str(CORES) + ' ' + opalexe + ' ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out'
qid = subprocess.check_output(execommand) outfile = ofn +'.out'
qid = subprocess.call(['mpirun', '-np ', str(CORES), opalexe, oinpFile, '2>&1','|','tee',outfile])
os.chdir('..') os.chdir('..')
return -1 return -1
else: 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