@@ -1270,20 +1270,20 @@ int unifyfs_invoke_broadcast_extents_cache(int gfid)
12701270 hg_id_t op_hgid = unifyfsd_rpc_context -> rpcs .extent_cache_bcast_id ;
12711271 hg_size_t buf_size = n_extents * sizeof (* extents );
12721272 hg_bulk_t extents_bulk ;
1273- // void* buf = (void*) extents;
1273+ void * buf = (void * ) extents ;
12741274 // MJB TESTING: make a copy to avoid reuse of cache as bulk across
12751275 // concurrent bcasts
1276- void * buf = malloc ((size_t )buf_size );
1277- if (NULL != buf ) {
1278- memcpy (buf , (void * )extents , (size_t )buf_size );
1276+ // void* buf = malloc((size_t)buf_size);
1277+ // if (NULL != buf) {
1278+ // memcpy(buf, (void*)extents, (size_t)buf_size);
12791279 hg_return_t hret = margo_bulk_create (unifyfsd_rpc_context -> svr_mid , 1 ,
12801280 & buf , & buf_size ,
12811281 HG_BULK_READ_ONLY , & extents_bulk );
12821282 if (hret != HG_SUCCESS ) {
12831283 LOGERR ("margo_bulk_create() failed - %s" ,
12841284 HG_Error_to_string (hret ));
12851285 ret = UNIFYFS_ERROR_MARGO ;
1286- free (buf );
1286+ // free(buf);
12871287 } else {
12881288 coll_request * coll = NULL ;
12891289 extent_cache_bcast_in_t * in = calloc (1 , sizeof (* in ));
@@ -1301,18 +1301,27 @@ int unifyfs_invoke_broadcast_extents_cache(int gfid)
13011301 coll = collective_create (rpc , HG_HANDLE_NULL , op_hgid ,
13021302 glb_pmi_rank , (void * )in , NULL ,
13031303 sizeof (extent_cache_bcast_out_t ),
1304- HG_BULK_NULL , extents_bulk , buf );
1304+ HG_BULK_NULL , extents_bulk , NULL //buf
1305+ );
13051306 if (NULL == coll ) {
13061307 ret = ENOMEM ;
13071308 } else {
1309+ /* start the broadcast */
13081310 ret = collective_forward (coll );
13091311 if (ret == UNIFYFS_SUCCESS ) {
1310- ret = invoke_bcast_progress_rpc (coll );
1312+ /* progress/finish the bcast operation */
1313+ LOGDBG ("BCAST_RPC: bcast progress collective(%p)" ,
1314+ coll );
1315+ ret = collective_finish (coll );
1316+ if (ret != UNIFYFS_SUCCESS ) {
1317+ LOGERR ("finish failed for coll(%p) (rc=%d)" ,
1318+ coll , ret );
1319+ }
13111320 }
13121321 }
13131322 }
13141323 }
1315- }
1324+ // }
13161325
13171326 return ret ;
13181327}
0 commit comments