From 32b82db7a3d82694bf44139e73fbd8f40c0d05f2 Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Fri, 19 Jul 2019 14:58:47 -0400 Subject: [PATCH] * slurm: Added custom sacct wrapper script which contains my preferences. --- slurm/sacct1.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 slurm/sacct1.sh diff --git a/slurm/sacct1.sh b/slurm/sacct1.sh new file mode 100755 index 0000000..d9ce71e --- /dev/null +++ b/slurm/sacct1.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# +# Frequently-used `sacct` commands with various presets. +# +# Created: 20190719 +# +# +# Preset 1: frequently sought information, such as job ID, username, +# num of cores, various time quantities. +# - The timing field width accommodates up to hundreds of days. +# - The accounting records corresponding to job steps are eliminated. + +FIELDS_PRESET1=JobID,JobIDRaw,JobName%-20,User,Partition,Elapsed%12,NCPUS%5,CPUTime%12,TotalCPU%12,Submit,Start,End + +filter_sacct_only_main_jobs () { + awk '($2 ~ /^[0-9]+$/) || (FNR <= 2) { print }' +} + +sacct -o $FIELDS_PRESET1 "$@" \ + | filter_sacct_only_main_jobs + + +