[petsc-users] PETSc openMP

Junchao Zhang junchao.zhang at gmail.com
Thu Sep 21 10:10:09 CDT 2023


include/petsc/private/petscimpl.h  has

#if defined(__cplusplus)
#error "Thread safety requires either --download-concurrencykit,
std::atomic, or --with-openmp"
#else
#error "Thread safety requires either --download-concurrencykit,
stdatomic.h, or --with-openmp"
#endif

So it means when you require --with-threadsafety, your system needs to have
std atomic;  otherwise you need to add --download-concurrencykit or
--with-openmp

--Junchao Zhang


On Thu, Sep 21, 2023 at 9:39 AM Di Miao via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> To whom it may concern,
>
>
>
> I would like to run PETSc in a multi-threaded way (KSP per thread). I
> checked PETSc’s manual and it says:
>
>
>
> There is an OpenMP thread-safe subset of PETSc that may be configured for
> using --with-threadsafety [--with-openmp or --download-concurrencykit].
>
>
>
> I am confused about the square bracket here. Does this mean I need to
> --with-threadsafety +( --with-openmp/--download-concurrencykit) or this
> mean I can add --with-threadsafety or --with-openmp or
> --download-concurrencykit?
>
>
>
> Looking for your explanation on these flags!
>
>
>
> Thank you
>
> Di
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230921/bb3984a2/attachment-0001.html>


More information about the petsc-users mailing list