Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs	(revision 6400)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs	(revision 6401)
@@ -33,6 +33,24 @@
 using System.Threading;
 using System.Xml;
+using System.IO;
+using HeuristicLab.Persistence.Default.Xml;
                      
 namespace HeuristicLab.MPIAlgorithmRunner {
+  public class StreamingHelper {
+    public static IItem StreamItem(Stream stream) {
+      using (MemoryStream memoryStream = new MemoryStream()) {
+        byte[] buffer = new byte[256];
+        int read;
+        while ((read = stream.Read(buffer, 0, buffer.Length)) != 0)
+          memoryStream.Write(buffer, 0, read);
+
+        using (MemoryStream itemStream = new MemoryStream(memoryStream.GetBuffer())) {
+          IItem result = XmlParser.Deserialize(itemStream) as IItem;
+          return result;
+        }
+      }
+    }
+  }
+
   [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single)]
   class AlgorithmBroker: IAlgorithmBroker {
@@ -54,10 +72,6 @@
       endpoint.Name = "AlgorithmBrokerEndpoint";
       NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None);
+      netTCPBinding.TransferMode = TransferMode.Streamed;
       netTCPBinding.MaxReceivedMessageSize = int.MaxValue;
-      XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas();
-      quotas.MaxArrayLength = int.MaxValue;
-      netTCPBinding.ReaderQuotas = quotas;
-      netTCPBinding.SendTimeout = new TimeSpan(600000000);
-      netTCPBinding.ReceiveTimeout = new TimeSpan(600000000);
       endpoint.Binding = netTCPBinding;
       int port = FindFreeTcpPort();
@@ -92,20 +106,39 @@
     #region IAlgorithmBroker Members
 
