Changeset 7320 for branches/HiveHiveEngine
- Timestamp:
- 01/12/12 17:14:36 (13 years ago)
- Location:
- branches/HiveHiveEngine
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveHiveEngine/HeuristicLab.HiveEngine/3.3/HiveEngine.cs
r7287 r7320 370 370 var failedJobs = allHiveTasks.Where(x => x.Task.State != TaskState.Finished); 371 371 if (failedJobs.Count() > 0) { 372 throw new HiveEngineException("Task failed: " + failedJobs.First().Task.StateLog.Last().Exception);372 throw new HiveEngineException("Task (" + failedJobs.First().Task.Id + ") failed: " + failedJobs.First().Task.StateLog.Last().Exception); 373 373 } 374 374 -
branches/HiveHiveEngine/HeuristicLab.Services.Hive/3.3/HiveDao.cs
r7287 r7320 112 112 /// this is for the hive engine 113 113 /// </summary> 114 private IEnumerable<DT.Task> GetPausedParentTasks(IEnumerable<Guid> resourceIds, int count) { 115 using (var db = CreateContext()) { 114 private IEnumerable<DT.Task> GetHiveEngineParentTasks(IEnumerable<Guid> resourceIds, int count) { 115 using (var db = CreateContext()) { 116 //query for waiting parent hive engine tasks or parent hive engine tasks where all childrens are finished 116 117 var query = from ar in db.AssignedResources 117 118 where resourceIds.Contains(ar.ResourceId) 118 && ar.Task.State == TaskState. Paused119 && ar.Task.State == TaskState.Waiting 119 120 && ar.Task.IsParentTask 120 121 && !ar.Task.FinishWhenChildJobsFinished … … 122 123 where child.ParentTaskId == ar.Task.TaskId 123 124 select child).All(x => x.State == TaskState.Finished) 124 && (from child in db.Tasks // avoid returning WaitForChildTasks task where no child-task exist (yet)125 where child.ParentTaskId == ar.Task.TaskId126 select child).Count() > 0127 125 orderby ar.Task.Priority descending, db.Random() 128 126 select DT.Convert.ToDto(ar.Task); … … 135 133 var resourceIds = GetParentResources(slave.Id).Select(r => r.Id); 136 134 137 //check for freshly uploaded hive engine tasks 138 var waitingParentJobs = GetParentTasks(resourceIds, count, false); 139 if (count > 0 && waitingParentJobs.Count() >= count) return waitingParentJobs.Take(count).ToArray(); 140 141 //check if there are hive engine tasks which have finished childs 142 waitingParentJobs = GetPausedParentTasks(resourceIds, count); 135 //check if there are hive engine tasks to calculate 136 var waitingParentJobs = GetHiveEngineParentTasks(resourceIds, count); 143 137 if (count > 0 && waitingParentJobs.Count() >= count) return waitingParentJobs.Take(count).ToArray(); 144 138 145 139 var query = from ar in db.AssignedResources 146 140 where resourceIds.Contains(ar.ResourceId) 147 && ! (ar.Task.IsParentTask && ar.Task.FinishWhenChildJobsFinished)141 && !ar.Task.IsParentTask 148 142 && ar.Task.State == TaskState.Waiting 149 143 && ar.Task.CoresNeeded <= slave.FreeCores
Note: See TracChangeset
for help on using the changeset viewer.