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

Where should we put collectives? #142

Open
rogerpearce opened this issue Mar 1, 2023 · 3 comments
Open

Where should we put collectives? #142

rogerpearce opened this issue Mar 1, 2023 · 3 comments

Comments

@rogerpearce
Copy link
Collaborator

rogerpearce commented Mar 1, 2023

@steiltre @bwpriest

Quick discussion point. I want to add a prefix_sum collective and am realizing how many collective helpers we have added to the comm. Do you think we should move this out to keep comm from getting so cluttered?

Current list that we have in com::

  • all_reduce_sum
  • all_reduce_max
  • all_reduce_min
  • all_reduce

I want to add prefix_sum, but I suspect these will also be very handy in the future:

  • bcast
  • is_same
    • We could shorten the all_reduce_* to just min/max/sum/and/or
  • reduce (w/o the all)

Example usage would be:

{
   #include <ygm/collective.hpp>
   // .....
   size_t sum = ygm::sum(42, comm);
}

EDIT: We could start this by not actually moving the comm::all_reduce* but keeping them and marking them as deprecated and remove later.

@bwpriest
Copy link
Member

bwpriest commented Mar 1, 2023

I like the idea of moving collectives into standalone functions that take a comm as an argument.

@rogerpearce
Copy link
Collaborator Author

rogerpearce commented Mar 1, 2023

OK, I'll start this with prefix_sum and we can later decide when we want to move all_reduce. Lots of code uses all_reduce_sum.

@rogerpearce
Copy link
Collaborator Author

rogerpearce commented Mar 1, 2023

This will require adding a method to get the underlying MPI_Comm from ygm::comm, which is something that @ppete asked me for anyways.

Do we like?

ygm::comm::get_mpi_comm()

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

2 participants