Index: src/benchmark/bench_tools.h
===================================================================
--- src/benchmark/bench_tools.h	(revision 711)
+++ src/benchmark/bench_tools.h	(revision 718)
@@ -4,4 +4,7 @@
 
 #include<vector>
+#include<iostream>
+
+#include<hugo/time_measure.h>
 
 ///An experimental typedef factory
@@ -24,4 +27,6 @@
 
 ///A primitive primtest
+
+///\bug 2 is not a prime according to this function!
 bool isPrim(int n)
 {
@@ -70,4 +75,12 @@
 };
 
+inline void PrintTime(char *ID,hugo::Timer &T) 
+{
+  hugo::TimeStamp S(T);
+  std::cout << ID << ' ' << S.getUserTime() << ' '
+	    << S.getSystemTime() << ' ' << S.getRealTime() << std::endl;
+}
+
+  
 
 #endif
Index: src/benchmark/benchmark
===================================================================
--- src/benchmark/benchmark	(revision 718)
+++ src/benchmark/benchmark	(revision 718)
@@ -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"
+
Index: src/benchmark/graph-bench.cc
===================================================================
--- src/benchmark/graph-bench.cc	(revision 711)
+++ src/benchmark/graph-bench.cc	(revision 718)
@@ -1,6 +1,4 @@
 #include<math.h>
 #include<hugo/list_graph.h>
-#include<hugo/time_measure.h>
-#include<iostream>
 
 #include"bench_tools.h"
@@ -29,5 +27,5 @@
   std::vector<Edge> equ(rat);
   
-  unsigned long long int count;
+  long long int count;
   
   for(count=0;count<rat;count++) {
@@ -39,6 +37,8 @@
     equ[count%rat]=G.addEdge(nodes[(count*p)%n],nodes[(count*p/n)%n]);
   }
-  std::cout << "Added " << count
-	    << " ( " << n << "^2 * " << rat << " ) edges\n";
+//   std::cout << "Added " << count
+// 	    << " ( " << n << "^2 * " << rat << " ) edges\n";
+
+
   //  for(int i=0;1;i++) ;
 }
@@ -46,13 +46,11 @@
 int main()
 {
-  std::cout << "START: n="  << nextPrim(1000) << " rat="
-	    << nextPrim(300) << " p=" << nextPrim(100) << '\n';
   hugo::Timer T;
   makeFullGraph<ListGraph>(nextPrim(1000),nextPrim(300),nextPrim(100));
-  std::cout << T  << '\n';
-  std::cout << "START: n="  << nextPrim(1000) << " rat="
-	    << nextPrim(300) << " p=" << nextPrim(100) << '\n';
+  
+  PrintTime("BIG",T);
   T.reset();
   makeFullGraph<ListGraph>(nextPrim(100),nextPrim(30000),nextPrim(150));
-  std::cout << T  << '\n';
+
+  PrintTime("SMALL",T);
 }
Index: src/benchmark/hcube.cc
===================================================================
--- src/benchmark/hcube.cc	(revision 711)
+++ src/benchmark/hcube.cc	(revision 718)
@@ -5,7 +5,5 @@
 #include<hugo/smart_graph.h>
 #include<hugo/dijkstra.h>
-#include<hugo/time_measure.h>
-#include<iostream>
-//#include<../work/jacint/max_flow.h>
+#include<../work/jacint/max_flow_no_stack.h>
 #include"bench_tools.h"
 
@@ -24,5 +22,5 @@
   for(int i=0;i<bits[dim];i++) {
     nodes.push_back(G.addNode());
-    for(j=0;j<dim;j++) if(i&bits[j]) G.addEdge(nodes[i-bits[j]],nodes[i]);
+    for(int j=0;j<dim;j++) if(i&bits[j]) G.addEdge(nodes[i-bits[j]],nodes[i]);
   }
 }
@@ -47,4 +45,24 @@
 }
 
+inline int numOfOnes(int n,int dim)
+{
+  int s=0;
+  for(int i=0;i<dim;i++) {
+    s+=n%2;
+    n>>=1;
+  }
+  return s;
+}
+
+inline int numOfZeros(int n,int dim)
+{
+  int s=dim;
+  for(int i=0;i<dim;i++) {
+    s-=n&1;
+    n>>=1;
+  }
+  return s;
+}
+
 int main(int argc, char *argv[])
 {
@@ -66,11 +84,13 @@
   int dim=atoi(argv[1]);
   
-  cout << "Creating Hipercube ("<< (1<<dim) << " nodes, "
-       << dim*(1<<dim) << " edges):";
+//   cout << "Creating Hipercube ("<< (1<<dim) << " nodes, "
+//        << dim*(1<<dim) << " edges):";
 
+  T.reset();
   vector<Node> nodes;
   addBiDirHiperCube(G,dim,nodes);
-  cout << T;
-  cout << "\nGenerating the lengths: ";
+
+  PrintTime("GENGRAPH",T);
+
   T.reset();
   Graph::EdgeMap<int> map(G);
@@ -83,8 +103,14 @@
       //    map[Edge(((long long int)(i)*2987)%(dim*(1<<dim)))]=P();
       map[Edge(((long long int)(i)*93505)%(dim*(1<<dim)))]=P();
+  
+//     for(int i=0;i<(1<<dim);i++) {
+//       int mul= (1<<(numOfZeros(i,dim)/4));
+//       for(OutEdgeIt e(G,nodes[i]);G.valid(e);G.next(e))
+// 	map[e]*=mul;
+//     }
   }
   
-  cout << T;
-  cout << "\nRunning Dijkstra: ";
+  PrintTime("GENLENGTHS",T);
+
   T.reset();
   {
@@ -92,14 +118,14 @@
     Dij.run(nodes[0]);
   }
-  cout << T;
-//   cout << "\nRunning MaxFlow: ";
-//   T.reset();
-//   {
-//    Graph::EdgeMap<int> flow(G);
+  PrintTime("DIJKSTRA",T);
+
+  T.reset();
+  {
+   Graph::EdgeMap<int> flow(G);
    
-//     MaxFlow<Graph,int> MF(G,nodes[0],nodes[1<<dim-1],map,flow);
-//     MF.run(MF.NO_FLOW);
-//   }
-//   cout << T;
-  cout << "\n";
+    MaxFlowNoStack<Graph,int> MF(G,nodes[0],nodes[1<<dim-1],map,flow);
+    MF.run(MF.NO_FLOW);
+  }
+  PrintTime("PREFLOW",T);
+
 }
