[petsc-dev] OpenMP

Mark Adams mfadams at lbl.gov
Sat Nov 6 15:50:52 CDT 2021


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/)

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/20211106/29f692ba/attachment.html>


More information about the petsc-dev mailing list