<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p><br>
</p>
<p>It seems to me, if you are using srun directly to get an
interactive shell, you can just run the script once you get your
shell.</p>
<p><br>
</p>
<p>You can set the variables and then run srun. It automatically
exports the environment.</p>
<p>If you want to change a particular one (or more), use something
like --export=ALL,MYVAR=othervalue</p>
<p>do 'man srun' and look at the --export option<br>
</p>
<p><br>
</p>
<p>Brian Andrus<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 3/3/2021 9:28 PM, Chin,David wrote:<br>
</div>
<blockquote type="cite"
cite="mid:BN7PR01MB385812CFF437B78493E0F3E2D6979@BN7PR01MB3858.prod.exchangelabs.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<div style="font-family: "Courier New", monospace;
font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;"><a class="moz-txt-link-abbreviated" href="mailto:ahmet.mercan@uhem.itu.edu.tr">ahmet.mercan@uhem.itu.edu.tr</a>
wrote:</span></div>
<div style="font-family: "Courier New", monospace;
font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;">> </span><span
style="font-family: "Courier New", monospace;
font-size: 14.6667px; background-color: rgb(255, 255, 255);
display: inline !important;">Prolog and TaskProlog are
different parameters and scripts. You should</span><br>
<span style="font-family: "Courier New", monospace;
font-size: 14.6667px; background-color: rgb(255, 255, 255);
display: inline !important;">> use the TaskProlog script to
set env. variables.</span></div>
<div style="font-family: "Courier New", monospace;
font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: "Courier New", monospace;
font-size: 14.6667px; background-color: rgb(255, 255, 255);
display: inline !important;"><br>
</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">Can
you tell me how to do this for srun? E.g. users request an
interactive shell:</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;"><br>
</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">
srun -n 1 -t 600 --pty /bin/bash</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;"><br>
</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">but
the shell on the compute node does not have the env variables
set.</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;"><br>
</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">I use
the same prolog script as TaskProlog, which sets it properly
for jobs submitted</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">with
sbatch.</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;"><br>
</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">Thanks
in advance,</span></div>
<div style="font-family: "Courier New", monospace;
color: rgb(0, 0, 0);"><span style="font-size: 14.6667px;">
Dave Chin</span></div>
<div>
<div style="font-family: "Courier New", monospace;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" dir="ltr"
style="font-size:12pt; color:#000000; font-family:'Courier
New',monospace">
<div class="BodyFragment"><font size="2"><span
style="font-size:10pt">
<div class="PlainText"
style="font-family:"Courier
New",monospace; font-size:13.3333px">
</div>
<span id="ms-rterangepaste-start"></span>
<div>--</div>
<div>
<div>David Chin, PhD (he/him) Sr. SysAdmin,
URCF, Drexel</div>
<div><a class="moz-txt-link-abbreviated" href="mailto:dwc62@drexel.edu">dwc62@drexel.edu</a>
215.571.4335 (o)</div>
<div>For URCF support: <a class="moz-txt-link-abbreviated" href="mailto:urcf-support@drexel.edu">urcf-support@drexel.edu</a></div>
<div><a class="moz-txt-link-freetext" href="https://proteusmaster.urcf.drexel.edu/urcfwiki">https://proteusmaster.urcf.drexel.edu/urcfwiki</a></div>
<div>github:prehensilecode</div>
</div>
<span id="ms-rterangepaste-end"></span>
<div class="PlainText"><br>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
<div style="font-family:"Courier New",monospace;
font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
slurm-users <a class="moz-txt-link-rfc2396E" href="mailto:slurm-users-bounces@lists.schedmd.com"><slurm-users-bounces@lists.schedmd.com></a> on
behalf of mercan <a class="moz-txt-link-rfc2396E" href="mailto:ahmet.mercan@uhem.itu.edu.tr"><ahmet.mercan@uhem.itu.edu.tr></a><br>
<b>Sent:</b> Friday, February 12, 2021 16:27<br>
<b>To:</b> Slurm User Community List
<a class="moz-txt-link-rfc2396E" href="mailto:slurm-users@lists.schedmd.com"><slurm-users@lists.schedmd.com></a>; Herc Silverstein
<a class="moz-txt-link-rfc2396E" href="mailto:herc.silverstein@schrodinger.com"><herc.silverstein@schrodinger.com></a>;
<a class="moz-txt-link-abbreviated" href="mailto:slurm-users@schedmd.com">slurm-users@schedmd.com</a> <a class="moz-txt-link-rfc2396E" href="mailto:slurm-users@schedmd.com"><slurm-users@schedmd.com></a><br>
<b>Subject:</b> Re: [slurm-users] prolog not passing env var
to job</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span
style="font-size:11pt">
<div class="PlainText">External.<br>
<br>
Hi;<br>
<br>
Prolog and TaskProlog are different parameters and
scripts. You should<br>
use the TaskProlog script to set env. variables.<br>
<br>
Regards;<br>
<br>
Ahmet M.<br>
<br>
<br>
</div>
</span></font></div>
<br>
<p
style="font-family:Calibri;font-size:10pt;color:#000000;margin:5pt;"
align="Left">
Drexel Internal Data<br>
</p>
</blockquote>
</body>
</html>