Skip to content

Commit a4c8527

Browse files
authored
Merge pull request #28817 from lindsayad/petsc-update
Update petsc to 3.22.1-ish (includes some 3.23 features)
2 parents 538d819 + 27b45d9 commit a4c8527

35 files changed

+73
-119
lines changed

apptainer/petsc.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,4 +91,3 @@ From: {{ APPTAINER_FROM }}
9191
%files
9292
{{ MOOSE_DIR }}/scripts/configure_petsc.sh {{ ROOT_BUILD_DIR }}/scripts/configure_petsc.sh
9393
{{ MOOSE_DIR }}/scripts/update_and_rebuild_petsc.sh {{ ROOT_BUILD_DIR }}/scripts/update_and_rebuild_petsc.sh
94-
{{ MOOSE_DIR }}/scripts/tao_restore_viewer.patch {{ ROOT_BUILD_DIR }}/scripts/tao_restore_viewer.patch

conda/libmesh/conda_build_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ mpi:
33
- openmpi
44

55
moose_petsc:
6-
- moose-petsc 3.21.5 mpich_1
7-
- moose-petsc 3.21.5 openmpi_1
6+
- moose-petsc 3.22.1.193.g72c1e49ee3d mpich_0
7+
- moose-petsc 3.22.1.193.g72c1e49ee3d openmpi_0
88

99
moose_libmesh_vtk:
1010
- moose-libmesh-vtk 9.3.0 mpich_4

conda/libmesh/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# As well as any directions pertaining to modifying those files.
66
# ALSO: Follow the directions in scripts/tests/versioner_hashes.yaml
7-
{% set build = 1 %}
7+
{% set build = 2 %}
88
{% set version = "2024.10.17" %}
99

1010
package:

conda/moose-dev/conda_build_config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ mpi:
33
- openmpi
44

55
moose_libmesh:
6-
- moose-libmesh 2024.10.17 mpich_1
7-
- moose-libmesh 2024.10.17 openmpi_1
6+
- moose-libmesh 2024.10.17 mpich_2
7+
- moose-libmesh 2024.10.17 openmpi_2
88

99
moose_wasp:
1010
- moose-wasp 2024.11.13

conda/moose-dev/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# REMEMBER TO UPDATE the .yaml files for the following packages:
33
# moose/conda_build_config.yaml
44
# As well as any directions pertaining to modifying those files.
5-
{% set version = "2024.11.14" %}
5+
{% set version = "2024.11.15" %}
66

77
package:
88
name: moose-dev

conda/moose/conda_build_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mpi:
33
- openmpi
44

55
moose_dev:
6-
- moose-dev 2024.11.14
6+
- moose-dev 2024.11.15
77

88
#### Darwin SDK SYSROOT
99
CONDA_BUILD_SYSROOT: # [osx]

conda/petsc/meta.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#
88
# As well as any directions pertaining to modifying those files.
99
# ALSO: Follow the directions in scripts/tests/versioner_hashes.yaml
10-
{% set build = 1 %}
11-
{% set version = "3.21.5" %}
10+
{% set build = 0 %}
11+
{% set version = "3.22.1.193.g72c1e49ee3d" %}
1212

1313
package:
1414
name: moose-petsc
@@ -20,7 +20,6 @@ source:
2020
- path: ../functions/retry_build.sh
2121
- patches:
2222
- no-cppflags-in-pkgconfig-cflags.patch
23-
- ../../scripts/tao_restore_viewer.patch
2423

2524
build:
2625
number: {{ build }}

framework/doc/packages_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ maximum_python: 3.11
1010
mpich: 4.2.1
1111
openmpi: 4.1.6
1212
petsc_alt: 3.11.4
13-
petsc: 3.21.5
13+
petsc: 3.22.1.193.g72c1e49ee3d
1414
apptainer_rockylinux: 8.8.20230518
1515
apptainer_mpich: 3.4.3
1616
apptainer_gcc: 12.2.1

framework/include/problems/FEProblemBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,9 +2333,9 @@ class FEProblemBase : public SubProblem, public Restartable
23332333
void clearCurrentResidualVectorTags();
23342334

23352335
/**
2336-
* Clear the current Jacobian vector tag data structure ... if someone creates it
2336+
* Clear the current Jacobian matrix tag data structure ... if someone creates it
23372337
*/
2338-
void clearCurrentJacobianVectorTags() {}
2338+
void clearCurrentJacobianMatrixTags() {}
23392339

