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 in sattach. 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 in sattach. 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 the slurmctld to 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 in sattach. 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-filter options. Notes: The terminal size and resize events are ignored by sattach. Proper operation requires that the job step be initiated by srun using the --pty option. so if you didn't srun --pty it, this is not gonna behave. noted. πŸ“
  • -Q, --quiet β€” Suppress informational messages from sattach. 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 of sattach's informational messages. Multiple -v's will further increase sattach's verbosity. stack them like accessories, each -v is 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 for sattach to use. See DebugFlags in the slurm.conf(5) man page for a full list of flags. The environment variable takes precedence over the setting in the slurm.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