Statistics
| Revision:

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

History | View | Annotate | Download (538 Bytes)

1
#!/bin/bash
2

    
3
EXE=Pi_Pthreads_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
    echo -e "Process $p" >> $LOGFILE
21
    echo -ne "Start $EXE with $ITERATIONS and $p : "
22
    i=1
23
    while [ $i -le $REPEAT ]
24
    do 
25
        echo -ne "$i "
26
        $TIME ./$EXE $ITERATIONS $p >> $LOGFILE 2>&1 
27
        i=$(($i+1))
28
    done
29
    echo
30
    p=$(($p+1))
31
done