Skip to content

Support PETSc 3.23+ - #408

Open
sabakhshi wants to merge 11 commits into
mainfrom
petsc325support
Open

Support PETSc 3.23+#408
sabakhshi wants to merge 11 commits into
mainfrom
petsc325support

Conversation

@sabakhshi

Copy link
Copy Markdown
Contributor

Purpose

PetSC 3.23 introduced major breaking changes to the Fortran interface breaking a lot of code in ADflow.
This PR introduces compatibility with the changes in PetSC 3.23+.
Confirmed also working to PetSC 3.25.4.
Note this PR breaks compatibility with PetSC versions below 3.23

Expected time until merged

1 week

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (non-backwards-compatible fix or feature)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Documentation update
  • Maintenance update
  • Other (please describe)

Testing

All regression and units tests pass.

Checklist

  • I have run ruff check and ruff format to make sure the Python code adheres to PEP-8 and is consistently formatted
  • [] I have formatted the Fortran code with fprettify or C/C++ code with clang-format as applicable
  • I have run unit and regression tests which pass locally with my changes
  • I have added new tests that prove my fix is effective or that my feature works
  • I have added necessary documentation

@sabakhshi
sabakhshi requested a review from a team as a code owner August 28, 2026 00:13
@sabakhshi
sabakhshi requested review from A-CGray, ArshSaja, anilyil and mpdutta and removed request for ArshSaja August 28, 2026 00:13
@sabakhshi sabakhshi changed the title Support PetSC 3.23+ Support PetSc 3.23+ Aug 28, 2026
@A-CGray A-CGray changed the title Support PetSc 3.23+ Support PETSc 3.23+ Aug 31, 2026
@A-CGray

A-CGray commented Aug 31, 2026

Copy link
Copy Markdown
Member

I'm getting this compiler error building with PETSc 3.25.4

../NKSolver/NKSolvers.F90:176:49:

 176 |                                 PETSC_DETERMINE, ctx, dRdwPseudo, ierr)
     |                                                 1
Error: Rank mismatch in argument ‘ctx’ at (1) (scalar and rank-1)
../NKSolver/NKSolvers.F90:205:66:

 205 |                 call KSPMonitorSet(NK_KSP, linearResidualMonitor, PETSC_NULL_FUNCTION, &
     |                                                                  1
Error: Invalid procedure argument at (1)
../NKSolver/NKSolvers.F90:1727:13:

1727 |         use NKSolver, only: destroyNKSolver, linearResidualMonitor
     |             1
Fatal Error: Cannot open module file ‘nksolver.mod’ for reading at (1): No such file or directory
compilation terminated.
make[3]: *** [rules:9: NKSolvers.o] Error 1
make[3]: *** Waiting for unfinished jobs....

       --- Compiled adjointDebug.F90 successfully ---


       --- Compiled fortranPC.F90 successfully ---

../adjoint/adjointAPI.F90:1202:49:

1202 |                                 PETSC_DETERMINE, matfreectx, dRdwT, ierr)
     |                                                 1
Error: Rank mismatch in argument ‘ctx’ at (1) (scalar and rank-1)
../adjoint/adjointAPI.F90:929:57:

 929 |             call KSPMonitorSet(adjointKSP, MyKSPMonitor, PETSC_NULL_FUNCTION, &
     |                                                         1
Error: Invalid procedure argument at (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants