forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 148
Refactor: encapsulate direct MPI_Allreduce calls with Parallel_Reduce consistent wrappers #6860
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
Open
A-006
wants to merge
6
commits into
deepmodeling:develop
Choose a base branch
from
A-006:mpi_gather
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+287
−48
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f1290e9
Refactor: encapsulate MPI_Allreduce with Parallel_Reduce::reduce_all …
A-006 6157da8
Refactor: encapsulate MPI_Allreduce(MPI_IN_PLACE) calls with Parallel…
A-006 97517f1
Refactor: convert Parallel_Reduce to templated API and add MPI guards
A-006 a2e85e4
Refactor: encapsulate MPI_Allreduce with Parallel_Reduce across vario…
A-006 e308494
Refactor: complete MPI encapsulation and fix OMP pragmas for better c…
A-006 3606a66
Fix: implement MPI reductions in depend_mock for parallel tests
A-006 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| #define PW_BASIS_BIG_H | ||
| #include "source_base/constants.h" | ||
| #include "source_base/global_function.h" | ||
| #include "source_base/parallel_reduce.h" | ||
| #ifdef __MPI | ||
| #include "mpi.h" | ||
| #endif | ||
|
|
@@ -167,7 +168,7 @@ class PW_Basis_Big : public PW_Basis_Sup | |
| ibox[1] = 2*n2+1; | ||
| ibox[2] = 2*n3+1; | ||
| #ifdef __MPI | ||
| MPI_Allreduce(MPI_IN_PLACE, ibox, 3, MPI_INT, MPI_MAX , this->pool_world); | ||
| Parallel_Reduce::reduce_max_pool(ibox, 3); | ||
| #endif | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete the #ifdef __MPI and #endif ? |
||
|
|
||
| // Find the minimal FFT box size the factors into the primes (2,3,5,7). | ||
|
|
@@ -350,7 +351,7 @@ class PW_Basis_Big : public PW_Basis_Sup | |
| } | ||
| } | ||
| #ifdef __MPI | ||
| MPI_Allreduce(MPI_IN_PLACE, &this->gridecut_lat, 1, MPI_DOUBLE, MPI_MIN , this->pool_world); | ||
| Parallel_Reduce::reduce_min_pool(this->gridecut_lat); | ||
| #endif | ||
| this->gridecut_lat -= 1e-6; | ||
|
|
||
|
|
||
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
what's the meaning of 'or'?