Changeset 5786 for branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
- Timestamp:
- 03/22/11 11:36:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs
r5718 r5786 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Configuration; 25 using System.IO; 24 26 using System.Linq; 25 27 using System.Threading; 26 28 using HeuristicLab.Clients.Hive.Jobs; 29 using HeuristicLab.Collections; 27 30 using HeuristicLab.Common; 28 31 using HeuristicLab.Core; 29 32 using HeuristicLab.Optimization; 33 using HeuristicLab.PluginInfrastructure; 30 34 31 35 namespace HeuristicLab.Clients.Hive { 32 using System.Configuration;33 using System.IO;34 using HeuristicLab.Collections;35 using HeuristicLab.PluginInfrastructure;36 37 36 /// <summary> 38 37 /// An experiment which contains multiple batch runs of algorithms. … … 378 377 379 378 #region HiveJob Events 380 void HiveJob_JobStateChanged(object sender, EventArgs e) {379 private void HiveJob_JobStateChanged(object sender, EventArgs e) { 381 380 if (HiveJob != null) { 382 381 rootJobId = HiveJob.Job.Id; … … 520 519 HiveJob hj = hiveJob.GetHiveJobByJobId(lightweightJob.Id); 521 520 if (hj != null) { 521 DateTime lastJobDataUpdate = hj.Job.LastJobDataUpdate; 522 522 hj.UpdateFromLightweightJob(lightweightJob); 523 if ((hj.Job.State == JobState.Aborted || 524 hj.Job.State == JobState.Failed || 525 hj.Job.State == JobState.Finished) && 526 !hj.IsFinishedOptimizerDownloaded) { 523 524 // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated 525 if (lastJobDataUpdate != DateTime.MinValue && lastJobDataUpdate < hj.Job.LastJobDataUpdate) { 527 526 LogMessage(hj.Job.Id, "Downloading optimizer for job"); 528 527 OptimizerJob optimizerJob = LoadOptimizerJob(hj.Job.Id); 529 528 if (optimizerJob == null) { 530 529 // something bad happened to this job. set to finished to allow the rest beeing downloaded 531 hj.IsFinishedOptimizerDownloaded = true;530 //hj.IsFinishedOptimizerDownloaded = true; 532 531 } else { 533 if (lightweightJob.ParentJobId.HasValue) {534 HiveJob parentHiveJob = HiveJob.GetHiveJobByJobId(lightweightJob.ParentJobId.Value);535 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id);532 // if the job is paused, download but don't integrate into parent optimizer (to avoid Prepare) 533 if (hj.Job.State == JobState.Paused) { 534 536 535 } else { 537 this.HiveJob.IsFinishedOptimizerDownloaded = true; 536 if (lightweightJob.ParentJobId.HasValue) { 537 HiveJob parentHiveJob = HiveJob.GetHiveJobByJobId(lightweightJob.ParentJobId.Value); 538 parentHiveJob.UpdateChildOptimizer(optimizerJob, hj.Job.Id); 539 } else { 540 //this.HiveJob.IsFinishedOptimizerDownloaded = true; 541 } 538 542 } 539 543 } … … 550 554 551 555 private bool AllJobsFinished() { 552 return HiveJob.GetAllHiveJobs().All(hj => hj.IsFinishedOptimizerDownloaded); 556 //return HiveJob.GetAllHiveJobs().All(hj => hj.IsFinishedOptimizerDownloaded); 557 return HiveJob.GetAllHiveJobs().All(j => j.Job.State == JobState.Finished 558 || j.Job.State == JobState.Aborted 559 || j.Job.State == JobState.Failed); 553 560 } 554 561
Note: See TracChangeset
for help on using the changeset viewer.