Commit ef2f0f1b authored by snuverink_j's avatar snuverink_j
Browse files

remove non-functional restart option as discussed in #8

parent 90269ee0
......@@ -14,12 +14,6 @@ import subprocess
from simulation import Simulation
from opaldict import OpalDict
def getNearestRestartStep(restart_pos,fn):
print('pos= ',restart_pos,' fn= ',fn)
res = subprocess.check_output('H5getStep ' + str(restart_pos) + " " + fn);
return int(res.split("=")[2])
def getBaseName():
path ='.'
ext1 ='*.tmpl'
......@@ -48,7 +42,7 @@ def getBaseName():
return name
def printUsage():
print("./runOPAL.py [--restart-file=FILE [--restart-step=STEPNR | --restart-pos=POS]] [--help] [--quiet] [--info=num] [--test] [--keep] [--queue=qname] [--hypert=num] [--nobatch] [ATTR=SCANVALUE] {[ATTR=VALUE]}")
print("./runOPAL.py [--help] [--quiet] [--info=num] [--test] [--keep] [--queue=qname] [--hypert=num] [--nobatch] [ATTR=SCANVALUE] {[ATTR=VALUE]}")
print("")
print("--help prints this message")
print("--test does everything but submitting the job")
......@@ -58,9 +52,6 @@ def printUsage():
print("--info=<num> steers the std-output of OPAL. The range is 0 < num < 6 (default), from minimal to maximum output")
print("--queue=<qname> defines in which queue the job goes. Overwrites QUEUE (deprecated SGE_QUEUE)")
print("--hypert=<num> defines the number of Hyper-Threads used. Default 0")
print("--restart-file specifies the file that needs to be restarted.")
print("--restart-pos specifies the position (in meter) defining the restart of the simulation. If no data has been dumped at that position *runOpal* will use the nearest position stored in the restart file as restart position. Unit of POS is meter.")
print("--restart-step specifies the restart step of the simulation.")
print("")
print("SCANVALUE=start:end:step, scans a parameter space, e.g. example TFWHM=0.85:0.90:0.01 ")
print("ATTR refers to a name in the data file")
......@@ -108,8 +99,6 @@ def main(argv):
doTest = False
doKeep = False
doNobatch = False
restart_step = -99
restart_file = ""
queue = ""
info = 6
hypert = 0
......@@ -118,15 +107,8 @@ def main(argv):
for arg in argv:
if arg.startswith("--test"):
doTest = True
elif arg.startswith("--restart-file"):
restart_file = str.lstrip(arg,"--restart-file=")
elif arg.startswith("--restart-step"):
restart_step = arg.split("=")[1]
elif arg.startswith("--hypert"):
hypert = int(arg.split("=")[1])
elif arg.startswith("--restart-pos"):
restart_pos = arg.split("=")[1]
restart_step = str(getNearestRestartStep(restart_pos,restart_file))
elif arg.startswith("--keep"):
doKeep = True
elif arg.startswith("--nobatch"):
......@@ -193,7 +175,7 @@ def main(argv):
if not opaldict.hasRanges():
sim = Simulation(opaldict)
qid = sim.run(N, baseFileName, restart_step, inputfilePath, tmplFile, oinpFile, restart_file, doTest, doKeep, doNobatch, info, queue, hypert, quiet)
qid = sim.run(N, baseFileName, inputfilePath, tmplFile, oinpFile, doTest, doKeep, doNobatch, info, queue, hypert, quiet)
if doNobatch:
print( "... finished!\n")
#else:
......@@ -223,7 +205,7 @@ def main(argv):
print(ranges)
#run simulations of all possible combinations
args = [N, baseFileName, restart_step, inputfilePath, tmplFile, oinpFile, restart_file, doTest, doKeep, doNobatch, info, queue, hypert, quiet]
args = [N, baseFileName, inputfilePath, tmplFile, oinpFile, doTest, doKeep, doNobatch, info, queue, hypert, quiet]
traverseRanges(list(ranges.items()), opaldict, args, doNobatch)
# clean up
os.system("rm -f *.bak ")
......
......@@ -51,7 +51,7 @@ class Simulation:
os.mkdir(self.dirname)
return True
def run(self,N, baseFileName, restart_step, inputfilePath, tmplFile, oinpFile, restart_file, doTest, doKeep, doNobatch, info, queue, hypert, quiet):
def run(self,N, baseFileName, inputfilePath, tmplFile, oinpFile, doTest, doKeep, doNobatch, info, queue, hypert, quiet):
# make directory name indicating changed values
self.dirname = baseFileName
if N >= 0:
......
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