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

Update to PETSc 3.22 #202

Merged
merged 4 commits into from
Oct 28, 2024
Merged

Update to PETSc 3.22 #202

merged 4 commits into from
Oct 28, 2024

Conversation

ViralBShah
Copy link
Member

@ViralBShah ViralBShah commented Oct 18, 2024

➜  test git:(vs/petsc-3.22) julia --project=.. old_test.jl
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Vector 'Vec_0x84000000_0' (argument #1) was locked for read-only access in unknown_function() at unknown file:0 (line numbers only accurate to function begin)
[0]PETSC ERROR: See https://petsc.org/release/faq/ for trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.22.0, Sep 28, 2024 
[0]PETSC ERROR: Unknown Name with 1 MPI process(es) and PETSC_ARCH  on Virals-MacBook-Pro.local by viralshah Fri Oct 18 17:23:46 2024
[0]PETSC ERROR: Configure options: --prefix=/workspace/destdir/lib/petsc/double_real_Int64 --CC=mpicc --FC=mpif90 --CXX=mpicxx --COPTFLAGS=-O3 -g --CXXOPTFLAGS=-O3 -g --FOPTFLAGS=-O3 --with-blaslapack-lib=/workspace/destdir/lib/libopenblas.dylib --with-blaslapack-suffix= --CFLAGS=-fno-stack-protector --FFLAGS=" " --LDFLAGS=-L/workspace/destdir/lib --CC_LINKER_FLAGS= --with-64-bit-indices=1 --with-debugging=0 --with-batch --with-mpi=1 --with-mpi-lib="[/workspace/destdir/lib/libmpifort.dylib,/workspace/destdir/lib/libmpi.dylib]" --with-mpi-include=/workspace/destdir/include --with-sowing=0 --with-precision=double --with-scalar-type=real --with-pthread=0 --PETSC_ARCH=aarch64-apple-darwin20_double_real_Int64 --with-scalapack-lib=/workspace/destdir/lib/libscalapack32.dylib --with-scalapack-include=/workspace/destdir/include --download-suitesparse=1 --download-suitesparse-shared=0 --download-superlu_dist=1 --download-superlu_dist-shared=0 --download-hypre=1 --download-hypre-shared=0 --download-hypre-configure-arguments="--host --build" --download-mumps=1 --download-mumps-shared=0 --download-tetgen=1 --download-triangle=1 --SOSUFFIX=double_real_Int64 --with-shared-libraries=1 --with-clean=1
[0]PETSC ERROR: #1 VecSetErrorIfLocked() at /workspace/srcdir/petsc-3.22.0/include/petscvec.h:649
[0]PETSC ERROR: #2 VecGetArray() at /workspace/srcdir/petsc-3.22.0/src/vec/vec/interface/rvector.c:2020
Tests: Error During Test at /Users/viralshah/.julia/dev/PETSc/test/old_test.jl:96
  Test threw exception
  Expression: ≈(PETSc.solve!([2.0, 3.0], S), [1.0, 2.0], rtol = 0.0001)
  PETSc.PetscError(73)
  Stacktrace:
   [1] unsafe_localarray(::Type{Float64}, cv::Ptr{Nothing}; read::Bool, write::Bool)
     @ PETSc ~/.julia/dev/PETSc/src/vec.jl:144
   [2] unsafe_localarray
     @ ~/.julia/dev/PETSc/src/vec.jl:140 [inlined]
   [3] (::var"#F!#2")(cfx::Ptr{Nothing}, cx::Ptr{Nothing}, a::Nothing)
     @ Main ~/.julia/dev/PETSc/test/old_test.jl:74
   [4] (::PETSc.SNESFn{Float64})(csnes::Ptr{Nothing}, cx::Ptr{Nothing}, cfx::Ptr{Nothing}, ctx::Ptr{Nothing})
     @ PETSc ~/.julia/dev/PETSc/src/snes.jl:94
Test Summary: | Pass  Error  Total  Time
Tests         |   19      1     20  1.5s
ERROR: LoadError: Some tests did not pass: 19 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/viralshah/.julia/dev/PETSc/test/old_test.jl:5

@ViralBShah
Copy link
Member Author

@boriskaus Will #203 help here?

@boriskaus
Copy link
Collaborator

don't think so as that only fixes the failure in test_dmstag, but this occurs in old_tests.

It shows the importance of having automatic wrapping of the functions, though..
We could try make that work with 3.21 first and see how easy it is to apply that to 3.22.

@ViralBShah
Copy link
Member Author

Right. No question. Wrapping is a bigger project - hope to find some time later to get to it. Much of the wrapping is already done in that open PR, and needs a bit more work for the wrapped file to load.

It would be ideal to directly work on wrapping with 3.22 if that were possible (but that would mean having 3.22 working and passing CI here).

@boriskaus
Copy link
Collaborator

boriskaus commented Oct 22, 2024

I looked at the error message for 3.22 and it is related to unsafe_localarray which internally calls VecGetArray, VecGetArrayWrite etc. It seems to be a bigger issue as this is used in many tests and examples.

The PETSc changelog for 3.22 doesn't show anything obvious that would explain this, though.

edit: it might be related to this: Make VecLock API active in optimized mode, which suggest that we probably did something wrong beforehand. Perhaps this is already fixed in the auto wrapped branch?

@boriskaus
Copy link
Collaborator

boriskaus commented Oct 26, 2024

@ViralBShah the mistake is now fixed (we now have to be a bit more precise in calling unsafe_localarray), so 3.22 can be merged

@ViralBShah ViralBShah merged commit 19ca702 into main Oct 28, 2024
4 checks passed
@ViralBShah ViralBShah deleted the vs/petsc-3.22 branch October 28, 2024 12:12
@ViralBShah
Copy link
Member Author

Awesome! I just bumped the version in Project.toml to 0.3.0. Is it ok to release the new version?

@boriskaus
Copy link
Collaborator

fine with me.

@ViralBShah
Copy link
Member Author

@ViralBShah
Copy link
Member Author

Trying again: JuliaRegistries/General#118231

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