Skip to content
Snippets Groups Projects
Commit f92812b3 authored by David Verelst's avatar David Verelst
Browse files

prepost.dlctemplate: add option for running in zip-chunk mode

parent e01df4e2
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ from matplotlib import pyplot as plt ...@@ -26,6 +26,7 @@ from matplotlib import pyplot as plt
from wetb.prepost import Simulations as sim from wetb.prepost import Simulations as sim
from wetb.prepost import dlcdefs from wetb.prepost import dlcdefs
from wetb.prepost import dlcplots from wetb.prepost import dlcplots
from wetb.prepost.simchunks import create_chunks_htc_pbs
plt.rc('font', family='serif') plt.rc('font', family='serif')
plt.rc('xtick', labelsize=10) plt.rc('xtick', labelsize=10)
...@@ -183,7 +184,7 @@ def variable_tag_func(master, case_id_short=False): ...@@ -183,7 +184,7 @@ def variable_tag_func(master, case_id_short=False):
# ============================================================================= # =============================================================================
def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=True, def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=True,
runmethod=None, write_htc=True): runmethod=None, write_htc=True, zipchunks=False):
""" """
Launch load cases defined in Excel files Launch load cases defined in Excel files
""" """
...@@ -248,6 +249,17 @@ def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=True, ...@@ -248,6 +249,17 @@ def launch_dlcs_excel(sim_id, silent=False, verbose=False, pbs_turb=True,
mann64 = sim.MannTurb64(silent=silent) mann64 = sim.MannTurb64(silent=silent)
mann64.gen_pbs(cases) mann64.gen_pbs(cases)
if zipchunks:
# create chunks
# sort so we have minimal copying turb files from mimer to node/scratch
sorts_on = ['[DLC]', '[Windspeed]']
create_chunks_htc_pbs(cases, sort_by_values=sorts_on, ppn=20,
nr_procs_series=9, processes=1,
walltime='20:00:00', chunks_dir='zip-chunks-jess')
create_chunks_htc_pbs(cases, sort_by_values=sorts_on, ppn=12,
nr_procs_series=15, processes=1,
walltime='20:00:00', chunks_dir='zip-chunks-gorm')
def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True, def post_launch(sim_id, statistics=True, rem_failed=True, check_logs=True,
force_dir=False, update=False, saveinterval=2000, csv=False, force_dir=False, update=False, saveinterval=2000, csv=False,
...@@ -414,6 +426,9 @@ if __name__ == '__main__': ...@@ -414,6 +426,9 @@ if __name__ == '__main__':
dest='envelopeblade', help='Compute envelopeblade') dest='envelopeblade', help='Compute envelopeblade')
parser.add_argument('--envelopeturbine', default=False, action='store_true', parser.add_argument('--envelopeturbine', default=False, action='store_true',
dest='envelopeturbine', help='Compute envelopeturbine') dest='envelopeturbine', help='Compute envelopeturbine')
parser.add_argument('--zipchunks', default=False, action='store_true',
dest='zipchunks', help='Create PBS launch files for'
'running in zip-chunk find+xargs mode.')
opt = parser.parse_args() opt = parser.parse_args()
# TODO: use arguments to determine the scenario: # TODO: use arguments to determine the scenario:
...@@ -451,7 +466,7 @@ if __name__ == '__main__': ...@@ -451,7 +466,7 @@ if __name__ == '__main__':
# create HTC files and PBS launch scripts (*.p) # create HTC files and PBS launch scripts (*.p)
if opt.prep: if opt.prep:
print('Start creating all the htc files and pbs_in files...') print('Start creating all the htc files and pbs_in files...')
launch_dlcs_excel(sim_id, silent=False) launch_dlcs_excel(sim_id, silent=False, zipchunks=opt.zipchunks)
# post processing: check log files, calculate statistics # post processing: check log files, calculate statistics
if opt.check_logs or opt.stats or opt.fatigue or opt.envelopeblade or opt.envelopeturbine: if opt.check_logs or opt.stats or opt.fatigue or opt.envelopeblade or opt.envelopeturbine:
post_launch(sim_id, check_logs=opt.check_logs, update=False, post_launch(sim_id, check_logs=opt.check_logs, update=False,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment