From: degomme Date: Tue, 23 Jun 2015 07:26:35 +0000 (+0200) Subject: Find objdump before admitting privatization is possible and compiling it. X-Git-Tag: v3_12~564 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6236235ea0bc673b3c361cdb8075b6d622c0e84a Find objdump before admitting privatization is possible and compiling it. MacOS has mmap and no objdump, so this disables the feature on this platform for now --- diff --git a/buildtools/Cmake/CompleteInFiles.cmake b/buildtools/Cmake/CompleteInFiles.cmake index 456f61097c..df8b11bfd7 100644 --- a/buildtools/Cmake/CompleteInFiles.cmake +++ b/buildtools/Cmake/CompleteInFiles.cmake @@ -218,6 +218,7 @@ else() SET(HAVE_MMALLOC 0) endif() + if(WIN32) #THOSE FILES ARE FUNCTIONS ARE NOT DETECTED BUT THEY SHOULD... set(HAVE_UCONTEXT_H 1) set(HAVE_MAKECONTEXT 1) @@ -266,7 +267,15 @@ endif() if(enable_smpi) include(FindGFortran) + #really checks for objdump for privatization + find_package(BinUtils QUIET) SET(HAVE_SMPI 1) + + if( NOT "${CMAKE_OBJDUMP}" MATCHES "CMAKE_OBJDUMP-NOTFOUND" AND HAVE_MMAP) + SET(HAVE_PRIVATIZATION 1) + else() + SET(HAVE_PRIVATIZATION 0) + endif() endif() #-------------------------------------------------------------------------------------------------- diff --git a/buildtools/Cmake/PrintArgs.cmake b/buildtools/Cmake/PrintArgs.cmake index 27d6d6d48c..928da8fa14 100644 --- a/buildtools/Cmake/PrintArgs.cmake +++ b/buildtools/Cmake/PrintArgs.cmake @@ -61,6 +61,7 @@ if(enable_print_message) message("HAVE_ASPRINTF ...............: ${HAVE_ASPRINTF}") message("HAVE_VASPRINTF ..............: ${HAVE_VASPRINTF}") message("HAVE_MMAP ...................: ${HAVE_MMAP}") + message("HAVE_PRIVATIZATION ..........: ${HAVE_PRIVATIZATION}") message("HAVE_PROCESS_VM_READV .......: ${HAVE_PROCESS_VM_READV}") message("HAVE_THREAD_LOCAL_STORAGE ...: ${HAVE_THREAD_LOCAL_STORAGE}") message("HAVE_MMALLOC ................: ${HAVE_MMALLOC}") diff --git a/buildtools/Cmake/src/internal_config.h.in b/buildtools/Cmake/src/internal_config.h.in index edfd175a6c..e05ec9c520 100644 --- a/buildtools/Cmake/src/internal_config.h.in +++ b/buildtools/Cmake/src/internal_config.h.in @@ -154,6 +154,9 @@ /* Indicates that we have SMPI FORTRAN support */ #cmakedefine SMPI_FORTRAN @SMPI_FORTRAN@ +/* We have mmap and objdump to handle privatization */ +#cmakedefine HAVE_PRIVATIZATION @HAVE_PRIVATIZATION@ + /* Indicates that we have NS3 support */ #cmakedefine HAVE_NS3 @HAVE_NS3@ diff --git a/src/smpi/smpi_bench.c b/src/smpi/smpi_bench.c index d8630166a6..a67e6366f2 100644 --- a/src/smpi/smpi_bench.c +++ b/src/smpi/smpi_bench.c @@ -621,7 +621,7 @@ void smpi_really_switch_data_segment(int dest) { if(smpi_size_data_exe == 0)//no need to switch return; -#ifdef HAVE_MMAP +#ifdef HAVE_PRIVATIZATION int i; if(smpi_loaded_page==-1){//initial switch, do the copy from the real page here for (i=0; i< SIMIX_process_count(); i++){ @@ -724,7 +724,7 @@ void smpi_get_executable_global_size(){ void smpi_initialize_global_memory_segments(){ -#ifndef HAVE_MMAP +#ifndef HAVE_PRIVATIZATION smpi_privatize_global_variables=0; return; #else @@ -798,7 +798,7 @@ Ask the Internet about tutorials on how to increase the files limit such as: htt void smpi_destroy_global_memory_segments(){ if (smpi_size_data_exe == 0)//no need to switch return; -#ifdef HAVE_MMAP +#ifdef HAVE_PRIVATIZATION int i; for (i=0; i< smpi_process_count(); i++){ if(munmap(smpi_privatisation_regions[i].address, smpi_size_data_exe) < 0) { diff --git a/teshsuite/smpi/mpich3-test/CMakeLists.txt b/teshsuite/smpi/mpich3-test/CMakeLists.txt index 0eb3631560..83a27b0b82 100644 --- a/teshsuite/smpi/mpich3-test/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/CMakeLists.txt @@ -66,7 +66,7 @@ include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include/") if(enable_smpi AND enable_smpi_MPICH3_testsuite) #C version - use automatic privatization if mmap is supported, manual through SMPI macros if not - if(HAVE_MMAP) + if(HAVE_PRIVATIZATION) add_library(mtest_c STATIC util/mtest.c) else() add_library(mtest_c STATIC util/mtest_manual.c) diff --git a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt index 8f1fde7919..08564d827c 100644 --- a/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt +++ b/teshsuite/smpi/mpich3-test/coll/CMakeLists.txt @@ -16,7 +16,7 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite) add_executable(allgather3 allgather3.c) add_executable(allgatherv2 allgatherv2.c) add_executable(allgatherv3 allgatherv3.c) - if(HAVE_MMAP) + if(HAVE_PRIVATIZATION) add_executable(allgatherv4 allgatherv4.c) else() add_executable(allgatherv4 allgatherv4_manual.c)