-
Notifications
You must be signed in to change notification settings - Fork 4
/
gather_hardware_info
executable file
·55 lines (50 loc) · 1.68 KB
/
gather_hardware_info
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
maxtime=360 #max time in seconds after nodetest script is interrupted
read -e -p "Enter the walltime in minutes for getting info about compute nodes HW (enter to accept default):" -i "6" walltime
echo "Gathering info about hardware. Please wait, this may take up to $walltime minutes."
active_partition=`cat active_partition`
partition=`cat cpu_partition`
if [ $active_partition == $partition ]
then
SECONDS=0
timeout ${maxtime}s $vini_dir/get_node_info ${partition} ${walltime}
elapsed_time=$SECONDS
if [ $elapsed_time -ge $maxtime ]
then
echo "unable to get hardware info on compute nodes"
rm -f $WORKDIR/gather_hardware_info
scancel -u $USER
else
> $WORKDIR/gather_hardware_info
fi
fi
partition=`cat gpu_partition`
if [ $active_partition == $partition ]
then
SECONDS=0
timeout ${maxtime}s $vini_dir/get_node_info ${partition} ${walltime}
elapsed_time=$SECONDS
if [ $elapsed_time -ge $maxtime ]
then
echo "unable to get hardware info on compute nodes"
rm -f $WORKDIR/gather_hardware_info
scancel -u $USER
else
> $WORKDIR/gather_hardware_info
fi
fi
partition=`cat longcpu_partition`
if [ $active_partition == $partition ]
then
SECONDS=0
timeout ${maxtime}s $vini_dir/get_node_info ${partition} ${walltime}
elapsed_time=$SECONDS
if [ $elapsed_time -ge $maxtime ]
then
echo "unable to get hardware info on large memory nodes" #putting first unavailable large memory node on the list
rm -f $WORKDIR/gather_hardware_info
scancel -u $USER
else
> $WORKDIR/gather_hardware_info
fi
fi
rm -f ${partition}_cores ${partition}_memsize