a3fe.run._virtual_queue

Utilities for the Ensemble, Window, and Simulation Classes

Classes

Job(virtual_job_id, command_list[, ...])

Class to hold information about a job

VirtualQueue([queue_len_lim, log_dir, ...])

A virtual slurm queue which has no limit on the number of queued jobs, which submits slurm jobs to the real queue when there are few enough jobs queued.

class a3fe.run._virtual_queue.Job(virtual_job_id: int, command_list: List[str], slurm_job_id: int | None = None, status: JobStatus = JobStatus.NONE, slurm_file_base: str | None = None)[source]

Class to hold information about a job

Attributes:
slurm_file_base
slurm_job_id
slurm_outfile

Methods

has_failed()

Check whether the job has failed

has_failed() bool[source]

Check whether the job has failed

class a3fe.run._virtual_queue.VirtualQueue(queue_len_lim: int = 2000, log_dir: str = './output', stream_log_level: int = 10)[source]

A virtual slurm queue which has no limit on the number of queued jobs, which submits slurm jobs to the real queue when there are few enough jobs queued. This gets round slurm queue limits.

Attributes:
queue

The queue of jobs, both real and virtual.

stream_log_level

The log level for the stream handler.

Methods

kill(job)

Kill and remove a job from the real and virtual queues.

submit(command_list, slurm_file_base)

Submit a job to the virtual queue.

update()

Remove jobs from the queue if they have finished, then move jobs from the pre-queue to the real queue if there is space.

wait()

Wait for all jobs to finish.

kill(job: Job) None[source]

Kill and remove a job from the real and virtual queues.

property queue: List[Job]

The queue of jobs, both real and virtual.

property stream_log_level: int

The log level for the stream handler.

submit(command_list: List[str], slurm_file_base: str) Job[source]

Submit a job to the virtual queue.

Parameters:
  • command_list (_List[str]) – The command to be run.

  • slurm_file_base (str) – The base name of the slurm file to be written. This allows the slurm file to be checked for errors.

Returns:

job – The Job submitted to the virtual queue.

Return type:

Job

update() None[source]

Remove jobs from the queue if they have finished, then move jobs from the pre-queue to the real queue if there is space.

wait() None[source]

Wait for all jobs to finish.