Skip to content

Commit

Permalink
Enable OpenMP for GCC 4.8.4 build (trilinos#2562)
Browse files Browse the repository at this point in the history
This was the agreement as part trilinos#2317.

NOTE: This is using 'mpiexec --bind-to none ...' to avoid pinning the threads
in differnet MPI ranks to the same cores.  See trilinos#2422.
  • Loading branch information
bartlettroscoe committed May 4, 2018
1 parent 684a965 commit c296f6c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 6 deletions.
5 changes: 2 additions & 3 deletions cmake/load_sems_dev_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,5 @@ module load $sems_parmetis_and_version_default
module load $sems_scotch_and_version_default
module load $sems_superlu_and_version_default

if [ "${TRILINOS_SEMS_DEV_ENV_VERBOSE}" == "1" ] ; then
module list
fi
export OMP_NUM_THREADS=2
# This was the agreement for the OpenMP builds as per #2317
29 changes: 29 additions & 0 deletions cmake/std/MpiReleaseDebugSharedPtOpenMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file can be read in using either:
#
# -C <abs-path>/<file-name>.cmake
#
# or:
#
# -DTrilinos_CONFIGURE_OPTIONS_FILE:STRING=cmake/std/<file-name>.cmake
#

# Handle this being passed in with -C option instead of
# <Project>_CONFIGURE_OPTIONS_FILE.
IF ("${PROJECT_NAME}" STREQUAL "")
SET(PROJECT_NAME Trilinos)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/../tribits/core/utils/AssertDefined.cmake")
ENDIF()

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/SetUtils.cmake")

TRIL_SET_BOOL_CACHE_VAR(${PROJECT_NAME}_ENABLE_OpenMP ON)

TRIL_SET_CACHE_VAR(MPI_EXEC_PRE_NUMPROCS_FLAGS "--bind-to;none")
# NOTE: The above is a workaround for the problem of having threads on MPI
# ranks bind to the same cores (see #2422).

# NOTE: The order of these includes matters!

include("${CMAKE_CURRENT_LIST_DIR}/MpiReleaseDebugSharedPtSettings.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/BasicCiTestingSettings.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/sems/SEMSDevEnv.cmake")
18 changes: 16 additions & 2 deletions cmake/std/SetUtils.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
MACRO(TRIL_SET_BOOL_CACHE_VAR VAR_NAME VAR_VALUE)
#
# Usage:
#
# TRIL_SET_CACHE_VAR(<varName> <varVal> CACHE <type>)
#
MACRO(TRIL_SET_CACHE_VAR VAR_NAME VAR_VALUE)
IF ("${${VAR_NAME}}" STREQUAL "")
MESSAGE("-- " "Setting ${VAR_NAME}='${VAR_VALUE}' by default")
SET(${VAR_NAME} ${VAR_VALUE} CACHE BOOL
SET(${VAR_NAME} "${VAR_VALUE}" ${ARGN}
"Set in ${CMAKE_CURRENT_LIST_FILE}")
ENDIF()
ENDMACRO()

#
# Usage:
#
# TRIL_SET_BOOL_CACHE_VAR(<varName> <varVal>)
#
MACRO(TRIL_SET_BOOL_CACHE_VAR VAR_NAME VAR_VALUE)
TRIL_SET_CACHE_VAR(${VAR_NAME} ${VAR_VALUE} CACHE BOOL)
ENDMACRO()
2 changes: 1 addition & 1 deletion project-checkin-test-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'default-builds': [

('MPI_RELEASE_DEBUG_SHARED_PT', [
'-DTrilinos_CONFIGURE_OPTIONS_FILE:STRING=cmake/std/MpiReleaseDebugSharedPtSerial.cmake',
'-DTrilinos_CONFIGURE_OPTIONS_FILE:STRING=cmake/std/MpiReleaseDebugSharedPtOpenMP.cmake',
]),

], # default-builds
Expand Down

0 comments on commit c296f6c

Please sign in to comment.