Changeset 6168
- Timestamp:
- 05/09/11 14:12:10 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 1 added
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConfigManager.cs
r6110 r6168 113 113 114 114 public int GetUsedCores() { 115 Dictionary<Guid, Executor> engines = Core.Executors; 116 Dictionary<Guid, Job> jobs = Core.Jobs; 117 int usedCores = 0; 118 lock (engines) { 119 foreach (KeyValuePair<Guid, Job> kvp in jobs) 120 usedCores += kvp.Value.CoresNeeded; 121 } 122 return usedCores; 115 return Core.GetCoresNeeded(); 123 116 } 124 117 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r6112 r6168 24 24 using System.Diagnostics; 25 25 using System.IO; 26 using System.Linq; 26 27 using System.ServiceModel; 27 28 using System.Threading; … … 46 47 private Dictionary<Guid, Executor> executors = new Dictionary<Guid, Executor>(); 47 48 private Dictionary<Guid, AppDomain> appDomains = new Dictionary<Guid, AppDomain>(); 48 private Dictionary<Guid, Job> jobs = new Dictionary<Guid, Job>();49 49 50 50 private WcfService wcfService; … … 57 57 public Dictionary<Guid, Executor> Executors { 58 58 get { return executors; } 59 }60 61 internal Dictionary<Guid, Job> Jobs {62 get { return jobs; }63 59 } 64 60 … … 163 159 Job job = wcfService.GetJob(jobId); 164 160 if (job == null) throw new JobNotFoundException(jobId); 165 lock (executors) {166 if (!jobs.ContainsKey(job.Id)) {167 jobs.Add(job.Id, job);168 }169 }170 161 JobData jobData = wcfService.GetJobData(job.Id); 171 162 if (jobData == null) throw new JobDataNotFoundException(jobId); … … 220 211 221 212 private void DoPauseJob(Guid jobId) { 222 if (! Jobs.ContainsKey(jobId)) {213 if (!executors.ContainsKey(jobId)) { 223 214 clientCom.LogMessage("DoPauseJob: Can't find job with id " + jobId); 224 215 } else { 225 Job job = Jobs[jobId];226 227 if (job != null ) {216 Job job = wcfService.GetJob(jobId); 217 218 if (job != null && executors.ContainsKey(job.Id)) { 228 219 executors[job.Id].Pause(); 229 220 JobData sJob = executors[job.Id].GetPausedJob(); … … 251 242 252 243 private void DoStopJob(Guid jobId) { 253 if (! Jobs.ContainsKey(jobId)) {244 if (!executors.ContainsKey(jobId)) { 254 245 clientCom.LogMessage("DoStopJob: Can't find job with id " + jobId); 255 246 } else { 256 Job job = Jobs[jobId];247 Job job = wcfService.GetJob(jobId); 257 248 258 249 if (job != null) { … … 260 251 JobData sJob = executors[job.Id].GetFinishedJob(); 261 252 job.ExecutionTime = executors[job.Id].ExecutionTime; 262 263 253 264 254 try { … … 268 258 SlaveStatusInfo.JobsAborted++; 269 259 270 clientCom.LogMessage("Sending the stopp ped job with id: " + job.Id);260 clientCom.LogMessage("Sending the stopped job with id: " + job.Id); 271 261 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Aborted); 272 262 } … … 285 275 /// </summary> 286 276 private void DoAbortAll() { 287 List<Guid> guids = new List<Guid>(); 288 foreach (Guid job in Jobs.Keys) { 289 guids.Add(job); 290 } 291 292 foreach (Guid g in guids) { 293 KillAppDomain(g); 294 } 295 277 List<Guid> jobIds; 278 lock (executors) { 279 jobIds = new List<Guid>(executors.Keys); 280 } 281 foreach (Guid jobId in jobIds) { 282 KillAppDomain(jobId); 283 } 296 284 clientCom.LogMessage("Aborted all jobs!"); 297 285 } … … 304 292 305 293 //copy guids because there will be removed items from 'Jobs' 306 List<Guid> guids = new List<Guid>();307 foreach (Guid job in Jobs.Keys) {308 guids.Add(job);309 } 310 311 foreach (Guid g in guids) {312 DoPauseJob( g);294 List<Guid> jobIds; 295 lock (executors) { 296 jobIds = new List<Guid>(Executors.Keys); 297 } 298 299 foreach (Guid jobId in jobIds) { 300 DoPauseJob(jobId); 313 301 } 314 302 } … … 321 309 322 310 //copy guids because there will be removed items from 'Jobs' 323 List<Guid> guids = new List<Guid>();324 foreach (Guid job in Jobs.Keys) {325 guids.Add(job);326 } 327 328 foreach (Guid g in guids) {329 DoStopJob( g);311 List<Guid> jobIds; 312 lock (executors) { 313 jobIds = new List<Guid>(executors.Keys); 314 } 315 316 foreach (Guid jobId in jobIds) { 317 DoStopJob(jobId); 330 318 } 331 319 } … … 395 383 /// </summary> 396 384 public void PauseWaitJob(JobData data) { 397 if (! Jobs.ContainsKey(data.JobId)) {385 if (!Executors.ContainsKey(data.JobId)) { 398 386 clientCom.LogMessage("Can't find job with id " + data.JobId); 399 387 } else { 400 Job job = Jobs[data.JobId];388 Job job = wcfService.GetJob(data.JobId); 401 389 wcfService.UpdateJobData(job, data, ConfigManager.Instance.GetClientInfo().Id, JobState.Paused); 402 390 wcfService.UpdateJobState(job.Id, JobState.Waiting, null); … … 416 404 return; 417 405 } 418 if (! jobs.ContainsKey(jobId)) {406 if (!executors.ContainsKey(jobId)) { 419 407 clientCom.LogMessage("Job doesn't exist"); 420 408 return; 421 409 } 422 Job cJob = jobs[jobId];423 cJob.ExecutionTime = executors[jobId].ExecutionTime;410 Job job = wcfService.GetJob(jobId); 411 job.ExecutionTime = executors[jobId].ExecutionTime; 424 412 425 413 if (executors[jobId].Aborted) { … … 436 424 try { 437 425 clientCom.LogMessage("Sending the finished job with id: " + jobId); 438 wcfService.UpdateJobData( cJob, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Finished);426 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Finished); 439 427 } 440 428 catch (Exception e) { … … 456 444 /// A new Job from the wcfService has been received and will be started within a AppDomain. 457 445 /// </summary> 458 private void StartJobInAppDomain(Job myJob, JobData jobData) {459 clientCom.LogMessage("Received new job with id " + myJob.Id);446 private void StartJobInAppDomain(Job job, JobData jobData) { 447 clientCom.LogMessage("Received new job with id " + job.Id); 460 448 clientCom.StatusChanged(ConfigManager.Instance.GetStatusForClientConsole()); 461 449 462 450 lock (startInAppDomainLocker) { 463 if (executors.ContainsKey( myJob.Id)) {464 clientCom.LogMessage("Job with key " + myJob.Id + " already exists. Job will be ignored.");451 if (executors.ContainsKey(job.Id)) { 452 clientCom.LogMessage("Job with key " + job.Id + " already exists. Job will be ignored."); 465 453 return; 466 454 } 467 455 468 String pluginDir = Path.Combine(PluginCache.Instance.PluginTempBaseDir, myJob.Id.ToString());456 String pluginDir = Path.Combine(PluginCache.Instance.PluginTempBaseDir, job.Id.ToString()); 469 457 bool pluginsPrepared = false; 470 458 string configFileName = string.Empty; 471 459 472 460 try { 473 PluginCache.Instance.PreparePlugins( myJob, out configFileName);474 clientCom.LogMessage("Plugins fetched for job " + myJob.Id);461 PluginCache.Instance.PreparePlugins(job, out configFileName); 462 clientCom.LogMessage("Plugins fetched for job " + job.Id); 475 463 pluginsPrepared = true; 476 464 } 477 465 catch (Exception exception) { 478 clientCom.LogMessage(string.Format("Copying plugins for job {0} failed: {1}", myJob.Id, exception));479 wcfService.UpdateJobState( myJob.Id, JobState.Failed, exception.ToString());466 clientCom.LogMessage(string.Format("Copying plugins for job {0} failed: {1}", job.Id, exception)); 467 wcfService.UpdateJobState(job.Id, JobState.Failed, exception.ToString()); 480 468 SlaveStatusInfo.JobsAborted++; 481 lock (executors) {482 if (jobs.ContainsKey(myJob.Id)) {483 jobs.Remove(myJob.Id);484 }485 }486 469 } 487 470 488 471 if (pluginsPrepared) { 489 472 try { 490 AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox( myJob.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName));473 AppDomain appDomain = HeuristicLab.PluginInfrastructure.Sandboxing.SandboxManager.CreateAndInitSandbox(job.Id.ToString(), pluginDir, Path.Combine(pluginDir, configFileName)); 491 474 appDomain.UnhandledException += new UnhandledExceptionEventHandler(AppDomain_UnhandledException); 492 475 Executor executor; 493 appDomains.Add( myJob.Id, appDomain);476 appDomains.Add(job.Id, appDomain); 494 477 clientCom.LogMessage("Creating AppDomain"); 495 478 executor = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName); 496 479 clientCom.LogMessage("Created AppDomain"); 497 executor.JobId = myJob.Id;498 480 executor.Core = this; 499 clientCom.LogMessage("Starting Executor for job " + myJob.Id); 481 executor.JobId = job.Id; 482 executor.CoresNeeded = job.CoresNeeded; 483 executor.MemoryNeeded = job.MemoryNeeded; 484 clientCom.LogMessage("Starting Executor for job " + job.Id); 500 485 executor.Start(jobData.Data); 501 502 486 lock (executors) { 503 executors.Add( myJob.Id, executor);487 executors.Add(job.Id, executor); 504 488 } 505 489 } 506 490 catch (Exception exception) { 507 clientCom.LogMessage("Creating the Appdomain and loading the job failed for job " + myJob.Id);491 clientCom.LogMessage("Creating the Appdomain and loading the job failed for job " + job.Id); 508 492 clientCom.LogMessage("Error thrown is: " + exception.ToString()); 509 493 510 if (executors.ContainsKey( myJob.Id) && executors[myJob.Id].CurrentException != string.Empty) {511 wcfService.UpdateJobState( myJob.Id, JobState.Failed, executors[myJob.Id].CurrentException);494 if (executors.ContainsKey(job.Id) && executors[job.Id].CurrentException != string.Empty) { 495 wcfService.UpdateJobState(job.Id, JobState.Failed, executors[job.Id].CurrentException); 512 496 } else { 513 wcfService.UpdateJobState( myJob.Id, JobState.Failed, exception.ToString());497 wcfService.UpdateJobState(job.Id, JobState.Failed, exception.ToString()); 514 498 } 515 499 SlaveStatusInfo.JobsAborted++; 516 500 517 KillAppDomain( myJob.Id);501 KillAppDomain(job.Id); 518 502 } 519 503 } … … 587 571 } 588 572 589 jobs.Remove(id);590 573 PluginCache.Instance.DeletePluginsForJob(id); 591 574 GC.Collect(); … … 602 585 return null; // avoid destruction of proxy object after 5 minutes 603 586 } 587 588 public int GetCoresNeeded() { 589 lock (executors) { 590 return executors.Sum(x => x.Value.CoresNeeded); 591 } 592 } 604 593 } 605 594 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs
r6112 r6168 34 34 public Guid JobId { get; set; } 35 35 public IJob Job { get; set; } 36 public int CoresNeeded { get; set; } 37 public int MemoryNeeded { get; set; } 36 38 private bool wasJobAborted = false; 37 39 public Core Core { get; set; } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.cs
r6033 r6168 124 124 if (Content != null && Content.Job != null) { 125 125 this.stateTextBox.Text = Content.Job.State.ToString(); 126 this.commandTextBox.Text = Content.Job.Command.ToString(); 126 127 this.executionTimeTextBox.Text = Content.Job.ExecutionTime.ToString(); 127 128 this.dateFinishedTextBox.Text = Content.Job.DateFinished.ToString(); … … 137 138 } else { 138 139 this.stateTextBox.Text = string.Empty; 140 this.commandTextBox.Text = string.Empty; 139 141 this.executionTimeTextBox.Text = string.Empty; 140 142 this.dateCalculatedText.Text = string.Empty; … … 152 154 this.jobIdTextBox.ReadOnly = true; 153 155 this.stateTextBox.ReadOnly = true; 156 this.commandTextBox.ReadOnly = true; 154 157 this.executionTimeTextBox.ReadOnly = true; 155 158 this.dateCreatedTextBox.ReadOnly = true; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/HiveJobView.designer.cs
r6033 r6168 58 58 this.jobIdTextBox = new System.Windows.Forms.TextBox(); 59 59 this.tabControl = new System.Windows.Forms.TabControl(); 60 this.commandTextBox = new System.Windows.Forms.TextBox(); 61 this.commandLabel = new System.Windows.Forms.Label(); 60 62 this.stateLogTabPage.SuspendLayout(); 61 63 this.detailsTabPage.SuspendLayout(); … … 122 124 // 123 125 this.splitContainer1.Panel2.Controls.Add(this.jobStatusGroupBox); 124 this.splitContainer1.Size = new System.Drawing.Size(551, 1 55);126 this.splitContainer1.Size = new System.Drawing.Size(551, 178); 125 127 this.splitContainer1.SplitterDistance = 275; 126 128 this.splitContainer1.TabIndex = 33; … … 139 141 this.configurationGroupBox.Location = new System.Drawing.Point(0, 0); 140 142 this.configurationGroupBox.Name = "configurationGroupBox"; 141 this.configurationGroupBox.Size = new System.Drawing.Size(275, 1 55);143 this.configurationGroupBox.Size = new System.Drawing.Size(275, 178); 142 144 this.configurationGroupBox.TabIndex = 27; 143 145 this.configurationGroupBox.TabStop = false; … … 219 221 // jobStatusGroupBox 220 222 // 223 this.jobStatusGroupBox.Controls.Add(this.commandTextBox); 224 this.jobStatusGroupBox.Controls.Add(this.commandLabel); 221 225 this.jobStatusGroupBox.Controls.Add(this.stateTextBox); 222 226 this.jobStatusGroupBox.Controls.Add(this.dateCalculatedLabel); … … 234 238 this.jobStatusGroupBox.Location = new System.Drawing.Point(0, 0); 235 239 this.jobStatusGroupBox.Name = "jobStatusGroupBox"; 236 this.jobStatusGroupBox.Size = new System.Drawing.Size(272, 1 55);240 this.jobStatusGroupBox.Size = new System.Drawing.Size(272, 178); 237 241 this.jobStatusGroupBox.TabIndex = 24; 238 242 this.jobStatusGroupBox.TabStop = false; … … 251 255 // 252 256 this.dateCalculatedLabel.AutoSize = true; 253 this.dateCalculatedLabel.Location = new System.Drawing.Point(7, 85);257 this.dateCalculatedLabel.Location = new System.Drawing.Point(7, 108); 254 258 this.dateCalculatedLabel.Name = "dateCalculatedLabel"; 255 259 this.dateCalculatedLabel.Size = new System.Drawing.Size(83, 13); … … 270 274 this.dateCalculatedText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 271 275 | System.Windows.Forms.AnchorStyles.Right))); 272 this.dateCalculatedText.Location = new System.Drawing.Point(95, 85);276 this.dateCalculatedText.Location = new System.Drawing.Point(95, 108); 273 277 this.dateCalculatedText.Name = "dateCalculatedText"; 274 278 this.dateCalculatedText.Size = new System.Drawing.Size(171, 20); … … 279 283 this.dateFinishedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 280 284 | System.Windows.Forms.AnchorStyles.Right))); 281 this.dateFinishedTextBox.Location = new System.Drawing.Point(95, 1 07);285 this.dateFinishedTextBox.Location = new System.Drawing.Point(95, 130); 282 286 this.dateFinishedTextBox.Name = "dateFinishedTextBox"; 283 287 this.dateFinishedTextBox.Size = new System.Drawing.Size(171, 20); … … 288 292 this.executionTimeTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 289 293 | System.Windows.Forms.AnchorStyles.Right))); 290 this.executionTimeTextBox.Location = new System.Drawing.Point(95, 41);294 this.executionTimeTextBox.Location = new System.Drawing.Point(95, 64); 291 295 this.executionTimeTextBox.Name = "executionTimeTextBox"; 292 296 this.executionTimeTextBox.Size = new System.Drawing.Size(171, 20); … … 297 301 this.dateCreatedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 298 302 | System.Windows.Forms.AnchorStyles.Right))); 299 this.dateCreatedTextBox.Location = new System.Drawing.Point(95, 63);303 this.dateCreatedTextBox.Location = new System.Drawing.Point(95, 86); 300 304 this.dateCreatedTextBox.Name = "dateCreatedTextBox"; 301 305 this.dateCreatedTextBox.Size = new System.Drawing.Size(171, 20); … … 305 309 // 306 310 this.executionTimeLabel.AutoSize = true; 307 this.executionTimeLabel.Location = new System.Drawing.Point(7, 41);311 this.executionTimeLabel.Location = new System.Drawing.Point(7, 64); 308 312 this.executionTimeLabel.Name = "executionTimeLabel"; 309 313 this.executionTimeLabel.Size = new System.Drawing.Size(80, 13); … … 314 318 // 315 319 this.exceptionLabel.AutoSize = true; 316 this.exceptionLabel.Location = new System.Drawing.Point(7, 1 29);320 this.exceptionLabel.Location = new System.Drawing.Point(7, 152); 317 321 this.exceptionLabel.Name = "exceptionLabel"; 318 322 this.exceptionLabel.Size = new System.Drawing.Size(57, 13); … … 323 327 // 324 328 this.dateCreatedLabel.AutoSize = true; 325 this.dateCreatedLabel.Location = new System.Drawing.Point(7, 63);329 this.dateCreatedLabel.Location = new System.Drawing.Point(7, 86); 326 330 this.dateCreatedLabel.Name = "dateCreatedLabel"; 327 331 this.dateCreatedLabel.Size = new System.Drawing.Size(70, 13); … … 332 336 // 333 337 this.dateFinishedLabel.AutoSize = true; 334 this.dateFinishedLabel.Location = new System.Drawing.Point(7, 1 07);338 this.dateFinishedLabel.Location = new System.Drawing.Point(7, 130); 335 339 this.dateFinishedLabel.Name = "dateFinishedLabel"; 336 340 this.dateFinishedLabel.Size = new System.Drawing.Size(72, 13); … … 342 346 this.exceptionTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 343 347 | System.Windows.Forms.AnchorStyles.Right))); 344 this.exceptionTextBox.Location = new System.Drawing.Point(95, 1 29);348 this.exceptionTextBox.Location = new System.Drawing.Point(95, 152); 345 349 this.exceptionTextBox.Name = "exceptionTextBox"; 346 350 this.exceptionTextBox.Size = new System.Drawing.Size(171, 20); … … 435 439 this.tabControl.Size = new System.Drawing.Size(571, 401); 436 440 this.tabControl.TabIndex = 25; 441 // 442 // commandTextBox 443 // 444 this.commandTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 445 | System.Windows.Forms.AnchorStyles.Right))); 446 this.commandTextBox.Location = new System.Drawing.Point(95, 41); 447 this.commandTextBox.Name = "commandTextBox"; 448 this.commandTextBox.Size = new System.Drawing.Size(171, 20); 449 this.commandTextBox.TabIndex = 24; 450 // 451 // commandLabel 452 // 453 this.commandLabel.AutoSize = true; 454 this.commandLabel.Location = new System.Drawing.Point(7, 41); 455 this.commandLabel.Name = "commandLabel"; 456 this.commandLabel.Size = new System.Drawing.Size(57, 13); 457 this.commandLabel.TabIndex = 25; 458 this.commandLabel.Text = "Command:"; 437 459 // 438 460 // HiveJobView … … 497 519 protected System.Windows.Forms.Label dateCreatedLabel; 498 520 protected System.Windows.Forms.SplitContainer splitContainer1; 521 protected System.Windows.Forms.TextBox commandTextBox; 522 protected System.Windows.Forms.Label commandLabel; 499 523 500 524 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/OptimizerHiveJobView.cs
r6033 r6168 54 54 base.SetEnabledStateOfControls(); 55 55 56 this.restartButton.Enabled = Content != null && Content.Job.State == JobState.Paused;57 this.pauseButton.Enabled = Content != null && Content.Job.State == JobState.Calculating;58 this.stopButton.Enabled = Content != null && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused);56 this.restartButton.Enabled = Content != null && !Content.Job.Command.HasValue && Content.Job.State == JobState.Paused; 57 this.pauseButton.Enabled = Content != null && !Content.Job.Command.HasValue && Content.Job.State == JobState.Calculating; 58 this.stopButton.Enabled = Content != null && !Content.Job.Command.HasValue && (Content.Job.State == JobState.Calculating || Content.Job.State == JobState.Waiting || Content.Job.State == JobState.Paused); 59 59 } 60 60 #endregion -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/StateLogGanttChartListView.cs
r6004 r6168 64 64 if (Content.Count > 0) { 65 65 DateTime maxValue = Content.Max(x => x.Count > 0 ? x.Max(y => y.DateTime) : DateTime.MinValue); 66 var upperLimit = DateTime.FromOADate(Math.Min(DateTime.Now.AddSeconds(10).ToOADate(), maxValue.AddSeconds(10).ToOADate())); 66 DateTime upperLimit; 67 if (Content.All(x => x.Count > 0 ? (x.Last().State == JobState.Finished || x.Last().State == JobState.Failed || x.Last().State == JobState.Aborted) : true)) { 68 upperLimit = DateTime.FromOADate(Math.Min(DateTime.Now.AddSeconds(10).ToOADate(), maxValue.AddSeconds(10).ToOADate())); 69 } else { 70 upperLimit = DateTime.Now; 71 } 67 72 68 73 for (int i = 0; i < Content.Count; i++) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/StateLogGanttChartView.cs
r5779 r6168 62 62 StateLogGanttChartListView.SetupCategories(ganttChart); 63 63 if (Content.Count > 0) { 64 var upperLimit = DateTime.FromOADate(Math.Min(Content.Max(x => x.DateTime).ToOADate(), DateTime.Now.AddSeconds(10).ToOADate())); 64 DateTime upperLimit; 65 if(Content.Last().State == JobState.Finished || Content.Last().State == JobState.Failed || Content.Last().State == JobState.Aborted) { 66 upperLimit = DateTime.FromOADate(Math.Min(Content.Max(x => x.DateTime).ToOADate(), DateTime.Now.AddSeconds(10).ToOADate())); 67 } else { 68 upperLimit = DateTime.Now; 69 } 65 70 66 71 for (int i = 0; i < Content.Count - 1; i++) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJob.cs
r6111 r6168 320 320 321 321 public void Pause() { 322 ServiceLocator.Instance.CallHiveService(s => s.PauseJob(this.job.Id)); 322 if (this.Job.IsParentJob) { 323 foreach (var child in ChildHiveJobs) { 324 ServiceLocator.Instance.CallHiveService(s => s.PauseJob(child.job.Id)); 325 } 326 } else { 327 ServiceLocator.Instance.CallHiveService(s => s.PauseJob(this.job.Id)); 328 } 323 329 } 324 330 325 331 public void Stop() { 326 ServiceLocator.Instance.CallHiveService(s => s.StopJob(this.job.Id)); 332 if (this.Job.IsParentJob) { 333 foreach (var child in ChildHiveJobs) { 334 ServiceLocator.Instance.CallHiveService(s => s.StopJob(child.job.Id)); 335 } 336 } else { 337 ServiceLocator.Instance.CallHiveService(s => s.StopJob(this.job.Id)); 338 } 327 339 } 328 340 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/HiveJobDownloader.cs
r6033 r6168 1 using System; 1 #region License Information 2 /* HeuristicLab 3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 * 5 * This file is part of HeuristicLab. 6 * 7 * HeuristicLab is free software: you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation, either version 3 of the License, or 10 * (at your option) any later version. 11 * 12 * HeuristicLab is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>. 19 */ 20 #endregion 21 22 using System; 2 23 using System.Collections.Generic; 3 24 using System.Linq; 4 using System.Threading;5 using System.Threading.Tasks;6 25 using HeuristicLab.Clients.Hive.ExperimentManager; 7 26 using HeuristicLab.Clients.Hive.Jobs; … … 11 30 public class HiveJobDownloader { 12 31 private IEnumerable<Guid> jobIds; 13 private List<Task<HiveJob>> tasks;14 private bool abort = false;32 private JobDownloader<ItemJob> jobDownloader; 33 private IDictionary<Guid, HiveJob> results; 15 34 16 35 public bool IsFinished { 17 36 get { 18 return tasks.TrueForAll(t => t.Status == TaskStatus.RanToCompletion || 19 t.Status == TaskStatus.Faulted || 20 t.Status == TaskStatus.Canceled); 37 //return tasks.TrueForAll(t => t.Status == TaskStatus.RanToCompletion || 38 // t.Status == TaskStatus.Faulted || 39 // t.Status == TaskStatus.Canceled); 40 return results.Count == jobIds.Count(); 21 41 } 22 42 } … … 24 44 public int FinishedCount { 25 45 get { 26 var faulted = tasks.Where(t => t.Status == TaskStatus.Faulted); 27 if (faulted.Count() > 0) { 28 abort = true; 29 throw faulted.First().Exception; 30 } 31 return tasks.Count(t => t.Status == TaskStatus.RanToCompletion || 32 t.Status == TaskStatus.Faulted || 33 t.Status == TaskStatus.Canceled); 46 //var faulted = tasks.Where(t => t.Status == TaskStatus.Faulted); 47 //if (faulted.Count() > 0) { 48 // abort = true; 49 // throw faulted.First().Exception; 50 //} 51 //return tasks.Count(t => t.Status == TaskStatus.RanToCompletion || 52 // t.Status == TaskStatus.Faulted || 53 // t.Status == TaskStatus.Canceled); 54 return results.Count; 34 55 } 35 56 } … … 37 58 public IDictionary<Guid, HiveJob> Results { 38 59 get { 39 var results = new Dictionary<Guid, HiveJob>();40 foreach (var t in tasks) {41 if (t.Status == TaskStatus.Faulted) {42 throw t.Exception;43 }44 if (t.Result != null)45 results.Add(t.Result.Job.Id, t.Result);46 }60 //var results = new Dictionary<Guid, HiveJob>(); 61 //foreach (var t in tasks) { 62 // if (t.Status == TaskStatus.Faulted) { 63 // throw t.Exception; 64 // } 65 // if (t.Result != null) 66 // results.Add(t.Result.Job.Id, t.Result); 67 //} 47 68 return results; 48 69 } … … 51 72 public HiveJobDownloader(IEnumerable<Guid> jobIds) { 52 73 this.jobIds = jobIds; 74 this.jobDownloader = new JobDownloader<ItemJob>(2, 2); 75 this.results = new Dictionary<Guid, HiveJob>(); 53 76 } 54 77 55 78 public void StartAsync() { 56 abort = false;57 tasks = new List<Task<HiveJob>>();58 TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException);59 79 foreach (Guid jobId in jobIds) { 60 tasks.Add(Task<JobData>.Factory.StartNew( 61 (x) => DownloadJob(x), jobId) 62 .ContinueWith((x) => DeserializeJob(x.Result))); 80 jobDownloader.DownloadJob(jobId, 81 (id, itemJob, exception) => { 82 if (exception != null) { 83 throw new JobDownloaderException("Downloading job failed", exception); 84 } 85 Job job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(id)); 86 if (job != null && itemJob != null) { 87 HiveJob hiveJob; 88 if (itemJob is OptimizerJob) { 89 hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob); 90 } else { 91 hiveJob = new HiveJob(itemJob, true); 92 } 93 hiveJob.Job = job; 94 this.results.Add(id, hiveJob); 95 } 96 }); 63 97 } 98 99 //tasks = new List<Task<HiveJob>>(); 100 //TaskScheduler.UnobservedTaskException += new EventHandler<UnobservedTaskExceptionEventArgs>(TaskScheduler_UnobservedTaskException); 101 //foreach (Guid jobId in jobIds) { 102 // tasks.Add(Task<JobData>.Factory.StartNew( 103 // (x) => DownloadJob(x), jobId) 104 // .ContinueWith((x) => DeserializeJob(x.Result))); 105 //} 64 106 } 65 107 66 private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) {67 e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property68 }108 //private void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { 109 // e.SetObserved(); // avoid crash of process because task crashes. first exception found is handled in Results property 110 //} 69 111 70 // use semaphore to ensure only few concurrenct connections and few SerializedJob objects in memory71 private Semaphore downloadSemaphore = new Semaphore(2, 2);72 private Semaphore deserializeSemaphore = new Semaphore(2, 2);73 protected JobData DownloadJob(object jobId) {74 downloadSemaphore.WaitOne();75 deserializeSemaphore.WaitOne();76 JobData result;77 try {78 if (abort) return null;79 result = ServiceLocator.Instance.CallHiveService(s => s.GetJobData((Guid)jobId));80 }81 finally {82 downloadSemaphore.Release();83 }84 return result;85 }112 //// use semaphore to ensure only few concurrenct connections and few SerializedJob objects in memory 113 //private Semaphore downloadSemaphore = new Semaphore(2, 2); 114 //private Semaphore deserializeSemaphore = new Semaphore(2, 2); 115 //protected JobData DownloadJob(object jobId) { 116 // downloadSemaphore.WaitOne(); 117 // deserializeSemaphore.WaitOne(); 118 // JobData result; 119 // try { 120 // if (abort) return null; 121 // result = ServiceLocator.Instance.CallHiveService(s => s.GetJobData((Guid)jobId)); 122 // } 123 // finally { 124 // downloadSemaphore.Release(); 125 // } 126 // return result; 127 //} 86 128 87 protected HiveJob DeserializeJob(JobData jobData) {88 try {89 Job job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(jobData.JobId));90 if (abort || job == null || jobData == null) return null;129 //protected HiveJob DeserializeJob(JobData jobData) { 130 // try { 131 // Job job = ServiceLocator.Instance.CallHiveService(s => s.GetJob(jobData.JobId)); 132 // if (abort || job == null || jobData == null) return null; 91 133 92 HiveJob hiveJob;93 var itemJob = PersistenceUtil.Deserialize<ItemJob>(jobData.Data);94 if (itemJob is OptimizerJob) {95 hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob);96 } else {97 hiveJob = new HiveJob(itemJob, true);98 }99 jobData.Data = null; // reduce memory consumption.100 hiveJob.Job = job;101 return hiveJob;102 }103 finally {104 deserializeSemaphore.Release();105 }106 }134 // HiveJob hiveJob; 135 // var itemJob = PersistenceUtil.Deserialize<ItemJob>(jobData.Data); 136 // if (itemJob is OptimizerJob) { 137 // hiveJob = new OptimizerHiveJob((OptimizerJob)itemJob); 138 // } else { 139 // hiveJob = new HiveJob(itemJob, true); 140 // } 141 // jobData.Data = null; // reduce memory consumption. 142 // hiveJob.Job = job; 143 // return hiveJob; 144 // } 145 // finally { 146 // deserializeSemaphore.Release(); 147 // } 148 //} 107 149 } 108 150 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/JobDownloader.cs
r6111 r6168 20 20 } 21 21 22 public void DownloadJob(Guid jobId, Action< T> onFinishedAction) {22 public void DownloadJob(Guid jobId, Action<Guid, T, Exception> onFinishedAction) { 23 23 Task<JobData>.Factory.StartNew((x) => DownloadJob(x), jobId) 24 24 .ContinueWith((x) => DeserializeJob(x.Result)) 25 .ContinueWith((x) => OnJobFinished( x.Result, onFinishedAction), TaskContinuationOptions.ExecuteSynchronously);25 .ContinueWith((x) => OnJobFinished(jobId, x, onFinishedAction), TaskContinuationOptions.ExecuteSynchronously); 26 26 } 27 27 28 private T OnJobFinished(T job, Action<T> onFinishedAction) { 29 onFinishedAction(job); 30 return job; 28 private void OnJobFinished(Guid jobId, Task<T> task, Action<Guid, T, Exception> onFinishedAction) { 29 onFinishedAction(jobId, task.Result, task.Exception); 31 30 } 32 31 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ExperimentManager/RefreshableHiveExperiment.cs
r6110 r6168 35 35 private JobResultPoller jobResultPoller; 36 36 private JobDownloader<ItemJob> jobDownloader = new JobDownloader<ItemJob>(2, 2); 37 private static object locker = new object(); 37 38 38 39 [Storable] … … 66 67 get { return refreshAutomatically; } 67 68 set { 68 if (refreshAutomatically != value) { 69 refreshAutomatically = value; 70 OnRefreshAutomaticallyChanged(); 71 } 72 if (RefreshAutomatically && hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) { 73 StartResultPolling(); 74 } else { 75 StopResultPolling(); 69 lock (locker) { 70 if (refreshAutomatically != value) { 71 refreshAutomatically = value; 72 OnRefreshAutomaticallyChanged(); 73 } 74 if (RefreshAutomatically) { 75 if (hiveExperiment.HiveJobs != null && hiveExperiment.HiveJobs.Count > 0 && (jobResultPoller == null || !jobResultPoller.IsPolling)) { 76 StartResultPolling(); 77 } 78 } else { 79 StopResultPolling(); 80 } 76 81 } 77 82 } … … 156 161 // lastJobDataUpdate equals DateTime.MinValue right after it was uploaded. When the first results are polled, this value is updated 157 162 if (lastJobDataUpdate != DateTime.MinValue && lastJobDataUpdate < hj.Job.LastJobDataUpdate) { 158 jobDownloader.DownloadJob(hj.Job.Id, (itemJob) => { 163 jobDownloader.DownloadJob(hj.Job.Id, (id, itemJob, exception) => { 164 if (exception != null) { 165 throw new JobDownloaderException("Downloading job failed.", exception); 166 } 167 159 168 if (itemJob == null) { 160 169 // something bad happened to this job. bad job, BAAAD job! … … 218 227 hiveExperiment.ExecutionTime = TimeSpan.FromMilliseconds(hiveExperiment.GetAllHiveJobs().Sum(x => x.Job.ExecutionTime.HasValue ? x.Job.ExecutionTime.Value.TotalMilliseconds : 0)); 219 228 } 220 221 public void OnLoaded() {222 this.UpdateTotalExecutionTime();223 224 if (hiveExperiment.ExecutionState != ExecutionState.Stopped) {225 this.RefreshAutomatically = true;226 }227 }228 229 #endregion 229 230 … … 235 236 hiveExperiment.ModifiedChanged += new EventHandler(hiveExperiment_ModifiedChanged); 236 237 hiveExperiment.IsProgressingChanged += new EventHandler(hiveExperiment_IsProgressingChanged); 238 hiveExperiment.Loaded += new EventHandler(hiveExperiment_Loaded); 237 239 } 238 240 … … 244 246 hiveExperiment.ModifiedChanged -= new EventHandler(hiveExperiment_ModifiedChanged); 245 247 hiveExperiment.IsProgressingChanged -= new EventHandler(hiveExperiment_IsProgressingChanged); 248 hiveExperiment.Loaded -= new EventHandler(hiveExperiment_Loaded); 249 } 250 251 private void hiveExperiment_Loaded(object sender, EventArgs e) { 252 this.UpdateTotalExecutionTime(); 253 254 if (hiveExperiment.ExecutionState != ExecutionState.Stopped) { 255 this.RefreshAutomatically = true; 256 } 246 257 } 247 258 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/HeuristicLab.Clients.Hive-3.4.csproj
r6111 r6168 123 123 <Compile Include="ExperimentManager\ExperimentManagerClient.cs" /> 124 124 <Compile Include="ExperimentManager\HiveJobDownloader.cs" /> 125 <Compile Include="ExperimentManager\JobDownloaderException.cs" /> 125 126 <Compile Include="ExperimentManager\TreeView\IItemTree.cs" /> 126 127 <Compile Include="ExperimentManager\TreeView\IItemTreeAction.cs" /> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/HiveExperiment.cs
r6033 r6168 119 119 #region Events 120 120 public event EventHandler ExecutionTimeChanged; 121 pr ivatevoid OnExecutionTimeChanged() {122 EventHandler handler = ExecutionTimeChanged;121 protected virtual void OnExecutionTimeChanged() { 122 var handler = ExecutionTimeChanged; 123 123 if (handler != null) handler(this, EventArgs.Empty); 124 124 } 125 125 126 126 public event EventHandler ExecutionStateChanged; 127 pr ivatevoid OnExecutionStateChanged() {128 EventHandler handler = ExecutionStateChanged;127 protected virtual void OnExecutionStateChanged() { 128 var handler = ExecutionStateChanged; 129 129 if (handler != null) handler(this, EventArgs.Empty); 130 130 } … … 132 132 public event EventHandler HiveJobsChanged; 133 133 protected virtual void OnHiveJobsChanged() { 134 EventHandler handler = HiveJobsChanged;134 var handler = HiveJobsChanged; 135 135 if (handler != null) handler(this, EventArgs.Empty); 136 136 } 137 137 138 138 public event EventHandler IsProgressingChanged; 139 private void OnIsProgressingChanged() { 140 EventHandler handler = IsProgressingChanged; 139 protected virtual void OnIsProgressingChanged() { 140 var handler = IsProgressingChanged; 141 if (handler != null) handler(this, EventArgs.Empty); 142 } 143 144 public event EventHandler Loaded; 145 public virtual void OnLoaded() { 146 var handler = Loaded; 141 147 if (handler != null) handler(this, EventArgs.Empty); 142 148 } … … 175 181 return Name; 176 182 } 177 178 public virtual void OnLoaded() { }179 183 } 180 184 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/app_ascheibe.config
r6167 r6168 1 1 <?xml version="1.0"?> 2 2 <configuration> 3 <system.serviceModel> 4 <bindings> 5 <wsHttpBinding> 6 <binding name="wsHttpBinding_Hive" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 7 <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="2147483647"/> 8 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 9 <security mode="Message"> 10 <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 11 <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/> 12 </security> 13 </binding> 14 </wsHttpBinding> 15 </bindings> 16 <client> 3 <system.serviceModel> 4 <bindings> 5 <wsHttpBinding> 6 <binding name="wsHttpBinding_IHiveService" 7 closeTimeout="00:01:00" 8 openTimeout="00:01:00" 9 receiveTimeout="00:20:00" 10 sendTimeout="00:20:00" 11 bypassProxyOnLocal="false" 12 transactionFlow="false" 13 hostNameComparisonMode="StrongWildcard" 14 maxBufferPoolSize="2147483647" 15 maxReceivedMessageSize="2147483647" 16 messageEncoding="Text" 17 textEncoding="utf-8" 18 useDefaultWebProxy="true" 19 allowCookies="false"> 20 21 <readerQuotas maxDepth="2147483647" 22 maxStringContentLength="2147483647" 23 maxArrayLength="2147483647" 24 maxBytesPerRead="2147483647" 25 maxNameTableCharCount="2147483647"/> 26 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 27 <security mode="Message"> 28 <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 29 <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/> 30 </security> 31 </binding> 32 </wsHttpBinding> 33 </bindings> 34 <client> 17 35 <endpoint address="http://localhost/HiveService.svc" 18 36 binding="wsHttpBinding" 19 bindingConfiguration="wsHttpBinding_ Hive"37 bindingConfiguration="wsHttpBinding_IHiveService" 20 38 contract="HeuristicLab.Clients.Hive.IHiveService" 21 39 name="wsHttpBinding_IHiveService"> … … 25 43 26 44 </endpoint> 27 </client> 28 </system.serviceModel> 29 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> 45 </client> 46 </system.serviceModel> 47 <startup> 48 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 49 </startup> 50 </configuration> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/app_f005pc.config
r6167 r6168 1 1 <?xml version="1.0"?> 2 2 <configuration> 3 <system.serviceModel> 4 <bindings> 5 <wsHttpBinding> 6 <binding name="wsHttpBinding_Hive" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:20:00" sendTimeout="00:20:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> 7 <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/> 8 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 9 <security mode="Message"> 10 <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 11 <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/> 12 </security> 13 </binding> 14 </wsHttpBinding> 15 </bindings> 16 <client> 17 <endpoint address="http://localhost/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_Hive" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService"> 18 <identity> 19 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/> 20 </identity> 21 </endpoint> 22 </client> 23 </system.serviceModel> 24 <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> 3 <system.serviceModel> 4 <bindings> 5 <wsHttpBinding> 6 <binding name="wsHttpBinding_IHiveService" 7 closeTimeout="00:01:00" 8 openTimeout="00:01:00" 9 receiveTimeout="00:20:00" 10 sendTimeout="00:20:00" 11 bypassProxyOnLocal="false" 12 transactionFlow="false" 13 hostNameComparisonMode="StrongWildcard" 14 maxBufferPoolSize="2147483647" 15 maxReceivedMessageSize="2147483647" 16 messageEncoding="Text" 17 textEncoding="utf-8" 18 useDefaultWebProxy="true" 19 allowCookies="false"> 20 21 <readerQuotas maxDepth="2147483647" 22 maxStringContentLength="2147483647" 23 maxArrayLength="2147483647" 24 maxBytesPerRead="2147483647" 25 maxNameTableCharCount="2147483647"/> 26 <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/> 27 <security mode="Message"> 28 <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/> 29 <message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default"/> 30 </security> 31 </binding> 32 </wsHttpBinding> 33 </bindings> 34 <client> 35 <endpoint address="http://localhost/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService"> 36 <identity> 37 <certificate encodedValue="AwAAAAEAAAAUAAAAfEKvcVixnJay+q4hCPFuO0JL5TQgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxOTEwNTMxNVoXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXwC5TGcAffd/0oAWHtm0s6YXVXEgXgb1AYmBkkkhkKIFJG/e/Z0KSYbJepmSJD44W3oOAVm+x1DAsZxU79HahDYgWCuHLMm1TLpwSmYOQ0kV3pGHWHhiWV7h7oGLds/eqZ2EOpaNGryfEPnrA4VmxY91vV5/2BTeVSWG6F8lRKQIDAQABo0kwRzBFBgNVHQEEPjA8gBAR7kBnMRHO5gzThEqda0wWoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghCNN5wrUcXMmE/9xwp4TYa9MAkGBSsOAwIdBQADgYEAoPwEG4QTDXhlxERNDfsZmM2IhEpV42ppz1kEah2oYKDa/ElIMVtvqLv6flVtg18ENN/mEJWiHZ3NyP3qr2Pip+sh+/2WBiSbOaukES/CM7OJn9kJCImH7M/xqM8pxqY8IfgM6iBVrVj9uHqj3j2BBck+cYY8fKyh3CFifMIp6ac="/> 38 </identity> 39 </endpoint> 40 </client> 41 </system.serviceModel> 42 <startup> 43 <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> 44 </startup> 45 </configuration> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/app_services.config
r6167 r6168 4 4 <bindings> 5 5 <wsHttpBinding> 6 <binding name="wsHttpBinding_ Hive"6 <binding name="wsHttpBinding_IHiveService" 7 7 closeTimeout="00:01:00" 8 8 openTimeout="00:01:00" … … 33 33 </bindings> 34 34 <client> 35 <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_ Hive" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService">35 <endpoint address="http://services.heuristiclab.com/Hive-3.4/HiveService.svc" binding="wsHttpBinding" bindingConfiguration="wsHttpBinding_IHiveService" contract="HeuristicLab.Clients.Hive.IHiveService" name="wsHttpBinding_IHiveService"> 36 36 <identity> 37 37 <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Web/Hive-3.4/Web.config
r6167 r6168 30 30 <bindings> 31 31 <wsHttpBinding> 32 <binding name="WSHttpBinding_IHiveService" receiveTimeout="00:20:00" 33 sendTimeout="00:20:00" maxBufferPoolSize="104857600" maxReceivedMessageSize="104857600"> 34 <readerQuotas maxStringContentLength="104857600" maxArrayLength="104857600" /> 32 33 <binding name="WSHttpBinding_IHiveService" 34 receiveTimeout="00:10:00" 35 sendTimeout="00:10:00" 36 maxBufferPoolSize="2147483647" 37 maxReceivedMessageSize="2147483647"> 38 <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" /> 35 39 <security mode="Message"> 36 40 <transport clientCredentialType="Certificate"/> … … 55 59 <serviceSecurityAudit auditLogLocation="Application" suppressAuditFailure="false" messageAuthenticationAuditLevel="SuccessOrFailure" /> 56 60 <serviceThrottling maxConcurrentCalls="100" /> 61 <dataContractSerializer maxItemsInObjectGraph="2147483647" /> 57 62 </behavior> 58 63 </serviceBehaviors> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive/3.4/HiveService.cs
r6110 r6168 171 171 public void StopJob(Guid jobId) { 172 172 trans.UseTransaction(() => { 173 //dao.UpdateJobState(jobId, JobState.Aborted, null, auth.UserId, string.Empty);174 173 var job = dao.GetJob(jobId); 175 job.Command = Command.Stop; 176 dao.UpdateJob(job); 174 if (job.State == JobState.Calculating || job.State == JobState.Transferring) { 175 job.Command = Command.Stop; 176 dao.UpdateJob(job); 177 } else { 178 if (job.State != JobState.Aborted && job.State != JobState.Finished && job.State != JobState.Failed) { 179 job = UpdateJobState(jobId, JobState.Aborted, null, null, string.Empty); 180 } 181 } 177 182 }); 178 183 } … … 183 188 public void PauseJob(Guid jobId) { 184 189 trans.UseTransaction(() => { 185 //dao.UpdateJobState(jobId, JobState.Paused, null, auth.UserId, string.Empty);186 190 var job = dao.GetJob(jobId); 187 job.Command = Command.Pause; 188 dao.UpdateJob(job); 191 if (job.State == JobState.Calculating || job.State == JobState.Transferring) { 192 job.Command = Command.Pause; 193 dao.UpdateJob(job); 194 } else { 195 job = UpdateJobState(jobId, JobState.Paused, null, null, string.Empty); 196 } 189 197 }); 190 198 }
Note: See TracChangeset
for help on using the changeset viewer.