Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/11 14:47:56 (14 years ago)
Author:
cneumuel
Message:

#1233

  • added StateLog to log state transitions of hive jobs
  • added permissions to hive experiments (in data access layer, no UI for that yet)
  • extended unit tests
Location:
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager
Files:
2 edited

Legend:

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

    r5458 r5511  
    2424using System.Linq;
    2525using System.Threading;
     26using HeuristicLab.Clients.Common;
     27using HeuristicLab.Clients.Hive.Jobs;
    2628using HeuristicLab.Common;
    2729using HeuristicLab.Core;
     30using HeuristicLab.Optimization;
     31using HeuristicLab.Services.Hive.Common;
     32using HeuristicLab.Services.Hive.Common.DataTransfer;
     33using HeuristicLab.Services.Hive.Common.ServiceContracts;
    2834using HeuristicLab.Tracing;
    29 using HeuristicLab.Services.Hive.Common;
    30 using HeuristicLab.Services.Hive.Common.ServiceContracts;
    31 using HeuristicLab.Services.Hive.Common.DataTransfer;
    32 using HeuristicLab.Clients.Hive.Jobs;
    33 using HeuristicLab.Clients.Common;
    34 using HeuristicLab.Optimization;
    3535
    3636namespace HeuristicLab.Clients.Hive {
     37  using System.Configuration;
     38  using System.IO;
     39  using HeuristicLab.PluginInfrastructure;
    3740  using DT = HeuristicLab.Services.Hive.Common.DataTransfer;
    38   using HeuristicLab.PluginInfrastructure;
    39   using System.IO;
    40   using System.Configuration;
    41   using System.Reflection;
    42   using HeuristicLab.PluginInfrastructure.Manager;
    4341
    4442  /// <summary>
     
    301299    private static Plugin UploadConfigurationFile(IHiveService service) {
    302300      string exeFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "HeuristicLab 3.3.exe");
    303       string configFileName = ConfigurationManager.OpenExeConfiguration(exeFilePath).FilePath;
     301      string configFileName = Path.GetFileName(ConfigurationManager.OpenExeConfiguration(exeFilePath).FilePath);
    304302
    305303      Plugin configPlugin = new Plugin() {
     
    331329      if (hiveJob.OptimizerJob.ComputeInParallel &&
    332330        (hiveJob.OptimizerJob.Optimizer is Optimization.Experiment || hiveJob.OptimizerJob.Optimizer is Optimization.BatchRun)) {
    333         hiveJob.Job.JobState = JobState.WaitingForChildJobs;
     331        hiveJob.Job.SetState(JobState.FinishOnChildJobsFinished);
    334332        hiveJob.OptimizerJob.CollectChildJobs = false; // don't collect child-jobs on slaves
    335333        jobData = hiveJob.GetAsJobData(true, out plugins);
     
    522520        if (hj != null) {
    523521          hj.UpdateFromLightweightJob(lightweightJob);
    524           if ((hj.Job.JobState == JobState.Aborted ||
    525                hj.Job.JobState == JobState.Failed ||
    526                hj.Job.JobState == JobState.Finished) &&
     522          if ((hj.Job.State == JobState.Aborted ||
     523               hj.Job.State == JobState.Failed ||
     524               hj.Job.State == JobState.Finished) &&
    527525              !hj.IsFinishedOptimizerDownloaded) {
    528526            LogMessage(hj.Job.Id, "Downloading optimizer for job");
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobClient.cs

    r5404 r5511  
    2323using System.Collections.Generic;
    2424using System.Drawing;
    25 using System.IO;
    2625using System.Linq;
    2726using HeuristicLab.Clients.Hive.Jobs;
     
    3231using HeuristicLab.PluginInfrastructure;
    3332using HeuristicLab.Services.Hive.Common.DataTransfer;
    34 using HeuristicLab.PluginInfrastructure.Manager;
    3533
    3634namespace HeuristicLab.Clients.Hive {
     
    4543          return HeuristicLab.Common.Resources.VSImageLibrary.Event;
    4644        } else {
    47           if (job.JobState == JobState.Waiting) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    48           else if (job.JobState == JobState.WaitingForChildJobs) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
    49           else if (job.JobState == JobState.Calculating) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
    50           else if (job.JobState == JobState.Aborted) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
    51           else if (job.JobState == JobState.Failed) return HeuristicLab.Common.Resources.VSImageLibrary.Error;
    52           else if (job.JobState == JobState.Finished) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
     45          if (job.State == JobState.Waiting) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
     46          else if (job.State == JobState.FinishOnChildJobsFinished) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutablePrepared;
     47          else if (job.State == JobState.Calculating) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStarted;
     48          else if (job.State == JobState.Aborted) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
     49          else if (job.State == JobState.Failed) return HeuristicLab.Common.Resources.VSImageLibrary.Error;
     50          else if (job.State == JobState.Finished) return HeuristicLab.Common.Resources.VSImageLibrary.ExecutableStopped;
    5351          else return HeuristicLab.Common.Resources.VSImageLibrary.Event;
    5452        }
     
    108106    public HiveJob() {
    109107      this.Job = new Job() {
    110         JobState = JobState.Offline,
    111         DateCreated = DateTime.Now,
    112108        CoresNeeded = 1,
    113109        MemoryNeeded = 0
    114110      };
     111      job.SetState(JobState.Offline);
    115112      this.childHiveJobs = new ItemList<HiveJob>();
    116113      syncJobsWithOptimizers = true;
     
    406403      if (lightweightJob != null) {
    407404        job.Id = lightweightJob.Id;
    408         job.DateCreated = lightweightJob.DateCreated;
    409         job.DateCalculated = lightweightJob.DateCalculated;
    410         job.DateFinished = lightweightJob.DateFinished;
    411         job.Exception = lightweightJob.Exception;
    412405        job.Id = lightweightJob.Id;
    413406        job.ExecutionTime = lightweightJob.ExecutionTime;
    414         job.JobState = lightweightJob.JobState;
     407        job.StateLog = new List<StateLog>(lightweightJob.StateLog);
    415408        // what about parentJob
    416409        OnJobStateChanged();
     
    488481    public event EventHandler JobStateChanged;
    489482    private void OnJobStateChanged() {
    490       LogMessage("JobStateChanged (State: " + this.Job.JobState + ", ExecutionTime: " + this.Job.ExecutionTime.ToString() + ")");
     483      LogMessage("JobStateChanged (State: " + this.Job.State + ", ExecutionTime: " + this.Job.ExecutionTime.ToString() + ")");
    491484      EventHandler handler = JobStateChanged;
    492485      if (handler != null) handler(this, EventArgs.Empty);
Note: See TracChangeset for help on using the changeset viewer.