#!/bin/bash function runtest () # prefix, prog, args { echo $1 1>&2 $2 $3 $4 $5 $6 $7 $8 $9 >/dev/null; for ((i=1;i<=3;i++)) do $2 $3 $4 $5 $6 $7 $8 $9; done | awk '{print "'$1'",$0}' } function runalltest() #postfix, CXX, CXXFLAGS { echo $1 1>&2 make clean >/dev/null make CXX="$2" CXXFLAGS="$3" >/dev/null { runtest HCUBE19 hcube 19 runtest BFS13-5000 hcube 13 5000 runtest BFS10-50000 hcube 10 50000 runtest GRBENCH graph-bench } | awk "{print \$0, \"$1\"}" } runalltest "gcc-3.3 -O2" g++ "-O2" runalltest "gcc-3.3 -O2-march=pentium-m" g++ "-O2 -march=pentium-m" runalltest "gcc-3.3 -O3" g++ "-O3" runalltest "gcc-3.3 -O3-march=pentium-m" g++ "-O3 -march=pentium-m" runalltest "gcc-3.4 -O2" g++-3.4 "-O2" runalltest "gcc-3.4 -O2-march=pentium-m" g++-3.4 "-O2 -march=pentium-m" runalltest "gcc-3.4 -O3" g++-3.4 "-O3" runalltest "gcc-3.4 -O3-march=pentium-m" g++-3.4 "-O3 -march=pentium-m" runalltest "icc -O2" icc "-O2" runalltest "icc -O2-march=pentium-m" icc "-O2 -march=pentium-m" runalltest "icc -O3" icc "-O3" runalltest "icc -O3-march=pentium-m" icc "-O3 -march=pentium-m"