lst_auto_rta.utils.slurm.parse_JOBID_in_squeue_CSV_output¶
- lst_auto_rta.utils.slurm.parse_JOBID_in_squeue_CSV_output(squeue_output: str, filter_dict: Dict[str, Callable[[str], bool]] | None) List[int] [source]¶
Parses the output of a squeue command, formatted as CSV to retrieve the JOB ID of listed jobs.
Warning
The output is expected to be CSV (comma separated values), which is obtained with squeue by specifying the format with a , separator, for instance: “squeue –format=”%i,%j” will give a CSV output with 2 columns job ID and job name.
- Parameters:
squeue_output (str) – output of squeue –format=”%i,%j” (querying for job ID and job name)
filter_dict (Dict[str, Callable[[str], bool]] or None) – Filtering function dictionary. Keys are the fields in the output of squeue, eg “JOBID” Values are functions to evaluate on a value of this field, returning true or false. If the output of the function is not True, the entry in squeue output is ignored. Optional, default is None in which case not filtering is applied.
- Returns:
List of job ID.
- Return type:
List[int]