Eigenproblem with Multithreaded Code

20 жолу көрүлдү
Биринчи окулбаган билдирүүгө өтүү

Franco Milicchio

окула элек,
2019-ж., 17-июн. 08:10:1517/6/19
– deal.II User Group
Dear all,

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).

Is there an alternative to SLEPc/PETSc for eigenproblems that is thread-safe? I don't know, Eigen, or others...

Thanks!
    Franco

Wolfgang Bangerth

окула элек,
2019-ж., 17-июн. 12:30:1417/6/19
– dea...@googlegroups.com
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/

Franco Milicchio

окула элек,
2019-ж., 18-июн. 02:19:3518/6/19
– deal.II User Group
Thanks Wolfgang,

Unfortunately I cannot use MPI. It should be strictly a host-only code with no networking at all, so I am using threads. I could use fully blown processes, of course, but it's an overkill.

Cheers,
     Franco

Wolfgang Bangerth

окула элек,
2019-ж., 18-июн. 10:51:5018/6/19
– dea...@googlegroups.com
On 6/18/19 12:19 AM, Franco Milicchio wrote:
>
> Unfortunately I cannot use MPI. It should be strictly a host-only code with no
> networking at all, so I am using threads.

Then the same applies: Duplicate the data structures, and I would assume that
PETSc can be used in multithreaded mode.
Баарына жооп берүү
Авторго жооп берүү
Багыттоо
0 жаңы билдирүү