-
Notifications
You must be signed in to change notification settings - Fork 849
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
MPI Point-to-Point Refactoring + New Periodic BC Implementation #652
Conversation
…be generalized to all solvers and parallelization should be improved.
…sors, and eigenvalues. Both Euler and N-S operational. Fixed multiple bugs.
This PR is ready from my point of view. All periodic / turbomachinery meshes and regressions have been updated (thanks @salvovitale), and I can confirm they converge with the new periodic implementation. Only a few other regression tests needed to be updated due to the refactoring of the MPI, but they were very minor. If the tests pass, then I recommend we merge very soon. Any final comments or reviews are most welcome. |
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.
LGTM, @economon, thanks so much for this great effort. Really looking forward to that follow-up PR that will remove all the Set_MPI_*** routines.
Practical aspect: @economon @pcarruscag let me know how you want to handle merging this and #653, as they are both ready to go in but there will be some small conflicts.
@EduardoMolina : Nice results! Thanks for the comments. You are seeing more warnings bc I did in fact change the tolerance that controls the warning. But, note that this tolerance only controls when to print the warnings, so the matches should have still be the same (nearest neighbor after transformation). The reason is that the new implementation assumes a 1-to-1 matching of the nodes and surface elements on either side of the periodic face. To be consistent, the points/faces on either side should match exactly so that they can be summed into a complete dual control volume (this assumption is made in the implementation and the partial residuals are summed as such). Nice catch on the fem_solver check. I will add that to the conditional. Thanks for the review @rsanfer. I will submit the final version shortly and if the tests pass, I would propose we merge this one first, if alright with @pcarruscag (the reason being that I would likely need your help to update the implementation for templating in the end anyway :) ). |
Thanks for the input, everyone. Time to finally merge this one. @pcarruscag : let's finish up #653 as a next step and get that merged asap. I can help fix up any conflicts in the matrix classes. |
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.
A bit late to the party, I guess...
I thought i better submit that now instead of not submitting at all.
Most of it is quite pedantic.
Common/include/config_structure.hpp
Outdated
@@ -144,6 +144,7 @@ class CConfig { | |||
Sens_Remove_Sharp, /*!< \brief Flag for removing or not the sharp edges from the sensitivity computation. */ | |||
Hold_GridFixed, /*!< \brief Flag hold fixed some part of the mesh during the deformation. */ | |||
Axisymmetric, /*!< \brief Flag for axisymmetric calculations */ | |||
TaylorGreen, |
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.
Description missing
Common/include/config_structure.hpp
Outdated
@@ -5986,6 +5987,8 @@ class CConfig { | |||
*/ | |||
bool GetAxisymmetric(void); | |||
|
|||
bool GetTaylorGreen(void); |
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.
Description missing + indentation
bool Domain, /*!< \brief Indicates if a point must be computed or belong to another boundary */ | ||
Boundary, /*!< \brief To see if a point belong to the boundary (including MPI). */ | ||
PhysicalBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ | ||
SolidBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ | ||
SolidBoundary, /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ |
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.
Copied description.
including instead includin.
Difference between solid and physical not clear to me.
@@ -380,7 +421,86 @@ class CGeometry { | |||
* \brief Destructor of the class. | |||
*/ | |||
virtual ~CGeometry(void); | |||
|
|||
/*! |
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.
2x brief, not sure if that has a meaning within doxygen?
@@ -715,6 +835,12 @@ class CGeometry { | |||
*/ | |||
virtual void MatchInterface(CConfig *config); | |||
|
|||
/*! | |||
* \brief A virtual member. | |||
* \param[in] config - Definition of the particular problem. |
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.
Missing input val_periodic. Can be copied from the non-virtual MatchPeriodic from l. 2119
* \param[in] config - Definition of the particular problem. | ||
* \param[in] val_periodic - Index of the first periodic face in a pair. | ||
*/ | ||
void MatchPeriodic(CConfig *config, unsigned short val_periodic); |
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.
Input parameters as a list
@@ -191,10 +191,11 @@ class CSysSolve { | |||
* \param[in] tol - tolerance with which to solve the system | |||
* \param[in] m - maximum size of the search subspace | |||
* \param[in] monitoring - turn on priting residuals from solver to screen. | |||
* \param[in] config - Definition of the particular problem. | |||
*/ | |||
unsigned long CG_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, |
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.
Input parameters as a list
@@ -206,10 +207,11 @@ class CSysSolve { | |||
* \param[in] m - maximum size of the search subspace | |||
* \param[in] residual | |||
* \param[in] monitoring - turn on priting residuals from solver to screen. | |||
* \param[in] config - Definition of the particular problem. | |||
*/ | |||
unsigned long FGMRES_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, |
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.
Input parameters as a list
@@ -221,10 +223,11 @@ class CSysSolve { | |||
* \param[in] m - maximum size of the search subspace | |||
* \param[in] residual | |||
* \param[in] monitoring - turn on priting residuals from solver to screen. | |||
* \param[in] config - Definition of the particular problem. | |||
*/ | |||
unsigned long BCGSTAB_LinSolver(const CSysVector & b, CSysVector & x, CMatrixVectorProduct & mat_vec, |
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.
Input parameters as a list
@@ -57,7 +57,7 @@ vector<double> GEMM_Profile_MaxTime; /*!< \brief Maximum time spent for thi | |||
#include "../include/ad_structure.hpp" | |||
#include "../include/toolboxes/printing_toolbox.hpp" | |||
|
|||
CConfig::CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_nDim, unsigned short verb_level) { | |||
CConfig::CConfig(char case_filename[MAX_STRING_SIZE], unsigned short val_software, unsigned short val_iZone, unsigned short val_nZone, unsigned short val_nDim, bool verb_high) { |
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.
Input parameters as a list
Proposed Changes
Give a brief overview of your contribution here in a few sentences.
This is one for v7 and needs some testing. This PR contains a complete refactoring of the point-to-point MPI infrastructure and an entirely new implementation of the periodic BC for the FV solvers.
For the MPI refactoring:
For the periodic BC:
In a follow-up PR, I will remove many lines of code that are no longer needed (all Set_MPI_* routines, many outdated geometry routines, etc.)
Related Work
Resolve any issues (bug fix or feature request), note any related PRs, or mention interactions with the work of others, if any.
I could use some help with testing this one, in particular the rotational periodicity, which might still need some changes. Unfortunately, I do not have the original meshes for the periodic cases in the repo that are failing (other than Poiseuille)..@salvovitale @LaSerpe @arubino: do you have the original grids for the periodic cases before adding the halos with SU2_MSH? I would like to make sure that everything is working ok for all previous capability.All periodic meshes in the regressions have been updated for the new periodic BC, and a python script has been added to remove halo cells from old meshes that were preprocessed with SU2_MSH for the previous periodic BC implementation.
Resolves #550
Resolves #431
Resolves #416
Resolves #252
PR Checklist
Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.