<div dir="ltr">Also consider the --no-kill ("-k") options to sbatch (and srun.)<div>Following from the sbatch man page.<br><div>         -k, --no-kill [=off]<br>              Do  not  automatically  terminate  a job if one of the nodes it has been allocated fails.  The user will<br>              assume the responsibilities for fault-tolerance should a node fail.  When there is a node  failure,  any<br>              active  job  steps  (usually MPI jobs) on that node will almost certainly suffer a fatal error, but with<br>              --no-kill, the job allocation will not be revoked so the user may launch new job steps on the  remaining<br>              nodes in their allocation.<br><br>              Specify an optional argument of "off" disable the effect of the SBATCH_NO_KILL environment variable.</div><div><br></div><div>On-compute job-submission for these kinds of cases is (could be) your friend.<br></div><div><br></div><div>An explorer job may validate every node, compose the nodes that are appropriate for a given application, and then submit a subsequent job dependent upon the explorer job. This subsequent job could have an explicit node list (-w ...) or an exclude list (-x ...) or not. These are most useful for much larger and/or higher priority jobs, so they are running with a specific license, reservation or partition. Alternatively, the daughter jobs can be made dependent on the explorer job (--depend=afterok:<explorer-job-id>) or the nodes which aren't appropriate could have other actions initiated on them. (ex. sbatch --reboot -w <suspect-nodename> node-diagnostic-script.sh)<br><br><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 4, 2020 at 3:51 PM Rodrigo Santibáñez <<a href="mailto:rsantibanez.uchile@gmail.com">rsantibanez.uchile@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>What about instead of (automatic) requeue of the job, use --no-requeue in the first sbatch and when something went wrong with the job (why not something wrong with the node?) submit again with --no-requeue the job with the excluded nodes?</div><div><br></div><div>something as: sbatch --no-requeue file.sh, and then sbatch --no-requeue --exclude=n001file.sh (options in the command line overrides the options inside the script)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El jue., 4 jun. 2020 a las 17:40, Ransom, Geoffrey M. (<<a href="mailto:Geoffrey.Ransom@jhuapl.edu" target="_blank">Geoffrey.Ransom@jhuapl.edu</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Not quite.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The user’s job script in question is checking the error status of the program it ran while it is running. If a program fails the running job wants to exclude
 the machine it is currently running on and requeue itself in case it died due to a local machine issue that the scheduler has not flagged as a problem.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">The current goal is to have a running job step in an array job add the current host to its exclude list and requeue itself when it detects a problem. I can’t
 seem to modify the exclude list while a job is running, but once the task is requeued and back in the queue it is no longer running so it can’t modify its own exclude list.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I.e…. put something like the following into a sbatch script so each task can run it against itself.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">If ! $runprogram $args ; then<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">  NewExcNodeList=”$ ExcNodeList,$HOSTNAME”<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">  scontrol update job ${SLURM_JOB_ID} ExcNodeList=$NewExcNodeList<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">  scontrol requeue ${ SLURM_JOB_ID}<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">  sleep 10<u></u><u></u></span></p>
<p class="MsoNormal" style="margin-left:0.5in"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">fi<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> slurm-users <<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a>>
<b>On Behalf Of </b>Rodrigo Santibáñez<br>
<b>Sent:</b> Thursday, June 4, 2020 4:16 PM<br>
<b>To:</b> Slurm User Community List <<a href="mailto:slurm-users@lists.schedmd.com" target="_blank">slurm-users@lists.schedmd.com</a>><br>
<b>Subject:</b> [EXT] Re: [slurm-users] Change ExcNodeList on a running job<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div id="gmail-m_6028977275751254659gmail-m_-7433868415293233137APLWarningText">
<table cellspacing="0" cellpadding="0" border="0" align="left">
<tbody>
<tr>
<td style="width:100%;background:none 0% 0% repeat scroll rgb(224,224,224);padding:0in" width="100%">
<p class="MsoNormal">
<b><span style="color:red">APL external email warning: </span></b><span style="color:black">Verify sender
<a href="mailto:slurm-users-bounces@lists.schedmd.com" target="_blank">slurm-users-bounces@lists.schedmd.com</a> before clicking links or attachments</span><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
<p> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">Hello,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Jobs can be requeue if something wrong happens, and the node with failure excluded by the controller.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>--requeue</b><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">Specifies that the batch job should eligible to being requeue. The job may be requeued explicitly by a system administrator, after node failure, or upon preemption by a higher priority job. When a job is requeued,
 the batch script is initiated from its beginning. Also see the <b>--no-requeue</b> option. The
<i>JobRequeue</i> configuration parameter controls the default behavior on the cluster.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Also, jobs can be run selecting a specific node or excluding nodes<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>-w</b>, <b>--nodelist</b>=<<i>node name list</i>><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">Request a specific list of hosts. The job will contain
<i>all</i> of these hosts and possibly additional hosts as needed to satisfy resource requirements. The list may be specified as a comma-separated list of hosts, a range of hosts (host[1-5,7,...] for example), or a filename. The host list will be assumed to
 be a filename if it contains a "/" character. If you specify a minimum node or processor count larger than can be satisfied by the supplied host list, additional resources will be allocated on other nodes as needed. Duplicate node names in the list will be
 ignored. The order of the node names in the list is not important; the node names will be sorted by Slurm.
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><b>-x</b>, <b>--exclude</b>=<<i>node name list</i>><u></u><u></u></p>
<p class="MsoNormal" style="margin-left:0.5in">Explicitly exclude certain nodes from the resources granted to the job.
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">does this help?<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">El jue., 4 jun. 2020 a las 16:03, Ransom, Geoffrey M. (<<a href="mailto:Geoffrey.Ransom@jhuapl.edu" target="_blank">Geoffrey.Ransom@jhuapl.edu</a>>) escribió:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Hello<u></u><u></u></p>
<p class="MsoNormal">   We are moving from Univa(sge) to slurm and one of our users has jobs that if they detect a failure on the current machine they add that machine to their exclude list and requeue
 themselves. The user wants to emulate that behavior in slurm.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">It seems like “scontrol update job ${SLURM_JOB_ID} ExcNodeList $NEWExcNodeList” won’t work on a running job, but it does work on a job pending in the queue. This means the job can’t
 do this step and requeue itself to avoid running on the same host as before.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Our user wants his jobs to be able to exclude the current node and requeue itself.<u></u><u></u></p>
<p class="MsoNormal">Is there some way to accomplish this in slurm?<u></u><u></u></p>
<p class="MsoNormal">Is there a requeue counter of some sort so a job can see if it has requeued itself more than X times and give up?<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">Thanks.<u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div>
</blockquote></div>