nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Investigate PyNomad with OpenMP enabled

Open ctribes opened this issue 2 years ago • 1 comments

In version 4.2 and above, PyNomad building requested to disable OpenMP. Weird crashes was observed. Maybe related to Gil releasing. Look into Pyx code. Test again on all platforms with version > 4.3.1.

ctribes avatar Feb 10 '23 19:02 ctribes

On version 4.3.1, building and run tests work fine with OpenMP. More tests are required before putting this as a default for next release.

To enable OpenMP (if available), the root CMakeLists.txt needs to be modified (see below the commented lines).

#
# Choose to build the Python interface
#
option(BUILD_INTERFACE_PYTHON "Option to build Python interface to Nomad" OFF)
if(BUILD_INTERFACE_PYTHON MATCHES ON)
#   if(OpenMP_FOUND)
#       message(STATUS "  Warning: Cannot build Python interface with OpenMP enabled")
#   else()
       find_package(Python 3.6 QUIET REQUIRED)
       message(CHECK_START "  Configuring build for Python interface")
       add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/interfaces/PyNomad)
       message(CHECK_PASS " done")
#   endif()
else()
   message(STATUS "  Python interface to Nomad NOT built")
endif()

The build directory AND $NOMAD_HOME/interfaces/PyNomad/[build,PyNomad.....so] need to be removed.

Run the config command again and build.

cmake -DBUILD_INTERFACE_PYTHON=ON -S . -B build/release

ctribes avatar Feb 14 '23 16:02 ctribes