<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">They should not affect the task performance.<div><br></div><div>May be the cluster configuration allocated slow machines for <b>salloc</b>. </div><div><br></div><div><div _ngcontent-ng-c786175101="" class="markdown markdown-main-panel" dir="ltr" style="-webkit-text-size-adjust: auto;"><p><strong>salloc</strong> and <strong>sbatch</strong> have different purposes:</p><ul><li><strong>salloc</strong> is used to allocate a set of resources to a job. Once the resources have been allocated, the user can run a command or script on the allocated resources.</li><li><strong>sbatch</strong> is used to submit a batch script to Slurm. The batch script contains a list of commands or scripts that will be executed on the allocated resources.</li></ul><p>In general, <strong>salloc</strong> is used for jobs that need to be run interactively, such as jobs that require a shell or jobs that need to be debugged. <strong>sbatch</strong> is used for jobs that can be run in the background, such as long-running jobs or jobs that are submitted by a queuing system.</p><p>Here is a table that summarizes the key differences between salloc and sbatch:</p><div class="horizontal-scroll-wrapper"><div class="table-block-component"><table-block _nghost-ng-c4209835526="" ng-version="0.0.0-PLACEHOLDER"><div _ngcontent-ng-c4209835526="" class="table-block"><div _ngcontent-ng-c4209835526="" class="table-content"><table><tbody><tr><th>Feature</th><th>salloc</th><th>sbatch</th></tr><tr><td>Purpose</td><td>Allocate resources and run a command or script</td><td>Submit a batch script</td></tr><tr><td>Interactive</td><td>Yes</td><td>No</td></tr><tr><td>Background</td><td>No</td><td>Yes</td></tr><tr><td>Queuing system</td><td>No</td><td>Yes</td></tr></tbody></table></div></div></table-block></div></div><p>Here are some examples of how to use salloc and sbatch:</p><ul><li>To allocate 2 nodes with 4 CPUs each and run the command <code>ls</code>, you would use the following command:</li></ul><code-block _nghost-ng-c2461525115="" ng-version="0.0.0-PLACEHOLDER"><div _ngcontent-ng-c2461525115="" class="code-block"><div _ngcontent-ng-c2461525115="" class="code-block-decoration header gmat-subhead-2 ng-star-inserted">Code snippet</div><pre _ngcontent-ng-c2461525115=""><code _ngcontent-ng-c2461525115="" role="text" class="code-container">salloc -N 2 -c 4 ls
</code></pre></div></code-block><ul><li>To submit a batch script called <code>my_job.sh</code> that contains the command <code>python my_script.py</code>, you would use the following command:</li></ul><code-block _nghost-ng-c2461525115="" ng-version="0.0.0-PLACEHOLDER"><div _ngcontent-ng-c2461525115="" class="code-block"><div _ngcontent-ng-c2461525115="" class="code-block-decoration header gmat-subhead-2 ng-star-inserted">Code snippet</div><pre _ngcontent-ng-c2461525115=""><code _ngcontent-ng-c2461525115="" role="text" class="code-container">sbatch my_job.sh
</code></pre></div></code-block><p>For more information on salloc and sbatch, please see the following documentation:</p><ul><li>salloc documentation: https://slurm.schedmd.com/salloc.html</li><li>sbatch documentation: https://slurm.schedmd.com/sbatch.html</li></ul></div></div><div><br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On Jul 4, 2023, at 8:22 AM, Татьяна Озерова <tanyaozerova1318@gmail.com> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hello! I have question about way of launching tasks in Slurm. I use the service in cloud and submit an application with sbatch or salloc. As far as I am concerned, the commands are similar: they allocate resources for counting users tasks and run them. However, I have received different results in cluster performance for the same task (task execution time is too long in case of salloc). So my question is what is the difference between these two commands, that can affect on task performance? Thank you beforehand.<br></div>
</div></blockquote></div></body></html>