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/HiveJobClient.cs

    r5779 r5786  
    7777          DergisterOptimizerEvents();
    7878          optimizerJob = value;
    79           if (optimizerJob.ExecutionState == ExecutionState.Stopped) {
    80             IsFinishedOptimizerDownloaded = true;
    81           }
     79          //if (optimizerJob.ExecutionState == ExecutionState.Stopped) {
     80          //  IsFinishedOptimizerDownloaded = true;
     81          //}
    8282          RegisterOptimizerEvents();
    8383          OnOptimizerJobChanged();
     
    9191    }
    9292
    93     private bool isFinishedOptimizerDownloaded;
    94     public bool IsFinishedOptimizerDownloaded {
    95       get { return isFinishedOptimizerDownloaded; }
    96       set {
    97         if (isFinishedOptimizerDownloaded != value) {
    98           isFinishedOptimizerDownloaded = value;
    99           OnIsFinishedOptimizerDownloadedChanged();
    100         }
    101       }
    102     }
     93    //private bool isFinishedOptimizerDownloaded;
     94    //public bool IsFinishedOptimizerDownloaded {
     95    //  get { return isFinishedOptimizerDownloaded; }
     96    //  set {
     97    //    if (isFinishedOptimizerDownloaded != value) {
     98    //      isFinishedOptimizerDownloaded = value;
     99    //      OnIsFinishedOptimizerDownloadedChanged();
     100    //    }
     101    //  }
     102    //}
    103103
    104104    private bool syncJobsWithOptimizers = true;
     
    331331      }
    332332      if (childIsFinishedOptimizerDownloaded) {
    333         child.IsFinishedOptimizerDownloaded = true;
     333        //child.IsFinishedOptimizerDownloaded = true; // todo: clean up with childIsFinishedOptimizerDownloaded
    334334      }
    335335      syncJobsWithOptimizers = true;
     
    345345      }
    346346      foreach (IRun run in optimizerJob.Optimizer.Runs) {
    347         if (!batchRun.Runs.Contains(run))
     347        if (!batchRun.Runs.Contains(run)) {
     348          run.Name = GetNewRunName(run, batchRun.Runs);
    348349          batchRun.Runs.Add(run);
     350        }
     351      }
     352    }
     353
     354    /// <summary>
     355    /// Parses the run numbers out of runs and renames the run to the next number
     356    /// </summary>
     357    private static string GetNewRunName(IRun run, RunCollection runs) {
     358      int idx = run.Name.IndexOf("Run ") + 4;
     359
     360      if (idx == -1 || runs.Count == 0)
     361        return run.Name;
     362
     363      int maxRunNumber = int.MinValue;
     364      foreach (IRun r in runs) {
     365        int number = GetRunNumber(r.Name);
     366        maxRunNumber = Math.Max(maxRunNumber, number);
     367      }
     368
     369      return run.Name.Substring(0, idx) + (maxRunNumber + 1).ToString();
     370    }
     371
     372    /// <summary>
     373    /// Parses the number of a Run out of its name. Example "Genetic Algorithm Run 3" -> 3
     374    /// </summary>
     375    private static int GetRunNumber(string runName) {
     376      int idx = runName.IndexOf("Run ") + 4;
     377      if (idx == -1) {
     378        return 0;
     379      } else {
     380        return int.Parse(runName.Substring(idx, runName.Length - idx));
    349381      }
    350382    }
     
    403435      if (lightweightJob != null) {
    404436        job.Id = lightweightJob.Id;
    405         job.Id = lightweightJob.Id;
     437        job.ParentJobId = lightweightJob.ParentJobId;
    406438        job.ExecutionTime = lightweightJob.ExecutionTime;
    407439        job.State = lightweightJob.State;
    408440        job.StateLog = new List<StateLog>(lightweightJob.StateLog);
    409         // what about parentJob
     441        job.Command = lightweightJob.Command;
     442        job.LastJobDataUpdate = lightweightJob.LastJobDataUpdate;
     443       
    410444        OnJobStateChanged();
    411445        OnToStringChanged();
Note: See TracChangeset for help on using the changeset viewer.