cwltool.executors
=================

.. py:module:: cwltool.executors

.. autoapi-nested-parse::

   Single and multi-threaded executors.



Attributes
----------

.. autoapisummary::

   cwltool.executors.TMPDIR_LOCK


Classes
-------

.. autoapisummary::

   cwltool.executors.JobExecutor
   cwltool.executors.SingleJobExecutor
   cwltool.executors.MultithreadedJobExecutor
   cwltool.executors.NoopJobExecutor


Module Contents
---------------

.. py:data:: TMPDIR_LOCK

.. py:class:: JobExecutor

   Abstract base job executor.


   .. py:attribute:: final_output
      :type:  collections.abc.MutableSequence[cwl_utils.types.CWLObjectType | None]
      :value: []



   .. py:attribute:: final_status
      :type:  list[str]
      :value: []



   .. py:attribute:: output_dirs
      :type:  set[str]


   .. py:method:: __call__(process, job_order_object, runtime_context, logger = _logger)


   .. py:method:: output_callback(out, process_status)

      Collect the final status and outputs.



   .. py:method:: run_jobs(process, job_order_object, logger, runtime_context)
      :abstractmethod:


      Execute the jobs for the given Process.



   .. py:method:: execute(process, job_order_object, runtime_context, logger = _logger)

      Execute the process.



.. py:class:: SingleJobExecutor

   Bases: :py:obj:`JobExecutor`

   .. autoapi-inheritance-diagram:: cwltool.executors.SingleJobExecutor
      :parts: 1


   Default single-threaded CWL reference executor.


   .. py:method:: run_jobs(process, job_order_object, logger, runtime_context)

      Execute the jobs for the given Process.



.. py:class:: MultithreadedJobExecutor(max_parallel = 0)

   Bases: :py:obj:`JobExecutor`

   .. autoapi-inheritance-diagram:: cwltool.executors.MultithreadedJobExecutor
      :parts: 1


   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.


   .. py:attribute:: exceptions
      :type:  list[cwltool.errors.WorkflowException]
      :value: []



   .. py:attribute:: pending_jobs
      :type:  list[cwltool.utils.JobsType]
      :value: []



   .. py:attribute:: pending_jobs_lock


   .. py:attribute:: max_ram


   .. py:attribute:: max_cores


   .. py:attribute:: max_cuda
      :value: 0



   .. py:attribute:: allocated_ram


   .. py:attribute:: allocated_cores


   .. py:attribute:: allocated_cuda
      :type:  int
      :value: 0



   .. py:method:: select_resources(request, runtime_context)

      Naïve check for available cpu cores and memory.



   .. py:method:: run_job(job, runtime_context)

      Execute a single Job in a separate thread.



   .. py:method:: wait_for_next_completion(runtime_context)

      Wait for jobs to finish.



   .. py:method:: run_jobs(process, job_order_object, logger, runtime_context)

      Execute the jobs for the given Process.



.. py:class:: NoopJobExecutor

   Bases: :py:obj:`JobExecutor`

   .. autoapi-inheritance-diagram:: cwltool.executors.NoopJobExecutor
      :parts: 1


   Do nothing executor, for testing purposes only.


   .. py:method:: run_jobs(process, job_order_object, logger, runtime_context)

      Execute the jobs for the given Process.



   .. py:method:: execute(process, job_order_object, runtime_context, logger = None)

      Execute the process.



