Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions source/compute/jobs/job_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,15 @@ For example, assume that we have two job scripts:
It uses the environment variable ``perturbation_size`` to determine the perturbation to
apply.

To make ``sbatch`` print simply the job ID after submitting, use the ``--parsable`` option.
To make ``sbatch`` print the job ID after submitting, use the ``--parsable`` option.

- In some clusters, the ``--parsable`` option also prints the cluster name in the form "<job ID>;<cluster>". We can use cut to fetch just the job ID.
Copy link
Collaborator

@lexming lexming Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion to make it more clear:

Suggested change
- In some clusters, the ``--parsable`` option also prints the cluster name in the form "<job ID>;<cluster>". We can use cut to fetch just the job ID.
.. note::
In some clusters the ``--parsable`` option also prints the cluster name with the job
ID in the form ``<job ID>;<cluster>``. We can use the command ``cut`` to fetch just
the job ID as shown below.


The following lines automate the launch of the three jobs:

.. code:: bash

first=$(sbatch --parsable --job-name job_leader job_first.slurm)
first=$((sbatch --parsable --job-name job_leader job_first.slurm)| cut -d ';' -f1)
perturbation_size='0.05' sbatch --job-name job_pert_0_05 --dependency=afterok:$first job_depend.slurm
perturbation_size='0.1' sbatch --job-name job_pert_0_1 --dependency=afterok:$first job_depend.slurm

Expand Down