23402340
using SubProblem::doingPRefinement;
23412341
virtual void doingPRefinement(bool doing_p_refinement,

framework/include/systems/DumpObjectsNonlinearSystem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class DumpObjectsNonlinearSystem : public NonlinearSystemBase
2828

2929
virtual NonlinearSolver<Number> * nonlinearSolver() override { return NULL; }
3030
virtual void solve() override {}
31-
virtual void stopSolve(const ExecFlagType &) override {}
31+
virtual void stopSolve(const ExecFlagType &, const std::set<TagID> &) override {}
3232
virtual bool converged() override { return true; }
3333
virtual NumericVector<Number> & RHS() override { return *_dummy; }
3434
virtual SNES getSNES() override { return nullptr; }

framework/include/systems/LinearSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ class LinearSystem : public SolverSystem, public PerfGraphInterface
5050
/**
5151
* Quit the current solve as soon as possible.
5252
*/
53-
virtual void stopSolve(const ExecFlagType & exec_flag) override;
53+
virtual void stopSolve(const ExecFlagType & exec_flag,
54+
const std::set<TagID> & vector_tags_to_close) override;
5455

5556
/**
5657
* Compute the right hand side and the system matrix of the system for given tags.

framework/include/systems/NonlinearEigenSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class NonlinearEigenSystem : public NonlinearSystemBase
4141
/**
4242
* Quit the current solve as soon as possible.
4343
*/
44-
virtual void stopSolve(const ExecFlagType & exec_flag) override;
44+
virtual void stopSolve(const ExecFlagType & exec_flag,
45+
const std::set<TagID> & vector_tags_to_close) override;
4546

4647
/**
4748
* Returns the current nonlinear iteration number. In libmesh, this is

framework/include/systems/NonlinearSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class NonlinearSystem : public NonlinearSystemBase, public NonlinearImplicitSyst
3737
/**
3838
* Quit the current solve as soon as possible.
3939
*/
40-
virtual void stopSolve(const ExecFlagType & exec_flag) override;
40+
virtual void stopSolve(const ExecFlagType & exec_flag,
41+
const std::set<TagID> & vector_tags_to_close) override;
4142

4243
/**
4344
* Returns the current nonlinear iteration number. In libmesh, this is

framework/include/systems/SolverSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ class SolverSystem : public SystemBase
3636
/**
3737
* Quit the current solve as soon as possible.
3838
*/
39-
virtual void stopSolve(const ExecFlagType & exec_flag) = 0;
39+
virtual void stopSolve(const ExecFlagType & exec_flag,
40+
const std::set<TagID> & vector_tags_to_close) = 0;
4041

4142
/**
4243
* Set the solution to a given vector.

framework/src/problems/EigenProblem.C

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ EigenProblem::computeResidualTag(const NumericVector<Number> & soln,
296296
// specific system tags that we need for this instance
297297
_nl_eigen->disassociateDefaultVectorTags();
298298

299-
// Clear FE tags and first add the specific tag associated with the residual
300-
_fe_vector_tags.clear();
299+
// add the specific tag associated with the residual
300+
mooseAssert(_fe_vector_tags.empty(), "This should be empty indicating a clean starting state");
301301
_fe_vector_tags.insert(tag);
302302

303303
// Add any other user-added vector residual tags if they have associated vectors
@@ -312,6 +312,7 @@ EigenProblem::computeResidualTag(const NumericVector<Number> & soln,
312312

313313
setCurrentNonlinearSystem(_nl_eigen->number());
314314
computeResidualTags(_fe_vector_tags);
315+
_fe_vector_tags.clear();
315316

316317
_nl_eigen->disassociateVectorFromTag(residual, tag);
317318
}
@@ -329,8 +330,8 @@ EigenProblem::computeResidualAB(const NumericVector<Number> & soln,
329330
// specific system tags that we need for this instance
330331
_nl_eigen->disassociateDefaultVectorTags();
331332

332-
// Clear FE tags and first add the specific tags associated with the residual
333-
_fe_vector_tags.clear();
333+
// add the specific tags associated with the residual
334+
mooseAssert(_fe_vector_tags.empty(), "This should be empty indicating a clean starting state");
334335
_fe_vector_tags.insert(tagA);
335336
_fe_vector_tags.insert(tagB);
336337

@@ -346,6 +347,7 @@ EigenProblem::computeResidualAB(const NumericVector<Number> & soln,
346347
_nl_eigen->setSolution(soln);
347348

348349
computeResidualTags(_fe_vector_tags);
350+
_fe_vector_tags.clear();
349351

350352
_nl_eigen->disassociateVectorFromTag(residualA, tagA);
351353
_nl_eigen->disassociateVectorFromTag(residualB, tagB);

framework/src/problems/FEProblemBase.C

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -6265,10 +6265,10 @@ FEProblemBase::checkExceptionAndStopSolve(bool print_message)
62656265
// SNESSetFunctionDomainError() or directly inserting NaNs in the
62666266
// residual vector to let PETSc >= 3.6 return DIVERGED_NANORINF.
62676267
if (_current_nl_sys)
6268-
_current_nl_sys->stopSolve(_current_execute_on_flag);
6268+
_current_nl_sys->stopSolve(_current_execute_on_flag, _fe_vector_tags);
62696269

62706270
if (_current_linear_sys)
6271-
_current_nl_sys->stopSolve(_current_execute_on_flag);
6271+
_current_linear_sys->stopSolve(_current_execute_on_flag, _fe_vector_tags);
62726272

62736273
// and close Aux system (we MUST do this here; see #11525)
62746274
_aux->solution().close();
@@ -6300,8 +6300,9 @@ FEProblemBase::resetState()
63006300
ADReal::do_derivatives = true;
63016301
_current_execute_on_flag = EXEC_NONE;
63026302

6303+
// Clear the VectorTags and MatrixTags
63036304
clearCurrentResidualVectorTags();
6304-
clearCurrentJacobianVectorTags();
6305+
clearCurrentJacobianMatrixTags();
63056306

63066307
_safe_access_tagged_vectors = true;
63076308
_safe_access_tagged_matrices = true;
@@ -6639,54 +6640,35 @@ FEProblemBase::computeResidual(const NumericVector<Number> & soln,
66396640
_current_nl_sys->associateVectorToTag(residual, _current_nl_sys->residualVectorTag());
66406641
const auto & residual_vector_tags = getVectorTags(Moose::VECTOR_TAG_RESIDUAL);
66416642

6643+
mooseAssert(_fe_vector_tags.empty(), "This should be empty indicating a clean starting state");
66426644
// We filter out tags which do not have associated vectors in the current nonlinear
66436645
// system. This is essential to be able to use system-dependent residual tags.
66446646
selectVectorTagsFromSystem(*_current_nl_sys, residual_vector_tags, _fe_vector_tags);
66456647

66466648
computeResidualInternal(soln, residual, _fe_vector_tags);
6649+
_fe_vector_tags.clear();
66476650
}
66486651

66496652
void
66506653
FEProblemBase::computeResidualAndJacobian(const NumericVector<Number> & soln,
66516654
NumericVector<Number> & residual,
66526655
SparseMatrix<Number> & jacobian)
66536656
{
6654-
// vector tags
6655-
{
6656-
_current_nl_sys->associateVectorToTag(residual, _current_nl_sys->residualVectorTag());
6657-
const auto & residual_vector_tags = getVectorTags(Moose::VECTOR_TAG_RESIDUAL);
6658-
6659-
// We filter out tags which do not have associated vectors in the current nonlinear
6660-
// system. This is essential to be able to use system-dependent residual tags.
6661-
selectVectorTagsFromSystem(*_current_nl_sys, residual_vector_tags, _fe_vector_tags);
6662-
6663-
setCurrentResidualVectorTags(_fe_vector_tags);
6664-
}
6665-
6666-
// matrix tags
6667-
{
6668-
_fe_matrix_tags.clear();
6669-
6670-
auto & tags = getMatrixTags();
6671-
for (auto & tag : tags)
6672-
_fe_matrix_tags.insert(tag.second);
6673-
}
6674-
66756657
try
66766658
{
66776659
try
66786660
{
66796661
// vector tags
6680-
{
6681-
_current_nl_sys->associateVectorToTag(residual, _current_nl_sys->residualVectorTag());
6682-
const auto & residual_vector_tags = getVectorTags(Moose::VECTOR_TAG_RESIDUAL);
6662+
_current_nl_sys->associateVectorToTag(residual, _current_nl_sys->residualVectorTag());
6663+
const auto & residual_vector_tags = getVectorTags(Moose::VECTOR_TAG_RESIDUAL);
66836664

6684-
// We filter out tags which do not have associated vectors in the current nonlinear
6685-
// system. This is essential to be able to use system-dependent residual tags.
6686-
selectVectorTagsFromSystem(*_current_nl_sys, residual_vector_tags, _fe_vector_tags);
6665+
mooseAssert(_fe_vector_tags.empty(),
6666+
"This should be empty indicating a clean starting state");
6667+
// We filter out tags which do not have associated vectors in the current nonlinear
6668+
// system. This is essential to be able to use system-dependent residual tags.
6669+
selectVectorTagsFromSystem(*_current_nl_sys, residual_vector_tags, _fe_vector_tags);
66876670

6688-
setCurrentResidualVectorTags(_fe_vector_tags);
6689-
}
6671+
setCurrentResidualVectorTags(_fe_vector_tags);
66906672

66916673
// matrix tags
66926674
{
@@ -6793,6 +6775,8 @@ FEProblemBase::computeResidualAndJacobian(const NumericVector<Number> & soln,
67936775
}
67946776

67956777
resetState();
6778+
_fe_vector_tags.clear();
6779+
_fe_matrix_tags.clear();
67966780
}
67976781

67986782
void

framework/src/systems/LinearSystem.C

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,10 @@ LinearSystem::solve()
281281
}
282282

283283
void
284-
LinearSystem::stopSolve(const ExecFlagType & /*exec_flag*/)
284+
LinearSystem::stopSolve(const ExecFlagType & /*exec_flag*/,
285+
const std::set<TagID> & vector_tags_to_close)
285286
{
286287
// We close the containers in case the solve restarts from a failed iteration
288+
closeTaggedVectors(vector_tags_to_close);
287289
_linear_implicit_system.matrix->close();
288-
_linear_implicit_system.rhs->close();
289-
if (_rhs_time)
290-
_rhs_time->close();
291-
if (_rhs_non_time)
292-
_rhs_non_time->close();
293290
}

