cwltool.executors

Single and multi-threaded executors.

Attributes

TMPDIR_LOCK

Classes

JobExecutor

Abstract base job executor.

SingleJobExecutor

Default single-threaded CWL reference executor.

MultithreadedJobExecutor

Experimental multi-threaded CWL executor.

NoopJobExecutor

Do nothing executor, for testing purposes only.

Module Contents

cwltool.executors.TMPDIR_LOCK
class cwltool.executors.JobExecutor

Abstract base job executor.

final_output: collections.abc.MutableSequence[cwltool.utils.CWLObjectType | None] = []
final_status: list[str] = []
output_dirs: set[str]
__call__(process, job_order_object, runtime_context, logger=_logger)
Parameters:
Return type:

tuple[Optional[cwltool.utils.CWLObjectType], str]

output_callback(out, process_status)

Collect the final status and outputs.

Parameters:
  • out (Optional[cwltool.utils.CWLObjectType])

  • process_status (str)

Return type:

None

abstract run_jobs(process, job_order_object, logger, runtime_context)

Execute the jobs for the given Process.

Parameters:
Return type:

None

execute(process, job_order_object, runtime_context, logger=_logger)

Execute the process.

Parameters:
Return type:

tuple[Union[Optional[cwltool.utils.CWLObjectType]], str]

class cwltool.executors.SingleJobExecutor

Bases: JobExecutor

Inheritance diagram of cwltool.executors.SingleJobExecutor

Default single-threaded CWL reference executor.

run_jobs(process, job_order_object, logger, runtime_context)

Execute the jobs for the given Process.

Parameters:
Return type:

None

class cwltool.executors.MultithreadedJobExecutor

Bases: JobExecutor

Inheritance diagram of cwltool.executors.MultithreadedJobExecutor

Experimental multi-threaded CWL executor.

Does simple resource accounting, will not start a job unless it has cores / ram available, but does not make any attempt to optimize usage.

exceptions: list[cwltool.errors.WorkflowException] = []
pending_jobs: list[cwltool.utils.JobsType] = []
pending_jobs_lock
max_ram
max_cores
max_cuda
allocated_ram
allocated_cores
allocated_cuda: int = 0
select_resources(request, runtime_context)

Naïve check for available cpu cores and memory.

Parameters:
Return type:

dict[str, Union[int, float]]

run_job(job, runtime_context)

Execute a single Job in a separate thread.

Parameters:
Return type:

None

wait_for_next_completion(runtime_context)

Wait for jobs to finish.

Parameters:

runtime_context (cwltool.context.RuntimeContext)

Return type:

None

run_jobs(process, job_order_object, logger, runtime_context)

Execute the jobs for the given Process.

Parameters:
Return type:

None

class cwltool.executors.NoopJobExecutor

Bases: JobExecutor

Inheritance diagram of cwltool.executors.NoopJobExecutor

Do nothing executor, for testing purposes only.

run_jobs(process, job_order_object, logger, runtime_context)

Execute the jobs for the given Process.

Parameters:
Return type:

None

execute(process, job_order_object, runtime_context, logger=None)

Execute the process.

Parameters:
Return type:

tuple[Optional[cwltool.utils.CWLObjectType], str]