-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
53 lines (43 loc) · 1.58 KB
/
.aliases
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
## Aliases and functions
# source: https://github.com/stas00/ml-engineering/blob/master/slurm/users.md
### list slurm jobs with long format with 50 characters showing for job names
# list all Slurm jobs on cluster
alias sjobs='squeue -o "%.18i %9P %26j %.8T %.10M %.8l %.6D %.20S %R'
# list my jobs
alias myjobs='squeue --me -o "%.18i %9P %26j %.8T %.10M %.8l %.6D %.20S %R"'
# list my pending jobs
alias myjobs-pending='squeue --me --start'
# list states of partitions and their nodes
alias partitions='sinfo -o "%.7P %.5a %.16F"'
### recursively touch all files in the personal and common $SCRATCH spaces
function touch-all-files-in-scratch () {
dirs=("$ALL_CCFRSCRATCH" "$SCRATCH")
for dir in "${dirs[@]}"
do
# recursively touch files ('-a' option is to update access time only)
find "${dir}" -type f -print0 | xargs -0 touch -a
done
}
function sbatch-v100() {
sbatch --account="${SLURM_ACCOUNT}@v100" --mail-user="${SLURM_MAIL_USER}" "$@"
}
function sbatch-a100() {
sbatch --account="${SLURM_ACCOUNT}@a100" --mail-user="${SLURM_MAIL_USER}" "$@"
}
function wandb_sync_offline_runs() {
root_dir="$1"
find $root_dir -type d -name 'offline-run*' -print0 | xargs -0 ls -td | xargs -t -L 1 wandb sync --mark-synced
}
function wandb_parallel_sync_offline_runs() {
root_dir="$1"
find $root_dir -type d -name 'offline-run*' -print0 | xargs -0 ls -td | xargs -t -L 1 --max-procs 10 wandb sync --mark-synced --no-include-synced
}
function wandb_csync_offline_runs {
root_dir="$1"
while :
do
wandb_sync_offline_runs $root_dir
sleep 5m
done
}