-
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
Using the primitive variable index classes in more places (+ minor chores) #1476
Conversation
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/ | ||
while (Result.size() < nPointDomain) { |
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.
Reason for the residual changes.
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.
Ok: RCM in practice reorders points/point-ID's such that neighboring points have similar ID's which itself is beneficial for stencil as data for neighboring points is close together in memory which is a good thing for minimizing cache misses.
Now, why would one exclude halo points from the re-ordering? If the reordering is done per process it shouldn't really matter from a naive standpoint ... or it should even be worse considering that the halo point values are not ordered with the rest?
Enlighten me if that can be briefly explained (answer given in Dev-meeting)
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.
-> (from dev meeting) Halo points should be at the end of the point list as a convention.
The disconnected domain parts were the change (as they happen in the CHT pin case where disconnected pin-pieces are treated as 1 zone)
if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, 0, iDim); | ||
|
||
if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, nDim + 1, iDim); | ||
Grad_Temp[iDim] = nodes->GetGradient_Primitive(iPoint, prim_idx.Temperature(), iDim); |
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.
Nice! 👍
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! Thanks!
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.
💐 many good cleanups where hardcoded indexes were used. And good that CONV_CRITERIA is now deprecated
else if (!option_name.compare("CONV_CRITERIA")) | ||
newString.append("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n" | ||
"RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n"); |
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.
Finally 💪 This will definitely hit a few people. I saw quite a few cases where the warning was consequently ignored :) ... I also did bother to change it in some instances (see below 🙈 )
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/ | ||
while (Result.size() < nPointDomain) { |
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.
Ok: RCM in practice reorders points/point-ID's such that neighboring points have similar ID's which itself is beneficial for stencil as data for neighboring points is close together in memory which is a good thing for minimizing cache misses.
Now, why would one exclude halo points from the re-ordering? If the reordering is done per process it shouldn't really matter from a naive standpoint ... or it should even be worse considering that the halo point values are not ordered with the rest?
Enlighten me if that can be briefly explained (answer given in Dev-meeting)
/*--- Move the start of the queue, equivalent to taking from the front of | ||
* the queue and inserting at the end of the result. ---*/ | ||
AddPoint = Result[QueueStart]; | ||
++QueueStart; | ||
|
||
AuxQueue.clear(); | ||
for (auto iNode = 0u; iNode < nodes->GetnPoint(AddPoint); iNode++) { | ||
auto AdjPoint = nodes->GetPoint(AddPoint, iNode); | ||
if ((!inQueue[AdjPoint]) && (AdjPoint < nPointDomain)) { | ||
AuxQueue.push_back(AdjPoint); | ||
/*--- Add all adjacent nodes to the queue in increasing order of their | ||
degree, checking if the element is already in the queue. ---*/ |
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.
inconsistent commenting style (* used/not-used in the 2nd line comment)
Verdict: U n a c c e p t a b l e
for (const auto status : InQueue) { | ||
if (!status) SU2_MPI::Error("RCM ordering failed", CURRENT_FUNCTION); |
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.
👍 for adding a check
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/ | ||
while (Result.size() < nPointDomain) { |
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.
-> (from dev meeting) Halo points should be at the end of the point list as a convention.
The disconnected domain parts were the change (as they happen in the CHT pin case where disconnected pin-pieces are treated as 1 zone)
@@ -82,7 +82,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT | |||
% | |||
% --------------------------- CONVERGENCE PARAMETERS --------------------------% | |||
% | |||
CONV_CRITERIA= RESIDUAL |
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.
Wasn't me - Shaggy, 2000
@@ -55,6 +55,9 @@ class CIncEulerVariable : public CFlowVariable { | |||
inline IndexType ThermalConductivity() const { return nDim+6; } | |||
inline IndexType CpTotal() const { return nDim+7; } | |||
inline IndexType CvTotal() const { return nDim+8; } | |||
|
|||
/*--- For compatible interface with NEMO. ---*/ | |||
inline IndexType Temperature_ve() const { return std::numeric_limits<IndexType>::max(); } |
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.
I need to
#include <limits>
for this to work using gcc/11.1.0 + openmpi/4.1.2. as well as 11.2.0 + 4.0.5. The test-builds pass(ed) so it cannot be a major issue.
This stackoverflow post gives resource that the limits header is used much less widely in gcc11 standard library headers -> requiring to explicitly include it.
And I guess we want to assure foward-compatibility ;)
Cleanup related with #1392