Commit fe939a60 authored by georgios.voutsinas's avatar georgios.voutsinas
Browse files

add example and test for corsika std storage option

parent ccb92add
Pipeline #3748705 passed with stages
in 19 minutes and 47 seconds
......@@ -121,7 +121,7 @@ run_corsika_slurm__dry:
CONFIG: test_slurm_corsika.toml
#
# Job: run test corsika parameter_card process for proton production
# Job: run test corsika parameter_card process for proton production and temporary storage option
#
run_corsika_slurm_extended_dry:
<<: *test_production
......@@ -129,7 +129,15 @@ run_corsika_slurm_extended_dry:
CONFIG: test_slurm_corsika_extended.toml
#
# Job: run test corsika parameter_scan process for gamma production
# Job: run test corsika parameter_card process for proton production and std storage option
#
run_corsika_slurm_extended_dry:
<<: *test_production
variables:
CONFIG: test_slurm_corsika_extended_std.toml
#
# Job: run test corsika parameter_scan process for gamma production
#
run_corsika_slurm_scan_dry:
<<: *test_production
......
# Configuration file for IACT simulations configured for CI in docker container
[environment]
[environment.submission]
run_directory = "/tmp/sim_runner"
tool = "slurm" # Either local, sge or slurm are supported
job_template = "sim_runner/templates/corsika_slurm.job"
[environment.corsika]
software_intallation_path = '/opt/corsika/run'
sources = ['corsika', 'UrQMD-1.3.1-xs.dat', 'NUCNUCCS', 'tables.dat', 'atmprof_ecmwf_north_winter_fixed.dat']
version = "6.9"
temporary_local_configuration_path = '/tmp/corsika-config'
configuration_repository = 'https://gitlab.cern.ch/cta-unige/corsika-config.git'
tag = "1-first-config"
entry_point = "config_4LSTs_2MAGIC.cfg"
#configuration_repository = 'https://github.com/cta-observatory/lst-sim-config.git'
#tag = "corsika_v1"
#entry_point = "config_LST1_2MAGIC_diffuse_gammas.cfg"
output_path = "./test/output"
[process]
dry_run = true # Read all configurations, generate job log header but do not run actual simulation
stage = 'corsika' # could be either corsika or sim_telarray
production_type = "parameter_card"
[process.parameter_scan]
particle_type = 'gamma'
parameter_block = 'viewcone'
parameter = 'viewcone'
initial = 3
final = 10
step = 1
[process.parameter_card]
particle_type = 'gamma'
parameter_list = ['theta', 'az', 'phip', 'CSCAT', 'Emin', 'Emax', 'NShower', 'IO_BUFFER', 'MAX_BUNCHES']
parameter_values = [['37.661', '89.359', '85.801', '101150', '9', '89670', '20000', '5000000000', '5000000']]
[corsika]
number_of_runs = 1
[meta]
telescope_array_name = "LST1_2MAGIC"
......@@ -77,7 +77,7 @@ srun /opt/sim_telarray/bin/sim_telarray -I/tmp/sim_telarray-config -c /tmp/sim_t
def test_slurm_dry_run_corsika(self):
"""
Test SLURM job creation for Corsika
Test SLURM job creation for Corsika, temporary storage option
"""
test_job = """#!/bin/bash
#SBATCH --partition=long,xxl
......@@ -98,5 +98,28 @@ mkdir /tmp/corsika_theta_37.661_az_89.359_run1; mkdir /tmp/corsika_theta_37.661_
self.assertEqual(job_content.rstrip(), test_job.rstrip())
def test_slurm_dry_run_corsika_std_storage(self):
"""
Test SLURM job creation for Corsika, standard storage option
"""
test_job = """#!/bin/bash
#SBATCH --partition=long,xxl
#SBATCH --time=12:00:00
#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=2200 # in MB
#SBATCH --output=/tmp/sim_runner//log/job_corsika_parameter_card_1.log
#SBATCH --error=/tmp/sim_runner//error/job_corsika_parameter_card_1.err
srun /opt/corsika/run/corsika -o ./test/output/node_corsika_theta_37.661_az_89.359_/output//corsika_theta_37.661_az_89.359_run1 < ./test/output/node_corsika_theta_37.661_az_89.359_/config/parameter_cardcorsika_theta_37.661_az_89.359_run1_config.cfg > ./test/output/node_corsika_theta_37.661_az_89.359_/log//corsika_theta_37.661_az_89.359_run1.log"""
config_file_name = './examples/test_slurm_corsika_extended_std.toml'
verbosity = 0
runner.run(config_file_name, verbosity)
job_file = open('/tmp/sim_runner/jobs/job_corsika_parameter_card_1.job', 'r')
job_content = job_file.read()
job_file.close()
self.maxDiff = None
self.assertEqual(job_content.rstrip(), test_job.rstrip())
if __name__ == '__main__':
unittest.main()
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