Changeset 6464 for branches/HeuristicLab.Hive-3.4/sources
- Timestamp:
- 06/21/11 17:29:56 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 1 deleted
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/ResourcesView.cs
r6454 r6464 38 38 } 39 39 40 private const string ungroupedGroupName = "UNGROUPED"; 41 private const int slaveImageIndex = 0; 42 private const int slaveGroupImageIndex = 1; 43 44 40 45 public ResourcesView() { 41 46 InitializeComponent(); … … 68 73 69 74 //rebuild 70 TreeNode ungrp = new TreeNode( "UNGROUPED");71 ungrp.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;75 TreeNode ungrp = new TreeNode(ungroupedGroupName); 76 ungrp.ImageIndex = slaveGroupImageIndex; 72 77 ungrp.SelectedImageIndex = ungrp.ImageIndex; 73 78 var newGroup = new SlaveGroup(); 74 newGroup.Name = "UNGROUPED";79 newGroup.Name = ungroupedGroupName; 75 80 newGroup.Id = Guid.NewGuid(); 76 81 newGroup.Description = "Contains slaves which are in no group"; … … 82 87 if (g.ParentResourceId == null) { 83 88 TreeNode tn = new TreeNode(); 84 tn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;89 tn.ImageIndex = slaveGroupImageIndex; 85 90 tn.SelectedImageIndex = tn.ImageIndex; 86 91 … … 89 94 90 95 BuildSlaveGroupTree(g, tn); 96 tn.ExpandAll(); 91 97 treeSlaveGroup.Nodes.Add(tn); 92 98 } … … 94 100 if (g.ParentResourceId == null) { 95 101 var stn = new TreeNode(g.Name); 96 stn.ImageIndex = 0;102 stn.ImageIndex = slaveImageIndex; 97 103 stn.SelectedImageIndex = stn.ImageIndex; 98 104 stn.Tag = g; … … 101 107 } 102 108 } 109 ungrp.ExpandAll(); 103 110 treeSlaveGroup.Nodes.Add(ungrp); 104 111 } … … 111 118 stn.ImageIndex = 0; 112 119 } else if (r is SlaveGroup) { 113 stn.ImageIndex = treeSlaveGroup.ImageList.Images.Count - 1;120 stn.ImageIndex = slaveGroupImageIndex; 114 121 } 115 122 stn.SelectedImageIndex = stn.ImageIndex; … … 204 211 205 212 if (destNode.TreeView == newNode.TreeView) { 213 if (destNode.Text == ungroupedGroupName || (destNode.Parent != null && destNode.Parent.Text == ungroupedGroupName)) { 214 MessageBox.Show(String.Format("You can't drag items to the {0} group.{1}This group only contains slaves which haven't yet been assigned to a real group.", 215 ungroupedGroupName, Environment.NewLine), "HeuristicLab Hive Administration", MessageBoxButtons.OK, MessageBoxIcon.Information); 216 return; 217 } 218 206 219 SlaveGroup sgrp = null; 207 220 if (destNode.Tag != null && destNode.Tag is SlaveGroup) { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/SlaveView.Designer.cs
r6373 r6464 69 69 this.txtSlaveState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 70 70 | System.Windows.Forms.AnchorStyles.Right))); 71 this.txtSlaveState.Enabled = false; 71 72 this.txtSlaveState.Location = new System.Drawing.Point(120, 186); 72 73 this.txtSlaveState.Name = "txtSlaveState"; … … 78 79 this.txtOS.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 79 80 | System.Windows.Forms.AnchorStyles.Right))); 81 this.txtOS.Enabled = false; 80 82 this.txtOS.Location = new System.Drawing.Point(120, 160); 81 83 this.txtOS.Name = "txtOS"; … … 105 107 this.txtDetailsDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 106 108 | System.Windows.Forms.AnchorStyles.Right))); 109 this.txtDetailsDescription.Enabled = false; 107 110 this.txtDetailsDescription.Location = new System.Drawing.Point(120, 56); 108 111 this.txtDetailsDescription.Name = "txtDetailsDescription"; … … 127 130 this.txtName.Size = new System.Drawing.Size(249, 20); 128 131 this.txtName.TabIndex = 21; 129 this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged _1);132 this.txtName.TextChanged += new System.EventHandler(this.txtName_TextChanged); 130 133 // 131 134 // txtCPU … … 133 136 this.txtCPU.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 134 137 | System.Windows.Forms.AnchorStyles.Right))); 138 this.txtCPU.Enabled = false; 135 139 this.txtCPU.Location = new System.Drawing.Point(120, 82); 136 140 this.txtCPU.Name = "txtCPU"; … … 142 146 this.txtMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 143 147 | System.Windows.Forms.AnchorStyles.Right))); 148 this.txtMemory.Enabled = false; 144 149 this.txtMemory.Location = new System.Drawing.Point(120, 108); 145 150 this.txtMemory.Name = "txtMemory"; … … 151 156 this.txtLastHeartbeat.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 152 157 | System.Windows.Forms.AnchorStyles.Right))); 158 this.txtLastHeartbeat.Enabled = false; 153 159 this.txtLastHeartbeat.Location = new System.Drawing.Point(120, 212); 154 160 this.txtLastHeartbeat.Name = "txtLastHeartbeat"; … … 205 211 this.txtFreeMemory.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 206 212 | System.Windows.Forms.AnchorStyles.Right))); 213 this.txtFreeMemory.Enabled = false; 207 214 this.txtFreeMemory.Location = new System.Drawing.Point(120, 134); 208 215 this.txtFreeMemory.Name = "txtFreeMemory"; … … 214 221 this.txtId.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 215 222 | System.Windows.Forms.AnchorStyles.Right))); 223 this.txtId.Enabled = false; 216 224 this.txtId.Location = new System.Drawing.Point(120, 30); 217 225 this.txtId.Name = "txtId"; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Administration/3.4/Views/SlaveView.cs
r6373 r6464 66 66 Slave ct = (Slave)Content; 67 67 txtName.Text = ct.Name; 68 txtCPU.Text = ct.Cores.ToString() + " Cores @ " + ct.CpuSpeed.ToString() + " Mhz, Arch.: " + ct.CpuArchitecture.ToString();68 txtCPU.Text = string.Format("{0} Cores @ {1} Mhz, Arch.: {2}", ct.Cores.ToString(), ct.CpuSpeed.ToString(), ct.CpuArchitecture.ToString()); 69 69 txtDetailsDescription.Text = ct.Description; 70 70 txtMemory.Text = ct.Memory.ToString(); … … 78 78 txtName.Text = ct.Name; 79 79 ShowSlaveUI(false); 80 } else 80 } else { 81 81 throw new Exception("Unknown Resource in SlaveView"); 82 82 } 83 83 } 84 }85 86 void txtName_TextChanged(object sender, EventArgs e) {87 throw new NotImplementedException();88 84 } 89 85 … … 105 101 txtFreeMemory.Visible = show; 106 102 txtId.Visible = show; 103 txtName.Enabled = !show; 107 104 } 108 105 … … 111 108 } 112 109 113 private void txtName_TextChanged _1(object sender, EventArgs e) {110 private void txtName_TextChanged(object sender, EventArgs e) { 114 111 if (Content != null && Content is SlaveGroup) { 115 112 Content.Name = txtName.Text; -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Core.cs
r6456 r6464 299 299 throw; 300 300 } 301 catch (AppDomainNotCreatedException) { 302 throw; 303 } 301 304 } 302 305 … … 394 397 heartbeatManager.AwakeHeartBeatThread(); 395 398 clientCom.LogMessage(string.Format("Exception occured for job {0}: {1}", e.Value.JobId, e.Value2.ToString())); 399 wcfService.UpdateJobState(e.Value.JobId, JobState.Waiting, e.Value2.ToString()); 396 400 } 397 401 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Executor.cs
r6456 r6464 33 33 public class Executor : MarshalByRefObject, IDisposable { 34 34 private bool wasJobAborted = false; 35 private Semaphore pauseStopSem = new Semaphore(0, 1);36 private Semaphore startJobSem = new Semaphore(0, 1);37 private Semaphore jobStartedSem = new Semaphore(0, 1); // make pause or stop wait until start is finished35 private AutoResetEvent pauseStopSem = new AutoResetEvent(false); 36 private AutoResetEvent startJobSem = new AutoResetEvent(false); // block start method call 37 private AutoResetEvent jobStartedSem = new AutoResetEvent(false); // make pause or stop wait until start is finished 38 38 private ExecutorQueue executorQueue; 39 39 private bool jobDataInvalid = false; // if true, the jobdata is not sent when the job is failed … … 47 47 public bool IsPausing { get; set; } 48 48 49 p rivate Exception currentException;50 public String CurrentException {49 public Exception CurrentException; 50 public String CurrentExceptionStr { 51 51 get { 52 if ( currentException != null) {53 return currentException.ToString();52 if (CurrentException != null) { 53 return CurrentException.ToString(); 54 54 } else { 55 55 return string.Empty; … … 84 84 85 85 job.Start(); 86 if (! jobStartedSem.WaitOne(TimeSpan.FromSeconds(Settings.Default.ExecutorSemTimeouts))) {86 if (!startJobSem.WaitOne(Settings.Default.ExecutorSemTimeouts)) { 87 87 jobDataInvalid = true; 88 88 throw new TimeoutException("Timeout when starting the job. JobStarted event was not fired."); 89 89 } 90 jobStartedSem.Release();91 90 } 92 91 catch (Exception e) { 93 this. currentException = e;92 this.CurrentException = e; 94 93 Job_JobFailed(this, new EventArgs<Exception>(e)); 94 } 95 finally { 96 jobStartedSem.Set(); 95 97 } 96 98 } … … 101 103 jobStartedSem.WaitOne(Settings.Default.ExecutorSemTimeouts); 102 104 if (job == null) { 103 currentException = new Exception("Pausing job " + this.JobId + ": Job is null"); 105 CurrentException = new Exception("Pausing job " + this.JobId + ": Job is null"); 106 executorQueue.AddMessage(ExecutorMessageType.ExceptionOccured); 104 107 return; 105 108 } … … 112 115 } 113 116 catch (Exception ex) { 114 currentException = new Exception("Error pausing job " + this.JobId + ": " + ex.ToString()); 117 CurrentException = new Exception("Error pausing job " + this.JobId + ": " + ex.ToString()); 118 executorQueue.AddMessage(ExecutorMessageType.ExceptionOccured); 115 119 } 116 120 } … … 122 126 jobStartedSem.WaitOne(Settings.Default.ExecutorSemTimeouts); 123 127 if (job == null) { 124 currentException = new Exception("Stopping job " + this.JobId + ": Job is null"); 128 CurrentException = new Exception("Stopping job " + this.JobId + ": Job is null"); 129 executorQueue.AddMessage(ExecutorMessageType.ExceptionOccured); 125 130 } 126 131 wasJobAborted = true; … … 132 137 } 133 138 catch (Exception ex) { 134 currentException = new Exception("Error stopping job " + this.JobId + ": " + ex.ToString()); 139 CurrentException = new Exception("Error stopping job " + this.JobId + ": " + ex.ToString()); 140 executorQueue.AddMessage(ExecutorMessageType.ExceptionOccured); 135 141 } 136 142 } … … 155 161 IsStopping = true; 156 162 EventArgs<Exception> ex = (EventArgs<Exception>)e; 157 currentException = ex.Value; 158 163 CurrentException = ex.Value; 159 164 executorQueue.AddMessage(ExecutorMessageType.JobFailed); 160 165 } … … 162 167 private void Job_JobStopped(object sender, EventArgs e) { 163 168 IsStopping = true; 164 if (wasJobAborted) 165 pauseStopSem. Release();166 169 if (wasJobAborted) { 170 pauseStopSem.Set(); 171 } 167 172 executorQueue.AddMessage(ExecutorMessageType.JobStopped); 168 173 } … … 170 175 private void Job_JobPaused(object sender, EventArgs e) { 171 176 IsPausing = true; 172 pauseStopSem. Release();177 pauseStopSem.Set(); 173 178 executorQueue.AddMessage(ExecutorMessageType.JobPaused); 174 179 } 175 180 176 181 private void Job_JobStarted(object sender, EventArgs e) { 177 jobStartedSem.Release();182 startJobSem.Set(); 178 183 executorQueue.AddMessage(ExecutorMessageType.JobStarted); 179 184 } … … 190 195 //send empty job and save exception 191 196 jobData.Data = PersistenceUtil.Serialize(new JobData()); 192 if ( currentException == null) {193 currentException = new Exception("Job with id " + this.JobId + " is null, sending empty job");197 if (CurrentException == null) { 198 CurrentException = new Exception("Job with id " + this.JobId + " is null, sending empty job"); 194 199 } 195 200 } else { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/ExecutorMessage.cs
r6371 r6464 30 30 JobStopped, 31 31 JobFailed, 32 StopExecutorMonitoringThread 32 StopExecutorMonitoringThread, 33 ExceptionOccured 33 34 } 34 35 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Manager/HeartbeatManager.cs
r6456 r6464 40 40 41 41 public HeartbeatManager() { 42 Interval = new TimeSpan(0, 0, Settings.Default.HeartbeatInterval);42 Interval = Settings.Default.HeartbeatInterval; 43 43 } 44 44 -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Properties/Settings.Designer.cs
r6456 r6464 26 26 [global::System.Configuration.UserScopedSettingAttribute()] 27 27 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 [global::System.Configuration.DefaultSettingValueAttribute(" 10")]29 public intHeartbeatInterval {30 get { 31 return (( int)(this["HeartbeatInterval"]));28 [global::System.Configuration.DefaultSettingValueAttribute("00:00:10")] 29 public global::System.TimeSpan HeartbeatInterval { 30 get { 31 return ((global::System.TimeSpan)(this["HeartbeatInterval"])); 32 32 } 33 33 set { … … 182 182 [global::System.Configuration.UserScopedSettingAttribute()] 183 183 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 184 [global::System.Configuration.DefaultSettingValueAttribute(" 50")]185 public intDirOpSleepTime {186 get { 187 return (( int)(this["DirOpSleepTime"]));184 [global::System.Configuration.DefaultSettingValueAttribute("00:00:01")] 185 public global::System.TimeSpan DirOpSleepTime { 186 get { 187 return ((global::System.TimeSpan)(this["DirOpSleepTime"])); 188 188 } 189 189 set { … … 206 206 [global::System.Configuration.UserScopedSettingAttribute()] 207 207 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 208 [global::System.Configuration.DefaultSettingValueAttribute(" 1000")]209 public intPluginDeletionTimeout {210 get { 211 return (( int)(this["PluginDeletionTimeout"]));208 [global::System.Configuration.DefaultSettingValueAttribute("00:00:01")] 209 public global::System.TimeSpan PluginDeletionTimeout { 210 get { 211 return ((global::System.TimeSpan)(this["PluginDeletionTimeout"])); 212 212 } 213 213 set { … … 218 218 [global::System.Configuration.UserScopedSettingAttribute()] 219 219 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 220 [global::System.Configuration.DefaultSettingValueAttribute(" 45")]221 public intExecutorSemTimeouts {222 get { 223 return (( int)(this["ExecutorSemTimeouts"]));220 [global::System.Configuration.DefaultSettingValueAttribute("00:00:46")] 221 public global::System.TimeSpan ExecutorSemTimeouts { 222 get { 223 return ((global::System.TimeSpan)(this["ExecutorSemTimeouts"])); 224 224 } 225 225 set { -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/Properties/Settings.settings
r6456 r6464 3 3 <Profiles /> 4 4 <Settings> 5 <Setting Name="HeartbeatInterval" Type="System. Int32" Scope="User">6 <Value Profile="(Default)"> 10</Value>5 <Setting Name="HeartbeatInterval" Type="System.TimeSpan" Scope="User"> 6 <Value Profile="(Default)">00:00:10</Value> 7 7 </Setting> 8 8 <Setting Name="LastUsedFileName" Type="System.String" Scope="User"> … … 42 42 <Value Profile="(Default)">3</Value> 43 43 </Setting> 44 <Setting Name="DirOpSleepTime" Type="System. Int32" Scope="User">45 <Value Profile="(Default)"> 50</Value>44 <Setting Name="DirOpSleepTime" Type="System.TimeSpan" Scope="User"> 45 <Value Profile="(Default)">00:00:01</Value> 46 46 </Setting> 47 47 <Setting Name="PluginDeletionRetries" Type="System.Int32" Scope="User"> 48 48 <Value Profile="(Default)">5</Value> 49 49 </Setting> 50 <Setting Name="PluginDeletionTimeout" Type="System. Int32" Scope="User">51 <Value Profile="(Default)"> 1000</Value>50 <Setting Name="PluginDeletionTimeout" Type="System.TimeSpan" Scope="User"> 51 <Value Profile="(Default)">00:00:01</Value> 52 52 </Setting> 53 <Setting Name="ExecutorSemTimeouts" Type="System. Int32" Scope="User">54 <Value Profile="(Default)"> 45</Value>53 <Setting Name="ExecutorSemTimeouts" Type="System.TimeSpan" Scope="User"> 54 <Value Profile="(Default)">00:00:46</Value> 55 55 </Setting> 56 56 <Setting Name="QueuesMaxThreads" Type="System.Int32" Scope="User"> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/SlaveJob.cs
r6456 r6464 202 202 case ExecutorMessageType.JobFailed: 203 203 executorMonitoringRun = false; 204 OnJobFailed(new JobFailedException(executor.CurrentException ));204 OnJobFailed(new JobFailedException(executor.CurrentExceptionStr)); 205 205 DisposeAppDomain(); 206 206 break; … … 208 208 case ExecutorMessageType.StopExecutorMonitoringThread: 209 209 executorMonitoringRun = false; 210 return; 210 break; 211 212 case ExecutorMessageType.ExceptionOccured: 213 executorMonitoringRun = false; 214 DisposeAppDomain(); 215 if (executor.CurrentException != null) { 216 OnExceptionOccured(executor.CurrentException); 217 } else { 218 OnExceptionOccured(new Exception(string.Format("Unknow exception occured in Executor for job {0}", JobId))); 219 } 220 break; 211 221 } 212 222 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_ascheibe.config
r6456 r6464 13 13 <HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings> 14 14 <setting name="HeartbeatInterval" serializeAs="String"> 15 <value> 10</value>15 <value>00:00:10</value> 16 16 </setting> 17 17 <setting name="LastUsedFileName" serializeAs="String"> … … 52 52 </setting> 53 53 <setting name="DirOpSleepTime" serializeAs="String"> 54 <value> 50</value>54 <value>00:00:01</value> 55 55 </setting> 56 56 <setting name="PluginDeletionRetries" serializeAs="String"> … … 58 58 </setting> 59 59 <setting name="PluginDeletionTimeout" serializeAs="String"> 60 <value> 1000</value>60 <value>00:00:01</value> 61 61 </setting> 62 62 <setting name="ExecutorSemTimeouts" serializeAs="String"> 63 <value> 45</value>63 <value>00:00:46</value> 64 64 </setting> 65 65 <setting name="QueuesMaxThreads" serializeAs="String"> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_f005pc.config
r6456 r6464 13 13 <HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings> 14 14 <setting name="HeartbeatInterval" serializeAs="String"> 15 <value> 10</value>15 <value>00:00:10</value> 16 16 </setting> 17 17 <setting name="LastUsedFileName" serializeAs="String"> … … 52 52 </setting> 53 53 <setting name="DirOpSleepTime" serializeAs="String"> 54 <value> 50</value>54 <value>00:00:01</value> 55 55 </setting> 56 56 <setting name="PluginDeletionRetries" serializeAs="String"> … … 58 58 </setting> 59 59 <setting name="PluginDeletionTimeout" serializeAs="String"> 60 <value> 1000</value>60 <value>00:00:01</value> 61 61 </setting> 62 62 <setting name="ExecutorSemTimeouts" serializeAs="String"> 63 <value> 45</value>63 <value>00:00:46</value> 64 64 </setting> 65 65 <setting name="QueuesMaxThreads" serializeAs="String"> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.4/app_services.config
r6456 r6464 13 13 <HeuristicLab.Clients.Hive.SlaveCore.Properties.Settings> 14 14 <setting name="HeartbeatInterval" serializeAs="String"> 15 <value> 10</value>15 <value>00:00:10</value> 16 16 </setting> 17 17 <setting name="LastUsedFileName" serializeAs="String"> … … 52 52 </setting> 53 53 <setting name="DirOpSleepTime" serializeAs="String"> 54 <value> 50</value>54 <value>00:00:01</value> 55 55 </setting> 56 56 <setting name="PluginDeletionRetries" serializeAs="String"> … … 58 58 </setting> 59 59 <setting name="PluginDeletionTimeout" serializeAs="String"> 60 <value> 1000</value>60 <value>00:00:01</value> 61 61 </setting> 62 62 <setting name="ExecutorSemTimeouts" serializeAs="String"> 63 <value> 45</value>63 <value>00:00:46</value> 64 64 </setting> 65 65 <setting name="QueuesMaxThreads" serializeAs="String">
Note: See TracChangeset
for help on using the changeset viewer.