Skip to content

Instantly share code, notes, and snippets.

@Jingnan-Jia
Last active June 9, 2022 13:52
Show Gist options
  • Save Jingnan-Jia/446cbf578796c4096aa4b1d9044d3bda to your computer and use it in GitHub Desktop.
Save Jingnan-Jia/446cbf578796c4096aa4b1d9044d3bda to your computer and use it in GitHub Desktop.
##############################
# Frequently used commands
##############################
squeue
squeue -u [username]
squeue --me
sinfo
scancel [jobid]
scontrol show job [jobid]
srun --pty bash --x11 [more_args]
sbatch [bash_script.sh]
###############
# SINFO aliases
###############
# Detailed sinfo
alias si="sinfo -o '%8P %10n %.11T %.4c %.8z %.6m %.8e %20G %10l %10L %10O %20E' -S '-P'"
# sinfo only on GPU partition
alias sig="si -p gpu,LKEBgpu"
# sinfo only on CPU partition
alias sic="si -p cpu"
###############
# SQUEUE aliases
###############
alias qq="watch -n 0.1 'squeue -u jjia -o \"%.10i %.9P %.24j %.8u %.2t %.10M %.5D %10O %R\" ; echo -e \"\n\" ; squeue -p LKEBgpu,highmemgpu,gpu --sort=\"N,-i\" -o \"%.10i %.9P %.12j %.8u %.2t %.10M %.5D %.16R %.3C %.7m %10O %b\"; echo -e \"\n\"; sinfo -a' "
###############
# SCONTROL aliases
###############
alias qqq="scontrol -o show nodes | grep -e \"lkeb\" -e \"gpu.ai\" -e \"gpu\"| awk '{ print \$1, \$4, \$5, \$9, \$23, \$24, \$25, \$38}'"
alias qqq="scontrol -o show nodes | grep -e "lkeb" -e "gpu"| awk 'BEGIN {print "NodeName CPUAlloc CPUTot Gres RealMem AllocMem FreeMem AllocTres"} { printf("%-15s%-9s%-7s%-18s%-11s%-9s%-8s%s\n", substr($1, 10), substr($4, 10), substr($5, 8), substr($9, 6), substr(substr($23, 12)/1024,0,4), substr(substr($24, 10)/1024,0,4), substr(substr($25, 9)/1024, 0, 4), substr($38, 11))}'"
###############
# NVIDIA aliases
###############
alias nvperf="nvitop -m auto"
alias wn="watch nvidia-smi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment