openmpi  3.1.6
About: Open MPI is a high performance Message Passing Interface (MPI) library project combining technologies and resources from several other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the best MPI library available. 3.x series.
  Fossies Dox: openmpi-3.1.6.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dss_types.h
Go to the documentation of this file.
1 /* -*- C -*-
2  *
3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4  * University Research and Technology
5  * Corporation. All rights reserved.
6  * Copyright (c) 2004-2006 The University of Tennessee and The University
7  * of Tennessee Research Foundation. All rights
8  * reserved.
9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10  * University of Stuttgart. All rights reserved.
11  * Copyright (c) 2004-2005 The Regents of the University of California.
12  * All rights reserved.
13  * Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
14  * Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights
15  * reserved.
16  * Copyright (c) 2014-2016 Research Organization for Information Science
17  * and Technology (RIST). All rights reserved.
18  * Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
19  * $COPYRIGHT$
20  *
21  * Additional copyrights may follow
22  *
23  * $HEADER$
24  */
31 #ifndef OPAL_DSS_TYPES_H_
32 #define OPAL_DSS_TYPES_H_
33 
34 #include "opal_config.h"
35 
36 #ifdef HAVE_SYS_TIME_H
37 #include <sys/time.h> /* for struct timeval */
38 #endif
39 
40 #include "opal/class/opal_object.h"
42 #include "opal/class/opal_list.h"
43 
44 typedef uint32_t opal_jobid_t;
45 typedef uint32_t opal_vpid_t;
46 typedef struct {
50 #define OPAL_SIZEOF_PROCESS_NAME_T 8
51 
53 
54 typedef uint8_t opal_data_type_t;
55 #define OPAL_DATA_TYPE_T OPAL_UINT8
56 #define OPAL_DSS_ID_MAX UINT8_MAX
57 #define OPAL_DSS_ID_INVALID OPAL_DSS_ID_MAX
58 
59 /* define a structure to hold generic byte objects */
60 typedef struct {
61  int32_t size;
62  uint8_t *bytes;
64 
65 /* Type defines for packing and unpacking */
66 #define OPAL_UNDEF (opal_data_type_t) 0
67 #define OPAL_BYTE (opal_data_type_t) 1
68 #define OPAL_BOOL (opal_data_type_t) 2
69 #define OPAL_STRING (opal_data_type_t) 3
70 #define OPAL_SIZE (opal_data_type_t) 4
71 #define OPAL_PID (opal_data_type_t) 5
72  /* all the integer flavors */
73 #define OPAL_INT (opal_data_type_t) 6
74 #define OPAL_INT8 (opal_data_type_t) 7
75 #define OPAL_INT16 (opal_data_type_t) 8
76 #define OPAL_INT32 (opal_data_type_t) 9
77 #define OPAL_INT64 (opal_data_type_t) 10
78  /* all the unsigned integer flavors */
79 #define OPAL_UINT (opal_data_type_t) 11
80 #define OPAL_UINT8 (opal_data_type_t) 12
81 #define OPAL_UINT16 (opal_data_type_t) 13
82 #define OPAL_UINT32 (opal_data_type_t) 14
83 #define OPAL_UINT64 (opal_data_type_t) 15
84  /* floating point types */
85 #define OPAL_FLOAT (opal_data_type_t) 16
86 #define OPAL_DOUBLE (opal_data_type_t) 17
87  /* system types */
88 #define OPAL_TIMEVAL (opal_data_type_t) 18
89 #define OPAL_TIME (opal_data_type_t) 19
90  /* OPAL types */
91 #define OPAL_BYTE_OBJECT (opal_data_type_t) 20
92 #define OPAL_DATA_TYPE (opal_data_type_t) 21
93 #define OPAL_NULL (opal_data_type_t) 22
94 #define OPAL_PSTAT (opal_data_type_t) 23
95 #define OPAL_NODE_STAT (opal_data_type_t) 24
96 #define OPAL_HWLOC_TOPO (opal_data_type_t) 25
97 #define OPAL_VALUE (opal_data_type_t) 26
98 #define OPAL_BUFFER (opal_data_type_t) 27
99 #define OPAL_PTR (opal_data_type_t) 28
100 #define OPAL_NAME (opal_data_type_t) 29
101 #define OPAL_JOBID (opal_data_type_t) 30
102 #define OPAL_VPID (opal_data_type_t) 31
103 #define OPAL_STATUS (opal_data_type_t) 32
104 #define OPAL_PERSIST (opal_data_type_t) 33
105 #define OPAL_SCOPE (opal_data_type_t) 34
106 #define OPAL_DATA_RANGE (opal_data_type_t) 35
107 #define OPAL_INFO_DIRECTIVES (opal_data_type_t) 36
108 #define OPAL_PROC_STATE (opal_data_type_t) 37
109 #define OPAL_PROC_INFO (opal_data_type_t) 38
111  /* OPAL Dynamic */
112 #define OPAL_DSS_ID_DYNAMIC (opal_data_type_t) 100
113 
114 /* define the results values for comparisons so we can change them in only one place */
115 #define OPAL_VALUE1_GREATER +1
116 #define OPAL_VALUE2_GREATER -1
117 #define OPAL_EQUAL 0
118 
119 /* define some types so we can store the generic
120  * values and still *know* how to convert it for PMIx */
121 typedef int opal_status_t;
122 typedef uint32_t opal_proc_state_t;
123 
124 /* define an opal_proc_info_t for transferring info to/from PMIx */
125 typedef struct {
128  char *hostname;
130  pid_t pid;
135 
136 /* Data value object */
137 typedef struct {
138  opal_list_item_t super; /* required for this to be on lists */
139  char *key; /* key string */
140  opal_data_type_t type; /* the type of value stored */
141  union {
142  bool flag;
143  uint8_t byte;
144  char *string;
145  size_t size;
146  pid_t pid;
147  int integer;
148  int8_t int8;
149  int16_t int16;
150  int32_t int32;
151  int64_t int64;
152  unsigned int uint;
153  uint8_t uint8;
154  uint16_t uint16;
155  uint32_t uint32;
156  uint64_t uint64;
158  float fval;
159  double dval;
160  struct timeval tv;
161  time_t time;
165  void *ptr; // never packed or passed anywhere
166  } data;
167 } opal_value_t;
169 
170 /* Process statistics object */
171 #define OPAL_PSTAT_MAX_STRING_LEN 32
172 typedef struct {
173  opal_list_item_t super; /* required for this to be on a list */
174  /* process ident info */
176  int32_t rank;
177  pid_t pid;
179  /* process stats */
180  char state[2];
181  struct timeval time;
182  float percent_cpu;
183  int32_t priority;
184  int16_t num_threads;
185  float pss; /* in MBytes */
186  float vsize; /* in MBytes */
187  float rss; /* in MBytes */
188  float peak_vsize; /* in MBytes */
189  int16_t processor;
190  /* time at which sample was taken */
191  struct timeval sample_time;
192 } opal_pstats_t;
194 typedef struct {
196  char *disk;
197  unsigned long num_reads_completed;
198  unsigned long num_reads_merged;
199  unsigned long num_sectors_read;
200  unsigned long milliseconds_reading;
201  unsigned long num_writes_completed;
202  unsigned long num_writes_merged;
203  unsigned long num_sectors_written;
204  unsigned long milliseconds_writing;
205  unsigned long num_ios_in_progress;
206  unsigned long milliseconds_io;
210 typedef struct {
213  unsigned long num_bytes_recvd;
214  unsigned long num_packets_recvd;
215  unsigned long num_recv_errs;
216  unsigned long num_bytes_sent;
217  unsigned long num_packets_sent;
218  unsigned long num_send_errs;
221 typedef struct {
223  /* node-level load averages */
224  float la;
225  float la5;
226  float la15;
227  /* memory usage */
228  float total_mem; /* in MBytes */
229  float free_mem; /* in MBytes */
230  float buffers; /* in MBytes */
231  float cached; /* in MBytes */
232  float swap_cached; /* in MBytes */
233  float swap_total; /* in MBytes */
234  float swap_free; /* in MBytes */
235  float mapped; /* in MBytes */
236  /* time at which sample was taken */
237  struct timeval sample_time;
238  /* list of disk stats, one per disk */
240  /* list of net stats, one per interface */
242 
245 
246 /* structured-unstructured data flags */
247 #define OPAL_DSS_STRUCTURED true
248 #define OPAL_DSS_UNSTRUCTURED false
249 
256 };
257 
259 
260 #define OPAL_DSS_BUFFER_TYPE_HTON(h);
261 #define OPAL_DSS_BUFFER_TYPE_NTOH(h);
262 
273  char *base_ptr;
276  char *pack_ptr;
279  char *unpack_ptr;
280 
285  size_t bytes_used;
286 };
290 typedef struct opal_buffer_t opal_buffer_t;
291 
294 
296 
297 #endif /* OPAL_DSS_TYPES_H */
opal_jobid_t
uint32_t opal_jobid_t
Definition: dss_types.h:44
opal_value_t::bo
opal_byte_object_t bo
Definition: dss_types.h:157
opal_value_t::pid
pid_t pid
Definition: dss_types.h:146
OPAL_PSTAT_MAX_STRING_LEN
#define OPAL_PSTAT_MAX_STRING_LEN
Definition: dss_types.h:171
opal_value_t::byte
uint8_t byte
Definition: dss_types.h:143
opal_value_t::uint32
uint32_t uint32
Definition: dss_types.h:155
opal_proc_info_t::super
opal_list_item_t super
Definition: dss_types.h:126
opal_buffer_t::bytes_used
size_t bytes_used
Number of bytes used by the buffer (i.e., amount of data – including overhead – packed in the buffer)
Definition: dss_types.h:285
opal_buffer_t
Structure for holding a buffer to be used with the RML or OOB subsystems.
Definition: dss_types.h:267
opal_netstats_t::num_bytes_recvd
unsigned long num_bytes_recvd
Definition: dss_types.h:213
opal_buffer_t::parent
opal_object_t parent
First member must be the object's parent.
Definition: dss_types.h:269
opal_node_stats_t::swap_cached
float swap_cached
Definition: dss_types.h:232
opal_netstats_t::num_packets_sent
unsigned long num_packets_sent
Definition: dss_types.h:217
sample_time
static char * sample_time
Definition: orte-top.c:89
opal_value_t::uint8
uint8_t uint8
Definition: dss_types.h:153
opal_diskstats_t::num_reads_completed
unsigned long num_reads_completed
Definition: dss_types.h:197
opal_pstats_t::pss
float pss
Definition: dss_types.h:185
opal_value_t
Definition: dss_types.h:137
opal_diskstats_t::num_sectors_read
unsigned long num_sectors_read
Definition: dss_types.h:199
opal_pointer_array.h
opal_diskstats_t::super
opal_list_item_t super
Definition: dss_types.h:195
opal_byte_object_t::size
int32_t size
Definition: dss_types.h:61
opal_proc_info_t::executable_name
char * executable_name
Definition: dss_types.h:129
OPAL_DSS_BUFFER_FULLY_DESC
@ OPAL_DSS_BUFFER_FULLY_DESC
Definition: dss_types.h:255
opal_list.h
opal_node_stats_t::la
float la
Definition: dss_types.h:224
opal_diskstats_t::milliseconds_io
unsigned long milliseconds_io
Definition: dss_types.h:206
opal_diskstats_t::milliseconds_writing
unsigned long milliseconds_writing
Definition: dss_types.h:204
opal_process_name_t::jobid
opal_jobid_t jobid
Definition: dss_types.h:47
opal_netstats_t::num_bytes_sent
unsigned long num_bytes_sent
Definition: dss_types.h:216
opal_pstats_t::percent_cpu
float percent_cpu
Definition: dss_types.h:182
opal_diskstats_t::num_reads_merged
unsigned long num_reads_merged
Definition: dss_types.h:198
opal_value_t::key
char * key
Definition: dss_types.h:139
BEGIN_C_DECLS
#define BEGIN_C_DECLS
code that should be in ompi_config_bottom.h regardless of build status
Definition: opal_config_bottom.h:85
opal_value_t::type
opal_data_type_t type
Definition: dss_types.h:140
opal_buffer_t::unpack_ptr
char * unpack_ptr
Where the next data will be unpacked from (within the allocated memory starting as base_ptr)
Definition: dss_types.h:279
opal_buffer_t::type
opal_dss_buffer_type_t type
type of buffer
Definition: dss_types.h:271
opal_dss_buffer_type_t
opal_dss_buffer_type_t
buffer type
Definition: dss_types.h:253
opal_diskstats_t::num_sectors_written
unsigned long num_sectors_written
Definition: dss_types.h:203
opal_node_stats_t::free_mem
float free_mem
Definition: dss_types.h:229
opal_diskstats_t::num_ios_in_progress
unsigned long num_ios_in_progress
Definition: dss_types.h:205
opal_pstats_t::num_threads
int16_t num_threads
Definition: dss_types.h:184
opal_object_t
Base object.
Definition: opal_object.h:194
opal_diskstats_t::disk
char * disk
Definition: dss_types.h:196
opal_status_t
int opal_status_t
Definition: dss_types.h:121
OBJ_CLASS_DECLARATION
OBJ_CLASS_DECLARATION(opal_proc_info_t)
opal_value_t::flag
bool flag
Definition: dss_types.h:142
opal_node_stats_t::diskstats
opal_list_t diskstats
Definition: dss_types.h:239
opal_node_stats_t::swap_total
float swap_total
Definition: dss_types.h:233
opal_proc_info_t::pid
pid_t pid
Definition: dss_types.h:130
opal_value_t::status
opal_status_t status
Definition: dss_types.h:162
opal_node_stats_t
Definition: dss_types.h:221
opal_netstats_t::super
opal_list_item_t super
Definition: dss_types.h:211
opal_object.h
opal_diskstats_t::num_writes_completed
unsigned long num_writes_completed
Definition: dss_types.h:201
opal_byte_object_t
Definition: dss_types.h:60
opal_node_stats_t::swap_free
float swap_free
Definition: dss_types.h:234
opal_value_t::time
time_t time
Definition: dss_types.h:161
OPAL_DSS_BUFFER_NON_DESC
@ OPAL_DSS_BUFFER_NON_DESC
Definition: dss_types.h:254
opal_buffer_t::pack_ptr
char * pack_ptr
Where the next data will be packed to (within the allocated memory starting at base_ptr)
Definition: dss_types.h:276
opal_diskstats_t::milliseconds_reading
unsigned long milliseconds_reading
Definition: dss_types.h:200
opal_netstats_t::num_send_errs
unsigned long num_send_errs
Definition: dss_types.h:218
opal_proc_info_t::name
opal_process_name_t name
Definition: dss_types.h:127
opal_pstats_t::super
opal_list_item_t super
Definition: dss_types.h:173
opal_diskstats_t
Definition: dss_types.h:194
opal_vpid_t
uint32_t opal_vpid_t
Definition: dss_types.h:45
opal_process_name_t
Definition: dss_types.h:46
opal_value_t::ptr
void * ptr
Definition: dss_types.h:165
opal_value_t::string
char * string
Definition: dss_types.h:144
opal_pstats_t
Definition: dss_types.h:172
opal_node_stats_t::total_mem
float total_mem
Definition: dss_types.h:228
OPAL_DECLSPEC
#define OPAL_DECLSPEC
Definition: opal_config_bottom.h:253
opal_buffer_t::base_ptr
char * base_ptr
Start of my memory.
Definition: dss_types.h:273
opal_pstats_t::vsize
float vsize
Definition: dss_types.h:186
opal_pstats_t::rss
float rss
Definition: dss_types.h:187
opal_value_t::uint
unsigned int uint
Definition: dss_types.h:152
opal_byte_object_t::bytes
uint8_t * bytes
Definition: dss_types.h:62
opal_list_item_t
Definition: opal_list.h:103
opal_data_type_t
BEGIN_C_DECLS typedef uint8_t opal_data_type_t
Definition: dss_types.h:54
opal_diskstats_t::num_writes_merged
unsigned long num_writes_merged
Definition: dss_types.h:202
opal_node_stats_t::netstats
opal_list_t netstats
Definition: dss_types.h:241
opal_value_t::super
opal_list_item_t super
Definition: dss_types.h:138
opal_proc_info_t::state
opal_proc_state_t state
Definition: dss_types.h:132
opal_value_t::int64
int64_t int64
Definition: dss_types.h:151
opal_value_t::integer
int integer
Definition: dss_types.h:147
opal_value_t::int8
int8_t int8
Definition: dss_types.h:148
opal_value_t::name
opal_process_name_t name
Definition: dss_types.h:163
opal_value_t::fval
float fval
Definition: dss_types.h:158
opal_diskstats_t::weighted_milliseconds_io
unsigned long weighted_milliseconds_io
Definition: dss_types.h:207
opal_value_t::uint64
uint64_t uint64
Definition: dss_types.h:156
opal_value_t::int16
int16_t int16
Definition: dss_types.h:149
opal_process_name_t::vpid
opal_vpid_t vpid
Definition: dss_types.h:48
opal_pstats_t::rank
int32_t rank
Definition: dss_types.h:176
opal_value_t::size
size_t size
Definition: dss_types.h:145
opal_list_t
Definition: opal_list.h:152
opal_node_stats_t::la5
float la5
Definition: dss_types.h:225
opal_node_stats_t::super
opal_object_t super
Definition: dss_types.h:222
opal_value_t::uint16
uint16_t uint16
Definition: dss_types.h:154
opal_pstats_t::peak_vsize
float peak_vsize
Definition: dss_types.h:188
opal_netstats_t::net_interface
char * net_interface
Definition: dss_types.h:212
opal_node_stats_t::la15
float la15
Definition: dss_types.h:226
opal_pstats_t::priority
int32_t priority
Definition: dss_types.h:183
opal_netstats_t::num_recv_errs
unsigned long num_recv_errs
Definition: dss_types.h:215
opal_buffer_t::bytes_allocated
size_t bytes_allocated
Number of bytes allocated (starting at base_ptr)
Definition: dss_types.h:282
opal_node_stats_t::buffers
float buffers
Definition: dss_types.h:230
opal_netstats_t
Definition: dss_types.h:210
opal_netstats_t::num_packets_recvd
unsigned long num_packets_recvd
Definition: dss_types.h:214
opal_proc_info_t::exit_code
opal_status_t exit_code
Definition: dss_types.h:131
opal_proc_info_t
Definition: dss_types.h:125
opal_pstats_t::pid
pid_t pid
Definition: dss_types.h:177
opal_value_t::int32
int32_t int32
Definition: dss_types.h:150
END_C_DECLS
#define END_C_DECLS
Definition: opal_config_bottom.h:86
opal_node_stats_t::cached
float cached
Definition: dss_types.h:231
opal_value_t::pinfo
opal_proc_info_t pinfo
Definition: dss_types.h:164
opal_proc_state_t
uint32_t opal_proc_state_t
Definition: dss_types.h:122
opal_proc_info_t::hostname
char * hostname
Definition: dss_types.h:128