[petsc-dev] OpenMP

Mark Adams mfadams at lbl.gov
Sun Nov 7 06:41:03 CST 2021


Ah, great.
I guessed right (that was the page I was looking at but I still don't see
this)
#if defined(_OPENMP) && _OPENMP >= 201811

On Sat, Nov 6, 2021 at 8:47 PM Junchao Zhang <junchao.zhang at gmail.com>
wrote:

>
>
> On Sat, Nov 6, 2021 at 3:51 PM Mark Adams <mfadams at lbl.gov> wrote:
>
>> Yea, that is a bit inscrutable, but I see mumps is the main/only user of
>> this:
>>
>> /* 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 */
>>
>> 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 (
>> https://www.openmp.org/specifications/)
>>
> {200505,"2.5"},{200805,"3.0"},{201107,"3.1"},{201307,"4.0"},{201511,"4.5"},{201811,"5.0"},{202011,"5.1"}
>
> On Sat, Nov 6, 2021 at 4:27 PM Junchao Zhang <junchao.zhang at gmail.com>
>> wrote:
>>
>>>
>>>
>>> On Sat, Nov 6, 2021 at 5:51 AM Mark Adams <mfadams at lbl.gov> wrote:
>>>
>>>> Two questions on OMP:
>>>>
>>>> * Can I test for the version of OMP? I want >= 5 and I see this, which
>>>> looks promising:
>>>> include/petscsys.h:#elif defined(_OPENMP) && *_OPENMP >= 201307* &&
>>>> !defined(_WIN32)
>>>>
>>>> * What is the difference between HAVE_OPENMP and
>>>> HAVE_OPENMP_SUPPORT.
>>>>
>>>> # this is different from HAVE_OPENMP. HAVE_OPENMP_SUPPORT checks if we
>>> have facilities to support
>>> # running PETSc in flat-MPI mode and third party libraries in MPI+OpenMP
>>> hybrid mode
>>> if self.mpi.found and self.mpi.support_mpi3_shm and self.pthread.found
>>> and self.hwloc.found:
>>> # Apple pthread does not provide this functionality
>>> if self.function.check('pthread_barrier_init', libraries = 'pthread'):
>>> self.addDefine('HAVE_OPENMP_SUPPORT', 1)
>>>
>>>
>>>> Thanks,
>>>> Mark
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20211107/d06ea2fa/attachment.html>


More information about the petsc-dev mailing list