18.2.72. PMIx_Info_get_size

PMIx_Info_get_size — Compute the size (in bytes) of the data payload in a pmix_info_t(5) structure.

18.2.72.1. SYNOPSIS

#include <pmix.h>

pmix_status_t PMIx_Info_get_size(const pmix_info_t *val,
                                 size_t *size);

18.2.72.2. INPUT PARAMETERS

  • val: Pointer to the pmix_info_t(5) whose payload size is to be computed.

18.2.72.3. OUTPUT PARAMETERS

  • size: Pointer to a size_t variable where the computed size, in bytes, will be returned.

18.2.72.4. DESCRIPTION

Compute and return the size, in bytes, of the data payload contained in a pmix_info_t(5) structure. A pmix_info_t(5) associates a key string with a pmix_value_t(5), so the returned size accounts for both components:

  • The size of the contained pmix_value_t(5) payload, computed as described for PMIx_Value_get_size(3).

  • The length of the key string, up to PMIX_MAX_KEYLEN characters, including the terminating NULL where present.

The size of the pmix_info_t(5) structure itself is also added, so size reflects the total storage associated with the info, not just its payload.

The source pmix_info_t(5) is not altered by this function.

18.2.72.5. RETURN VALUE

Returns PMIX_SUCCESS on success. On error, a negative value corresponding to a PMIx error constant is returned, including:

  • PMIX_ERR_UNKNOWN_DATA_TYPE — the type field of the contained value is PMIX_UNDEF or otherwise not a recognized PMIx data type, so the size could not be computed.

Any other negative value indicates an appropriate error condition. PMIx error constants are defined in pmix_common.h.

18.2.72.6. NOTES

The returned size includes the size of the pmix_info_t(5) structure itself, the length of its key, and the size of its contained pmix_value_t(5) payload. The value payload is sized by delegating to PMIx_Value_get_size(3).