-    public void TransmitAlgorithm(MPITransportWrapper<IAlgorithm> algorithm, int updateInterval) {
-      Console.WriteLine("Transmitting Algorithm...");
+    public void SetUpdateInterval(int updateInterval) {
+      Console.WriteLine("Set update interval...");
+
       int clients = MPI.Communicator.world.Group.Size - 1;
-
-      for(int i = 0; i < clients; i++) {
+      for (int i = 0; i < clients; i++) {
         int client = i + 1;
-        communicator.Send<MPITransportWrapper<IAlgorithm>>(algorithm, client, 0);
         communicator.Send<int>(updateInterval, client, 1);
       }
     }
 
+    public void TransmitAlgorithm(Stream stream) {
+      Console.WriteLine("Transmitting Algorithm...");
+
+      IAlgorithm alg = StreamingHelper.StreamItem(stream) as IAlgorithm;
+      MPITransportWrapper<IAlgorithm> algorithm = new MPITransportWrapper<IAlgorithm>(alg);
+
+      int clients = MPI.Communicator.world.Group.Size - 1;
+      for(int i = 0; i < clients; i++) {
+        int client = i + 1;
+        communicator.Send<MPITransportWrapper<IAlgorithm>>(algorithm, client, 0);
+      }
+    }
+
+    public object resultLocker = new object();
     public ItemList<ResultCollection> Results { get; set; }
 
-    public MPITransportWrapper<ItemList<ResultCollection>> GetResults() {
+    public Stream GetResults() {
       Console.WriteLine("Transmitting Results...");
-      return new MPITransportWrapper<ItemList<ResultCollection>>(Results);
+      MemoryStream stream = new MemoryStream();
+      lock (resultLocker) {
+        XmlGenerator.Serialize(Results, stream);
+      }
+      stream = new MemoryStream((stream as MemoryStream).GetBuffer());
+
+      return stream;
     }
 
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs	(revision 6400)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/IAlgorithmBroker.cs	(revision 6401)
@@ -28,4 +28,5 @@
 using HeuristicLab.Operators.MPISupport;
 using HeuristicLab.Core;
+using System.IO;
 
 namespace HeuristicLab.MPIAlgorithmRunner {
@@ -33,8 +34,11 @@
   public interface IAlgorithmBroker {
     [OperationContract]
-    void TransmitAlgorithm(MPITransportWrapper<IAlgorithm> algorithm, int updateInterval);
+    void SetUpdateInterval(int updateInterval);
+    
+    [OperationContract]
+    void TransmitAlgorithm(Stream stream);
 
     [OperationContract]
-    MPITransportWrapper<ItemList<ResultCollection>> GetResults();
+    Stream GetResults();
 
     [OperationContract]
Index: /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs	(revision 6400)
+++ /branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs	(revision 6401)
@@ -77,10 +77,10 @@
           SetJobStatus(address);
 
-          ItemList<ResultCollection> results = new ItemList<ResultCollection>();
-          
           bool[] finished = new bool[clients];
           int finishedCount = 0;
 
           while (finishedCount != clients) {
+            ItemList<ResultCollection> results = new ItemList<ResultCollection>();
+
             for (int i = 0; i < clients; i++) {
               if (!finished[i]) {
@@ -105,5 +105,6 @@
 
             Console.WriteLine("Update results");
-            broker.Results = results;
+            lock (broker.resultLocker)
+              broker.Results = results;
           }
 
@@ -114,4 +115,5 @@
           broker.ExitWaitHandle.WaitOne();
           Console.WriteLine("Finished.");
+          Thread.Sleep(1000);
           service.Close();
         } else {
Index: /branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs
===================================================================
--- /branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs	(revision 6400)
+++ /branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs	(revision 6401)
@@ -229,6 +229,6 @@
         task.StdOutFilePath = "stdout.txt";
         task.StdErrFilePath = "stderr.txt";
-        task.WorkDirectory = path; 
-        task.MinimumNumberOfCores = task.MaximumNumberOfCores = 3;
+        task.WorkDirectory = path;
+        task.MinimumNumberOfCores = task.MaximumNumberOfCores = cpuPerNode * requestedNodes.Count;
         job.AddTask(task);
 
@@ -260,19 +260,20 @@
 
           NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None);
-          XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas();
-          quotas.MaxArrayLength = int.MaxValue;
-          netTCPBinding.ReaderQuotas = quotas;
+          netTCPBinding.TransferMode = TransferMode.Streamed;
           netTCPBinding.MaxReceivedMessageSize = int.MaxValue;
-          netTCPBinding.SendTimeout = new TimeSpan(600000000);
-          netTCPBinding.ReceiveTimeout = new TimeSpan(600000000);
           ChannelFactory<IAlgorithmBroker> factory = new ChannelFactory<IAlgorithmBroker>(netTCPBinding, address);
           IAlgorithmBroker proxy = factory.CreateChannel();
 
-          proxy.TransmitAlgorithm(new MPITransportWrapper<IAlgorithm>(algorithm), updateInterval);
+          Stream stream = new MemoryStream();
+          XmlGenerator.Serialize(algorithm, stream);
+          stream = new MemoryStream((stream as MemoryStream).GetBuffer());
+
+          proxy.TransmitAlgorithm(stream);
+          proxy.SetUpdateInterval(updateInterval);
 
           while (!proxy.IsAlgorithmTerminated()) {
             cancellationToken.ThrowIfCancellationRequested();
 
-            ItemList<ResultCollection> results = proxy.GetResults().InnerItem;
+            ItemList<ResultCollection> results = StreamingHelper.StreamItem(proxy.GetResults()) as ItemList<ResultCollection>;
 
             ResultCollection resultCollection = (globalScope.Variables["Results"].Value as ResultCollection);
@@ -292,11 +293,4 @@
           throw e;
         }
-        finally {
-           /*ISchedulerJob schedulerJob = scheduler.OpenJob(job.Id);
-           if (schedulerJob != null &&
-             (schedulerJob.State == JobState.Running || schedulerJob.State == JobState.Queued)) {
-               scheduler.CancelJob(job.Id, "Cancelled");            
-           } */
-        }
       }
     }
Index: /branches/MPI/HeuristicLab.Operators.MPISupport/3.3/MPITransportWrapper.cs
===================================================================
--- /branches/MPI/HeuristicLab.Operators.MPISupport/3.3/MPITransportWrapper.cs	(revision 6400)
+++ /branches/MPI/HeuristicLab.Operators.MPISupport/3.3/MPITransportWrapper.cs	(revision 6401)
@@ -45,5 +45,5 @@
 
     public MPITransportWrapper(T item) {
-      innerItem = item;
+      innerItem = item.Clone() as T;
     }
 
