Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Find objdump before admitting privatization is possible and compiling it.
authordegomme <augustin.degomme@unibas.ch>
Tue, 23 Jun 2015 07:26:35 +0000 (09:26 +0200)
committerdegomme <augustin.degomme@unibas.ch>
Tue, 23 Jun 2015 07:27:04 +0000 (09:27 +0200)
MacOS has mmap and no objdump, so this disables the feature on this platform for now

buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/PrintArgs.cmake
buildtools/Cmake/src/internal_config.h.in
src/smpi/smpi_bench.c
teshsuite/smpi/mpich3-test/CMakeLists.txt
teshsuite/smpi/mpich3-test/coll/CMakeLists.txt

index 456f610..df8b11b 100644 (file)
@@ -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()
 
 #--------------------------------------------------------------------------------------------------
index 27d6d6d..928da8f 100644 (file)
@@ -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}")
index edfd175..e05ec9c 100644 (file)
 /* 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@
 
index d863016..a67e636 100644 (file)
@@ -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) {
index 0eb3631..83a27b0 100644 (file)
@@ -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)
index 8f1fde7..08564d8 100644 (file)
@@ -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)