vtkPVSystemConfigInformation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkPVSystemConfigInformation_h
11 #define vtkPVSystemConfigInformation_h
12 
13 #include "vtkPVInformation.h"
14 
15 #include <string> // for string
16 using std::string;
17 #include <vector> // for vector
18 using std::vector;
19 
21 {
22 public:
23  class ConfigInfo
24  {
25  public:
27  : ProcessType(-1)
28  , SystemType(-1)
29  , Rank(-1)
30  , Pid(0)
31  , HostMemoryTotal(0)
32  , HostMemoryAvailable(0)
33  , ProcMemoryAvailable(0)
34  {
35  }
36 
37  void Print();
38 
39  bool operator<(const ConfigInfo& other) const { return this->Rank < other.Rank; }
40 
41  string OSDescriptor;
42  string CPUDescriptor;
43  string MemDescriptor;
44  string HostName;
47  int Rank;
48  long long Pid;
49  long long HostMemoryTotal;
52  };
53 
54  static vtkPVSystemConfigInformation* New();
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
61  void CopyFromObject(vtkObject* obj) override;
62 
66  void AddInformation(vtkPVInformation* info) override;
67 
69 
72  void CopyToStream(vtkClientServerStream* css) override;
73  void CopyFromStream(const vtkClientServerStream* css) override;
75 
79  size_t GetSize() { return this->Configs.size(); }
80 
81  const char* GetOSDescriptor(size_t i) { return this->Configs[i].OSDescriptor.c_str(); }
82  const char* GetCPUDescriptor(size_t i) { return this->Configs[i].CPUDescriptor.c_str(); }
83  const char* GetMemoryDescriptor(size_t i) { return this->Configs[i].MemDescriptor.c_str(); }
84  const char* GetHostName(size_t i) { return this->Configs[i].HostName.c_str(); }
85  int GetProcessType(size_t i) { return this->Configs[i].ProcessType; }
86  int GetSystemType(size_t i) { return this->Configs[i].SystemType; }
87  int GetRank(size_t i) { return this->Configs[i].Rank; }
88  long long GetPid(size_t i) { return this->Configs[i].Pid; }
89  long long GetHostMemoryTotal(size_t i) { return this->Configs[i].HostMemoryTotal; }
90  long long GetHostMemoryAvailable(size_t i) { return this->Configs[i].HostMemoryAvailable; }
91  long long GetProcMemoryAvailable(size_t i) { return this->Configs[i].ProcMemoryAvailable; }
92 
96  void Sort();
97 
98 protected:
100  ~vtkPVSystemConfigInformation() override;
101 
102 private:
103  vector<ConfigInfo> Configs;
104 
106  void operator=(const vtkPVSystemConfigInformation&) = delete;
107 };
108 
109 #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.