Changeset 7287
- Timestamp:
- 01/07/12 02:07:44 (13 years ago)
- Location:
- branches/HiveHiveEngine
- Files:
-
- 21 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveHiveEngine/HeuristicLab 3.3.sln
r7251 r7287 272 272 EndProject 273 273 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Algorithms.Benchmarks.Views-3.3", "HeuristicLab.Algorithms.Benchmarks.Views\3.3\HeuristicLab.Algorithms.Benchmarks.Views-3.3.csproj", "{3C906172-E044-4DF0-B4FD-AA21192D5D3E}" 274 EndProject 275 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.HiveEngine-3.3", "HeuristicLab.HiveEngine\3.3\HeuristicLab.HiveEngine-3.3.csproj", "{2C036542-5451-4A23-AFF6-87575C7BAFE7}" 276 EndProject 277 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.HiveEngine.Views-3.3", "HeuristicLab.HiveEngine.Views\3.3\HeuristicLab.HiveEngine.Views-3.3.csproj", "{E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}" 274 278 EndProject 275 279 Global … … 1330 1334 {3C906172-E044-4DF0-B4FD-AA21192D5D3E}.Release|x86.ActiveCfg = Release|x86 1331 1335 {3C906172-E044-4DF0-B4FD-AA21192D5D3E}.Release|x86.Build.0 = Release|x86 1336 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1337 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|Any CPU.Build.0 = Debug|Any CPU 1338 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|x64.ActiveCfg = Debug|x64 1339 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|x64.Build.0 = Debug|x64 1340 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|x86.ActiveCfg = Debug|x86 1341 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Debug|x86.Build.0 = Debug|x86 1342 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|Any CPU.ActiveCfg = Release|Any CPU 1343 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|Any CPU.Build.0 = Release|Any CPU 1344 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|x64.ActiveCfg = Release|x64 1345 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|x64.Build.0 = Release|x64 1346 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|x86.ActiveCfg = Release|x86 1347 {2C036542-5451-4A23-AFF6-87575C7BAFE7}.Release|x86.Build.0 = Release|x86 1348 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 1349 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|Any CPU.Build.0 = Debug|Any CPU 1350 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|x64.ActiveCfg = Debug|x64 1351 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|x64.Build.0 = Debug|x64 1352 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|x86.ActiveCfg = Debug|x86 1353 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Debug|x86.Build.0 = Debug|x86 1354 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|Any CPU.ActiveCfg = Release|Any CPU 1355 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|Any CPU.Build.0 = Release|Any CPU 1356 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|x64.ActiveCfg = Release|x64 1357 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|x64.Build.0 = Release|x64 1358 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|x86.ActiveCfg = Release|x86 1359 {E37F15E0-D0D6-4C6E-AD22-0DA514C943A3}.Release|x86.Build.0 = Release|x86 1332 1360 EndGlobalSection 1333 1361 GlobalSection(SolutionProperties) = preSolution -
branches/HiveHiveEngine/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r7285 r7287 29 29 using HeuristicLab.Common; 30 30 using HeuristicLab.Core; 31 using HeuristicLab.Optimization; 31 32 using HeuristicLab.PluginInfrastructure; 32 33 using TS = System.Threading.Tasks; … … 315 316 finally { 316 317 refreshableJob.IsProgressing = false; 318 refreshableJob.Progress.Finish(); 317 319 } 318 320 } … … 364 366 taskData = hiveTask.GetAsTaskData(true, out plugins); 365 367 } else { 366 hiveTask.Task.IsParentTask = false; 368 if (hiveTask.ItemTask.Item is EngineAlgorithm && ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine is IHiveEngine) { 369 hiveTask.Task.IsParentTask = true; 370 //TODO: this is a little hack so that this task does not get executed immediately because the taskdata will be uploaded twice 371 hiveTask.Task.State = TaskState.Aborted; 372 } else { 373 hiveTask.Task.IsParentTask = false; 374 } 375 367 376 hiveTask.Task.FinishWhenChildJobsFinished = false; 368 377 taskData = hiveTask.GetAsTaskData(false, out plugins); … … 389 398 } else { 390 399 hiveTask.Task.Id = HiveServiceLocator.Instance.CallHiveService((s) => s.AddTask(hiveTask.Task, taskData, groups.ToList())); 400 401 if (hiveTask.Task.State == TaskState.Aborted) { 402 //TODO: this is a very bad hack 403 if (hiveTask.ItemTask.Item is EngineAlgorithm && ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine is IHiveEngine) { 404 IHiveEngine he = ((EngineAlgorithm)hiveTask.ItemTask.Item).Engine as IHiveEngine; 405 he.ParentTaskId = hiveTask.Task.Id; 406 taskData = hiveTask.GetAsTaskData(false, out plugins); 407 taskData.TaskId = hiveTask.Task.Id; 408 409 Task t = HiveServiceLocator.Instance.CallHiveService((s) => s.GetTask(hiveTask.Task.Id)); 410 t.State = TaskState.Waiting; 411 HiveServiceLocator.Instance.CallHiveService((s) => s.UpdateTaskData(t, taskData)); 412 } 413 } 414 391 415 } 392 416 } -
branches/HiveHiveEngine/HeuristicLab.Services.Hive/3.3/HiveDao.cs
r7259 r7287 103 103 || child.State == TaskState.Aborted 104 104 || child.State == TaskState.Failed).All(x => x) 105 orderby ar.Task.Priority descending, db.Random() 106 select DT.Convert.ToDto(ar.Task); 107 return count == 0 ? query.ToArray() : query.Take(count).ToArray(); 108 } 109 } 110 111 /// <summary> 112 /// this is for the hive engine 113 /// </summary> 114 private IEnumerable<DT.Task> GetPausedParentTasks(IEnumerable<Guid> resourceIds, int count) { 115 using (var db = CreateContext()) { 116 var query = from ar in db.AssignedResources 117 where resourceIds.Contains(ar.ResourceId) 118 && ar.Task.State == TaskState.Paused 119 && ar.Task.IsParentTask 120 && !ar.Task.FinishWhenChildJobsFinished 121 && (from child in db.Tasks 122 where child.ParentTaskId == ar.Task.TaskId 123 select child).All(x => x.State == TaskState.Finished) 105 124 && (from child in db.Tasks // avoid returning WaitForChildTasks task where no child-task exist (yet) 106 125 where child.ParentTaskId == ar.Task.TaskId … … 115 134 using (var db = CreateContext()) { 116 135 var resourceIds = GetParentResources(slave.Id).Select(r => r.Id); 117 //Originally we checked here if there are parent tasks which should be calculated (with GetParentTasks(resourceIds, count, false);). 118 //Because there is at the moment no case where this makes sense (there don't exist parent tasks which need to be calculated), 119 //we skip this step because it's wasted runtime 136 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); 143 if (count > 0 && waitingParentJobs.Count() >= count) return waitingParentJobs.Take(count).ToArray(); 120 144 121 145 var query = from ar in db.AssignedResources -
branches/HiveHiveEngine/HeuristicLab.Services.Hive/3.3/HiveService.cs
r7259 r7287 71 71 } 72 72 dao.AddTaskData(taskData); 73 dao.UpdateTaskState(task.Id, DA.TaskState.Waiting, null, userManager.CurrentUserId, null); 73 //TODO: hack!! change this 74 if (task.State != TaskState.Aborted) { 75 dao.UpdateTaskState(task.Id, DA.TaskState.Waiting, null, userManager.CurrentUserId, null); 76 } 74 77 return taskData.TaskId; 75 78 }, false, true);
Note: See TracChangeset
for help on using the changeset viewer.