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.
Reason for the residual changes.
There was a problem hiding this comment.
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.
-> (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); |
TobiKattmann
left a comment
There was a problem hiding this comment.
💐 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.
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.
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.
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); |
| /*--- Repeat as many times as necessary to handle disconnected graphs. ---*/ | ||
| while (Result.size() < nPointDomain) { |
There was a problem hiding this comment.
-> (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)
| % | ||
| % --------------------------- CONVERGENCE PARAMETERS --------------------------% | ||
| % | ||
| CONV_CRITERIA= RESIDUAL |
There was a problem hiding this comment.
Wasn't me - Shaggy, 2000
| 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.
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