18.2.46. PMIx_Error_code

PMIx_Error_code — Return the PMIx status code corresponding to a status name string.

18.2.46.1. SYNOPSIS

#include <pmix.h>

pmix_status_t PMIx_Error_code(const char *errname);

18.2.46.2. INPUT PARAMETERS

  • errname: A NULL-terminated string naming a PMIx status or event constant, as would be returned by PMIx_Error_string(3).

18.2.46.3. DESCRIPTION

Return the numeric pmix_status_t value whose symbolic name matches the provided string. The function searches the library’s table of known status and event constants for an entry whose name matches errname and returns that entry’s code. The comparison is case-insensitive.

PMIx_Error_code is the inverse of PMIx_Error_string(3): given a name produced by that function, it recovers the corresponding numeric status value.

Note

PMIx_Error_code is a library extension provided by OpenPMIx; it is not defined by the PMIx Standard.

18.2.46.4. RETURN VALUE

Returns the pmix_status_t value corresponding to errname on success. If no known status or event constant has a matching name, the function returns INT32_MIN to indicate that the name was not recognized.

18.2.46.5. NOTES

Because a successful lookup can legitimately return a large negative value (PMIx error codes are negative), callers that need to detect failure should test explicitly for the INT32_MIN sentinel rather than assuming any negative return denotes an unrecognized name.