<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof ContentPasted0">
Thanks so much for this answer!  Turned out that default partitions get set <span style="display: inline !important; background-color: rgb(255, 255, 255);" class="ContentPasted1">on this HPC </span>via an environment variable, so armed with the knowledge you
 shared, I've been able to figure out a viable path for my use-case by making use of 'unset SBATCH_PARTITION' =)</div>
<div class="elementToProof">
<div style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-Dan</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; color: rgb(0, 0, 0);">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div id="appendonsend"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
<hr tabindex="-1" style="display:inline-block; width:98%;">
<b>From:</b> slurm-users on behalf of Bjørn-Helge Mevik<br>
<b>Sent:</b> Thursday, November 9, 2023 2:38 AM<br>
<b>To:</b> slurm-users@schedmd.com<br>
<b>Subject:</b> Re: [slurm-users] --partition requests ignored in scripts
<div><br>
</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">"Bunis, Dan" <Daniel.Bunis@ucsf.edu> writes:<br>
<br>
> My colleagues and I have noticed that our compute cluster seems to<br>
> ignore '--partition' requests when we give them as '#SBATCH<br>
> --partition=<partition_name>' inside of our scripts, but it respects<br>
> them when given in-line within our sbatch calls as 'sbatch<br>
> --partition=<partition_name> script.sh'.  Based on some googling, it<br>
> seems that both methods are meant to work, so I'm wondering if it's<br>
> known what can cause the in-script methodology to NOT work for<br>
> schedulers where the in-line methodology DOES work?<br>
<br>
My suspicion is that there is an environment variable SBATCH_PARTITION<br>
set in your shells.  Such a variable will override the #SBATCH directive,<br>
but not the command line switch.<br>
<br>
>From man sbatch:<br>
<br>
INPUT ENVIRONMENT VARIABLES<br>
[...]<br>
    NOTE: Environment variables will override any options set in a batch<br>
    script, and command line options will override any environment<br>
    variables.<br>
<br>
-- <br>
Regards,<br>
Bjørn-Helge Mevik, dr. scient,<br>
Department for Research Computing, University of Oslo<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>