Changeset 6910
- Timestamp:
- 10/12/11 15:48:53 (13 years ago)
- Location:
- branches/HeuristicLab.Hive-3.4/sources
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave.ConsoleClient/3.3/HeuristicLab.Clients.Hive.Slave.ConsoleClient-3.3.csproj
r6896 r6910 40 40 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> 41 41 <PlatformTarget>AnyCPU</PlatformTarget> 42 <OutputPath> ..\..\..\..\..\trunk\sources\bin\</OutputPath>42 <OutputPath>bin\Debug\</OutputPath> 43 43 </PropertyGroup> 44 44 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'"> … … 65 65 <Project>{989FE92B-484E-41EE-87E2-6A24AF0381D8}</Project> 66 66 <Name>HeuristicLab.Clients.Hive.Slave-3.3</Name> 67 <Private> False</Private>67 <Private>True</Private> 68 68 </ProjectReference> 69 69 <ProjectReference Include="..\..\HeuristicLab.Clients.Hive\3.3\HeuristicLab.Clients.Hive-3.3.csproj"> 70 70 <Project>{B5EF1E5A-9F3D-40B9-B4B0-30AADF2E2CEB}</Project> 71 71 <Name>HeuristicLab.Clients.Hive-3.3</Name> 72 <Private> False</Private>72 <Private>True</Private> 73 73 </ProjectReference> 74 74 <ProjectReference Include="..\..\HeuristicLab.Hive\3.3\HeuristicLab.Hive-3.3.csproj"> 75 75 <Project>{F98A1740-9AC9-4D36-A582-6A2D0D06978D}</Project> 76 76 <Name>HeuristicLab.Hive-3.3</Name> 77 <Private> False</Private>77 <Private>True</Private> 78 78 </ProjectReference> 79 79 </ItemGroup> -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Core.cs
r6893 r6910 241 241 if (task == null) throw new TaskNotFoundException(taskId); 242 242 if (ConfigManager.Instance.GetFreeCores() < task.CoresNeeded) throw new OutOfCoresException(); 243 if (ConfigManager. GetFreeMemory() < task.MemoryNeeded) throw new OutOfMemoryException();243 if (ConfigManager.Instance.GetFreeMemory() < task.MemoryNeeded) throw new OutOfMemoryException(); 244 244 SlaveStatusInfo.IncrementUsedCores(task.CoresNeeded); usedCores = task.CoresNeeded; 245 245 TaskData taskData = wcfService.GetTaskData(taskId); -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/ConfigManager.cs
r6897 r6910 46 46 private Slave slave; 47 47 private PerformanceCounter cpuCounter; 48 private PerformanceCounter memCounter; 48 49 49 50 /// <summary> … … 52 53 public ConfigManager(TaskManager jobManager) { 53 54 this.jobManager = jobManager; 54 UpdateSlaveInfo();55 }56 57 private void UpdateSlaveInfo() {58 55 cpuCounter = new PerformanceCounter(); 59 56 cpuCounter.CategoryName = "Processor"; 60 57 cpuCounter.CounterName = "% Processor Time"; 61 58 cpuCounter.InstanceName = "_Total"; 59 memCounter = new PerformanceCounter("Memory", "Available Bytes", true); 62 60 63 61 Asleep = false; … … 70 68 slave.OperatingSystem = Environment.OSVersion.VersionString; 71 69 slave.CpuSpeed = GetCpuSpeed(); 72 slave.FreeMemory = GetFreeMemory(); 73 slave.HbInterval = (int)Settings.Default.HeartbeatInterval.TotalSeconds; 70 71 UpdateSlaveInfo(); 72 } 73 74 private void UpdateSlaveInfo() { 75 if (slave != null) { 76 slave.FreeMemory = GetFreeMemory(); 77 slave.HbInterval = (int)Settings.Default.HeartbeatInterval.TotalSeconds; 78 } 74 79 } 75 80 … … 240 245 /// returns free memory of machine in MB 241 246 /// </summary> 242 public staticint GetFreeMemory() {247 public int GetFreeMemory() { 243 248 int mb = 0; 244 249 245 250 try { 246 PerformanceCounter counter = new PerformanceCounter("Memory", "Available Bytes", true); 247 mb = (int)(counter.NextValue() / 1024 / 1024); 251 mb = (int)(memCounter.NextValue() / 1024 / 1024); 248 252 } 249 253 catch { } … … 252 256 253 257 public float GetCpuUtilization() { 254 return cpuCounter.NextValue(); 258 float cpuVal = 0.0F; 259 260 try { 261 return cpuCounter.NextValue(); 262 } 263 catch { } 264 return cpuVal; 255 265 } 256 266 } -
branches/HeuristicLab.Hive-3.4/sources/HeuristicLab.Clients.Hive.Slave/3.3/Manager/HeartbeatManager.cs
r6893 r6910 97 97 SlaveId = info.Id, 98 98 FreeCores = info.Cores.HasValue ? info.Cores.Value - SlaveStatusInfo.UsedCores : 0, 99 FreeMemory = ConfigManager. GetFreeMemory(),99 FreeMemory = ConfigManager.Instance.GetFreeMemory(), 100 100 CpuUtilization = ConfigManager.Instance.GetCpuUtilization(), 101 101 JobProgress = ConfigManager.Instance.GetExecutionTimeOfAllJobs(),
Note: See TracChangeset
for help on using the changeset viewer.