18.2.113. PMIx_Info_list_xfer_unique

PMIx_Info_list_xfer_unique — Copy an existing pmix_info_t(5) onto an opaque list only if its key is not already present

18.2.113.1. SYNOPSIS

#include <pmix.h>

pmix_status_t PMIx_Info_list_xfer_unique(void *ptr,
                                         const pmix_info_t *info,
                                         bool overwrite);

18.2.113.1.1. Python Syntax

No Python equivalent

18.2.113.2. INPUT PARAMETERS

  • ptr: Opaque list handle returned by PMIx_Info_list_start(3).

  • info: Pointer to the source pmix_info_t to be copied onto the list.

  • overwrite: If true and an entry with the same key already exists, its value is replaced with a copy of the source value. If false, an existing entry is left unchanged.

18.2.113.3. DESCRIPTION

PMIx_Info_list_xfer_unique is the key-unique variant of PMIx_Info_list_xfer(3). The list identified by ptr is first scanned for an existing entry whose key matches that of the source info:

  • If a match is found and overwrite is true, the existing value is destructed and replaced with a copy of the source value. No new entry is appended.

  • If a match is found and overwrite is false, the list is left unchanged.

  • If no match is found, a full copy of the source info is appended to the end of the list.

The transfer is a deep copy; the source info may be modified or freed once the function returns.

18.2.113.4. RETURN VALUE

Returns PMIX_SUCCESS when the entry was added, updated, or intentionally left unchanged; or a negative PMIx error constant such as PMIX_ERR_NOMEM if a new entry could not be allocated.