Commit f3f4bddd authored by Mykhailo Dalchenko's avatar Mykhailo Dalchenko
Browse files

Merge branch 'feature/tmp' into 'feature/htcondor-support'

Fix the htcondor submission for sim_telarray

See merge request !38
parents 71cf1437 60b88041
Pipeline #3728715 passed with stages
in 17 minutes and 34 seconds
executable = __executable__
arguments = __arguments__
executable = __run_dir__/condor_sim_telarray.sh
output = __stdoutput__
error = __stderror__
initialdir = __outputdir__
should_transfer_files = YES
transfer_input_files = __input_file__
when_to_transfer_output = ON_EXIT_OR_EVICT
request_memory = 2G
accounting_group = group_auger.user
+MaxRuntime = 60*60*24*5
queue 1
queue
......@@ -7,34 +7,27 @@
use_non_tagged_configuration = false
[environment.submission]
run_directory = "/tmp/sim_runner"
run_directory = "/tmp/sim_runner/run_dir"
tool = "htcondor" # Either local, sge or slurm are supported
job_template = './examples/job_template_test_htcondor.job'
[environment.corsika]
version = "6.9"
temporary_local_configuration_path = '/tmp/corsika-config'
[environment.sim_telarray]
software_intallation_path = '/opt/sim_telarray/bin'
version = "2018-11-07"
temporary_local_configuration_path = '/tmp/sim_telarray-config'
configuration_repository = 'https://gitlab.cern.ch/cta-unige/sim-config'
tag = "LST-SiPM-NSB-0.1"
software_intallation_path = '/afs/cern.ch/work/m/mdalchen/private/corsika_simtel/sim_telarray/bin'
version = "latest"
temporary_local_configuration_path = '/afs/cern.ch/work/m/mdalchen/private/cta/test/sim_telarray-config'
configuration_repository = 'https://github.com/cta-observatory/lst-sim-config'
tag = "sim-telarray-lst-magic-prod2-v1.3"
# Main configuration file in the tagged configuration, which links the rest configuration files together
entry_point = "config.cfg"
input_path = "/scratch/examples/data/" # For condor submitter this path must be absolute
output_path = "/scratch/test/output/" # For condor submitter this path must be absolute
entry_point = "array.cfg"
input_path = "./examples/data" # For condor submitter this path must be absolute
output_path = "/tmp/sim_runner/output" # For condor submitter this path must be absolute
[process]
dry_run = true # Read all configurations, generate job log header but do not run actual simulation
#dry_run = false # Read all configurations, generate job log header but do not run actual simulation
stage = 'sim_telarray' # could be either corsika or sim_telarray. For the moment only latter is supported
production_type = "gamma"
extract_calibration = false
[corsika]
placeholder = true # corsika running is not supported yet
[sim_telarray]
[sim_telarray.preprocessor]
NUM_TELESCOPES = 1
......@@ -45,18 +38,9 @@ placeholder = true # corsika running is not supported yet
only_triggered_telescopes = 0
only_triggered_arrays = 0
maximum_events = 100
ignore_telescopes= 'all:-1'
maximum_telescopes = 7
random_state = 'auto'
show = 'all' # Show all parameters at the beginning of each job
[sim_telarray.telescope]
# Common orientations: 'north': 'phi' = 5.3195}, 'south': 'phi' = 174.6805
telescope_phi = 174.6805
telescope_zenith_angle = 20 # commonly named θ
[sim_telarray.night_sky_background]
nsb_scaling_factor = 2
maximum_telescopes = 1
[sim_telarray.calibration]
pedestal_events = 10 # check default value! 100 is for pedestal runs
......
......@@ -475,8 +475,11 @@ def submit_jobs(config, job_commands):
"""
stage = config['process']['stage']
if stage == 'sim_telarray':
os.makedirs(config['environment'][stage]['output_path'] + '/hist/', exist_ok=True)
os.makedirs(config['environment'][stage]['output_path'] + '/log/', exist_ok=True)
if config['environment']['submission']['tool'] == "htcondor":
os.makedirs(config['environment'][stage]['output_path'], exist_ok=True)
else:
os.makedirs(config['environment'][stage]['output_path'] + '/hist/', exist_ok=True)
os.makedirs(config['environment'][stage]['output_path'] + '/log/', exist_ok=True)
run_directory = f"{config['environment']['submission']['run_directory']}/"
os.makedirs(run_directory, exist_ok=True)
os.makedirs(run_directory + '/error/', exist_ok=True)
......@@ -532,8 +535,12 @@ def submit_jobs(config, job_commands):
template = pkg_resources.read_text(templates, f'{stage}_{tool}.job')
if config['environment']['submission']['tool'] == 'htcondor':
split_command = shlex.split(cmd)
template = template.replace('__executable__', split_command[0])
template = template.replace('__arguments__', " ".join(split_command[1:]))
#template = template.replace('__executable__', split_command[0])
#template = template.replace('__arguments__', " ".join(split_command[1:]))
template = template.replace('__run_dir__', run_directory)
condor_sim_telarray_script = f'#!/bin/bash\n{split_command[0]} {" ".join(split_command[1:])}'
with open(f'{run_directory}/condor_sim_telarray.sh', 'w') as f:
f.write(condor_sim_telarray_script)
template = template.replace('__outputdir__', config['environment'][stage]['output_path'])
template = template.replace('__input_file__',
f"{config['environment'][stage]['input_path']}/{split_command[-1]}")
......
executable = __executable__
arguments = __arguments__
executable = __run_dir__/condor_sim_telarray.sh
output = __stdoutput__
error = __stderror__
log = __stdlog__
initialdir = __outputdir__
should_transfer_files = YES
transfer_input_files = __input_file__
when_to_transfer_output = ON_EXIT_OR_EVICT
request_memory = 2G
accounting_group = group_auger.user
+MaxRuntime = 60*60*24*5
queue 1
queue
Supports Markdown
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