SLURM Reference Manual for HP XC System Software

-a jobid (lowercase, --attach=jobid)
attaches (or reattaches) your current SRUN session to the already running job whose
SLURM ID is jobid. The job to which you attach must have its resources managed
by SLURM, but it can be either interactive ("allocated," started with -A) or batch
(started with -b). This option allows you to monitor or intervene in previously started
SRUN jobs. You cannot use -a with -b or -A. Because the running job to which you
attach already has its resources specied, you cannot use -a with -n, -N, or -c. You
can only attach to jobs for which you are the authorized owner.
READ-ONLY.
By default, -a attaches to the designated job read-only. STDOUT and STDERR are
copied to the attaching SRUN, just as if the current SRUN session had started the job.
However, signals are not forwarded to the remote processes (and a single CTRL-C
will detach the read-only SRUN from the job).
READ-WRITE.
If you use -j (--join) or -s (--steal) along with -a, your SRUN session "joins" the
running job and can also forward signals to it as well as receive STDOUT and
STDERR from it. If you join a SLURM batch (-b) job, you can send signals to its
batch script. Join (-j) does not forward STDIN, but steal (-s, which closes other open
sessions with the job) does forward STDIN as well as signals.
-j (lowercase, --join)
joins a running SLURM job (always used only with -a, --attach, to specify the jobid).
This not only duplicates STDOUT and STDERR to the attaching SRUN session, but
it also forwards signals to the job's script or processes as well.
-s (--steal) steals all connections to a running SLURM job (always used only with -a, --attach,
to specify the jobid). STEAL closes any open sessions with the specied job, then
copies STDOUT and STDERR to the attaching SRUN session, and it also forwards
both signals and STDIN to the job's script or processes.
SLURM Reference Manual - 21