Skip to content

Conversation

@talbring
Copy link
Member

Proposed Changes

This PR fixes a couple of bugs I found recently. I also adapted the config preprocessing output to reflect the new output and convergence criteria options.

Furthermore it fixes the artifacts mentioned by @TobiKattmann in #774 regarding the Heatflux sensitivity.

Feel free to add any other fixes that you might came across.

Related Work

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.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags).
  • My contribution is commented and consistent with SU2 style.
  • [] I have added a test case that demonstrates my contribution, if necessary.

@TobiKattmann
Copy link
Contributor

@oleburghardt @talbring This PR fixes the multicore heat-flux-sensitivitiy issues. Tested with the tutorial made by ole. Good job

I added a commit that fixes the error-message if you want to have tecplot-binary output but compiled using the --disable-tecio flag. It caused a compile time error ... it is behind a preprocessor statement #ifndef HAVE_TECIO, so this thing is only seen when using the --disable-tecio flag.

* \note Aligned dynamic allocation is disabled for compilation on MAC.
*/
#define REAL_ALLOCATOR(EXTRA) \
#ifndef __APPLE__
Copy link
Member

@pcarruscag pcarruscag Oct 15, 2019

Choose a reason for hiding this comment

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

Addresses the problem reported by @economon in #753

Copy link
Member

Choose a reason for hiding this comment

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

This now build on Mac, but I now see issues with the assert() calls on the first access of one of these containers at the start of the solver

Copy link
Member

Choose a reason for hiding this comment

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

@economon I need more details, I do not have a Mac to go test this myself.

Copy link
Member

Choose a reason for hiding this comment

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

Here's what I am seeing in Xcode (trace on left and assertion failure at bottom). Just let me know what else I can provide to help with this...

Screen Shot 2019-10-16 at 12 12 50 AM

Copy link
Member

Choose a reason for hiding this comment

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

Humm, is this after you updated #790? (I think I recognise the function name) If so that probably means the data is not being allocated. Push your changes and I can have a look directly in #790.

Copy link
Member

Choose a reason for hiding this comment

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

Do note that asserts are disabled when building with ninja unless buildtype=debug.
You may want to define NDEBUG for your optimized builds in Xcode as the cost of those checks is not negligible.

Copy link
Member

Choose a reason for hiding this comment

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

Noted. I typically only build in serial debug mode in Xcode and keep a separate build at the command line in release mode w/ MPI, but I can add flags for this.

Btw, I also noticed that the new C2DContainer class has the assignment operator overloaded to perform a deep copy. Is it possible to do a shallow copy, i.e., just set the pointer of an existing initialized container to an existing one without allocating memory?

Copy link
Member

Choose a reason for hiding this comment

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

With what is implemented it is not possible. If the objective is avoiding the double allocation of gradients, I would suggest using a VectorOfMatrix& that is set to primitive gradient when no allocation is needed, otherwise a different VectorOfMatrix object is resized and the the reference is set to that instead. This way there are no ownership problems (who frees the pointer and so on). References need an initializer but that can be either of the other containers.
If it's for a different purpose I can think of something.

Copy link
Member

Choose a reason for hiding this comment

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

Aok, let me give that a try (yes it is for the gradients). #790 is looking good after merging everything, will be pushing the cleaned version shortly

Copy link
Member

Choose a reason for hiding this comment

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

Looks like the choice of initializer does affect the solution, btw. Looks like the reconstruction gradient vector should use the auxiliary vector's initializer for correctness...

ILU_matrix = new ScalarType [nnz_ilu*nVar*nEqn];
for (iVar = 0; iVar < nnz_ilu*nVar*nEqn; iVar++) ILU_matrix[iVar] = 0.0;

invM = new ScalarType [nPointDomain*nVar*nEqn];
Copy link
Member

Choose a reason for hiding this comment

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

Addresses segfault found by @economon when using ILU with fill-in greater than 0.
Maybe in #790 one of the testcases can be modified to use this feature?

cur_sha_commit = status[1:].split(' ')[0]
if (cur_sha_commit != sha_commit):
print('SHA-1 tag stored in index does not match SHA tag stored in this script.')
sys.exit(1)
Copy link
Member

