19.3.14. pmix_data_array_t
pmix_data_array_t — Defines an array of like-typed values
19.3.14.1. SYNTAX
19.3.14.1.1. C Syntax
#include <pmix_common.h>
typedef struct pmix_data_array {
pmix_data_type_t type;
size_t size;
void *array;
} pmix_data_array_t;
19.3.14.2. DESCRIPTION
The pmix_data_array_t structure defines an array data structure — a
contiguous block of size elements, all of the same PMIx datatype type.
type— a pmix_data_type_t(5) value identifying the datatype of every element stored inarray.size— the number of elements inarray.array— pointer to the contiguous block ofsizeelements. Each element is of the C type corresponding totype(for example, anarrayof pmix_info_t(5) whentypeisPMIX_INFO).
PMIX_DATA_ARRAY is itself a legal element type: when type is
PMIX_DATA_ARRAY, array points at a contiguous block of size
pmix_data_array_t structures, each a complete array in its own right
(and each free to declare a different element type). The elements are
stored inline in the block — they are not pointers to arrays
elsewhere. Constructing such an array zeroes every element, so an element
the caller does not fill in is a valid empty array (PMIX_UNDEF,
size 0) rather than uninitialized memory, and destructing the outer
array recursively releases every element.
Nesting is bounded. PMIx refuses to pack or unpack an array nested more
deeply inside other arrays than the bfrops_base_max_array_depth MCA
parameter permits — 100 levels by default, or unlimited if the
parameter is set to zero. The limit counts every form of nesting, both an
array whose element type is PMIX_DATA_ARRAY and the ordinary case of
an array reached through a pmix_value_t, because each level of either
costs the receiver a frame of recursion while costing the sender only a
few bytes on the wire.
The pmix_data_array_t structure is the mechanism by which a collection of
values is conveyed through a single pmix_value_t(5)
or pmix_info_t(5): the containing structure references
a pmix_data_array_t (via the darray union member of a pmix_value_t),
which in turn points at the array of individual objects.
19.3.14.3. STATIC INITIALIZER
A statically declared pmix_data_array_t may be initialized with the
PMIX_DATA_ARRAY_STATIC_INIT macro, which sets type to PMIX_UNDEF, size to 0, and array to NULL:
pmix_data_array_t array = PMIX_DATA_ARRAY_STATIC_INIT;
See also