Config#

2026-03-31

2 min read time

Applies to Linux

The ucxx::Config class provides access to UCX configuration parameters. It wraps the UCP configuration and allows querying and setting UCX_* environment variable overrides used during context creation.

#include <ucxx/config.h>

namespace ucxx

class Config#

Component encapsulating the UCP configuration.

The UCP layer provides a handle to its configuration in form of ucp_config_t* object, this class encapsulates that object and provides methods to simplify its handling.

Public Functions

explicit Config(
ConfigMap userOptions
)#

Constructor that reads the UCX configuration and apply user options.

Read UCX configuration defaults and environment variable modifiers and apply user configurations overriding previously set configurations.

Parameters:

userOptions[in] user-defined options overriding defaults and environment variable modifiers.

ConfigMap get(
)#

Get the configuration map.

Get the configuration map with all visible UCP configurations that are in effect for the current process.

Returns:

The map to the UCP configurations defined for the process.

ucp_config_t *getHandle(
)#

Get the underlying ucp_config_t* handle.

Lifetime of the ucp_config_t* handle is managed by the ucxx::Config object and its ownership is non-transferrable. Once the ucxx::Config is destroyed the handle is not valid anymore, it is the user’s responsibility to ensure the owner’s lifetime while using the handle.

// config is `ucxx::Config`
ucp_config_t* configHandle = config.getHandle();
Returns:

The underlying ucp_config_t* handle.