forked from FrontISTR/SpMVBenchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·39 lines (31 loc) · 960 Bytes
/
run.sh
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
#!/bin/bash
NCPU=`grep physical.id /proc/cpuinfo | sort -u | wc -l`
VCORE=`grep processor /proc/cpuinfo | wc -l`
RCORE=`cat /proc/cpuinfo | grep -P '^(physical|core) id\s*:' | paste - - | sort -u | wc -l`
CPUNAME=`cat /proc/cpuinfo |grep "model name"|head -n 1 | cut -d ':' -f 2`
CPUNAME=`cat /proc/cpuinfo |grep "model name"|head -n 1 | cut -d ':' -f 2`
CACHESIZE=`cat /proc/cpuinfo |grep "cache size"|head -n 1 | cut -d ':' -f 2`
NCOL=$1
echo $CPUNAME
echo $CACHESIZE
echo "NCOL: $NCOL"
echo "VectorLength: "$(( 9*$NCOL*$NCOL*$NCOL ))
echo "Vectorsize: "$(( 8*9*$NCOL*$NCOL*$NCOL/1024 ))"kB"
echo "Cores, GFLOPS"
function do_test () {
export OMP_NUM_THREADS=$1
echo -n "$1",
time1=`./spmv33 $NCOL | grep "GFLOP"|awk '{print $2}'`
echo $time1
}
for i in `seq 1 $RCORE`; do
OMP=$i
do_test $OMP
done
#for i in `seq 1 10`; do
# OMP=$(( $i*$RCORE / 10 ))
# if [ $OMP -le 4 ] ; then
# continue
# fi
# do_test $OMP
#done