Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/27/11 15:20:23 (13 years ago)
Author:
cneumuel
Message:

#1233

  • finished experiment sharing
  • added role for executing privileged jobs
  • refreshing experiments in experimentManager does not delete already downloaded jobs
  • moved some properties from HiveExperiment into RefreshableHiveExperiment
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs

    r6452 r6479  
    9292    }
    9393
     94    public bool IsAllowedPrivileged { get; set; }
     95
    9496    #region constructors and cloning
    9597    public HiveEngine() {
     
    9799      this.Priority = 0;
    98100      this.log = new ThreadSafeLog(this.log);
     101      this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged());
    99102    }
    100103
     
    249252          var engineHiveJob = new EngineHiveJob(jobs[i], parentScopeClone);
    250253          engineHiveJob.Job.Priority = this.Priority;
    251           hiveExperiment.HiveJobs.Add(engineHiveJob);
     254          refreshableHiveExperiment.HiveJobs.Add(engineHiveJob);
    252255
    253256          // shuffle random variable to avoid the same random sequence in each operation; todo: does not yet work (it cannot find the random variable)
     
    261264        while (!refreshableHiveExperiment.AllJobsFinished()) {
    262265          Thread.Sleep(2000);
    263           this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x.HiveExperiment.ExecutionTime.TotalMilliseconds));
     266          this.ExecutionTimeOnHive = TimeSpan.FromMilliseconds(hiveExperiments.Sum(x => x.ExecutionTime.TotalMilliseconds));
    264267          cancellationToken.ThrowIfCancellationRequested();
    265268        }
    266         log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment.HiveExperiment.ExecutionTime));
    267 
    268         var failedJobs = hiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed);
     269        log.LogMessage(string.Format("{0} finished (TotalExecutionTime: {1}).", refreshableHiveExperiment.ToString(), refreshableHiveExperiment.ExecutionTime));
     270
     271        var failedJobs = refreshableHiveExperiment.HiveJobs.Where(x => x.Job.State == JobState.Failed);
    269272        if (failedJobs.Count() > 0) {
    270273          throw new HiveEngineException("Job failed: " + failedJobs.First().Job.StateLog.Last().Exception);
     
    273276        // get scopes
    274277        int j = 0;
    275         foreach (var hiveJob in hiveExperiment.HiveJobs) {
     278        foreach (var hiveJob in refreshableHiveExperiment.HiveJobs) {
    276279          var scope = ((IAtomicOperation)((EngineJob)hiveJob.ItemJob).InitialOperation).Scope;
    277280          scopes[j++] = scope;
     
    299302        hiveExperiment.IsPrivileged = this.IsPrivileged;
    300303        var refreshableHiveExperiment = new RefreshableHiveExperiment(hiveExperiment);
    301         refreshableHiveExperiment.IsControllable = false;
     304        refreshableHiveExperiment.IsDownloadable = false; // download happens automatically so disable button
    302305        hiveExperiments.Add(refreshableHiveExperiment);
    303306        return refreshableHiveExperiment;
     
    312315
    313316    private void ClearData(RefreshableHiveExperiment refreshableHiveExperiment) {
    314       var jobs = refreshableHiveExperiment.HiveExperiment.GetAllHiveJobs();
     317      var jobs = refreshableHiveExperiment.GetAllHiveJobs();
    315318      foreach (var job in jobs) {
    316319        job.ClearData();
Note: See TracChangeset for help on using the changeset viewer.