sbcast(1)

πŸ’– sbcast(1) β€” Slurm Commands ✨

okay bestie, pull up a chair, we're doing sbcast today and honestly? it's giving main character energy for file transfers. this is the sbcast page from the Slurm Commands manual, and i'm gonna walk you through every single crumb. no skips, no "you'll figure it out", we're doing the whole thing. πŸ’…


🌸 NAME 🌸

sbcast β€” transmit a file to the nodes allocated to a Slurm job.

like. that's it. that's the whole vibe. you got a file, you got nodes, sbcast introduces them. πŸ¦‹


✨ SYNOPSIS ✨

sbcast [-CfFjpstvV] SOURCE DEST

look at her. compact. iconic. two positional args and a lil pile of flags. πŸŽ€


πŸ’œ DESCRIPTION πŸ’œ

so sbcast is the tool you use to transmit a file to every single node allocated to the currently active Slurm job. that's the whole job description, and she does it well.

⚠️ important vibe check: this command should ONLY be executed from inside a Slurm batch job, or inside the shell that gets spawned after a Slurm job's resource allocation. do not just run it wherever, bestie, it needs that job context. 😭

now the two args, let's go:

  • SOURCE β€” the name of a file on the current node. it's the thing you're sending. the payload. the little guy going on a journey. 🌈
  • DEST β€” and this one's the fully qualified pathname for the file copy that's gonna be created on each node. every node gets their own copy. we're sharing the wealth. πŸ‘‘

and here's the tea on DEST, because it has feelings about where it lives:

  • if you give it a fully qualified pathname? slay, it goes exactly there.
  • if you don't? then the file gets created in the directory specified in the BcastParameters parameter in the slurm.conf file (if that's available), and if it's not available, it just lands in the current working directory you invoked the sbcast command from. lowkey flexible of her. πŸ’…

also: DEST should be on a file system local to that node. periodt.

ngl, parallel file systems may actually provide better performance than sbcast can, although honestly performance is gonna vary by file size, degree of parallelism, and network type. so it's giving "it depends", not "one is always better". don't @ me. πŸ™ˆ

πŸŽ€ OPTIONS πŸŽ€

