-
Notifications
You must be signed in to change notification settings - Fork 563
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
Seacas, Tpetra: fix warning-free build #13192
Conversation
You seem to have created a PR on master. This is not allowed behavior, so we've blocked your PR. Please switch your PR to target the develop branch and remove the AT: WIP label. |
TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC | ||
(numExportLIDs != numPacketsPerLID.extent (0), std::runtime_error, | ||
(numExportLIDs != numPacketsPerLID_extent, std::runtime_error, |
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.
Just out of curiosity, what was the warning here? It looks like it was comparing one extent with another, so they should have both been size_t
...
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.
After I changed the type of numExportLIDs to be const LO
I got the following error:
projects/albany/nightlyCDashTrilinosBlake/repos-gcc/Trilinos/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp:5807:42: error: no match for call to '(Kokkos::DualView<long unsigned int*, Kokkos::Device<Kokkos::Serial, Kokkos::HostSpace>, void, void>) (int)'
5807 | (numExportLIDs != numPacketsPerLID(0), std::runtime_error,
| ~~~~~~~~~~~~~~~~^~~
/projects/albany/nightlyCDashTrilinosBlake/repos-gcc/Trilinos/packages/teuchos/core/src/Teuchos_TestForException.hpp:180:33: note: in definition of macro 'TEUCHOS_TEST_FOR_EXCEPTION'
180 | const bool throw_exception = (throw_exception_test); \
| ^~~~~~~~~~~~~~~~~~~~
/projects/albany/nightlyCDashTrilinosBlake/repos-gcc/Trilinos/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp:5806:5: note: in expansion of macro 'TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC'
5806 | TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC
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.
I assume that should say (numExportLIDs != numPacketsPerLID.extent(0)
and generate a -Wsign-compare, not this error?
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.
Sorry, in my hasty attempt to manually revert my change, I reverted it incorrectly. The actual error is a sign comparison issue, yes:
/projects/albany/nightlyCDashTrilinosBlake/repos-gcc/Trilinos/packages/tpetra/core/src/Tpetra_CrsGraph_def.hpp:5807:22: error: comparison of integer expressions of different signedness: 'const LO' {aka 'const int'} and 'std::enable_if_t<true, long unsigned int>' {aka 'long unsigned int'} [-Werror=sign-compare]
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.
OK thanks. I would also be OK with just declaring numExportLIDs
to be size_t instead, but it doesn't really matter
@@ -291,10 +291,6 @@ namespace Ioex { | |||
"exodus", filename, Ioss::READ_RESTART, Ioss::ParallelUtils::comm_self(), properties); | |||
Ioss::Region region(dbi, "line_decomp_region"); | |||
|
|||
int status = Ioss::DecompUtils::line_decompose( |
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.
Why are you removing this function call?
For some reason I cannot reply directly to your comment @mperego. I removed int status b/c it is an unused variable within the routine where it appears. |
You can still call the function |
@mperego interesting. How would you fix the unused variable issue in this case? |
The (void) explicitly discards the return value, so that there won't be future warnings about an unused return value |
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.
I didn't pay much attention to the seacase change, thanks @mperego for catching that. I suggested a different change to get rid of the warning.
seacas is snapshotted into trilinos. Anything you commit to trilinos for seacas will eventually just get overwritten by the next snapshot. @gsjaardema will have to bring the changes back to the main seacas repo. |
Doesn't Seacas team incorporate Trilinos changes before sapshotting, like ROL team does? |
Not that I know of. The ROL team is unique in this regard, as their internal repo is a complete fork of trilinos so it is easy to push either way. The other packages usually use a script to copy modified files - it's a one way operation. Maybe this changed recently - @gsjaardema ? |
Thanks for weighing in @rppawlo , @mperego and @brian-kelley . Given the discussion, I think it is probably most expedient to close this PR and to have @gsjaardema and @brian-kelley implement fixes to seacas and tpetra, respectively, as Trilinos developers. @gsjaardema @brian-kelley : would that be OK? I can modify the relevant Trilinos issue which is only about seacas to include tpetra. |
Thank you, @brian-kelley ! |
@@ -291,10 +291,6 @@ namespace Ioex { | |||
"exodus", filename, Ioss::READ_RESTART, Ioss::ParallelUtils::comm_self(), properties); | |||
Ioss::Region region(dbi, "line_decomp_region"); | |||
|
|||
int status = Ioss::DecompUtils::line_decompose( |
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.
The correct fix is to either check the status and report an erorr/warning if needed, or to remove just the int status
part. The function call is needed.
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, I closed my PR b/c there were issues with it. It would be best if you could create a PR with the optimal fix.
Not long ago, a warning-free build of Trilinos broke; see #13168. This PR should fix the problem. The changes are to @trilinos/tpetra and @trilinos/seacas .