- Timestamp:
- 06/27/11 15:20:23 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.HiveEngine/3.4/HiveEngine.cs
r6452 r6479 92 92 } 93 93 94 public bool IsAllowedPrivileged { get; set; } 95 94 96 #region constructors and cloning 95 97 public HiveEngine() { … … 97 99 this.Priority = 0; 98 100 this.log = new ThreadSafeLog(this.log); 101 this.IsAllowedPrivileged = ServiceLocator.Instance.CallHiveService((s) => s.IsAllowedPrivileged()); 99 102 } 100 103 … … 249 252 var engineHiveJob = new EngineHiveJob(jobs[i], parentScopeClone); 250 253 engineHiveJob.Job.Priority = this.Priority; 251 hiveExperiment.HiveJobs.Add(engineHiveJob);254 refreshableHiveExperiment.HiveJobs.Add(engineHiveJob); 252 255 253 256 // shuffle random variable to avoid the same random sequence in each operation; todo: does not yet work (it cannot find the random variable) … … 261 264 while (!refreshableHiveExperiment.AllJobsFinished()) { 262 265 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)); 264 267 cancellationToken.ThrowIfCancellationRequested(); 265 268 } 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); 269 272 if (failedJobs.Count() > 0) { 270 273 throw new HiveEngineException("Job failed: " + failedJobs.First().Job.StateLog.Last().Exception); … … 273 276 // get scopes 274 277 int j = 0; 275 foreach (var hiveJob in hiveExperiment.HiveJobs) {278 foreach (var hiveJob in refreshableHiveExperiment.HiveJobs) { 276 279 var scope = ((IAtomicOperation)((EngineJob)hiveJob.ItemJob).InitialOperation).Scope; 277 280 scopes[j++] = scope; … … 299 302 hiveExperiment.IsPrivileged = this.IsPrivileged; 300 303 var refreshableHiveExperiment = new RefreshableHiveExperiment(hiveExperiment); 301 refreshableHiveExperiment.Is Controllable = false;304 refreshableHiveExperiment.IsDownloadable = false; // download happens automatically so disable button 302 305 hiveExperiments.Add(refreshableHiveExperiment); 303 306 return refreshableHiveExperiment; … … 312 315 313 316 private void ClearData(RefreshableHiveExperiment refreshableHiveExperiment) { 314 var jobs = refreshableHiveExperiment. HiveExperiment.GetAllHiveJobs();317 var jobs = refreshableHiveExperiment.GetAllHiveJobs(); 315 318 foreach (var job in jobs) { 316 319 job.ClearData();
Note: See TracChangeset
for help on using the changeset viewer.