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

pflotran@develop build failures due to fortran interface changes in petsc@main #255

Open
balay opened this issue Jun 14, 2024 · 7 comments

Comments

@balay
Copy link
Member

balay commented Jun 14, 2024

https://gitlab.com/xsdk-project/spack-xsdk/-/jobs/7100286934

     51    petsc_utility.F90:42:36:
     52    
     53       42 |   call MatSetValuesBlockedLocal(A,1,irow-1,1,icol-1,ndof_mat
           ,ADD_VALUES, &
     54          |                                    1
  >> 55    Error: Rank mismatch in argument 'c' at (1) (rank-1 and scalar)
@balay
Copy link
Member Author

balay commented Jun 14, 2024

There are multiple changes on PETSc fortran interface. The first one:

  • VecLockPop - which is deprecated (since 3.11) for a while appears to be removed now (only for fortran? C still exists).

i.e the following change gets this part of the issue resolved [and this change should work with older petsc versions aswell:

-  call VecLockPop(xx,ierr);CHKERRQ(ierr)
+  call VecLockReadPop(xx,ierr);CHKERRQ(ierr)

etc..

@balay
Copy link
Member Author

balay commented Jun 14, 2024

Next issue: triggered by https://gitlab.com/petsc/petsc/-/merge_requests/7559

[0]PETSC ERROR: Cannot create PETSC_NULL_XXX object
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Development GIT revision: v3.21.1-241-g0764c050596  GIT Date: 2024-05-29 11:11:27 -0500
[0]PETSC ERROR: /home/balay/pflotran/src/pflotran/pflotran on a arch-linux-c-debug named pj01 by balay Fri Jun 14 15:01:33 2024
[0]PETSC ERROR: Configure options --with-hdf5-fortran-bindings --with-hdf5-dir=/home/balay/pinstall-hdf5
[0]PETSC ERROR: #1 snescreate_() at /home/balay/petsc/arch-linux-c-debug/src/snes/interface/ftn-auto/snesf.c:725
[0]PETSC ERROR: #2 solver.F90:439

The following usage is in pfortran - which is no longer correct? So I'm not sure what changes is required here [and stay backward compatible with current release]

  solver%snes = PETSC_NULL_SNES
  <snip>
  call SNESCreate(comm,solver%snes,ierr);CHKERRQ(ierr)
  <snip>
  if (solver%snes /= PETSC_NULL_SNES) then
    call SNESDestroy(solver%snes,ierr);CHKERRQ(ierr)

@balay balay changed the title pflotran@develop build failures due to fortran interface changes in petsc/master pflotran@develop build failures due to fortran interface changes in petsc@main Jun 14, 2024
@balay
Copy link
Member Author

balay commented Jul 18, 2024

also cc: @rtmills

@ghammond86
Copy link

Sorry. I completely missed this.

Are there any Fortran examples for SNESCreate/Destroy()?

@balay
Copy link
Member Author

balay commented Jul 18, 2024

I think we'll need @BarrySmith 's help here.

I'll have to recheck issues with latest petsc/main

@ghammond86
Copy link

@BarrySmith @balay @rtmills

No need. I figured it out (helps to think before asking a question). Fortran is now using classes (extended derived types) instead of derived types. These changes are relatively comprehensive. We have a release coming up in a few weeks that will be based on 3.21. After that release, we will refactor.

@balay
Copy link
Member Author

balay commented Jul 18, 2024

Sure thanks! This work is more for the next xsdk release due nov (i.e with the next petsc version 3.22 due sept etc..)..

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

No branches or pull requests

3 participants