This page will give you a list of the commonly used commands for SLURM. Although there are a few advanced ones in here, as you start making significant use of the cluster, you’ll find that these advanced ones are essential! Show
A good comparison of SLURM, LSF, PBS/Torque, and SGE commands can be found here. Also useful:
General commandsGet documentation on a command:
Try the following commands:
Submitting jobsThe following example script specifies a partition, time limit, memory allocation and number of cores. All your scripts should specify values for these four parameters. You can also set additional parameters as shown, such as jobname and output file. For This script performs a simple task — it generates of file of random numbers and then sorts it. A detailed explanation the script is available here.
Now you can submit your job with the command:
If you want to test your job and find out when your job is estimated to run use (note this does not actually submit the job):
Information on jobsList all current jobs for a user: List all running jobs for a user: List all pending jobs for a user: List priority order of jobs for the current user (you) in a given partition: List all current jobs in the shared partition for a user: List
detailed information for a job (useful for troubleshooting): List status info for a currently running job: Once your job has completed, you can get additional information that was not available during the run. This includes run time, memory used, etc. To view the same information for all jobs of a user: Controlling jobsTo cancel one job: To cancel all the jobs for a user: To cancel all the pending jobs for a user: To cancel one or more jobs by name: To hold a particular job from being scheduled: To release a particular job to be scheduled: To requeue (cancel and rerun) a particular job: Job arrays and useful commandsAs shown in the commands above, its easy to refer to one job by its Job ID, or to all your jobs via your username. What if you want to refer to a subset of your jobs? The answer is to submit your job set as a job array. Then you can use the job array ID to refer to the set when running SLURM commands. See the following excellent resources for further information: To cancel an indexed job in a job array: To find the original submit time for your job array Advanced (but useful!) commandsThe following commands work for individual jobs and for job arrays, and allow easy manipulation of large numbers of jobs. You can combine these commands with the parameters shown above to provide great flexibility and precision in job control. (Note that all of these commands are entered on one line) Suspend all running jobs for a user (takes into account job arrays): Resume all suspended jobs for a user: After resuming, check if any are still suspended: The following is useful if your group has its own queue and you want to quickly see utilization. Example for the smith partition:
Custom CommandsWe and users on the FASRC cluster have developed custom commands that also are deployed on the cluster for use. If you have a command you want to contribute please contact us. Below are the custom commands we have added.
Which of the following commands will show a list of process names along with their process ID PID?You need to use the ps command. It provides information about the currently running processes, including their process identification numbers (PIDs). Both Linux and UNIX support the ps command to display information about all running process. The ps command gives a snapshot of the current processes.
Which of the following commands can be used to remove a group from a Linux system?To delete a group from Linux, use the command groupdel. There is no option. If the group to be deleted is the initial group of one of the users, you can not delete the group. The files changed by the groupdel command are two files "/etc/group" and "/etc/gshadow".
Which of the following can be used to move a job to the background?Explanation: If we'd suspended a job using ctrl-Z then after that we can use the bg command to push the current foreground job to the background.
Which of the following commands will display the exit status of the last command used in the bash shell?To display the exit code for the last command you ran on the command line, use the following command: $ echo $?
|