Skip to content

Commit 1f36d30

Browse files
job runners: document handler interface
1 parent c0e5109 commit 1f36d30

File tree

3 files changed

+8
-75
lines changed

3 files changed

+8
-75
lines changed

src/plugins/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ The following are "core" plugins maintained by the Cylc team:
1111
cylc-rose
1212
main-loop/index
1313
install/index
14+
job-runners/index
1415

1516
.. warning::
1617

src/plugins/job-runners/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. _CustomJobSubmissionMethods:
2+
3+
Custom Job Submission Methods
4+
-----------------------------
5+
6+
.. autoclass:: cylc.flow.job_runner_handlers.documentation.ExampleHandler
7+
:members:

src/user-guide/task-implementation/job-submission.rst

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -302,78 +302,3 @@ If you specify an :cylc:conf:`[events]execution timeout` and an
302302
ignored.
303303

304304
.. cylc-scope::
305-
306-
307-
.. _CustomJobSubmissionMethods:
308-
309-
Custom Job Submission Methods
310-
-----------------------------
311-
312-
Defining a new job runner handler requires a little Python programming. Use
313-
the built-in handlers (e.g. :py:mod:`cylc.flow.job_runner_handlers.background`)
314-
as examples.
315-
316-
317-
An Example
318-
^^^^^^^^^^
319-
320-
The following ``qsub.py`` module overrides the built-in *pbs*
321-
job runner handler to change the directive prefix from ``#PBS`` to
322-
``#QSUB``:
323-
324-
.. TODO - double check that this still works, it's been a while
325-
326-
.. code-block:: python
327-
328-
#!/usr/bin/env python3
329-
330-
from cylc.flow.job_runner_handlers.pbs import PBSHandler
331-
332-
class QSUBHandler(PBSHandler):
333-
DIRECTIVE_PREFIX = "#QSUB "
334-
335-
JOB_RUNNER_HANDLER = QSUBHandler()
336-
337-
If this is in the Python search path (see
338-
:ref:`Where To Put Job Runner Handler Modules` below) you can use it by
339-
name in your global configuration:
340-
341-
.. code-block:: cylc
342-
343-
[platforms]
344-
[[my_platform]]
345-
hosts = myhostA, myhostB
346-
job runner = qsub # <---!
347-
348-
Then in your ``flow.cylc`` file you can use this platform:
349-
350-
.. code-block:: cylc
351-
352-
[scheduling]
353-
[[graph]]
354-
R1 = "a"
355-
[runtime]
356-
[[root]]
357-
execution time limit = PT1M
358-
platform = my_platform
359-
[[[directives]]]
360-
-l nodes = 1
361-
-q = long
362-
-V =
363-
364-
Note, this workflow will fail at run time because we only changed the
365-
directive format, and PBS does not accept ``#QSUB`` directives in
366-
reality.
367-
368-
369-
.. _Where To Put Job Runner Handler Modules:
370-
371-
Where To Put Job Runner Handler Modules
372-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
373-
374-
Custom job runner handlers must be installed on workflow and job
375-
hosts in one of these locations:
376-
377-
- under ``WORKFLOW-RUN-DIR/lib/python/``
378-
- under ``CYLC-PATH/cylc/flow/job_runner_handlers/``
379-
- or anywhere in ``$PYTHONPATH``

0 commit comments

Comments
 (0)