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
BcastParametersparameter in theslurm.conffile (if that's available), and if it's not available, it just lands in the current working directory you invoked thesbcastcommand 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 arelz4(which is the default) andnone. 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 theslurm.conffile using theBcastParametersoption. π--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 keywordNONEis configured, then no directory paths will be excluded at all β nobody's left out. the default value is whateverslurm.confBcastExcludesays, 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 bySlurmUser/root, so like, permission check first. also:--nodelistmust 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-allocationoption. 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 toyes(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 inslurm.confSbcastParameterssend_libs. see also--exclude. π-s,--size=<size>β specify the block size used for file broadcast. the size can have a suffix ofkormfor 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 or8MB, 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 isMessageTimeoutas 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 currently64. 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 runsbcastor other Slurm client commands that send remote procedure calls toslurmctldfrom loops in shell scripts or other programs. like, seriously. ensure that programs limit calls tosbcastto 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,--compressSBCAST_EXCLUDEβ--exclude=<NONE|path1,...,pathN>SBCAST_FANOUTβ-F number,--fanout=numberSBCAST_FORCEβ-f,--forceSBCAST_SEND_LIBSβ--send-libs[=yes|no]SBCAST_PRESERVEβ-p,--preserveSBCAST_SIZEβ-s size,--size=sizeSBCAST_TIMEOUTβ-t seconds,--timeout=secondsSLURM_CONFβ the location of the Slurm configuration file.SLURM_DEBUG_FLAGSβ specify debug flags forsbcastto use. seeDebugFlagsin theslurm.conf(5)man page for a full list of flags. the environment variable takes precedence over the setting in theslurm.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
- 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