Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/BenchmarkView.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/BenchmarkView.cs	(revision 6947)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks.Views/3.3/BenchmarkView.cs	(revision 6948)
@@ -26,12 +26,9 @@
 namespace HeuristicLab.Algorithms.Benchmarks.Views {
   [View("Benchmark View")]
-  [Content(typeof(Whetstone), true)]
-  [Content(typeof(Dhrystone), true)]
-  [Content(typeof(Linpack), true)]
+  [Content(typeof(Benchmark), true)]
   public partial class BenchmarkView : AlgorithmView {
     public BenchmarkView() {
       InitializeComponent();
       tabControl.TabPages.Remove(this.problemTabPage);
-      tabControl.TabPages.Remove(this.parametersTabPage);
     }
   }
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Benchmark.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Benchmark.cs	(revision 6947)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Benchmark.cs	(revision 6948)
@@ -31,5 +31,7 @@
 using HeuristicLab.Data;
 using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 
 namespace HeuristicLab.Algorithms.Benchmarks {
@@ -37,9 +39,24 @@
   /// A base class for benchmarks.
   /// </summary>
-  [Item("Benchmark", "A base class for benchmarks.")]
+  [Item("Benchmark", "A wrapper for benchmark algorithms.")]
+  [Creatable("Benchmarks")]
   [StorableClass]
-  public abstract class Benchmark : IAlgorithm {
-
+  public class Benchmark : IAlgorithm {
+    private Random random = new Random();
+
+    [Storable]
     private DateTime lastUpdateTime;
+
+    [Storable]
+    private IBenchmark benchmarkAlgorithm;
+    public IBenchmark BenchmarkAlgorithm {
+      get { return benchmarkAlgorithm; }
+      set {
+        if (value == null) throw new ArgumentNullException();
+        benchmarkAlgorithm = value;
+      }
+    }
+
+    private CancellationTokenSource cancellationTokenSource;
 
     [Storable]
@@ -202,7 +219,23 @@
     }
 
+    #region Parameter Properties
+
+    public ConstrainedValueParameter<IBenchmark> BenchmarkAlgorithmParameter {
+      get { return (ConstrainedValueParameter<IBenchmark>)Parameters["BenchmarkAlgorithm"]; }
+    }
+
+    private ValueParameter<IntValue> ChunkSizeParameter {
+      get { return (ValueParameter<IntValue>)Parameters["ChunkSize"]; }
+    }
+
+    private ValueParameter<DoubleValue> TimeLimitParameter {
+      get { return (ValueParameter<DoubleValue>)Parameters["TimeLimit"]; }
+    }
+
+    #endregion
+
     #region Constructors
 
-    protected Benchmark() {
+    public Benchmark() {
       name = ItemName;
       description = ItemDescription;
@@ -215,8 +248,10 @@
       Runs = new RunCollection();
       results = new ResultCollection();
+      CreateParameters();
+      DiscoverBenchmarks();
       Prepare();
     }
 
-    protected Benchmark(Benchmark original, Cloner cloner) {
+    public Benchmark(Benchmark original, Cloner cloner) {
       cloner.RegisterClonedObject(original, this);
       name = original.name;
@@ -232,9 +267,34 @@
       Initialize();
 
-      results = new ResultCollection();
+      results = cloner.Clone(original.results);
+      DiscoverBenchmarks();
       Prepare();
     }
 
     #endregion
+
+    private void CreateParameters() {
+      Parameters.Add(new ValueParameter<IntValue>("ChunkSize", "The size (MB) of the chunk array that gets generated", new IntValue(0)));
+      Parameters.Add(new ValueParameter<DoubleValue>("TimeLimit", "The time limit (in minutes) for a benchmark run", new DoubleValue(0)));
+    }
+
+    private void DiscoverBenchmarks() {
+      var benchmarks = from t in ApplicationManager.Manager.GetTypes(typeof(IBenchmark))
+                       select t;
+      ItemSet<IBenchmark> values = new ItemSet<IBenchmark>();
+      foreach (var benchmark in benchmarks) {
+        IBenchmark b = (IBenchmark)Activator.CreateInstance(benchmark);
+        values.Add(b);
+      }
+      string paramName = "BenchmarkAlgorithm";
+      if (!Parameters.ContainsKey(paramName)) {
+        if (values.Count > 0) {
+          Parameters.Add(new ConstrainedValueParameter<IBenchmark>(paramName, values, values.First(a => a is IBenchmark)));
+        } else {
+          // throw exception?
+          Parameters.Add(new ConstrainedValueParameter<IBenchmark>(paramName, values));
+        }
+      }
+    }
 
     private void Initialize() {
@@ -264,8 +324,9 @@
       if ((ExecutionState != ExecutionState.Started) && (ExecutionState != ExecutionState.Paused))
         throw new InvalidOperationException(string.Format("Stop not allowed in execution state \"{0}\".", ExecutionState));
+      cancellationTokenSource.Cancel();
     }
 
     public virtual void Start() {
-      var cancellationTokenSource = new CancellationTokenSource();
+      cancellationTokenSource = new CancellationTokenSource();
       OnStarted();
       Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token);
@@ -283,4 +344,5 @@
           }
         }
+
         cancellationTokenSource.Dispose();
         cancellationTokenSource = null;
@@ -297,5 +359,14 @@
       timer.Start();
       try {
-        RunBenchmark();
+        BenchmarkAlgorithm = (IBenchmark)BenchmarkAlgorithmParameter.ActualValue;
+        int chunkSize = ((IntValue)ChunkSizeParameter.ActualValue).Value;
+        if (chunkSize > 0) {
+          BenchmarkAlgorithm.ChunkData = CreateDataChuck(chunkSize);
+        }
+        BenchmarkAlgorithm.TimeLimit = TimeSpan.FromMinutes(((DoubleValue)TimeLimitParameter.ActualValue).Value);
+        BenchmarkAlgorithm.Run(cancellationToken, results);
+      }
+      catch (OperationCanceledException) {
+        //Console.WriteLine(ex.ToString());
       }
       finally {
@@ -304,9 +375,5 @@
         ExecutionTime += DateTime.Now - lastUpdateTime;
       }
-
-      cancellationToken.ThrowIfCancellationRequested();
-    }
-
-    protected abstract void RunBenchmark();
+    }
 
     private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) {
@@ -348,4 +415,29 @@
     }
 
+    private byte[][] CreateDataChuck(int megaBytes) {
+      if (megaBytes <= 0) {
+        throw new ArgumentException("MegaBytes must be greater than zero", "megaBytes");
+      }
+      byte[][] chunk = new byte[megaBytes][];
+      for (int i = 0; i < chunk.Length; i++) {
+        chunk[i] = new byte[1024 * 1024];
+        random.NextBytes(chunk[i]);
+      }
+      return chunk;
+    }
+    /*
+    private int[] CreateDataChuck(int megaBytes) {
+      if (megaBytes <= 0) {
+        throw new ArgumentException("MegaBytes must be greater than zero", "megaBytes");
+      }
+      int size = (megaBytes * 1020 * 1024) / sizeof(int);
+      int[] data = new int[size];
+      for (int i = 0; i < data.Length; i++) {
+        data[i] = random.Next();
+      }
+      return data;
+    }
+    */
+
     #region Events
 
@@ -464,11 +556,9 @@
     #endregion
 
