19
19
20
20
BEGIN_C_DECLS
21
21
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
+ */
22
27
typedef struct {
23
28
/* Ref counting & locking*/
24
29
int refcnt ;
@@ -41,6 +46,15 @@ typedef struct {
41
46
opal_list_t tls_list ;
42
47
} opal_common_ucx_wpool_t ;
43
48
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
+ */
44
58
typedef struct {
45
59
opal_recursive_mutex_t mutex ;
46
60
opal_atomic_int32_t refcntr ;
@@ -59,6 +73,11 @@ typedef struct {
59
73
size_t comm_size ;
60
74
} opal_common_ucx_ctx_t ;
61
75
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
+ */
62
81
typedef struct {
63
82
/* reference context to which memory region belongs */
64
83
opal_common_ucx_ctx_t * ctx ;
@@ -78,6 +97,11 @@ typedef struct {
78
97
opal_tsd_key_t mem_tls_key ;
79
98
} opal_common_ucx_wpmem_t ;
80
99
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
+ */
81
105
typedef struct opal_common_ucx_winfo {
82
106
opal_recursive_mutex_t mutex ;
83
107
volatile int released ;
@@ -96,6 +120,10 @@ typedef struct {
96
120
97
121
typedef void (* opal_common_ucx_user_req_handler_t )(void * request );
98
122
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
+ */
99
127
typedef struct {
100
128
void * ext_req ;
101
129
opal_common_ucx_user_req_handler_t ext_cb ;
0 commit comments