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
Fix SymmetricMatrixCoefficient::ProjectSymmetric
bug
#4271
base: master
Are you sure you want to change the base?
Conversation
I am not sure why the linker was not able to find symbols for arm64 for the checks -- if anyone has any suggestions, please let me know! |
GitHub actions recently started rolling out new runners for macOS jobs which use macOS 14 and Arm64 instances instead of x84_64 for |
This PR is now under review (see the table in the PR description). To help with the review process, please do not force push to the branch. |
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.
Yes, this is a bug for sure, there seems to be confusion between plain Vector
or Memory
wrappers and DenseSymmetricMatrix
, which takes the size of the matrix as an argument of UseExternalData
and not size of the data.
would it make sense to add a small unit test ? |
…Matrix to Constant one
@paul-hilscher:
|
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.
Thanks for the fix and the tests! Great stuff.
@paul-hilscher @najlkin Thank you for your feedback -- if there is anything else to adjust please let me know, otherwise this should be ready to merge into |
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.
Thanks @j-signorelli !
Merged in |
There is a failure with this PR in our regression testing on Lassen (V100 machine) when building optimized + CUDA. The error is below, can you double-check the code?
|
I think the problem might be that |
I'm pretty sure this is because
Probably for a debug GPU build one of the asserts in the type-casts in |
Yes, that would explain why it happens only in this context. I presumed these basic methods are safe, but MFEM can always surprise 😄 . It goes quite far beyond the scope of this PR, so it would be perhaps cleaner to just turn off the device processing and open a separate PR for this. |
It's a (minor) bug fix so I would encourage adding the patch as part of this PR. But I will let the editor @tzanio decide. |
These "distance" methods were meant for small vectors on CPU where the overhead of |
Hmm, I'm still not sure how but in my tests with a CUDA build, the unit tests pass. I'm using a debug build but that should not change the result unless it produces an error from a failed check which it does not. |
It turns out the unit test failure is due to a compiler issue: when using |
I noticed a potential issue when qf.HostWrite(); sometime before the start of the loop over elements, here: Line 812 in 13e1067
|
@j-signorelli what do you think about the discussion and suggestions above ☝️ ? |
The matrix defined for projection of SymmetricMatrixCoefficient onto a QuadratureFunction appears to be of incorrect size.
The current code creates a vdim x vdim matrix, where vdim is the dimension of the QF = height*(height+1)/2.
For wanting to output a symmetric 3x3 tensor (6 values), this then creates a 6x6 matrix instead of a 3x3 one. This PR fixes that.
PR Checklist
make style
.CHANGELOG
:CHANGELOG
to group with other related features?INSTALL
:make
orcmake
have a new target?.github
.appveyor.yml
.gitignore
:make distclean; git status
shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.examples/makefile
:SEQ_EXAMPLES
andPAR_EXAMPLES
variables.clean
target..gitignore
file.examples/CMakeLists.txt
:ALL_EXE_SRCS
variable.THIS_TEST_OPTIONS
is set correctly for the new example.doc/CodeDocumentation.dox
.examples/pumi
), list it indoc/CodeDocumentation.conf.in
src/examples.md
.src/examples.md
andsrc/img
.examples.md
, list the example under the appropriate categories, add new categories if necessary.features.md
.makefile
andmakefile
in corresponding miniapp directory..gitignore
file.CMakeLists.txt
file in theminiapps
directory, if the new miniapp is in a new directory.CMakeLists.txt
file in the new miniapp directory.doc/CodeDocumentation.dox
miniapps/nurbs
), add it toMINIAPP_SUBDIRS
in themakefile
.miniapps/nurbs
), list it indoc/CodeDocumentation.conf.in
src/meshing.md
andsrc/electromagnetics.md
files.src/examples.md
andsrc/img
.features.md
.mfem/web
repo.README
(rare).doc/CodeDocumentation.dox
(rare).make unittest
to make sure all unit tests pass.tests/scripts
.