Choose a reason for hiding this comment

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

Has the index been updated to have these new SHA tags for meson and ninja? I am still debugging #790 upon merging #753 #777 and this #798, and now when I try to build with meson, I get this error. Could be that my local copy still has some issues due to improper merge, or could be that this isn't updated yet

Copy link
Member Author

Choose a reason for hiding this comment

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

Previously the tags in git and in the init.py script where not matching and the error was not thrown because the indentation was wrong ... try git submodule update or deleting meson, ninja, codi, medi in the externals folder.

Copy link
Member

Choose a reason for hiding this comment

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

I continued to have this issue, so I simply reset the stored SHA in the index to the one that you have in init.py. Should be all good. Will be adjusted in #790

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like you changed the version of ninja and meson in your branch. Maybe just make sure to use the newest ones if they work without any problem.

@talbring
Copy link
Member Author

I tried to solve the problem where sometimes the regression tests stall ... it seems to be a problem of openmpi. Changed it to mpich, but then mpi4py has problems. I reverted it for now. We have to live with that problem for a while unfortunately.

/* DESCRIPTION: Number of nonlinear deformation iterations (surface deformation increments) */
addUnsignedLongOption("DEFORM_NONLINEAR_ITER", GridDef_Nonlinear_Iter, 1);
/* DESCRIPTION: Number of smoothing iterations for FEA mesh deformation */
addUnsignedLongOption("DEFORM_LINEAR_ITER", GridDef_Linear_Iter, 1000);
Copy link
Member

Choose a reason for hiding this comment

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

I got rid of this option in favor of the equivalent and more descriptive DEFORM_LINEAR_SOLVER_ITER

@oleburghardt
Copy link
Contributor

oleburghardt commented Oct 25, 2019

@pcarruscag
I added a commit that improves the bad names for the new routines that we discussed #803. They should be more instructional now.
Moreover, at some places (default) function arguments are used instead of different functions, which hides the changes a bit and makes it more elegant.

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.

Hey all, is this still WIP? One could merge this and reopen another various_fixes branch. I find myself and also e.g. #790 tracking this branch rather than develop as it includes fixes I need (which unnecessarily increases diff size to develop for said PR790).

Tests pass and (in serial) are no additional warnings, so from my standpoint this would be good to go

I will address the 2 little points below

if (dist == 0.0) break;
}

Copy link
Contributor

@TobiKattmann TobiKattmann Oct 27, 2019

Choose a reason for hiding this comment

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

trailing whitespace Edit: deleted

/*-- Send donor info --*/
Buffer_Send_FaceIndex = new unsigned long[MaxFace_Donor];
Buffer_Send_FaceNodes = new unsigned long[MaxFaceNodes_Donor];
//Buffer_Send_FaceProc = new unsigned long[MaxFaceNodes_Donor];
Copy link
Contributor

@TobiKattmann TobiKattmann Oct 27, 2019

Choose a reason for hiding this comment

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

Can this line be erased (and 5 lines below again)? Edit: I erased them

Comment on lines +695 to +704
if (Buffer_Receive_GlobalPoint[Global_Point_Donor] != -1){

Coord_j = &Buffer_Receive_Coord[ Global_Point_Donor*nDim];

dist = PointsDistance(Coord_i, Coord_j);

if (dist < mindist) {
mindist = dist; pProcessor = iProcessor;
pGlobalPoint = Buffer_Receive_GlobalPoint[Global_Point_Donor];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks again @talbring @rsanfer (and everyone involved I might not know about) for finding & fixing this bug!

@talbring talbring changed the title [WIP] Various fixes Various fixes Oct 27, 2019
@talbring
Copy link
Member Author

Yep from my side we can merge this in

@oleburghardt
Copy link
Contributor

@TobiKattmann Good idea to eventually just open up another one.

@oleburghardt oleburghardt merged commit ac104f8 into develop Oct 28, 2019
@oleburghardt oleburghardt deleted the various_fixes branch October 28, 2019 07:13
@pcarruscag
Copy link
Member

pcarruscag commented Oct 28, 2019

And... we broke travis again.
Edit: Ah Tim fixed it already.

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.

6 participants