vtkPVSystemConfigInformation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
22 #ifndef vtkPVSystemConfigInformation_h
23 #define vtkPVSystemConfigInformation_h
24 
25 #include "vtkPVInformation.h"
26 
27 #include <string> // for string
28 using std::string;
29 #include <vector> // for vector
30 using std::vector;
31 
33 {
34 public:
35  class ConfigInfo
36  {
37  public:
39  : ProcessType(-1)
40  , SystemType(-1)
41  , Rank(-1)
42  , Pid(0)
43  , HostMemoryTotal(0)
44  , HostMemoryAvailable(0)
45  , ProcMemoryAvailable(0)
46  {
47  }
48 
49  void Print();
50 
51  bool operator<(const ConfigInfo& other) const { return this->Rank < other.Rank; }
52 
53  string OSDescriptor;
54  string CPUDescriptor;
55  string MemDescriptor;
56  string HostName;
59  int Rank;
60  long long Pid;
61  long long HostMemoryTotal;
64  };
65 
66  static vtkPVSystemConfigInformation* New();
68  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
73  void CopyFromObject(vtkObject* obj) override;
74 
78  void AddInformation(vtkPVInformation* info) override;
79 
81 
84  void CopyToStream(vtkClientServerStream* css) override;
85  void CopyFromStream(const vtkClientServerStream* css) override;
87 
91  size_t GetSize() { return this->Configs.size(); }
92 
93  const char* GetOSDescriptor(size_t i) { return this->Configs[i].OSDescriptor.c_str(); }
94  const char* GetCPUDescriptor(size_t i) { return this->Configs[i].CPUDescriptor.c_str(); }
95  const char* GetMemoryDescriptor(size_t i) { return this->Configs[i].MemDescriptor.c_str(); }
96  const char* GetHostName(size_t i) { return this->Configs[i].HostName.c_str(); }
97  int GetProcessType(size_t i) { return this->Configs[i].ProcessType; }
98  int GetSystemType(size_t i) { return this->Configs[i].SystemType; }
99  int GetRank(size_t i) { return this->Configs[i].Rank; }
100  long long GetPid(size_t i) { return this->Configs[i].Pid; }
101  long long GetHostMemoryTotal(size_t i) { return this->Configs[i].HostMemoryTotal; }
102  long long GetHostMemoryAvailable(size_t i) { return this->Configs[i].HostMemoryAvailable; }
103  long long GetProcMemoryAvailable(size_t i) { return this->Configs[i].ProcMemoryAvailable; }
104 
108  void Sort();
109 
110 protected:
112  ~vtkPVSystemConfigInformation() override;
113 
114 private:
115  vector<ConfigInfo> Configs;
116 
118  void operator=(const vtkPVSystemConfigInformation&) = delete;
119 };
120 
121 #endif
A vtkClientServerStream serializable container of information describing memory configuration of the ...
Store messages for the interpreter.
#define VTKREMOTINGCORE_EXPORT
bool operator<(const ConfigInfo &other) const
size_t GetSize()
Access managed information.
Superclass for information objects.