|
ucs_status_t | uct_worker_create (ucs_async_context_t *async, ucs_thread_mode_t thread_mode, uct_worker_h *worker_p) |
| Create a worker object. More...
|
|
void | uct_worker_destroy (uct_worker_h worker) |
| Destroy a worker object. More...
|
|
void | uct_worker_progress_register_safe (uct_worker_h worker, ucs_callback_t func, void *arg, unsigned flags, uct_worker_cb_id_t *id_p) |
| Add a slow path callback function to a worker progress. More...
|
|
void | uct_worker_progress_unregister_safe (uct_worker_h worker, uct_worker_cb_id_t *id_p) |
| Remove a slow path callback function from worker's progress. More...
|
|
ucs_status_t | uct_config_get (void *config, const char *name, char *value, size_t max) |
| Get value by name from interface configuration (uct_iface_config_t), memory domain configuration (uct_md_config_t) or connection manager configuration (uct_cm_config_t). More...
|
|
ucs_status_t | uct_config_modify (void *config, const char *name, const char *value) |
| Modify interface configuration (uct_iface_config_t), memory domain configuration (uct_md_config_t) or connection manager configuration (uct_cm_config_t). More...
|
|
unsigned | uct_worker_progress (uct_worker_h worker) |
| Explicit progress for UCT worker. More...
|
|
UCT context abstracts all the resources required for network communication. It is designed to enable either share or isolate resources for multiple programming models used by an application.
This section provides a detailed description of this concept and routines associated with it.
◆ uct_alloc_method_t
Enumerator |
---|
UCT_ALLOC_METHOD_THP | Allocate from OS using libc allocator with Transparent Huge Pages enabled
|
UCT_ALLOC_METHOD_MD | Allocate using memory domain
|
UCT_ALLOC_METHOD_HEAP | Allocate from heap using libc allocator
|
UCT_ALLOC_METHOD_MMAP | Allocate from OS using mmap() syscall
|
UCT_ALLOC_METHOD_HUGE | Allocate huge pages
|
UCT_ALLOC_METHOD_LAST | |
UCT_ALLOC_METHOD_DEFAULT | Use default method
|
◆ uct_worker_create()
The worker represents a progress engine. Multiple progress engines can be created in an application, for example to be used by multiple threads. Transports can allocate separate communication resources for every worker, so that every worker can be progressed independently of others.
- Parameters
-
[in] | async | Context for async event handlers. Must not be NULL. |
[in] | thread_mode | Thread access mode to the worker and all interfaces and endpoints associated with it. |
[out] | worker_p | Filled with a pointer to the worker object. |
- Examples
- uct_hello_world.c.
◆ uct_worker_destroy()
◆ uct_worker_progress_register_safe()
If *id_p is equal to UCS_CALLBACKQ_ID_NULL, this function will add a callback which will be invoked every time progress is made on the worker. *id_p will be updated with an id which refers to this callback and can be used in uct_worker_progress_unregister_safe to remove it from the progress path.
- Parameters
-
[in] | worker | Handle to the worker whose progress should invoke the callback. |
[in] | func | Pointer to the callback function. |
[in] | arg | Argument for the callback function. |
[in] | flags | Callback flags, see ucs_callbackq_flags. |
[in,out] | id_p | Points to a location to store a callback identifier. If *id_p is equal to UCS_CALLBACKQ_ID_NULL, a callback will be added and *id_p will be replaced with a callback identifier which can be subsequently used to remove the callback. Otherwise, no callback will be added and *id_p will be left unchanged. |
- Note
- This function is thread safe.
◆ uct_worker_progress_unregister_safe()
If *id_p is not equal to UCS_CALLBACKQ_ID_NULL, remove a callback which was previously added by uct_worker_progress_register_safe. *id_p will be reset to UCS_CALLBACKQ_ID_NULL.
- Parameters
-
[in] | worker | Handle to the worker whose progress should invoke the callback. |
[in,out] | id_p | Points to a callback identifier which indicates the callback to remove. If *id_p is not equal to UCS_CALLBACKQ_ID_NULL, the callback will be removed and *id_p will be reset to UCS_CALLBACKQ_ID_NULL. If *id_p is equal to UCS_CALLBACKQ_ID_NULL, no operation will be performed and *id_p will be left unchanged. |
- Note
- This function is thread safe.
◆ uct_config_get()
ucs_status_t uct_config_get |
( |
void * |
config, |
|
|
const char * |
name, |
|
|
char * |
value, |
|
|
size_t |
max |
|
) |
| |
- Parameters
-
[in] | config | Configuration to get from. |
[in] | name | Configuration variable name. |
[out] | value | Pointer to get value. Should be allocated/freed by caller. |
[in] | max | Available memory space at value pointer. |
- Returns
- UCS_OK if found, otherwise UCS_ERR_INVALID_PARAM or UCS_ERR_NO_ELEM if error.
◆ uct_config_modify()
ucs_status_t uct_config_modify |
( |
void * |
config, |
|
|
const char * |
name, |
|
|
const char * |
value |
|
) |
| |
- Parameters
-
[in] | config | Configuration to modify. |
[in] | name | Configuration variable name. |
[in] | value | Value to set. |
- Returns
- Error code.
◆ uct_worker_progress()
This routine explicitly progresses any outstanding communication operations and active message requests.
- Note
- In the current implementation, users MUST call this routine to receive the active message requests.
- Parameters
-
[in] | worker | Handle to worker. |
- Returns
- Nonzero if any communication was progressed, zero otherwise.
- Examples
- uct_hello_world.c.