framework/src/systems/NonlinearEigenSystem.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ NonlinearEigenSystem::attachSLEPcCallbacks()
385385
}
386386

387387
void
388-
NonlinearEigenSystem::stopSolve(const ExecFlagType &)
388+
NonlinearEigenSystem::stopSolve(const ExecFlagType &, const std::set<TagID> &)
389389
{
390390
mooseError("did not implement yet \n");
391391
}

framework/src/systems/NonlinearSystem.C

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -231,29 +231,22 @@ NonlinearSystem::solve()
231231
}
232232

233233
void
234-
NonlinearSystem::stopSolve(const ExecFlagType & exec_flag)
234+
NonlinearSystem::stopSolve(const ExecFlagType & exec_flag,
235+
const std::set<TagID> & vector_tags_to_close)
235236
{
236237
PetscNonlinearSolver<Real> & solver =
237238
static_cast<PetscNonlinearSolver<Real> &>(*sys().nonlinear_solver);
238239

239240
if (exec_flag == EXEC_LINEAR || exec_flag == EXEC_POSTCHECK)
240241
{
241-
auto ierr = SNESSetFunctionDomainError(solver.snes());
242-
LIBMESH_CHKERR(ierr);
242+
LibmeshPetscCall(SNESSetFunctionDomainError(solver.snes()));
243243

244244
// Clean up by getting vectors into a valid state for a
245-
// (possible) subsequent solve. There may be more than just
246-
// these...
247-
_nl_implicit_sys.rhs->close();
248-
if (_Re_time)
249-
_Re_time->close();
250-
_Re_non_time->close();
245+
// (possible) subsequent solve.
246+
closeTaggedVectors(vector_tags_to_close);
251247
}
252248
else if (exec_flag == EXEC_NONLINEAR)
253-
{
254-
auto ierr = SNESSetJacobianDomainError(solver.snes());
255-
LIBMESH_CHKERR(ierr);
256-
}
249+
LibmeshPetscCall(SNESSetJacobianDomainError(solver.snes()));
257250
else
258251
mooseError("Unsupported execute flag: ", Moose::stringify(exec_flag));
259252
}

modules/porous_flow/test/tests/energy_conservation/heat01.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
type = SMP
6969
full = true
7070
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
71-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
71+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
7272
[]
7373
[]
7474

modules/porous_flow/test/tests/energy_conservation/heat02.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
type = SMP
118118
full = true
119119
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
120-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
120+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
121121
[]
122122
[]
123123

modules/porous_flow/test/tests/mass_conservation/mass01.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
type = SMP
9191
full = true
9292
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
93-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
93+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
9494
[]
9595
[]
9696

modules/porous_flow/test/tests/mass_conservation/mass02.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
type = SMP
108108
full = true
109109
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
110-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
110+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
111111
[]
112112
[]
113113

modules/richards/test/tests/mass/m01.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
type = SMP
103103
full = true
104104
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
105-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
105+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
106106
[../]
107107
[]
108108

modules/richards/test/tests/mass/m_fu_01.i

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
type = SMP
103103
full = true
104104
petsc_options_iname = '-ksp_type -pc_type -snes_atol -snes_rtol -snes_max_it'
105-
petsc_options_value = 'bcgs bjacobi 1 1 10000'
105+
petsc_options_value = 'bcgs bjacobi 1 .999 10000'
106106
[../]
107107
[]
108108

0 commit comments

Comments
 (0)