Skip to content
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

Merged
merged 11 commits into from
Dec 31, 2021

Conversation

pcarruscag
Copy link
Member

Cleanup related with #1392

@pcarruscag pcarruscag changed the title Using the primitive variable index classes in more places Using the primitive variable index classes in more places (+ minor chores) Dec 25, 2021
Comment on lines +4770 to +4771
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/
while (Result.size() < nPointDomain) {
Copy link
Member Author

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.

Copy link
Contributor

@TobiKattmann TobiKattmann Jan 5, 2022

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)

Copy link
Contributor

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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! 👍

Copy link
Contributor

@WallyMaier WallyMaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@pcarruscag pcarruscag merged commit 9efe761 into develop Dec 31, 2021
@pcarruscag pcarruscag deleted the solver_index_cleanup branch December 31, 2021 16:02
Copy link
Contributor

@TobiKattmann TobiKattmann left a 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

Comment on lines +2953 to +2955
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");
Copy link
Contributor

@TobiKattmann TobiKattmann Jan 5, 2022

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 🙈 )

Comment on lines +4770 to +4771
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/
while (Result.size() < nPointDomain) {
Copy link
Contributor

@TobiKattmann TobiKattmann Jan 5, 2022

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)

Comment on lines +4795 to +4801
/*--- 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. ---*/
Copy link
Contributor

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

Comment on lines +4824 to +4825
for (const auto status : InQueue) {
if (!status) SU2_MPI::Error("RCM ordering failed", CURRENT_FUNCTION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for adding a check

Comment on lines +4770 to +4771
/*--- Repeat as many times as necessary to handle disconnected graphs. ---*/
while (Result.size() < nPointDomain) {
Copy link
Contributor

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
Copy link
Contributor

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(); }
Copy link
Contributor

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The NS continuous adjoint solver tries to load a restart even with RESTART_SOL = NO
3 participants