Dear Arthur,

See https://github.com/dealii/dealii/issues/18886

Basically,  even reading from PETSc ghosted vectors from multiple
threads currently does not work, you can either switch to the current
PETSc master and test if that fixes the issue or wait until we figure
out a way to not lock/unlock the ghost VEC from multiple threads.



On Thu, Nov 6, 2025 at 6:36 PM 'Wolfgang Bangerth' via deal.II User
Group <[email protected]> wrote:
>
> On 11/6/25 12:08, Arthur Bawin wrote:
> > present_pressure_values is part of the scratch_data, so I don't think this 
> > is
> > the issue. The attached gdb backtrace shows VecGetSize_Seq on top, called
> > in dealii::PETScWrappers::VectorBase::extract_subvector_to<unsigned int
> > const*, double*> , which would be a read issue on Petsc's end? (Sorry, I
> > should have included the backtrace in the first place).
>
> Yes, I think my expectation would also have been that reading the size of a
> vector via VecGetSize is thread-safe. Apparently, it is not :-( The function
> is implemented here:
>
> https://gitlab.com/petsc/petsc/-/blob/main/src/vec/vec/impls/seq/bvec2.c?ref_type=heads#L122
> I can't really say why that would not be thread-safe: The only thing I can
> imagine is the call to PetscFunctionBegin.
>
> I do not know how to fix this, but here are a few suggestions:
> * When you're in a debugger, take a look where the other threads are. In the
> backtrace, one is clearly in a PETSc function. Check where the other thread
> is, to make sure that you can narrow down that it's really concurrent access
> to PETSc data that are the problem.
>
> * If you have the ability, compile PETSc with debug flags so that you can go
> in the debugger and check which line in the PETSc functions actually causes
> the problem.
>
> * Talk to the PETSc folks on their mailing list about the issue once you're
> sure you know what the problem is.
>
> I acknowledge that none of these options actually solve your problem.
>
> Best
>   W.
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth          email:                 [email protected]
>                             www: http://www.math.colostate.edu/~bangerth/
>
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see 
> https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups 
> "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion visit 
> https://groups.google.com/d/msgid/dealii/c5041521-b593-4d9d-8b4b-a9c4920ef570%40colostate.edu.

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/dealii/CAMRj59F68UvLPHJu9ocDXXE5dRJ6NFkWGcQ7V8O0GPP9GqW00g%40mail.gmail.com.

Reply via email to