Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/07/10 10:22:27 (14 years ago)
Author:
cneumuel
Message:
  • created HiveClient which shows an overview over all submitted HiveExperiments
  • its possible to download all submitted HiveExperiments including results
  • Experiments are now sent as a whole to the Hive and the Hive-Slaves take care of creating child-jobs (if necessary). The parent job is then paused and will be reactivated when all child-jobs are finished
  • WcfService-Clients are now consistently managed by WcfServicePool which allows to use IDisposable-Pattern and always keeps exactly one proxy-object until all callers disposed them.
  • created ProgressView which is able to lock a View and display progress of an action. It also allows to simulate progress if no progress-information is available so that users don't get too nervous while waiting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-Hive/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Core/3.3/DefaultScheduler.cs

    r4285 r4368  
    2121
    2222    public bool ExistsJobForSlave(HeartBeatData hbData) {
    23       List<JobDto> allOfflineJobsForSlave = new List<JobDto>(DaoLocator.JobDao.FindFittingJobsForSlave(JobState.Offline, hbData.FreeCores, hbData.FreeMemory, hbData.SlaveId));
    24       return (allOfflineJobsForSlave != null && allOfflineJobsForSlave.Count > 0);
     23      return
     24        DaoLocator.JobDao.FindJobsWithFinishedChilds(hbData.SlaveId).Count() > 0 ||
     25        DaoLocator.JobDao.FindFittingJobs(JobState.Offline, hbData.FreeCores, hbData.FreeMemory, hbData.SlaveId).Count() > 0;
    2526    }
    2627
     
    3132        using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions { IsolationLevel = ApplicationConstants.ISOLATION_LEVEL_SCOPE })) {
    3233          SlaveDto slave = DaoLocator.SlaveDao.FindById(slaveId);
     34
    3335          if (slave != null) {
    34             LinkedList<JobDto> allOfflineJobsForSlave = new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobsForSlave(JobState.Offline, slave.NrOfFreeCores, slave.FreeMemory, slave.Id));
    35             if (allOfflineJobsForSlave != null && allOfflineJobsForSlave.Count > 0) {
    36               jobToCalculate = allOfflineJobsForSlave.First.Value;
    37               jobToCalculate.State = JobState.Calculating;
    38               jobToCalculate.Slave = slave;
    39               jobToCalculate.Slave.State = SlaveState.Calculating;
    40               jobToCalculate.DateCalculated = DateTime.Now;
    41               DaoLocator.JobDao.AssignSlaveToJob(slave.Id, jobToCalculate.Id);
    42               DaoLocator.JobDao.Update(jobToCalculate);
    43               DaoLocator.SlaveDao.Update(jobToCalculate.Slave);
     36            LinkedList<JobDto> finishedJobsForSlave = new LinkedList<JobDto>(DaoLocator.JobDao.FindJobsWithFinishedChilds(slave.Id));
     37            if (finishedJobsForSlave != null && finishedJobsForSlave.Count > 0) {
     38              jobToCalculate = finishedJobsForSlave.First.Value;
     39              UpdateJobAsCalculating(jobToCalculate, slave);
     40            }
     41
     42            LinkedList<JobDto> offlineJobsForSlave = new LinkedList<JobDto>(DaoLocator.JobDao.FindFittingJobs(JobState.Offline, slave.NrOfFreeCores, slave.FreeMemory, slave.Id));
     43            if (offlineJobsForSlave != null && offlineJobsForSlave.Count > 0) {
     44              jobToCalculate = offlineJobsForSlave.First.Value;
     45              UpdateJobAsCalculating(jobToCalculate, slave);
    4446            }
    4547          }
     
    5254    }
    5355
     56    private static void UpdateJobAsCalculating(JobDto jobToCalculate, SlaveDto slave) {
     57      jobToCalculate.State = JobState.Calculating;
     58      jobToCalculate.Slave = slave;
     59      jobToCalculate.Slave.State = SlaveState.Calculating;
     60      jobToCalculate.DateCalculated = DateTime.Now;
     61      DaoLocator.JobDao.AssignSlaveToJob(slave.Id, jobToCalculate.Id);
     62      DaoLocator.JobDao.Update(jobToCalculate);
     63      DaoLocator.SlaveDao.Update(jobToCalculate.Slave);
     64    }
     65
    5466    #endregion
    5567  }
Note: See TracChangeset for help on using the changeset viewer.