<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 3:51 PM Mark Adams <<a href="mailto:mfadams@lbl.gov">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">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/" target="_blank">https://www.openmp.org/specifications/</a>)</div></div></blockquote><div><pre class="gmail-lang-c gmail-s-code-block" style="margin-top:0px;padding:12px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:1.30769;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:5px"><code class="gmail-hljs gmail-language-c" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">200505</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"2.5"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">200805</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"3.0"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">201107</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"3.1"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">201307</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"4.0"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">201511</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"4.5"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">201811</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"5.0"</span>},{<span class="gmail-hljs-number" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">202011</span>,<span class="gmail-hljs-string" style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:inherit;vertical-align:baseline;box-sizing:inherit">"5.1"</span>}</code></pre></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="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" target="_blank">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>
</blockquote></div></div>