Commit e4ad8f3d authored by snuverink_j's avatar snuverink_j
Browse files

merlin4 is switched off, for issue #3

parent afcce390
......@@ -72,7 +72,7 @@ class Simulation:
if os.system('lndir ' + fieldmapPath) != 0:
print("lndir failed (possibly doesn't exist on this system), using cp -rs..."),
if os.system('cp -rs ' + fieldmapPath + '/* .') == 0:
print("Sucess!")
print("Success!")
else:
print("Failed also! Exiting.")
sys.exit()
......@@ -131,14 +131,8 @@ class Simulation:
if not queue:
queue = os.getenv("SGE_QUEUE", "prime_bd.q")
# Merlin4
if (hostname.startswith("merlinl")):
batchsys = 'SGE'
runfile = 'run.sge'
self.WriteSGEOrteMerlin(opalexe, oinpFile, CORES, time, ram, info, queue)
# Merlin5
elif (hostname.startswith("merlin-l")):
if (hostname.startswith("merlin-l")):
batchsys = 'SLURM'
runfile = 'run.merlin5'
time = os.getenv("SLURM_TIME", "24:00:00")
......@@ -417,76 +411,4 @@ class Simulation:
s1 += "$MPICMD \n"
s1 += "####################################################\n"
myfile.write(s1)
myfile.close()
def WriteSGEOrteMerlin(self, opalexe, oinpFile, cores, time, ram, info, queue):
title=oinpFile.partition(".")[0]
myfile = open('run.sge','w')
s1 = "#!/bin/bash \n"
s1 += "#$ -cwd \n"
s1 += "#$ -j y \n"
s1 += "#$ -N " + title + "\n"
s1 += "#$ -pe orte " + str(cores) + " \n"
s1 += "#$ -q " + queue + " \n"
s1 += "#$ -v OPAL_EXE_PATH,MPIEXEC,LD_LIBRARY_PATH \n"
s1 += "#$ -l " + time + ",ram=" + ram + "G\n"
s1 += "# R U N in R E S T A R T M O D E ##############\n"
s1 += "# qsub -v RESTART=\"T\" run.sge \n"
s1 += "###################################################\n"
s1 += "# Set the environment variables:\n"
try:
v = os.environ["OPAL_EXE_PATH"]
except KeyError:
print("OPAL_EXE_PATH not set bye bye")
sys.exit(1)
s1 += "export OMP_NUM_THREADS=1\n"
s1 += "####################################################\n"
s1 += "# BEGIN DEBUG \n"
s1 += "# Print the SGE environment on master host: \n"
s1 += "####################################################\n"
s1 += "echo \"=== SGE job JOB_NAME=$JOB_NAME JOB_ID=$JOB_ID\" \n"
s1 += "####################################################\n"
s1 += "echo DATE=`date`\n"
s1 += "echo HOSTNAME=`hostname` \n"
s1 += "echo PWD=`pwd`\n"
s1 += "echo \"NSLOTS=$NSLOTS\"\n"
s1 += "####################################################\n"
s1 += "echo \"Running environment:\" \n"
s1 += "env \n"
s1 += "####################################################\n"
s1 += "echo \"Loaded environment modules:\" \n"
s1 += "module list 2>&1 \n"
s1 += "echo \n"
s1 += "# END DEBUG \n"
s1 += "####################################################\n"
s1 += "# The command to run with mpiexec: \n"
s1 += "if [ -n \"$OPAL_EXE_PATH\" ]; then \n"
s1 += "CMD=$OPAL_EXE_PATH/opal \n"
s1 += "elif [ -n \"$OPAL_DIR\" ]; then \n"
s1 += "CMD=$OPAL_DIR/bin/opal \n"
s1 += "else \n"
s1 += "echo \"OPAL executable not found\" \n"
s1 += "exit 42 \n"
s1 += "fi \n"
s1 += "if [ -z \"$RESTART\" ] \n"
s1 += "then \n"
s1 += "echo \"Normal run ..... \" \n"
s1 += "ARGS=" + "\"" + oinpFile + " --info " + str(info) + " --warn 6 \"\n"
s1 += "else \n"
s1 += "echo \"Restart run .... \" \n"
s1 += "ARGS=" + "\"" + oinpFile + " -restart -1 --info " + str(info) + " --warn 6 \"\n"
s1 += "fi \n"
s1 += "####################################################\n"
s1 += "# BEGIN DEBUG \n"
s1 += "# Check that the libraries are available (on the master host): \n"
s1 += "echo \"ldd $CMD\" \n"
s1 += "ldd $CMD \n"
s1 += "# Check the number of threads used by OpenMP: \n"
s1 += "echo \"OMP_NUM_THREADS=$OMP_NUM_THREADS\" \n"
s1 += "# END DEBUG \n"
s1 += "####################################################\n"
s1 += "MPICMD=\"$MPIEXEC --bind-to socket -x LD_LIBRARY_PATH -x OMP_NUM_THREADS -np $NSLOTS $CMD $ARGS\" \n"
s1 += "$MPICMD \n"
s1 += "####################################################\n"
myfile.write(s1)
myfile.close()
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