emop.lib.schedulers package

Submodules

emop.lib.schedulers.emop_slurm module

class emop.lib.schedulers.emop_slurm.EmopSLURM(settings)[source]

Bases: emop.lib.emop_scheduler.EmopScheduler

current_job_count()[source]

Get count of this application’s active jobs

The currentjobs are those that are Running+Pending.

Example command used:
squeue -r –noheader -p idhmc -n emop-controller
Returns:
int: The numberof current jobs
get_submit_cmd(num_pages=0, queue=None, name=None, mem_per_cpu=None, cpus_per_task=None, dependency=None, job_type='job')[source]

Generates a sbatch command

Based on settings a sbatch command is generated.

Args:
num_pages (int): Number of pages being scheduled
Returns:
list: The command to be executed
jobid_env_vars = ['SLURM_JOB_ID', 'SLURM_JOBID']
name = 'SLURM'
submit_job(proc_id, num_pages, dependency=None)[source]

Submit a job to SLURM

Before the job is submitted some environment variables are set which are then used by SLURM.

PROC_ID tells the SLURM job which JSON file to load. EMOP_CONFIG_PATH tells the SLURM job which INI file should be used.

Args:
proc_id (str or int): proc_id to be used by submitted job num_pages (int): Number of pages being scheduled
Returns:
str: SLURM Job ID (false returned if failed)
submit_transfer_job(task_id)[source]

Submit a transfer job to SLURM

Before the job is submitted some environment variables are set which are then used by SLURM.

TASK_ID tells the SLURM job which task ID to monitor. EMOP_CONFIG_PATH tells the SLURM job which INI file should be used.

Args:
task_id (str or int): task_id to be used by submitted job
Returns:
str: ID of job submitted

Module contents