Changeset 6401 for branches/MPI/HeuristicLab.MPIEngine
- Timestamp:
- 06/09/11 12:52:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs ¶
r6400 r6401 229 229 task.StdOutFilePath = "stdout.txt"; 230 230 task.StdErrFilePath = "stderr.txt"; 231 task.WorkDirectory = path; 232 task.MinimumNumberOfCores = task.MaximumNumberOfCores = 3;231 task.WorkDirectory = path; 232 task.MinimumNumberOfCores = task.MaximumNumberOfCores = cpuPerNode * requestedNodes.Count; 233 233 job.AddTask(task); 234 234 … … 260 260 261 261 NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None); 262 XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas(); 263 quotas.MaxArrayLength = int.MaxValue; 264 netTCPBinding.ReaderQuotas = quotas; 262 netTCPBinding.TransferMode = TransferMode.Streamed; 265 263 netTCPBinding.MaxReceivedMessageSize = int.MaxValue; 266 netTCPBinding.SendTimeout = new TimeSpan(600000000);267 netTCPBinding.ReceiveTimeout = new TimeSpan(600000000);268 264 ChannelFactory<IAlgorithmBroker> factory = new ChannelFactory<IAlgorithmBroker>(netTCPBinding, address); 269 265 IAlgorithmBroker proxy = factory.CreateChannel(); 270 266 271 proxy.TransmitAlgorithm(new MPITransportWrapper<IAlgorithm>(algorithm), updateInterval); 267 Stream stream = new MemoryStream(); 268 XmlGenerator.Serialize(algorithm, stream); 269 stream = new MemoryStream((stream as MemoryStream).GetBuffer()); 270 271 proxy.TransmitAlgorithm(stream); 272 proxy.SetUpdateInterval(updateInterval); 272 273 273 274 while (!proxy.IsAlgorithmTerminated()) { 274 275 cancellationToken.ThrowIfCancellationRequested(); 275 276 276 ItemList<ResultCollection> results = proxy.GetResults().InnerItem;277 ItemList<ResultCollection> results = StreamingHelper.StreamItem(proxy.GetResults()) as ItemList<ResultCollection>; 277 278 278 279 ResultCollection resultCollection = (globalScope.Variables["Results"].Value as ResultCollection); … … 292 293 throw e; 293 294 } 294 finally {295 /*ISchedulerJob schedulerJob = scheduler.OpenJob(job.Id);296 if (schedulerJob != null &&297 (schedulerJob.State == JobState.Running || schedulerJob.State == JobState.Queued)) {298 scheduler.CancelJob(job.Id, "Cancelled");299 } */300 }301 295 } 302 296 }
Note: See TracChangeset
for help on using the changeset viewer.