extern void gasnete_coll_gather_all_pami(gasnet_team_handle_t team, void *dst, void *src, size_t nbytes, int flags GASNETE_THREAD_FARG) { if ((team->pami.geom == PAMI_GEOMETRY_NULL) || !gasnete_use_pami_allga #if GASNET_PAR || (team->multi_images_any && (nbytes > team->pami.scratch_max_nbytes)) #endif ) { /* Use generic implementation for cases we don't (yet) handle, or when disabled */ gasnet_coll_handle_t handle; handle = gasnete_coll_gather_all_nb_default(team,dst,src,nbytes,flags,0 GASNETE_THREAD_PASS); gasnete_coll_wait_sync(handle GASNETE_THREAD_PASS); } else { /* Use PAMI-specific implementation: */ #if GASNET_PAR if (team->multi_images_any) { gasnete_coll_pami_allgavi(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); } else { gasnete_coll_pami_allga(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); } #else gasnete_coll_pami_allga(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); #endif } }
extern void gasnete_coll_gather_allM_pami(gasnet_team_handle_t team, void * const dstlist[], void * const srclist[], size_t nbytes, int flags GASNETE_THREAD_FARG) { if ((team->pami.geom == PAMI_GEOMETRY_NULL) || !gasnete_use_pami_allga #if GASNET_PAR || (team->multi_images_any && (nbytes > team->pami.scratch_max_nbytes)) #endif ) { /* Use generic implementation for cases we don't (yet) handle, or when disabled */ gasnet_coll_handle_t handle; handle = gasnete_coll_gather_allM_nb_default(team,dstlist,srclist,nbytes,flags,0 GASNETE_THREAD_PASS); gasnete_coll_wait_sync(handle GASNETE_THREAD_PASS); } else { /* Use PAMI-specific implementation: */ #if GASNET_PAR const gasnete_coll_threaddata_t * const td = GASNETE_COLL_MYTHREAD_NOALLOC; void * const dst = dstlist[((flags & GASNET_COLL_LOCAL) ? td->my_local_image : td->my_image)]; void * const src = srclist[((flags & GASNET_COLL_LOCAL) ? td->my_local_image : td->my_image)]; if (team->multi_images_any) { gasnete_coll_pami_allgavi(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); } else { gasnete_coll_pami_allga(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); } #else void * const dst = GASNETE_COLL_MY_1ST_IMAGE(team, dstlist, flags); void * const src = GASNETE_COLL_MY_1ST_IMAGE(team, srclist, flags); gasnete_coll_pami_allga(team,dst,src,nbytes,flags GASNETE_THREAD_PASS); #endif } }
extern void gasnete_coll_scatter_pami(gasnet_team_handle_t team, void *dst, gasnet_image_t srcimage, void *src, size_t nbytes, int flags GASNETI_THREAD_FARG) { if ((team->pami.geom == PAMI_GEOMETRY_NULL) || !gasnete_use_pami_scatt #if GASNET_PAR /* TODO: could remove size restriction by segmenting/pipelining */ || (team->multi_images_any && (nbytes > team->pami.scratch_max_nbytes)) #endif ) { /* Use generic implementation for cases we don't (yet) handle, or when disabled */ gasnet_coll_handle_t handle; handle = gasnete_coll_scatter_nb_default(team,dst,srcimage,src,nbytes,flags,0 GASNETI_THREAD_PASS); gasnete_coll_wait_sync(handle GASNETI_THREAD_PASS); } else { /* Use PAMI-specific implementation: */ #if GASNET_PAR if (team->multi_images_any) { gasnete_coll_pami_scattvi(team,dst,srcimage,src,nbytes,flags GASNETI_THREAD_PASS); } else { gasnete_coll_pami_scatt(team,dst,srcimage,src,nbytes,flags GASNETI_THREAD_PASS); } #else gasnete_coll_pami_scatt(team,dst,srcimage,src,nbytes,flags GASNETI_THREAD_PASS); #endif } }