Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/11 11:36:53 (13 years ago)
Author:
cneumuel
Message:

#1233

  • implemented correct numbering of BatchRuns
  • improvements in ExperimentManager
  • fixed bug in server (jobs were scheduled multiple times)
  • added exception handling for task in slave
  • improved timeout handling of jobs (LifecycleManager)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveExperimentClient.cs

    r5718 r5786  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Configuration;
     25using System.IO;
    2426using System.Linq;
    2527using System.Threading;
    2628using HeuristicLab.Clients.Hive.Jobs;
     29using HeuristicLab.Collections;
    2730using HeuristicLab.Common;
    2831using HeuristicLab.Core;
    2932using HeuristicLab.Optimization;
     33using HeuristicLab.PluginInfrastructure;
    3034
    3135namespace HeuristicLab.Clients.Hive {
    32   using System.Configuration;
    33   using System.IO;
    34   using HeuristicLab.Collections;
    35   using HeuristicLab.PluginInfrastructure;
    36 
    3736  /// <summary>
    3837  /// An experiment which contains multiple batch runs of algorithms.
     
    378377
    379378    #region HiveJob Events
    380     void HiveJob_JobStateChanged(object sender, EventArgs e) {
     379    private void HiveJob_JobStateChanged(object sender, EventArgs e) {
    381380      if (HiveJob != null) {
    382381        rootJobId = HiveJob.Job.Id;
     
    520519        HiveJob hj = hiveJob.GetHiveJobByJobId(lightweightJob.Id);
    521520        if (hj != null) {
     521          DateTime lastJobDataUpdate = hj.Job.LastJobDataUpdate;
    522522          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) {
    527526            LogMessage(hj.Job.Id, "Downloading optimizer for job");
    528527            OptimizerJob optimizerJob = LoadOptimizerJob(hj.Job.Id);
    529528            if (optimizerJob == null) {
    530529              // something bad happened to this job. set to finished to allow the rest beeing downloaded
    531               hj.IsFinishedOptimizerDownloaded = true;
     530              //hj.IsFinishedOptimizerDownloaded = true;
    532531            } 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               
    536535              } 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                }
    538542              }
    539543            }
     
    550554
    551555    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);
    553560    }
    554561
Note: See TracChangeset for help on using the changeset viewer.