-
Notifications
You must be signed in to change notification settings - Fork 743
Expand file tree
/
Copy pathq
More file actions
executable file
·57 lines (55 loc) · 1.31 KB
/
q
File metadata and controls
executable file
·57 lines (55 loc) · 1.31 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
#!/bin/bash
#========================================
# Script to submit job in Intel devcloud
#
# Version: 0.5
#========================================
properties=("xe_hp" "dg1" "skx" "clx" "gpu")
avail_1=$(pbsnodes | grep properties | sort | cut -d',' -f6 | 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
echo $property
if [ -z "$1" ]; then
echo "Missing script argument, Usage: ./q run.sh"
elif [ ! -f "$1" ]; then
echo "File $1 does not exist"
else
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