Commit 0c5ad1a2 authored by snuverink_j's avatar snuverink_j
Browse files

if OPAL_EXE_PATH not defined use opal executable from PATH (hopefully); improve output

parent 53ab1042
......@@ -97,14 +97,18 @@ class Simulation:
with open(oinpFile, 'w') as file:
file.write(filedata)
opalexe = '$OPAL_EXE_PATH/opal'
if os.environ.get('OPAL_EXE_PATH'):
opalexe = '$OPAL_EXE_PATH/opal'
else:
opalexe = 'opal'
print 'Simulation directory is ' + self.dirname + ' using OPAL at ', os.environ.get('OPAL_EXE_PATH')
print 'Using templatefile at ' + inputfilePath + ' using fieldmaps at ' + fieldmapPath + ' \n'
print 'Using templatefile at ' + inputfilePath
print 'Using fieldmaps at ' + fieldmapPath
print 'Parameter set in ' + oinpFile + ' are:'
for s, value in sorted(self.opaldict.iteritems()):
print ' :::: ' + s + '= ' + str(value)
print ' :::: ' + s + ' = ' + str(value)
if not doNobatch:
hostname = commands.getoutput("hostname")
......@@ -120,7 +124,7 @@ class Simulation:
print "You use deprecated environment variable SGE_RAM. Please use in the future RAM"
ram = os.getenv("SGE_RAM")
else:
ram= os.getenv("RAM", "4")
ram = os.getenv("RAM", "4")
if not queue:
queue = os.getenv("SGE_QUEUE", "prime_bd.q")
......@@ -179,7 +183,7 @@ class Simulation:
print 'Done with setup of the OPAL simulation and executing the job on ' + str(CORES) + ' cores...\n\n\n'
ofn, fileExtension = os.path.splitext(oinpFile)
print 'STD output is written to ' + ofn + '.out'
execommand = 'mpirun -np ' + str(CORES) + ' ' + os.environ.get('OPAL_EXE_PATH') + '/opal ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out'
execommand = 'mpirun -np ' + str(CORES) + ' ' + opalexe + ' ' + oinpFile + ' 2>&1 | tee ' + ofn + '.out'
qid = commands.getoutput(execommand)
os.chdir('..')
return -1
......
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