Index: branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj
===================================================================
--- branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj	(revision 6348)
+++ branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj	(revision 6354)
@@ -120,4 +120,8 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.Collections\3.3\HeuristicLab.Collections-3.3.csproj">
+      <Project>{958B43BC-CC5C-4FA2-8628-2B3B01D890B6}</Project>
+      <Name>HeuristicLab.Collections-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\..\HeuristicLab.Common\3.3\HeuristicLab.Common-3.3.csproj">
       <Project>{A9AD58B9-3EF9-4CC1-97E5-8D909039FF5C}</Project>
@@ -127,4 +131,8 @@
       <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
       <Name>HeuristicLab.Core-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.Operators.MPISupport\3.3\HeuristicLab.Operators.MPISupport-3.3.csproj">
+      <Project>{6BD69CDA-4875-4045-8B35-6FD4602854F5}</Project>
+      <Name>HeuristicLab.Operators.MPISupport-3.3</Name>
     </ProjectReference>
     <ProjectReference Include="..\..\..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
Index: branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame
===================================================================
--- branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame	(revision 6348)
+++ branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame	(revision 6354)
@@ -30,7 +30,9 @@
   [PluginDependency("HeuristicLab.Common", "3.3")]
   [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
   [PluginDependency("HeuristicLab.MPInet", "1.0.0")]
   [PluginDependency("HeuristicLab.Optimization", "3.3")]
   [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Operators.MPISupport", "3.3")]
   public class HeuristicLabProblemsVehicleRoutingPlugin : PluginBase {
   }
Index: branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/Program.cs
===================================================================
--- branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/Program.cs	(revision 6348)
+++ branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/MPIAlgorithmRunner/3.3/Program.cs	(revision 6354)
@@ -27,4 +27,6 @@
 using HeuristicLab.Persistence.Default.Xml;
 using System.Threading;
+using HeuristicLab.Operators.MPISupport;
+using HeuristicLab.Core;
 
 namespace HeuristicLab.MPIAlgorithmRunner {
@@ -33,21 +35,73 @@
 
     static void Main(string[] args) {
-      if (args.Length != 2) {
+      if (args.Length != 3) {
         Console.WriteLine("Args:" + args.Length);
 
-        throw new ArgumentException("You must provide two arguments - the algorithm file and the result file");
+        throw new ArgumentException("You must provide 3 arguments - the algorithm file, the result file and the update interval (in ms)");
       }
 
       string fileName = args[0];
       string resultName = args[1];
+      int updateInterval = int.Parse(args[2]);
 
       using (new MPI.Environment(ref args)) {
-        Program p = new Program();
-        p.StartAlgorithm(fileName, resultName + MPI.Communicator.world.Rank + ".hl");
+        MPI.Communicator communicator = MPI.Communicator.world.Clone() as MPI.Communicator;
+
+        if (communicator.Rank == 0) {
+          IAlgorithm alg = XmlParser.Deserialize<IAlgorithm>(fileName);
+          MPITransportWrapper<IAlgorithm> transport = new MPITransportWrapper<IAlgorithm>(alg);
+
+          int clients = communicator.Size - 1;
+          Console.WriteLine("Sending alg to " + clients + " clients");
+          for (int i = 0; i < clients; i++) {
+            int client = i + 1;
+            communicator.Send(transport, client, 0);
+          }
+
+          ItemList<ResultCollection> results = new ItemList<ResultCollection>();
+          
+          bool[] finished = new bool[clients];
+          int finishedCount = 0;
+
+          while (finishedCount != clients) {
+            for (int i = 0; i < clients; i++) {
+              if (!finished[i]) {
+                int client = i + 1;
+                ResultCollection result = communicator.Receive<MPITransportWrapper<ResultCollection>>(client, 1).InnerItem;
+
+                Console.WriteLine("Received result " + result);
+
+                if (results.Count != clients) {
+                  results.Add(result);
+                } else {
+                  results[i] = result;
+                }
+
+                Console.WriteLine("Probing...");
+                if (communicator.ImmediateProbe(client, 2) != null) {
+                  finished[i] = true;
+                  finishedCount++;
+                }
+              }
+            }
+
+            Console.WriteLine("Update results");
+            lock (resultName) {
+              XmlGenerator.Serialize(results, resultName);
+            }
+          }
+
+          Console.WriteLine("Finished.");
+        } else {
+          Program p = new Program();
+          p.StartAlgorithm(updateInterval, communicator);
+        }
       }
     }
 
-    public void StartAlgorithm(string fileName, string resultName) {
-      IAlgorithm alg = XmlParser.Deserialize<HeuristicLab.Optimization.IAlgorithm>(fileName);
+    public void StartAlgorithm(int updateInterval, MPI.Communicator communicator) {
+      IAlgorithm alg = communicator.Receive<MPITransportWrapper<IAlgorithm>>(0, 0).InnerItem;
+
+      Console.WriteLine("Starting algorithm...");
 
       alg.Stopped += new EventHandler(algorithm_Stopped);
@@ -57,7 +111,28 @@
       alg.Start();
 
+      Timer t = new Timer(delegate(object state) {
+        if (alg.ExecutionState == ExecutionState.Started) {
+          Console.WriteLine("Pausing alg...");
+          alg.Pause();
+
+          while (alg.ExecutionState != ExecutionState.Paused) {
+            Thread.Sleep(100);
+          }
+
+          communicator.Send<MPITransportWrapper<ResultCollection>>(
+            new MPITransportWrapper<ResultCollection>(alg.Results), 0, 1);
+
+          Console.WriteLine("Sending update...");
+
+          Console.WriteLine("Resuming alg...");
+          alg.Start();
+        }
+      }, null, updateInterval, updateInterval);
+
       waitHandle.WaitOne();
 
-      XmlGenerator.Serialize(alg, resultName);
+      communicator.Send<int>(communicator.Rank, 0, 2);
+      communicator.Send<MPITransportWrapper<ResultCollection>>(
+          new MPITransportWrapper<ResultCollection>(alg.Results), 0, 1);
     }
 
