-
Notifications
You must be signed in to change notification settings - Fork 60
Restructuring of MPI classes to support the addition of different communication backends #839
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
Conversation
streeve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great - first round of clarifications/suggestions
I added a CommSpaceType=Mpi template parameter to the relevant functions. |
|
@streeve any updates on this? |
|
@JStewart28 sorry for the delay again - I just fixed conflicts with main (we fixed a serious |
Thanks, @streeve. I fixed the CI errors by editing the struct template <int VLEN, int D1, int D2, int D3>
struct MySoA
{
float m0[D1][D2][D3][VLEN];
int m1[VLEN];
double m2[D1][VLEN];
double m3[D1][D2][VLEN];
KOKKOS_INLINE_FUNCTION
MySoA(){};
};Adding the constructor fixes the Ubuntu/OpenSUSE warnings and adding |
|
Thanks @JStewart28 that's been blocking a few different things - do you mind splitting the CI fix into a separate PR? I built Cabana locally with |
Yes. Opened PR #858. I'll look into the memory error and let you know if I can figure it out. |
|
@streeve can you provide more details about the memory error? The AddressSanitizer is saying there is a double-free, but it says that for any test I run, including tests such as DeepCopy and CartesianGrid. I also get the double-free message if I run the Halo test (or any other test) from the master branch of Cabana. This is on WSL/Windows. |
streeve
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question/potential change and I'm ready to merge!
Sounds like we need to investigate this further, but that we shouldn't block this PR any further |
Classes used for MPI communication have been restructured to support the addition of different communication backends. Mpi is currently the only communication backend. The Mpi backend contains the code already used in Cabana for communication. The restructuring was done as discussed in previous emails.
Changes:
Cabana_CommunicationPlan.hpprenamed toCabana_CommunicationPlanBase.hpp.Cabana::CommSpace::Mpiadded toCabana_CommunicationPlanBase.hpp.CommunicationPlanandCommunicationDatarenamed toCommunicationPlanBaseandCommunicationDataBase.impl/Cabana_CommunicationPlan_{backend_name}.hpp.CommSpace::Mpito maintain backwards compatibility.Cabana_Halo.hpp, theHaloclass is now typed onCommSpaceType, which isCommSpace::Mpiby default. TheGatherandScatterclasses extract theCommSpaceTypefrom theHaloType.GatherandScatterclasses, the correctapplyImplfunction, which performs the gather or scatter operation, is enabled based on the communication space theHalois created in.applyImplfunctions forGatherandScatterare located inimpl/Cabana_Halo_{backend_name}.hpp.Cabana_Distributor.hpp, theDistributorclass is now typed onCommSpaceType, which isCommSpace::Mpiby default.migratefunctions have been moved toImpl::migrateDataandImpl::migrateSlicefunctions. These functions are typed on the communication space theDistributoris created in. Specific implementations are inimpl/Cabana_Migrate_{backend_name}.hpp.CommunicationPlan,Distributor, andHalotests have been modified to support testing all communication backends. Currently,CommSpace::Mpiis the only backend tested. (Because it is the only backend that exists)Cabana_Tags.hppwhere communication backend and import/export type tags are stored.#includesand CMake files have been modified to have the new file names.2.
Cabana_Grid_Halo.hpprenamed toCabana_Grid_HaloBase.hpp.- Base class contains variables and functions needed for all communication backends.
- Classes that implement a specific communication backend are derived from the base class and located in
impl/Cabana_Grid_Halo_{backend_name}.hpp.- The default communication space is
Grid::CommSpace::Mpito maintain backwards compatibility.3. The test frameworks of the
halo2dandhalo3dtests have been modified to support testing all communication backends. Currently,Mpiis the only backend tested. (Because it is the only backend that exists)4. All
#includesand CMake files have been modified to have the new file names.Other notes and questions:
The- Update: See Changes->Core->item vii.CommSpace::Mpitag is declared in bothCoreand inGrid. This may get confusing and there is currently no way to globally define a tag for bothGridandCore. What do you all think?SparseHalohas not been modified to support various backends in this pull request but may be modified in the future.MpiisMpiAdvancewhich implements locality-aware communication.