-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathq
More file actions
68 lines (66 loc) · 1.85 KB
/
q
File metadata and controls
68 lines (66 loc) · 1.85 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
62
63
64
65
66
67
68
#!/bin/bash
#========================================
# Script to submit job in Intel devcloud
#
# Version: 0.5
#========================================
if [[ -z "${TARGET_NODE}" ]]; then
properties=("ats" "icx" "clx" "skx" "cfl" "xe_hp" "dg1" "gpu" )
else
properties=("${TARGET_NODE}" "ats" "icx" "clx" "skx" "cfl" "xe_hp" "dg1" "gpu" )
fi
avail_1=$(pbsnodes | grep properties | sort | cut -d',' -f7 | uniq)
avail_2=$(pbsnodes | grep properties | sort | cut -d',' -f2 | uniq)
for value in "${properties[@]}"
do
for avail in $avail_1
do
if [ "$avail" == "$value" ]; then
property="$value"
break 2
fi
done
for avail in $avail_2
do
if [ "$avail" == "$value" ]; then
property="$value"
break 2
fi
done
done
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
echo "Users could know available nodes by : ./q -h"
elif [ "$1" == "-h" ];then
echo "Available Nodes:"
echo $avail_2 $avail_1
echo "users could select a prefer worker node by : export a value to TARGET_NODE. ex: export TARGET_NODE=icx"
echo "=== Status of submitted task ==="
qstat
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
echo "submit $1 to $property node"
script=$1
rm *.sh.* > /dev/null 2>&1
#qsub
echo "Submitting job:"
qsub -l nodes=1:$property:ppn=2 -d . $script
# qsub -q batch@v-qsvr-nda-l nodes=ppn=2 -I
# pbsnodes
#qstat
qstat
#wait for output file to be generated and display
echo -ne "Waiting for Output."
until [ -f $script.o* ]; do
sleep 1
echo -ne "."
((timeout++))
if [ $timeout == 60 ]; then
echo "TimeOut 60 seconds: Job is still queued for execution, check for output file later (*.sh.o)"
break
fi
done
cat $script.o*
cat $script.e*
fi