Statistics
| Revision:

root / Pi / C / OpenMP / bench.sh @ 39

History | View | Annotate | Download (566 Bytes)

1
#!/bin/bash
2

    
3
EXE=Pi_OpenMP_LONG
4
ITERATIONS=10000000000
5
TIME=time
6

    
7
REPEAT=10
8
PROCESS=16
9

    
10
[ ! $1 == '' ] && EXE=$1
11
[ ! $2 == '' ] && ITERATIONS=$2
12
[ ! $3 == '' ] && PROCESS=$3
13

    
14
LOGFILE=${EXE}_${HOSTNAME}_${ITERATIONS}.log
15

    
16
> $LOGFILE
17
p=1
18
while [ $p -le $PROCESS ]
19
do
20
    export OMP_NUM_THREADS=$p
21
    echo -e "Process $p" >> $LOGFILE
22
    echo -ne "Start $EXE with $ITERATIONS and $p : "
23
    i=1
24
    while [ $i -le $REPEAT ]
25
    do 
26
        echo -ne "$i "
27
        $TIME ./$EXE $ITERATIONS $p >> $LOGFILE 2>&1 
28
        i=$(($i+1))
29
    done
30
    echo
31
    p=$(($p+1))
32
done