Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/05/17 14:03:03 (7 years ago)
Author:
jkarder
Message:

#2784: fixed pausing of waiting hive tasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive/3.3/HiveTasks/OptimizerHiveTask.cs

    r14185 r15121  
    316316    public override void AddChildHiveTask(HiveTask hiveTask) {
    317317      base.AddChildHiveTask(hiveTask);
    318       var optimizerHiveJob = (OptimizerHiveTask)hiveTask;
     318      var optimizerHiveTask = (OptimizerHiveTask)hiveTask;
    319319      syncTasksWithOptimizers = false;
    320       if (this.ItemTask != null && optimizerHiveJob.ItemTask != null) {
    321         // if task is in state Paused, it has to preserve its ResultCollection, which is cleared when a optimizer is added to an experiment
    322         OptimizerTask optimizerJobClone = null;
    323         if (optimizerHiveJob.Task.State == TaskState.Paused) {
    324           optimizerJobClone = (OptimizerTask)optimizerHiveJob.ItemTask.Clone();
    325         }
     320      if (this.ItemTask != null && optimizerHiveTask.ItemTask != null) {
     321        OptimizerTask optimizerTaskClone = (OptimizerTask)optimizerHiveTask.ItemTask.Clone();
    326322
    327323        if (this.ItemTask.Item is Optimization.Experiment) {
    328           if (!this.ItemTask.OptimizerAsExperiment.Optimizers.Contains(optimizerHiveJob.ItemTask.Item)) {
    329             UpdateOptimizerInExperiment(this.ItemTask.OptimizerAsExperiment, optimizerHiveJob.ItemTask);
     324          if (!this.ItemTask.OptimizerAsExperiment.Optimizers.Contains(optimizerHiveTask.ItemTask.Item)) {
     325            UpdateOptimizerInExperiment(this.ItemTask.OptimizerAsExperiment, optimizerHiveTask.ItemTask);
    330326          }
    331327        } else if (this.ItemTask.Item is Optimization.BatchRun) {
    332           UpdateOptimizerInBatchRun(this.ItemTask.OptimizerAsBatchRun, optimizerHiveJob.ItemTask);
    333         }
    334 
    335         if (optimizerHiveJob.Task.State == TaskState.Paused) {
    336           optimizerHiveJob.ItemTask = optimizerJobClone;
    337         }
     328          UpdateOptimizerInBatchRun(this.ItemTask.OptimizerAsBatchRun, optimizerHiveTask.ItemTask);
     329        }
     330
     331        optimizerHiveTask.syncTasksWithOptimizers = false;
     332        optimizerHiveTask.ItemTask = optimizerTaskClone;
     333        optimizerHiveTask.syncTasksWithOptimizers = true;
    338334      }
    339335      syncTasksWithOptimizers = true;
Note: See TracChangeset for help on using the changeset viewer.