Skip to content

Python Job Scripts

Jeremy McCormick edited this page Jan 28, 2020 · 1 revision

Job Parameters

Parameters are provided to job scripts using a JSON file e.g.

{
   "parameter1": "value1",
   "parameter2": "value2",
   ...
}

Each job component may require specific parameters.

These are the generic parameters that are not specific to certain components:

Parameter Description Notes
input_files list or dict of input files
output_files list or dict of output files
seed random engine seed
output_dir output directory where files will be copied
job_id numerical job ID
nevents number of input events to process

Input Files

The input_files parameter is a list or dict specifying required input files for the job.

If this parameter is a list then the files are read directly from the specified locations without copying them.

If this parameter is a dict, then files are copied from the location specified in the value to the working directory of the job and renamed to the key.

For example, these parameters will result in three files being copied to the working directory at the start of the job:

"input_files": {
    "beam.stdhep": "/nfs/slac/g/hps3/data/mc_production/beam/1pt05/v5/egs5_beam_v5_1pt05_000001.stdhep",
    "tri.lhe.gz": "/nfs/slac/g/hps3/data/mc_production/tritrig/1pt05/tritrig_unweighted_events_000001.lhe.gz",
    "wab.lhe.gz": "/nfs/slac/g/hps3/data/mc_production/wab/1pt05/wab_10mrad_unweighted_events_000001.lhe.gz"
}

Currently, some job scripts will not properly handle list arguments! It is planned that the job scripts will be updated so that list arguments can be used in all cases.

Output Files and Output Directory

The output_dir parameter is a directory where output files should be copied. It will be created if it does not exist.

The output_files parameter is a list or dict specifying the output files that the job script should produce as a final product.

If this is a dict, then the output file will be copied to the output directory and renamed from the key to the value.

If this is a list, then the output file will be copied but not renamed.

Here is an example:

"output_files": {
    "wab-beam-tri_recon.slcio": "wab-beam-tri_recon_000301.slcio"
}
"output_dir": "/scratch"

The file will be copied into /scratch from wab-beam-tri_recon.slcio and renamed to wab-beam-tri_recon_000301.slcio.

Clone this wiki locally