- Timestamp:
- 06/18/09 15:01:10 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 9 added
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/GridExecuter.cs
r2057 r2058 53 53 } 54 54 55 public GridExecuter(IDispatcher dispatcher, IStore store, string gridUrl)55 public GridExecuter(IDispatcher dispatcher, IStore store, IGridServer server) 56 56 : base(dispatcher, store) { 57 this.jobManager = new JobManager( gridUrl);57 this.jobManager = new JobManager(server); 58 58 activeAlgorithms = new Dictionary<AsyncGridResult, IAlgorithm>(); 59 59 jobManager.Reset(); -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLab.CEDMA.Server-3.3.csproj
r2057 r2058 92 92 <ItemGroup> 93 93 <Compile Include="ExecuterBase.cs" /> 94 <Compile Include="HiveExecuter.cs">95 <SubType>Code</SubType>96 </Compile>97 94 <Compile Include="IExecuter.cs" /> 98 95 <Compile Include="DispatcherBase.cs" /> … … 136 133 <Name>HeuristicLab.Data-3.2</Name> 137 134 </ProjectReference> 135 <ProjectReference Include="..\..\HeuristicLab.Grid.HiveBridge\3.2\HeuristicLab.Grid.HiveBridge-3.2.csproj"> 136 <Project>{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}</Project> 137 <Name>HeuristicLab.Grid.HiveBridge-3.2</Name> 138 </ProjectReference> 138 139 <ProjectReference Include="..\..\HeuristicLab.Grid\3.2\HeuristicLab.Grid-3.2.csproj"> 139 140 <Project>{545CE756-98D8-423B-AC2E-6E7D70926E5C}</Project> 140 141 <Name>HeuristicLab.Grid-3.2</Name> 141 </ProjectReference>142 <ProjectReference Include="..\..\HeuristicLab.Hive.Engine\3.2\HeuristicLab.Hive.Engine-3.2.csproj">143 <Project>{C8FEDAC1-0326-4293-B585-F0FEDDEDFC11}</Project>144 <Name>HeuristicLab.Hive.Engine-3.2</Name>145 142 </ProjectReference> 146 143 <ProjectReference Include="..\..\HeuristicLab.Modeling\3.2\HeuristicLab.Modeling-3.2.csproj"> -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/HeuristicLabCedmaServerPlugin.cs
r2057 r2058 31 31 [Dependency(Dependency = "HeuristicLab.CEDMA.DB-3.3")] 32 32 [Dependency(Dependency = "HeuristicLab.Grid-3.2")] 33 [Dependency(Dependency = "HeuristicLab.Grid.HiveBridge-3.2")] 33 34 [Dependency(Dependency = "HeuristicLab.Core-3.2")] 34 35 [Dependency(Dependency = "HeuristicLab.Data-3.2")] -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/Server.cs
r2050 r2058 30 30 using HeuristicLab.CEDMA.DB; 31 31 using System.ServiceModel.Description; 32 using HeuristicLab.Grid; 33 using HeuristicLab.Grid.HiveBridge; 32 34 33 35 namespace HeuristicLab.CEDMA.Server { … … 105 107 internal void Connect(string serverUrl) { 106 108 dispatcher = new SimpleDispatcher(store); 109 IGridServer gridServer = null; 107 110 if (serverUrl.Contains("ExecutionEngine")) { 108 executer = new HiveExecuter(dispatcher, store,serverUrl);111 gridServer = new HiveGridServerWrapper(serverUrl); 109 112 } else { 110 113 // default is grid backend 111 executer = new GridExecuter(dispatcher, store,serverUrl);114 gridServer = new GridServerProxy(serverUrl); 112 115 } 116 executer = new GridExecuter(dispatcher, store, gridServer); 113 117 executer.Start(); 114 118 } -
trunk/sources/HeuristicLab.DistributedEngine/3.2/DistributedEngine.cs
r2055 r2058 72 72 73 73 public override void Execute() { 74 if (jobManager == null) this.jobManager = new JobManager( serverAddress);74 if (jobManager == null) this.jobManager = new JobManager(new GridServerProxy(serverAddress)); 75 75 jobManager.Reset(); 76 76 base.Execute(); -
trunk/sources/HeuristicLab.Grid/3.2/HeuristicLab.Grid-3.2.csproj
r2055 r2058 99 99 </Compile> 100 100 <Compile Include="AsyncGridResult.cs" /> 101 <Compile Include="GridServerProxy.cs" /> 101 102 <Compile Include="Database.cs" /> 102 103 <Compile Include="EngineRunner.cs" /> … … 128 129 <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project> 129 130 <Name>HeuristicLab.PluginInfrastructure</Name> 131 </ProjectReference> 132 <ProjectReference Include="..\..\HeuristicLab.Tracing\3.2\HeuristicLab.Tracing-3.2.csproj"> 133 <Project>{EE2034D9-6E27-48A1-B855-42D45F69A4FC}</Project> 134 <Name>HeuristicLab.Tracing-3.2</Name> 130 135 </ProjectReference> 131 136 </ItemGroup> -
trunk/sources/HeuristicLab.Grid/3.2/HeuristicLabGridPlugin.cs
r1529 r2058 30 30 [PluginFile(Filename = "HeuristicLab.Grid-3.2.dll", Filetype = PluginFileType.Assembly)] 31 31 [Dependency(Dependency = "HeuristicLab.Core-3.2")] 32 [Dependency(Dependency = "HeuristicLab.Tracing-3.2")] 32 33 public class HeuristicLabGridPlugin : PluginBase { 33 34 } -
trunk/sources/HeuristicLab.Grid/3.2/JobManager.cs
r2055 r2058 39 39 public class JobManager { 40 40 private const int MAX_RESTARTS = 5; 41 private const int MAX_CONNECTION_RETRIES = 10;42 private const int RETRY_TIMEOUT_SEC = 60;43 41 private const int RESULT_POLLING_TIMEOUT = 5; 44 42 … … 49 47 private object runningQueueLock = new object(); 50 48 private Queue<AsyncGridResult> runningJobs = new Queue<AsyncGridResult>(); 51 private object connectionLock = new object();52 53 49 private AutoResetEvent runningWaitHandle = new AutoResetEvent(false); 54 50 private AutoResetEvent waitingWaitHandle = new AutoResetEvent(false); 55 51 56 private ChannelFactory<IGridServer> factory;57 52 58 public JobManager( string address) {59 this. address = address;53 public JobManager(IGridServer server) { 54 this.server = server; 60 55 Thread starterThread = new Thread(StartEngines); 61 56 Thread resultsGatheringThread = new Thread(GetResults); … … 65 60 66 61 public void Reset() { 67 ResetConnection();68 62 lock (waitingQueueLock) { 69 63 foreach (AsyncGridResult r in waitingJobs) { … … 80 74 } 81 75 82 private void ResetConnection() {83 Trace.TraceInformation("Reset connection in JobManager");84 lock (connectionLock) {85 // open a new channel86 NetTcpBinding binding = new NetTcpBinding();87 binding.MaxReceivedMessageSize = 100000000; // 100Mbytes88 binding.ReaderQuotas.MaxStringContentLength = 100000000; // also 100M chars89 binding.ReaderQuotas.MaxArrayLength = 100000000; // also 100M elements;90 91 factory = new ChannelFactory<IGridServer>(binding);92 server = factory.CreateChannel(new EndpointAddress(address));93 }94 }95 76 96 77 public void StartEngines() { … … 103 84 if (job == null) waitingWaitHandle.WaitOne(); // no jobs waiting 104 85 else { 105 Guid currentEngineGuid = TryStartExecuteEngine(job.Engine);86 Guid currentEngineGuid = server.BeginExecuteEngine(ZipEngine(job.Engine)); 106 87 if (currentEngineGuid == Guid.Empty) { 107 88 // couldn't start the job -> requeue … … 141 122 if (job == null) runningWaitHandle.WaitOne(); // no jobs running 142 123 else { 143 byte[] zippedResult = TryEndExecuteEngine(server,job.Guid);124 byte[] zippedResult = server.TryEndExecuteEngine(job.Guid); 144 125 if (zippedResult != null) { 145 126 // successful => store result … … 149 130 } else { 150 131 // there was a problem -> check the state of the job and restart if necessary 151 JobState jobState = TryGetJobState(server,job.Guid);132 JobState jobState = server.JobState(job.Guid); 152 133 if (jobState == JobState.Unknown) { 153 134 job.Restarts++; … … 195 176 } 196 177 } 197 198 private Guid TryStartExecuteEngine(IEngine engine) {199 byte[] zippedEngine = ZipEngine(engine);200 return SavelyExecute(() => server.BeginExecuteEngine(zippedEngine));201 }202 203 private byte[] TryEndExecuteEngine(IGridServer server, Guid engineGuid) {204 return SavelyExecute(() => {205 byte[] zippedResult = server.TryEndExecuteEngine(engineGuid);206 return zippedResult;207 });208 }209 210 private JobState TryGetJobState(IGridServer server, Guid engineGuid) {211 return SavelyExecute(() => server.JobState(engineGuid));212 }213 214 private TResult SavelyExecute<TResult>(Func<TResult> a) {215 int retries = 0;216 do {217 try {218 lock (connectionLock) {219 return a();220 }221 }222 catch (TimeoutException) {223 retries++;224 Thread.Sleep(TimeSpan.FromSeconds(RETRY_TIMEOUT_SEC));225 }226 catch (CommunicationException) {227 ResetConnection();228 retries++;229 Thread.Sleep(TimeSpan.FromSeconds(RETRY_TIMEOUT_SEC));230 }231 } while (retries < MAX_CONNECTION_RETRIES);232 Trace.TraceWarning("Reached max connection retries");233 return default(TResult);234 }235 178 } 236 179 } -
trunk/sources/HeuristicLab.sln
r2035 r2058 230 230 EndProject 231 231 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Modeling-3.3", "HeuristicLab.Modeling\3.3\HeuristicLab.Modeling-3.3.csproj", "{3A5ACA94-47A7-47D6-B644-2B8A7503FCCC}" 232 EndProject 233 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Grid.HiveBridge-3.2", "HeuristicLab.Grid.HiveBridge\3.2\HeuristicLab.Grid.HiveBridge-3.2.csproj", "{DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}" 232 234 EndProject 233 235 Global … … 976 978 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.CEDMA Debug|x64.Build.0 = Debug|x64 977 979 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.CEDMA Debug|x86.ActiveCfg = Debug|x86 980 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.CEDMA Debug|x86.Build.0 = Debug|x86 978 981 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 979 982 {E66D1EAA-525C-4F6D-BD25-DBCAE3750E25}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1181 1184 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|x64.Build.0 = Debug|x64 1182 1185 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|x86.ActiveCfg = Debug|x86 1186 {74223A32-C726-4978-BE78-37113A18373C}.CEDMA Debug|x86.Build.0 = Debug|x86 1183 1187 {74223A32-C726-4978-BE78-37113A18373C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1184 1188 {74223A32-C726-4978-BE78-37113A18373C}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1216 1220 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|x64.Build.0 = Debug|x64 1217 1221 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|x86.ActiveCfg = Debug|x86 1222 {7C20D100-8BEB-433A-9499-F075E2CB9297}.CEDMA Debug|x86.Build.0 = Debug|x86 1218 1223 {7C20D100-8BEB-433A-9499-F075E2CB9297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1219 1224 {7C20D100-8BEB-433A-9499-F075E2CB9297}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1251 1256 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|x64.Build.0 = Debug|x64 1252 1257 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|x86.ActiveCfg = Debug|x86 1258 {6084CFB5-733F-449D-9F92-2E40D13F0514}.CEDMA Debug|x86.Build.0 = Debug|x86 1253 1259 {6084CFB5-733F-449D-9F92-2E40D13F0514}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1254 1260 {6084CFB5-733F-449D-9F92-2E40D13F0514}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1286 1292 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|x64.Build.0 = Debug|x64 1287 1293 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|x86.ActiveCfg = Debug|x86 1294 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.CEDMA Debug|x86.Build.0 = Debug|x86 1288 1295 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1289 1296 {545CE756-98D8-423B-AC2E-6E7D70926E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 1842 1849 {4095C92C-5A4C-44BC-9963-5F384CF5CC3F}.Modeling Debug|x64.Build.0 = Debug|x64 1843 1850 {4095C92C-5A4C-44BC-9963-5F384CF5CC3F}.Modeling Debug|x86.ActiveCfg = Debug|x86 1844 {4095C92C-5A4C-44BC-9963-5F384CF5CC3F}.Modeling Debug|x86.Build.0 = Debug|x861845 1851 {4095C92C-5A4C-44BC-9963-5F384CF5CC3F}.Release|Any CPU.ActiveCfg = Release|Any CPU 1846 1852 {4095C92C-5A4C-44BC-9963-5F384CF5CC3F}.Release|Any CPU.Build.0 = Release|Any CPU … … 3343 3349 {7E18E25A-BCEB-467A-BACC-ABCA73F9D655}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3344 3350 {7E18E25A-BCEB-467A-BACC-ABCA73F9D655}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3351 {7E18E25A-BCEB-467A-BACC-ABCA73F9D655}.CEDMA Debug|x86.Build.0 = Debug|x86 3345 3352 {7E18E25A-BCEB-467A-BACC-ABCA73F9D655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3346 3353 {7E18E25A-BCEB-467A-BACC-ABCA73F9D655}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3401 3408 {80F7FADA-549D-4151-8856-79B620A50DBA}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3402 3409 {80F7FADA-549D-4151-8856-79B620A50DBA}.CEDMA Debug|x86.ActiveCfg = Debug|x86 3410 {80F7FADA-549D-4151-8856-79B620A50DBA}.CEDMA Debug|x86.Build.0 = Debug|x86 3403 3411 {80F7FADA-549D-4151-8856-79B620A50DBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3404 3412 {80F7FADA-549D-4151-8856-79B620A50DBA}.Debug|Any CPU.Build.0 = Debug|Any CPU … … 3851 3859 {3A5ACA94-47A7-47D6-B644-2B8A7503FCCC}.Visualization Debug|x86.ActiveCfg = Debug|x86 3852 3860 {3A5ACA94-47A7-47D6-B644-2B8A7503FCCC}.Visualization Debug|x86.Build.0 = Debug|x86 3861 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|Any CPU.ActiveCfg = Debug|Any CPU 3862 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|Any CPU.Build.0 = Debug|Any CPU 3863 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x64.ActiveCfg = Debug|Any CPU 3864 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.CEDMA Debug|x86.ActiveCfg = Debug|Any CPU 3865 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 3866 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|Any CPU.Build.0 = Debug|Any CPU 3867 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|x64.ActiveCfg = Debug|Any CPU 3868 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|x86.ActiveCfg = Debug|x86 3869 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Debug|x86.Build.0 = Debug|x86 3870 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Modeling Debug|Any CPU.ActiveCfg = Debug|Any CPU 3871 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Modeling Debug|Any CPU.Build.0 = Debug|Any CPU 3872 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Modeling Debug|x64.ActiveCfg = Debug|Any CPU 3873 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Modeling Debug|x86.ActiveCfg = Debug|Any CPU 3874 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Release|Any CPU.ActiveCfg = Release|Any CPU 3875 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Release|Any CPU.Build.0 = Release|Any CPU 3876 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Release|x64.ActiveCfg = Release|Any CPU 3877 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Release|x86.ActiveCfg = Release|Any CPU 3878 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.v3.2 Debug|Any CPU.ActiveCfg = Debug|Any CPU 3879 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.v3.2 Debug|Any CPU.Build.0 = Debug|Any CPU 3880 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.v3.2 Debug|x64.ActiveCfg = Debug|Any CPU 3881 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.v3.2 Debug|x86.ActiveCfg = Debug|Any CPU 3882 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Visualization Debug|Any CPU.ActiveCfg = Debug|Any CPU 3883 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Visualization Debug|Any CPU.Build.0 = Debug|Any CPU 3884 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Visualization Debug|x64.ActiveCfg = Debug|Any CPU 3885 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB}.Visualization Debug|x86.ActiveCfg = Debug|Any CPU 3853 3886 EndGlobalSection 3854 3887 GlobalSection(SolutionProperties) = preSolution … … 3934 3967 {80F7FADA-549D-4151-8856-79B620A50DBA} = {410732DB-725A-4824-896B-C298978343C0} 3935 3968 {ABAE70E0-14E3-4588-B6BB-15DF022985C3} = {410732DB-725A-4824-896B-C298978343C0} 3969 {DFAC1BEA-6D9D-477F-AC7B-E64977644DDB} = {410732DB-725A-4824-896B-C298978343C0} 3936 3970 {A9E282EA-180F-4233-B809-AEDF0787545C} = {78982D7C-D63D-4A3D-AE1F-F58AC007603B} 3937 3971 {BF7D9494-A586-457B-8DF9-ED599F9E6A71} = {78982D7C-D63D-4A3D-AE1F-F58AC007603B} -
trunk/sources/HeuristicLab/CopyAssemblies.cmd
r2056 r2058 50 50 copy "%SolutionDir%\HeuristicLab.GP.StructureIdentification.TimeSeries\3.3\%Outdir%\HeuristicLab.GP.StructureIdentification.TimeSeries-3.3.dll" .\plugins 51 51 copy "%SolutionDir%\HeuristicLab.Grid\3.2\%Outdir%\HeuristicLab.Grid-3.2.dll" .\plugins 52 copy "%SolutionDir%\HeuristicLab.Grid.HiveBridge\3.2\%Outdir%\HeuristicLab.Grid.HiveBridge-3.2.dll" .\plugins 52 53 copy "%SolutionDir%\HeuristicLab.Hive.Client.Common\3.2\%Outdir%\HeuristicLab.Hive.Client.Common-3.2.dll" .\plugins 53 54 copy "%SolutionDir%\HeuristicLab.Hive.Client.Communication\3.2\%Outdir%\HeuristicLab.Hive.Client.Communication-3.2.dll" .\plugins
Note: See TracChangeset
for help on using the changeset viewer.