Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs	(revision 6392)
@@ -0,0 +1,115 @@
+﻿#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.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Net;
+using System.Net.Sockets;
+using System.ServiceModel;
+using System.ServiceModel.Description;
+using HeuristicLab.Operators.MPISupport;
+using HeuristicLab.Optimization;
+using HeuristicLab.Core;
+using System.Threading;
+                     
+namespace HeuristicLab.MPIAlgorithmRunner {
+  [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
+  class AlgorithmBroker: IAlgorithmBroker {
+    private static int FindFreeTcpPort() {
+      TcpListener l = new TcpListener(IPAddress.Parse("127.0.0.1"), 0);
+      l.Start();
+      int port = ((IPEndPoint)l.LocalEndpoint).Port;
+      l.Stop();
+      return port;
+    }
+
+    private static ServiceHost CreateService(MPI.Communicator communicator) {
+      AlgorithmBroker broker = new AlgorithmBroker(communicator);
+      ServiceHost service = new ServiceHost(broker);
+
+      ContractDescription contract = ContractDescription.GetContract(typeof(IAlgorithmBroker));
+      contract.ContractType = typeof(IAlgorithmBroker);
+      ServiceEndpoint endpoint = new ServiceEndpoint(contract);
+      endpoint.Name = "AlgorithmBrokerEndpoint";
+      NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None);
+      endpoint.Binding = netTCPBinding;
+      int port = FindFreeTcpPort();
+      endpoint.Address = new EndpointAddress("net.tcp://localhost:" + port + "/AlgorithmBroker");
+      service.AddServiceEndpoint(endpoint);
+
+      return service;
+    }
+
+    public static ServiceHost StartService(MPI.Communicator communicator) {
+      try {
+        ServiceHost service = CreateService(communicator);
+
+        service.Open();
+
+        return service;
+      }
+      catch (AddressAlreadyInUseException) {
+        return StartService(communicator);
+      }
+    }
+
+    private MPI.Communicator communicator;
+
+    public AlgorithmBroker(MPI.Communicator communicator) {
+      this.communicator = communicator;
+      ExitWaitHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
+    }
+
+    #region IAlgorithmBroker Members
+
+    public void TransmitAlgorithm(MPITransportWrapper<IAlgorithm> algorithm) {
+      Console.WriteLine("Transmitting Algorithm...");
+      int clients = MPI.Communicator.world.Group.Size;
+
+      for(int i = 0; i < clients; i++) {
+        int client = i + 1;
+        communicator.Send<MPITransportWrapper<IAlgorithm>>(algorithm, client, 0);
+      }
+    }
+
+    public ItemList<ResultCollection> Results { get; set; }
+
+    public MPITransportWrapper<ItemList<ResultCollection>> GetResults() {
+      Console.WriteLine("Transmitting Results...");
+      return new MPITransportWrapper<ItemList<ResultCollection>>(Results);
+    }
+
+    public EventWaitHandle ExitWaitHandle { get; private set; }
+
+    public bool Terminated { get; set; }
+
+    public bool IsAlgorithmTerminated() {
+      lock (ExitWaitHandle) {
+        if (Terminated)
+          ExitWaitHandle.Set();
+        return Terminated;
+      }
+    }
+    #endregion
+  }
+}
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj	(revision 6392)
@@ -0,0 +1,189 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{62C3B458-430E-4EF4-8250-C50BCF94D035}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.MPIAlgorithmRunner</RootNamespace>
+    <AssemblyName>HeuristicLab.MPIAlgorithmRunner-3.3</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <TargetFrameworkProfile>Client</TargetFrameworkProfile>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\MPIAlgorithmRunner.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\MPIAlgorithmRunner.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>bin\x64\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Debug\MPIAlgorithmRunner.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+    <CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
+    <CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>bin\x64\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <CodeAnalysisLogFile>bin\Release\MPIAlgorithmRunner.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
+    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
+    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
+    <CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Microsoft.Hpc.Scheduler, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+      <HintPath>Microsoft.Hpc.Scheduler.dll</HintPath>
+    </Reference>
+    <Reference Include="MPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=29b4a045737654fe, processorArchitecture=MSIL">
+      <HintPath>..\HeuristicLab.ExtLibs\HeuristicLab.MPInet\1.0.0\MPI.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.ServiceModel" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="AlgorithmBroker.cs" />
+    <Compile Include="HeuristicLabMPIAlgorithmRunnerPlugin.cs" />
+    <Compile Include="IAlgorithmBroker.cs" />
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </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>
+      <Name>HeuristicLab.Common-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
+      <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">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\1.0.0\HeuristicLab.MPInet-1.0.0.csproj">
+      <Project>{C47EEE60-DF91-46DB-9B78-F2C2301D6FE7}</Project>
+      <Name>HeuristicLab.MPInet-1.0.0</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.Optimization\3.3\HeuristicLab.Optimization-3.3.csproj">
+      <Project>{14AB8D24-25BC-400C-A846-4627AA945192}</Project>
+      <Name>HeuristicLab.Optimization-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
+      <Project>{102BC7D3-0EF9-439C-8F6D-96FF0FDB8E1B}</Project>
+      <Name>HeuristicLab.Persistence-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame" />
+    <None Include="Properties\AssemblyInfo.frame" />
+    <None Include="MPI_ISLAND_GA.hl">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="Howto.txt" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd
+SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabMPIAlgorithmRunnerPlugin.cs"</PreBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame	(revision 6392)
@@ -0,0 +1,40 @@
+#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 HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.MPIAlgorithmRunner {
+  /// <summary>
+  /// Plugin class for HeuristicLab.MPIAlgorithmRunner plugin
+  /// </summary>
+  [Plugin("HeuristicLab.MPIAlgorithmRunner", "3.3.4.$WCREV$")]
+  [PluginFile("HeuristicLab.MPIAlgorithmRunner-3.3.exe", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.MPInet", "1.0.0")]
+  [PluginDependency("HeuristicLab.Operators.MPISupport", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Operators.MPISupport", "3.3")]
+  public class HeuristicLabProblemsVehicleRoutingPlugin : PluginBase {
+  }
+}
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Howto.txt
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Howto.txt	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Howto.txt	(revision 6392)
@@ -0,0 +1,2 @@
+﻿-> Download the Microsoft Compute Cluser Pack from http://www.microsoft.com/downloads/en/details.aspx?FamilyID=D8462378-2F68-409D-9CB3-02312BC23BFD
+-> Execute the parallel version using mpiexec.exe -n 2 MPIAlgorithmRunner.exe MPI_ISLAND_GA.hl MPI_ISLAND_GA_RESULT
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs	(revision 6392)
@@ -0,0 +1,43 @@
+﻿#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.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.ServiceModel;
+using HeuristicLab.Optimization;
+using HeuristicLab.Operators.MPISupport;
+using HeuristicLab.Core;
+
+namespace HeuristicLab.MPIAlgorithmRunner {
+  [ServiceContract]
+  public interface IAlgorithmBroker {
+    [OperationContract]
+    void TransmitAlgorithm(MPITransportWrapper<IAlgorithm> algorithm);
+
+    [OperationContract]
+    MPITransportWrapper<ItemList<ResultCollection>> GetResults();
+
+    [OperationContract]
+    bool IsAlgorithmTerminated();
+  }
+}
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs	(revision 6392)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs	(revision 6392)
@@ -0,0 +1,163 @@
+﻿#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.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.Xml;
+using System.Threading;
+using HeuristicLab.Operators.MPISupport;
+using HeuristicLab.Core;
+using Microsoft.Hpc.Scheduler;
+using System.ServiceModel;
+using System.Net;
+
+namespace HeuristicLab.MPIAlgorithmRunner {
+  class Program {
+    EventWaitHandle waitHandle = new EventWaitHandle(false, EventResetMode.ManualReset);
+
+    private static void SetJobStatus(string address) {
+      Console.WriteLine("Started service... at " + address);
+
+      // Discover the job's context from the environment
+      String headNodeName = System.Environment.GetEnvironmentVariable("CCP_CLUSTER_NAME");
+      int jobId = System.Convert.ToInt32(System.Environment.GetEnvironmentVariable("CCP_JOBID"));
+
+      // Connect to the head node and get the job
+      IScheduler scheduler = new Scheduler();
+      scheduler.Connect(headNodeName);
+      ISchedulerJob job = scheduler.OpenJob(jobId);
+
+      job.SetCustomProperty("address", address);
+
+      job.Commit();
+    }
+
+    private static string GetAddress(ServiceHost service) {
+      IPHostEntry IPHost = Dns.GetHostByName(Dns.GetHostName());
+      string address = "net.tcp://" + IPHost.AddressList[0].ToString() + ":" + service.ChannelDispatchers[0].Listener.Uri.Port + "/AlgorithmBroker";
+
+      return address;
+    }
+
+    static void Main(string[] args) {
+      using (new MPI.Environment(ref args)) {
+        int clients = MPI.Communicator.world.Group.Size;
+        int updateInterval = 5000;
+
+        MPI.Communicator communicator = MPI.Communicator.world.Clone() as MPI.Communicator;
+
+        if (communicator.Rank == 0) {
+          ServiceHost service = AlgorithmBroker.StartService(communicator);
+          AlgorithmBroker broker = (service.SingletonInstance as AlgorithmBroker);
+
+          string address = GetAddress(service);
+          SetJobStatus(address);
+
+          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");
+            broker.Results = results;
+          }
+
+          lock (broker.ExitWaitHandle) {
+            broker.Terminated = true;
+          }
+
+          broker.ExitWaitHandle.WaitOne();
+          Console.WriteLine("Finished.");
+          service.Close();
+        } else {
+          Program p = new Program();
+          p.StartAlgorithm(updateInterval, communicator);
+        }
+      }
+    }
+
+    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);
+      waitHandle.Reset();
+
+      alg.Prepare(true);
+      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();
+
+      communicator.Send<int>(communicator.Rank, 0, 2);
+      communicator.Send<MPITransportWrapper<ResultCollection>>(
+          new MPITransportWrapper<ResultCollection>(alg.Results), 0, 1);
+    }
+
+    void algorithm_Stopped(object sender, EventArgs e) {
+      waitHandle.Set();
+    }
+  }
+}
