Changeset 6394
- Timestamp:
- 06/08/11 14:26:36 (14 years ago)
- Location:
- branches/MPI
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/MPI/HeuristicLab.ExtLibs/HeuristicLab.MPInet/1.0.0/HeuristicLab.MPInet-1.0.0.csproj
r6393 r6394 168 168 </PropertyGroup> 169 169 <PropertyGroup> 170 <PostBuildEvent> 171 </PostBuildEvent> 170 <PostBuildEvent>set ProjectName=$(ProjectName) 171 set Source=$(TargetPath) 172 set Configuration=$(ConfigurationName) 173 set Platform=$(PlatformName) 174 set SolutionDir=$(SolutionDir) 175 176 if exist "$(SolutionDir)CustomPostBuild.cmd" call "$(SolutionDir)CustomPostBuild.cmd"</PostBuildEvent> 172 177 </PropertyGroup> 173 178 </Project> -
branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/AlgorithmBroker.cs
r6388 r6394 32 32 using HeuristicLab.Core; 33 33 using System.Threading; 34 using System.Xml; 34 35 35 36 namespace HeuristicLab.MPIAlgorithmRunner { … … 53 54 endpoint.Name = "AlgorithmBrokerEndpoint"; 54 55 NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None); 56 netTCPBinding.MaxReceivedMessageSize = int.MaxValue; 57 XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas(); 58 quotas.MaxArrayLength = int.MaxValue; 59 netTCPBinding.ReaderQuotas = quotas; 55 60 endpoint.Binding = netTCPBinding; 56 61 int port = FindFreeTcpPort(); 57 62 endpoint.Address = new EndpointAddress("net.tcp://localhost:" + port + "/AlgorithmBroker"); 58 63 service.AddServiceEndpoint(endpoint); 64 ServiceDebugBehavior debug = service.Description.Behaviors.Find<ServiceDebugBehavior>(); 65 debug.IncludeExceptionDetailInFaults = true; 59 66 60 67 return service; … … 85 92 public void TransmitAlgorithm(MPITransportWrapper<IAlgorithm> algorithm) { 86 93 Console.WriteLine("Transmitting Algorithm..."); 87 int clients = MPI.Communicator.world.Group.Size ;94 int clients = MPI.Communicator.world.Group.Size - 1; 88 95 89 96 for(int i = 0; i < clients; i++) { -
branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/HeuristicLab.MPIAlgorithmRunner-3.3.csproj
r6393 r6394 129 129 <Reference Include="System" /> 130 130 <Reference Include="System.Core" /> 131 <Reference Include="System.Runtime.Serialization" /> 131 132 <Reference Include="System.ServiceModel" /> 132 133 <Reference Include="System.Xml.Linq" /> … … 168 169 SubWCRev "%25ProjectDir%25\" "%25ProjectDir%25\HeuristicLabMPIAlgorithmRunnerPlugin.cs.frame" "%25ProjectDir%25\HeuristicLabMPIAlgorithmRunnerPlugin.cs"</PreBuildEvent> 169 170 </PropertyGroup> 171 <PropertyGroup> 172 <PostBuildEvent>set ProjectName=$(ProjectName) 173 set Source=$(TargetPath) 174 set Configuration=$(ConfigurationName) 175 set Platform=$(PlatformName) 176 set SolutionDir=$(SolutionDir) 177 178 if exist "$(SolutionDir)CustomPostBuild.cmd" call "$(SolutionDir)CustomPostBuild.cmd"</PostBuildEvent> 179 </PropertyGroup> 170 180 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 171 181 Other similar extension points exist, see Microsoft.Common.targets. -
branches/MPI/HeuristicLab.MPIAlgorithmRunner/3.3/Program.cs
r6388 r6394 41 41 42 42 // Discover the job's context from the environment 43 String headNodeName = System.Environment.GetEnvironmentVariable("CCP_ CLUSTER_NAME");43 String headNodeName = System.Environment.GetEnvironmentVariable("CCP_SCHEDULER"); 44 44 int jobId = System.Convert.ToInt32(System.Environment.GetEnvironmentVariable("CCP_JOBID")); 45 46 Console.WriteLine(jobId + "@" + headNodeName); 45 47 46 48 // Connect to the head node and get the job … … 63 65 static void Main(string[] args) { 64 66 using (new MPI.Environment(ref args)) { 65 int clients = MPI.Communicator.world.Group.Size; 67 int clients = MPI.Communicator.world.Group.Size - 1; 68 Console.WriteLine("Clients: " + clients); 69 66 70 int updateInterval = 5000; 67 71 -
branches/MPI/HeuristicLab.MPIEngine/3.3/HeuristicLab.MPIEngine-3.3.csproj
r6393 r6394 128 128 <HintPath>..\..\HeuristicLab.ExtLibs\HeuristicLab.MPInet\MPIAlgorithmRunner\3.3\Microsoft.Hpc.Scheduler.dll</HintPath> 129 129 </Reference> 130 <Reference Include="Microsoft.Hpc.Scheduler.Properties, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> 131 <HintPath>..\..\Microsoft.Hpc.Scheduler.Properties.dll</HintPath> 132 </Reference> 130 133 <Reference Include="System" /> 131 134 <Reference Include="System.Core" /> 135 <Reference Include="System.Runtime.Serialization" /> 132 136 <Reference Include="System.ServiceModel" /> 133 137 <Reference Include="System.Xml.Linq" /> -
branches/MPI/HeuristicLab.MPIEngine/3.3/MPIEngine.cs
r6388 r6394 35 35 using HeuristicLab.MPIAlgorithmRunner; 36 36 using HeuristicLab.Operators.MPISupport; 37 using Microsoft.Hpc.Scheduler.Properties; 38 using System.Xml; 37 39 38 40 namespace HeuristicLab.MPIEngine { … … 74 76 } 75 77 78 protected override void OnPaused() { 79 base.OnPaused(); 80 81 Stop(); 82 } 83 76 84 protected override void Run(System.Threading.CancellationToken cancellationToken) { 85 string username = @"user"; 86 string password = @"password"; 87 string headNode = "blade00.hpc.fh-hagenberg.at"; 88 List<string> requestedNodes = new List<string>(); 89 requestedNodes.Add("BLADE00"); 90 string path = @"C:\public\MPISupport"; 91 int cpuPerNode = 8; 92 77 93 if (ExecutionStack.Count == 1) { 78 94 ExecutionContext context = ExecutionStack.Pop() as ExecutionContext; … … 81 97 82 98 string exec = @"mpiexec"; 83 string args = @"-c 3 C:\public\MPISupport\HeuristicLab.MPIAlgorithmRunner-3.3.exe";99 string args = @"-c " + cpuPerNode + " /genvlist CCP_JOBID " + path + @"\HeuristicLab.MPIAlgorithmRunner-3.3.exe"; 84 100 85 101 IScheduler scheduler = new Scheduler(); 86 scheduler.Connect( "blade00.hpc.fh-hagenberg.at");102 scheduler.Connect(headNode); 87 103 88 104 ISchedulerJob job = scheduler.CreateJob(); 89 105 job.Name = "HeuristicLab.MPIEngine"; 90 job.RequestedNodes.Add("BLADE03"); 106 foreach (string requestedNode in requestedNodes) 107 job.RequestedNodes.Add(requestedNode); 91 108 ISchedulerTask task = job.CreateTask(); 92 109 task.Name = "HeuristicLab.MPIAlgorithmRunner"; … … 94 111 task.StdOutFilePath = "stdout.txt"; 95 112 task.StdErrFilePath = "stderr.txt"; 113 task.WorkDirectory = path; 96 114 task.MinimumNumberOfCores = task.MaximumNumberOfCores = 3; 97 115 job.AddTask(task); 98 116 99 scheduler.SubmitJob(job, @"HPC\svonolfe", @"Vunkopf!3");117 scheduler.SubmitJob(job, username, ""); 100 118 101 119 try { … … 104 122 105 123 while (address == null && timeout > 0) { 124 cancellationToken.ThrowIfCancellationRequested(); 125 106 126 ISchedulerJob schedulerJob = scheduler.OpenJob(job.Id); 107 127 if (schedulerJob != null) { 108 INameValueCollection properties = schedulerJob.GetCustomProperties();109 NameValue item = properties.FirstOrDefault(i => i.Name == "address"); 110 if ( item!= null) {111 address = item.Value;128 NameValue property = schedulerJob.GetCustomProperties().FirstOrDefault(p => p.Name == "address"); 129 130 if (property != null) { 131 address = property.Value; 112 132 } else { 113 133 System.Threading.Thread.Sleep(1000); 114 134 timeout--; 115 135 } 116 } 136 } 117 137 } 118 138 … … 122 142 123 143 NetTcpBinding netTCPBinding = new NetTcpBinding(SecurityMode.None); 144 XmlDictionaryReaderQuotas quotas = new XmlDictionaryReaderQuotas(); 145 quotas.MaxArrayLength = int.MaxValue; 146 netTCPBinding.ReaderQuotas = quotas; 147 netTCPBinding.MaxReceivedMessageSize = int.MaxValue; 124 148 ChannelFactory<IAlgorithmBroker> factory = new ChannelFactory<IAlgorithmBroker>(netTCPBinding, address); 125 149 IAlgorithmBroker proxy = factory.CreateChannel(); … … 128 152 129 153 while (!proxy.IsAlgorithmTerminated()) { 154 cancellationToken.ThrowIfCancellationRequested(); 155 130 156 ItemList<ResultCollection> results = proxy.GetResults().InnerItem; 131 157 … … 143 169 } 144 170 catch (Exception e) { 145 scheduler.CancelJob(job.Id, "Exception: " + e. Message);171 scheduler.CancelJob(job.Id, "Exception: " + e.GetType()); 146 172 throw e; 173 } 174 finally { 175 /*ISchedulerJob schedulerJob = scheduler.OpenJob(job.Id); 176 if (schedulerJob != null && 177 (schedulerJob.State == JobState.Running || schedulerJob.State == JobState.Queued)) { 178 scheduler.CancelJob(job.Id, "Cancelled"); 179 } */ 147 180 } 148 181 } -
branches/MPI/HeuristicLab.Operators.MPISupport/3.3/MPITransportWrapper.cs
r6354 r6394 49 49 50 50 protected MPITransportWrapper(SerializationInfo info, StreamingContext context) { 51 MemoryStream stream = new MemoryStream(info.GetValue("Item", typeof(byte[])) as byte[]);52 if ( stream!= null)53 innerItem = XmlParser.Deserialize( stream) as T;51 byte[] buffer = info.GetValue("Item", typeof(byte[])) as byte[]; 52 if (buffer != null) 53 innerItem = XmlParser.Deserialize(new MemoryStream(buffer)) as T; 54 54 else 55 55 innerItem = null;
Note: See TracChangeset
for help on using the changeset viewer.