18.2.45. PMIx_Error_string

PMIx_Error_string — Return a string representation of a PMIx status code.

18.2.45.1. SYNOPSIS

#include <pmix.h>

const char* PMIx_Error_string(pmix_status_t status);

18.2.45.1.1. Python Syntax

from pmix import *

foo = PMIxClient()
# status is an integer PMIx status code
string = foo.error_string(PMIX_ERR_NOT_FOUND)

18.2.45.2. INPUT PARAMETERS

  • status: A pmix_status_t value (a PMIx status or event constant) for which a string representation is desired.

18.2.45.3. DESCRIPTION

Return a human-readable, NULL-terminated string that names the provided PMIx status code. The function searches the library’s table of known status and event constants for one whose numeric value matches status and returns its symbolic name (for example, "NOT-FOUND" for PMIX_ERR_NOT_FOUND).

PMIx_Error_string may be called at any time, including outside of the initialized region, and is usable by servers and tools in addition to clients.

Note

The returned string is statically allocated within the PMIx library and must not be modified or freed by the caller.

18.2.45.4. RETURN VALUE

Returns a pointer to a statically allocated, NULL-terminated string naming the provided status code. If status does not correspond to any status or event constant known to the library, the fixed string "ERROR STRING NOT FOUND" is returned. The function always returns a valid, non-NULL pointer.

18.2.45.5. NOTES

PMIx_Error_string is the inverse of PMIx_Error_code(3), which maps a status name string back to its numeric pmix_status_t value.

Because the returned string is owned by the library, callers must never pass it to free().