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

Fixed "fall through" for PR "New PR: Eigen system supports shell matrices" #15324

Merged
merged 2 commits into from
May 21, 2020

Conversation

fdkong
Copy link
Contributor

@fdkong fdkong commented May 20, 2020

/opt/civet/build_0/moose/framework/src/utils/SlepcSupport.C:385:40: error: this statement may fall through [-Werror=implicit-fallthrough=]
  385 |       solver_params._eigen_matrix_free = true;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/opt/civet/build_0/moose/framework/src/utils/SlepcSupport.C:387:5: note: here
  387 |     case Moose::EST_NEWTON:
      |     ^~~~
cc1plus: all warnings being treated as errors

We changed APIs in #15315, and we need to reserve the old APIs for Griffin for a second.

I will go to update Griffin to use new APIs. Once that is done, we could remove the old APIs.

Refs #15315

/opt/civet/build_0/moose/framework/src/utils/SlepcSupport.C:385:40: error: this statement may fall through [-Werror=implicit-fallthrough=]
  385 |       solver_params._eigen_matrix_free = true;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/opt/civet/build_0/moose/framework/src/utils/SlepcSupport.C:387:5: note: here
  387 |     case Moose::EST_NEWTON:
      |     ^~~~
cc1plus: all warnings being treated as errors

We changed APIs in  idaholab#15315, and we need to reserve the old APIs for Griffin for a second.

I will go to update Griffin to use new APIs. Once that is done, we could remove the old APIs.

Refs idaholab#15315
@fdkong fdkong changed the title Fixed "fall through" for PR #15315 Fixed "fall through" for PR "New PR: Eigen system supports shell matrices" May 20, 2020
@fdkong fdkong requested a review from lindsayad May 20, 2020 17:46
Copy link
Member

@lindsayad lindsayad left a comment

Choose a reason for hiding this comment

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

What target did this fail on? Make sure that it's running on this PR

Comment on lines -268 to 277
case Moose::EST_MF_MONOLITH_NEWTON: // This should be removed once RattleSnake is updated
/* Falls through. */
// This should be removed once Griffin is updated
case Moose::EST_MF_MONOLITH_NEWTON:
Moose::PetscSupport::setSinglePetscOption("-init_eps_monitor_conv");
Moose::PetscSupport::setSinglePetscOption("-init_eps_monitor");
Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_monitor");
Moose::PetscSupport::setSinglePetscOption("-eps_power_ksp_monitor");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_monitor");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_ksp_monitor");
break;
case Moose::EST_NEWTON:
Copy link
Member

Choose a reason for hiding this comment

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

This is an empty case statement; this is fine to "fallthrough" on. The compiler is not warning/erroring about this, is it?

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, case Moose::EST_MF_MONOLITH_NEWTON should be empty in theory since it will take the same thing as case Moose::EST_NEWTON:

But complier is angry at me if I leave case Moose::EST_MF_MONOLITH_NEWTON empty

https://civet.inl.gov/job/530953/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do not need to worry about this code. It will be removed once I get Griffin updated. But we need to get the moose changes in first

Copy link
Member

Choose a reason for hiding this comment

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

the compiler is only warning about the below case; not this one

Copy link
Member

Choose a reason for hiding this comment

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

But since it's temporary, I won't make you update the PR

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, we do not need to worry about this temporary code. I will remove it soon

Comment on lines -384 to 419
case Moose::EST_MF_MONOLITH_NEWTON: // This block should be removed once RattleSnake is updated
// This block (EST_MF_MONOLITH_NEWTON) should be removed once Griffin is updated
// This is used to for API update
case Moose::EST_MF_MONOLITH_NEWTON:
solver_params._eigen_matrix_free = true;
/* Falls through. */
#if !SLEPC_VERSION_LESS_THAN(3, 8, 0) || !PETSC_VERSION_RELEASE
Moose::PetscSupport::setSinglePetscOption("-eps_type", "power");
Moose::PetscSupport::setSinglePetscOption("-eps_power_nonlinear", "1");
Moose::PetscSupport::setSinglePetscOption("-eps_power_update", "1");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_max_it", "1");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_ksp_rtol", "1e-2");
Moose::PetscSupport::setSinglePetscOption(
"-init_eps_max_it", stringify(params.get<unsigned int>("free_power_iterations")));
Moose::PetscSupport::setSinglePetscOption("-eps_target_magnitude", "");
if (solver_params._eigen_matrix_free)
{
Moose::PetscSupport::setSinglePetscOption("-eps_power_snes_mf_operator", "1");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_snes_mf_operator", "1");
}

if (solver_params._customized_pc_for_eigen)
{
Moose::PetscSupport::setSinglePetscOption("-eps_power_pc_type", "moosepc");
Moose::PetscSupport::setSinglePetscOption("-init_eps_power_pc_type", "moosepc");
}
#else
mooseError("Newton-based eigenvalue solver requires SLEPc 3.7.3 or higher");
#endif
break;
case Moose::EST_NEWTON:
Copy link
Member

Choose a reason for hiding this comment

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

Yea, this guy is not empty, so the fallthrough warning/error is valid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see

@fdkong
Copy link
Contributor Author

fdkong commented May 20, 2020

I need to fix this as well. Why PETSc-3.11.4 hates me so much?!

https://civet.inl.gov/job/530947/

@moosebuild
Copy link
Contributor

moosebuild commented May 20, 2020

Job Documentation on 372faa6 wanted to post the following:

View the site here

This comment will be updated on new commits.

@fdkong
Copy link
Contributor Author

fdkong commented May 20, 2020

I can not reproduce the issue.

I keep working on

@fdkong fdkong force-pushed the matrix_free_eigenvalue branch 2 times, most recently from 951e97a to d4e343e Compare May 20, 2020 22:44
@andrsd
Copy link
Contributor

andrsd commented May 21, 2020

Just FYI, the fix for the doco target is already in next, so it is safe to ignore the failure. We need a clean next so that all the fixes get into master and we can continue rolling...

@fdkong
Copy link
Contributor Author

fdkong commented May 21, 2020

Just FYI, the fix for the doco target is already in next, so it is safe to ignore the failure. We need a clean next so that all the fixes get into master and we can continue rolling...

Good to know! Otherwise I can not believe I just broke docs :-)

@moosebuild
Copy link
Contributor

Job Modules debug PETSc alt on 372faa6 : invalidated by @fdkong

Why it takes forever?

@moosebuild
Copy link
Contributor

Job Modules debug PETSc submodule on 372faa6 : invalidated by @fdkong

Why it takes forever?

@moosebuild
Copy link
Contributor

Job Pthreads+OpenMP Test on 372faa6 : invalidated by @fdkong

Why it takes forever?

@fdkong
Copy link
Contributor Author

fdkong commented May 21, 2020

@lindsayad It is ready for review or merge

@lindsayad lindsayad merged commit 1581046 into idaholab:next May 21, 2020
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.

4 participants