dragon.workflows.batch.batch.Job
- class Job[source]
Bases:
Task- __init__(batch, process_templates: list [ProcessTemplate], reads: list | None = None, writes: list | None = None, name: str | None = None, timeout: float = 1000000000.0, pmi: PMIBackend = PMIBackend.CRAY) None [source]
Creates a new job task. Arguments for a process passed using
ProcessTemplate.argsthat are of typeTaskwill create a dependency for this task on the output of the task specified by the argument. Further, the output of the specified task will be passed in place of theTaskargument when the job executes.- Parameters:
batch (
Batch) – The batch in which this function task will execute.process_templates – List of pairs of the form (nprocs, process_template), where nprocs is the number
of processes to create using the specified template. :type process_templates: list :param reads: A list of
Readobjects created by callingBatch.read(). :type reads: Optional[list] :param writes: A list ofWriteobjects created by callingBatch.write(). :type writes: Optional[list] :param name: A human-readable name for the task. :type name: Optional[str] :param pmi: The PMI backend to use for launching MPI jobs. Defaults toPMIBackend.CRAY.Set to
PMIBackend.PMIXfor systems using PMIx, orNoneto disable PMI.- Returns:
Returns None.
- Return type:
None
Methods
__init__(batch, process_templates[, reads, ...])Creates a new job task.
dump_dag(file_name)Dump a PNG image of the dependency DAG associated with a compiled program.
get([block, timeout])Wait for this Task to complete.
Attributes
Provides the unique ID for this task.
- __init__(batch, process_templates: list [ProcessTemplate], reads: list | None = None, writes: list | None = None, name: str | None = None, timeout: float = 1000000000.0, pmi: PMIBackend = PMIBackend.CRAY) None [source]
Creates a new job task. Arguments for a process passed using
ProcessTemplate.argsthat are of typeTaskwill create a dependency for this task on the output of the task specified by the argument. Further, the output of the specified task will be passed in place of theTaskargument when the job executes.- Parameters:
batch (
Batch) – The batch in which this function task will execute.process_templates – List of pairs of the form (nprocs, process_template), where nprocs is the number
of processes to create using the specified template. :type process_templates: list :param reads: A list of
Readobjects created by callingBatch.read(). :type reads: Optional[list] :param writes: A list ofWriteobjects created by callingBatch.write(). :type writes: Optional[list] :param name: A human-readable name for the task. :type name: Optional[str] :param pmi: The PMI backend to use for launching MPI jobs. Defaults toPMIBackend.CRAY.Set to
PMIBackend.PMIXfor systems using PMIx, orNoneto disable PMI.- Returns:
Returns None.
- Return type:
None
- dump_dag(file_name: str ) None [source]
Dump a PNG image of the dependency DAG associated with a compiled program.
- Parameters:
file_name – Name for the new PNG file.
- Returns:
Returns None.
- Return type:
None
- get(block: bool = True, timeout: float = 1000000000.0) None [source]
Wait for this Task to complete. This function returns the task’s result and prints any stdout/stderr output.
- Parameters:
- Raises:
TimeoutError – If the specified timeout is exceeded.
:raises
TaskNotReadyError: If block is False and the result is not yet available.- Returns:
Returns the result of the task.
- Return type:
Any
- property uid
Provides the unique ID for this task.