Skip to content

CMake: Add `OCTOPUS_TESTS_OpenMP_THREADS` to control OpenMP parallelization

Cristian Le requested to merge LecrisUT/octopus:cmake/openmp-defaults into main

Here's a quick fix for the discussion on zulip.

The user has full control to override OCTOPUS_TESTS_OpenMP_THREADS even with OCTOPUS_OpenMP=OFF, but the default is set as:

  • if OCTOPUS_OpenMP == OFF -> 1
  • if OCTOPUS_OpenMP == ON && OMP_NUM_THREADS -> OMP_NUM_THREADS
  • if OCTOPUS_OpenMP == ON && NOT OMP_NUM_THREADS -> 2

This does not enable the user to oversubscribe OpenMP parallelization. To do that is quite tricky when there is MPI/GPU parallelization as well

Edited by Cristian Le

Merge request reports