@@ -53,7 +53,7 @@ mca_spml_ucx_t mca_spml_ucx = {
5353 mca_spml_ucx_deregister ,
5454 mca_spml_base_oob_get_mkeys ,
5555 mca_spml_ucx_put ,
56- NULL , // mca_spml_ucx_put_nb,
56+ NULL , /* todo: mca_spml_ucx_put_nb, */
5757 mca_spml_ucx_get ,
5858 mca_spml_ucx_recv ,
5959 mca_spml_ucx_send ,
@@ -174,6 +174,8 @@ static void dump_address(int pe, char *addr, size_t len)
174174#endif
175175}
176176
177+ static char spml_ucx_transport_ids [1 ] = { 0 };
178+
177179int mca_spml_ucx_add_procs (oshmem_proc_t * * procs , size_t nprocs )
178180{
179181 size_t i , n ;
@@ -208,7 +210,6 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs)
208210 /* Get the EP connection requests for all the processes from modex */
209211 for (n = 0 ; n < nprocs ; ++ n ) {
210212 i = (my_rank + n ) % nprocs ;
211- //if (i == my_rank) continue;
212213 dump_address (i , (char * )(wk_raddrs + wk_roffs [i ]), wk_rsizes [i ]);
213214 err = ucp_ep_create (mca_spml_ucx .ucp_worker ,
214215 (ucp_address_t * )(wk_raddrs + wk_roffs [i ]),
@@ -217,6 +218,8 @@ int mca_spml_ucx_add_procs(oshmem_proc_t** procs, size_t nprocs)
217218 SPML_ERROR ("ucp_ep_create failed!!!\n" );
218219 goto error2 ;
219220 }
221+ procs [i ]-> num_transports = 1 ;
222+ procs [i ]-> transport_ids = spml_ucx_transport_ids ;
220223 }
221224
222225 ucp_worker_release_address (mca_spml_ucx .ucp_worker , wk_local_addr );
@@ -377,46 +380,27 @@ int mca_spml_ucx_deregister(sshmem_mkey_t *mkeys)
377380int mca_spml_ucx_get (void * src_addr , size_t size , void * dst_addr , int src )
378381{
379382 void * rva ;
380- sshmem_mkey_t * r_mkey ;
381- ucs_status_t err ;
383+ ucs_status_t status ;
382384 spml_ucx_mkey_t * ucx_mkey ;
383385
384- r_mkey = mca_memheap_base_get_cached_mkey (src , src_addr , 0 , & rva );
385- if (OPAL_UNLIKELY (!r_mkey )) {
386- SPML_ERROR ("pe=%d: %p is not address of shared variable" ,
387- src , src_addr );
388- oshmem_shmem_abort (-1 );
389- return OSHMEM_ERROR ;
390- }
391-
392- ucx_mkey = (spml_ucx_mkey_t * )(r_mkey -> spml_context );
393- err = ucp_get (mca_spml_ucx .ucp_peers [src ].ucp_conn , dst_addr , size ,
394- (uint64_t )rva , ucx_mkey -> rkey );
386+ ucx_mkey = mca_spml_ucx_get_mkey (src , src_addr , & rva );
387+ status = ucp_get (mca_spml_ucx .ucp_peers [src ].ucp_conn , dst_addr , size ,
388+ (uint64_t )rva , ucx_mkey -> rkey );
395389
396- return OPAL_LIKELY ( UCS_OK == err ) ? OSHMEM_SUCCESS : OSHMEM_ERROR ;
390+ return ucx_status_to_oshmem ( status ) ;
397391}
398392
399393int mca_spml_ucx_put (void * dst_addr , size_t size , void * src_addr , int dst )
400394{
401395 void * rva ;
402- sshmem_mkey_t * r_mkey ;
403- ucs_status_t err ;
396+ ucs_status_t status ;
404397 spml_ucx_mkey_t * ucx_mkey ;
405398
406- r_mkey = mca_memheap_base_get_cached_mkey (dst , dst_addr , 0 , & rva );
407- if (OPAL_UNLIKELY (!r_mkey )) {
408- SPML_ERROR ("pe=%d: %p is not address of shared variable" ,
409- dst , dst_addr );
410- oshmem_shmem_abort (-1 );
411- return OSHMEM_ERROR ;
412- }
413-
414- ucx_mkey = (spml_ucx_mkey_t * )(r_mkey -> spml_context );
415-
416- err = ucp_put (mca_spml_ucx .ucp_peers [dst ].ucp_conn , src_addr , size ,
417- (uint64_t )rva , ucx_mkey -> rkey );
399+ ucx_mkey = mca_spml_ucx_get_mkey (dst , dst_addr , & rva );
400+ status = ucp_put (mca_spml_ucx .ucp_peers [dst ].ucp_conn , src_addr , size ,
401+ (uint64_t )rva , ucx_mkey -> rkey );
418402
419- return OPAL_LIKELY ( UCS_OK == err ) ? OSHMEM_SUCCESS : OSHMEM_ERROR ;
403+ return ucx_status_to_oshmem ( status ) ;
420404}
421405
422406int mca_spml_ucx_fence (void )
0 commit comments