here we go, the full roster, not a single flag left behind, we love a complete list:

  • -C, --compress[=library] β€” compress the file being transmitted, bestie, squeeze it. the optional argument says which data compression library to use. supported values are lz4 (which is the default) and none. some compression libraries may be unavailable on some systems, so like, check your vibes. the default compression library (and enabling compression at all) may be set in the slurm.conf file using the BcastParameters option. πŸ’–
  • --exclude=<NONE|path1,...,pathN> β€” a comma-separated list of absolute directory paths to be excluded when autodetecting and broadcasting executable shared object dependencies. if the keyword NONE is configured, then no directory paths will be excluded at all β€” nobody's left out. the default value is whatever slurm.conf BcastExclude says, and this option overrides it. see also --send-libs. πŸ¦‹
  • -f, --force β€” if the destination file (and the destination library directory when you're using --send-libs) already exists, replace it. no hesitation. no mercy. ✨
  • -j, --jobid=<jobID[+hetjobOffset].[stepID]> β€” specify the job ID to use, with optional hetjob offset and/or step ID. a SLUID may also be used in place of a numeric job ID, she's flexible like that. if you're running inside an allocation this is unneeded, because the job ID just gets read from the environment. 😌
  • -Z, --no-allocation β€” transmit files to a list of nodes regardless of what jobs they may be running. this can only be done by SlurmUser/root, so like, permission check first. also: --nodelist must be used with this option. mandatory. non-negotiable. πŸ”₯
  • -w, --nodelist=<node_name_list> β€” a list of hosts to transmit files to. these nodes must be a subset of the targeted job, OR you have to use the --no-allocation option. those are the two paths, pick one. 🌸
  • -p, --preserve β€” preserves modification times, access times, and modes from the original file. she remembers where she came from. πŸ₯Ή
  • --send-libs[=yes|no] β€” if set to yes (or you pass no argument at all), autodetect and broadcast the executable's shared object dependencies to the allocated compute nodes. the files get placed in a directory alongside the executable. this overrides the default behavior configured in slurm.conf SbcastParameters send_libs. see also --exclude. πŸ’œ
  • -s, --size=<size> β€” specify the block size used for file broadcast. the size can have a suffix of k or m for kilobytes or megabytes respectively (it defaults to bytes). this size is subject to rounding and range limits to maintain good performance. the default value is the file size or 8MB, whichever is smaller. this value may need to be set on systems with very limited memory β€” so yeah, tiny-memory besties, listen up. πŸ’€
  • -t, --timeout=<seconds> β€” specify the message timeout in seconds. the default value is MessageTimeout as reported by "scontrol show config". setting a higher value may be necessitated by relatively slow I/O performance on the compute node disks. slow disks, longer patience. ⏳
  • -F, --treewidth=<number> β€” specify the treewidth of messages used for file transfer. maximum value is currently 64. a value of "off" disables the fanout entirely. 🌳
  • -v, --verbose β€” provide detailed event logging through program execution. she's gonna tell you everything she's doing. πŸ’…
  • -V, --version β€” print version information and exit. short, sweet, done. ✨

πŸ”₯ PERFORMANCE πŸ”₯

okay this part is the serious one, so listen up bestie, i mean it:

executing sbcast sends a remote procedure call to slurmctld. if enough calls from sbcast 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 not cute. that's the opposite of cute. 😭

🚫 do NOT run sbcast or other Slurm client commands that send remote procedure calls to slurmctld from loops in shell scripts or other programs. like, seriously. ensure that programs limit calls to sbcast to the minimum necessary for the information you're trying to gather. one call. maybe two. not a thousand. please. πŸ™

🌈 ENVIRONMENT VARIABLES 🌈

some sbcast options may be set via environment variables! these environment variables, along with their corresponding options, are listed below. (note: command line options will always override these settings β€” CLI stays winning, as she should. πŸ‘‘)

  • SBCAST_COMPRESS β€” -C, --compress
  • SBCAST_EXCLUDE β€” --exclude=<NONE|path1,...,pathN>
  • SBCAST_FANOUT β€” -F number, --fanout=number
  • SBCAST_FORCE β€” -f, --force
  • SBCAST_SEND_LIBS β€” --send-libs[=yes|no]
  • SBCAST_PRESERVE β€” -p, --preserve
  • SBCAST_SIZE β€” -s size, --size=size
  • SBCAST_TIMEOUT β€” -t seconds, --timeout=seconds
  • SLURM_CONF β€” the location of the Slurm configuration file.
  • SLURM_DEBUG_FLAGS β€” specify debug flags for sbcast 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.

πŸ’… AUTHORIZATION πŸ’…

when using SlurmDBD, users who have an AdminLevel defined (Operator or Admin) are given the authority to invoke sbcast on other users' jobs. yeah. that's the power. use it responsibly, queen. 🫢


πŸ“ EXAMPLES πŸ“

using a batch script, transmit local file my.prog to /tmp/my.proc on the local nodes and then execute it.

$ cat my.job
#!/bin/bash
sbcast my.prog /tmp/my.prog
srun /tmp/my.prog

$ sbatch --nodes=8 my.job
srun: jobid 12345 submitted

look at that flow. write it, broadcast it, run it, submit it across 8 nodes. chef's kiss. ate and left no crumbs. 😌✨


πŸŽ€ COPYING πŸŽ€

Copyright (C) 2006-2010 The Regents of the University of California. Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). 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 πŸ¦‹


and that's the whole page, bestie, every last crumb of it. πŸ’– this was the Slurm 26.05 version of the sbcast(1) page from the Slurm Commands manual β€” go forth, broadcast responsibly, and remember: minimum necessary calls. mwah. πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from