Changeset 1119


Ignore:
Timestamp:
01/14/09 16:03:50 (12 years ago)
Author:
kgrading
Message:

corrected the progress calculation (#457)

Location:
trunk/sources
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Hive.Client.Core/ConfigurationManager/ConfigManager.cs

    r1034 r1119  
    106106      return st;     
    107107    }
     108
     109    public Dictionary<long, double> GetProgressOfAllJobs() {
     110      Dictionary<long,double> prog = new Dictionary<long,double>();
     111      Dictionary<long, Executor> engines = Core.GetExecutionEngines();
     112      foreach (KeyValuePair<long, Executor> kvp in engines) {
     113        Executor e = kvp.Value;
     114        prog[e.JobId] = e.Progress;
     115      }
     116      return prog;
     117    }
     118
    108119  }
    109120}
  • trunk/sources/HeuristicLab.Hive.Client.Core/Core.cs

    r1103 r1119  
    162162        AppDomain appDomain = PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.Job.Id.ToString(), sandboxed, typeof(TestJob));
    163163        appDomain.UnhandledException += new UnhandledExceptionEventHandler(appDomain_UnhandledException);
    164         lock (Locker) {
     164        lock (Locker) {                   
    165165          if (!jobs.ContainsKey(e.Result.Job.Id)) {
    166166            jobs.Add(e.Result.Job.Id, e.Result.Job);
  • trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs

    r1097 r1119  
    7474      ClientInfo info = ConfigManager.Instance.GetClientInfo();
    7575      // Todo: remove tempfix for free cores.
    76       // TODO: change jobProgress from int to Dictionary of Job and Double
    77       HeartBeatData heartBeatData = new HeartBeatData { ClientId = info.ClientId,
    78                                                               freeCores = info.NrOfCores - (ClientStatusInfo.JobsFetched - ClientStatusInfo.JobsProcessed),
    79                                                               freeMemory = 1000,
    80                                                               jobProgress = ClientStatusInfo.JobsFetched - ClientStatusInfo.JobsProcessed};
     76
     77      HeartBeatData heartBeatData = new HeartBeatData {
     78        ClientId = info.ClientId,
     79        freeCores = info.NrOfCores - (ClientStatusInfo.JobsFetched - ClientStatusInfo.JobsProcessed),
     80        freeMemory = 1000,
     81        jobProgress = ConfigManager.Instance.GetProgressOfAllJobs()
     82      };
    8183      if (wcfService.ConnState == NetworkEnum.WcfConnState.Failed) {
    8284        wcfService.Connect();
  • trunk/sources/HeuristicLab.Hive.Client.ExecutionEngine/Executor.cs

    r1097 r1119  
    5353    public void Start(byte[] serializedJob) {
    5454      CreationTime = DateTime.Now;
    55       Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);
     55      //Job = (IJob)PersistenceManager.RestoreFromGZip(serializedJob);
     56      //debug
     57      Job = new TestJob();
    5658      Job.JobStopped += new EventHandler(Job_JobStopped);
    5759      Job.Start();
  • trunk/sources/HeuristicLab.Hive.Contracts/BusinessObjects/HeartBeatData.cs

    r780 r1119  
    1616    public int freeCores { get; set; }
    1717    [DataMember]
    18     public int jobProgress { get; set; } // TODO: define Type
     18    public Dictionary<long, double> jobProgress { get; set; } // TODO: define Type
    1919  }
    2020}
  • trunk/sources/HeuristicLab.Hive.JobBase/TestJob.cs

    r1023 r1119  
    6767    }
    6868
     69    public TestJob() {
     70    }
     71
    6972
    7073  }
Note: See TracChangeset for help on using the changeset viewer.