Submits a malariasimulation job for execution on different platforms.
This function prepares the necessary scripts and submits the malariasimulation job based on the specified HPC configuration.
If the job is to be run locally, it generates the required PowerShell script for running malariasimulation and submits
it for execution. For SLURM-based jobs, it delegates the submission to the SLURM-specific function.
Parameters: |
-
exp
(object )
–
An experiment object containing attributes like ‘job_directory’, ‘hpc’, ‘analyzer_script’,
and ‘malariasimulation_jobs’ needed for job configuration and submission.
|
Raises: |
-
ValueError
–
If an unsupported HPC configuration is provided.
-
CalledProcessError
–
If there is an issue with running the job submission command for SLURM.
|
Source code in malariasimulation\utils.py
| def submit_run_malariasimulation(exp):
"""
Submits a malariasimulation job for execution on different platforms.
This function prepares the necessary scripts and submits the malariasimulation job based on the specified HPC configuration.
If the job is to be run locally, it generates the required PowerShell script for running malariasimulation and submits
it for execution. For SLURM-based jobs, it delegates the submission to the SLURM-specific function.
Args:
exp (object): An experiment object containing attributes like 'job_directory', 'hpc', 'analyzer_script',
and 'malariasimulation_jobs' needed for job configuration and submission.
Raises:
ValueError: If an unsupported HPC configuration is provided.
subprocess.CalledProcessError: If there is an issue with running the job submission command for SLURM.
"""
os.makedirs(os.path.join(exp.job_directory, 'malariasimulation_jobs'), exist_ok=True)
if exp.hpc == 'LOCAL':
if not exp.use_container:
from utility.helper_local import write_ps1_analyzer, submit_runmodel_local
write_ps1_malariasimulation(exp)
write_ps1_analyzer(exp, pyscript=exp.analyzer_script[0], model='malariasimulation')
submit_runmodel_local(exp, model='malariasimulation')
else:
from utility.helper_local_docker import write_sh_analyzer, write_sh_plotters, submit_runmodel_sh
write_sh_malariasimulation(exp)
write_sh_analyzer(exp, pyscript=exp.analyzer_script[0], model='malariasimulation')
#write_sh_plotters(exp, model='malariasimulation')
submit_runmodel_sh(exp, model='malariasimulation')
else:
# Default, run via SLURM on HPC
submit_run_malariasimulation_slurm(exp)
|