20.2.236. PMIx_Check_nspace_strict
PMIx_Check_nspace_strict — Compare two
pmix_nspace_t(5) values for equality, without
treating an invalid namespace as a wildcard
20.2.236.1. SYNOPSIS
#include <pmix.h>
bool PMIx_Check_nspace_strict(const char *key1, const char *key2);
20.2.236.1.1. Python Syntax
No Python equivalent
20.2.236.2. INPUT PARAMETERS
key1: Pointer to the first namespace (typically a pmix_nspace_t(5)) to be compared.key2: Pointer to the second namespace to be compared.
20.2.236.3. DESCRIPTION
Compare two namespaces for equality. The comparison examines at most
PMIX_MAX_NSLEN characters, which is the maximum length a
pmix_nspace_t can hold.
An invalid namespace (NULL or zero-length, as determined by
PMIx_Nspace_invalid(3)) matches
nothing — not even another invalid namespace. “Unset” is not a
value two namespaces can agree on.
This is the difference between this routine and PMIx_Check_nspace(3), which treats an invalid namespace on either side as a wildcard that matches anything.
20.2.236.4. RETURN VALUE
Returns true only when both namespaces are valid and their first
PMIX_MAX_NSLEN characters match. Returns false otherwise —
including when either namespace, or both, is invalid.
20.2.236.5. NOTES
PMIx_Check_nspace_strict is an OpenPMIx convenience routine and is the
backing implementation of the PMIX_CHECK_NSPACE_STRICT macro.
Choosing between the two routines is a question of what is being asked:
Use PMIx_Check_nspace(3) to match a request against a filter, where an unset namespace means “any” — for example, deciding whether a query restricted to one namespace should see a given entry.
Use
PMIx_Check_nspace_strictto ask whether two things belong to the same namespace. Structures frequently carry namespace fields that are legitimately empty (a launcher or parent that was never recorded, a request nobody is waiting on), and comparing one of those withPMIx_Check_nspacesilently answerstrueagainst every namespace in the system.