From 27bdb63a931b25343ea48d9f6fd368d9c95ce30e Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Tue, 4 Oct 2016 13:47:25 +1300 Subject: [PATCH 1/9] Added Score-P support when using GNU compilers and OpenMPI --- CMakeLists.txt | 5 ++++- CMakeScripts/OCComponentSetupMacros.cmake | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d471799..3dbcb56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -300,7 +300,10 @@ endif() if (TOOLCHAIN) message(STATUS "@ TOOLCHAIN: ${TOOLCHAIN}") endif() +if (MPI_PROFILING) + message(STATUS "@ MPI PROFILER: ${MPI_PROFILING}") +endif() message(STATUS "@") printnextsteps() -log("Finished configuration in ${CMAKE_CURRENT_BINARY_DIR}") \ No newline at end of file +log("Finished configuration in ${CMAKE_CURRENT_BINARY_DIR}") diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index 4f87303..f5a21fe 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -228,7 +228,16 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) else() set(_LOGFLAG 0) endif() - + + # Score-P wrapper usage (if profiling is requested by user) + if(${COMPONENT_NAME} IN_LIST OPENCMISS_COMPONENTS_WITHMPI) + if (MPI_PROFILING AND TOOLCHAIN STREQUAL "gnu" AND MPI STREQUAL "openmpi") + set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) + else() + set(EXTRA_CONFIGURE_OPTS ) + endif() + endif() + log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources @@ -238,27 +247,21 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) STAMP_DIR ${BINARY_DIR}/${_OC_EXTPROJ_STAMP_DIR} #--Download step-------------- - # Ideal solution - include in the external project that also builds. - # Still a mess with mixed download/build stamp files and even though the UPDATE_DISCONNECTED command - # skips the update command the configure etc dependency chain is yet executed each time :-( - #${DOWNLOAD_CMDS} - #UPDATE_DISCONNECTED 1 # Dont update without being asked. New feature of CMake 3.2.0-rc1 - # Need empty download command, otherwise creation of external project fails with "no download info" DOWNLOAD_COMMAND "" #--Configure step------------- - CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli # disables warnings for unused cmdline options + CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli ${EXTRA_CONFIGURE_FLAGS} # disables warnings for unused cmdline options SOURCE_DIR ${SOURCE_DIR} BINARY_DIR ${BINARY_DIR} CMAKE_ARGS ${DEFS} #--Build step----------------- BUILD_COMMAND ${BUILD_COMMAND} + #--Install step--------------- - # currently set as extra arg (above), somehow does not work - #INSTALL_DIR ${CMAKE_INSTALL_PREFIX} INSTALL_COMMAND ${INSTALL_COMMAND} + # Logging LOG_CONFIGURE ${_LOGFLAG} LOG_BUILD ${_LOGFLAG} From eb3c6f070a6cfd2d992597e020dbf617a1e9b60d Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Tue, 4 Oct 2016 13:50:24 +1300 Subject: [PATCH 2/9] set the use DEVEL repos as default when using Developer mode --- Templates/OpenCMISSDeveloper.template.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Templates/OpenCMISSDeveloper.template.cmake b/Templates/OpenCMISSDeveloper.template.cmake index 779ff0b..e695001 100644 --- a/Templates/OpenCMISSDeveloper.template.cmake +++ b/Templates/OpenCMISSDeveloper.template.cmake @@ -26,9 +26,9 @@ # # See also: OC_DEVEL_ALL_. # -# .. default:: NO +# .. default:: NO -#set(IRON_DEVEL YES) +set(IRON_DEVEL YES) ## # _REPO From 139b8ddfcc82077a3f4a5da81e3205fc95540d33 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Wed, 12 Oct 2016 14:31:23 +1300 Subject: [PATCH 3/9] added support for Allinea's MAP profiler --- CMakeScripts/OCComponentSetupMacros.cmake | 19 +++++++++++++++---- CMakeScripts/OCToolchainFlags.cmake | 5 +++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index f5a21fe..550fb24 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -228,14 +228,25 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) else() set(_LOGFLAG 0) endif() - - # Score-P wrapper usage (if profiling is requested by user) + + #------------------------------------------------------------------------------------- + # Add support for MPI Profiling + #------------------------------------------------------------------------------------- + # Score-P wrapper usage if(${COMPONENT_NAME} IN_LIST OPENCMISS_COMPONENTS_WITHMPI) - if (MPI_PROFILING AND TOOLCHAIN STREQUAL "gnu" AND MPI STREQUAL "openmpi") - set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) + if (MPI_PROFILING STREQUAL "scorep") + if (TOOLCHAIN STREQUAL "gnu") + set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) + elseif (TOOLCHAIN STREQUAL "intel") + set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-icc -DCMAKE_CXX_COMPILER=scorep-icpc -DCMAKE_Fortran_COMPILER=scorep-ifort) + else() + set(EXTRA_CONFIGURE_OPTS ) + endif() else() set(EXTRA_CONFIGURE_OPTS ) endif() + else() + set(EXTRA_CONFIGURE_OPTS ) endif() log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) diff --git a/CMakeScripts/OCToolchainFlags.cmake b/CMakeScripts/OCToolchainFlags.cmake index 5d332ef..f4ea138 100644 --- a/CMakeScripts/OCToolchainFlags.cmake +++ b/CMakeScripts/OCToolchainFlags.cmake @@ -150,6 +150,11 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "XL" OR CMAKE_CXX_COMPILER_ID STREQUAL "XL") endif() endif() +# For MPI profiling with Allinea MAP +if (MPI_PROFILING STREQUAL "map") + addFlagAll("-g") +endif() + # Thus far all compilers seem to use the -p flag for profiling if (OC_PROFILING) addFlagAll("-p" ) From 588fa94f96a123ce51449924bd81d6aa79822b61 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Thu, 13 Oct 2016 11:52:36 +1300 Subject: [PATCH 4/9] fixed misspelled configure flag. Added TAU and MAP support --- CMakeScripts/OCComponentSetupMacros.cmake | 13 ++++++++++--- CMakeScripts/OCToolchainFlags.cmake | 14 ++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index 550fb24..8f3975a 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -230,10 +230,13 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) endif() #------------------------------------------------------------------------------------- - # Add support for MPI Profiling + # PROFILING + # All MPI-enabled components are instrument for performance monitoring if requested + # by the user #------------------------------------------------------------------------------------- - # Score-P wrapper usage if(${COMPONENT_NAME} IN_LIST OPENCMISS_COMPONENTS_WITHMPI) + + # Score-P profiler requested if (MPI_PROFILING STREQUAL "scorep") if (TOOLCHAIN STREQUAL "gnu") set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) @@ -242,9 +245,13 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) else() set(EXTRA_CONFIGURE_OPTS ) endif() + # TAU profiler requested + elseif (MPI_PROFILING STREQUAL "tau") + set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=tau_cc.sh -DCMAKE_CXX_COMPILER=tau_cxx.sh -DCMAKE_Fortran_COMPILER=tau_f90.sh) else() set(EXTRA_CONFIGURE_OPTS ) endif() + else() set(EXTRA_CONFIGURE_OPTS ) endif() @@ -262,7 +269,7 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) DOWNLOAD_COMMAND "" #--Configure step------------- - CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli ${EXTRA_CONFIGURE_FLAGS} # disables warnings for unused cmdline options + CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli ${EXTRA_CONFIGURE_OPTS} # disables warnings for unused cmdline options SOURCE_DIR ${SOURCE_DIR} BINARY_DIR ${BINARY_DIR} CMAKE_ARGS ${DEFS} diff --git a/CMakeScripts/OCToolchainFlags.cmake b/CMakeScripts/OCToolchainFlags.cmake index f4ea138..afa8ca5 100644 --- a/CMakeScripts/OCToolchainFlags.cmake +++ b/CMakeScripts/OCToolchainFlags.cmake @@ -104,7 +104,7 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL " #endif() # Release -# addFlagAll("-fast" RELEASE) + addFlagAll("-fast" RELEASE) # Debug addFlagAll("-traceback" DEBUG) @@ -150,11 +150,6 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "XL" OR CMAKE_CXX_COMPILER_ID STREQUAL "XL") endif() endif() -# For MPI profiling with Allinea MAP -if (MPI_PROFILING STREQUAL "map") - addFlagAll("-g") -endif() - # Thus far all compilers seem to use the -p flag for profiling if (OC_PROFILING) addFlagAll("-p" ) @@ -182,3 +177,10 @@ foreach(lang C CXX Fortran) message(STATUS "${lang} flags (DEBUG)=${CMAKE_${lang}_FLAGS_DEBUG}") endif() endforeach() + +####################### +# PROFILING SUPPORT +# Alinea's MAP profiler requires debugging symbols present in all executables +if(MPI_PROFILING STREQUAL "map") + addFlagAll("-g" ) +endif() From 99cb523dc6e3917fd84038aac2f97cc92f21a46e Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Fri, 21 Oct 2016 09:47:52 +1300 Subject: [PATCH 5/9] finalized MPI_PROFILING option --- CMakeLists.txt | 2 +- CMakeScripts/OCComponentSetupMacros.cmake | 104 ++++++++++++---------- CMakeScripts/OCMPIConfig.cmake | 2 +- CMakeScripts/OCToolchainFlags.cmake | 6 -- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dbcb56..f2ca4d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,7 +301,7 @@ if (TOOLCHAIN) message(STATUS "@ TOOLCHAIN: ${TOOLCHAIN}") endif() if (MPI_PROFILING) - message(STATUS "@ MPI PROFILER: ${MPI_PROFILING}") + message(STATUS "@ SCORE-P PROFILING ENABLED") endif() message(STATUS "@") printnextsteps() diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index 8f3975a..c441202 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -229,62 +229,68 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) set(_LOGFLAG 0) endif() - #------------------------------------------------------------------------------------- - # PROFILING - # All MPI-enabled components are instrument for performance monitoring if requested - # by the user - #------------------------------------------------------------------------------------- - if(${COMPONENT_NAME} IN_LIST OPENCMISS_COMPONENTS_WITHMPI) + log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) - # Score-P profiler requested - if (MPI_PROFILING STREQUAL "scorep") - if (TOOLCHAIN STREQUAL "gnu") - set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) - elseif (TOOLCHAIN STREQUAL "intel") - set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=scorep-icc -DCMAKE_CXX_COMPILER=scorep-icpc -DCMAKE_Fortran_COMPILER=scorep-ifort) - else() - set(EXTRA_CONFIGURE_OPTS ) - endif() - # TAU profiler requested - elseif (MPI_PROFILING STREQUAL "tau") - set(EXTRA_CONFIGURE_OPTS -DCMAKE_C_COMPILER=tau_cc.sh -DCMAKE_CXX_COMPILER=tau_cxx.sh -DCMAKE_Fortran_COMPILER=tau_f90.sh) - else() - set(EXTRA_CONFIGURE_OPTS ) - endif() + if (MPI_PROFILING) + ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} + DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources + PREFIX ${BINARY_DIR} + LIST_SEPARATOR ${OC_LIST_SEPARATOR} + TMP_DIR ${BINARY_DIR}/ep_tmp + STAMP_DIR ${BINARY_DIR}/${_OC_EXTPROJ_STAMP_DIR} + + #--Download step-------------- + # Need empty download command, otherwise creation of external project fails with "no download info" + DOWNLOAD_COMMAND "" + + #--Configure step------------- + CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran + SOURCE_DIR ${SOURCE_DIR} + BINARY_DIR ${BINARY_DIR} + CMAKE_ARGS ${DEFS} + + #--Build step----------------- + BUILD_COMMAND ${BUILD_COMMAND} - else() - set(EXTRA_CONFIGURE_OPTS ) - endif() - - log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) - ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} - DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources - PREFIX ${BINARY_DIR} - LIST_SEPARATOR ${OC_LIST_SEPARATOR} - TMP_DIR ${BINARY_DIR}/ep_tmp - STAMP_DIR ${BINARY_DIR}/${_OC_EXTPROJ_STAMP_DIR} + #--Install step--------------- + INSTALL_COMMAND ${INSTALL_COMMAND} + + # Logging + LOG_CONFIGURE ${_LOGFLAG} + LOG_BUILD ${_LOGFLAG} + LOG_INSTALL ${_LOGFLAG} + ) + else() + ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} + DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources + PREFIX ${BINARY_DIR} + LIST_SEPARATOR ${OC_LIST_SEPARATOR} + TMP_DIR ${BINARY_DIR}/ep_tmp + STAMP_DIR ${BINARY_DIR}/${_OC_EXTPROJ_STAMP_DIR} - #--Download step-------------- - # Need empty download command, otherwise creation of external project fails with "no download info" - DOWNLOAD_COMMAND "" + #--Download step-------------- + # Need empty download command, otherwise creation of external project fails with "no download info" + DOWNLOAD_COMMAND "" - #--Configure step------------- - CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli ${EXTRA_CONFIGURE_OPTS} # disables warnings for unused cmdline options - SOURCE_DIR ${SOURCE_DIR} - BINARY_DIR ${BINARY_DIR} - CMAKE_ARGS ${DEFS} + #--Configure step------------- + CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli # disables warnings for unused cmdline options + SOURCE_DIR ${SOURCE_DIR} + BINARY_DIR ${BINARY_DIR} + CMAKE_ARGS ${DEFS} - #--Build step----------------- - BUILD_COMMAND ${BUILD_COMMAND} + #--Build step----------------- + BUILD_COMMAND ${BUILD_COMMAND} - #--Install step--------------- - INSTALL_COMMAND ${INSTALL_COMMAND} + #--Install step--------------- + INSTALL_COMMAND ${INSTALL_COMMAND} + + # Logging + LOG_CONFIGURE ${_LOGFLAG} + LOG_BUILD ${_LOGFLAG} + LOG_INSTALL ${_LOGFLAG} + ) + endif() - # Logging - LOG_CONFIGURE ${_LOGFLAG} - LOG_BUILD ${_LOGFLAG} - LOG_INSTALL ${_LOGFLAG} - ) set_target_properties(${OC_EP_PREFIX}${COMPONENT_NAME} PROPERTIES FOLDER "ExternalProjects") # See OpenCMISSDeveloper.cmake diff --git a/CMakeScripts/OCMPIConfig.cmake b/CMakeScripts/OCMPIConfig.cmake index 3422784..91babc4 100644 --- a/CMakeScripts/OCMPIConfig.cmake +++ b/CMakeScripts/OCMPIConfig.cmake @@ -192,7 +192,7 @@ if (NOT MPI_FOUND) set(MPI_C_COMPILER ${OWN_MPI_INSTALL_DIR}/bin/mpicc) set(MPI_CXX_COMPILER ${OWN_MPI_INSTALL_DIR}/bin/mpicxx) set(MPI_Fortran_COMPILER ${OWN_MPI_INSTALL_DIR}/bin/mpifort) - elseif (MPI STREQUAL mpich) + elseif (MPI STREQUAL mpich) set(_MPI_VERSION ${MPICH_VERSION}) if (MPI_BUILD_TYPE STREQUAL RELEASE) list(APPEND _MPI_EXTRA_PARAMS --enable-fast=O3,ndebug --disable-error-checking --without-timing --without-mpit-pvars) diff --git a/CMakeScripts/OCToolchainFlags.cmake b/CMakeScripts/OCToolchainFlags.cmake index afa8ca5..9e7afca 100644 --- a/CMakeScripts/OCToolchainFlags.cmake +++ b/CMakeScripts/OCToolchainFlags.cmake @@ -178,9 +178,3 @@ foreach(lang C CXX Fortran) endif() endforeach() -####################### -# PROFILING SUPPORT -# Alinea's MAP profiler requires debugging symbols present in all executables -if(MPI_PROFILING STREQUAL "map") - addFlagAll("-g" ) -endif() From 47f23915e982e0ae68e19f51b88a69adf46c53b9 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Thu, 27 Oct 2016 08:29:24 +1300 Subject: [PATCH 6/9] changed -Ofast to -O3 to allow successfully compliation with Intel 2017 compilers --- CMakeScripts/OCToolchainFlags.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeScripts/OCToolchainFlags.cmake b/CMakeScripts/OCToolchainFlags.cmake index 9e7afca..d688dee 100644 --- a/CMakeScripts/OCToolchainFlags.cmake +++ b/CMakeScripts/OCToolchainFlags.cmake @@ -55,12 +55,11 @@ if (CMAKE_COMPILER_IS_GNUC OR CMAKE_C_COMPILER_ID STREQUAL "GNU" OR MINGW) # ABI Flag -m$(ABI) # These flags are set by CMake by default anyways. - # addFlagAll("-O3" RELEASE) addFlagAll("-O0" DEBUG) # Release - addFlagAll("-Ofast" RELEASE) + addFlagAll("-O3" RELEASE) # Debug @@ -104,7 +103,8 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL " #endif() # Release - addFlagAll("-fast" RELEASE) + addFlagAll("-O3" RELEASE) + addFlagAll("-fPIE" Fortran RELEASE) # Debug addFlagAll("-traceback" DEBUG) From 77f8527a2437566ec41c6a76c6e8c08a3c1f9221 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Tue, 1 Nov 2016 15:22:23 +1300 Subject: [PATCH 7/9] enable Score-P profiling for GNU builds and TAU profiling for INTEL builds --- CMakeLists.txt | 9 +++- .../OCCollectComponentDefinitions.cmake | 11 +++++ CMakeScripts/OCComponentSetupMacros.cmake | 44 ++++++------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f2ca4d6..76ce023 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,13 @@ # Further, you can specify an explicit mpi compiler wrapper (full path or just the binary name) for each language, # where can be each of "C","CXX" or "Fortran". # This can be used independently of (but possibly with) the MPI_HOME setting. +# +# ============== PROFILING ==================== +# +# MPI_PROFILING: []| +# If set, MPI profiling will be enabled. Currently the Score-P profiling package (www.vi-hps.org/projects/score-p) +# is used when GNU compilers are enabled. The TAU profiler (www.cs.oregon.edu/research/tau) is used for when Intel +# compilers are enabled. MPI profiling is not supported for other compilers at this time. ######################################################## # If your cmake is older than 2.6 - goodbye. @@ -301,7 +308,7 @@ if (TOOLCHAIN) message(STATUS "@ TOOLCHAIN: ${TOOLCHAIN}") endif() if (MPI_PROFILING) - message(STATUS "@ SCORE-P PROFILING ENABLED") + message(STATUS "@ PROFILER: ${MPI_PROFILING}") endif() message(STATUS "@") printnextsteps() diff --git a/CMakeScripts/OCCollectComponentDefinitions.cmake b/CMakeScripts/OCCollectComponentDefinitions.cmake index 99ed73a..2617c4c 100644 --- a/CMakeScripts/OCCollectComponentDefinitions.cmake +++ b/CMakeScripts/OCCollectComponentDefinitions.cmake @@ -27,6 +27,17 @@ LIST(APPEND COMPONENT_COMMON_DEFS -DCMAKE_INSTALL_DEFAULT_COMPONENT_NAME=Development ) +if(TOOLCHAIN STREQUAL "intel") + LIST(APPEND COMPONENT_COMMON_DEFS + -DUSING_INTEL_COMPILERS=1 + ) +endif() +if(MPI_PROFILING) + LIST(APPEND COMPONENT_COMMON_DEFS + -DENABLE_MPI_PROFILING=1 + ) +endif() + # Add compilers and flags foreach(lang C CXX Fortran) # Define flags diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index c441202..7a9f96f 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -232,36 +232,19 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) if (MPI_PROFILING) - ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} - DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources - PREFIX ${BINARY_DIR} - LIST_SEPARATOR ${OC_LIST_SEPARATOR} - TMP_DIR ${BINARY_DIR}/ep_tmp - STAMP_DIR ${BINARY_DIR}/${_OC_EXTPROJ_STAMP_DIR} - - #--Download step-------------- - # Need empty download command, otherwise creation of external project fails with "no download info" - DOWNLOAD_COMMAND "" - - #--Configure step------------- - CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran - SOURCE_DIR ${SOURCE_DIR} - BINARY_DIR ${BINARY_DIR} - CMAKE_ARGS ${DEFS} - - #--Build step----------------- - BUILD_COMMAND ${BUILD_COMMAND} + if (TOOLCHAIN STREQUAL "gnu") + set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) + else() + if (TOOLCHAIN STREQUAL "intel") + set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=tau_cc.sh -DCMAKE_CXX_COMPILER=tau_cxx.sh -DCMAKE_Fortran_COMPILER=tau_f90.sh) + else() + set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli) + endif() + endif() + endif() - #--Install step--------------- - INSTALL_COMMAND ${INSTALL_COMMAND} - # Logging - LOG_CONFIGURE ${_LOGFLAG} - LOG_BUILD ${_LOGFLAG} - LOG_INSTALL ${_LOGFLAG} - ) - else() - ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} + ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources PREFIX ${BINARY_DIR} LIST_SEPARATOR ${OC_LIST_SEPARATOR} @@ -273,7 +256,7 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) DOWNLOAD_COMMAND "" #--Configure step------------- - CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli # disables warnings for unused cmdline options + CMAKE_COMMAND ${CONFIGURE_COMMAND} SOURCE_DIR ${SOURCE_DIR} BINARY_DIR ${BINARY_DIR} CMAKE_ARGS ${DEFS} @@ -288,8 +271,7 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) LOG_CONFIGURE ${_LOGFLAG} LOG_BUILD ${_LOGFLAG} LOG_INSTALL ${_LOGFLAG} - ) - endif() + ) set_target_properties(${OC_EP_PREFIX}${COMPONENT_NAME} PROPERTIES FOLDER "ExternalProjects") From ee9bd0957f21ab6e07ce2b089edbddf9ad5e17c5 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Tue, 8 Nov 2016 11:19:50 +1300 Subject: [PATCH 8/9] added support for Intel VTune profiling. Removed Score-P and TAU support --- CMakeLists.txt | 14 ++++++++++---- CMakeScripts/OCCollectComponentDefinitions.cmake | 5 ----- CMakeScripts/OCComponentSetupMacros.cmake | 14 +------------- CMakeScripts/OCToolchainFlags.cmake | 9 ++++++--- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76ce023..d9da632 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,9 +69,8 @@ # ============== PROFILING ==================== # # MPI_PROFILING: []| -# If set, MPI profiling will be enabled. Currently the Score-P profiling package (www.vi-hps.org/projects/score-p) -# is used when GNU compilers are enabled. The TAU profiler (www.cs.oregon.edu/research/tau) is used for when Intel -# compilers are enabled. MPI profiling is not supported for other compilers at this time. +# If set, MPI profiling will be enabled. Currently Intel's VTune package is used for performance performance +# and analysis. It is only available if Intel compilers and MPI and being used. ######################################################## # If your cmake is older than 2.6 - goodbye. @@ -102,6 +101,13 @@ if (NOT CMAKE_COMPATIBLE) endif(NOT CMAKE_COMPATIBLE) ############################## END OF FULLY BACKWARDS-COMPATIBLE PART ############################### +# MPI Profiling only available when using Intel compilers +if(TOOLCHAIN STREQUAL "intel") +else() + set(MPI_PROFILING OFF) +endif() + + # OPENCMISS_CMAKE_MIN_VERSION is defined in OCCMakeCheck cmake_minimum_required(VERSION ${OPENCMISS_CMAKE_MIN_VERSION} FATAL_ERROR) @@ -308,7 +314,7 @@ if (TOOLCHAIN) message(STATUS "@ TOOLCHAIN: ${TOOLCHAIN}") endif() if (MPI_PROFILING) - message(STATUS "@ PROFILER: ${MPI_PROFILING}") + message(STATUS "@ PROFILER: Intel VTune") endif() message(STATUS "@") printnextsteps() diff --git a/CMakeScripts/OCCollectComponentDefinitions.cmake b/CMakeScripts/OCCollectComponentDefinitions.cmake index 2617c4c..ea52dc1 100644 --- a/CMakeScripts/OCCollectComponentDefinitions.cmake +++ b/CMakeScripts/OCCollectComponentDefinitions.cmake @@ -32,11 +32,6 @@ if(TOOLCHAIN STREQUAL "intel") -DUSING_INTEL_COMPILERS=1 ) endif() -if(MPI_PROFILING) - LIST(APPEND COMPONENT_COMMON_DEFS - -DENABLE_MPI_PROFILING=1 - ) -endif() # Add compilers and flags foreach(lang C CXX Fortran) diff --git a/CMakeScripts/OCComponentSetupMacros.cmake b/CMakeScripts/OCComponentSetupMacros.cmake index 7a9f96f..e66ccc7 100644 --- a/CMakeScripts/OCComponentSetupMacros.cmake +++ b/CMakeScripts/OCComponentSetupMacros.cmake @@ -231,18 +231,6 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) log("Adding ${COMPONENT_NAME} with DEPS=${${COMPONENT_NAME}_DEPS}" VERBOSE) - if (MPI_PROFILING) - if (TOOLCHAIN STREQUAL "gnu") - set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=scorep-gcc -DCMAKE_CXX_COMPILER=scorep-g++ -DCMAKE_Fortran_COMPILER=scorep-gfortran) - else() - if (TOOLCHAIN STREQUAL "intel") - set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli -DCMAKE_C_COMPILER=tau_cc.sh -DCMAKE_CXX_COMPILER=tau_cxx.sh -DCMAKE_Fortran_COMPILER=tau_f90.sh) - else() - set(CONFIGURE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli) - endif() - endif() - endif() - ExternalProject_Add(${OC_EP_PREFIX}${COMPONENT_NAME} DEPENDS ${${COMPONENT_NAME}_DEPS} ${COMPONENT_NAME}-sources @@ -256,7 +244,7 @@ function(createExternalProjects COMPONENT_NAME SOURCE_DIR BINARY_DIR DEFS) DOWNLOAD_COMMAND "" #--Configure step------------- - CMAKE_COMMAND ${CONFIGURE_COMMAND} + CMAKE_COMMAND ${CMAKE_COMMAND} --no-warn-unused-cli SOURCE_DIR ${SOURCE_DIR} BINARY_DIR ${BINARY_DIR} CMAKE_ARGS ${DEFS} diff --git a/CMakeScripts/OCToolchainFlags.cmake b/CMakeScripts/OCToolchainFlags.cmake index d688dee..67127d3 100644 --- a/CMakeScripts/OCToolchainFlags.cmake +++ b/CMakeScripts/OCToolchainFlags.cmake @@ -91,7 +91,8 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL " # ABI Flag -m$(ABI) # CMake default anyways - #addFlagAll("-O3" RELEASE) + addFlagAll("-O3" RELEASE) + addFlagAll("-g" RELEASE) # Somehow CMake does not add the appropriate C-standard flags even though # the C_STANDARD variable is set. Well do it manually for now. @@ -102,9 +103,11 @@ elseif (CMAKE_C_COMPILER_ID STREQUAL "Intel" OR CMAKE_CXX_COMPILER_ID STREQUAL " # addFlag("-std=c99" C) #endif() - # Release - addFlagAll("-O3" RELEASE) + # Release - needed for Intel Parallel Studio 2017+ addFlagAll("-fPIE" Fortran RELEASE) + + # Release - added for vector optimisation + addFlagAll("-xAVX" RELEASE) # Debug addFlagAll("-traceback" DEBUG) From 3abb4ba1fb3fdfab99f9b1e5027fd25e3100cfc7 Mon Sep 17 00:00:00 2001 From: Mark Cheeseman Date: Fri, 11 Nov 2016 14:43:12 +1300 Subject: [PATCH 9/9] Update CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d9da632..9578218 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,7 @@ # ============== PROFILING ==================== # # MPI_PROFILING: []| -# If set, MPI profiling will be enabled. Currently Intel's VTune package is used for performance performance +# If set, MPI profiling will be enabled. Currently Intel's VTune package is used for performance # and analysis. It is only available if Intel compilers and MPI and being used. ########################################################