-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetTimeMvapich2.sh
More file actions
executable file
·35 lines (32 loc) · 935 Bytes
/
getTimeMvapich2.sh
File metadata and controls
executable file
·35 lines (32 loc) · 935 Bytes
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
#!/bin/bash -e
threadWorkComm() {
affinity=$1
workers=$2
echo "mic0:1" > ./hostsThreadWorkComm
echo "export MV2_ENABLE_AFFINITY=0" > ./threadWorkCommMvapich2.sh
echo "$PWD/threadWorkComm.${affinity} $workers" >> ./threadWorkCommMvapich2.sh
chmod +x ./threadWorkCommMvapich2.sh
echo "-n 1 : $PWD/threadWorkCommMvapich2.sh " > ./configThreadWorkComm
mpirun_rsh \
-config ./configThreadWorkComm \
-hostfile ./hostsThreadWorkComm &>> work${workers}.log
}
getAvg() {
t=$(awk '/realTime/ {sum+=$2; cnt+=1;} END {print sum/cnt}' work${1}.log)
echo -n ", $t "
}
declare -a fns
fns[1]="threadWorkComm"
for fnIdx in "${!fns[@]}"; do
for affinity in 1 2 4; do
echo -n "${fns[$fnIdx]}, $affinity"
for workers in 2 4 8 16 32; do
cat /dev/null > work${workers}.log
for j in {0..4}; do
${fns[$fnIdx]} $affinity $workers
done
getAvg $workers
done
echo ""
done
done