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  : OSDescriptor("")
40  , CPUDescriptor("")
41  , MemDescriptor("")
42  , HostName("")
43  , ProcessType(-1)
44  , SystemType(-1)
45  , Rank(-1)
46  , Pid(0)
47  , HostMemoryTotal(0)
48  , HostMemoryAvailable(0)
49  , ProcMemoryAvailable(0)
50  {
51  }
52 
53  void Print();
54 
55  bool operator<(const ConfigInfo& other) const { return this->Rank < other.Rank; }
56 
57  public:
58  string OSDescriptor;
59  string CPUDescriptor;
60  string MemDescriptor;
61  string HostName;
64  int Rank;
65  long long Pid;
66  long long HostMemoryTotal;
69  };
70 
71 public:
72  static vtkPVSystemConfigInformation* New();
74  void PrintSelf(ostream& os, vtkIndent indent) override;
75 
79  void CopyFromObject(vtkObject* obj) override;
80 
84  void AddInformation(vtkPVInformation* info) override;
85 
87 
90  void CopyToStream(vtkClientServerStream* css) override;
91  void CopyFromStream(const vtkClientServerStream* css) override;
93 
97  size_t GetSize() { return this->Configs.size(); }
98 
99  const char* GetOSDescriptor(size_t i) { return this->Configs[i].OSDescriptor.c_str(); }
100  const char* GetCPUDescriptor(size_t i) { return this->Configs[i].CPUDescriptor.c_str(); }
101  const char* GetMemoryDescriptor(size_t i) { return this->Configs[i].MemDescriptor.c_str(); }
102  const char* GetHostName(size_t i) { return this->Configs[i].HostName.c_str(); }
103  int GetProcessType(size_t i) { return this->Configs[i].ProcessType; }
104  int GetSystemType(size_t i) { return this->Configs[i].SystemType; }
105  int GetRank(size_t i) { return this->Configs[i].Rank; }
106  long long GetPid(size_t i) { return this->Configs[i].Pid; }
107  long long GetHostMemoryTotal(size_t i) { return this->Configs[i].HostMemoryTotal; }
108  long long GetHostMemoryAvailable(size_t i) { return this->Configs[i].HostMemoryAvailable; }
109  long long GetProcMemoryAvailable(size_t i) { return this->Configs[i].ProcMemoryAvailable; }
110 
114  void Sort();
115 
116 protected:
118  ~vtkPVSystemConfigInformation() override;
119 
120 private:
121  vector<ConfigInfo> Configs;
122 
123 private:
125  void operator=(const vtkPVSystemConfigInformation&) = delete;
126 };
127 
128 #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.