Commit 6563331d authored by Michael Lamparski's avatar Michael Lamparski
Browse files

rename to LAMMPS_OMP_COMPAT, improve docs

parent 0bedebc0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -242,9 +242,9 @@ if(BUILD_OMP)

  if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.99.9))
    # GCC 9.x strictly implements OpenMP 4.0 semantics for consts.
    add_definitions(-DLMP_OMP_COMPAT=4)
    add_definitions(-DLAMMPS_OMP_COMPAT=4)
  else()
    add_definitions(-DLMP_OMP_COMPAT=3)
    add_definitions(-DLAMMPS_OMP_COMPAT=3)
  endif()
endif()

+10 −0
Original line number Diff line number Diff line
@@ -264,6 +264,16 @@ cmake -C ../cmake/presets/all_on.cmake -C ../cmake/presets/nolib.cmake -D PKG_GP
  </dl>
  </td>
</tr>
<tr>
  <td><code>LAMMPS_OMP_COMPAT</code></td>
  <td>Workaround for backwards-incompatible changes regarding predetermined sharing modes in OpenMP 4.x.  A value of 3 or 4 should be used, reflecting the version of the OpenMP spec that is implemented by the compiler.</td>
  <td>
  <dl>
    <dt><code>3</code> (default except for known OMP 4.0 compilers)</dt>
    <dt><code>4</code></dt>
  </dl>
  </td>
</tr>
<tr>
  <td><code>LAMMPS_MEMALIGN</code></td>
  <td>controls the alignment of blocks of memory allocated by LAMMPS</td>
+2 −1
Original line number Diff line number Diff line
@@ -147,7 +147,8 @@ semantics, which are incompatible with the OpenMP 3.1 semantics used
in LAMMPS (for maximal compatibility with compiler versions in use).
LAMMPS will try to detect compilers that use OpenMP 4.0 semantics and
change the directives accordingly, but if your compiler is not
detected, you may set the CMake variable ``-D LMP_OMP_COMPAT=4``.
detected, you may set the define ``-D LAMMPS_OMP_COMPAT=4`` in ``LMP_INC``
or the CMake build command.

----------

+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@
// so this is what LAMMPS primarily uses.  For those compilers
// that strictly implement OpenMP 4.0 (such as GCC 9.0), we
// give up default(none).
#if LMP_OMP_COMPAT == 4
#if LAMMPS_OMP_COMPAT == 4
#    define LMP_SHARED(...)
#    define LMP_DEFAULT_NONE default(shared)
#else