Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6004


Ignore:
Timestamp:
04/11/11 20:57:29 (14 years ago)
Author:
ascheibe
Message:

#1233

  • fix pause/stop bug when serializing big experiments
  • use proper newlines
  • use GetPlugin(..) instead of GetPlugins()
Location:
branches/HeuristicLab.Hive-3.4/sources
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Tests/SlaveCommListener.cs

    r5795 r6004  
    5050      }
    5151      catch (Exception e) {
    52         OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\nException is: " + e.ToString());
     52        OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?" + Environment.NewLine + "Exception is: " + e.ToString());
    5353        return false;
    5454      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveItem.cs

    r5826 r6004  
    6767      }
    6868      catch (Exception ex) {
    69         OnMessageLogged("Error establishing connection to Core. Are you missing a configuration file?\n" + ex.ToString());
     69        OnMessageLogged("Error establishing connection to Core. Are you missing a configuration file?" + Environment.NewLine + ex.ToString());
    7070      }
    7171    }
     
    7878      }
    7979      catch (Exception) {
    80         OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?\n");
     80        OnMessageLogged("Couldn't connect to Slave core. Is it possible that the Slave Core isn't running?" + Environment.NewLine);
    8181        return false;
    8282      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.Views/3.4/SlaveView.cs

    r5826 r6004  
    110110
    111111    void Content_SlaveShutdown(object sender, System.EventArgs e) {
    112       txtLog.AppendText("Slave did shutdown\n");
     112      txtLog.AppendText("Slave did shutdown" + Environment.NewLine);
    113113      Task.Factory.StartNew(Connector);
    114114    }
    115115
    116116    void Content_SlaveMessageLogged(object sender, EventArgs<string> e) {
    117       txtLog.AppendText(e.Value + "\n");
     117      txtLog.AppendText(e.Value + Environment.NewLine);
    118118    }
    119119    #endregion
     
    208208      }
    209209      catch (InvalidOperationException ex) {
    210         MessageBox.Show("Error starting service: Hive Slave Service not found!\n" + ex.ToString());
     210        MessageBox.Show("Error starting service: Hive Slave Service not found!" + Environment.NewLine + ex.ToString());
    211211      }
    212212      catch (Exception ex) {
    213         MessageBox.Show("Error starting service, exception is: \n" + ex.ToString());
     213        MessageBox.Show("Error starting service, exception is: " + Environment.NewLine + ex.ToString());
    214214      }
    215215    }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ConfigManager.cs

    r5790 r6004  
    103103        foreach (KeyValuePair<Guid, Executor> kvp in engines) {
    104104          Executor e = kvp.Value;
    105           prog[e.JobId] = e.ExecutionTime;
     105          //don't include jobs in hb's which are currently serializing
     106          if (e.SendHeartbeatForExecutor) {
     107            prog[e.JobId] = e.ExecutionTime;
     108          }
    106109        }
    107110      }
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs

    r5826 r6004  
    3838    private Semaphore pauseStopSem = new Semaphore(0, 1);
    3939
     40    public bool SendHeartbeatForExecutor { get; set; }
     41
    4042    public bool Aborted { get; set; }
     43
     44    public DateTime CreationTime { get; set; }
    4145
    4246    private Exception currentException;
     
    6367    }
    6468
    65     public DateTime CreationTime { get; set; }
     69    public Executor() {
     70      SendHeartbeatForExecutor = true;
     71    }
    6672
    6773    /// <param name="serializedJob"></param>
     
    9096
    9197    public void Pause() {
     98      SendHeartbeatForExecutor = false;
    9299      if (Job == null) {
    93100        SlaveClientCom.Instance.ClientCom.LogMessage("Pausing job: Job is null");
     
    108115
    109116    public void Stop() {
     117      SendHeartbeatForExecutor = false;
    110118      if (Job == null) {
    111119        SlaveClientCom.Instance.ClientCom.LogMessage("Stopping job: Job is null");
     
    181189
    182190    private void Job_JobFailed(object sender, EventArgs e) {
    183       //TODO: get exception to client
    184191      HeuristicLab.Common.EventArgs<Exception> ex = (HeuristicLab.Common.EventArgs<Exception>)e;
    185192      currentException = ex.Value;
     
    241248    }
    242249
    243     public Executor() {
    244     }
    245 
    246250    public void Dispose() {
    247251      if (Job != null)
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/PluginCache.cs

    r5787 r6004  
    142142        SlaveClientCom.Instance.ClientCom.LogMessage("Fetching plugins for job");
    143143
    144         IEnumerable<Plugin> pluginDescriptions = WcfService.Instance.GetPlugins();
    145144        List<Plugin> requiredPlugins = new List<Plugin>();
    146145        foreach (Guid pluginId in myJob.PluginsNeededIds) {
    147           Plugin pl = pluginDescriptions.FirstOrDefault(p => p.Id == pluginId);
    148           if (pl != null)
    149             requiredPlugins.Add(pl);
     146          //TODO: rewrite, GetPlugin(..) should be the last thing to do after checking the local plugins
     147          Plugin plugin = WcfService.Instance.GetPlugin(pluginId);
     148          if (plugin != null)
     149            requiredPlugins.Add(plugin);
    150150        }
    151151
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/WcfService.cs

    r5790 r6004  
    112112
    113113    #region Plugin Methods
     114
     115    public Plugin GetPlugin(Guid id) {
     116      return CallHiveService(s => s.GetPlugin(id));
     117    }
     118
    114119    public IEnumerable<Plugin> GetPlugins() {
    115120      return CallHiveService(s => s.GetPlugins());
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Views/3.4/ExperimentManager/StateLogGanttChartListView.cs

    r5779 r6004  
    9393      DateTime until = to != null ? to.DateTime : upperLimit;
    9494      TimeSpan duration = until - from.DateTime;
    95       string tooltip = string.Format("State: {0}\nDuration: {1}\n{2} - {3}", from.State, duration, from.DateTime, until);
     95      string tooltip = string.Format("State: {0} " + Environment.NewLine + " Duration: {1} " + Environment.NewLine + " {2} - {3}", from.State, duration, from.DateTime, until);
    9696      if (!string.IsNullOrEmpty(from.Exception))
    97         tooltip += "\n" + from.Exception;
     97        tooltip += Environment.NewLine + from.Exception;
    9898      ganttChart.AddData(name, from.State.ToString(), from.DateTime, until, tooltip, false);
    9999    }
    100    
     100
    101101    protected override void SetEnabledStateOfControls() {
    102102      base.SetEnabledStateOfControls();
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive/3.4/ServiceClients/Heartbeat.cs

    r5614 r6004  
    3333      String val = "SlaveId: " + SlaveId + ", FreeCores: " + FreeCores;
    3434      foreach (KeyValuePair<Guid, TimeSpan> kvp in JobProgress) {
    35         val += "\nId" + kvp.Key + " ExecutionTime " + kvp.Value;
     35        val += Environment.NewLine + "Id" + kvp.Key + " ExecutionTime " + kvp.Value;
    3636      }
    3737      return val;
  • branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Services.Hive.Common/3.4/DataTransfer/Heartbeat.cs

    r5405 r6004  
    4242      String val = "SlaveId: " + SlaveId + ", FreeCores: " + FreeCores;
    4343      foreach (KeyValuePair<Guid, TimeSpan> kvp in JobProgress) {
    44         val += "\nId" + kvp.Key + " ExecutionTime " + kvp.Value;
     44        val += Environment.NewLine + "Id" + kvp.Key + " ExecutionTime " + kvp.Value;
    4545      }
    4646      return val;
Note: See TracChangeset for help on using the changeset viewer.