Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GA_Sync should call ARMCI_Barrier when possible #325

Open
jeffhammond opened this issue May 31, 2024 · 0 comments
Open

GA_Sync should call ARMCI_Barrier when possible #325

jeffhammond opened this issue May 31, 2024 · 0 comments
Assignees

Comments

@jeffhammond
Copy link
Member

GA_Sync is equivalent to ARMCI_Barrier on the world group. One can optimize ARMCI_Barrier better than ARMCI_AllFence + pnga_msg_sync.

We should also add ARMCI_GroupBarrier that is equivalent to ARMCI_GroupFence + pnga_msg_pgroup_sync.

void pnga_sync()
{
  GA_Internal_Threadsafe_Lock();
#ifdef CHECK_MA
  Integer status;
#endif

#ifdef USE_ARMCI_GROUP_FENCE
  if (GA_Default_Proc_Group == -1) {
    int grp_id = (int)GA_Default_Proc_Group;
    ARMCI_GroupFence(&grp_id);
    pnga_msg_sync();
  } else {
    int grp_id = (Integer)GA_Default_Proc_Group;
    pnga_pgroup_sync(grp_id);
  }
#else
  if (GA_Default_Proc_Group == -1) {
    ARMCI_AllFence(); // HERE
    pnga_msg_sync();
    if(GA_fence_set)bzero(fence_array,(int)GAnproc);
    GA_fence_set=0;
  } else {
    Integer grp_id = (Integer)GA_Default_Proc_Group;
    pnga_pgroup_sync(grp_id);
  }
#endif
#ifdef CHECK_MA
  status = MA_verify_allocator_stuff();
#endif
  GA_Internal_Threadsafe_Unlock();
}
@jeffhammond jeffhammond self-assigned this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant