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
A bug in advection assemblers #2252
Comments
Hi YiminJin, welcome, and thanks for reporting this! This looks indeed like it could be a bug. We only introduced the multithreading support recently, and apparently this case was not tested. Could you post a minimal case that seems to cause the error? Is it enough to run aspect with -j on one of the discontinuous tests? |
You can add a line "set Use discontinuous composition discretization = true" in /tests/multicomponent_harmonic.prm, and try to run this test with -j. The output on my computer is: -- This is ASPECT, the Advanced Solver for Problems in Earth's ConvecTion.
|
@YiminJin -- thanks for submitting this! I think your diagnosis is exactly correct. In
But then in
In other words, we correctly copy the The bug would have been obvious if we had (correctly) used
The same change has to be made for the other two member variables, obviously. Do you want to try this and whether it fixes the problem? If you are not confident in making the change yourself, then I can take care of it. But it would be nice to have you among our list of developers! |
@bangerth thanks for your detailed solution! I'm a beginner of github and it took me some time to learn to use it. I have submitted a pull-request and fixed the problem there. However, another problem arises when those bugs are fixed. When running ./aspect -j $PATH_TO_TESTS/discontinuous_composition_1.prm on my computer, it prints: -- This is ASPECT, the Advanced Solver for Problems in Earth's ConvecTion.
|
fix bug described in [issue #2252]
You did everything right, I think the problem is that PETSc reads parameters from your ASPECT command line and tries to interpret them (even if you do not use it). Could you check if the warning disappears if you apply the attached patch to main.cc? It essentially just filters out all of the ASPECT command line options before initializing PETSc. |
@gassmoeller thank you! The patch works and the warnings disappear now. |
Great, then I will open a pull request with that patch later. |
Can this issue be closed? |
I believe that I have found a bug in assemblers of advection fields across all versions of ASPECT.
In struct internal::Assembly::Scratch::AdvectionSystem, there are pointers of FEFaceValues and FESubfaceValues, which will be newed by the constructor if discontinuous Galerkin method is chosen to solve the advection system. However, the copy constructor copies the pointer rather than FEFaceValues itself to the new object. So if the user use multi-threads, there will be several threads visiting the same auxiliary arrays in FEFaceValues at the same time, which will lead to mistake.
Since FEFaceValues cannot be copied, I think the correct way is to new a same one in the copy constructor.
Please let me know if it is really a bug, or I've made something wrong.
Thank you very much!
The text was updated successfully, but these errors were encountered: