Commit a72fc04a authored by snuverink_j's avatar snuverink_j
Browse files

update usage, dosctrings inside functions

parent 639c6a95
......@@ -48,26 +48,30 @@ def getBaseName():
return name
def printUsage():
print("./runOPAL.py [--restart-file=FILE [--restart-step=STEPNR | --restart-pos=POS]] [--info=num] [--test] [--keep] [--hypert=num] [ATTR=SCANVALUE] {[ATTR=VALUE]}")
print( "")
print("Unit of POS is meter.")
print("SCANVALUE=start:end:step, example TFWHM=0.85:0.90:0.01 ")
print("./runOPAL.py [--restart-file=FILE [--restart-step=STEPNR | --restart-pos=POS]] [--help] [--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")
print("--keep if same simulation has been run before, keep old data and abort")
print("--nobatch run opal locally not using the batch system and waits until the job is done")
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-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")
print("Recognized environment variables: DISTRIBUTIONS, FIELDMAPS, OPAL_EXE_PATH, TEMPLATES, QUEUE, RAM, TIME (deprecated SGE_)")
"""
Traverse all possible combinations of range variable values. Start simulation
once all range variables are fixed to a value. A list entry has the following
structure:
['name of var', start_value, end_value, step_value]
"""
def traverseRanges(list, opaldict, args, doNobatch):
"""
Traverse all possible combinations of range variable values. Start simulation
once all range variables are fixed to a value. A list entry has the following
structure:
['name of var', start_value, end_value, step_value]
"""
head = list[0]
tail = list[1:]
curval = head[1][0]
......@@ -90,11 +94,10 @@ def traverseRanges(list, opaldict, args, doNobatch):
traverseRanges(tail, opaldict, args, doNobatch)
curval = curval + step
"""
main method
"""
def main(argv):
"""
main method
"""
N = -1 # a running number; if given use it to label directory!
quiet = False
doTest = False
......
......@@ -151,22 +151,26 @@ class Simulation:
runfile = 'run.blues'
self.WritePBSBlues(opalexe, oinpFile, CORES, time, ram, info, queue)
# ANL Bebop
elif (hostname.startswith("bebop") or hostname.startswith("bdw") or hostname.startswith("knl")):
batchsys = 'SLURM'
runfile = 'run.bebop'
time = os.environ["TIME"]
self.WriteBebop(opalexe, oinpFile, CORES, time, ram, info, runfile, queue, hypert, quiet)
# NERSC Cori Haswell
elif (hostname.startswith("cori")):
batchsys = 'SLURM'
runfile = 'run.cori'
self.WriteCori(opalexe, oinpFile, CORES, time, ram, info, runfile)
# NERSC Edison
elif (hostname.startswith("edison")):
batchsys = 'SLURM'
runfile = 'run.edison'
self.WriteEdison(opalexe, oinpFile, CORES, time, ram, info, runfile)
# CSCS Piz-Daint
elif (hostname.startswith("daint")):
batchsys = 'SLURM'
runfile = 'run.daint'
......
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