Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/12 02:07:44 (12 years ago)
Author:
ascheibe
Message:

#1744

  • added the new Hive engine. The engine can now be executed in the Hive. If child tasks are created it pauses and is transfered back to the server. If the child tasks are finished it is sent back to a slave.
  • changed the server so that it reschedules paused parent tasks if their childs are finished as well as tasks where FinishWhenChildJobsFinished is set to false
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveHiveEngine/HeuristicLab.Clients.Hive/3.3/HiveClient.cs

    r7285 r7287  
    2929using HeuristicLab.Common;
    3030using HeuristicLab.Core;
     31using HeuristicLab.Optimization;
    3132using HeuristicLab.PluginInfrastructure;
    3233using TS = System.Threading.Tasks;
     
    315316      finally {
    316317        refreshableJob.IsProgressing = false;
     318        refreshableJob.Progress.Finish();
    317319      }
    318320    }
     
    364366          taskData = hiveTask.GetAsTaskData(true, out plugins);
    365367        } else {
    366           hiveTask.Task.IsParentTask = false;
     368          if (hiveTask.ItemTask.Item is EngineAlgorithm && ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine is IHiveEngine) {
     369            hiveTask.Task.IsParentTask = true;
     370            //TODO: this is a little hack so that this task does not get executed immediately because the taskdata will be uploaded twice
     371            hiveTask.Task.State = TaskState.Aborted;
     372          } else {
     373            hiveTask.Task.IsParentTask = false;
     374          }
     375
    367376          hiveTask.Task.FinishWhenChildJobsFinished = false;
    368377          taskData = hiveTask.GetAsTaskData(false, out plugins);
     
    389398            } else {
    390399              hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList()));
     400
     401              if (hiveTask.Task.State == TaskState.Aborted) {
     402                //TODO: this is a very bad hack
     403                if (hiveTask.ItemTask.Item is EngineAlgorithm && ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine is IHiveEngine) {
     404                  IHiveEngine he = ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine as IHiveEngine;
     405                  he.ParentTaskId = hiveTask.Task.Id;
     406                  taskData = hiveTask.GetAsTaskData(false, out plugins);
     407                  taskData.TaskId = hiveTask.Task.Id;
     408
     409                  Task t = HiveServiceLocator.Instance.CallHiveService((s) => s.GetTask(hiveTask.Task.Id));
     410                  t.State = TaskState.Waiting;
     411                  HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateTaskData(t, taskData));
     412                }
     413              }
     414
    391415            }
    392416          }
Note: See TracChangeset for help on using the changeset viewer.