On 6/17/19 6:10 AM, Franco Milicchio wrote:
>
> we're about to implement an eigenvalue problem that needs multiple solutions.
> In particular, we're going to compute min & max eigenvalues of several
> matrices, so we were going to spawn some threads and solve some in parallel.
>
> The problem is that, as far as I see, there are wrappers in deal.II for SLEPc,
> so PETSc, but we cannot use MPI in our system. PETSc works only with MPI, and
> I cannot start multiple threads, or at least that is what I understand (see
>
https://www.mcs.anl.gov/petsc/miscellaneous/petscthreads.html).
I think that is only partially true. What is *not* safe is to let PETSc access
the same data structures from multiple threads. That includes an MPI
communicator.
But if you are willing to duplicate the matrix and use different (cloned) MPI
communicators for the copies of the matrix, then I suspect that you can use
PETSc on multiple threads as long as every thread accesses only one of the
matrices and a unique MPI communicator.
That said, if you're already using MPI, why not just put one MPI process on
each processor core? In that case, you don't need multithreading.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/