Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions ompi/mca/pml/ucx/pml_ucx.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ int mca_pml_ucx_close(void)

int mca_pml_ucx_init(void)
{
ucp_worker_params_t params;
ucs_status_t status;
int rc;

Expand All @@ -203,7 +204,10 @@ int mca_pml_ucx_init(void)
}

/* TODO check MPI thread mode */
status = ucp_worker_create(ompi_pml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
params.thread_mode = UCS_THREAD_MODE_SINGLE;

status = ucp_worker_create(ompi_pml_ucx.ucp_context, &params,
&ompi_pml_ucx.ucp_worker);
if (UCS_OK != status) {
return OMPI_ERROR;
Expand Down Expand Up @@ -257,6 +261,7 @@ int mca_pml_ucx_cleanup(void)

int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
{
ucp_ep_params_t ep_params;
ucp_address_t *address;
ucs_status_t status;
ompi_proc_t *proc;
Expand Down Expand Up @@ -287,7 +292,11 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
}

PML_UCX_VERBOSE(2, "connecting to proc. %d", proc->proc_name.vpid);
status = ucp_ep_create(ompi_pml_ucx.ucp_worker, address, &ep);

ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
ep_params.address = address;

status = ucp_ep_create(ompi_pml_ucx.ucp_worker, &ep_params, &ep);
free(address);

if (UCS_OK != status) {
Expand Down
21 changes: 16 additions & 5 deletions oshmem/mca/spml/ucx/spml_ucx.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs)
size_t wk_addr_len;
int *wk_roffs, *wk_rsizes;
char *wk_raddrs;
ucp_ep_params_t ep_params;


mca_spml_ucx.ucp_peers = (ucp_peer_t *) calloc(nprocs, sizeof(*(mca_spml_ucx.ucp_peers)));
Expand All @@ -277,9 +278,13 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs)
for (n = 0; n < nprocs; ++n) {
i = (my_rank + n) % nprocs;
dump_address(i, (char *)(wk_raddrs + wk_roffs[i]), wk_rsizes[i]);

ep_params.field_mask = UCP_EP_PARAM_FIELD_REMOTE_ADDRESS;
ep_params.address = (ucp_address_t *)(wk_raddrs + wk_roffs[i]);

err = ucp_ep_create(mca_spml_ucx.ucp_worker,
(ucp_address_t *)(wk_raddrs + wk_roffs[i]),
&mca_spml_ucx.ucp_peers[i].ucp_conn);
&ep_params,
&mca_spml_ucx.ucp_peers[i].ucp_conn);
if (UCS_OK != err) {
SPML_ERROR("ucp_ep_create failed!!!\n");
goto error2;
Expand Down Expand Up @@ -367,6 +372,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
ucs_status_t err;
spml_ucx_mkey_t *ucx_mkey;
size_t len;
ucp_mem_map_params_t mem_map_params;

*count = 0;
mkeys = (sshmem_mkey_t *) calloc(1, sizeof(*mkeys));
Expand All @@ -380,8 +386,13 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
}

mkeys[0].spml_context = ucx_mkey;
err = ucp_mem_map(mca_spml_ucx.ucp_context,
&addr, size, 0, &ucx_mkey->mem_h);

mem_map_params.field_mask = UCP_MEM_MAP_PARAM_FIELD_ADDRESS |
UCP_MEM_MAP_PARAM_FIELD_LENGTH;
mem_map_params.address = addr;
mem_map_params.length = size;

err = ucp_mem_map(mca_spml_ucx.ucp_context, &mem_map_params, &ucx_mkey->mem_h);
if (UCS_OK != err) {
goto error_out1;
}
Expand All @@ -407,7 +418,7 @@ sshmem_mkey_t *mca_spml_ucx_register(void* addr,
}

mkeys[0].len = len;
mkeys[0].va_base = addr;
mkeys[0].va_base = mem_map_params.address;
*count = 1;
return mkeys;

Expand Down
6 changes: 5 additions & 1 deletion oshmem/mca/spml/ucx/spml_ucx_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,13 @@ static int mca_spml_ucx_component_close(void)

static int spml_ucx_init(void)
{
ucp_worker_params_t params;
ucs_status_t err;

err = ucp_worker_create(mca_spml_ucx.ucp_context, UCS_THREAD_MODE_SINGLE,
params.field_mask = UCP_WORKER_PARAM_FIELD_THREAD_MODE;
params.thread_mode = UCS_THREAD_MODE_SINGLE;

err = ucp_worker_create(mca_spml_ucx.ucp_context, &params,
&mca_spml_ucx.ucp_worker);
if (UCS_OK != err) {
return OSHMEM_ERROR;
Expand Down