Skip to content

Fix for PetscCtxRt and PetscCtx argument types#170

Merged
stevendargaville merged 1 commit intomainfrom
BarrySmith-fix-petscctxrt
Feb 1, 2026
Merged

Fix for PetscCtxRt and PetscCtx argument types#170
stevendargaville merged 1 commit intomainfrom
BarrySmith-fix-petscctxrt

Conversation

@stevendargaville
Copy link
Collaborator

@stevendargaville stevendargaville commented Jan 20, 2026

@BarrySmith I've brought the changes from your fork into this branch that will be merged after your PETSc MR. The commit hash you will need for PFLARE.py in PETSc is ad0dba9.

@BarrySmith
Copy link
Contributor

Thanks. The PETSc CI is getting an error I don't understand with PFLARE; it doesn't seem to be related to this change but suddenly it appeared, maybe you understand it.

/home/svcpetsc/soft/mpich-4.2.2/bin/mpif90 -o src/PMISR_DDC.o -c -fPIC -Wall -ffree-line-length-none -ffree-line-length-0 -Wno-lto-type-mismatch -Wno-unused-dummy-argument -g -O   -Werror -Werror -I/scratch/svcpetsc/glci-builds/HXRAfDpzy/2/petsc/petsc/arch-ci-freebsd-pkgs-opt/externalpackages/git.pflare -Iinclude -I/scratch/svcpetsc/glci-builds/HXRAfDpzy/2/petsc/petsc/include -I/scratch/svcpetsc/glci-builds/HXRAfDpzy/2/petsc/petsc/arch-ci-freebsd-pkgs-opt/include -I/home/svcpetsc/petsc-hash-pkgs/4e9453/include -I/home/svcpetsc/soft/mpich-4.2.2/include    -I/scratch/svcpetsc/glci-builds/HXRAfDpzy/2/petsc/petsc/arch-ci-freebsd-pkgs-opt/externalpackages/git.pflare -Iinclude src/PMISR_DDC.F90
src/PMISR_DDC.F90:294:51:

  294 |       if (comm_size/=1) assigned_nonlocal = .FALSE.
      |                                                   ^
Error: 'assigned_nonlocal.dim[0].ubound' may be used uninitialized [-Werror=maybe-uninitialized]
src/PMISR_DDC.F90:157:93:

  157 |       PFLARE_PETSCBOOL_C_TYPE, dimension(:), allocatable, target :: assigned_local, assigned_nonlocal
      |                                                                                             ^
note: 'assigned_nonlocal.dim[0].ubound' was declared here
src/PMISR_DDC.F90:423:90:

  423 |             call boolscatter_mat_end_c(A_array, assigned_local_ptr, assigned_nonlocal_ptr)
      |                                                                                          ^
Error: 'assigned_local_ptr' may be used uninitialized [-Werror=maybe-uninitialized]
src/PMISR_DDC.F90:158:61:

  158 |       type(c_ptr) :: measure_nonlocal_ptr, assigned_local_ptr, assigned_nonlocal_ptr
      |                                                             ^
note: 'assigned_local_ptr' was declared here
src/PMISR_DDC.F90:423:90:

  423 |             call boolscatter_mat_end_c(A_array, assigned_local_ptr, assigned_nonlocal_ptr)
      |                                                                                          ^
Error: 'assigned_nonlocal_ptr' may be used uninitialized [-Werror=maybe-uninitialized]
src/PMISR_DDC.F90:158:84:

  158 |       type(c_ptr) :: measure_nonlocal_ptr, assigned_local_ptr, assigned_nonlocal_ptr
      |                                                                                    ^
note: 'assigned_nonlocal_ptr' was declared here
f951: all warnings being treated as errors
gmake[2]: *** [/scratch/svcpetsc/glci-builds/HXRAfDpzy/2/petsc/petsc/lib/petsc/conf/rules:171: src/PMISR_DDC.o] Error 1

https://gitlab.com/petsc/petsc/-/jobs/12774297747

https://gitlab.com/petsc/petsc/-/jobs/12774297747

@stevendargaville
Copy link
Collaborator Author

Thanks. The PETSc CI is getting an error I don't understand with PFLARE; it doesn't seem to be related to this change but suddenly it appeared, maybe you understand it.

Ah apologies, that was due to some recent changes in main and not this PR, but I thought I had the PFLARE CI setup to ensure all warnings were on and set as errors like the PETSc CI so that this wouldn't happen. I'll try and fix this now.

@stevendargaville stevendargaville force-pushed the BarrySmith-fix-petscctxrt branch from ad0dba9 to 4ca6c2d Compare January 20, 2026 19:53
@stevendargaville
Copy link
Collaborator Author

@BarrySmith Ok this should be fixed now. Missed warnings were caused by old gcc version in the PFLARE CI and a missed -Werror flag for Fortran files, which have now been fixed.

The commit you need is 4ca6c2d

@BarrySmith
Copy link
Contributor

I had to change the Interface_XXX function to exclude the final end interface line and require the user to provide that so you will need to make another change to the branch.

@stevendargaville
Copy link
Collaborator Author

@BarrySmith Done

@BarrySmith
Copy link
Contributor

@stevendargaville It's gotten better. It now does not need the use of Interface_xxx so could you please remove those? Thanks

@stevendargaville stevendargaville force-pushed the BarrySmith-fix-petscctxrt branch from 647ff8a to 5a629ea Compare January 22, 2026 15:53
@stevendargaville
Copy link
Collaborator Author

@BarrySmith no worries, done

@BarrySmith
Copy link
Contributor

@stevendargaville One of the pflare tests in the PETSc CI is failing. Could you please take a look at it https://gitlab.com/petsc/petsc/-/jobs/12854064147

@stevendargaville
Copy link
Collaborator Author

stevendargaville commented Jan 26, 2026

@stevendargaville One of the pflare tests in the PETSc CI is failing. Could you please take a look at it https://gitlab.com/petsc/petsc/-/jobs/12854064147

Apologies, I've managed to replicate this and am working through now.

…re ctx pointers are declared null to prevent uninitialised warnings
@stevendargaville stevendargaville force-pushed the BarrySmith-fix-petscctxrt branch from 5a629ea to f4ad40b Compare January 26, 2026 22:07
@stevendargaville
Copy link
Collaborator Author

@BarrySmith Ok that should be fixed (and the PFLARE CI has been updated with -fp_trap on to catch this in the future).

As it looks like your PETSc MR is close to merging, any chance you could use the PFLARE commit hash f4ad40b rather than this branch name, as I tag any commit that makes it into PETSc main so github doesn't garbage collect away a branch.

@BarrySmith
Copy link
Contributor

Satish likes to enforce hashes before merge so we will use a hash when merged. Until then I find it is simpler to use the branch name otherwise I have to constantly change commits and will make mistakes.

@stevendargaville
Copy link
Collaborator Author

Sure no worries 😄

@stevendargaville stevendargaville merged commit 4d75a2d into main Feb 1, 2026
16 of 28 checks passed
@stevendargaville stevendargaville deleted the BarrySmith-fix-petscctxrt branch February 2, 2026 00:13
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.

2 participants