21.2.262. PMIx_server_dmodex_request2

PMIx_server_dmodex_request2 — Request locally posted modex data for a specified process on behalf of a remote requester.

21.2.262.1. SYNOPSIS

#include <pmix_server.h>

pmix_status_t PMIx_server_dmodex_request2(const pmix_proc_t *proc,
                                          const pmix_info_t info[], size_t ninfo,
                                          pmix_dmodex_response_fn_t cbfunc,
                                          void *cbdata);

21.2.262.1.1. Python Syntax

from pmix import *

foo = PMIxServer()
# ... after a successful foo.init() ...
proc = {'nspace': "myapp", 'rank': 3}
# the requester, as the requesting server's direct_modex up-call named it
info = [{'key': PMIX_USERID, 'value': 1000, 'val_type': PMIX_UINT32},
        {'key': PMIX_GRPID, 'value': 1000, 'val_type': PMIX_UINT32},
        {'key': PMIX_REQUESTOR, 'value': {'nspace': "otherjob", 'rank': 0},
         'val_type': PMIX_PROC}]
rc, (data, sz) = foo.dmodex_request2(proc, info)
# rc is the status delivered to the callback

21.2.262.2. INPUT PARAMETERS

  • proc: Pointer to a pmix_proc_t(5) identifying the process whose posted data is being requested. A rank of PMIX_RANK_WILDCARD requests the job-level information for the namespace rather than the data posted by a specific process. Must not be NULL.

  • info: Array of pmix_info_t(5) directives, or NULL. It must remain valid until cbfunc is called.

  • ninfo: Number of elements in info.

  • cbfunc: Callback function of type pmix_dmodex_response_fn_t that is invoked with the requested data once it becomes available, or with the reason it will not be returned. Must not be NULL.

  • cbdata: Opaque pointer that is passed, unmodified, to cbfunc.

21.2.262.3. DIRECTIVES

The host names the process the request is being made for, as the requesting server named it in its direct_modex up-call (see pmix_server_module_t(5)):

  • PMIX_USERID (uint32_t) — the requester’s user ID.

  • PMIX_GRPID (uint32_t) — the requester’s group ID.

  • PMIX_REQUESTOR (pmix_proc_t(5)) — the requesting process.

21.2.262.4. DESCRIPTION

PMIx_server_dmodex_request2 is PMIx_server_dmodex_request(3) with directives. When they name a requester, the library returns the data only if that requester may access the target job - it is one of the job’s own processes, is root or runs as the server’s own user, is the job’s owner, or is named by user or group in the job’s access list - and otherwise completes the request with PMIX_ERR_NO_PERMISSIONS. A request that names no requester is answered as PMIx_server_dmodex_request answers it.

The requesting server remembers which requesters the holding server approved, answers only them from the copy it keeps, and asks again for any other. See Access control by user and group.

A host can tell whether the library provides this function from the PMIX_CAP_DMODEX_REQUEST2 capability flag in pmix_version.h.

The request is non-blocking, is deferred when the data is not yet available, and delivers its result through cbfunc exactly as PMIx_server_dmodex_request does; see that page for the callback and the ownership of the returned blob.

21.2.262.5. RETURN VALUE

A return of PMIX_SUCCESS indicates only that the request was accepted for processing; the final status and any data are delivered through cbfunc. Possible immediate return values include:

  • PMIX_SUCCESS — the request was accepted for processing.

  • PMIX_ERR_BAD_PARAM — proc or cbfunc was NULL, or info was NULL with a non-zero ninfo.

  • PMIX_ERR_NOT_AVAILABLE — the operation cannot be serviced because the library’s progress engine has been stopped.

  • PMIX_ERR_INIT — the PMIx server library has not been initialized.

When an error is returned immediately, cbfunc is not called. The status delivered to cbfunc may additionally be:

  • PMIX_ERR_NO_PERMISSIONS — the named requester may not access the target job’s data.

  • PMIX_ERR_BAD_PARAM — a directive naming the requester had the wrong type.