Skip to content

Commit

Permalink
Add GCC 4.8.4 bild with OpenMP enabled (trilinos#2562)
Browse files Browse the repository at this point in the history
This build matches settings targeted for the GCC 4.8.4 auto PR build in trilinos#2462.

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 47e6e20
Show file tree
Hide file tree
Showing 4 changed files with 68 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
30 changes: 30 additions & 0 deletions cmake/std/GCC-4.8.4-MpiReleaseDebugSharedPtOpenMP.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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"
CACHE STSRING)
# 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")
19 changes: 19 additions & 0 deletions cmake/std/GCC-4.8.4-MpiReleaseDebugSharedPtOpenMP_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# Source this script in order to load env for
# GCC-4.8.4-MpiReleaseDebugSharedPtOpenMP build using:
#
# source GCC-4.8.4-MpiReleaseDebugSharedPtOpenMP_env.sh
#

_ABS_FILE_PATH=`readlink -f "${BASH_SOURCE[0]}"`
if [ "$_ABS_FILE_PATH" != "" ] ; then
_SCRIPT_DIR=`dirname $_ABS_FILE_PATH`
else
echo "***"
echo "*** Could not get the Trilinos directory!"
echo "***"
return
fi

source ${_SCRIPT_DIR}/../load_sems_dev_env.sh \
sems-gcc/4.8.4 sems-openmpi/1.10.1 sems-cmake/3.5.2
20 changes: 17 additions & 3 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>)
#
FUNCTION(TRIL_SET_CACHE_VAR VAR_NAME VAR_VALUE CACHE_STR TYPE_STR)
IF ("${${VAR_NAME}}" STREQUAL "")
MESSAGE("-- " "Setting ${VAR_NAME}='${VAR_VALUE}' by default")
SET(${VAR_NAME} ${VAR_VALUE} CACHE BOOL
SET(${VAR_NAME} "${VAR_VALUE}" ${CACHE_STR} ${TYPE_STR}
"Set in ${CMAKE_CURRENT_LIST_FILE}")
ENDIF()
ENDMACRO()
ENDFUNCTION()

#
# Usage:
#
# TRIL_SET_BOOL_CACHE_VAR(<varName> <varVal>)
#
FUNCTION(TRIL_SET_BOOL_CACHE_VAR VAR_NAME VAR_VALUE)
TRIL_SET_CACHE_VAR(${VAR_NAME} ${VAR_VALUE} CACHE BOOL)
ENDFUNCTION()

0 comments on commit 47e6e20

Please sign in to comment.