Changeset 6111
- Timestamp:
- 05/03/11 17:14:02 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/ExperimentManagerClient.cs
r6033 r6111 27 27 using System.Threading; 28 28 using HeuristicLab.Clients.Hive.ExperimentManager; 29 using HeuristicLab.Clients.Hive.Jobs;30 29 using HeuristicLab.Common; 31 30 using HeuristicLab.Core; 31 using HeuristicLab.Hive; 32 32 using HeuristicLab.PluginInfrastructure; 33 33 … … 373 373 } 374 374 375 public static OptimizerJob LoadOptimizerJob(Guid jobId) {375 public static ItemJob LoadItemJob(Guid jobId) { 376 376 JobData jobData = ServiceLocator.Instance.CallHiveService(s => s.GetJobData(jobId)); 377 377 try { 378 return PersistenceUtil.Deserialize< OptimizerJob>(jobData.Data);378 return PersistenceUtil.Deserialize<ItemJob>(jobData.Data); 379 379 } 380 380 catch { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJob.cs
r6033 r6111 344 344 } 345 345 } 346 347 public virtual void IntegrateChild(ItemJob job, Guid childJobId) { } 346 348 } 347 349 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/JobResultPoller.cs
r6006 r6111 26 26 27 27 namespace HeuristicLab.Clients.Hive { 28 internalclass JobResultPoller {28 public class JobResultPoller { 29 29 private bool stopRequested { get; set; } 30 30 private AutoResetEvent waitHandle; 31 31 private Thread thread; 32 32 33 private IEnumerable<HiveJob> hiveJobs;34 public IEnumerable<HiveJob> HiveJobs{35 get { return hive Jobs; }36 set { hive Jobs= value; }33 private Guid hiveExperimentId; 34 public Guid HiveExperimentId { 35 get { return hiveExperimentId; } 36 set { hiveExperimentId = value; } 37 37 } 38 38 … … 54 54 } 55 55 56 public JobResultPoller( IEnumerable<HiveJob> hiveJobs, TimeSpan interval) {56 public JobResultPoller(Guid hiveExperimentId, TimeSpan interval) { 57 57 this.isPolling = false; 58 this.hive Jobs = hiveJobs;58 this.hiveExperimentId = hiveExperimentId; 59 59 this.interval = interval; 60 60 } … … 75 75 } 76 76 77 p ublicvoid RunPolling() {77 private void RunPolling() { 78 78 try { 79 79 waitHandle = new AutoResetEvent(false); … … 94 94 } 95 95 96 p rivate voidFetchJobResults() {97 ServiceLocator.Instance.CallHiveService(service => {96 public IEnumerable<LightweightJob> FetchJobResults() { 97 return ServiceLocator.Instance.CallHiveService(service => { 98 98 var responses = new List<LightweightJob>(); 99 foreach (HiveJob hiveJob in HiveJobs) { 100 responses.AddRange(service.GetLightweightChildJobs(hiveJob.Job.Id, true, true)); 101 } 99 responses.AddRange(service.GetLightweightExperimentJobs(hiveExperimentId)); 102 100 OnJobResultsReceived(responses); 101 return responses; 103 102 }); 104 103 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/OptimizerHiveJob.cs
r6033 r6111 26 26 using HeuristicLab.Collections; 27 27 using HeuristicLab.Common; 28 using HeuristicLab.Hive; 28 29 using HeuristicLab.Optimization; 29 30 using HeuristicLab.PluginInfrastructure; … … 169 170 /// add the runs from the optimizerJob to the batchrun and replace the Optimizer 170 171 /// </summary> 171 public void UpdateChildOptimizer(OptimizerJob optimizerJob, Guid childJobId) { 172 public override void IntegrateChild(ItemJob job, Guid childJobId) { 173 var optimizerJob = (OptimizerJob)job; 172 174 syncJobsWithOptimizers = false; // don't sync with optimizers during this method 173 175 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj
r6033 r6111 120 120 <Compile Include="Exceptions\JobResultPollingException.cs" /> 121 121 <Compile Include="Exceptions\OptimizerNotFoundException.cs" /> 122 <Compile Include="ExperimentManager\JobDownloader.cs" /> 122 123 <Compile Include="ExperimentManager\ExperimentManagerClient.cs" /> 123 124 <Compile Include="ExperimentManager\HiveJobDownloader.cs" /> … … 130 131 <Compile Include="Exceptions\ResourceNotFoundException.cs" /> 131 132 <Compile Include="IServiceLocator.cs" /> 133 <Compile Include="Jobs\EngineJob.cs" /> 132 134 <Compile Include="Jobs\OptimizerJob.cs" /> 133 135 <Compile Include="HeuristicLabClientsHivePlugin.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/Jobs/OptimizerJob.cs
r6033 r6111 131 131 Item.NameChanged += new EventHandler(optimizer_NameChanged); 132 132 Item.NameChanging += new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 133 Item.ExecutionStateChanged += new EventHandler(optimizer_ExecutionStateChanged); 134 Item.ExecutionTimeChanged += new EventHandler(optimizer_ExecutionTimeChanged); 135 Item.Started += new EventHandler(optimizer_Started); 133 136 } 134 137 … … 140 143 Item.NameChanged -= new EventHandler(optimizer_NameChanged); 141 144 Item.NameChanging -= new EventHandler<CancelEventArgs<string>>(optimizer_NameChanging); 145 Item.ExecutionStateChanged -= new EventHandler(optimizer_ExecutionStateChanged); 146 Item.ExecutionTimeChanged -= new EventHandler(optimizer_ExecutionTimeChanged); 147 Item.Started -= new EventHandler(optimizer_Started); 142 148 base.DeregisterItemEvents(); 143 149 } … … 159 165 } 160 166 167 protected virtual void optimizer_Started(object sender, EventArgs e) { 168 OnJobStarted(); 169 } 170 161 171 protected virtual void optimizer_Stopped(object sender, EventArgs e) { 162 172 OnJobStopped(); … … 165 175 protected virtual void optimizer_Paused(object sender, EventArgs e) { 166 176 OnJobPaused(); 177 } 178 179 protected virtual void optimizer_ExecutionTimeChanged(object sender, EventArgs e) { 180 OnExecutionTimeChanged(); 181 } 182 183 protected virtual void optimizer_ExecutionStateChanged(object sender, EventArgs e) { 184 OnExecutionStateChanged(); 167 185 } 168 186 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HeuristicLab.HiveEngine-3.4.csproj
r6039 r6111 150 150 </ItemGroup> 151 151 <ItemGroup> 152 <Compile Include="EngineJob.cs" />153 152 <Compile Include="HeuristicLabHiveEnginePlugin.cs" /> 154 153 <Compile Include="Exceptions\ScopeMergeException.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6039 r6111 226 226 object locker = new object(); 227 227 IDictionary<Guid, int> jobIndices = new Dictionary<Guid, int>(); 228 var hiveExperiment = new HiveExperiment(); ;228 var hiveExperiment = new HiveExperiment(); 229 229 230 230 try { … … 240 240 hiveExperiment.ResourceNames = this.ResourceNames; 241 241 hiveExperiment.Id = ServiceLocator.Instance.CallHiveService(s => s.AddHiveExperiment(hiveExperiment)); 242 hiveExperiments.Add(new RefreshableHiveExperiment(hiveExperiment)); 242 var refreshableHiveExperiment = new RefreshableHiveExperiment(hiveExperiment); 243 hiveExperiments.Add(refreshableHiveExperiment); 243 244 244 245 // create upload-tasks … … 283 284 }, cancellationToken, TaskCreationOptions.PreferFairness); 284 285 processUploadedJobsTask.Start(); 286 287 refreshableHiveExperiment.RefreshAutomatically = true; 288 289 while (!refreshableHiveExperiment.AllJobsFinished()) { 290 Thread.Sleep(1000); 291 // update time 292 // handle cancellation 293 } 294 295 285 296 286 297 // poll job-statuses and create tasks for those which are finished
Note: See TracChangeset
for help on using the changeset viewer.