-
Notifications
You must be signed in to change notification settings - Fork 15
Performance analysis #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: devel
Are you sure you want to change the base?
Changes from all commits
a777086
064b669
00e2ae2
175b7bf
f97da80
33e3dc1
76f1696
329c71f
495ecbb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -159,18 +159,18 @@ get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES) | |
| # | ||
|
|
||
| # Start out with the generic MPI compiler names, as these are most commonly used. | ||
| set(_MPI_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) | ||
| set(_MPI_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ | ||
| set(_MPI_Generic_C_COMPILER_NAMES mpicc mpcc mpicc_r mpcc_r) | ||
| set(_MPI_Generic_CXX_COMPILER_NAMES mpicxx mpiCC mpcxx mpCC mpic++ mpc++ | ||
| mpicxx_r mpiCC_r mpcxx_r mpCC_r mpic++_r mpc++_r) | ||
| set(_MPI_Fortran_COMPILER_NAMES #mpif77 mpif77_r mpf77 mpf77_r | ||
| set(_MPI_Generic_Fortran_COMPILER_NAMES #mpif77 mpif77_r mpf77 mpf77_r | ||
| mpif90 mpif90_r mpf90 mpf90_r | ||
| mpif95 mpif95_r mpf95 mpf95_r) | ||
|
|
||
| # GNU compiler names | ||
| set(_MPI_GNU_C_COMPILER_NAMES mpigcc mpgcc mpigcc_r mpgcc_r) | ||
| set(_MPI_GNU_C_COMPILER_NAMES mpgcc mpigcc_r mpgcc_r) | ||
| set(_MPI_GNU_CXX_COMPILER_NAMES mpig++ mpg++ mpig++_r mpg++_r) | ||
| set(_MPI_GNU_Fortran_COMPILER_NAMES #mpig77 mpig77_r mpg77 mpg77_r | ||
| mpigfortran mpgfortran mpigfortran_r mpgfortran_r) | ||
| mpgfortran mpigfortran_r mpgfortran_r) | ||
|
|
||
| # Intel MPI compiler names | ||
| set(_MPI_Intel_C_COMPILER_NAMES mpiicc) | ||
|
|
@@ -188,7 +188,7 @@ set(_MPI_XL_CXX_COMPILER_NAMES mpixlcxx mpixlC mpixlc++ mpxl | |
| mpixlcxx_r mpixlC_r mpixlc++_r mpxlcxx_r mpxlc++_r mpixlc++_r mpxlCC_r) | ||
| set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95_r | ||
| mpixlf90 mpixlf90_r mpxlf90 mpxlf90_r | ||
| #mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r | ||
| #mpixlf77 mpixlf77_r mpxlf77 mpxlf77_r | ||
| mpixlf mpixlf_r mpxlf mpxlf_r) | ||
|
|
||
| ############################################################ | ||
|
|
@@ -197,14 +197,32 @@ set(_MPI_XL_Fortran_COMPILER_NAMES mpixlf95 mpixlf95_r mpxlf95 mpxlf95 | |
| # append vendor-specific compilers to the list if we either don't know the compiler id, | ||
| # or if we know it matches the regular compiler. | ||
| foreach (lang C CXX Fortran) | ||
| set(_MPI_${lang}_COMPILER_NAMES ) | ||
| if (lang IN_LIST ENABLED_LANGUAGES) | ||
| foreach (id GNU Intel PGI XL) | ||
| if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) | ||
| #Add in add instrumentation wrappers | ||
| if(OC_INSTRUMENTATION STREQUAL "scorep") | ||
| # Replace mpi compiler name with the appropriate scorep wrapper name | ||
| foreach (mpicompiler ${_MPI_Generic_${lang}_COMPILER_NAMES}) | ||
| list(INSERT _MPI_${lang}_COMPILER_NAMES 0 "scorep-${mpicompiler}") | ||
| endforeach() | ||
| else() | ||
| list(INSERT _MPI_${lang}_COMPILER_NAMES 0 ${_MPI_Generic_${lang}_COMPILER_NAMES}) | ||
| endif() | ||
| foreach (id GNU Intel PGI XL) | ||
| if (NOT CMAKE_${lang}_COMPILER_ID OR CMAKE_${lang}_COMPILER_ID STREQUAL id) | ||
| #Add in add instrumentation wrappers | ||
| if(OC_INSTRUMENTATION STREQUAL "scorep") | ||
| # Replace mpi compiler name with the appropriate scorep wrapper name | ||
| foreach (mpicompiler ${_MPI_${id}_${lang}_COMPILER_NAMES}) | ||
| list(INSERT _MPI_${lang}_COMPILER_NAMES 0 "scorep-${mpicompiler}") | ||
| endforeach() | ||
| else() | ||
| list(INSERT _MPI_${lang}_COMPILER_NAMES 0 ${_MPI_${id}_${lang}_COMPILER_NAMES}) | ||
| endif() | ||
| unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here | ||
| endforeach() | ||
| messagev("Looking for _MPI_${lang}_COMPILER_NAMES=${_MPI_${lang}_COMPILER_NAMES}") | ||
| endif() | ||
| unset(_MPI_${id}_${lang}_COMPILER_NAMES) # clean up the namespace here | ||
| endforeach() | ||
| messagev(STATUS "Looking for _MPI_${lang}_COMPILER_NAMES=${_MPI_${lang}_COMPILER_NAMES}") | ||
| endif() | ||
| endforeach() | ||
|
|
||
|
|
@@ -230,8 +248,12 @@ if (DEFINED MPI_HOME) | |
| else() | ||
| # Allow all paths, and add an extra path if set | ||
| set(PATHOPT ) | ||
| # Start with MPI_HOME from the environment, of given | ||
| set(_MPI_PREFIX_PATH $ENV{MPI_HOME}) | ||
| # CPB 11/11/16 Don't look at MPI_HOME environment variable. Some MPI distros set this but others don't. This can mean that | ||
| # the MPI_HOME environment variable might clash with what has been specified via the -DMPI= option. The common MPI_HOME's | ||
| # are covered below regardless. | ||
| # Start with MPI_HOME from the environment, of given | ||
| #set(_MPI_PREFIX_PATH $ENV{MPI_HOME}) | ||
| set(_MPI_PREFIX_PATH ) | ||
| # Check if a mpi mnemonic is given | ||
| # Standard local paths will be added below later | ||
| if(DEFINED MPI) | ||
|
|
@@ -296,12 +318,16 @@ else() | |
|
|
||
| # Build a list of prefixes to search for MPI. | ||
| set(_MPI_PREFIX_PATH_COPY ${_MPI_PREFIX_PATH}) | ||
| set(_MPI_PREFIX_PATH ) | ||
| messagev("CMAKE_SYSTEM_PREFIX_PATH = ${CMAKE_SYSTEM_PREFIX_PATH}") | ||
| messagev("_MPI_PREFIX_PATH_COPY = ${_MPI_PREFIX_PATH_COPY}") | ||
| foreach(SystemPrefixDir | ||
| ${CMAKE_SYSTEM_PREFIX_PATH} | ||
| # Add some more paths | ||
| /usr/lib /usr/lib64 | ||
| /usr/local/lib /usr/local/lib64) | ||
| ${CMAKE_SYSTEM_PREFIX_PATH} | ||
| # Add some more paths | ||
| /usr/lib /usr/lib64 | ||
| /usr/local/lib /usr/local/lib64) | ||
| foreach(MpiPackageDir ${_MPI_PREFIX_PATH_COPY}) | ||
| messagev("SystemPrefixDir = ${SystemPrefixDir} MpiPackageDir = ${MpiPackageDir}") | ||
| messagev("Trying path ${SystemPrefixDir}/${MpiPackageDir}") | ||
| if(EXISTS ${SystemPrefixDir}/${MpiPackageDir}) | ||
| messagev("Path added") | ||
|
|
@@ -359,6 +385,7 @@ function (_mpi_check_compiler compiler options cmdvar resvar) | |
| endif() | ||
| set(${cmdvar} "${cmdline}" PARENT_SCOPE) | ||
| set(${resvar} "${success}" PARENT_SCOPE) | ||
| messagev("Checking MPI compiler; compiler=${compiler}; options=${options}; cmdline=${cmdline}; result=${success}") | ||
| endfunction() | ||
|
|
||
| # | ||
|
|
@@ -386,7 +413,8 @@ function (interrogate_mpi_compiler lang try_libs) | |
| # compiler, MPI_${lang}_COMPILER won't be equal to MPI_${lang}_NO_INTERROGATE, and we'll | ||
| # inspect that compiler anew. This allows users to set new compilers w/o rm'ing cache. | ||
| string(COMPARE NOTEQUAL "${MPI_${lang}_NO_INTERROGATE}" "${MPI_${lang}_COMPILER}" interrogate) | ||
|
|
||
|
|
||
| messagev("lang=${lang}; MPI_${lang}_COMPILER=${MPI_${lang}_COMPILER}; MPI_${lang}_NO_INTERROGATE=${MPI_${lang}_NO_INTERROGATE}; interrogate=${interrogate}") | ||
| # If MPI is set already in the cache, don't bother with interrogating the compiler. | ||
| if (interrogate AND ((NOT MPI_${lang}_INCLUDE_PATH) OR (NOT MPI_${lang}_LIBRARIES))) | ||
| if (MPI_${lang}_COMPILER) | ||
|
|
@@ -733,7 +761,7 @@ function(is_file_executable file result_var) | |
|
|
||
| get_filename_component(file_full "${file}" ABSOLUTE) | ||
| string(TOLOWER "${file_full}" file_full_lower) | ||
| #messagev("file_full='${file_full}'") | ||
| messagev("file_full='${file_full}'") | ||
|
|
||
| # If file name ends in .exe on Windows, *assume* executable: | ||
| # | ||
|
|
@@ -777,9 +805,9 @@ function(is_file_executable file result_var) | |
| string(REPLACE "${file_full}" " _file_full_ " file_ov "${file_ov}") | ||
| string(TOLOWER "${file_ov}" file_ov) | ||
|
|
||
| #messagev("file_ov='${file_ov}'") | ||
| messagev("file_ov='${file_ov}'") | ||
| if("${file_ov}" MATCHES "symbolic link") | ||
| #messagev("symlink!") | ||
| messagev("symlink!") | ||
| if(NOT readlink_cmd) | ||
| find_program(readlink_cmd "readlink") | ||
| mark_as_advanced(readlink_cmd) | ||
|
|
@@ -789,15 +817,15 @@ function(is_file_executable file result_var) | |
| OUTPUT_VARIABLE resolved_link | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| ) | ||
| #messagev("recursive call: is_exec(${resolved_link} recursive_result)") | ||
| messagev("recursive call: is_exec(${resolved_link} recursive_result)") | ||
| is_file_executable(${resolved_link} recursive_result) | ||
| #messagev("recursive result: ${recursive_result}") | ||
| messagev("recursive result: ${recursive_result}") | ||
| set(${result_var} ${recursive_result} PARENT_SCOPE) | ||
| else() | ||
| message(WARNING "No 'readlink' command, cant resolve symlink '${file_full}'") | ||
| endif() | ||
| elseif("${file_ov}" MATCHES "executable") | ||
| #messagev("executable!") | ||
| messagev("executable!") | ||
| #if("${file_ov}" MATCHES "text") | ||
| # messagev("but text, so *not* a binary executable!") | ||
| #else() | ||
|
|
@@ -933,7 +961,7 @@ endfunction() | |
| ############################################################ | ||
|
|
||
| # Most mpi distros have some form of mpiexec which gives us something we can reliably look for. | ||
| #messagev("MPI executable: names=${_MPI_EXEC_NAMES},hints=${_MPI_PREFIX_PATH},PATH_SUFFIXES=${_BIN_SUFFIX},PATHOPT=${PATHOPT}") | ||
| messagev("MPI executable: names=${_MPI_EXEC_NAMES},hints=${_MPI_PREFIX_PATH},PATH_SUFFIXES=${_BIN_SUFFIX},PATHOPT=${PATHOPT}") | ||
| find_program(MPIEXEC | ||
| NAMES ${_MPI_EXEC_NAMES} | ||
| HINTS ${_MPI_PREFIX_PATH} | ||
|
|
@@ -987,7 +1015,7 @@ endforeach() | |
| set(_MPI_DETECTED_MNEMONICS ) | ||
| foreach (lang C CXX Fortran) | ||
| if (lang IN_LIST ENABLED_LANGUAGES) | ||
| #messagev("MPI_${lang}_COMPILER '${MPI_${lang}_COMPILER}': CMAKE_${lang}_COMPILER_WORKS=${CMAKE_${lang}_COMPILER_WORKS}") | ||
| messagev("MPI_${lang}_COMPILER '${MPI_${lang}_COMPILER}': CMAKE_${lang}_COMPILER_WORKS=${CMAKE_${lang}_COMPILER_WORKS}") | ||
| if (CMAKE_${lang}_COMPILER_WORKS) | ||
| # If the user supplies a compiler *name* instead of an absolute path, assume that we need to find THAT compiler. | ||
| if (MPI_${lang}_COMPILER) | ||
|
|
@@ -996,7 +1024,7 @@ foreach (lang C CXX Fortran) | |
| set(try_libs FALSE) | ||
| is_file_executable(${MPI_${lang}_COMPILER} MPI_COMPILER_IS_EXECUTABLE) | ||
| if (NOT MPI_COMPILER_IS_EXECUTABLE) | ||
| #messagev("User-defined MPI_${lang}_COMPILER is NOT an executable, looking for matching executable") | ||
| messagev("User-defined MPI_${lang}_COMPILER is NOT an executable, looking for matching executable") | ||
| # Get rid of our default list of names and just search for the name the user wants. | ||
| set(_MPI_${lang}_COMPILER_NAMES ${MPI_${lang}_COMPILER}) | ||
| set(MPI_${lang}_COMPILER "MPI_${lang}_COMPILER-NOTFOUND" CACHE FILEPATH "Cleared" FORCE) | ||
|
|
@@ -1005,19 +1033,29 @@ foreach (lang C CXX Fortran) | |
| set(try_libs TRUE) | ||
| endif() | ||
|
|
||
| #messagev("Looking for MPI_${lang}_COMPILER with names ${_MPI_${lang}_COMPILER_NAMES} at ${_MPI_PREFIX_PATH} + environment PATH") | ||
| messagev("Looking for MPI_${lang}_COMPILER with names ${_MPI_${lang}_COMPILER_NAMES} at ${_MPI_PREFIX_PATH}") | ||
| # Try and find the MPI compiler. First look in the hints directories | ||
| find_program(MPI_${lang}_COMPILER | ||
| NAMES ${_MPI_${lang}_COMPILER_NAMES} | ||
| HINTS ${_MPI_PREFIX_PATH} | ||
| PATH_SUFFIXES ${_BIN_SUFFIX} | ||
| ${PATHOPT}) | ||
| NO_DEFAULT_PATH) | ||
| interrogate_mpi_compiler(${lang} ${try_libs}) | ||
| mark_as_advanced(MPI_${lang}_COMPILER) | ||
| if(NOT $MPI_${lang}_FOUND AND NOT PATHOPT STREQUAL NO_DEFAULT_PATH) | ||
| # If the MPI compiler is not found then look in wider paths. | ||
| messagev("Looking for MPI_${lang}_COMPILER with names ${_MPI_${lang}_COMPILER_NAMES} at ${_MPI_PREFIX_PATH} + environment PATH") | ||
| find_program(MPI_${lang}_COMPILER | ||
| NAMES ${_MPI_${lang}_COMPILER_NAMES} | ||
| HINTS ${_MPI_PREFIX_PATH} | ||
| PATH_SUFFIXES ${_BIN_SUFFIX} | ||
| ${PATHOPT}) | ||
| interrogate_mpi_compiler(${lang} ${try_libs}) | ||
| endif() | ||
|
|
||
| # last ditch try -- if nothing works so far, just try running the regular compiler and | ||
| # see if we can create an MPI executable. | ||
| set(regular_compiler_worked 0) | ||
| if (NOT MPI_${lang}_LIBRARIES OR NOT MPI_${lang}_INCLUDE_PATH) | ||
| if (NOT MPI_${lang}_FOUND) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm hoping the full implications of this change are understood.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we are trying to find an MPI compiler. This is done via an interrogate_mpi_compiler call which sets the MPI_${lang}_FOUND variable based directly on the LIBRARIES and INCLUDE_PATH variables as above. |
||
| try_regular_compiler(${lang} regular_compiler_worked) | ||
| endif() | ||
|
|
||
|
|
@@ -1032,6 +1070,7 @@ foreach (lang C CXX Fortran) | |
| if(MPI_${lang}_FOUND) | ||
| messagev("Found MPI-${lang}!") | ||
| check_mpi_type(${lang}) | ||
| mark_as_advanced(MPI_${lang}_COMPILER) | ||
| endif() | ||
|
|
||
| # See that the found MPI is compatible with the toolchain. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a comment as to why this is not desired?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a comment. Basically some MPI environs set this when they are installed and this can then clash with the MPI environ specified via -DMPI=...