-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbash_profile_gpatlas
More file actions
61 lines (57 loc) · 1.7 KB
/
bash_profile_gpatlas
File metadata and controls
61 lines (57 loc) · 1.7 KB
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
54
55
56
57
58
59
60
61
if [[ "$HOSTNAME" == gpatlas* ]]
then
echo "Atlas local setup for gpatlas*"
export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh
alias qme='qstat -u $USER'
# utils from ~cshimmin/.bash_profile
function qkill_all() {
if [ -z "$1" ]; then
lim=200
else
lim=$1
fi
# first kill the jobs which are queued
jobids="$(qstat -u $(whoami) | grep atlas | grep Q | tail -n $lim | cut -d' ' -f1)"
if [ ! -z "$jobids" ]; then
qdel $jobids
fi
# then kill any that are still running (squelch the usual error about 'all')
qdel all 2> /dev/null
}
function qhold_all() {
if [ -z "$1" ]; then
lim=100
else
lim=$1
fi
# first get jobs which are queued
jobids="$(qstat -u $(whoami) | grep atlas | grep Q | tail -n $lim | cut -d' ' -f1)"
if [ ! -z "$jobids" ]; then
qhold -h u $jobids
fi
}
function qrls_all() {
if [ -z "$1" ]; then
lim=100
else
lim=$1
fi
# first get jobs which are holding
jobids="$(qstat -u $(whoami) | grep atlas | grep H | tail -n $lim | cut -d' ' -f1)"
if [ ! -z "$jobids" ]; then
qrls -h u $jobids
fi
}
function cluster_run() {
local nodes="c-12-15 c-12-19 c-12-23 c-12-27 c-12-31 c-12-35 c-12-39"
for node in ${nodes}; do
echo "running on ${node}"
ssh $node $1
echo
done
}
function jobs_per_user() {
squeue | grep -v USER | awk 'NR > 1 {count[$4]++}END{for(j in count) print j," : "count[j]" jobs"}'
}
fi