- Timestamp:
- 02/17/11 14:47:56 (14 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r5472 r5511 185 185 engines[job.Id].Pause(); 186 186 JobData sJob = engines[job.Id].GetFinishedJob(); 187 job.Exception = engines[job.Id].CurrentException;187 // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is paused 188 188 job.ExecutionTime = engines[job.Id].ExecutionTime; 189 189 190 190 try { 191 191 ClientCom.LogMessage("Sending the paused job with id: " + job.Id); 192 wcfService.UpdateJob (job, sJob);192 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id); 193 193 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 194 194 } … … 208 208 engines[job.Id].Stop(); 209 209 JobData sJob = engines[job.Id].GetFinishedJob(); 210 job.Exception = engines[job.Id].CurrentException;210 // job.Exception = engines[job.Id].CurrentException; // can there be an exception if a job is stopped regularly 211 211 job.ExecutionTime = engines[job.Id].ExecutionTime; 212 212 213 213 try { 214 214 ClientCom.LogMessage("Sending the stoppped job with id: " + job.Id); 215 wcfService.UpdateJob (job, sJob);215 wcfService.UpdateJobData(job, sJob, ConfigManager.Instance.GetClientInfo().Id); 216 216 SlaveStatusInfo.JobsProcessed++; //TODO: count or not count, thats the question 217 217 } … … 345 345 } else { 346 346 Job job = Jobs[data.JobId]; 347 job.JobState = JobState.WaitingForChildJobs; 348 wcfService.UpdateJob(job, data); 347 job.SetState(JobState.Transferring); 348 wcfService.UpdateJobData(job, data, ConfigManager.Instance.GetClientInfo().Id); 349 job.SetState(JobState.Waiting); // todo: what if it was a ResumeOnChildJobsFinished job before? maybe look into StateLog 350 wcfService.UpdateJob(job); 349 351 } 350 352 KillAppDomain(data.JobId); … … 372 374 cJob.ExecutionTime = engines[jobId].ExecutionTime; 373 375 374 JobData sJob = engines[j obId].GetFinishedJob();375 cJob.Exception = engines[jobId].CurrentException;376 cJob.ExecutionTime = engines[j obId].ExecutionTime;376 JobData sJob = engines[jId].GetFinishedJob(); 377 // cJob.Exception = engines[jId].CurrentException; // can there be an exception if the job is sent normally. the exception should be entered in the statelog with the corresponding state (Failed) 378 cJob.ExecutionTime = engines[jId].ExecutionTime; 377 379 378 380 try { 379 381 ClientCom.LogMessage("Sending the finished job with id: " + jobId); 380 wcfService.UpdateJob (cJob, sJob);382 wcfService.UpdateJobData(cJob, sJob, ConfigManager.Instance.GetClientInfo().Id); 381 383 SlaveStatusInfo.JobsProcessed++; 382 384 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs
r5469 r5511 128 128 129 129 Job childJob = new Job(); 130 childJob. JobState = JobState.Offline;130 childJob.SetState(JobState.Offline); 131 131 childJob.CoresNeeded = 1; 132 132 childJob.MemoryNeeded = 0; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs
r5458 r5511 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Clients.Common; 25 using HeuristicLab.Clients.Hive.Slave.Properties;26 25 using HeuristicLab.Common; 27 26 using HeuristicLab.Services.Hive.Common; … … 141 140 } 142 141 142 public void UpdateJob(Job job) { 143 using (Disposable<IHiveService> service = GetSlaveService()) { 144 try { 145 service.Obj.UpdateJob(job); 146 } 147 catch (Exception ex) { 148 HandleNetworkError(ex); 149 } 150 } 151 } 152 143 153 /// <summary> 144 154 /// used on pause or if job finished to upload the job results … … 146 156 /// <param name="job"></param> 147 157 /// <param name="jobData"></param> 148 public void UpdateJob(Job job, JobData jobData) { 149 using (Disposable<IHiveService> service = GetSlaveService()) { 150 try { 151 service.Obj.UpdateJob(job, jobData); 152 } 153 catch (Exception ex) { 154 HandleNetworkError(ex); 155 } 156 } 157 } 158 158 public void UpdateJobData(Job job, JobData jobData, Guid slaveId) { 159 using (Disposable<IHiveService> service = GetSlaveService()) { 160 try { 161 JobState before = job.State; 162 job.SetState(JobState.Transferring, slaveId, ""); 163 service.Obj.UpdateJob(job); 164 165 service.Obj.UpdateJobData(job, jobData); 166 167 job.SetState(before, slaveId, ""); 168 service.Obj.UpdateJob(job); 169 } 170 catch (Exception ex) { 171 HandleNetworkError(ex); 172 } 173 } 174 } 175 159 176 public List<MessageContainer> SendHeartbeat(Heartbeat heartbeat) { 160 177 using (Disposable<IHiveService> service = GetSlaveService()) {
Note: See TracChangeset
for help on using the changeset viewer.