soprano.hpc.submitter.debug.debugqueue#

Definition of a fake QueueInterface class, useful for debugging Submitters.

Classes

DebugQueueInterface([dt])

DebugQueueInterface object

class soprano.hpc.submitter.debug.debugqueue.DebugQueueInterface(dt=0.1)[source]#

Bases: QueueInterface

DebugQueueInterface object

A class meant to emulate a QueueInterface while doing absolutely nothing of what it does. Jobs are simply stored locally, there’s a fixed waiting time, and are then executed. Ideally they should be simple, quick stuff (like an echo command). No guarantees for actually long jobs.

In the submitted script a syntax for additional variables is allowed, similar to real queue systems. These follow the convention of many engines of having to start with #$. For example

#$ WAIT 10

means the job will be put in a “wait” state for 10 seconds. The currently available variables are:

WAIT - specify how long the job has to stay in a “wait” state. If two values are provided, these are considered bounds for a random number RUN - same as above, but for the running state. This has no bearing on the actual running time (it’s suggested that it’s something very quick)

Initialize the DebugQueueInterface.

Args:
dt (float): frequency with which the queue status is updated
kill(job_id)[source]#

Kill the job with the given ID

Args:
job_id (str): ID of the job to kill

list()[source]#

List all jobs found in the queue

Returns:
jobs (dict): a dict of jobs classified by ID containing all info
that can be matched through list_outre

property remote_target#

RemoteTarget if a remote Host is set

set_remote_host(host=None, timeout=1.0)#

Set a remote host for use by this QueueInterface

If a remote host is set, this Interface will try using the Paramiko library to connect to it via SSH. Check the docstring of soprano.hpc.submitter.utils.RemoteTarget to see what the limitations are for this usage.

Args:
host (Optional[str]): host name of the remote machine to connect
to. Further information must be contained in
the user’s ~/.ssh/config file. If left empty
the remote host is UNSET and therefore the
interface goes back to local use.
timeout (Optional[float]): connection timeout in seconds (default
is 1 second)
submit(script, cwd=None)[source]#

Submit a job to the queue.

Args:
script (str): content of the submission script
cwd (Optional[str]): path to the desired working directory

Returns:
job_id (str): the job ID assigned by the queue system and parsed
with sub_outre