-    #region IDeepCloneable Members
-
-    public abstract IDeepCloneable Clone(Cloner cloner);
-
-    #endregion
-
-    #region ICloneable Members
+    #region Clone
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new Benchmark(this, cloner);
+    }
 
     public object Clone() {
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Dhrystone.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Dhrystone.cs	(revision 6947)
+++ 	(revision )
@@ -1,347 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Diagnostics;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.Benchmarks {
-  [Item("Dhrystone Algorithm", "Dhrystone benchmarking algorithm.")]
-  [Creatable("Benchmarks")]
-  [StorableClass]
-  public class Dhrystone : Benchmark {
-
-    #region Benchmark Fields
-
-    private const int Ident_1 = 0;
-    private const int Ident_2 = 1;
-    private const int Ident_3 = 2;
-    private const int Ident_4 = 3;
-    private const int Ident_5 = 4;
-
-    private Record_Type Record_Glob;
-    private Record_Type Next_Record_Glob;
-
-    private int Int_Glob;
-    private Boolean Bool_Glob;
-
-    private char Char_Glob_1;
-    private char Char_Glob_2;
-
-    private int[] Array_Glob_1 = new int[128];
-    private int[][] Array_Glob_2 = new int[128][];
-
-    private Record_Type First_Record = new Record_Type();
-    private Record_Type Second_Record = new Record_Type();
-
-    private long Number_Of_Runs = 10000000;
-
-    #endregion
-
-    #region Costructors
-
-    public Dhrystone()
-      : base() {
-
-    }
-
-    private Dhrystone(Dhrystone original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
-
-    #endregion
-
-    #region IDeepClonable Members
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Dhrystone(this, cloner);
-    }
-
-    #endregion
-
-    #region Benchmark Methods
-
-    protected override void RunBenchmark() {
-      int Int_Loc_1;
-      int Int_Loc_2;
-      int Int_Loc_3;
-
-      int[] Int_Loc_1_Ref = new int[1];
-      int[] Int_Loc_3_Ref = new int[1];
-
-      char Char_Index;
-      int[] Enum_Loc = new int[1];
-
-      string String_Loc_1;
-      string String_Loc_2;
-
-      long total_time;
-
-      int Run_Index;
-
-      Next_Record_Glob = Second_Record;
-      Record_Glob = First_Record;
-
-      Record_Glob.Record_Comp = Next_Record_Glob;
-      Record_Glob.Discr = Ident_1;
-      Record_Glob.Enum_Comp = Ident_3;
-      Record_Glob.Int_Comp = 40;
-      Record_Glob.String_Comp = "DHRYSTONE PROGRAM, SOME STRING";
-      String_Loc_1 = "DHRYSTONE PROGRAM, 1'ST STRING";
-
-      for (int i = 0; i < 128; i++) {
-        Array_Glob_2[i] = new int[128];
-      }
-
-      Stopwatch sw = new Stopwatch();
-      sw.Start();
-
-
-      for (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index) {
-        Proc_5();
-        Proc_4();
-
-        Int_Loc_1 = 2;
-        Int_Loc_2 = 3;
-
-        String_Loc_2 = "DHRYSTONE PROGRAM, 2'ND STRING";
-
-        Enum_Loc[0] = Ident_2;
-        Bool_Glob = !Func_2(String_Loc_1, String_Loc_2);
-
-        while (Int_Loc_1 < Int_Loc_2) {
-          Int_Loc_3_Ref[0] = 5 * Int_Loc_1 - Int_Loc_2;
-          Proc_7(Int_Loc_1, Int_Loc_2, Int_Loc_3_Ref);
-          Int_Loc_1 += 1;
-        }
-
-        Int_Loc_3 = Int_Loc_3_Ref[0];
-        Proc_8(Array_Glob_1, Array_Glob_2, Int_Loc_1, Int_Loc_3);
-        Proc_1(Record_Glob);
-
-        for (Char_Index = 'A'; Char_Index <= Char_Glob_2; ++Char_Index) {
-          if (Enum_Loc[0] == Func_1(Char_Index, 'C'))
-            Proc_6(Ident_1, Enum_Loc);
-        }
-
-        Int_Loc_3 = Int_Loc_2 * Int_Loc_1;
-        Int_Loc_2 = Int_Loc_3 / Int_Loc_1;
-        Int_Loc_2 = 7 * (Int_Loc_3 - Int_Loc_2) - Int_Loc_1;
-
-        Int_Loc_1_Ref[0] = Int_Loc_1;
-        Proc_2(Int_Loc_1_Ref);
-        Int_Loc_1 = Int_Loc_1_Ref[0];
-      }
-
-      sw.Stop();
-      total_time = sw.ElapsedMilliseconds;
-
-      Results.Add(new Result("DIPS", new DoubleValue(Number_Of_Runs * 1000 / total_time)));
-    }
-
-    private int Func_1(char Char_Par_1_Val, char Char_Par_2_Val) {
-      char Char_Loc_1;
-      char Char_Loc_2;
-
-      Char_Loc_1 = Char_Par_1_Val;
-      Char_Loc_2 = Char_Loc_1;
-      if (Char_Loc_2 != Char_Par_2_Val)
-        return Ident_1;
-      else
-        return Ident_2;
-    }
-
-    private bool Func_2(string String_Par_1_Ref, string String_Par_2_Ref) {
-      int Int_Loc;
-      char Char_Loc = '\0';
-
-      Int_Loc = 2;
-
-      while (Int_Loc <= 2) {
-        if (Func_1(String_Par_1_Ref[Int_Loc], String_Par_2_Ref[Int_Loc + 1]) == Ident_1) {
-          Char_Loc = 'A';
-          Int_Loc += 1;
-        }
-      }
-      if (Char_Loc >= 'W' && Char_Loc < 'z')
-        Int_Loc = 7;
-      if (Char_Loc == 'X')
-        return true;
-      else {
-        if (String_Par_1_Ref.CompareTo(String_Par_2_Ref) > 0) {
-          Int_Loc += 7;
-          return true;
-        } else
-          return false;
-      }
-    }
-
-    private bool Func_3(int Enum_Par_Val) {
-      int Enum_Loc;
-
-      Enum_Loc = Enum_Par_Val;
-      if (Enum_Loc == Ident_3)
-        return true;
-      else
-        return false;
-    }
-
-    private void Proc_1(Record_Type Pointer_Par_Val) {
-      Record_Type Next_Record = Pointer_Par_Val.Record_Comp;
-
-      Pointer_Par_Val.Record_Comp = Record_Glob;
-
-      Pointer_Par_Val.Int_Comp = 5;
-
-      Next_Record.Int_Comp = Pointer_Par_Val.Int_Comp;
-      Next_Record.Record_Comp = Pointer_Par_Val.Record_Comp;
-      Proc_3(Next_Record.Record_Comp);
-
-      int[] Int_Ref = new int[1];
-
-      if (Next_Record.Discr == Ident_1) {
-        Next_Record.Int_Comp = 6;
-        Int_Ref[0] = Next_Record.Enum_Comp;
-        Proc_6(Pointer_Par_Val.Enum_Comp, Int_Ref);
-        Next_Record.Enum_Comp = Int_Ref[0];
-        Next_Record.Record_Comp = Record_Glob.Record_Comp;
-        Int_Ref[0] = Next_Record.Int_Comp;
-        Proc_7(Next_Record.Int_Comp, 10, Int_Ref);
-        Next_Record.Int_Comp = Int_Ref[0];
-      } else
-        Pointer_Par_Val = Pointer_Par_Val.Record_Comp;
-    }
-
-    private void Proc_2(int[] Int_Par_Ref) {
-      int Int_Loc;
-      int Enum_Loc;
-
-      Int_Loc = Int_Par_Ref[0] + 10;
-      Enum_Loc = 0;
-
-      do
-        if (Char_Glob_1 == 'A') {
-          Int_Loc -= 1;
-          Int_Par_Ref[0] = Int_Loc - Int_Glob;
-          Enum_Loc = Ident_1;
-        }
-      while (Enum_Loc != Ident_1);
-    }
-
-    private void Proc_3(Record_Type Pointer_Par_Ref) {
-      if (Record_Glob != null)
-        Pointer_Par_Ref = Record_Glob.Record_Comp;
-      else
-        Int_Glob = 100;
-
-      int[] Int_Comp_Ref = new int[1];
-      Int_Comp_Ref[0] = Record_Glob.Int_Comp;
-      Proc_7(10, Int_Glob, Int_Comp_Ref);
-      Record_Glob.Int_Comp = Int_Comp_Ref[0];
-    }
-
-    private void Proc_4() {
-      bool Bool_Loc;
-
-      Bool_Loc = Char_Glob_1 == 'A';
-      Bool_Loc = Bool_Loc || Bool_Glob;
-      Char_Glob_2 = 'B';
-    }
-
-    private void Proc_5() {
-      Char_Glob_1 = 'A';
-      Bool_Glob = false;
-    }
-
-    private void Proc_6(int Enum_Par_Val, int[] Enum_Par_Ref) {
-
-      Enum_Par_Ref[0] = Enum_Par_Val;
-
-      if (!Func_3(Enum_Par_Val))
-        Enum_Par_Ref[0] = Ident_4;
-
-      switch (Enum_Par_Val) {
-        case Ident_1:
-          Enum_Par_Ref[0] = Ident_1;
-          break;
-
-        case Ident_2:
-          if (Int_Glob > 100)
-            Enum_Par_Ref[0] = Ident_1;
-          else
-            Enum_Par_Ref[0] = Ident_4;
-          break;
-
-        case Ident_3:
-          Enum_Par_Ref[0] = Ident_2;
-          break;
-
-        case Ident_4:
-          break;
-
-        case Ident_5:
-          Enum_Par_Ref[0] = Ident_3;
-          break;
-      }
-    }
-
-    private void Proc_7(int Int_Par_Val1, int Int_Par_Val2, int[] Int_Par_Ref) {
-      int Int_Loc;
-      Int_Loc = Int_Par_Val1 + 2;
-      Int_Par_Ref[0] = Int_Par_Val2 + Int_Loc;
-    }
-
-    private void Proc_8(int[] Array_Par_1_Ref, int[][] Array_Par_2_Ref, int Int_Par_Val_1, int Int_Par_Val_2) {
-      int Int_Index;
-      int Int_Loc;
-
-      Int_Loc = Int_Par_Val_1 + 5;
-      Array_Par_1_Ref[Int_Loc] = Int_Par_Val_2;
-      Array_Par_1_Ref[Int_Loc + 1] = Array_Par_1_Ref[Int_Loc];
-      Array_Par_1_Ref[Int_Loc + 30] = Int_Loc;
-
-      for (Int_Index = Int_Loc; Int_Index <= Int_Loc + 1; ++Int_Index)
-        Array_Par_2_Ref[Int_Loc][Int_Index] = Int_Loc;
-      Array_Par_2_Ref[Int_Loc][Int_Loc - 1] += 1;
-      Array_Par_2_Ref[Int_Loc + 20][Int_Loc] = Array_Par_1_Ref[Int_Loc];
-      Int_Glob = 5;
-    }
-
-    #endregion
-
-    #region Private Class
-
-    private class Record_Type {
-      public Record_Type Record_Comp;
-      public int Discr;
-      public int Enum_Comp;
-      public int Int_Comp;
-      public string String_Comp;
-    }
-
-    #endregion
-  }
-}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/DhrystoneBenchmark.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/DhrystoneBenchmark.cs	(revision 6948)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/DhrystoneBenchmark.cs	(revision 6948)
@@ -0,0 +1,424 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using System.Threading;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.Benchmarks {
+  [Item("Dhrystone Algorithm", "Dhrystone benchmarking algorithm.")]
+  [StorableClass]
+  public class DhrystoneAlgorithm : IBenchmark {
+    [Storable]
+    private byte[][] chunk;
+
+    private TimeSpan timeLimit;
+
+    private bool stopBenchmark;
+
+    private CancellationToken cancellationToken;
+
+    #region Benchmark Fields
+
+    private const int Ident_1 = 0;
+    private const int Ident_2 = 1;
+    private const int Ident_3 = 2;
+    private const int Ident_4 = 3;
+    private const int Ident_5 = 4;
+
+    private Record_Type Record_Glob;
+    private Record_Type Next_Record_Glob;
+
+    private int Int_Glob;
+    private Boolean Bool_Glob;
+
+    private char Char_Glob_1;
+    private char Char_Glob_2;
+
+    private int[] Array_Glob_1 = new int[128];
+    private int[][] Array_Glob_2 = new int[128][];
+
+    private Record_Type First_Record = new Record_Type();
+    private Record_Type Second_Record = new Record_Type();
+
+    private long Default_Number_Of_Runs = 10000000;
+
+    #endregion
+
+    #region Properties
+
+    public byte[][] ChunkData {
+      get { return chunk; }
+      set { chunk = value; }
+    }
+
+    public TimeSpan TimeLimit {
+      get { return timeLimit; }
+      set { timeLimit = value; }
+    }
+
+    public string ItemName {
+      get { return ItemAttribute.GetName(this.GetType()); }
+    }
+
+    public string ItemDescription {
+      get { return ItemAttribute.GetDescription(this.GetType()); }
+    }
+
+    public Version ItemVersion {
+      get { return ItemAttribute.GetVersion(this.GetType()); }
+    }
+
+    public Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
+    }
+
+    #endregion
+
+    #region Costructors
+
+    public DhrystoneAlgorithm() {
+    }
+
+    private DhrystoneAlgorithm(DhrystoneAlgorithm original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+    }
+
+    #endregion
+
+    #region Benchmark Methods
+    // implementation based on Java version: http://www.okayan.jp/DhrystoneApplet/dhry_src.jar
+
+    public void Run(CancellationToken token, ResultCollection results) {
+      cancellationToken = token;
+      stopBenchmark = false;
+
+      int Int_Loc_1;
+      int Int_Loc_2;
+      int Int_Loc_3;
+
+      int[] Int_Loc_1_Ref = new int[1];
+      int[] Int_Loc_3_Ref = new int[1];
+
+      char Char_Index;
+      int[] Enum_Loc = new int[1];
+
+      string String_Loc_1;
+      string String_Loc_2;
+
+      long total_time;
+
+      long Run_Index;
+
+      Next_Record_Glob = Second_Record;
+      Record_Glob = First_Record;
+
+      Record_Glob.Record_Comp = Next_Record_Glob;
+      Record_Glob.Discr = Ident_1;
+      Record_Glob.Enum_Comp = Ident_3;
+      Record_Glob.Int_Comp = 40;
+      Record_Glob.String_Comp = "DHRYSTONE PROGRAM, SOME STRING";
+      String_Loc_1 = "DHRYSTONE PROGRAM, 1'ST STRING";
+
+      for (int i = 0; i < 128; i++) {
+        Array_Glob_2[i] = new int[128];
+      }
+
+      Stopwatch sw = new Stopwatch();
+      sw.Start();
+
+      Run_Index = 1;
+      while (!stopBenchmark) {
+        Proc_5();
+        Proc_4();
+
+        Int_Loc_1 = 2;
+        Int_Loc_2 = 3;
+
+        String_Loc_2 = "DHRYSTONE PROGRAM, 2'ND STRING";
+
+        Enum_Loc[0] = Ident_2;
+        Bool_Glob = !Func_2(String_Loc_1, String_Loc_2);
+
+        while (Int_Loc_1 < Int_Loc_2) {
+          Int_Loc_3_Ref[0] = 5 * Int_Loc_1 - Int_Loc_2;
+          Proc_7(Int_Loc_1, Int_Loc_2, Int_Loc_3_Ref);
+          Int_Loc_1 += 1;
+        }
+
+        Int_Loc_3 = Int_Loc_3_Ref[0];
+        Proc_8(Array_Glob_1, Array_Glob_2, Int_Loc_1, Int_Loc_3);
+        Proc_1(Record_Glob);
+
+        for (Char_Index = 'A'; Char_Index <= Char_Glob_2; ++Char_Index) {
+          if (Enum_Loc[0] == Func_1(Char_Index, 'C'))
+            Proc_6(Ident_1, Enum_Loc);
+        }
+
+        Int_Loc_3 = Int_Loc_2 * Int_Loc_1;
+        Int_Loc_2 = Int_Loc_3 / Int_Loc_1;
+        Int_Loc_2 = 7 * (Int_Loc_3 - Int_Loc_2) - Int_Loc_1;
+
+        Int_Loc_1_Ref[0] = Int_Loc_1;
+        Proc_2(Int_Loc_1_Ref);
+        Int_Loc_1 = Int_Loc_1_Ref[0];
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        if ((timeLimit == null) || (timeLimit.TotalMilliseconds == 0)) {
+          if (Run_Index > Default_Number_Of_Runs) {
+            stopBenchmark = true;
+          }
+        } else if (sw.Elapsed > timeLimit) {
+          stopBenchmark = true;
+        }
+
+        Run_Index++;
+      }
+
+      sw.Stop();
+      total_time = sw.ElapsedMilliseconds;
+
+      results.Add(new Result("DIPS", new DoubleValue(Run_Index * 1000 / total_time)));
+
+    }
+
+    private int Func_1(char Char_Par_1_Val, char Char_Par_2_Val) {
+      char Char_Loc_1;
+      char Char_Loc_2;
+
+      Char_Loc_1 = Char_Par_1_Val;
+      Char_Loc_2 = Char_Loc_1;
+      if (Char_Loc_2 != Char_Par_2_Val)
+        return Ident_1;
+      else
+        return Ident_2;
+    }
+
+    private bool Func_2(string String_Par_1_Ref, string String_Par_2_Ref) {
+      int Int_Loc;
+      char Char_Loc = '\0';
+
+      Int_Loc = 2;
+
+      while (Int_Loc <= 2) {
+        if (Func_1(String_Par_1_Ref[Int_Loc], String_Par_2_Ref[Int_Loc + 1]) == Ident_1) {
+          Char_Loc = 'A';
+          Int_Loc += 1;
+        }
+      }
+      if (Char_Loc >= 'W' && Char_Loc < 'z')
+        Int_Loc = 7;
+      if (Char_Loc == 'X')
+        return true;
+      else {
+        if (String_Par_1_Ref.CompareTo(String_Par_2_Ref) > 0) {
+          Int_Loc += 7;
+          return true;
+        } else
+          return false;
+      }
+    }
+
+    private bool Func_3(int Enum_Par_Val) {
+      int Enum_Loc;
+
+      Enum_Loc = Enum_Par_Val;
+      if (Enum_Loc == Ident_3)
+        return true;
+      else
+        return false;
+    }
+
+    private void Proc_1(Record_Type Pointer_Par_Val) {
+      Record_Type Next_Record = Pointer_Par_Val.Record_Comp;
+
+      Pointer_Par_Val.Record_Comp = Record_Glob;
+
+      Pointer_Par_Val.Int_Comp = 5;
+
+      Next_Record.Int_Comp = Pointer_Par_Val.Int_Comp;
+      Next_Record.Record_Comp = Pointer_Par_Val.Record_Comp;
+      Proc_3(Next_Record.Record_Comp);
+
+      int[] Int_Ref = new int[1];
+
+      if (Next_Record.Discr == Ident_1) {
+        Next_Record.Int_Comp = 6;
+        Int_Ref[0] = Next_Record.Enum_Comp;
+        Proc_6(Pointer_Par_Val.Enum_Comp, Int_Ref);
+        Next_Record.Enum_Comp = Int_Ref[0];
+        Next_Record.Record_Comp = Record_Glob.Record_Comp;
+        Int_Ref[0] = Next_Record.Int_Comp;
+        Proc_7(Next_Record.Int_Comp, 10, Int_Ref);
+        Next_Record.Int_Comp = Int_Ref[0];
+      } else
+        Pointer_Par_Val = Pointer_Par_Val.Record_Comp;
+    }
+
+    private void Proc_2(int[] Int_Par_Ref) {
+      int Int_Loc;
+      int Enum_Loc;
+
+      Int_Loc = Int_Par_Ref[0] + 10;
+      Enum_Loc = 0;
+
+      do
+        if (Char_Glob_1 == 'A') {
+          Int_Loc -= 1;
+          Int_Par_Ref[0] = Int_Loc - Int_Glob;
+          Enum_Loc = Ident_1;
+        }
+      while (Enum_Loc != Ident_1);
+    }
+
+    private void Proc_3(Record_Type Pointer_Par_Ref) {
+      if (Record_Glob != null)
+        Pointer_Par_Ref = Record_Glob.Record_Comp;
+      else
+        Int_Glob = 100;
+
+      int[] Int_Comp_Ref = new int[1];
+      Int_Comp_Ref[0] = Record_Glob.Int_Comp;
+      Proc_7(10, Int_Glob, Int_Comp_Ref);
+      Record_Glob.Int_Comp = Int_Comp_Ref[0];
+    }
+
+    private void Proc_4() {
+      bool Bool_Loc;
+
+      Bool_Loc = Char_Glob_1 == 'A';
+      Bool_Loc = Bool_Loc || Bool_Glob;
+      Char_Glob_2 = 'B';
+    }
+
+    private void Proc_5() {
+      Char_Glob_1 = 'A';
+      Bool_Glob = false;
+    }
+
+    private void Proc_6(int Enum_Par_Val, int[] Enum_Par_Ref) {
+
+      Enum_Par_Ref[0] = Enum_Par_Val;
+
+      if (!Func_3(Enum_Par_Val))
+        Enum_Par_Ref[0] = Ident_4;
+
+      switch (Enum_Par_Val) {
+        case Ident_1:
+          Enum_Par_Ref[0] = Ident_1;
+          break;
+
+        case Ident_2:
+          if (Int_Glob > 100)
+            Enum_Par_Ref[0] = Ident_1;
+          else
+            Enum_Par_Ref[0] = Ident_4;
+          break;
+
+        case Ident_3:
+          Enum_Par_Ref[0] = Ident_2;
+          break;
+
+        case Ident_4:
+          break;
+
+        case Ident_5:
+          Enum_Par_Ref[0] = Ident_3;
+          break;
+      }
+    }
+
+    private void Proc_7(int Int_Par_Val1, int Int_Par_Val2, int[] Int_Par_Ref) {
+      int Int_Loc;
+      Int_Loc = Int_Par_Val1 + 2;
+      Int_Par_Ref[0] = Int_Par_Val2 + Int_Loc;
+    }
+
+    private void Proc_8(int[] Array_Par_1_Ref, int[][] Array_Par_2_Ref, int Int_Par_Val_1, int Int_Par_Val_2) {
+      int Int_Index;
+      int Int_Loc;
+
+      Int_Loc = Int_Par_Val_1 + 5;
+      Array_Par_1_Ref[Int_Loc] = Int_Par_Val_2;
+      Array_Par_1_Ref[Int_Loc + 1] = Array_Par_1_Ref[Int_Loc];
+      Array_Par_1_Ref[Int_Loc + 30] = Int_Loc;
+
+      for (Int_Index = Int_Loc; Int_Index <= Int_Loc + 1; ++Int_Index)
+        Array_Par_2_Ref[Int_Loc][Int_Index] = Int_Loc;
+      Array_Par_2_Ref[Int_Loc][Int_Loc - 1] += 1;
+      Array_Par_2_Ref[Int_Loc + 20][Int_Loc] = Array_Par_1_Ref[Int_Loc];
+      Int_Glob = 5;
+    }
+
+    #endregion
+
+    #region Private Class
+
+    private class Record_Type {
+      public Record_Type Record_Comp;
+      public int Discr;
+      public int Enum_Comp;
+      public int Int_Comp;
+      public string String_Comp;
+    }
+
+    #endregion
+
+    #region Clone
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new DhrystoneAlgorithm(this, cloner);
+    }
+
+    public object Clone() {
+      return Clone(new Cloner());
+    }
+
+    #endregion
+
+    #region Events
+
+    public event EventHandler ItemImageChanged;
+    protected virtual void OnItemImageChanged() {
+      EventHandler handler = ItemImageChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ToStringChanged;
+    protected virtual void OnToStringChanged() {
+      EventHandler handler = ToStringChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    #endregion
+
+
+  }
+}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/HeuristicLab.Algorithms.Benchmarks-3.3.csproj
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/HeuristicLab.Algorithms.Benchmarks-3.3.csproj	(revision 6947)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/HeuristicLab.Algorithms.Benchmarks-3.3.csproj	(revision 6948)
@@ -51,9 +51,10 @@
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="Whetstone.cs" />
-    <Compile Include="Dhrystone.cs" />
-    <Compile Include="Linpack.cs" />
+    <Compile Include="DhrystoneBenchmark.cs" />
+    <Compile Include="IBenchmark.cs" />
+    <Compile Include="LinpackBenchmark.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="WhetstoneAlgorithm.cs" />
   </ItemGroup>
   <ItemGroup>
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/IBenchmark.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/IBenchmark.cs	(revision 6948)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/IBenchmark.cs	(revision 6948)
@@ -0,0 +1,32 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Threading;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+namespace HeuristicLab.Algorithms.Benchmarks {
+  public interface IBenchmark : IItem {
+    byte[][] ChunkData { get; set; }
+    TimeSpan TimeLimit { get; set; }
+    void Run(CancellationToken cancellationToken, ResultCollection resuls);
+  }
+}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Linpack.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Linpack.cs	(revision 6947)
+++ 	(revision )
@@ -1,438 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Diagnostics;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.Benchmarks {
-  [Item("Linpack Algorithm", "Linpack benchmarking algorithm.")]
-  [Creatable("Benchmarks")]
-  [StorableClass]
-  public class Linpack : Benchmark {
-
-    #region Benchmark Fields
-
-    private const int DEFAULT_PSIZE = 1500;
-
-    private double eps_result = 0.0;
-    private double mflops_result = 0.0;
-    private double residn_result = 0.0;
-    private double time_result = 0.0;
-    private double total = 0.0;
-
-    private Stopwatch sw = new Stopwatch();
-
-    #endregion
-
-    #region Costructors
-
-    public Linpack()
-      : base() {
-    }
-
-    private Linpack(Linpack original, Cloner cloner)
-      : base(original, cloner) {
-    }
-
-    #endregion
-
-    #region IDeepClonable Members
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Linpack(this, cloner);
-    }
-
-    #endregion
-
-    #region Linpack Benchmark
-    // implementation based on Java version: http://www.netlib.org/benchmark/linpackjava/
-
-    protected override void RunBenchmark() {
-      int n = DEFAULT_PSIZE;
-      int ldaa = DEFAULT_PSIZE;
-      int lda = DEFAULT_PSIZE + 1;
-
-      double[][] a = new double[ldaa][];
-      double[] b = new double[ldaa];
-      double[] x = new double[ldaa];
-
-      double ops;
-      double norma;
-      double normx;
-      double resid;
-      int i;
-      int info;
-      int[] ipvt = new int[ldaa];
-
-      for (i = 0; i < ldaa; i++) {
-        a[i] = new double[lda];
-      }
-
-      ops = (2.0e0 * (((double)n) * n * n)) / 3.0 + 2.0 * (n * n);
-
-      norma = mathGen(a, lda, n, b);
-
-      sw.Reset();
-      sw.Start();
-
-      info = dgefa(a, lda, n, ipvt);
-
-      dgesl(a, lda, n, ipvt, b, 0);
-
-      sw.Stop();
-      total = sw.Elapsed.TotalMilliseconds / 1000;
-
-      for (i = 0; i < n; i++) {
-        x[i] = b[i];
-      }
-
-      norma = mathGen(a, lda, n, b);
-
-      for (i = 0; i < n; i++) {
-        b[i] = -b[i];
-      }
-
-      dmxpy(n, b, n, lda, x, a);
-
-      resid = 0.0;
-      normx = 0.0;
-
-      for (i = 0; i < n; i++) {
-        resid = (resid > abs(b[i])) ? resid : abs(b[i]);
-        normx = (normx > abs(x[i])) ? normx : abs(x[i]);
-      }
-
-      eps_result = epslon((double)1.0);
-
-      residn_result = resid / (n * norma * normx * eps_result);
-      residn_result += 0.005; // for rounding
-      residn_result = (int)(residn_result * 100);
-      residn_result /= 100;
-
-      time_result = total;
-      time_result += 0.005; // for rounding
-      time_result = (int)(time_result * 100);
-      time_result /= 100;
-
-      mflops_result = ops / (1.0e6 * total);
-      mflops_result += 0.0005; // for rounding
-      mflops_result = (int)(mflops_result * 1000);
-      mflops_result /= 1000;
-
-      Results.Add(new Result("Mflops/s", new DoubleValue(mflops_result)));
-      Results.Add(new Result("total Mflops/s", new DoubleValue(mflops_result * Environment.ProcessorCount)));
-    }
-
-    private double abs(double d) {
-      return (d >= 0) ? d : -d;
-    }
-
-    private double mathGen(double[][] a, int lda, int n, double[] b) {
-      Random gen;
-      double norma;
-      int init, i, j;
-
-      init = 1325;
-      norma = 0.0;
-
-      gen = new Random(init);
-
-      // Next two for() statements switched.  Solver wants
-      // matrix in column order. --dmd 3/3/97
-
-      for (i = 0; i < n; i++) {
-        for (j = 0; j < n; j++) {
-          a[j][i] = gen.NextDouble() - .5;
-          norma = (a[j][i] > norma) ? a[j][i] : norma;
-        }
-      }
-
-      for (i = 0; i < n; i++) {
-        b[i] = 0.0;
-      }
-
-      for (j = 0; j < n; j++) {
-        for (i = 0; i < n; i++) {
-          b[i] += a[j][i];
-        }
-      }
-
-      return norma;
-    }
-
-    private int dgefa(double[][] a, int lda, int n, int[] ipvt) {
-      double[] col_k, col_j;
-      double t;
-      int j, k, kp1, l, nm1;
-      int info;
-
-      // gaussian elimination with partial pivoting
-
-      info = 0;
-      nm1 = n - 1;
-      if (nm1 >= 0) {
-        for (k = 0; k < nm1; k++) {
-          col_k = a[k];
-          kp1 = k + 1;
-
-          // find l = pivot index
-
-          l = idamax(n - k, col_k, k, 1) + k;
-          ipvt[k] = l;
-
-          // zero pivot implies this column already triangularized
-
-          if (col_k[l] != 0) {
-            // interchange if necessary
-
-            if (l != k) {
-              t = col_k[l];
-              col_k[l] = col_k[k];
-              col_k[k] = t;
-            }
-
-            // compute multipliers
-
-            t = -1.0 / col_k[k];
-            dscal(n - (kp1), t, col_k, kp1, 1);
-
-            // row elimination with column indexing
-
-            for (j = kp1; j < n; j++) {
-              col_j = a[j];
-              t = col_j[l];
-              if (l != k) {
-                col_j[l] = col_j[k];
-                col_j[k] = t;
-              }
-              daxpy(n - (kp1), t, col_k, kp1, 1,
-                col_j, kp1, 1);
-            }
-          } else {
-            info = k;
-          }
-        }
-      }
-
-      ipvt[n - 1] = n - 1;
-      if (a[(n - 1)][(n - 1)] == 0) info = n - 1;
-
-      return info;
-    }
-
-    private void dgesl(double[][] a, int lda, int n, int[] ipvt, double[] b, int job) {
-      double t;
-      int k, kb, l, nm1, kp1;
-
-      nm1 = n - 1;
-      if (job == 0) {
-        // job = 0 , solve  a * x = b.  first solve  l*y = b
-
-        if (nm1 >= 1) {
-          for (k = 0; k < nm1; k++) {
-            l = ipvt[k];
-            t = b[l];
-            if (l != k) {
-              b[l] = b[k];
-              b[k] = t;
-            }
-            kp1 = k + 1;
-            daxpy(n - (kp1), t, a[k], kp1, 1, b, kp1, 1);
-          }
-        }
-
-        // now solve  u*x = y
-
-        for (kb = 0; kb < n; kb++) {
-          k = n - (kb + 1);
-          b[k] /= a[k][k];
-          t = -b[k];
-          daxpy(k, t, a[k], 0, 1, b, 0, 1);
-        }
-      } else {
-        // job = nonzero, solve  trans(a) * x = b.  first solve  trans(u)*y = b
-
-        for (k = 0; k < n; k++) {
-          t = ddot(k, a[k], 0, 1, b, 0, 1);
-          b[k] = (b[k] - t) / a[k][k];
-        }
-
-        // now solve trans(l)*x = y 
-
-        if (nm1 >= 1) {
-          //for (kb = 1; kb < nm1; kb++) {
-          for (kb = 0; kb < nm1; kb++) {
-            k = n - (kb + 1);
-            kp1 = k + 1;
-            b[k] += ddot(n - (kp1), a[k], kp1, 1, b, kp1, 1);
-            l = ipvt[k];
-            if (l != k) {
-              t = b[l];
-              b[l] = b[k];
-              b[k] = t;
-            }
-          }
-        }
-      }
-    }
-
-    private void daxpy(int n, double da, double[] dx, int dx_off, int incx, double[] dy, int dy_off, int incy) {
-      int i, ix, iy;
-
-      if ((n > 0) && (da != 0)) {
-        if (incx != 1 || incy != 1) {
-
-          // code for unequal increments or equal increments not equal to 1
-
-          ix = 0;
-          iy = 0;
-          if (incx < 0) ix = (-n + 1) * incx;
-          if (incy < 0) iy = (-n + 1) * incy;
-          for (i = 0; i < n; i++) {
-            dy[iy + dy_off] += da * dx[ix + dx_off];
-            ix += incx;
-            iy += incy;
-          }
-          return;
-        } else {
-          // code for both increments equal to 1
-
-          for (i = 0; i < n; i++)
-            dy[i + dy_off] += da * dx[i + dx_off];
-        }
-      }
-    }
-
-    private double ddot(int n, double[] dx, int dx_off, int incx, double[] dy, int dy_off, int incy) {
-      double dtemp = 0;
-      int i, ix, iy;
-
-      if (n > 0) {
-        if (incx != 1 || incy != 1) {
-          // code for unequal increments or equal increments not equal to 1
-
-          ix = 0;
-          iy = 0;
-          if (incx < 0) ix = (-n + 1) * incx;
-          if (incy < 0) iy = (-n + 1) * incy;
-          for (i = 0; i < n; i++) {
-            dtemp += dx[ix + dx_off] * dy[iy + dy_off];
-            ix += incx;
-            iy += incy;
-          }
-        } else {
-          // code for both increments equal to 1
-
-          for (i = 0; i < n; i++)
-            dtemp += dx[i + dx_off] * dy[i + dy_off];
-        }
-      }
-      return (dtemp);
-    }
-
-    private void dscal(int n, double da, double[] dx, int dx_off, int incx) {
-      int i, nincx;
-
-      if (n > 0) {
-        if (incx != 1) {
-          // code for increment not equal to 1
-
-          nincx = n * incx;
-          for (i = 0; i < nincx; i += incx)
-            dx[i + dx_off] *= da;
-        } else {
-          // code for increment equal to 1
-
-          for (i = 0; i < n; i++)
-            dx[i + dx_off] *= da;
-        }
-      }
-    }
-
-    private int idamax(int n, double[] dx, int dx_off, int incx) {
-      double dmax, dtemp;
-      int i, ix, itemp = 0;
-
-      if (n < 1) {
-        itemp = -1;
-      } else if (n == 1) {
-        itemp = 0;
-      } else if (incx != 1) {
-        // code for increment not equal to 1
-
-        dmax = (dx[dx_off] < 0.0) ? -dx[dx_off] : dx[dx_off];
-        ix = 1 + incx;
-        for (i = 0; i < n; i++) {
-          dtemp = (dx[ix + dx_off] < 0.0) ? -dx[ix + dx_off] : dx[ix + dx_off];
-          if (dtemp > dmax) {
-            itemp = i;
-            dmax = dtemp;
-          }
-          ix += incx;
-        }
-      } else {
-        // code for increment equal to 1
-
-        itemp = 0;
-        dmax = (dx[dx_off] < 0.0) ? -dx[dx_off] : dx[dx_off];
-        for (i = 0; i < n; i++) {
-          dtemp = (dx[i + dx_off] < 0.0) ? -dx[i + dx_off] : dx[i + dx_off];
-          if (dtemp > dmax) {
-            itemp = i;
-            dmax = dtemp;
-          }
-        }
-      }
-      return (itemp);
-    }
-
-    private double epslon(double x) {
-      double a, b, c, eps;
-
-      a = 4.0e0 / 3.0e0;
-      eps = 0;
-      while (eps == 0) {
-        b = a - 1.0;
-        c = b + b + b;
-        eps = abs(c - 1.0);
-      }
-      return (eps * abs(x));
-    }
-
-    private void dmxpy(int n1, double[] y, int n2, int ldm, double[] x, double[][] m) {
-      int j, i;
-
-      // cleanup odd vector
-      for (j = 0; j < n2; j++) {
-        for (i = 0; i < n1; i++) {
-          y[i] += x[j] * m[j][i];
-        }
-      }
-    }
-
-    #endregion
-  }
-}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/LinpackBenchmark.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/LinpackBenchmark.cs	(revision 6948)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/LinpackBenchmark.cs	(revision 6948)
@@ -0,0 +1,567 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using System.Threading;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.Benchmarks {
+  [Item("Linpack Algorithm", "Linpack benchmarking algorithm.")]
+  [StorableClass]
+  public class LinpackBenchmark : IBenchmark {
+    [Storable]
+    private byte[][] chunk;
+
+    private TimeSpan timeLimit;
+
+    private bool stopBenchmark;
+
+    private CancellationToken cancellationToken;
+
+    #region Benchmark Fields
+
+    private const int DEFAULT_PSIZE = 1500;
+
+    private double eps_result = 0.0;
+    private double mflops_result = 0.0;
+    private double residn_result = 0.0;
+    private double time_result = 0.0;
+    private double total = 0.0;
+
+    private Stopwatch sw = new Stopwatch();
+
+    #endregion
+
+    #region Properties
+
+    public byte[][] ChunkData {
+      get { return chunk; }
+      set { chunk = value; }
+    }
+
+    public TimeSpan TimeLimit {
+      get { return timeLimit; }
+      set { timeLimit = value; }
+    }
+
+    public string ItemName {
+      get { return ItemAttribute.GetName(this.GetType()); }
+    }
+
+    public string ItemDescription {
+      get { return ItemAttribute.GetDescription(this.GetType()); }
+    }
+
+    public Version ItemVersion {
+      get { return ItemAttribute.GetVersion(this.GetType()); }
+    }
+
+    public Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
+    }
+
+    #endregion
+
+    #region Costructors
+
+    public LinpackBenchmark() {
+    }
+
+    public LinpackBenchmark(LinpackBenchmark original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+    }
+
+    #endregion
+
+    #region Linpack Benchmark
+    // implementation based on Java version: http://www.netlib.org/benchmark/linpackjava/
+
+    public void Run(CancellationToken token, ResultCollection results) {
+      cancellationToken = token;
+      stopBenchmark = false;
+      TimeSpan executionTime = new TimeSpan();
+      bool resultAchieved = false;
+      do {
+        int n = DEFAULT_PSIZE;
+        int ldaa = DEFAULT_PSIZE;
+        int lda = DEFAULT_PSIZE + 1;
+
+        double[][] a = new double[ldaa][];
+        double[] b = new double[ldaa];
+        double[] x = new double[ldaa];
+
+        double ops;
+        double norma;
+        double normx;
+        double resid;
+        int i;
+        int info;
+        int[] ipvt = new int[ldaa];
+
+        for (i = 0; i < ldaa; i++) {
+          a[i] = new double[lda];
+        }
+
+        ops = (2.0e0 * (((double)n) * n * n)) / 3.0 + 2.0 * (n * n);
+
+        norma = mathGen(a, lda, n, b);
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        sw.Reset();
+        sw.Start();
+
+        info = dgefa(a, lda, n, ipvt);
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        dgesl(a, lda, n, ipvt, b, 0);
+
+        sw.Stop();
+        total = sw.Elapsed.TotalMilliseconds / 1000;
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        for (i = 0; i < n; i++) {
+          x[i] = b[i];
+        }
+
+        norma = mathGen(a, lda, n, b);
+
+        for (i = 0; i < n; i++) {
+          b[i] = -b[i];
+        }
+
+        dmxpy(n, b, n, lda, x, a);
+
+        resid = 0.0;
+        normx = 0.0;
+
+        for (i = 0; i < n; i++) {
+          resid = (resid > abs(b[i])) ? resid : abs(b[i]);
+          normx = (normx > abs(x[i])) ? normx : abs(x[i]);
+        }
+
+        eps_result = epslon((double)1.0);
+
+        residn_result = resid / (n * norma * normx * eps_result);
+        residn_result += 0.005; // for rounding
+        residn_result = (int)(residn_result * 100);
+        residn_result /= 100;
+
+        time_result = total;
+        time_result += 0.005; // for rounding
+        time_result = (int)(time_result * 100);
+        time_result /= 100;
+
+        mflops_result = ops / (1.0e6 * total);
+        mflops_result += 0.0005; // for rounding
+        mflops_result = (int)(mflops_result * 1000);
+        mflops_result /= 1000;
+
+        if (!resultAchieved) {
+          results.Add(new Result("Mflops/s", new DoubleValue(mflops_result)));
+          results.Add(new Result("total Mflops/s", new DoubleValue(mflops_result * Environment.ProcessorCount)));
+          resultAchieved = true;
+        }
+
+        executionTime += sw.Elapsed;
+        if (timeLimit == null)
+          stopBenchmark = true;
+        else if (executionTime > timeLimit)
+          stopBenchmark = true;
+      } while (!stopBenchmark);
+    }
+
+    private double abs(double d) {
+      return (d >= 0) ? d : -d;
+    }
+
+    private double mathGen(double[][] a, int lda, int n, double[] b) {
+      Random gen;
+      double norma;
+      int init, i, j;
+
+      init = 1325;
+      norma = 0.0;
+
+      gen = new Random(init);
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      // Next two for() statements switched.  Solver wants
+      // matrix in column order. --dmd 3/3/97
+
+      for (i = 0; i < n; i++) {
+        for (j = 0; j < n; j++) {
+          a[j][i] = gen.NextDouble() - .5;
+          norma = (a[j][i] > norma) ? a[j][i] : norma;
+        }
+      }
+
+      for (i = 0; i < n; i++) {
+        b[i] = 0.0;
+      }
+
+      for (j = 0; j < n; j++) {
+        for (i = 0; i < n; i++) {
+          b[i] += a[j][i];
+        }
+      }
+
+      return norma;
+    }
+
+    private int dgefa(double[][] a, int lda, int n, int[] ipvt) {
+      double[] col_k, col_j;
+      double t;
+      int j, k, kp1, l, nm1;
+      int info;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      // gaussian elimination with partial pivoting
+
+      info = 0;
+      nm1 = n - 1;
+      if (nm1 >= 0) {
+        for (k = 0; k < nm1; k++) {
+          col_k = a[k];
+          kp1 = k + 1;
+
+          // find l = pivot index
+
+          l = idamax(n - k, col_k, k, 1) + k;
+          ipvt[k] = l;
+
+          // zero pivot implies this column already triangularized
+
+          if (col_k[l] != 0) {
+            // interchange if necessary
+
+            if (l != k) {
+              t = col_k[l];
+              col_k[l] = col_k[k];
+              col_k[k] = t;
+            }
+
+            if (cancellationToken.IsCancellationRequested) {
+              throw new OperationCanceledException(cancellationToken);
+            }
+
+            // compute multipliers
+
+            t = -1.0 / col_k[k];
+            dscal(n - (kp1), t, col_k, kp1, 1);
+
+            if (cancellationToken.IsCancellationRequested) {
+              throw new OperationCanceledException(cancellationToken);
+            }
+
+            // row elimination with column indexing
+
+            for (j = kp1; j < n; j++) {
+              col_j = a[j];
+              t = col_j[l];
+              if (l != k) {
+                col_j[l] = col_j[k];
+                col_j[k] = t;
+              }
+              daxpy(n - (kp1), t, col_k, kp1, 1,
+                col_j, kp1, 1);
+            }
+          } else {
+            info = k;
+          }
+        }
+      }
+
+      ipvt[n - 1] = n - 1;
+      if (a[(n - 1)][(n - 1)] == 0) info = n - 1;
+
+      return info;
+    }
+
+    private void dgesl(double[][] a, int lda, int n, int[] ipvt, double[] b, int job) {
+      double t;
+      int k, kb, l, nm1, kp1;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      nm1 = n - 1;
+      if (job == 0) {
+        // job = 0 , solve  a * x = b.  first solve  l*y = b
+
+        if (nm1 >= 1) {
+          for (k = 0; k < nm1; k++) {
+            l = ipvt[k];
+            t = b[l];
+            if (l != k) {
+              b[l] = b[k];
+              b[k] = t;
+            }
+            kp1 = k + 1;
+            daxpy(n - (kp1), t, a[k], kp1, 1, b, kp1, 1);
+          }
+        }
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        // now solve  u*x = y
+
+        for (kb = 0; kb < n; kb++) {
+          k = n - (kb + 1);
+          b[k] /= a[k][k];
+          t = -b[k];
+          daxpy(k, t, a[k], 0, 1, b, 0, 1);
+        }
+      } else {
+        // job = nonzero, solve  trans(a) * x = b.  first solve  trans(u)*y = b
+
+        for (k = 0; k < n; k++) {
+          t = ddot(k, a[k], 0, 1, b, 0, 1);
+          b[k] = (b[k] - t) / a[k][k];
+        }
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        // now solve trans(l)*x = y 
+
+        if (nm1 >= 1) {
+          //for (kb = 1; kb < nm1; kb++) {
+          for (kb = 0; kb < nm1; kb++) {
+            k = n - (kb + 1);
+            kp1 = k + 1;
+            b[k] += ddot(n - (kp1), a[k], kp1, 1, b, kp1, 1);
+            l = ipvt[k];
+            if (l != k) {
+              t = b[l];
+              b[l] = b[k];
+              b[k] = t;
+            }
+          }
+        }
+      }
+    }
+
+    private void daxpy(int n, double da, double[] dx, int dx_off, int incx, double[] dy, int dy_off, int incy) {
+      int i, ix, iy;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      if ((n > 0) && (da != 0)) {
+        if (incx != 1 || incy != 1) {
+
+          // code for unequal increments or equal increments not equal to 1
+
+          ix = 0;
+          iy = 0;
+          if (incx < 0) ix = (-n + 1) * incx;
+          if (incy < 0) iy = (-n + 1) * incy;
+          for (i = 0; i < n; i++) {
+            dy[iy + dy_off] += da * dx[ix + dx_off];
+            ix += incx;
+            iy += incy;
+          }
+          return;
+        } else {
+          // code for both increments equal to 1
+
+          for (i = 0; i < n; i++)
+            dy[i + dy_off] += da * dx[i + dx_off];
+        }
+      }
+    }
+
+    private double ddot(int n, double[] dx, int dx_off, int incx, double[] dy, int dy_off, int incy) {
+      double dtemp = 0;
+      int i, ix, iy;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      if (n > 0) {
+        if (incx != 1 || incy != 1) {
+          // code for unequal increments or equal increments not equal to 1
+
+          ix = 0;
+          iy = 0;
+          if (incx < 0) ix = (-n + 1) * incx;
+          if (incy < 0) iy = (-n + 1) * incy;
+          for (i = 0; i < n; i++) {
+            dtemp += dx[ix + dx_off] * dy[iy + dy_off];
+            ix += incx;
+            iy += incy;
+          }
+        } else {
+          // code for both increments equal to 1
+
+          for (i = 0; i < n; i++)
+            dtemp += dx[i + dx_off] * dy[i + dy_off];
+        }
+      }
+      return (dtemp);
+    }
+
+    private void dscal(int n, double da, double[] dx, int dx_off, int incx) {
+      int i, nincx;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      if (n > 0) {
+        if (incx != 1) {
+          // code for increment not equal to 1
+
+          nincx = n * incx;
+          for (i = 0; i < nincx; i += incx)
+            dx[i + dx_off] *= da;
+        } else {
+          // code for increment equal to 1
+
+          for (i = 0; i < n; i++)
+            dx[i + dx_off] *= da;
+        }
+      }
+    }
+
+    private int idamax(int n, double[] dx, int dx_off, int incx) {
+      double dmax, dtemp;
+      int i, ix, itemp = 0;
+
+      if (cancellationToken.IsCancellationRequested) {
+        throw new OperationCanceledException(cancellationToken);
+      }
+
+      if (n < 1) {
+        itemp = -1;
+      } else if (n == 1) {
+        itemp = 0;
+      } else if (incx != 1) {
+        // code for increment not equal to 1
+
+        dmax = (dx[dx_off] < 0.0) ? -dx[dx_off] : dx[dx_off];
+        ix = 1 + incx;
+        for (i = 0; i < n; i++) {
+          dtemp = (dx[ix + dx_off] < 0.0) ? -dx[ix + dx_off] : dx[ix + dx_off];
+          if (dtemp > dmax) {
+            itemp = i;
+            dmax = dtemp;
+          }
+          ix += incx;
+        }
+      } else {
+        // code for increment equal to 1
+
+        itemp = 0;
+        dmax = (dx[dx_off] < 0.0) ? -dx[dx_off] : dx[dx_off];
+        for (i = 0; i < n; i++) {
+          dtemp = (dx[i + dx_off] < 0.0) ? -dx[i + dx_off] : dx[i + dx_off];
+          if (dtemp > dmax) {
+            itemp = i;
+            dmax = dtemp;
+          }
+        }
+      }
+      return (itemp);
+    }
+
+    private double epslon(double x) {
+      double a, b, c, eps;
+
+      a = 4.0e0 / 3.0e0;
+      eps = 0;
+      while (eps == 0) {
+        b = a - 1.0;
+        c = b + b + b;
+        eps = abs(c - 1.0);
+      }
+      return (eps * abs(x));
+    }
+
+    private void dmxpy(int n1, double[] y, int n2, int ldm, double[] x, double[][] m) {
+      int j, i;
+
+      // cleanup odd vector
+      for (j = 0; j < n2; j++) {
+        for (i = 0; i < n1; i++) {
+          y[i] += x[j] * m[j][i];
+        }
+      }
+    }
+
+    #endregion
+
+    #region Clone
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new LinpackBenchmark(this, cloner);
+    }
+
+    public object Clone() {
+      return Clone(new Cloner());
+    }
+
+    #endregion
+
+    #region Events
+
+    public event EventHandler ItemImageChanged;
+    protected virtual void OnItemImageChanged() {
+      EventHandler handler = ItemImageChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ToStringChanged;
+    protected virtual void OnToStringChanged() {
+      EventHandler handler = ToStringChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    #endregion
+  }
+}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Whetstone.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/Whetstone.cs	(revision 6947)
+++ 	(revision )
@@ -1,247 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using HeuristicLab.Common;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.Benchmarks {
-  [Item("Whetstone Algorithm", "Whetstone benchmarking algorithm.")]
-  [Creatable("Benchmarks")]
-  [StorableClass]
-  public class Whetstone : Benchmark {
-
-    #region Benchmark Fields
-
-    private long begin_time;
-    private long end_time;
-
-    private int ITERATIONS;
-    private int numberOfCycles;
-    private int cycleNo;
-    private double x1, x2, x3, x4, x, y, t, t1, t2;
-    private double[] z = new double[1];
-    private double[] e1 = new double[4];
-    private int i, j, k, l, n1, n2, n3, n4, n6, n7, n8, n9, n10, n11;
-
-    #endregion
-
-    #region Costructors
-
-    public Whetstone()
-      : base() {
-
-    }
-
-    private Whetstone(Whetstone original, Cloner cloner)
-      : base(original, cloner) {
-
-    }
-
-    #endregion
-
-    #region IDeepClonable Members
-
-    public override IDeepCloneable Clone(Cloner cloner) {
-      return new Whetstone(this, cloner);
-    }
-
-    #endregion
-
-    #region Whetstone Benchmark
-
-    protected override void RunBenchmark() {
-      ITERATIONS = 100; // ITERATIONS / 10 = Millions Whetstone instructions
-
-      numberOfCycles = 100;
-      int numberOfRuns = 10;
-      float elapsedTime = 0;
-      float meanTime = 0;
-      float rating = 0;
-      float meanRating = 0;
-      int intRating = 0;
-
-      for (int runNumber = 1; runNumber <= numberOfRuns; runNumber++) {
-        elapsedTime = (float)(MainCalc() / 1000);
-        meanTime = meanTime + (elapsedTime * 1000 / numberOfCycles);
-        rating = (1000 * numberOfCycles) / elapsedTime;
-        meanRating = meanRating + rating;
-        intRating = (int)rating;
-        numberOfCycles += 10;
-      }
-
-      meanTime = meanTime / numberOfRuns;
-      meanRating = meanRating / numberOfRuns;
-      intRating = (int)meanRating;
-
-      Results.Add(new Result("MWIPS", new IntValue(intRating / 1000)));
-    }
-
-    private double MainCalc() {
-      // initialize constants
-      t = 0.499975;
-      t1 = 0.50025;
-      t2 = 2.0;
-
-      // set values of module weights
-      n1 = 0 * ITERATIONS;
-      n2 = 12 * ITERATIONS;
-      n3 = 14 * ITERATIONS;
-      n4 = 345 * ITERATIONS;
-      n6 = 210 * ITERATIONS;
-      n7 = 32 * ITERATIONS;
-      n8 = 899 * ITERATIONS;
-      n9 = 616 * ITERATIONS;
-      n10 = 0 * ITERATIONS;
-      n11 = 93 * ITERATIONS;
-
-      begin_time = DateTime.Now.Ticks / 10000; // get ms
-
-      for (cycleNo = 1; cycleNo <= numberOfCycles; cycleNo++) {
-        /* MODULE 1: simple identifiers */
-        x1 = 1.0;
-        x2 = x3 = x4 = -1.0;
-        for (i = 1; i <= n1; i += 1) {
-          x1 = (x1 + x2 + x3 - x4) * t;
-          x2 = (x1 + x2 - x3 + x4) * t; // correction: x2 = ( x1 + x2 - x3 - x4 ) * t;
-          x3 = (x1 - x2 + x3 + x4) * t; // correction: x3 = ( x1 - x2 + x3 + x4 ) * t;
-          x4 = (-x1 + x2 + x3 + x4) * t;
-        }
-
-        /* MODULE 2: array elements */
-        e1[0] = 1.0;
-        e1[1] = e1[2] = e1[3] = -1.0;
-        for (i = 1; i <= n2; i += 1) {
-          e1[0] = (e1[0] + e1[1] + e1[2] - e1[3]) * t;
-          e1[1] = (e1[0] + e1[1] - e1[2] + e1[3]) * t;
-          e1[2] = (e1[0] - e1[1] + e1[2] + e1[3]) * t;
-          e1[3] = (-e1[0] + e1[1] + e1[2] + e1[3]) * t;
-        }
-
-        /* MODULE 3: array as parameter */
-        for (i = 1; i <= n3; i += 1)
-          pa(e1);
-
-        /* MODULE 4: conditional jumps */
-        j = 1;
-        for (i = 1; i <= n4; i += 1) {
-          if (j == 1)
-            j = 2;
-          else
-            j = 3;
-          if (j > 2)
-            j = 0;
-          else
-            j = 1;
-          if (j < 1)
-            j = 1;
-          else
-            j = 0;
-        }
-
-        /* MODULE 5: omitted */
-
-        /* MODULE 6: integer arithmetic */
-        j = 1;
-        k = 2;
-        l = 3;
-        for (i = 1; i <= n6; i += 1) {
-          j = j * (k - j) * (l - k);
-          k = l * k - (l - j) * k;
-          l = (l - k) * (k + j);
-          e1[l - 2] = j + k + l; /* C arrays are zero based */
-          e1[k - 2] = j * k * l;
-        }
-
-        /* MODULE 7: trig. functions */
-        x = y = 0.5;
-        for (i = 1; i <= n7; i += 1) {
-          x = t * Math.Atan(t2 * Math.Sin(x) * Math.Cos(x) / (Math.Cos(x + y) + Math.Cos(x - y) - 1.0));
-          y = t * Math.Atan(t2 * Math.Sin(y) * Math.Cos(y) / (Math.Cos(x + y) + Math.Cos(x - y) - 1.0));
-        }
-
-        /* MODULE 8: procedure calls */
-        x = y = z[0] = 1.0;
-        for (i = 1; i <= n8; i += 1)
-          p3(x, y, z);
-
-        /* MODULE9: array references */
-        j = 0;
-        k = 1;
-        l = 2;
-        e1[0] = 1.0;
-        e1[1] = 2.0;
-        e1[2] = 3.0;
-        for (i = 1; i <= n9; i++)
-          p0();
-
-        /* MODULE10: integer arithmetic */
-        j = 2;
-        k = 3;
-        for (i = 1; i <= n10; i += 1) {
-          j = j + k;
-          k = j + k;
-          j = k - j;
-          k = k - j - j;
-        }
-
-        /* MODULE11: standard functions */
-        x = 0.75;
-        for (i = 1; i <= n11; i += 1)
-          x = Math.Sqrt(Math.Exp(Math.Log(x) / t1));
-      } /* for */
-
-      end_time = DateTime.Now.Ticks / 10000; // get ms
-
-      return (end_time - begin_time);
-    }
-
-    public void pa(double[] e) {
-      int j;
-      j = 0;
-      do {
-        e[0] = (e[0] + e[1] + e[2] - e[3]) * t;
-        e[1] = (e[0] + e[1] - e[2] + e[3]) * t;
-        e[2] = (e[0] - e[1] + e[2] + e[3]) * t;
-        e[3] = (-e[0] + e[1] + e[2] + e[3]) / t2;
-        j += 1;
-      }
-      while (j < 6);
-    }
-
-    public void p3(double x, double y, double[] z) {
-      x = t * (x + y);
-      y = t * (x + y);
-      z[0] = (x + y) / t2;
-    }
-
-    public void p0() {
-      e1[j] = e1[k];
-      e1[k] = e1[l];
-      e1[l] = e1[j];
-    }
-
-    #endregion
-  }
-}
Index: branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/WhetstoneAlgorithm.cs
===================================================================
--- branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/WhetstoneAlgorithm.cs	(revision 6948)
+++ branches/Benchmarking/sources/HeuristicLab.Algorithms.Benchmarks/3.3/WhetstoneAlgorithm.cs	(revision 6948)
@@ -0,0 +1,326 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Diagnostics;
+using System.Drawing;
+using System.Threading;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.Benchmarks {
+  [Item("Whetstone Algorithm", "Whetstone benchmarking algorithm.")]
+  [StorableClass]
+  public class WhetstoneBenchmark : IBenchmark {
+    [Storable]
+    private byte[][] chunk;
+
+    private TimeSpan timeLimit;
+
+    private bool stopBenchmark;
+
+    private CancellationToken cancellationToken;
+
+    #region Benchmark Fields
+
+    private long begin_time;
+    private long end_time;
+
+    private int ITERATIONS;
+    private int numberOfCycles;
+    private int cycleNo;
+    private double x1, x2, x3, x4, x, y, t, t1, t2;
+    private double[] z = new double[1];
+    private double[] e1 = new double[4];
+    private int i, j, k, l, n1, n2, n3, n4, n6, n7, n8, n9, n10, n11;
+
+    #endregion
+
+    #region Properties
+
+    public byte[][] ChunkData {
+      get { return chunk; }
+      set { chunk = value; }
+    }
+
+    public TimeSpan TimeLimit {
+      get { return timeLimit; }
+      set { timeLimit = value; }
+    }
+
+    public string ItemName {
+      get { return ItemAttribute.GetName(this.GetType()); }
+    }
+
+    public string ItemDescription {
+      get { return ItemAttribute.GetDescription(this.GetType()); }
+    }
+
+    public Version ItemVersion {
+      get { return ItemAttribute.GetVersion(this.GetType()); }
+    }
+
+    public Image ItemImage {
+      get { return HeuristicLab.Common.Resources.VSImageLibrary.Event; }
+    }
+
+    #endregion
+
+    #region Costructors
+
+    public WhetstoneBenchmark() {
+    }
+
+    private WhetstoneBenchmark(WhetstoneBenchmark original, Cloner cloner) {
+      cloner.RegisterClonedObject(original, this);
+    }
+
+    #endregion
+
+    #region Whetstone Benchmark
+    // implementation based on Java version: www.aicas.com/download/Whetstone.java
+
+    public void Run(CancellationToken token, ResultCollection results) {
+      cancellationToken = token;
+      stopBenchmark = false;
+
+      ITERATIONS = 100; // ITERATIONS / 10 = Millions Whetstone instructions
+
+      numberOfCycles = 100;
+      int defaultNumberOfRuns = 10;
+      float elapsedTime = 0;
+      float meanTime = 0;
+      float rating = 0;
+      float meanRating = 0;
+      int intRating = 0;
+
+      long runNumber = 1;
+      Stopwatch sw = new Stopwatch();
+      sw.Start();
+
+      while (!stopBenchmark) {
+        elapsedTime = (float)(MainCalc() / 1000);
+        meanTime = meanTime + (elapsedTime * 1000 / numberOfCycles);
+        rating = (1000 * numberOfCycles) / elapsedTime;
+        meanRating = meanRating + rating;
+        intRating = (int)rating;
+        numberOfCycles += 10;
+
+        if (cancellationToken.IsCancellationRequested) {
+          throw new OperationCanceledException(cancellationToken);
+        }
+
+        if ((timeLimit == null) || (timeLimit.TotalMilliseconds == 0)) {
+          if (runNumber > defaultNumberOfRuns) {
+            stopBenchmark = true;
+          }
+        } else if (sw.Elapsed > timeLimit) {
+          stopBenchmark = true;
+        }
+
+        runNumber++;
+      }
+      sw.Stop();
+      meanTime = meanTime / runNumber;
+      meanRating = meanRating / runNumber;
+      intRating = (int)meanRating;
+
+      results.Add(new Result("MWIPS", new IntValue(intRating / 1000)));
+    }
+
+    private double MainCalc() {
+      // initialize constants
+      t = 0.499975;
+      t1 = 0.50025;
+      t2 = 2.0;
+
+      // set values of module weights
+      n1 = 0 * ITERATIONS;
+      n2 = 12 * ITERATIONS;
+      n3 = 14 * ITERATIONS;
+      n4 = 345 * ITERATIONS;
+      n6 = 210 * ITERATIONS;
+      n7 = 32 * ITERATIONS;
+      n8 = 899 * ITERATIONS;
+      n9 = 616 * ITERATIONS;
+      n10 = 0 * ITERATIONS;
+      n11 = 93 * ITERATIONS;
+
+      begin_time = DateTime.Now.Ticks / 10000; // get ms
+
+      for (cycleNo = 1; cycleNo <= numberOfCycles; cycleNo++) {
+        /* MODULE 1: simple identifiers */
+        x1 = 1.0;
+        x2 = x3 = x4 = -1.0;
+        for (i = 1; i <= n1; i += 1) {
+          x1 = (x1 + x2 + x3 - x4) * t;
+          x2 = (x1 + x2 - x3 + x4) * t; // correction: x2 = ( x1 + x2 - x3 - x4 ) * t;
+          x3 = (x1 - x2 + x3 + x4) * t; // correction: x3 = ( x1 - x2 + x3 + x4 ) * t;
+          x4 = (-x1 + x2 + x3 + x4) * t;
+        }
+
+        /* MODULE 2: array elements */
+        e1[0] = 1.0;
+        e1[1] = e1[2] = e1[3] = -1.0;
+        for (i = 1; i <= n2; i += 1) {
+          e1[0] = (e1[0] + e1[1] + e1[2] - e1[3]) * t;
+          e1[1] = (e1[0] + e1[1] - e1[2] + e1[3]) * t;
+          e1[2] = (e1[0] - e1[1] + e1[2] + e1[3]) * t;
+          e1[3] = (-e1[0] + e1[1] + e1[2] + e1[3]) * t;
+        }
+
+        /* MODULE 3: array as parameter */
+        for (i = 1; i <= n3; i += 1)
+          pa(e1);
+
+        /* MODULE 4: conditional jumps */
+        j = 1;
+        for (i = 1; i <= n4; i += 1) {
+          if (j == 1)
+            j = 2;
+          else
+            j = 3;
+          if (j > 2)
+            j = 0;
+          else
+            j = 1;
+          if (j < 1)
+            j = 1;
+          else
+            j = 0;
+        }
+
+        /* MODULE 5: omitted */
+
+        /* MODULE 6: integer arithmetic */
+        j = 1;
+        k = 2;
+        l = 3;
+        for (i = 1; i <= n6; i += 1) {
+          j = j * (k - j) * (l - k);
+          k = l * k - (l - j) * k;
+          l = (l - k) * (k + j);
+          e1[l - 2] = j + k + l; /* C arrays are zero based */
+          e1[k - 2] = j * k * l;
+        }
+
+        /* MODULE 7: trig. functions */
+        x = y = 0.5;
+        for (i = 1; i <= n7; i += 1) {
+          x = t * Math.Atan(t2 * Math.Sin(x) * Math.Cos(x) / (Math.Cos(x + y) + Math.Cos(x - y) - 1.0));
+          y = t * Math.Atan(t2 * Math.Sin(y) * Math.Cos(y) / (Math.Cos(x + y) + Math.Cos(x - y) - 1.0));
+        }
+
+        /* MODULE 8: procedure calls */
+        x = y = z[0] = 1.0;
+        for (i = 1; i <= n8; i += 1)
+          p3(x, y, z);
+
+        /* MODULE9: array references */
+        j = 0;
+        k = 1;
+        l = 2;
+        e1[0] = 1.0;
+        e1[1] = 2.0;
+        e1[2] = 3.0;
+        for (i = 1; i <= n9; i++)
+          p0();
+
+        /* MODULE10: integer arithmetic */
+        j = 2;
+        k = 3;
+        for (i = 1; i <= n10; i += 1) {
+          j = j + k;
+          k = j + k;
+          j = k - j;
+          k = k - j - j;
+        }
+
+        /* MODULE11: standard functions */
+        x = 0.75;
+        for (i = 1; i <= n11; i += 1)
+          x = Math.Sqrt(Math.Exp(Math.Log(x) / t1));
+      } /* for */
+
+      end_time = DateTime.Now.Ticks / 10000; // get ms
+
+      return (end_time - begin_time);
+    }
+
+    public void pa(double[] e) {
+      int j;
+      j = 0;
+      do {
+        e[0] = (e[0] + e[1] + e[2] - e[3]) * t;
+        e[1] = (e[0] + e[1] - e[2] + e[3]) * t;
+        e[2] = (e[0] - e[1] + e[2] + e[3]) * t;
+        e[3] = (-e[0] + e[1] + e[2] + e[3]) / t2;
+        j += 1;
+      }
+      while (j < 6);
+    }
+
+    public void p3(double x, double y, double[] z) {
+      x = t * (x + y);
+      y = t * (x + y);
+      z[0] = (x + y) / t2;
+    }
+
+    public void p0() {
+      e1[j] = e1[k];
+      e1[k] = e1[l];
+      e1[l] = e1[j];
+    }
+
+    #endregion
+
+    #region Clone
+
+    public IDeepCloneable Clone(Cloner cloner) {
+      return new WhetstoneBenchmark(this, cloner);
+    }
+
+    public object Clone() {
+      return Clone(new Cloner());
+    }
+
+    #endregion
+
+    #region Events
+
+    public event EventHandler ItemImageChanged;
+    protected virtual void OnItemImageChanged() {
+      EventHandler handler = ItemImageChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    public event EventHandler ToStringChanged;
+    protected virtual void OnToStringChanged() {
+      EventHandler handler = ToStringChanged;
+      if (handler != null) handler(this, EventArgs.Empty);
+    }
+
+    #endregion
+  }
+}
