sattach(1)
β¨ sattach(1) β Slurm Commands energy β¨
okay bestie, buckle up, because this is the Slurm Commands era and we're talking about sattach β the little command that lets you slide into a running job step's DMs. π
π NAME π
sattach β attach to a Slurm job step. that's it. that's the vibe. π«Ά
πΈ SYNOPSIS πΈ
sattach [options] <jobid|sluid)>.<stepid>
π¦ DESCRIPTION π¦
So sattach literally attaches to a running Slurm job step. The way it works is it makes the IO streams of all the tasks in a running Slurm job step available to you. oh and it's also suitable for use with a parallel debugger like TotalView, which is giving very much "yes I run a debugger, and what about it." π₯
π« careful though: it cannot be used to attach directly to extern or batch steps, because the IO channels of these steps are not set or directly forwarded to a file. so don't even try it. it's not that kind of party. π
Also β a SLUID may be used in place of a numeric job ID to identify the job. iconic, tbh. β¨
π OPTIONS π
--error-filter[=]<task number>β Only transmit standard input to a single task, or print the standard output or standard error from a single task. The filtering is performed locally insattach. one task, that's it, no group chat. π-h,--helpβ Display help information and exit. the "help me I'm lost" button, and valid. π--input-filter[=]<task number>β Only transmit standard input to a single task, or print the standard output or standard error from a single task. The filtering is performed locally insattach. same deal as above, but for the input girlies. πΈ-l,--labelβ Prepend each line of task standard output or standard error with the task number of its origin. now you know WHICH task said it. receipts. π§Ύβ¨--layoutβ Contacts theslurmctldto obtain the task layout information for the job step, prints the task layout information, and then exits without attaching to the job step. it's giving "just here for the info, not the commitment." π¦--output-filter[=]<task number>β Only transmit standard input to a single task, or print the standard output or standard error from a single task. The filtering is performed locally insattach. yes bestie, the same description again, they're a trio. π--ptyβ Execute task zero in pseudo terminal. Not compatible with the--input-filter,--output-filter, or--error-filteroptions. Notes: The terminal size and resize events are ignored bysattach. Proper operation requires that the job step be initiated bysrunusing the--ptyoption. so if you didn'tsrun --ptyit, this is not gonna behave. noted. π-Q,--quietβ Suppress informational messages fromsattach. Errors will still be displayed. shhh era, but the errors still get to yell. π-u,--usageβ Display brief usage message and exit. the sparknotes of help. β¨-V,--versionβ Display Slurm version number and exit. what version are we onnnn π-v,--verboseβ Increase the verbosity ofsattach's informational messages. Multiple-v's will further increasesattach's verbosity. stack them like accessories, each-vis another charm on the bracelet. π
π₯ PERFORMANCE π₯
okay this part is the serious one, bestie, so listen up fr fr.
Executing sattach sends a remote procedure call to slurmctld. If enough calls from sattach or other Slurm client commands that send remote procedure calls to the slurmctld daemon come in at once, it can result in a degradation of performance of the slurmctld daemon, possibly resulting in a denial of service. that's the bad kind of viral. π
Do not run sattach or other Slurm client commands that send remote procedure calls to slurmctld from loops in shell scripts or other programs. Ensure that programs limit calls to sattach to the minimum necessary for the information you are trying to gather. no spamming, no farming, we do not do that here. π
π INPUT ENVIRONMENT VARIABLES π
Upon startup, salloc will read and handle the options set in the following environment variables. Note: Command line options always override environment variables settings. so the command line is the main character here, periodt. π
SLURM_CONFβ The location of the Slurm configuration file. where the lore lives. πSLURM_DEBUG_FLAGSβ Specify debug flags forsattachto use. See DebugFlags in theslurm.conf(5)man page for a full list of flags. The environment variable takes precedence over the setting in theslurm.conf. env var > config file, the way that it is. β¨SLURM_EXIT_ERRORβ Specifies the exit code generated when a Slurm error occurs (e.g. invalid options). This can be used by a script to distinguish application exit codes from various Slurm error conditions. so you can tell "my code broke" apart from "Slurm said no." π
π EXAMPLES π
Attach to job 15, step 0:
$ sattach 15.0
Attach to job with SLUID s4SNKN57XZTE00, step 1:
$ sattach s4SNKN57XZTE00.1
Limit the output to the 5th task of job 65386, step 15:
$ sattach --output-filter 5 65386.15
look at us, attaching and filtering and slaying. π
π COPYING π
Copyright (C) 2006-2007 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). Copyright (C) 2008-2009 Lawrence Livermore National Security. Copyright (C) 2010-2022 SchedMD LLC.
This file is part of Slurm, a resource management program. For details, see <https://slurm.schedmd.com/>.
Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
π SEE ALSO π
sinfo(1), salloc(1), sbatch(1), squeue(1), scancel(1), scontrol(1), slurm.conf(5), sched_setaffinity (2), numa (3)
and that's the whole page, bestie β this was Slurm 26.05, straight from the Slurm Commands collection. go forth, attach responsibly, and don't spam slurmctld in a while loop. mwah. πβ¨π¦
π¦ where this page comes from
- arch rolling: slurm-llnl 26.05.5.1-1 Β· GPL-2.0-or-later
- epel 10: slurm 26.05.5-1.el10_3 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-1-Clause
- nixpkgs unstable: slurm 26-05-5-1
- ubuntu stonking: slurm-client 26.05.4-1ubuntu1 Β· GPL-2.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms