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

Seacas, Tpetra: fix warning-free build #13192

Closed
wants to merge 1 commit into from
Closed

Conversation

ikalash
Copy link
Contributor

@ikalash ikalash commented Jul 1, 2024

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 .

@ikalash ikalash requested review from a team as code owners July 1, 2024 22:57
@github-actions github-actions bot added the AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.) label Jul 1, 2024
Copy link

github-actions bot commented Jul 1, 2024

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.

@ikalash ikalash changed the base branch from master to develop July 1, 2024 22:58
TEUCHOS_TEST_FOR_EXCEPTION_CLASS_FUNC
(numExportLIDs != numPacketsPerLID.extent (0), std::runtime_error,
(numExportLIDs != numPacketsPerLID_extent, std::runtime_error,
Copy link
Contributor

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...

Copy link
Contributor Author

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

Copy link
Contributor

@brian-kelley brian-kelley Jul 1, 2024

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?

Copy link
Contributor Author

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]

Copy link
Contributor

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

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?

@ikalash
Copy link
Contributor Author

ikalash commented Jul 2, 2024

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.

@mperego
Copy link
Contributor

mperego commented Jul 2, 2024

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 Ioss::DecompUtils::line_decompose and avoid assigning the return value to status.
I don't know what that function does but you are likely changing the behavior of the code if you remove the call.

@ikalash
Copy link
Contributor Author

ikalash commented Jul 2, 2024

@mperego interesting. How would you fix the unused variable issue in this case?

@brian-kelley
Copy link
Contributor

@ikalash

        (void) Ioss::DecompUtils::line_decompose(
            region, m_processorCount, m_decomposition.m_method, m_decomposition.m_decompExtra,
            element_to_proc_global, INT(0));

The (void) explicitly discards the return value, so that there won't be future warnings about an unused return value

Copy link
Contributor

@brian-kelley brian-kelley left a 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.

@rppawlo
Copy link
Contributor

rppawlo commented Jul 2, 2024

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.

@mperego
Copy link
Contributor

mperego commented Jul 2, 2024

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?

@rppawlo
Copy link
Contributor

rppawlo commented Jul 2, 2024

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 ?

@ikalash
Copy link
Contributor Author

ikalash commented Jul 2, 2024

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.

@brian-kelley
Copy link
Contributor

@ikalash I opened #13213 for the Tpetra changes.

@ikalash
Copy link
Contributor Author

ikalash commented Jul 8, 2024

Thank you, @brian-kelley !

@ikalash ikalash closed this Jul 16, 2024
@@ -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(
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants