[petsc-users] PETSc openMP

Barry Smith bsmith at petsc.dev
Thu Sep 21 11:26:39 CDT 2023


   If you plan to use OpenMP for threading then use

--with-threadsafety --with-openmp

> On Sep 21, 2023, at 11:10 AM, Junchao Zhang <junchao.zhang at gmail.com> wrote:
> 
> 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 <mailto: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/4287f679/attachment.html>


More information about the petsc-users mailing list