added Scatter and Gather implementations in PLUMED Communicator#1381
Open
aalhossary wants to merge 2 commits intoplumed:masterfrom
Open
added Scatter and Gather implementations in PLUMED Communicator#1381aalhossary wants to merge 2 commits intoplumed:masterfrom
aalhossary wants to merge 2 commits intoplumed:masterfrom
Conversation
Member
|
thanks for your contribution! Can you also add regtets? I guess the correct places are:
It should be as simple as:
Note that test number 7 uses asserts, whereas test number 2 writes on a file. The second approach is a bit better, because in case of multiple functions it allows to see that only one failed. The first approach will just crash. Please follow the convention in the respective file. Thanks again! |
- Added Scatter/Gather tests to rt-make-2 (MPI version) - Added Scatter/Gather tests to rt-make-7 (non-MPI version) - Updated reference output files
Iximiel
reviewed
Mar 20, 2026
| reset(comm,a); | ||
| std::vector<int> gather_send(4); | ||
| std::vector<int> gather_recv(4*comm.Get_size(),0); | ||
| for(unsigned i=0;i<gather_send.size();i++) gather_send[i]=(i+1)*(comm.Get_rank()+1); |
Member
There was a problem hiding this comment.
Please make more clear who is sending the data and break some line, like this:
Suggested change
| for(unsigned i=0;i<gather_send.size();i++) gather_send[i]=(i+1)*(comm.Get_rank()+1); | |
| for(unsigned i=0;i<gather_send.size();i++) { | |
| gather_send[i]=1+i+(comm.Get_rank()+1)*100; | |
| } |
So we expect 101 102 103 104 201 202 203 204 301 302 303 304, and if something is wrong is faster to understand where
If you want you can apply a similar idea also to the scatter test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The MPI Communicator does not have Scatter and Gather implementations (It has AllScatter but not Scatter).
Here is an implementation of them for future use.
I need them in my development.
Type of contribution
Copyright
COPYRIGHTfile with the correct license information. Code should be released under an open source license. I also used the commandcd src && ./header.sh mymodulenamein order to make sure the headers of the module are correct.Tests