Skip to content

Instantly share code, notes, and snippets.

@prerakmody
Last active November 16, 2022 13:44
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prerakmody/f7e1b730dbf1da12a3c4b3b8a3571896 to your computer and use it in GitHub Desktop.
Save prerakmody/f7e1b730dbf1da12a3c4b3b8a3571896 to your computer and use it in GitHub Desktop.
SLURM Commands

Useful aliases

Add these aliases in your ~/.bashrc file. To use them, save the updated file and type . ~/.bashrc to reload the bash file

  1. View all running jobs
    • alias qq="watch -n 0.1 'squeue -u ppmody -o \"%.10i %.9P %.24j %.8u %.2t %.10M %.5D %R\" ; echo -e \"\n\" ; squeue -p LKEBgpu,highmemgpu,gpu --sort=\"N,-i\" -o \"%.10i %.9P %.12j %.8u %.2t %.10M %.5D %.16R %.3C %.7m %b\"; echo -e \"\n\"; sinfo -a' "
      
  2. View resources within the cluster
    • alias qqq="scontrol -o show nodes |grep -e \"lkeb\" -e \"gpu.ai\" -e \"gpu\"| awk '{ print \$1, \$4, \$5, \$9, \$23, \$24, \$25}'"
      
  3. GPU performance
    •  alias nvidia-perff="watch -n 0.1 nvidia-smi"
      
  4. GPU performance (with graphs)
    • Firstly, pip install nvitop
    • alias nvidia-perf="nvitop -m auto"
      
  5. Disk/ usage
    • alias diskusage='du -Sh | sort -rh | head -5'
      alias driveusage='df -ah .'
      
  6. Displaying conda env with username and hostname
    • e.g. "(hansegmentation) [ppmody@res-hpc-lo02]$"
    • export PS1="($CONDA_DEFAULT_ENV) [\u@\h]$ " 
      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment