Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/29/10 15:50:03 (14 years ago)
Author:
cneumuel
Message:

#1260

  • refined job-downloads for limited resources
  • fixed minor bugs
Location:
branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive
Files:
1 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/HiveJob.cs

    r4810 r5181  
    327327          }
    328328        } else {
    329           childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped;
     329          childIsFinishedOptimizerDownloaded = optimizerJob.Optimizer.ExecutionState == ExecutionState.Stopped || optimizerJob.Optimizer.ExecutionState == ExecutionState.Prepared;
    330330        }
    331331      }
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/HiveJobDownloader.cs

    r5179 r5181  
    1414    private IEnumerable<Guid> jobIds;
    1515    private List<Task<HiveJob>> tasks;
     16    private bool abort = false;
    1617
    1718    public bool IsFinished {
     
    2526    public int FinishedCount {
    2627      get {
     28        var faulted = tasks.Where(t => t.Status == TaskStatus.Faulted);
     29        if (faulted.Count() > 0) {
     30          abort = true;
     31          throw faulted.First().Exception;
     32        }
    2733        return tasks.Count(t => t.Status == TaskStatus.RanToCompletion ||
    2834                                t.Status == TaskStatus.Faulted ||
     
    3440      get {
    3541        var results = new Dictionary<Guid, HiveJob>();
    36         foreach(var t in tasks) {
    37           results.Add(t.Result.JobDto.Id, t.Result);
     42        foreach (var t in tasks) {
     43          if (t.Status == TaskStatus.Faulted) {
     44            throw t.Exception;
     45          }
     46          if(t.Result != null)
     47            results.Add(t.Result.JobDto.Id, t.Result);
    3848        }
    3949        return results;
     
    4555    }
    4656
    47    
    4857    public void StartAsync() {
     58      abort = false;
    4959      tasks = new List<Task<HiveJob>>();
    5060      foreach (Guid jobId in jobIds) {
     
    5464      }
    5565    }
    56     // use semaphore to ensure only few tasks download concurrently (so not too many connections are open)
    57     private Semaphore taskSemaphore = new Semaphore(2, 2);
     66    // use semaphore to ensure only few concurrenct connections and few SerializedJob objects in memory
     67    private Semaphore downloadSemaphore = new Semaphore(2, 2);
     68    private Semaphore deserializeSemaphore = new Semaphore(2, 2);
    5869    protected SerializedJob DownloadJob(object jobId) {
    59       taskSemaphore.WaitOne(Timeout.Infinite);
    60       using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
    61         return service.Obj.GetLastSerializedResult((Guid)jobId).Obj;
     70      downloadSemaphore.WaitOne();
     71      deserializeSemaphore.WaitOne();
     72      SerializedJob result;
     73      try {
     74        if (abort) return null;
     75        using (Disposable<IClientFacade> service = ServiceLocator.Instance.StreamedClientFacadePool.GetService()) {
     76          result = service.Obj.GetLastSerializedResult((Guid)jobId).Obj;
     77        }
    6278      }
     79      finally {
     80        downloadSemaphore.Release();
     81      }
     82      return result;
    6383    }
    6484
    6585    protected HiveJob DeserializeJob(SerializedJob serializedJob) {
    66       HiveJob job = new HiveJob(serializedJob, false);
    67       job.Job.Prepare(); // reduce memory consumption.
    68       taskSemaphore.Release();
    69       job.JobDto = serializedJob.JobInfo;
    70       return job;
     86      try {
     87        if (abort || serializedJob == null) return null;
     88        HiveJob job = new HiveJob(serializedJob, false);
     89        serializedJob.SerializedJobData = null; // reduce memory consumption.
     90        job.Job.Prepare(); // reduce memory consumption.
     91        job.JobDto = serializedJob.JobInfo;
     92        return job;
     93      }
     94      finally {
     95        deserializeSemaphore.Release();
     96      }
    7197    }
    7298  }
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.ExperimentManager/3.3/app.config

    r5179 r5181  
    2929    </bindings>
    3030    <client>
    31       <endpoint address="net.tcp://christoph:9001/Hive-3.3/ClientService.svc" binding="netTcpBinding" bindingConfiguration="ClientTcpStreamedEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientTcpStreamedEndpoint">
     31      <endpoint address="net.tcp://services.heuristiclab.com:8000/Hive-3.3/ClientService.svc" binding="netTcpBinding" bindingConfiguration="ClientTcpStreamedEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientTcpStreamedEndpoint">
    3232        <identity>
    33           <dns value="localhost"/>
     33          <dns value="services.heuristiclab.com"/>
    3434        </identity>
    3535      </endpoint>
    36       <endpoint address="http://christoph/Hive-3.3/ClientService.svc" binding="wsHttpBinding" bindingConfiguration="ClientHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientHttpEndpoint">
     36      <endpoint address="http://services.heuristiclab.com/Hive-3.3/ClientService.svc" binding="wsHttpBinding" bindingConfiguration="ClientHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IClientFacade" name="ClientHttpEndpoint">
    3737        <identity>
    38           <certificate encodedValue="AwAAAAEAAAAUAAAAozaKcSPdw1Cdd57hw9mr3eCjxTIgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxMjA2NTYyNloXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFM6bQUgvCnsnBO9TZnOrC6x1riE2pXUzU6H38GYot674WNfir82fMh9+ojWSY/CiMzExcNWFtC3i8BG7giLYVwSanuwQ8QyRFYq3g5UMqdlm4/aof/4QMmS+SuRDsa8F4lbvdS9zBVFiyyUNYzlzO/rY08DrkCgx4X2IQGOvixwIDAQABo0kwRzBFBgNVHQEEPjA8gBCjMn9uvzNhU2c//E3RSYmUoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQADgYEADIf8as2VBfZEpwb/GuVifvPTR0Ud+dTCwTjBdMymqjNR5NTSi408DifssSTBVGIi7xkWbQDlQQHOZmVqVFoqfNbGrtm9w1MSK24HAEMXr0WFBltvldGKCvtYnZqf377qU5gq7IBXcJZi87bZ2l1M3icr6RJo4fIbnZOa5M430aw="/>
     38          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3939        </identity>
    4040      </endpoint>
    4141    </client>
    42 
     42   
    4343  </system.serviceModel>
    4444<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Server.Console/3.3/app.config

    r5179 r5181  
    2626    </bindings>
    2727    <client>
    28       <endpoint address="http://christoph/Hive-3.3/ServerConsoleService.svc" behaviorConfiguration="ServerConsoleBehaviour" binding="wsHttpBinding" bindingConfiguration="ServerConsoleHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IServerConsoleFacade" name="ServerConsoleHttpEndpoint">
     28      <endpoint address="http://services.heuristiclab.com/Hive-3.3/ServerConsoleService.svc" behaviorConfiguration="ServerConsoleBehaviour" binding="wsHttpBinding" bindingConfiguration="ServerConsoleHttpEndpoint" contract="HeuristicLab.Hive.Contracts.Interfaces.IServerConsoleFacade" name="ServerConsoleHttpEndpoint">
    2929        <identity>
    30           <certificate encodedValue="AwAAAAEAAAAUAAAAozaKcSPdw1Cdd57hw9mr3eCjxTIgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxMjA2NTYyNloXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFM6bQUgvCnsnBO9TZnOrC6x1riE2pXUzU6H38GYot674WNfir82fMh9+ojWSY/CiMzExcNWFtC3i8BG7giLYVwSanuwQ8QyRFYq3g5UMqdlm4/aof/4QMmS+SuRDsa8F4lbvdS9zBVFiyyUNYzlzO/rY08DrkCgx4X2IQGOvixwIDAQABo0kwRzBFBgNVHQEEPjA8gBCjMn9uvzNhU2c//E3RSYmUoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQADgYEADIf8as2VBfZEpwb/GuVifvPTR0Ud+dTCwTjBdMymqjNR5NTSi408DifssSTBVGIi7xkWbQDlQQHOZmVqVFoqfNbGrtm9w1MSK24HAEMXr0WFBltvldGKCvtYnZqf377qU5gq7IBXcJZi87bZ2l1M3icr6RJo4fIbnZOa5M430aw="/>
     30          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3131        </identity>
    3232      </endpoint>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Communication/3.3/app.config

    r5179 r5181  
    2727    </bindings>
    2828    <client>
    29       <endpoint address="http://christoph/Hive-3.3/SlaveService.svc" binding="wsHttpBinding" bindingConfiguration="SlaveHttpEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveHttpEndpoint">
     29      <endpoint address="http://services.heuristiclab.com/Hive-3.3/SlaveService.svc" binding="wsHttpBinding" bindingConfiguration="SlaveHttpEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveHttpEndpoint">
    3030        <identity>
    31           <certificate encodedValue="AwAAAAEAAAAUAAAAozaKcSPdw1Cdd57hw9mr3eCjxTIgAAAAAQAAAPIBAAAwggHuMIIBW6ADAgECAhBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQAwFDESMBAGA1UEAxMJbG9jYWxob3N0MB4XDTEwMTAxMjA2NTYyNloXDTM5MTIzMTIzNTk1OVowFDESMBAGA1UEAxMJbG9jYWxob3N0MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDFM6bQUgvCnsnBO9TZnOrC6x1riE2pXUzU6H38GYot674WNfir82fMh9+ojWSY/CiMzExcNWFtC3i8BG7giLYVwSanuwQ8QyRFYq3g5UMqdlm4/aof/4QMmS+SuRDsa8F4lbvdS9zBVFiyyUNYzlzO/rY08DrkCgx4X2IQGOvixwIDAQABo0kwRzBFBgNVHQEEPjA8gBCjMn9uvzNhU2c//E3RSYmUoRYwFDESMBAGA1UEAxMJbG9jYWxob3N0ghBhrVLVbjrtvUe4zWuGbVeuMAkGBSsOAwIdBQADgYEADIf8as2VBfZEpwb/GuVifvPTR0Ud+dTCwTjBdMymqjNR5NTSi408DifssSTBVGIi7xkWbQDlQQHOZmVqVFoqfNbGrtm9w1MSK24HAEMXr0WFBltvldGKCvtYnZqf377qU5gq7IBXcJZi87bZ2l1M3icr6RJo4fIbnZOa5M430aw="/>
     31          <certificate encodedValue="AwAAAAEAAAAUAAAAwK1+2oAmcy/mI2P2QjyiJRh0y60gAAAAAQAAACoCAAAwggImMIIBj6ADAgECAhAIkseQ2EEhgU720qJA61gqMA0GCSqGSIb3DQEBBAUAMCQxIjAgBgNVBAMTGXNlcnZpY2VzLmhldXJpc3RpY2xhYi5jb20wHhcNMTAwNTExMTExNDAyWhcNMzkxMjMxMjM1OTU5WjAkMSIwIAYDVQQDExlzZXJ2aWNlcy5oZXVyaXN0aWNsYWIuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq26Bwmwc7k+4W30qLQ2j+FInEL5BuH6opDY6CSlrtt3xQS/anrhvpbf3QghLDVINzcHkzbPmm/SguG4F85QLB6xO+tJaOvRo0iEK5g3c307vMIru7FJwk/OhplEQ5J1hbDgL3zOJlrWlgtqRVxCtVdF3XroI9BctOt1NkeKv9ewIDAQABo1kwVzBVBgNVHQEETjBMgBCjbgdYd4j5JgUuJ1Wo/GxroSYwJDEiMCAGA1UEAxMZc2VydmljZXMuaGV1cmlzdGljbGFiLmNvbYIQCJLHkNhBIYFO9tKiQOtYKjANBgkqhkiG9w0BAQQFAAOBgQAb/2xk2uQad68shSPl/uixWgvFI8WkxOTBopOLaLtDxwCeZ3mWVHdV9VnixHtThubnEBXAhYOCQSIXWtQuXFWO+gH3YyjTRJY5kTmXyuvBRTn3/so5SrQ7Rdlm9hf6E5YVX3tCjAy7ybUyaDUkQfmH5vmvgvpMzRfsJ1qhnUpJiQ=="/>
    3232        </identity>
    3333      </endpoint>
    34       <endpoint address="net.tcp://christoph:9001/Hive-3.3/SlaveService.svc" binding="netTcpBinding" bindingConfiguration="SlaveTcpStreamedEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveTcpStreamedEndpoint">
     34      <endpoint address="net.tcp://services.heuristiclab.com:8000/Hive-3.3/SlaveService.svc" binding="netTcpBinding" bindingConfiguration="SlaveTcpStreamedEndpoint" contract="SlaveFacade.ISlaveFacade" name="SlaveTcpStreamedEndpoint">
    3535        <identity>
    36           <dns value="localhost"/>
     36          <dns value="services.heuristiclab.com"/>
    3737        </identity>
    3838      </endpoint>
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/ConfigurationManager/ConfigManager.cs

    r5000 r5181  
    104104    }
    105105
    106     public Dictionary<Guid, TimeSpan> GetExecutionTimeOfAllJobs() {
     106    public Dictionary<Guid, TimeSpan> GetExecutionTimeOfRunningJobs() {
    107107      Dictionary<Guid, TimeSpan> prog = new Dictionary<Guid, TimeSpan>();
    108108      Dictionary<Guid, Executor> engines = Core.ExecutionEngines;
    109109      lock (engines) {
    110110        foreach (KeyValuePair<Guid, Executor> kvp in engines) {
    111           Executor e = kvp.Value;
    112           prog[e.JobId] = e.ExecutionTime;
     111          if (kvp.Value.ExecutionState == HeuristicLab.Core.ExecutionState.Started) { // only report from started jobs. this ensures that hung jobs will get an abort after some timeout. also if a job is already prepared (after it stopped), the executionTime would be 00:00:00
     112            Executor e = kvp.Value;
     113            prog[e.JobId] = e.ExecutionTime;
     114          }
    113115        }
    114116      }
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/HeuristicLab.Hive.Slave.Core/3.3/HeartbeatManager.cs

    r4772 r5181  
    9898                FreeCores = info.NrOfCores.HasValue ? info.NrOfCores.Value - ConfigManager.Instance.GetUsedCores() : 0,
    9999                FreeMemory = GetFreeMemory(),
    100                 JobProgress = ConfigManager.Instance.GetExecutionTimeOfAllJobs(),
     100                JobProgress = ConfigManager.Instance.GetExecutionTimeOfRunningJobs(),
    101101                IsAllowedToCalculate = UptimeManager.Instance.IsAllowedToCalculate() && UptimeManager.Instance.CalendarAvailable
    102102              };
  • branches/HeuristicLab.Hive-3.3/sources/HeuristicLab.Hive/PreBuildEvent.cmd

    r5179 r5181  
    44REM SET configfile=f005pc.hagenberg.fhooe.at - app.config
    55REM SET configfile=localhost - app.config
    6 REM SET configfile=services.heuristiclab.com - app.config
    7 SET configfile=christoph - app.config
     6SET configfile=services.heuristiclab.com - app.config
     7REM SET configfile=christoph - app.config
    88
    99IF EXIST "%configfile%" (
Note: See TracChangeset for help on using the changeset viewer.