<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div><br></div> If you plan to use OpenMP for threading then use<div><br></div><div>--with-threadsafety --with-openmp<div><div><br><blockquote type="cite"><div>On Sep 21, 2023, at 11:10 AM, Junchao Zhang <junchao.zhang@gmail.com> wrote:</div><br class="Apple-interchange-newline"><div><div dir="ltr"><div>include/petsc/private/petscimpl.h has<br></div><div><br></div><div><div style="font-family: Menlo, Monaco, "Courier New", monospace; font-size: 14px; line-height: 21px; white-space: pre;"><div><span style="color:rgb(0,128,0)"> </span><span style="color:rgb(0,128,0)">#if defined(__cplusplus)</span></div><div><span style="color:rgb(0,128,0)"> #error </span><span style="color:rgb(0,128,0)">"Thread safety requires either --download-concurrencykit, std::atomic, or --with-openmp"</span></div><div><span style="color:rgb(0,128,0)"> #else</span></div><div><span style="color:rgb(0,128,0)"> #error </span><span style="color:rgb(0,128,0)">"Thread safety requires either --download-concurrencykit, stdatomic.h, or --with-openmp"</span></div><div><span style="color:rgb(0,128,0)"> #endif</span></div></div></div><div><br></div>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<div><br></div><div>--Junchao Zhang<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 21, 2023 at 9:39 AM Di Miao via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg8866329436302139733">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="m_8866329436302139733WordSection1"><p class="MsoNormal">To whom it may concern,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I would like to run PETSc in a multi-threaded way (KSP per thread). I checked PETSc’s manual and it says:<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">There is an OpenMP thread-safe subset of PETSc that may be configured for using --with-threadsafety [--with-openmp or --download-concurrencykit].<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">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?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Looking for your explanation on these flags!<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thank you<u></u><u></u></p><p class="MsoNormal">Di<u></u><u></u></p>
</div>
</div>
</div></blockquote></div>
</div></blockquote></div><br></div></div></body></html>