Skip to content

Commit 9ab6ecb

Browse files
authored
Merge pull request #6492 from janjust/oshmem-multiple-contexts-master
Oshmem multiple contexts
2 parents 53cd31e + 9c3d00b commit 9ab6ecb

File tree

7 files changed

+228
-124
lines changed

7 files changed

+228
-124
lines changed

opal/mca/common/ucx/common_ucx.c

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ void opal_common_ucx_mca_proc_added(void)
153153
#endif
154154
}
155155

156+
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence_nb(int *fenced)
157+
{
158+
return opal_pmix.fence_nb(NULL, 0, opal_common_ucx_mca_fence_complete_cb, (void *)fenced);
159+
}
160+
156161
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker)
157162
{
158163
volatile int fenced = 0;
@@ -182,9 +187,8 @@ static void opal_common_ucx_wait_all_requests(void **reqs, int count, ucp_worker
182187
}
183188
}
184189

185-
OPAL_DECLSPEC int opal_common_ucx_del_procs(opal_common_ucx_del_proc_t *procs, size_t count,
186-
size_t my_rank, size_t max_disconnect, ucp_worker_h worker)
187-
{
190+
OPAL_DECLSPEC int opal_common_ucx_del_procs_nofence(opal_common_ucx_del_proc_t *procs, size_t count,
191+
size_t my_rank, size_t max_disconnect, ucp_worker_h worker) {
188192
size_t num_reqs;
189193
size_t max_reqs;
190194
void *dreq, **dreqs;
@@ -232,10 +236,14 @@ OPAL_DECLSPEC int opal_common_ucx_del_procs(opal_common_ucx_del_proc_t *procs, s
232236
opal_common_ucx_wait_all_requests(dreqs, num_reqs, worker);
233237
free(dreqs);
234238

235-
if (OPAL_SUCCESS != (ret = opal_common_ucx_mca_pmix_fence(worker))) {
236-
return ret;
237-
}
238-
239239
return OPAL_SUCCESS;
240240
}
241241

242+
OPAL_DECLSPEC int opal_common_ucx_del_procs(opal_common_ucx_del_proc_t *procs, size_t count,
243+
size_t my_rank, size_t max_disconnect, ucp_worker_h worker)
244+
{
245+
opal_common_ucx_del_procs_nofence(procs, count, my_rank, max_disconnect, worker);
246+
247+
return opal_common_ucx_mca_pmix_fence(worker);
248+
}
249+

opal/mca/common/ucx/common_ucx.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,11 @@ OPAL_DECLSPEC void opal_common_ucx_mca_deregister(void);
105105
OPAL_DECLSPEC void opal_common_ucx_mca_proc_added(void);
106106
OPAL_DECLSPEC void opal_common_ucx_empty_complete_cb(void *request, ucs_status_t status);
107107
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence(ucp_worker_h worker);
108+
OPAL_DECLSPEC int opal_common_ucx_mca_pmix_fence_nb(int *fenced);
108109
OPAL_DECLSPEC int opal_common_ucx_del_procs(opal_common_ucx_del_proc_t *procs, size_t count,
109110
size_t my_rank, size_t max_disconnect, ucp_worker_h worker);
111+
OPAL_DECLSPEC int opal_common_ucx_del_procs_nofence(opal_common_ucx_del_proc_t *procs, size_t count,
112+
size_t my_rank, size_t max_disconnect, ucp_worker_h worker);
110113
OPAL_DECLSPEC void opal_common_ucx_mca_var_register(const mca_base_component_t *component);
111114

112115
static inline

oshmem/mca/spml/ikrit/spml_ikrit.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ int mca_spml_ikrit_put_simple(void* dst_addr,
149149
void* src_addr,
150150
int dst);
151151

152-
static void mca_spml_ikrit_cache_mkeys(shmem_ctx_t ctx, sshmem_mkey_t *, uint32_t seg, int remote_pe, int tr_id);
152+
static void mca_spml_ikrit_cache_mkeys(sshmem_mkey_t *, uint32_t seg, int remote_pe, int tr_id);
153153

154154
static mxm_mem_key_t *mca_spml_ikrit_get_mkey_slow(int pe, void *va, int ptl_id, void **rva);
155155

@@ -185,7 +185,7 @@ mca_spml_ikrit_t mca_spml_ikrit = {
185185
mca_spml_ikrit_get_mkey_slow
186186
};
187187

188-
static void mca_spml_ikrit_cache_mkeys(shmem_ctx_t ctx, sshmem_mkey_t *mkey, uint32_t seg, int dst_pe, int tr_id)
188+
static void mca_spml_ikrit_cache_mkeys(sshmem_mkey_t *mkey, uint32_t seg, int dst_pe, int tr_id)
189189
{
190190
mxm_peer_t *peer;
191191

@@ -504,7 +504,7 @@ sshmem_mkey_t *mca_spml_ikrit_register(void* addr,
504504
my_rank, i, addr, (unsigned long long)size,
505505
mca_spml_base_mkey2str(&mkeys[i]));
506506

507-
mca_spml_ikrit_cache_mkeys(NULL, &mkeys[i], memheap_find_segnum(addr), my_rank, i);
507+
mca_spml_ikrit_cache_mkeys(&mkeys[i], memheap_find_segnum(addr), my_rank, i);
508508
}
509509
*count = MXM_PTL_LAST;
510510

@@ -548,7 +548,7 @@ int mca_spml_ikrit_deregister(sshmem_mkey_t *mkeys)
548548

549549
}
550550

551-
int mca_spml_ikrit_oob_get_mkeys(shmem_ctx_t ctx, int pe, uint32_t seg, sshmem_mkey_t *mkeys)
551+
int mca_spml_ikrit_oob_get_mkeys(int pe, uint32_t seg, sshmem_mkey_t *mkeys)
552552
{
553553
int ptl;
554554

@@ -567,7 +567,7 @@ int mca_spml_ikrit_oob_get_mkeys(shmem_ctx_t ctx, int pe, uint32_t seg, sshmem_m
567567
mkeys[ptl].len = 0;
568568
mkeys[ptl].va_base = mca_memheap_seg2base_va(seg);
569569
mkeys[ptl].u.key = MAP_SEGMENT_SHM_INVALID;
570-
mca_spml_ikrit_cache_mkeys(NULL, &mkeys[ptl], seg, pe, ptl);
570+
mca_spml_ikrit_cache_mkeys(&mkeys[ptl], seg, pe, ptl);
571571
return OSHMEM_SUCCESS;
572572
}
573573

oshmem/mca/spml/ikrit/spml_ikrit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ extern sshmem_mkey_t *mca_spml_ikrit_register(void* addr,
182182
uint64_t shmid,
183183
int *count);
184184
extern int mca_spml_ikrit_deregister(sshmem_mkey_t *mkeys);
185-
extern int mca_spml_ikrit_oob_get_mkeys(shmem_ctx_t ctx, int pe,
185+
extern int mca_spml_ikrit_oob_get_mkeys(int pe,
186186
uint32_t segno,
187187
sshmem_mkey_t *mkeys);
188188

0 commit comments

Comments
 (0)