- Timestamp:
- 03/22/11 15:54:58 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r5789 r5793 159 159 switch (container.Message) { 160 160 case MessageContainer.MessageType.CalculateJob: 161 clientCom.LogMessage("Task.StartNew[0]: jobId: " + container.JobId);162 161 Task.Factory.StartNew((jobIdObj) => { 163 162 Guid jobId = (Guid)jobIdObj; 164 clientCom.LogMessage("Task.StartNew[1]: jobId: " + jobId);165 163 Job job = wcfService.GetJob(jobId); 166 164 if (job == null) throw new JobNotFoundException(jobId); … … 217 215 218 216 private void DoPauseJob(Guid jobId) { 219 Job job = Jobs[jobId]; 220 221 if (job != null) { 222 engines[job.Id].Pause(); 223 JobData sJob = engines[job.Id].GetPausedJob(); 224 // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is paused 225 job.ExecutionTime = engines[job.Id].ExecutionTime; 226 227 try { 228 clientCom.LogMessage("Sending the paused job with id: " + job.Id); 229 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Paused); 230 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 231 } 232 catch (Exception e) { 233 clientCom.LogMessage("Transmitting to server failed. Storing the paused job with id: " + job.Id + " to hdd (" + e.ToString() + ")"); 234 } 235 finally { 236 KillAppDomain(job.Id); // kill app-domain in every case 237 } 238 } 239 } 240 241 private void DoStopJob(Guid guid) { 242 Job job = Jobs[guid]; 243 244 if (job != null) { 245 engines[job.Id].Stop(); 246 JobData sJob = engines[job.Id].GetFinishedJob(); 247 // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is stopped regularly 248 job.ExecutionTime = engines[job.Id].ExecutionTime; 249 250 try { 251 clientCom.LogMessage("Sending the stoppped job with id: " + job.Id); 252 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Paused); 253 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 254 } 255 catch (Exception e) { 256 clientCom.LogMessage("Transmitting to server failed. Storing the paused job with id: " + job.Id + " to hdd (" + e.ToString() + ")"); 257 } 258 finally { 259 KillAppDomain(job.Id); // kill app-domain in every case 217 if (!Jobs.ContainsKey(jobId)) { 218 clientCom.LogMessage("DoPauseJob: Can't find job with id " + jobId); 219 } else { 220 Job job = Jobs[jobId]; 221 222 if (job != null) { 223 engines[job.Id].Pause(); 224 JobData sJob = engines[job.Id].GetPausedJob(); 225 job.ExecutionTime = engines[job.Id].ExecutionTime; 226 227 try { 228 clientCom.LogMessage("Sending the paused job with id: " + job.Id); 229 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Paused); 230 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 231 } 232 catch (Exception e) { 233 clientCom.LogMessage("Transmitting to server failed. Storing the paused job with id: " + job.Id + " to hdd (" + e.ToString() + ")"); 234 } 235 finally { 236 KillAppDomain(job.Id); // kill app-domain in every case 237 } 238 } 239 } 240 } 241 242 private void DoStopJob(Guid jobId) { 243 if (!Jobs.ContainsKey(jobId)) { 244 clientCom.LogMessage("DoStopJob: Can't find job with id " + jobId); 245 } else { 246 Job job = Jobs[jobId]; 247 248 if (job != null) { 249 engines[job.Id].Stop(); 250 JobData sJob = engines[job.Id].GetFinishedJob(); 251 job.ExecutionTime = engines[job.Id].ExecutionTime; 252 253 try { 254 clientCom.LogMessage("Sending the stoppped job with id: " + job.Id); 255 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id, JobState.Finished); 256 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 257 } 258 catch (Exception e) { 259 clientCom.LogMessage("Transmitting to server failed. Storing the paused job with id: " + job.Id + " to hdd (" + e.ToString() + ")"); 260 } 261 finally { 262 KillAppDomain(job.Id); // kill app-domain in every case 263 } 260 264 } 261 265 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs
r5789 r5793 76 76 Job.Resume(childjobs.Select(j => PersistenceUtil.Deserialize<IJob>(j.Data))); 77 77 } else { 78 Job.Prepare();78 // Job.Prepare(); // do NOT prepare here, otherwise paused jobs get restarted 79 79 Job.Start(); 80 80 }
Note: See TracChangeset
for help on using the changeset viewer.