Changeset 960


Ignore:
Timestamp:
12/11/08 15:14:02 (12 years ago)
Author:
kgrading
Message:

fixed fetchjobcompleted and sendheartbeat method (#430)

Location:
trunk/sources/HeuristicLab.Hive.Client.Core
Files:
2 edited

Legend:

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

    r949 r960  
    144144
    145145    void wcfService_PullJobCompleted(object sender, PullJobCompletedEventArgs e) {
    146       bool sandboxed = false;
     146      if (e.Result.StatusMessage != ApplicationConstants.RESPONSE_COMMUNICATOR_NO_JOBS_LEFT) {
     147        bool sandboxed = false;
    147148
    148       PluginManager.Manager.Initialize();
    149       AppDomain appDomain =  PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.JobId.ToString(), sandboxed, typeof(TestJob));
    150      
    151       appDomains.Add(e.Result.JobId, appDomain);
     149        PluginManager.Manager.Initialize();
     150        AppDomain appDomain =  PluginManager.Manager.CreateAndInitAppDomainWithSandbox(e.Result.JobId.ToString(), sandboxed, typeof(TestJob));     
     151        appDomains.Add(e.Result.JobId, appDomain);
    152152
    153       Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
    154       engine.JobId = e.Result.JobId;
    155       engine.Queue = MessageQueue.GetInstance();
    156       engine.Start(e.Result.SerializedJob);
    157       engines.Add(e.Result.JobId, engine);
     153        Executor engine = (Executor)appDomain.CreateInstanceAndUnwrap(typeof(Executor).Assembly.GetName().Name, typeof(Executor).FullName);
     154        engine.JobId = e.Result.JobId;
     155        engine.Queue = MessageQueue.GetInstance();
     156        engine.Start(e.Result.SerializedJob);
     157        engines.Add(e.Result.JobId, engine);
    158158
    159       ClientStatusInfo.JobsFetched++;
     159        ClientStatusInfo.JobsFetched++;
    160160
    161       Debug.WriteLine("Increment FetchedJobs to:"+ClientStatusInfo.JobsFetched);
     161        Debug.WriteLine("Increment FetchedJobs to:" + ClientStatusInfo.JobsFetched);
     162      }
    162163    }
    163164
  • trunk/sources/HeuristicLab.Hive.Client.Core/Heartbeat.cs

    r946 r960  
    7272      Console.WriteLine("tick");
    7373      ClientInfo info = ConfigManager.Instance.GetClientInfo();
     74      // Todo: remove tempfix for free cores.
    7475      HeartBeatData heartBeatData = new HeartBeatData { ClientId = info.ClientId,
    75                                                               freeCores = info.NrOfCores,
     76                                                              freeCores = info.NrOfCores - (ClientStatusInfo.JobsFetched - ClientStatusInfo.JobsProcessed),
    7677                                                              freeMemory = 1000,
    7778                                                              jobProgress = ClientStatusInfo.JobsFetched - ClientStatusInfo.JobsProcessed};
Note: See TracChangeset for help on using the changeset viewer.