Skip to content

submit simulation worker reference

github-actions[bot] edited this page Sep 28, 2026 · 30 revisions

This page is generated from docs/submit-simulation/worker-reference.md. Edit the repository source; automated publishing replaces direct wiki edits.

Unified legacy GEMC payload

src/workflows/slurm-submission/external/submit_GEMC_sample.sh was obtained from the RG-M job-submission code represented by submit_GEMC_GENIE_sample.sh and submit_GEMC_uniform_sample.sh under legacy/GEMC-samples/scripts/job_submission_scripts/. It has been modified for this project, but keeps the RG-M scripts' overall structure and usage pattern: Slurm supplies one array index, environment variables identify the input and detector settings, GEMC runs first, and reconstruction follows. The archived originals remain untouched.

This external payload is one of the project's deliberately modular RG-M boundaries. Maintained Python code validates and resolves inputs but does not duplicate the detector commands. When RG-M provides an updated job script, compare it with this payload and carry forward the small generator-independent adaptation described below. The external payload remains excluded from routine edits so its RG-M lineage and update path stay clear.

What is generalized

Only the sample monitoring and filename-prefix sections differ:

  • SAMPLE_GENERATOR identifies uniform, GENIE or any other generator.
  • GENERATOR_TUNE replaces the GENIE-specific tune variable.
  • SAMPLE_FILE_PREFIX supplies the complete prefix instead of hardcoding either the uniform or GENIE naming formula.
  • Target, Q², beam, GEMC data directory and uniform channel monitoring are retained together. Unset optional labels print empty values, as in the originals.

For uniform samples, a prefix can be Uniform__enFD__2070MeV. For physical samples, it can be C12__genie-gst__GEM21_11a_00_000__Q2_0_02__2070MeV. Double underscores separate metadata values; hyphens inside one value, such as genie-gst, remain unchanged. Other generators supply their own prefix without adding branches to the script.

What remains the same

The Slurm header, field settings, directory assignments, GEMC command and reconstruction command retain the legacy GENIE payload structure. The event-count assignment is generalized to require JOB_NEVENTS from the coordinator. There are no command arrays, parser, preview mode, directory creation, input validation or output checks added to this script.

The payload processes JOB_NEVENTS events with solenoid -1.0 and TORUS_FIELD supplied by the caller. The same count is passed to GEMC and reconstruction. Paths follow:

OUTPATH/lundfiles/SAMPLE_FILE_PREFIX_SLURM_ARRAY_TASK_ID.txt
OUTPATH/mchipo/mc_SAMPLE_FILE_PREFIX_SLURM_ARRAY_TASK_ID_torusTORUS_FIELD.hipo
OUTPATH/reconhipo/recon_SAMPLE_FILE_PREFIX_SLURM_ARRAY_TASK_ID_torusTORUS_FIELD.hipo

Create the directories before direct execution. gemc and recon-util must be available in PATH. Execute with Bash or submit with sbatch; the script does not itself submit a job. Direct execution retains legacy failure behavior: without a caller-supplied Bash -e, a failed GEMC command does not automatically prevent reconstruction. After Slurm accepts an array, neither this worker nor the coordinator reports task failures back into a maintained job ledger, retries them, or validates their reconstructed HIPO content. Operators must inspect Slurm states and logs and verify at least one reconhipo/ file with hipo-utils -dump; see the submission guide.

Caller settings

Variable Purpose
SAMPLE_FILE_PREFIX Complete filename prefix, without the _INDEX.txt suffix
JOB_NEVENTS Configured per-task event limit shared by the array; required
SAMPLE_GENERATOR, GENERATOR_TUNE Generator/tune monitoring labels
SAMPLE_TARGET_NUCLEUS, Q2_CUT Target and Q² monitoring labels
BEAM_ENERGY_LABEL, DETECTOR_ENERGY_GROUP, UNIFORM_SAMPLE_CHANNEL, GEMC_DATA_DIR Beam/resource-group/channel/environment monitoring
OUTPATH, SLURM_ARRAY_TASK_ID Run directory and file index
TORUS_FIELD +0.5 at 2 GeV; −1 at 4/6 GeV
GCARD_FILE, YAML_FILE Detector and reconstruction configurations

The sourced src/workflows/slurm-submission/setup_and_submit.csh invokes submit.py, which checks the preloaded environment and inputs and ensures both simulation output directories exist. Preview creates only missing directories; --execute recreates both and passes these settings to sbatch for one array per sample. Slurm exports the configured environment and supplies the task index. The configured event limit is shared by the array, including a shorter final LUND file; it is not an exact per-file count.

Integration with the maintained launcher

source run.csh --workflow submit refreshes the disposable server checkout and sources the setup script directly in the login shell. The Python coordinator imports resolve_inputs.py to resolve the LUND manifest, optional key=value config and CLI. There is no site JSON, local detector runner, lock database or generated wrapper. The payload retains its scheduler directives and detector commands unchanged.

CMake installs only this external payload under bin/. The setup workflow runs from the checkout through run.csh. Review the submission guide for settings and output replacement.

Clone this wiki locally