1919
2020BEGIN_C_DECLS
2121
22+ /* Worker pool is a global object that that is allocated per component or can be
23+ * shared between multiple compatible components.
24+ * The lifetime of this object is normally equal to the lifetime of a component[s].
25+ * It is expected to be initialized in MPI_Init and finalized in MPI_Finalize.
26+ */
2227typedef struct {
2328 /* Ref counting & locking*/
2429 int refcnt ;
@@ -41,6 +46,15 @@ typedef struct {
4146 opal_list_t tls_list ;
4247} opal_common_ucx_wpool_t ;
4348
49+ /* Worker Pool Context (wpctx) is an object that is comprised of a set of UCP
50+ * workers that are considered as one logical communication entity.
51+ * One UCP worker per "active" thread is used.
52+ * Thread is considered "active" if it performs communication operations on this
53+ * Wpool context.
54+ * A lifetime of this object is dynamic and determined by the application
55+ * (the object is created and destroyed with corresponding functions).
56+ * Context is bound to a particular Worker Pool object.
57+ */
4458typedef struct {
4559 opal_recursive_mutex_t mutex ;
4660 opal_atomic_int32_t refcntr ;
@@ -59,6 +73,11 @@ typedef struct {
5973 size_t comm_size ;
6074} opal_common_ucx_ctx_t ;
6175
76+ /* Worker Pool memory (wpmem) is an object that represents a remotely accessible
77+ * distributed memory.
78+ * It has dynamic lifetime (created and destroyed by corresponding functions).
79+ * It depends on particular Wpool context
80+ */
6281typedef struct {
6382 /* reference context to which memory region belongs */
6483 opal_common_ucx_ctx_t * ctx ;
@@ -78,6 +97,11 @@ typedef struct {
7897 opal_tsd_key_t mem_tls_key ;
7998} opal_common_ucx_wpmem_t ;
8099
100+ /* The structure that wraps UCP worker and holds the state that is required
101+ * for its use.
102+ * The structure is allocated along with UCP worker on demand and is being held
103+ * in the Worker Pool lists (either active or idle)
104+ */
81105typedef struct opal_common_ucx_winfo {
82106 opal_recursive_mutex_t mutex ;
83107 volatile int released ;
@@ -96,6 +120,10 @@ typedef struct {
96120
97121typedef void (* opal_common_ucx_user_req_handler_t )(void * request );
98122
123+ /* A fast-path structure that gathers all pointers that are required to
124+ * perform RMA operation
125+ * wpmem's mem_tls_key holds the pointer to this structure
126+ */
99127typedef struct {
100128 void * ext_req ;
101129 opal_common_ucx_user_req_handler_t ext_cb ;
0 commit comments