quickstart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
quickstart [2023/09/13 15:56] – [Basic job submission] docuadminquickstart [2025/05/08 19:43] (current) docuadmin
Line 36: Line 36:
  
 A complete list of parameters that ''srun'' accepts is available in the [[https://slurm.schedmd.com/srun.html|manpage]] for ''srun''. A complete list of parameters that ''srun'' accepts is available in the [[https://slurm.schedmd.com/srun.html|manpage]] for ''srun''.
 +
 +====== Run an Interactive Job on a Compute Node ======
 +
 +Running an interactive job on a compute node is the preferred method of testing jobs and scripts. Doing so avoids running resource-intensive workloads on the master (or login) node.
 +To start a job with an interactive shell on a compute node you can use this command:
 +
 +    srun -N 1 -n 1 --pty /bin/bash
  
 ====== Basic job submission ====== ====== Basic job submission ======
Line 54: Line 61:
 The commands are now in a format that can be submitted to the scheduler to be run as a job on the cluster. But we also need to tell the scheduler what resources are needed. This information can be passed to SLURM directly in the ''srun'' command or it can be placed in the script itself. The commands are now in a format that can be submitted to the scheduler to be run as a job on the cluster. But we also need to tell the scheduler what resources are needed. This information can be passed to SLURM directly in the ''srun'' command or it can be placed in the script itself.
  
-The job can be submitted to the scheduler by adding flags to the ''srun'' command to request one node and one task per node:    +The job can be submitted to the scheduler by adding flags to the ''sbatch'' command to request one node and one task per node:    
  
-    $ srun -J SleepJob -N 1 --tasks-per-node=1 date.sub &+    $ sbatch -J SleepJob -N 1 --tasks-per-node=1 date.sub &
  
 To place the resource request in the script itself, we modify the script to include additional lines for SLURM: To place the resource request in the script itself, we modify the script to include additional lines for SLURM:
Line 71: Line 78:
     date     date
  
-Then the job is submitted with ''srun'':+Then the job is submitted with ''sbatch'':
  
-    $ srun date.sub &+    $ sbatch date.sub
    
 The ''srun'' command will return a number for your job, the JOBID.  Now that the job is in the queue, you can check the status of the job using the ''squeue'' command: The ''srun'' command will return a number for your job, the JOBID.  Now that the job is in the queue, you can check the status of the job using the ''squeue'' command:
Line 79: Line 86:
     $ squeue --job <JOBID>     $ squeue --job <JOBID>
 -or- -or-
-    $ squeue-n <Job name if specified upon submission>+    $ squeue -n <Job name if specified upon submission>