Skip to content

Commit

Permalink
tutorials: add job submit tutorial
Browse files Browse the repository at this point in the history
Add a small tutorial on submitting jobs to Flux. To start, just add a simple
example of submitting jobs to Flux using the command line.

This tutorial can be expanded later to show how to submit jobs to Flux using
its job submission API.
  • Loading branch information
cmoussa1 committed Feb 8, 2023
1 parent 874b2dc commit 79a3f3a
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tutorials/commands/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Welcome to the Command Tutorials! These tutorials should help you to map specifi
with your use case, and then see detailed usage.

- ``flux proxy`` (:ref:`ssh-across-clusters`): "Send commands to a flux instance across clusters using ssh"
- ``job-submit`` (:ref:`job-submit`): "Submit a job in a Flux instance"

This section is currently 🚧️ under construction 🚧️, so please come back later to see more command tutorials!

Expand All @@ -15,4 +16,5 @@ This section is currently 🚧️ under construction 🚧️, so please come bac
:maxdepth: 2
:caption: Command Tutorials

ssh-across-clusters
ssh-across-clusters
job-submit
55 changes: 55 additions & 0 deletions tutorials/commands/job-submit.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.. _job-submit:

==========================
How to Submit Jobs in Flux
==========================

Do you want to submit a job to Flux? Here's a short tutorial on how to do so!

----------------------------
Submit Jobs Using Flux's CLI
----------------------------

From within a Flux instance, you can submit your job on the command line with
optional arguments, resource options, per task options, and per resource
options:

.. code-block:: sh
$ flux mini submit --nodes=2 --ntasks=4 --cores-per-task=2 ./my_compute_script.lua 120
ƒM5k8m7m
$ flux mini submit --nodes=1 --ntasks=1 --cores-per-task=2 ./my_other_script.lua 120
ƒSUEFPDH
A jobID is returned for every job submitted. You can view the status of your
running jobs with ``flux jobs``:

.. code-block:: sh
$ flux jobs
JOBID USER NAME ST NTASKS NNODES TIME INFO
ƒSUEFPDH fluxuser my_other_s R 1 1 1.842s
ƒM5k8m7m fluxuser my_compute R 4 2 3.255s
You can also get information about your job by passing in the jobID and a key.
For example, to get resource information about your job:

.. code-block:: sh
$ flux job info ƒM5k8m7m R
{"version":1,"execution":{"R_lite":[{"rank":"0-1","children":{"core":"0-3"}}]}}
There are a number of keys you can pass to get various information about your job:

.. code-block:: sh
J
R
eventlog
jobspec
guest.exec.eventlog
guest.input
guest.output
And that's it! If you have any questions, please
`let us know <https://github.com/flux-framework/flux-docs/issues>`_.

0 comments on commit 79a3f3a

Please sign in to comment.