Skip to content

Conversation

@mikesoehner
Copy link

Description

Implemented persistent communication class. This class can also be used to replace most of the already present collective communication in the code.

Related Pull Requests

  • #PR

Resolved Issues

  • #Issue

How Has This Been Tested?

Tested with Spinodal Decomposition example and unit tests.

mikesoehner and others added 21 commits May 29, 2024 13:35
Where possible an ifdef was added. So, depending
on the cmake flag for ENABLE_PERSISTENT, the code
is compiled differently.
Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
…onfig

Move cmake configuration for persistent collectives into the mpi module
This updated wrapper has an improved interface
and is more compact due to the environment class
being internal.
This function does not clear the forces in the SoA
structure.
Copy link
Member

@FG-TUM FG-TUM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive template magic :D

Can you explain in the main text of the PR why all of this is "just" behind an ifdef and why we can't simply get rid of the old communicator class?

Previously it was named Coll_Comm_Obj, but most of
ls1 follows camel case, so the name was adjusted.
The CollectiveCommunicationPersistent.h and
CollectiveCommunicationPersistent_helper.h will now always be included,
if ENABLE_MPI is set. This was done to get rid of the ifdef-endif blocks
enclosing all collective communication calls. The ENABLE_PERSISTENT was
moved inside the CollCommObj class to determine if a persistent
collective communication call is to be used.
The implementation of CollCommObj also changed because of that. Now the
persistent collective and the normal collective functions share
exactly the same interface with the only difference being the
ENABLE_PERSISTENT determining which is used. The new communicate()
functions now start all types of collective communication, therefore is
it no longer possible to omit the collective function type at
construction and give it during communication.
The function now returns a tuple of the received data. This change makes
it obvious that data is returned from this function. Another advantage
is that with structured bindings (C++ 17) the returned tuple can be used
to declare the variables into which the tuple values should be copied
(see docu in CollectiveCommunicationPersistent.h for more detail).
This was done to match the style of the rest of the code.
The Deallocator class was replaced with the MPI_Environment class which
wraps the MPI_Init, MPI_Init_thread and MPI_Finalize functions. This new
approach to control the destruction of the static data members is more
concise than the previous approach.
mikesoehner and others added 5 commits January 29, 2025 14:02
These functions were used to create a CollCommObj, but make little
sense to use. So, they were removed.
The template argument was not necessary for the template deductions and
was replaced with a normal constructor argument. The mutex data member
was also removed.
Update to the documentation concerning recent commits. The code
formatting was also updated to be in line with javadoc style and the
rest of the code.
numMolecules = domainDecomp->collCommGetUnsLong();
rotDOF = domainDecomp->collCommGetUnsLong();
domainDecomp->collCommFinalize();
auto collComm = makeCollCommObjAllreduceAdd(domainDecomp->getCommunicator(), summv2, sumIw2, numMolecules, rotDOF);

Check notice

Code scanning / CodeQL

Declaration hides variable Note

Variable collComm hides another variable of the same name (on
line 175
).
for(int d=0; d < 3; d++) sigv[d] = domainDecomp->collCommGetDouble();
domainDecomp->collCommFinalize();

auto collComm = makeCollCommObjAllreduceAdd(domainDecomp->getCommunicator(), sigv[0], sigv[1], sigv[2]);

Check notice

Code scanning / CodeQL

Declaration hides variable Note

Variable collComm hides another variable of the same name (on
line 175
).
Variable collComm hides another variable of the same name (on
line 215
).
mikesoehner and others added 7 commits February 14, 2025 14:07
This should get rid an error occurring with the
static variables.
Added a fake getCommunicator function in DomainDecompBase.h. Added
a FakeCollCommObj which does nothing but satisfies the interface of the
non-fake object. Also added creation functions for the fake object that
match the non-fake ones.
Previously the MPI communicator was stored as a separate member, but it
is now part of the MPI_Members member. This was done because it makes
code clearer to store members with similar usage together. There was a
check added to the CollCommObj constructor that checks, if the given
communicator has been changed (this is especially important to pass all
tests). The MPI_Members members has been reverted to a pointer. This was
done to fix the MPI_x_free after MPI_Finalize issue.
# Conflicts:
#	tools/gui/generators/CubicGridGenerator.cpp
#	tools/gui/generators/RayleighTaylorGenerator.cpp
Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
cniethammer
cniethammer previously approved these changes Feb 25, 2025
Copy link
Contributor

@cniethammer cniethammer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor suggestions to be included.

LGTM

Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
mikesoehner and others added 9 commits February 25, 2025 16:20
Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
Co-authored-by: Christoph Niethammer <cniethammer@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants