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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
|
export LD_LIBRARY_PATH=$PWD/massivethreads/lib
: ${TIME:=/usr/bin/time}
: ${ncores:='1 2 4 8 16 24 32 40 48 56 64'}
times=10
fib_size=40
fib_cutoff=10
nqueen_size=14
nqueen_cutoff=7
mandelbrot_size=2048
mandelbrot_cutoff=16
cilksort_size=4194304
cilksort_cutoff=32
cilksortpair_size=1048576
cilksortpair_cutoff=32
param_fib='11 40 10'
param_nqueen='11 14 7'
param_mandelbrot='11 2048 16'
param_cilksort='11 4194304 32'
param_cilksortpair='11 1048576 32'
for bench in fib nqueen mandelbrot cilksort cilksortpair; do
eval "size=\$${bench}_size"
eval "cutoff=\$${bench}_cutoff"
param="$times $size $cutoff"
paramseq="$times $size $size"
if [ -x "${bench}/${bench}_c_seq" ]; then
for i in 1; do
echo -
echo " ncores: $i"
MYTH_NUM_WORKERS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_c_seq $paramseq 2>&1
done
fi
if [ -x "${bench}/${bench}_c_myth" ]; then
for i in $ncores; do
echo -
echo " ncores: $i"
MYTH_NUM_WORKERS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_c_myth $param 2>&1
done
fi
if [ -x "${bench}/${bench}_smlsharp_seq" ]; then
for i in 1; do
echo -
echo " ncores: $i"
MYTH_NUM_WORKERS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_smlsharp_seq $paramseq 2>&1
done
fi
if [ -x "${bench}/${bench}_smlsharp_myth" ]; then
for i in $ncores; do
echo -
echo " ncores: $i"
MYTH_NUM_WORKERS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_smlsharp_myth $param 2>&1
done
fi
if [ -x "${bench}/${bench}_ghc_par" ]; then
for i in 1; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_ghc_par +RTS -N$i -RTS $paramseq 2>&1
done
for i in $ncores; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_ghc_par +RTS -N$i -RTS $param 2>&1
done
fi
if [ -x "${bench}/${bench}_manticore_ptuple" ]; then
for i in 1; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_manticore_ptuple -p $i $paramseq 2>&1
done
for i in $ncores; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_manticore_ptuple -p $i $param 2>&1
done
fi
if [ -x "${bench}/${bench}_maple_par" ]; then
for i in 1; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_maple_par @mpl procs $i -- $paramseq 2>&1
done
for i in $ncores; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_maple_par @mpl procs $i set-affinity -- $param 2>&1
done
fi
if [ -x "${bench}/${bench}_go_ref" ]; then
for i in 1; do
echo -
echo " ncores: $i"
GOMAXPROCS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_go_ref $paramseq 2>&1
done
for i in $ncores; do
echo -
echo " ncores: $i"
GOMAXPROCS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_go_ref $param 2>&1
done
fi
if [ -x "${bench}/${bench}_go_value" ]; then
for i in 1; do
echo -
echo " ncores: $i"
GOMAXPROCS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_go_value $paramseq 2>&1
done
for i in $ncores; do
echo -
echo " ncores: $i"
GOMAXPROCS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
${bench}/${bench}_go_value $param 2>&1
done
fi
b=`echo "$bench" | perl -ne 'print ucfirst'`
if [ -f "${bench}/${b}JavaSeq.class" ]; then
for i in 1; do
echo -
echo " ncores: $i"
${TIME} -f ' real: %e\n maxrss: %M' \
java -classpath ${bench} ${b}JavaSeq $paramseq 2>&1
done
fi
b=`echo "$bench" | perl -ne 'print ucfirst'`
if [ -f "${bench}/${b}JavaForkJoin.class" ]; then
for i in $ncores; do
echo -
echo " ncores: $i"
NPROCS=$i \
${TIME} -f ' real: %e\n maxrss: %M' \
java -classpath ${bench} ${b}JavaForkJoin $param 2>&1
done
fi
done
|