<div dir="ltr">Yea, that is a bit inscrutable, but I see mumps is the main/only user of this:<div><br><div>/* if using PETSc OpenMP support, we only call MUMPS on master ranks. Before/after the call, we change/restore CPUs the master ranks can run on */<br></div><div><br></div></div><div>And I see _OPENMP is a macro for the release date (yyyymm) of the OMP version. It's not clear what the v5.0 is (<a href="https://www.openmp.org/specifications/">https://www.openmp.org/specifications/</a>)</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 6, 2021 at 4:27 PM Junchao Zhang <<a href="mailto:junchao.zhang@gmail.com">junchao.zhang@gmail.com</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 dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Nov 6, 2021 at 5:51 AM Mark Adams <<a href="mailto:mfadams@lbl.gov" target="_blank">mfadams@lbl.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 dir="ltr">Two questions on OMP:<div><br></div><div>* Can I test for the version of OMP? I want >= 5 and I see this, which looks promising:</div><div>include/petscsys.h:#elif defined(_OPENMP) && <b>_OPENMP >= 201307</b> && !defined(_WIN32)<br></div><div><br></div><div>* What is the difference between HAVE_OPENMP and </div><div>HAVE_OPENMP_SUPPORT.</div><div><br></div></div></blockquote><div><div style="color:rgb(0,0,0);font-family:Menlo,Monaco,"Courier New",monospace;font-size:14px;line-height:21px;white-space:pre-wrap"><div>    <span style="color:rgb(0,128,0)"># this is different from HAVE_OPENMP. HAVE_OPENMP_SUPPORT checks if we have facilities to support</span></div><div>    <span style="color:rgb(0,128,0)"># running PETSc in flat-MPI mode and third party libraries in MPI+OpenMP hybrid mode</span></div><div>    <span style="color:rgb(175,0,219)">if</span> <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(0,16,128)">mpi</span>.found <span style="color:rgb(0,0,255)">and</span> <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(0,16,128)">mpi</span>.support_mpi3_shm <span style="color:rgb(0,0,255)">and</span> <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(0,16,128)">pthread</span>.found <span style="color:rgb(0,0,255)">and</span> <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(0,16,128)">hwloc</span>.found:</div><div>      <span style="color:rgb(0,128,0)">#  Apple pthread does not provide this functionality</span></div><div>      <span style="color:rgb(175,0,219)">if</span> <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(0,16,128)">function</span>.check(<span style="color:rgb(163,21,21)">'pthread_barrier_init'</span>, <span style="color:rgb(0,16,128)">libraries</span> = <span style="color:rgb(163,21,21)">'pthread'</span>):</div><div>        <span style="color:rgb(0,16,128)">self</span>.<span style="color:rgb(121,94,38)">addDefine</span>(<span style="color:rgb(163,21,21)">'HAVE_OPENMP_SUPPORT'</span>, <span style="color:rgb(9,134,88)">1</span>)</div></div></div><div> <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 dir="ltr"><div></div><div>Thanks,</div><div>Mark</div></div>
</blockquote></div></div>
</blockquote></div>