Skip to content

Instantly share code, notes, and snippets.

@lucaspar
Last active September 9, 2022 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucaspar/71169e5a321a16cb6c755882b8d6a4a6 to your computer and use it in GitHub Desktop.
Save lucaspar/71169e5a321a16cb6c755882b8d6a4a6 to your computer and use it in GitHub Desktop.
CRC commands
#!/usr/bin/env bash
# Helper program to list useful CRC commands
function get_pager_cmd() {
if command -v bat &>/dev/null; then
echo "bat -l bash"
else
echo cat
fi
}
pager_cmd=$(get_pager_cmd)
# echo "Pager: $pager_cmd"
echo -e "
Cheatsheet for CRC commands:
# --------------
# infrastructure
# show host group list
qconf -shgrpl
# show list of all user set lists
qconf -sul
# show list of all submission hosts
qconf -ss
# ---------------
# monitoring jobs
jobstats -d
htop -u \$USER
qstat -u \$USER
qstat -q gpu@@czajka
qstat -f
qhost -h qa-rtx6k-017.crc.nd.edu
# ------------------
# interactive shells
qrsh -q long -pe smp 1
qrsh -q long@d12chas407** -pe smp 1
qrsh -q gpu@@czajka -l gpu_card=1 -pe smp 1
qrsh -q gpu@qa-1080ti-002.crc.nd.edu -l gpu_card=0 -pe smp 1
qsh -q gpu@qa-1080ti-002.crc.nd.edu -l gpu_card=0 -S /bin/bash
# --------------------
# monitoring resources
resmon
# disk usage
spaceleft # user alias
quota
pan_df -H /scratch365/\$USER/
fs listquota -hu /afs/crc.nd.edu/group/cvrl/scratch_25/ | sort -k 4n
# nodes usage
free_nodes.sh -H
free_nodes.sh @czajka
nodesInUse.sh @cvrl_gpu
qstat -F -q gpu@@czajka | grep -i "gpu[@_]"
# sum of all gpus available in CVRL GPU queue or CRC GPU queue
qstat -F -q gpu@@cvrl_gpu | grep -i gpu_card= | cut -f 2 -d'=' | paste -sd+ | bc
qstat -F -q gpu@@crc_gpu | grep -i gpu_card= | cut -f 2 -d'=' | paste -sd+ | bc
# list all hosts in CVRL GPU queue or CRC GPU queue
qstat -F -q gpu@@cvrl_gpu | grep hostname=
qstat -F -q gpu@@crc_gpu | grep hostname=
# ---------------------------------------------------------------
# afs permissions (see afs groups below to manage multiple users)
fs la ~/public/datasets/bogus-dir
fs sa ~/public/datasets/bogus-dir <collaborator-net-id> rlw
fs sa ~/public/datasets/bogus-dir $USER:demogroup rlw
# a 'listing' (l) permission needs to be set for all parent directories
# for a user to access the target directory. Similarly, all existing
# descendent dirs need their permissions set as well recursively
# (e.g. find <parent> -type d -exec echo fs sa {} <net-id> rl \;).
# New directories have permissions inherited.
# Docs: https://docs.crc.nd.edu/infrastructure/user_acls.html
# ----------
# afs groups
pts listowned $USER
pts creategroup $USER:demogroup
pts membership $USER:demogroup
pts adduser <collaborator-net-id> $USER:demogroup
pts examine $USER:demogroup
" | $pager_cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment