# HG changeset patch # User alpar # Date 1090393400 0 # Node ID 75d36edc6bc4ad9636aa355ecd491dbbb0a04b07 # Parent 6874df3f61dbc0e0967f6e3310f53984a5080960 Ready to run the first test series. diff -r 6874df3f61db -r 75d36edc6bc4 src/benchmark/bench_tools.h --- a/src/benchmark/bench_tools.h Wed Jul 21 07:01:14 2004 +0000 +++ b/src/benchmark/bench_tools.h Wed Jul 21 07:03:20 2004 +0000 @@ -3,6 +3,9 @@ #define HUGO_BENCH_TEST_H #include +#include + +#include ///An experimental typedef factory #define GRAPH_TYPEDEF_FACTORY(Graph) \ @@ -23,6 +26,8 @@ ///A primitive primtest + +///\bug 2 is not a prime according to this function! bool isPrim(int n) { if(n%2) { @@ -69,5 +74,13 @@ } }; +inline void PrintTime(char *ID,hugo::Timer &T) +{ + hugo::TimeStamp S(T); + std::cout << ID << ' ' << S.getUserTime() << ' ' + << S.getSystemTime() << ' ' << S.getRealTime() << std::endl; +} + + #endif diff -r 6874df3f61db -r 75d36edc6bc4 src/benchmark/benchmark --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/benchmark/benchmark Wed Jul 21 07:03:20 2004 +0000 @@ -0,0 +1,29 @@ +#!/bin/bash + +function runtest () # prefix, prog, args +{ + echo $1 1>&2 + $2 $3 $4 $5 $6 $7 $8 $9|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 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" + diff -r 6874df3f61db -r 75d36edc6bc4 src/benchmark/graph-bench.cc --- a/src/benchmark/graph-bench.cc Wed Jul 21 07:01:14 2004 +0000 +++ b/src/benchmark/graph-bench.cc Wed Jul 21 07:03:20 2004 +0000 @@ -1,7 +1,5 @@ #include #include -#include -#include #include"bench_tools.h" @@ -28,7 +26,7 @@ //Edge equ[rat]; std::vector equ(rat); - unsigned long long int count; + long long int count; for(count=0;count(nextPrim(100),nextPrim(30000),nextPrim(150)); - std::cout << T << '\n'; + + PrintTime("SMALL",T); } diff -r 6874df3f61db -r 75d36edc6bc4 src/benchmark/hcube.cc --- a/src/benchmark/hcube.cc Wed Jul 21 07:01:14 2004 +0000 +++ b/src/benchmark/hcube.cc Wed Jul 21 07:03:20 2004 +0000 @@ -4,9 +4,7 @@ #include #include #include -#include -#include -//#include<../work/jacint/max_flow.h> +#include<../work/jacint/max_flow_no_stack.h> #include"bench_tools.h" using namespace std; @@ -23,7 +21,7 @@ for(int i=0;i>=1; + } + return s; +} + +inline int numOfZeros(int n,int dim) +{ + int s=dim; + for(int i=0;i>=1; + } + return s; +} + int main(int argc, char *argv[]) { // typedef ListGraph Graph; @@ -65,13 +83,15 @@ int dim=atoi(argv[1]); - cout << "Creating Hipercube ("<< (1< nodes; addBiDirHiperCube(G,dim,nodes); - cout << T; - cout << "\nGenerating the lengths: "; + + PrintTime("GENGRAPH",T); + T.reset(); Graph::EdgeMap map(G); { @@ -82,24 +102,30 @@ for(int i=0;i Dij(G,map); Dij.run(nodes[0]); } - cout << T; -// cout << "\nRunning MaxFlow: "; -// T.reset(); -// { -// Graph::EdgeMap flow(G); + PrintTime("DIJKSTRA",T); + + T.reset(); + { + Graph::EdgeMap flow(G); -// MaxFlow MF(G,nodes[0],nodes[1< MF(G,nodes[0],nodes[1<