<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">About the last point. In the case of <b>sbatch</b> the jobs wait in the queue as long as it takes until the resources are available. In the case of interactive jobs (at least using Son of Grid Engine) they fail after a short time if no resources available. <br><br><div dir="ltr">Sent from my iPhone</div><div dir="ltr"><br><blockquote type="cite">On Jul 4, 2023, at 9:11 AM, Loris Bennett <loris.bennett@fu-berlin.de> wrote:<br><br></blockquote></div><blockquote type="cite"><div dir="ltr"><span>Mike Mikailov <mmikailov@gmail.com> writes:</span><br><span></span><br><blockquote type="cite"><span>They should not affect the task performance.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>May be the cluster configuration allocated slow machines for salloc. </span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>salloc and sbatch have different purposes:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>* salloc 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</span><br></blockquote><blockquote type="cite"><span> resources.</span><br></blockquote><blockquote type="cite"><span>* sbatch 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</span><br></blockquote><blockquote type="cite"><span> resources.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>In general, salloc is used for jobs that need to be run interactively, such as jobs that require a shell or jobs that need to be debugged. sbatch is used</span><br></blockquote><blockquote type="cite"><span>for jobs that can be run in the background, such as long-running jobs or jobs that are submitted by a queuing system.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Here is a table that summarizes the key differences between salloc and sbatch:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> Feature salloc sbatch </span><br></blockquote><blockquote type="cite"><span> Purpose Allocate resources and run a command or script Submit a batch script </span><br></blockquote><blockquote type="cite"><span> Interactive Yes No </span><br></blockquote><blockquote type="cite"><span> Background No Yes </span><br></blockquote><blockquote type="cite"><span> Queuing system No Yes </span><br></blockquote><span></span><br><span>I am not sure what you mean with the last point, since 'salloc' is also</span><br><span>handled by the queueing system. If the resources requested are</span><br><span>currently not available, 'salloc' will wait until they are.</span><br><span></span><br><span>Cheers,</span><br><span></span><br><span>Loris</span><br><span></span><br><blockquote type="cite"><span>Here are some examples of how to use salloc and sbatch:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>* To allocate 2 nodes with 4 CPUs each and run the command ls, you would use the following command:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Code snippet</span><br></blockquote><blockquote type="cite"><span>salloc -N 2 -c 4 ls</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>* To submit a batch script called my_job.sh that contains the command python my_script.py, you would use the following command:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Code snippet</span><br></blockquote><blockquote type="cite"><span>sbatch my_job.sh</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>For more information on salloc and sbatch, please see the following documentation:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>* salloc documentation: https://slurm.schedmd.com/salloc.html</span><br></blockquote><blockquote type="cite"><span>* sbatch documentation: https://slurm.schedmd.com/sbatch.html</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span>Sent from my iPhone</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> On Jul 4, 2023, at 8:22 AM, Татьяна Озерова <tanyaozerova1318@gmail.com> wrote:</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><blockquote type="cite"><span> 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</span><br></blockquote><blockquote type="cite"><span> am concerned, the commands are similar: they allocate resources for counting users tasks and run them. However, I have received different</span><br></blockquote><blockquote type="cite"><span> 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</span><br></blockquote><blockquote type="cite"><span> between these two commands, that can affect on task performance? Thank you beforehand.</span><br></blockquote><blockquote type="cite"><span></span><br></blockquote><span>-- </span><br><span>Dr. Loris Bennett (Herr/Mr)</span><br><span>ZEDAT, Freie Universität Berlin</span><br><span></span><br></div></blockquote></body></html>