Quick Reference Guide: Difference between revisions

From Research Computing Center Wiki
Jump to navigation Jump to search
(Created page with "=Linux= Below are the minimum Linux commands and shortcuts that you should know to do work on an HPC cluster. ==Commands== <big>'''Directories'''</big> {| class="wikitable" !...")
 
No edit summary
Line 52: Line 52:
[[#top|Back to Top]]
[[#top|Back to Top]]
=Slurm=
=Slurm=
Below are the minimum Slurm commands that you should know to do work on an HPC cluster.
Below are the minimum Slurm commands that you should know to do work on an HPC cluster.  The first table are default Slurm commands.  The next table are GACRC pre-formatted wrapper scripts of the Slurm commands to provide more information and flexibility.  
<br />
<br />
<br />
<br />
'''Default Slurm Commands'''
{| class="wikitable"
{| class="wikitable"
! Command !! Description !! Examples
! Command !! Description !! Examples
Line 62: Line 63:
| <code>squeue</code> || Check status currently running jobs (--me for only your jobs) || <code>squeue --me</code>
| <code>squeue</code> || Check status currently running jobs (--me for only your jobs) || <code>squeue --me</code>
|-
|-
| <code>sacct</code> || Check status of your jobs started since midnight of current day (-X for one line per job)|| <code>sacct -X</code>
| <code>sacct -X</code> || Check status of your jobs started since midnight of current day (-X for one line per job)|| <code>sacct -X</code>
|-
|-
| <code>sacct -X -S yyyy-mm-dd</code> || Check status of your jobs since yyyy-mm-dd || <code>sacct -X -S 2021-10-20</code>
| <code>sacct -X -S yyyy-mm-dd</code> || Check status of your jobs since yyyy-mm-dd || <code>sacct -X -S 2021-10-20</code>
Line 69: Line 70:
|-
|-
| <code>scancel ''jobID'' || Cancel one of your running jobs || <code>scancel 456781</code>
| <code>scancel ''jobID'' || Cancel one of your running jobs || <code>scancel 456781</code>
|-
| <code>sinfo</code> || Check the status of partitions || <code>sinfo -p batch</code>
|-
|}
'''GACRC Slurm Commands'''
{| class="wikitable"
! Command !! Slurm Equivalent !! Examples
|-
| <code>interact</code> || Same as <code>qlogin</code> but with more flexibility || <code>interact -c 4 --mem 10gb --time 01:00:00</code>
|-
| <code>sq</code> || <code>squeue</code> || <code>sq --me</code>
|-
| <code>sacct-gacrc -X</code> || <code>sacct</code>|| <code>sacct-gacrc -X</code>
|-
|-
|}
|}

Revision as of 17:48, 12 October 2021

Linux

Below are the minimum Linux commands and shortcuts that you should know to do work on an HPC cluster.

Commands

Directories

Command Description Examples
ls List the contents of a particular directory (current dir if no path specified) ls /scratch/MyID
mkdir Make a new directory at the specified path mkdir /scratch/MyID/workdir
cd Change directory to a particular directory (personal /home dir if no path specified) cd /scratch/MyID
rmdir Remove an empty directory rmdir tmpdir

Files

Command Description Examples
nano Create or edit a file with nano(To save and exit: ctrl + x, y, enter) nano sub.sh
cat Print the contents of a file to the terminal (better for shorter files) cat slurm-42342.out
less View the contents of a file (better for longer files) less slurm-42342.out
cp Copy a file or files (cp sourcepath(s) destinationpath) cp /scratch/MyID/workdir/sub.sh /work/labgroup
rm Remove a file or files rm oldfile.txt
rm -r Remove a directory and all of its contents, recursively (starting with the last dir in the path) rm -r /home/MyID/olddir

Back to Top

Shortcuts

Shortcut Description
ctrl + l (lowercase L) Clear your terminal screen (scroll up to see previous output)
up/down arrow keys Cycle through previously entered commands
esc, . (escape, then period) Cycle through previous arguments to commands
ctrl + w Backspace typed text on the command line, one word at a time
ctrl + c Cancel typed text on the command line

Back to Top

Slurm

Below are the minimum Slurm commands that you should know to do work on an HPC cluster. The first table are default Slurm commands. The next table are GACRC pre-formatted wrapper scripts of the Slurm commands to provide more information and flexibility.

Default Slurm Commands

Command Description Examples
sbatch Submit a submission script to the cluster sbatch sub.sh
squeue Check status currently running jobs (--me for only your jobs) squeue --me
sacct -X Check status of your jobs started since midnight of current day (-X for one line per job) sacct -X
sacct -X -S yyyy-mm-dd Check status of your jobs since yyyy-mm-dd sacct -X -S 2021-10-20
sacct -j jobID Check status of a particular job sacct -j 234213
scancel jobID Cancel one of your running jobs scancel 456781
sinfo Check the status of partitions sinfo -p batch

GACRC Slurm Commands

Command Slurm Equivalent Examples
interact Same as qlogin but with more flexibility interact -c 4 --mem 10gb --time 01:00:00
sq squeue sq --me
sacct-gacrc -X sacct sacct-gacrc -X