add rocshmem_barrier() (#61)

* add team-barrier implementation

add a team-barrier API and implementation in the IPC and RO conduit.
Clean up some of the logic in the RO Conduit to distinguish between
sync, sync_all, barrier, and barrier_all.

* add team_barrier_tests to functional tests
This commit is contained in:
Edgar Gabriel
2025-03-24 11:23:03 -05:00
committed by GitHub
parent e8ba20c5f5
commit bcbc42e78f
18 changed files with 271 additions and 14 deletions
+2
View File
@@ -61,6 +61,8 @@ class IPCContext : public Context {
__device__ void barrier_all();
__device__ void barrier(rocshmem_team_t team);
__device__ void sync_all();
__device__ void sync(rocshmem_team_t team);
+16
View File
@@ -122,4 +122,20 @@ __device__ void IPCContext::barrier_all() {
__syncthreads();
}
__device__ void IPCContext::barrier(rocshmem_team_t team) {
IPCTeam *team_obj = reinterpret_cast<IPCTeam *>(team);
int pe = team_obj->my_pe_in_world;
int pe_start = team_obj->tinfo_wrt_world->pe_start;
int pe_stride = team_obj->tinfo_wrt_world->stride;
int pe_size = team_obj->num_pes;
long *p_sync = team_obj->barrier_pSync;
if (is_thread_zero_in_block()) {
quiet();
}
internal_sync(pe, pe_start, pe_stride, pe_size, p_sync);
__syncthreads();
}
} // namespace rocshmem