File: run.sh

package info (click to toggle)
libxsmm 1.17-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 14,976 kB
  • sloc: ansic: 119,587; cpp: 27,680; fortran: 9,179; sh: 5,765; makefile: 5,040; pascal: 2,312; python: 1,812; f90: 1,773
file content (61 lines) | stat: -rwxr-xr-x 1,736 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash

N=${1:-160}
C=${2:-1024}
K=${3:-1024}
spar=${4:-0.9}
rep=${5:-30}
echo "N        = " $N
echo "C        = " $C
echo "K        = " $K
echo "Sparsity = " $spar
echo "Repeats  = " $rep
fwd_max_perf=0
upd_max_perf=0
#for NB in 16 32 80 160 320
for NB in 160 320
do
  #for nb in 16 32 80 160 320
  for nb in 16 32
  do
    if [[ "$nb" -gt "$NB" ]]; then
      continue
    fi
    if [[ "$nb" == "32" && "$NB" == "80"  ]]; then
      continue
    fi
    #for KB in 8 16 32 64 128
    for KB in 128
    do
      #for CB in 8 16 32 64 128
      for CB in 64 128
      do
        echo "NB =" $NB ", nb =" $nb ", CB =" $CB ", KB =" $KB
        KMP_AFFINITY=compact,granularity=fine,1,28 OMP_NUM_THREADS=28 srun ./parallel_sparse_weight_B_mult $N $C $K $NB $CB $KB $nb $spar $rep 2>&1 1>tmp
        if [ $? -eq 0 ]
        then
          fwd_perf=$(grep "GFLOPS " tmp | awk -F " " '{print $1}')
          fwd_perf=${fwd_perf%.*}
          echo "  FWD_PERF =" $fwd_perf
          fwd_max_perf=$(( fwd_perf > fwd_max_perf ? fwd_perf : fwd_max_perf ))
        else
          echo "  FWD Fail"
        fi
        rm -f tmp
        KMP_AFFINITY=compact,granularity=fine,1,28 OMP_NUM_THREADS=28 srun ./parallel_sparse_weight_C_redmult $N $C $K $NB $CB $KB $nb $spar $rep 2>&1 1>tmp
        if [ $? -eq 0 ]
        then
          upd_perf=$(grep "GFLOPS " tmp | awk -F " " '{print $1}')
          upd_perf=${upd_perf%.*}
          echo "  UPD_PERF =" $upd_perf
          upd_max_perf=$(( upd_perf > upd_max_perf ? upd_perf : upd_max_perf ))
        else
          echo "  UPD Fail"
        fi
        rm -f tmp
      done
    done
  done
done
echo "FWD_MAX_PERF ="  $fwd_max_perf "GFLOPS"
echo "UPD_MAX_PERF ="  $upd_max_perf "GFLOPS"