18.2.6. PMIx_Commit

PMIx_Commit — Make previously staged key/value pairs available to other processes.

18.2.6.1. SYNOPSIS

#include <pmix.h>

pmix_status_t PMIx_Commit(void);

18.2.6.1.1. Python Syntax

from pmix import *

foo = PMIxClient()
# ... after one or more foo.put() calls ...
rc = foo.commit()

18.2.6.2. DESCRIPTION

Make available to other processes all key-value pairs previously staged by this process via PMIx_Put(3).

A PMIx implementation may locally cache non-reserved keys in the client library until they are committed. PMIx_Commit initiates the operation of making those staged key-value pairs available; depending on the implementation, this may involve transmitting the entire collection of data posted by the process to the local PMIx server. PMIx_Commit is an asynchronous operation: it returns to the caller immediately while the data is staged to the server in the background.

Note

Users are advised to always include the call to PMIx_Commit in case the local implementation requires it. Committing does not by itself circulate the posted data to other processes: availability of the data to peers still relies on the exchange mechanisms — typically a synchronization such as PMIx_Fence(3) — that govern data sharing.

PMIx_Commit takes no arguments. As a convenience, it is a no-op that returns PMIX_SUCCESS when there is nothing to commit — for example, when the caller is a singleton process with no local server to receive the data.

18.2.6.3. RETURN VALUE

Returns PMIX_SUCCESS on success. On error, a negative value corresponding to a PMIx error constant is returned, including:

  • PMIX_ERR_UNREACH — the local PMIx server could not be reached.

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

  • PMIX_ERR_INIT — the PMIx library has not been initialized.

Any other negative value indicates an appropriate error condition. PMIx error constants are defined in pmix_common.h.

18.2.6.4. NOTES

Because commitment does not guarantee that peers can immediately retrieve the data, a typical publication sequence is one or more PMIx_Put(3) calls, followed by PMIx_Commit, followed by a collective synchronization such as PMIx_Fence(3) before the peers issue PMIx_Get(3).