nipoppy.workflows.services.hpc.HPCRunner

class nipoppy.workflows.services.hpc.HPCRunner(study, subcommand, dpath_root, pipeline_name, pipeline_version=None, pipeline_step=None, keep_workdir=False, fpath_layout=None, verbose=False, hpc_config=None)

Service for generating and submitting HPC jobs via PySQA.

Parameters:
generate_cli_command(participant_id, session_id, *, extra_flags=None, extra_options=None)

Generate the CLI command for a participant-session combination.

Skips the –simulate, –hpc, –write-list and –dry-run options.

Parameters:
  • participant_id (str, optional) – Participant ID to run on.

  • session_id (str, optional) – Session ID to run on.

  • extra_flags (list[str], optional) – Additional CLI flags to append.

  • extra_options (dict[str, Any], optional) – Additional CLI options to append.

Returns:

The CLI command as a list of string tokens.

Return type:

list[str]

submit(hpc_cluster, job_name, job_array_commands, participant_ids, session_ids, dpath_work, dpath_hpc_logs, fname_hpc_error, fname_job_script, pipeline_name, pipeline_version, pipeline_step, dry_run=False)

Submit a job to the HPC scheduler.

Parameters:
  • hpc_cluster (str) – The name of the HPC cluster configuration to use.

  • job_name (str) – Name of the job to submit.

  • job_array_commands (list) – List of commands to run.

  • participant_ids (list) – List of participant IDs associated with the job.

  • session_ids (list) – List of session IDs associated with the job.

  • dpath_work (Path) – Working directory for the job.

  • dpath_hpc_logs (Path) – Directory where HPC logs will be saved.

  • fname_hpc_error (str) – Filename of the HPC error log.

  • fname_job_script (str) – Filename of the job script to generate.

  • pipeline_name (str) – Name of the pipeline being run.

  • pipeline_version (str) – Version of the pipeline being run.

  • pipeline_step (str) – Step of the pipeline being run.

  • dry_run (bool, optional) – Whether to only generate the script without submitting, by default False.

Returns:

The job ID if submitted successfully, else None.

Return type:

int or None

dpath_root
fpath_layout = None
hpc_config = None
keep_workdir = False
pipeline_name
pipeline_step = None
pipeline_version = None
study
subcommand
verbose = False