Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/11 15:54:58 (13 years ago)
Author:
cneumuel
Message:

#1233

  • implemented correct downloading of paused jobs. its now also possible to change parameters and resume a algorithm
  • removed Prepare() calls in ExperimentManager and in slave, as it prevents corrent resuming of paused jobs
  • made events in ItemTreeView be invoked in the correct thread
  • reduced log output in ExperimentManager
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  
    159159        switch (container.Message) {
    160160          case MessageContainer.MessageType.CalculateJob:
    161             clientCom.LogMessage("Task.StartNew[0]: jobId: " + container.JobId);
    162161            Task.Factory.StartNew((jobIdObj) => {
    163162              Guid jobId = (Guid)jobIdObj;
    164               clientCom.LogMessage("Task.StartNew[1]: jobId: " + jobId);
    165163              Job job = wcfService.GetJob(jobId);
    166164              if (job == null) throw new JobNotFoundException(jobId);
     
    217215
    218216    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          }
    260264        }
    261265      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs

    r5789 r5793  
    7676          Job.Resume(childjobs.Select(j => PersistenceUtil.Deserialize<IJob>(j.Data)));
    7777        } else {
    78           Job.Prepare();
     78          // Job.Prepare(); // do NOT prepare here, otherwise paused jobs get restarted
    7979          Job.Start();
    8080        }
Note: See TracChangeset for help on using the changeset viewer.