Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 24 Mar 2014 07:46:39 +0000 (08:46 +0100)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Mon, 24 Mar 2014 07:46:39 +0000 (08:46 +0100)
36 files changed:
COPYING
buildtools/Cmake/AddTests.cmake
buildtools/Cmake/CompleteInFiles.cmake
buildtools/Cmake/DefinePackages.cmake
buildtools/Cmake/GenerateDoc.cmake
buildtools/Cmake/MakeJava.cmake
buildtools/Cmake/src/internal_config.h.in
include/surf/surf_routing.h
include/xbt/mmalloc.h
src/bindings/java/org/simgrid/msg/NativeLib.java [deleted file]
src/bindings/java/org/simgrid/trace/Trace.java
src/include/mc/mc.h
src/include/surf/surf.h
src/include/xbt/win32_ucontext.h [moved from include/xbt/win32_ucontext.h with 100% similarity]
src/msg/msg_io.c
src/simgrid/sg_config.c
src/simix/smx_context_sysv.c
src/smpi/private.h
src/smpi/smpi_base.c
src/smpi/smpi_bench.c
src/smpi/smpi_global.c
src/smpi/smpi_mpi_dt.c
src/surf/workstation_interface.hpp
src/xbt/log.c
teshsuite/smpi/mpich3-test/f77/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f77/pt2pt/testlist
teshsuite/smpi/mpich3-test/f77/util/mtestf.f
teshsuite/smpi/mpich3-test/f90/pt2pt/CMakeLists.txt
teshsuite/smpi/mpich3-test/f90/pt2pt/allpairf90.f90
teshsuite/smpi/mpich3-test/f90/pt2pt/testlist
teshsuite/smpi/mpich3-test/f90/util/mtestf90.f90
teshsuite/smpi/mpich3-test/util/mtest.c
testsuite/mc/CMakeLists.txt
tools/CMakeLists.txt
tools/check_dist_archive.exclude
tools/generate.sh [moved from generate.sh with 100% similarity]

diff --git a/COPYING b/COPYING
index 6ff568f..4ff2f05 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -92,7 +92,7 @@ include/xbt/mmalloc.h
 
 In order to use ucontext with windows platform we had those files :
         src/xbt/win32_ucontext.c
-        include/xbt/win32_ucontext.h
+        src/include/xbt/win32_ucontext.h
 
 Their copyright is the following:
 
index f9b62f9..a3330e3 100644 (file)
@@ -570,16 +570,16 @@ if(NOT enable_memcheck)
   # END TESH TESTS
 
   if(enable_smpi_MPICH3_testsuite)
-    ADD_TEST(smpi-mpich3-coll-thread            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread)
-    ADD_TEST(smpi-mpich3-coll-ompi-thread       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0)
-    ADD_TEST(smpi-mpich3-coll-mpich-thread      ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich)
+    ADD_TEST(smpi-mpich3-coll-thread            ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/privatize_global_variables:yes)
+    ADD_TEST(smpi-mpich3-coll-ompi-thread       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes)
+    ADD_TEST(smpi-mpich3-coll-mpich-thread      ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes)
     set_tests_properties(smpi-mpich3-coll-thread smpi-mpich3-coll-ompi-thread smpi-mpich3-coll-mpich-thread PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     if(CONTEXT_UCONTEXT)
-      ADD_TEST(smpi-mpich3-coll-ompi-ucontext   ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0)
+      ADD_TEST(smpi-mpich3-coll-ompi-ucontext   ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:ucontext -execarg=--cfg=smpi/coll_selector:ompi -execarg=--cfg=smpi/send_is_detached_thres:0 -execarg=--cfg=smpi/privatize_global_variables:yes)
       set_tests_properties(smpi-mpich3-coll-ompi-ucontext PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
     if(HAVE_RAWCTX)
-      ADD_TEST(smpi-mpich3-coll-mpich-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich)
+      ADD_TEST(smpi-mpich3-coll-mpich-raw       ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/coll perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/coll -tests=testlist -execarg=--cfg=contexts/factory:raw -execarg=--cfg=smpi/coll_selector:mpich -execarg=--cfg=smpi/privatize_global_variables:yes)
       set_tests_properties(smpi-mpich3-coll-mpich-raw PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
 
@@ -594,11 +594,11 @@ if(NOT enable_memcheck)
     endif()
 
     if(SMPI_F2C)
-      ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/factory:thread -execarg=--cfg=contexts/stack_size:8000)
+      ADD_TEST(smpi-mpich3-thread-f77           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f77/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f77/ -tests=testlist -execarg=--cfg=contexts/stack_size:8000 -execarg=--cfg=smpi/privatize_global_variables:yes)
       set_tests_properties(smpi-mpich3-thread-f77 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
     if(SMPI_F90)
-      ADD_TEST(smpi-mpich3-thread-f90           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=contexts/factory:thread)
+      ADD_TEST(smpi-mpich3-thread-f90           ${CMAKE_COMMAND} -E chdir ${CMAKE_BINARY_DIR}/teshsuite/smpi/mpich3-test/f90/ perl ${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/runtests -mpiexec=${CMAKE_BINARY_DIR}/smpi_script/bin/smpirun -srcdir=${CMAKE_HOME_DIRECTORY}/teshsuite/smpi/mpich3-test/f90/ -tests=testlist -execarg=--cfg=smpi/privatize_global_variables:yes)
       set_tests_properties(smpi-mpich3-thread-f90 PROPERTIES PASS_REGULAR_EXPRESSION "tests passed!")
     endif()
   endif()
index 1e21249..ade8857 100644 (file)
@@ -236,6 +236,7 @@ else()
     message(STATUS "Warning: support for model-checking has been disabled because HAVE_MMALLOC is false")
   endif()
   SET(HAVE_MC 0)
+  SET(HAVE_MMALLOC 0)
   SET(MMALLOC_WANT_OVERRIDE_LEGACY 0)
 endif()
 
@@ -429,9 +430,9 @@ endif()
 
 if(WIN32)
   if(ARCH_32_BITS)
-    set(mcsc_flags "-D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    set(mcsc_flags "-D_XBT_WIN32 -D_I_X86_ -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
   else()
-    set(mcsc_flags "-D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    set(mcsc_flags "-D_XBT_WIN32 -D_AMD64_ -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
   endif()
 endif()
 
@@ -570,7 +571,7 @@ if(HAVE_MAKECONTEXT OR WIN32)
     else()
       set(makecontext_CPPFLAGS "-DTEST_makecontext -D_AMD64_")
     endif()
-    set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
+    set(makecontext_CPPFLAGS_2 "-D_XBT_WIN32 -I${CMAKE_HOME_DIRECTORY}/src/include/xbt -I${CMAKE_HOME_DIRECTORY}/src/xbt")
   endif()
 
   file(REMOVE ${CMAKE_BINARY_DIR}/conftestval)
index 3b5ee1a..a441a88 100644 (file)
@@ -1,7 +1,6 @@
 ### define source packages
 
 set(EXTRA_DIST
-  include/xbt/win32_ucontext.h
   src/bindings/java/MANIFEST.MF.in
   src/include/instr/instr_interface.h
   src/include/mc/datatypes.h
@@ -17,6 +16,7 @@ set(EXTRA_DIST
   src/include/surf/surf_resource_lmm.h
   src/include/surf/surfxml_parse_values.h
   src/include/surf/trace_mgr.h
+  src/include/xbt/win32_ucontext.h
   src/include/xbt/wine_dbghelp.h
   src/include/xbt/xbt_os_time.h
   src/msg/msg_mailbox.h
@@ -568,9 +568,11 @@ set(MC_SRC
   src/mc/mc_compare.c
   src/mc/mc_dpor.c
   src/mc/mc_global.c
-  src/mc/mc_dwarf
+  src/mc/mc_dwarf.c
   src/mc/mc_member.c
+  src/mc/mc_dwarf_attrnames.h
   src/mc/mc_dwarf_expression.c
+  src/mc/mc_dwarf_tagnames.h
   src/mc/mc_liveness.c
   src/mc/mc_memory.c
   src/mc/mc_private.h
index 6d9769e..d4f482c 100644 (file)
@@ -63,7 +63,7 @@ if(DOXYGEN_PATH)
     COMMAND ${DOXYGEN_PATH}/doxygen Doxyfile
     COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_HOME_DIRECTORY}/doc/simgrid_modules.map
     COMMAND ${CMAKE_COMMAND} -E echo "XX Javadoc pass"
-    COMMAND ${JAVADOC_PATH}/javadoc -quiet -d ${CMAKE_HOME_DIRECTORY}/doc/html/javadoc/ ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/msg/*.java
+    COMMAND ${JAVADOC_PATH}/javadoc -quiet -d ${CMAKE_HOME_DIRECTORY}/doc/html/javadoc/ ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*.java ${CMAKE_HOME_DIRECTORY}/src/bindings/java/org/simgrid/*/*.java
     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/doc
     )
 
index 8091c98..c8df82a 100644 (file)
@@ -124,3 +124,4 @@ swig_add_module(surf-java java ${JSURF_SWIG_SRC} ${JSURF_JAVA_C_SRC})
 swig_link_libraries(surf-java simgrid)
 
 add_dependencies(simgrid-java surf-java)
+add_dependencies(simgrid-java_pre_jar surf-java)
index bd406de..71b4bb4 100644 (file)
 /* Define to 1 if mmalloc is compiled in. */
 #cmakedefine HAVE_MMALLOC @HAVE_MMALLOC@
 
+/* Define to 1 if mmap is available */
+#cmakedefine HAVE_MMAP @HAVE_MMAP@
+
 /* Define to 1 if you have the `getdtablesize' function. */
 #cmakedefine HAVE_GETDTABLESIZE @HAVE_GETDTABLESIZE@
 
index a7a5a50..95984aa 100644 (file)
@@ -8,7 +8,7 @@
 #define _SURF_SURF_ROUTING_H
 
 #include "xbt/lib.h"
-#include "simgrid/platf_interface.h"
+#include "simgrid/platf.h"
 
 SG_BEGIN_DECL()
 
index 35c68e0..4ec2238 100644 (file)
@@ -10,6 +10,9 @@
 #ifndef MMALLOC_H
 #define MMALLOC_H 1
 
+#include <simgrid_config.h>
+#ifdef HAVE_MMALLOC
+
 #ifdef HAVE_STDDEF_H
 #  include <stddef.h>
 #else
@@ -19,7 +22,6 @@
 
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
-#include "mc/datatypes.h"
 
 /* Datatype representing a separate heap. The whole point of the mmalloc module
  * is to allow several such heaps in the process. It thus works by redefining
@@ -59,6 +61,8 @@ xbt_mheap_t mmalloc_get_current_heap(void);
 
 struct s_mc_snapshot;
 
+typedef struct s_dw_type *dw_type_t;
+
 int mmalloc_compare_heap(struct s_mc_snapshot* snapshot1, struct s_mc_snapshot* snapshot2, xbt_mheap_t heap1, xbt_mheap_t heap2);
 int mmalloc_linear_compare_heap(xbt_mheap_t heap1, xbt_mheap_t heap2);
 int init_heap_information(xbt_mheap_t heap1, xbt_mheap_t heap2, xbt_dynar_t to_ignore1, xbt_dynar_t to_ignore2);
@@ -68,4 +72,5 @@ void reset_heap_information(void);
 size_t mmalloc_get_bytes_used(xbt_mheap_t);
 ssize_t mmalloc_get_busy_size(xbt_mheap_t, void *ptr);
 
+#endif
 #endif                          /* MMALLOC_H */
diff --git a/src/bindings/java/org/simgrid/msg/NativeLib.java b/src/bindings/java/org/simgrid/msg/NativeLib.java
deleted file mode 100644 (file)
index 151fb95..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.simgrid.msg;
-
-public final class NativeLib {
-    public static String getPath() {
-        String prefix = "NATIVE";
-        String os = System.getProperty("os.name");
-        String arch = System.getProperty("os.arch");
-
-        if (os.toLowerCase().startsWith("^win"))
-            os = "Windows";
-        else if (os.contains("OS X"))
-            os = "Darwin";
-
-        if (arch.matches("^i[3-6]86$"))
-            arch = "x86";
-        else if (arch.equalsIgnoreCase("amd64"))
-            arch = "x86_64";
-
-        os = os.replace(' ', '_');
-        arch = arch.replace(' ', '_');
-
-        return prefix + "/" + os + "/" + arch + "/";
-    }
-
-    public static void main(String[] args) {
-        System.out.println(getPath());
-    }
-}
index 2a14056..425f708 100644 (file)
@@ -302,7 +302,7 @@ public final class Trace {
        /**
         * Set the value of a variable of a VM. 
         * 
-        * @param host
+        * @param vm
         * @param variable
         * @param value
         */
index 80f7146..e207590 100644 (file)
@@ -11,7 +11,6 @@
 #include "xbt/fifo.h"
 #include "xbt/dict.h"
 #include "xbt/function_types.h"
-#include "mc/datatypes.h"
 #include "simgrid/simix.h"
 #include "simgrid/modelchecker.h" /* our public interface (and definition of HAVE_MC) */
 #include "xbt/automaton.h"
index 0eeb7c2..87fb6aa 100644 (file)
@@ -409,8 +409,7 @@ XBT_PUBLIC(surf_action_t) surf_workstation_sleep(surf_resource_t resource, doubl
  * @brief Open a file on a workstation
  * 
  * @param workstation The surf workstation
- * @param mount The mount point
- * @param path The path to the file
+ * @param fullpath The path to the file
  * @return The surf action corresponding to the openning
  */
 XBT_PUBLIC(surf_action_t) surf_workstation_open(surf_resource_t workstation, const char* fullpath);
index ec54dd9..c7bbe8c 100644 (file)
@@ -113,7 +113,6 @@ sg_size_t MSG_file_write(msg_file_t fd, sg_size_t size)
 /** \ingroup msg_file_management
  * \brief Opens the file whose name is the string pointed to by path
  *
- * \param mount is the mount point where find the file is located
  * \param fullpath is the file location on the storage
  * \param data user data to attach to the file
  *
index 7d4da0b..ad4794f 100644 (file)
@@ -771,6 +771,11 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_int, 1, 1, NULL, NULL);
     xbt_cfg_setdefault_int(_sg_cfg_set, "smpi/send_is_detached_thres", 65536);
 
+    xbt_cfg_register(&_sg_cfg_set, "smpi/privatize_global_variables",
+                     "Boolean indicating whether we should privatize global variable at runtime.",
+                     xbt_cfgelm_boolean, 1, 1, NULL, NULL);
+    xbt_cfg_setdefault_boolean(_sg_cfg_set, "smpi/privatize_global_variables", "no");
+
     //For smpi/bw_factor and smpi/lat_factor
     //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN"
     //test is if( size >= thresholdN ) return valueN;
index d8f90fe..cb5b022 100644 (file)
@@ -15,7 +15,7 @@
 #include "mc/mc.h"
 
 #ifdef _XBT_WIN32
-#  include <win32_ucontext.h>     /* context relative declarations */
+#  include <xbt/win32_ucontext.h>     /* context relative declarations */
 #else
 #  include <ucontext.h>           /* context relative declarations */
 #endif
index a0af750..e692c38 100644 (file)
@@ -301,10 +301,20 @@ int smpi_coll_basic_alltoallv(void *sendbuf, int *sendcounts,
 // utilities
 extern double smpi_cpu_threshold;
 extern double smpi_running_power;
+extern int smpi_privatize_global_variables;
+extern char* start_data_exe; //start of the data+bss segment of the executable
+extern int size_data_exe; //size of the data+bss segment of the executable
+
+
+void switch_data_segment(int);
+void smpi_get_executable_global_size(void);
+void smpi_initialize_global_memory_segments(void);
+void smpi_destroy_global_memory_segments(void);
 void smpi_bench_destroy(void);
 void smpi_bench_begin(void);
 void smpi_bench_end(void);
 
+
 // f77 wrappers
 void mpi_init_(int*);
 void mpi_finalize_(int*);
index 5362b82..6295038 100644 (file)
@@ -376,6 +376,15 @@ void smpi_mpi_start(MPI_Request request)
       if(request->old_type->has_subtype == 0){
         oldbuf = request->buf;
         if (!_xbt_replay_is_active() && oldbuf && request->size!=0){
+          if((smpi_privatize_global_variables)
+           && ((char*)request->buf >= start_data_exe)
+           && ((char*)request->buf < start_data_exe + size_data_exe )
+       ){
+                 XBT_WARN("Privatization : We are sending from a zone inside global memory. Switch data segment ");
+                 switch_data_segment(smpi_process_index());
+       }
+
+
           buf = xbt_malloc(request->size);
           memcpy(buf,oldbuf,request->size);
         }
@@ -587,6 +596,15 @@ static void finish_wait(MPI_Request * request, MPI_Status * status)
     MPI_Datatype datatype = req->old_type;
 
     if(datatype->has_subtype == 1){
+      if (!_xbt_replay_is_active()){
+        if( smpi_privatize_global_variables
+            && ((char*)req->old_buf >= start_data_exe)
+            && ((char*)req->old_buf < start_data_exe + size_data_exe )
+        ){
+            XBT_VERB("Privatization : We are unserializing to a zone in global memory - Switch data segment ");
+            switch_data_segment(smpi_process_index());
+        }
+      }
       // This part handles the problem of non-contignous memory
       // the unserialization at the reception
       s_smpi_subtype_t *subtype = datatype->substruct;
index 9387099..126d181 100644 (file)
@@ -4,6 +4,7 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "internal_config.h"
 #include "private.h"
 #include "xbt/dict.h"
 #include "xbt/sysdep.h"
@@ -69,6 +70,13 @@ __thread int smpi_current_rank = 0;      /* Updated after each MPI call */
 double smpi_cpu_threshold;
 double smpi_running_power;
 
+int* fds;
+void** mappings;
+int loaded_page = -1;
+char* start_data_exe = NULL;
+int size_data_exe = 0;
+int smpi_privatize_global_variables;
+
 typedef struct {
   int fd;
   int count;
@@ -174,8 +182,11 @@ void smpi_execute(double duration)
   }
 }
 
+void switch_data_segment(int dest);
+
 void smpi_bench_begin(void)
 {
+  switch_data_segment(smpi_process_index());
   xbt_os_threadtimer_start(smpi_process_timer());
   smpi_current_rank = smpi_process_index();
 }
@@ -184,6 +195,7 @@ void smpi_bench_end(void)
 {
   xbt_os_timer_t timer = smpi_process_timer();
   xbt_os_threadtimer_stop(timer);
+//  switch_data_segment(smpi_process_count());
   if (smpi_process_get_sampling()) {
     XBT_CRITICAL("Cannot do recursive benchmarks.");
     XBT_CRITICAL("Are you trying to make a call to MPI within a SMPI_SAMPLE_ block?");
@@ -554,3 +566,191 @@ void* smpi_shared_set_call(const char* func, const char* input, void* data) {
    free(loc);
    return data;
 }
+
+
+
+
+#ifndef WIN32
+#define TOPAGE(addr) (void *)(((unsigned long)(addr) / xbt_pagesize) * xbt_pagesize)
+
+
+/*
+ * - read the executable data+bss section addresses and sizes
+ * - for each process create a copy of these sections with mmap
+ * - store them in a dynar
+ *
+ */
+
+
+
+void switch_data_segment(int dest){
+
+  if(size_data_exe == 0)//no need to switch
+    return;
+
+  if (loaded_page==dest)//no need to switch either
+    return;
+#ifdef HAVE_MMAP
+  int current= fds[dest];
+  XBT_VERB("Switching data frame to the one of process %d", dest);
+  void* tmp = mmap (TOPAGE(start_data_exe), size_data_exe, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, current, 0);
+  msync(TOPAGE(start_data_exe), size_data_exe, MS_SYNC | MS_INVALIDATE );
+  if (tmp != TOPAGE(start_data_exe))
+    xbt_die("Couldn't map the new region");
+  loaded_page=dest;
+#endif
+}
+
+void smpi_get_executable_global_size(){
+  int size_bss_binary=0;
+  int size_data_binary=0;
+  FILE *fp;
+  char *line = NULL;            /* Temporal storage for each line that is readed */
+  ssize_t read;                 /* Number of bytes readed */
+  size_t n = 0;                 /* Amount of bytes to read by xbt_getline */
+
+  char *lfields[7];
+  int i, found = 0;
+
+  char *command = bprintf("objdump --section-headers %s", xbt_binary_name);
+
+  fp = popen(command, "r");
+
+  if(fp == NULL){
+    perror("popen failed");
+    xbt_abort();
+  }
+
+  while ((read = xbt_getline(&line, &n, fp)) != -1 && found != 2) {
+
+    if(n == 0)
+      continue;
+
+    /* Wipeout the new line character */
+    line[read - 1] = '\0';
+
+    lfields[0] = strtok(line, " ");
+
+    if(lfields[0] == NULL)
+      continue;
+
+    if(strcmp(lfields[0], "Sections:") == 0
+        || strcmp(lfields[0], "Idx") == 0
+        || strncmp(lfields[0], xbt_binary_name, strlen(xbt_binary_name)) == 0)
+      continue;
+
+    for (i = 1; i < 7 && lfields[i - 1] != NULL; i++) {
+      lfields[i] = strtok(NULL, " ");
+    }
+
+    /*
+     * we are looking for these fields
+    23 .data         02625a20  00000000006013e0  00000000006013e0  000013e0  2**5
+                     CONTENTS, ALLOC, LOAD, DATA
+    24 .bss          02625a40  0000000002c26e00  0000000002c26e00  02626e00  2**5
+                     ALLOC
+    */
+
+    if(i>=6){
+      if(strcmp(lfields[1], ".data") == 0){
+        size_data_binary = strtoul(lfields[2], NULL, 16);
+        start_data_exe = (char*) strtoul(lfields[4], NULL, 16);
+        found++;
+      }else if(strcmp(lfields[1], ".bss") == 0){
+        //the beginning of bss is not exactly the end of data if not aligned, grow bss reported size accordingly
+        //TODO : check if this is OK, as some segments may be inserted between them.. 
+        size_bss_binary = ((char*) strtoul(lfields[4], NULL, 16) - (start_data_exe + size_data_binary))
+                          + strtoul(lfields[2], NULL, 16);
+        found++;
+       }
+
+    }
+
+  }
+
+  size_data_exe =(unsigned long)start_data_exe - (unsigned long)TOPAGE(start_data_exe)+ size_data_binary+size_bss_binary;
+  xbt_free(command);
+  xbt_free(line);
+  pclose(fp);
+
+}
+
+void smpi_initialize_global_memory_segments(){
+
+#ifndef HAVE_MMAP
+  smpi_privatize_global_variables=0;
+  return;
+#else
+
+  unsigned int i = 0;
+  smpi_get_executable_global_size();
+
+  XBT_DEBUG ("bss+data segment found : size %d starting at %p",size_data_exe, start_data_exe );
+
+  if(size_data_exe == 0){//no need to switch
+    smpi_privatize_global_variables=0;
+    return;
+  }
+
+  fds= (int*)xbt_malloc((smpi_process_count())*sizeof(int));
+  mappings= (void**)xbt_malloc((smpi_process_count())*sizeof(void*));
+
+
+  for (i=0; i< SIMIX_process_count(); i++){
+      //create SIMIX_process_count() mappings of this size with the same data inside
+      void *address = NULL, *tmp = NULL;
+      char path[] = "/dev/shm/my-buffer-XXXXXX";
+      int status;
+      int file_descriptor= mkstemp (path);
+      if (file_descriptor < 0)
+        xbt_die("Impossible to create temporary file for memory mapping");
+      status = unlink (path);
+      if (status)
+        xbt_die("Impossible to unlink temporary file for memory mapping");
+
+      status = ftruncate(file_descriptor, size_data_exe);
+      if(status)
+        xbt_die("Impossible to set the size of the temporary file for memory mapping");
+
+      /* Ask for a free region */
+      address = mmap (NULL, size_data_exe, PROT_NONE, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+
+      if (address == MAP_FAILED)
+        xbt_die("Couldn't find a free region for memory mapping");
+
+      tmp = mmap (address, size_data_exe, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_SHARED, file_descriptor, 0);
+
+      if (tmp != address)
+        xbt_die("Couldn't obtain the right address");
+      //initialize the values
+      memcpy(address,TOPAGE(start_data_exe),size_data_exe);
+
+      //store the address of the mapping for further switches
+      fds[i]=file_descriptor;
+      mappings[i]= address;
+  }
+
+#endif
+
+}
+
+void smpi_destroy_global_memory_segments(){
+  if(size_data_exe == 0)//no need to switch
+    return;
+#ifdef HAVE_MMAP
+  int i;
+  for (i=0; i< smpi_process_count(); i++){
+    if(munmap(mappings[i],size_data_exe) < 0) {
+      XBT_WARN("Unmapping of fd %d failed: %s", fds[i], strerror(errno));
+    }
+    close(fds[i]);
+  }
+  xbt_free(mappings);
+  xbt_free(fds);
+
+#endif
+
+}
+
+
+#endif
index 37f8dd0..60e550f 100644 (file)
@@ -328,7 +328,29 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm,
 {
   XBT_DEBUG("Copy the data over");
   if(_xbt_replay_is_active()) return;
-  memcpy(comm->comm.dst_buff, buff, buff_size);
+  void* tmpbuff=buff;
+
+  if((smpi_privatize_global_variables)
+      && ((char*)buff >= start_data_exe)
+      && ((char*)buff < start_data_exe + size_data_exe )
+    ){
+       XBT_WARN("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !");
+       switch_data_segment(((smpi_process_data_t)SIMIX_process_get_data(comm->comm.src_proc))->index);
+       tmpbuff = (void*)xbt_malloc(buff_size);
+       memcpy(tmpbuff, buff, buff_size);
+  }
+
+
+  if((smpi_privatize_global_variables)
+      && ((char*)comm->comm.dst_buff >= start_data_exe)
+      && ((char*)comm->comm.dst_buff < start_data_exe + size_data_exe )
+    ){
+       XBT_WARN("Privatization : We are copying to a zone inside global memory - Switch data segment");
+       switch_data_segment(((smpi_process_data_t)SIMIX_process_get_data(comm->comm.dst_proc))->index);
+  }
+
+
+  memcpy(comm->comm.dst_buff, tmpbuff, buff_size);
   if (comm->comm.detached) {
     // if this is a detached send, the source buffer was duplicated by SMPI
     // sender to make the original buffer available to the application ASAP
@@ -339,6 +361,9 @@ static void smpi_comm_copy_buffer_callback(smx_action_t comm,
     //inside the user data and should be free 
     comm->comm.src_buff = NULL;
   }
+
+  if(tmpbuff!=buff)xbt_free(tmpbuff);
+
 }
 
 void smpi_global_init(void)
@@ -383,6 +408,8 @@ void smpi_global_init(void)
              "Use the option \"--cfg=smpi/running_power:<flops>\" to set its value."
              "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information. ");
   }
+  if(smpi_privatize_global_variables)
+    smpi_initialize_global_memory_segments();
 }
 
 void smpi_global_destroy(void)
@@ -406,7 +433,8 @@ void smpi_global_destroy(void)
   }
   xbt_free(process_data);
   process_data = NULL;
-
+  if(smpi_privatize_global_variables)
+    smpi_destroy_global_memory_segments();
   smpi_free_static();
 }
 
@@ -565,6 +593,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]), int argc, char *argv[])
 
   smpi_cpu_threshold = sg_cfg_get_double("smpi/cpu_threshold");
   smpi_running_power = sg_cfg_get_double("smpi/running_power");
+  smpi_privatize_global_variables = sg_cfg_get_boolean("smpi/privatize_global_variables");
   if (smpi_cpu_threshold < 0)
     smpi_cpu_threshold = DBL_MAX;
 
index 8be8134..ee348b8 100644 (file)
@@ -1489,6 +1489,11 @@ void smpi_op_destroy(MPI_Op op)
 void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
                    MPI_Datatype * datatype)
 {
+  if(smpi_privatize_global_variables){ //we need to switch here, as the called function may silently touch global variables
+    XBT_VERB("Applying operation, switch to the right data frame ");
+    switch_data_segment(smpi_process_index());
+  }
+
   if(!_xbt_replay_is_active())
   op->func(invec, inoutvec, len, datatype);
 }
index 621771d..0b59b94 100644 (file)
@@ -258,8 +258,7 @@ public:
   /**
    * @brief Open a file
    * 
-   * @param mount The mount point
-   * @param path The full path to the file
+   * @param fullpath The full path to the file
    * 
    * @return The StorageAction corresponding to the opening
    */
index 24d7ec4..4a65fcd 100644 (file)
@@ -623,7 +623,9 @@ static void xbt_log_connect_categories(void)
   XBT_LOG_CONNECT(mc_checkpoint);
   XBT_LOG_CONNECT(mc_compare);
   XBT_LOG_CONNECT(mc_dpor);
+  XBT_LOG_CONNECT(mc_dwarf);
   XBT_LOG_CONNECT(mc_global);
+  XBT_LOG_CONNECT(mc_hash);
   XBT_LOG_CONNECT(mc_liveness);
   XBT_LOG_CONNECT(mc_memory);
   XBT_LOG_CONNECT(mc_memory_map);
index 5d4714b..e7cc14a 100644 (file)
@@ -16,12 +16,12 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F2C)
   add_executable(allpairf allpairf.f)
 #  add_executable(greqf greqf.f dummyf.f)
   #add_executable(mprobef mprobef.f)
-#  add_executable(statusesf statusesf.f)
+  add_executable(statusesf statusesf.f)
 
   target_link_libraries(allpairf simgrid mtest_f77)
 #  target_link_libraries(greqf simgrid mtest_f77)
   #target_link_libraries(mprobef simgrid mtest_f77)
-#  target_link_libraries(statusesf simgrid mtest_f77)
+  target_link_libraries(statusesf simgrid mtest_f77)
 
 endif()
 
index 3385b9d..fe7ad6b 100644 (file)
@@ -1,4 +1,4 @@
-#statusesf 1
+statusesf 1
 #greqf 1
 allpairf 2
-#mprobef 2 mpiversion=3.0
+mprobef 2 mpiversion=3.0
index f1a137c..81edc25 100644 (file)
@@ -15,8 +15,6 @@ C       about out-of-order statements
         logical dbgflag
         integer wrank
         common /mtest/ dbgflag, wrank
-        integer myindex
-        common /grr/ myindex
 
         call MPI_Initialized( flag, ierr )
         if (.not. flag) then
@@ -24,7 +22,6 @@ C       about out-of-order statements
         endif
 
         dbgflag = .false.
-        myindex = 0
         call MPI_Comm_rank( MPI_COMM_WORLD, wrank, ierr )
         end
 C
@@ -56,7 +53,8 @@ C A simple get intracomm for now
         integer comm, min_size, size, rank
         logical qsmaller
         integer myindex
-        common /grr/ myindex 
+        save myindex
+        data myindex /0/
 
         comm = MPI_COMM_NULL
         if (myindex .eq. 0) then
@@ -75,7 +73,6 @@ C A simple get intracomm for now
         endif
         myindex = mod( myindex, 4 ) + 1
         MTestGetIntracomm = comm .ne. MPI_COMM_NULL
-        qsmaller=.true.
         end
 C
         subroutine MTestFreeComm( comm )
index 51a0fcb..9275e6a 100644 (file)
@@ -11,11 +11,11 @@ if(enable_smpi AND enable_smpi_MPICH3_testsuite AND SMPI_F90)
   set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")
   include_directories("${CMAKE_HOME_DIRECTORY}/include/smpi")
 
-#  add_executable(allpairf90 allpairf90.f90)
+  add_executable(allpairf90 allpairf90.f90)
 #  add_executable(greqf90 greqf90.f90 dummyf90.f90)
 #  add_executable(mprobef90 mprobef90.f90)
   add_executable(statusesf90 statusesf90.f90)
-#  target_link_libraries(allpairf90 simgrid mtest_f90)
+  target_link_libraries(allpairf90 simgrid mtest_f90)
 #  target_link_libraries(greqf90 simgrid mtest_f90)
 #  target_link_libraries(mprobef90 simgrid mtest_f90)
   target_link_libraries(statusesf90 simgrid mtest_f90)
index 70f5c51..92251df 100644 (file)
@@ -21,6 +21,7 @@
       call MTest_Init( ierr )
 
       do while ( mtestGetIntraComm( comm, 2, .false. ) )
+
          call test_pair_send( comm, errs )
          call test_pair_ssend( comm, errs )
          !call test_pair_rsend( comm, errs )
index b39a1a0..920fba2 100644 (file)
@@ -1,5 +1,5 @@
 # This file generated by f77tof90
 statusesf90 1
 #greqf90 1
-#allpairf90 2
+allpairf90 2
 mprobef90 2 mpiversion=3.0
index 8e44792..56b76b7 100644 (file)
            endif
         endif
         end
-
-module array
-        integer, dimension(:), allocatable :: myindex
-end module
-
 !
 ! A simple get intracomm for now
         logical function MTestGetIntracomm( comm, min_size, qsmaller )
-        use array
         use mpi
-
         integer ierr
         integer comm, min_size, size, rank
         logical qsmaller
+        integer myindex
+        save myindex
+        data myindex /0/
 
-        integer status
-        call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
-        
-        if(.not. allocated(myindex)) then
-            allocate(myindex(size), STAT=status)
-            call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
-            myindex(rank+1)=0
-        endif
-
-        !data myindex /0/
-        
-        
-
-        if (myindex(rank+1) .eq. 0) then
+        comm = MPI_COMM_NULL
+        if (myindex .eq. 0) then
            comm = MPI_COMM_WORLD
-        else if (myindex(rank+1) .eq. 1) then
+        else if (myindex .eq. 1) then
            call mpi_comm_dup( MPI_COMM_WORLD, comm, ierr )
-        else if (myindex(rank+1) .eq. 2) then
+        else if (myindex .eq. 2) then
            call mpi_comm_size( MPI_COMM_WORLD, size, ierr )
            call mpi_comm_rank( MPI_COMM_WORLD, rank, ierr )
            call mpi_comm_split( MPI_COMM_WORLD, 0, size - rank, comm,  &
       &                                 ierr )
         else
-           if (min_size .eq. 1 .and. myindex(rank+1) .eq. 3) then
+           if (min_size .eq. 1 .and. myindex .eq. 3) then
               comm = MPI_COMM_SELF
            endif
         endif
-        myindex(rank+1) = mod( myindex(rank+1), 4 ) + 1
+        myindex = mod( myindex, 4 ) + 1
         MTestGetIntracomm = comm .ne. MPI_COMM_NULL
-        qsmaller=.true.
         end
 !
         subroutine MTestFreeComm( comm )
index e922072..e75d17b 100644 (file)
@@ -7,7 +7,6 @@
 #include "mpi.h"
 #include "mpitestconf.h"
 #include "mpitest.h"
-#include "smpi_cocci.h"
 #if defined(HAVE_STDIO_H) || defined(STDC_HEADERS)
 #include <stdio.h>
 #endif
@@ -49,13 +48,13 @@ static void MTestResourceSummary( FILE * );
 /* Here is where we could put the includes and definitions to enable
    memory testing */
 
-SMPI_VARINIT_GLOBAL_AND_SET(dbgflag, int, 0); /* Flag used for debugging */
-SMPI_VARINIT_GLOBAL_AND_SET(wrank, int, -1);  /* World rank */
-SMPI_VARINIT_GLOBAL_AND_SET(verbose, int, 0); /* Message level (0 is none) */
-SMPI_VARINIT_GLOBAL_AND_SET(returnWithVal, int, 0); /* Allow programs to return
-                                  with a non-zero if there was an error (may
-                                  cause problems with some runtime systems) */
-SMPI_VARINIT_GLOBAL_AND_SET(usageOutput, int, 0); /* */
+static int dbgflag = 0;         /* Flag used for debugging */
+static int wrank = -1;          /* World rank */
+static int verbose = 0;         /* Message level (0 is none) */
+static int returnWithVal = 0;   /* Allow programs to return with a non-zero 
+                                  if there was an error (may cause problems
+                                  with some runtime systems) */
+static int usageOutput = 0;     /* */
 
 /* Provide backward portability to MPI 1 */
 #ifndef MPI_VERSION
@@ -99,8 +98,8 @@ void MTest_Init_thread( int *argc, char ***argv, int required, int *provided )
     }
     /* Check for debugging control */
     if (getenv( "MPITEST_DEBUG" )) {
-       SMPI_VARGET_GLOBAL(dbgflag) = 1;
-       MPI_Comm_rank( MPI_COMM_WORLD, &SMPI_VARGET_GLOBAL(wrank) );
+       dbgflag = 1;
+       MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
     }
 
     /* Check for verbose control */
@@ -116,7 +115,7 @@ void MTest_Init_thread( int *argc, char ***argv, int required, int *provided )
        }
        else {
            if (val >= 0) {
-               SMPI_VARGET_GLOBAL(verbose) = val;
+               verbose = val;
            }
            else {
                fprintf( stderr, "Warning: %s not valid for MPITEST_VERBOSE\n", 
@@ -132,13 +131,13 @@ void MTest_Init_thread( int *argc, char ***argv, int required, int *provided )
            strcmp( envval, "YES" ) == 0 ||
            strcmp( envval, "true" ) == 0 ||
            strcmp( envval, "TRUE" ) == 0) {
-           SMPI_VARGET_GLOBAL(returnWithVal) = 1;
+           returnWithVal = 1;
        }
        else if (strcmp( envval, "no" ) == 0 ||
            strcmp( envval, "NO" ) == 0 ||
            strcmp( envval, "false" ) == 0 ||
            strcmp( envval, "FALSE" ) == 0) {
-           SMPI_VARGET_GLOBAL(returnWithVal) = 0;
+           returnWithVal = 0;
        }
        else {
            fprintf( stderr, 
@@ -150,7 +149,7 @@ void MTest_Init_thread( int *argc, char ***argv, int required, int *provided )
     
     /* Print rusage data if set */
     if (getenv( "MPITEST_RUSAGE" )) {
-       SMPI_VARGET_GLOBAL(usageOutput) = 1;
+       usageOutput = 1;
     }
 }
 /* 
@@ -220,7 +219,7 @@ void MTest_Finalize( int errs )
        fflush( stdout );
     }
     
-    if (SMPI_VARGET_GLOBAL(usageOutput))
+    if (usageOutput) 
        MTestResourceSummary( stdout );
 
 
@@ -233,7 +232,7 @@ void MTest_Finalize( int errs )
  */
 int MTestReturnValue( int errors )
 {
-    if (SMPI_VARGET_GLOBAL(returnWithVal)) return errors ? 1 : 0;
+    if (returnWithVal) return errors ? 1 : 0;
     return 0;
 }
 /* ------------------------------------------------------------------------ */
@@ -278,7 +277,7 @@ void MTestSleep( int sec )
  *    Indexed  - Indexed datatype.  Only for a count of 1 instance of the 
  *               datatype
  */
-SMPI_VARINIT_GLOBAL_AND_SET(datatype_index, int, 0);
+static int datatype_index = 0;
 
 /* ------------------------------------------------------------------------ */
 /* Datatype routines for contiguous datatypes                               */
@@ -637,7 +636,7 @@ int MTestGetDatatypes( MTestDatatype *sendtype, MTestDatatype *recvtype,
     recvtype->count      = count;
     /* Use datatype_index to choose a datatype to use.  If at the end of the
        list, return 0 */
-    switch (SMPI_VARGET_GLOBAL(datatype_index)) {
+    switch (datatype_index) {
     case 0:
        sendtype->datatype = MPI_INT;
        sendtype->isBasic  = 1;
@@ -859,7 +858,7 @@ int MTestGetDatatypes( MTestDatatype *sendtype, MTestDatatype *recvtype,
        break;
 #endif
     default:
-       SMPI_VARGET_GLOBAL(datatype_index) = -1;
+       datatype_index = -1;
     }
 
     if (!sendtype->InitBuf) {
@@ -870,29 +869,29 @@ int MTestGetDatatypes( MTestDatatype *sendtype, MTestDatatype *recvtype,
        sendtype->CheckBuf = MTestTypeContigCheckbuf;
        recvtype->CheckBuf = MTestTypeContigCheckbuf;
     }
-    SMPI_VARGET_GLOBAL(datatype_index)++;
+    datatype_index++;
 
-    if (SMPI_VARGET_GLOBAL(dbgflag) && SMPI_VARGET_GLOBAL(datatype_index) > 0) {
+    if (dbgflag && datatype_index > 0) {
        int typesize;
-       fprintf( stderr, "%d: sendtype is %s\n", SMPI_VARGET_GLOBAL(wrank), MTestGetDatatypeName( sendtype ) );
+       fprintf( stderr, "%d: sendtype is %s\n", wrank, MTestGetDatatypeName( sendtype ) );
        merr = MPI_Type_size( sendtype->datatype, &typesize );
        if (merr) MTestPrintError( merr );
-       fprintf( stderr, "%d: sendtype size = %d\n", SMPI_VARGET_GLOBAL(wrank), typesize );
-       fprintf( stderr, "%d: recvtype is %s\n", SMPI_VARGET_GLOBAL(wrank), MTestGetDatatypeName( recvtype ) );
+       fprintf( stderr, "%d: sendtype size = %d\n", wrank, typesize );
+       fprintf( stderr, "%d: recvtype is %s\n", wrank, MTestGetDatatypeName( recvtype ) );
        merr = MPI_Type_size( recvtype->datatype, &typesize );
        if (merr) MTestPrintError( merr );
-       fprintf( stderr, "%d: recvtype size = %d\n", SMPI_VARGET_GLOBAL(wrank), typesize );
+       fprintf( stderr, "%d: recvtype size = %d\n", wrank, typesize );
        fflush( stderr );
        
     }
-    else if (SMPI_VARGET_GLOBAL(verbose) && SMPI_VARGET_GLOBAL(datatype_index) > 0) {
+    else if (verbose && datatype_index > 0) {
        printf( "Get new datatypes: send = %s, recv = %s\n", 
                MTestGetDatatypeName( sendtype ), 
                MTestGetDatatypeName( recvtype ) );
        fflush( stdout );
     }
 
-    return SMPI_VARGET_GLOBAL(datatype_index);
+    return datatype_index;
 }
 
 /* Reset the datatype index (start from the initial data type.
@@ -901,13 +900,13 @@ int MTestGetDatatypes( MTestDatatype *sendtype, MTestDatatype *recvtype,
 */
 void MTestResetDatatypes( void )
 {
-    SMPI_VARGET_GLOBAL(datatype_index) = 0;
+    datatype_index = 0;
 }
 /* Return the index of the current datatype.  This is rarely needed and
    is provided mostly to enable debugging of the MTest package itself */
 int MTestGetDatatypeIndex( void )
 {
-    return SMPI_VARGET_GLOBAL(datatype_index);
+    return datatype_index;
 }
 
 /* Free the storage associated with a datatype */
@@ -954,15 +953,14 @@ int MTestCheckRecv( MPI_Status *status, MTestDatatype *recvtype )
    simplify the use of the routine */
 const char *MTestGetDatatypeName( MTestDatatype *dtype )
 {
-    typedef char name_type[4][MPI_MAX_OBJECT_NAME];
-    SMPI_VARINIT_STATIC(name, name_type);
-    SMPI_VARINIT_STATIC_AND_SET(sp, int, 0);
+    static char name[4][MPI_MAX_OBJECT_NAME];
+    static int sp=0;
     int rlen, merr;
 
-    if (SMPI_VARGET_STATIC(sp) >= 4) SMPI_VARGET_STATIC(sp) = 0;
-    merr = MPI_Type_get_name( dtype->datatype, SMPI_VARGET_STATIC(name)[SMPI_VARGET_STATIC(sp)], &rlen );
+    if (sp >= 4) sp = 0;
+    merr = MPI_Type_get_name( dtype->datatype, name[sp], &rlen );
     if (merr) MTestPrintError( merr );
-    return (const char *)SMPI_VARGET_STATIC(name)[SMPI_VARGET_STATIC(sp)++];
+    return (const char *)name[sp++];
 }
 /* ----------------------------------------------------------------------- */
 
@@ -973,10 +971,10 @@ const char *MTestGetDatatypeName( MTestDatatype *dtype )
  * that return value as well.
  * 
  */
-SMPI_VARINIT_GLOBAL_AND_SET(interCommIdx, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(intraCommIdx, int, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(intraCommName, const char *, 0);
-SMPI_VARINIT_GLOBAL_AND_SET(interCommName, const char *, 0);
+static int interCommIdx = 0;
+static int intraCommIdx = 0;
+static const char *intraCommName = 0;
+static const char *interCommName = 0;
 
 /* 
  * Get an intracommunicator with at least min_size members.  If "allowSmaller"
@@ -994,18 +992,18 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
        MPI_COMM_NULL is always considered large enough */
     while (!done) {
        isBasic = 0;
-       SMPI_VARGET_GLOBAL(intraCommName) = "";
-       switch (SMPI_VARGET_GLOBAL(intraCommIdx)) {
+       intraCommName = "";
+       switch (intraCommIdx) {
        case 0:
            *comm = MPI_COMM_WORLD;
            isBasic = 1;
-           SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_WORLD";
+           intraCommName = "MPI_COMM_WORLD";
            break;
        case 1:
            /* dup of world */
            merr = MPI_Comm_dup(MPI_COMM_WORLD, comm );
            if (merr) MTestPrintError( merr );
-           SMPI_VARGET_GLOBAL(intraCommName) = "Dup of MPI_COMM_WORLD";
+           intraCommName = "Dup of MPI_COMM_WORLD";
            break;
        case 2:
            /* reverse ranks */
@@ -1015,7 +1013,7 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
            if (merr) MTestPrintError( merr );
            merr = MPI_Comm_split( MPI_COMM_WORLD, 0, size-rank, comm );
            if (merr) MTestPrintError( merr );
-           SMPI_VARGET_GLOBAL(intraCommName) = "Rank reverse of MPI_COMM_WORLD";
+           intraCommName = "Rank reverse of MPI_COMM_WORLD";
            break;
        case 3:
            /* subset of world, with reversed ranks */
@@ -1026,12 +1024,12 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
            merr = MPI_Comm_split( MPI_COMM_WORLD, ((rank < size/2) ? 1 : MPI_UNDEFINED),
                                   size-rank, comm );
            if (merr) MTestPrintError( merr );
-           SMPI_VARGET_GLOBAL(intraCommName) = "Rank reverse of half of MPI_COMM_WORLD";
+           intraCommName = "Rank reverse of half of MPI_COMM_WORLD";
            break;
        case 4:
            *comm = MPI_COMM_SELF;
            isBasic = 1;
-           SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_SELF";
+           intraCommName = "MPI_COMM_SELF";
            break;
 
            /* These next cases are communicators that include some
@@ -1044,7 +1042,7 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
            int newsize;
            merr = MPI_Comm_size( MPI_COMM_WORLD, &size );
            if (merr) MTestPrintError( merr );
-           newsize = size - (SMPI_VARGET_GLOBAL(intraCommIdx) - 4);
+           newsize = size - (intraCommIdx - 4);
            
            if (allowSmaller && newsize >= min_size) {
                merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
@@ -1058,13 +1056,13 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
                    *comm = MPI_COMM_NULL;
                }
                else {
-                   SMPI_VARGET_GLOBAL(intraCommName) = "Split of WORLD";
+                   intraCommName = "Split of WORLD";
                }
            }
            else {
                /* Act like default */
                *comm = MPI_COMM_NULL;
-               SMPI_VARGET_GLOBAL(intraCommIdx) = -1;
+               intraCommIdx = -1;
            }
        }
        break;
@@ -1072,7 +1070,7 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
            /* Other ideas: dup of self, cart comm, graph comm */
        default:
            *comm = MPI_COMM_NULL;
-           SMPI_VARGET_GLOBAL(intraCommIdx) = -1;
+           intraCommIdx = -1;
            break;
        }
 
@@ -1083,7 +1081,7 @@ int MTestGetIntracommGeneral( MPI_Comm *comm, int min_size, int allowSmaller )
                done = 1;
        }
         else {
-            SMPI_VARGET_GLOBAL(intraCommName) = "MPI_COMM_NULL";
+            intraCommName = "MPI_COMM_NULL";
             isBasic = 1;
             done = 1;
         }
@@ -1094,7 +1092,7 @@ done2=done;
         /* Advance the comm index whether we are done or not, otherwise we could
          * spin forever trying to allocate a too-small communicator over and
          * over again. */
-        SMPI_VARGET_GLOBAL(intraCommIdx)++;
+        intraCommIdx++;
 
         if (!done && !isBasic && *comm != MPI_COMM_NULL) {
             /* avoid leaking communicators */
@@ -1103,7 +1101,7 @@ done2=done;
         }
     }
 
-    return SMPI_VARGET_GLOBAL(intraCommIdx);
+    return intraCommIdx;
 }
 
 /* 
@@ -1117,7 +1115,7 @@ int MTestGetIntracomm( MPI_Comm *comm, int min_size )
 /* Return the name of an intra communicator */
 const char *MTestGetIntracommName( void )
 {
-    return SMPI_VARGET_GLOBAL(intraCommName);
+    return intraCommName;
 }
 
 /* 
@@ -1138,9 +1136,9 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
     while (!done) {
         *comm = MPI_COMM_NULL;
         *isLeftGroup = 0;
-        SMPI_VARGET_GLOBAL(interCommName) = "MPI_COMM_NULL";
+        interCommName = "MPI_COMM_NULL";
 
-       switch (SMPI_VARGET_GLOBAL(interCommIdx)) {
+       switch (interCommIdx) {
        case 0:
            /* Split comm world in half */
            merr = MPI_Comm_rank( MPI_COMM_WORLD, &rank );
@@ -1166,7 +1164,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader,
                                             12345, comm );
                if (merr) MTestPrintError( merr );
-               SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD";
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD";
            }
            else 
                *comm = MPI_COMM_NULL;
@@ -1196,7 +1194,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, 
                                             rleader, 12346, comm );
                if (merr) MTestPrintError( merr );
-               SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD into 1, rest";
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD into 1, rest";
            }
            else
                *comm = MPI_COMM_NULL;
@@ -1227,7 +1225,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, 
                                             rleader, 12347, comm );
                if (merr) MTestPrintError( merr );
-               SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD into 2, rest";
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD into 2, rest";
            }
            else 
                *comm = MPI_COMM_NULL;
@@ -1266,7 +1264,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                mcomm = *comm;
                merr = MPI_Comm_dup(mcomm, comm);
                if (merr) MTestPrintError( merr );
-               SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD then dup'ing";
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD then dup'ing";
            }
            else 
                *comm = MPI_COMM_NULL;
@@ -1308,7 +1306,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                /* this split is effectively a dup but tests the split code paths */
                merr = MPI_Comm_split(mcomm, 0, rank, comm);
                if (merr) MTestPrintError( merr );
-               SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD then then splitting again";
+               interCommName = "Intercomm by splitting MPI_COMM_WORLD then then splitting again";
            }
            else
                *comm = MPI_COMM_NULL;
@@ -1345,7 +1343,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                     merr = MPI_Intercomm_create( mcomm, 0, MPI_COMM_WORLD, rleader, 12345, comm );
                     if (merr) MTestPrintError( merr );
                 }
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD (discarding rank 0 in the left group) then MPI_Intercomm_create'ing";
+                interCommName = "Intercomm by splitting MPI_COMM_WORLD (discarding rank 0 in the left group) then MPI_Intercomm_create'ing";
             }
             else {
                 *comm = MPI_COMM_NULL;
@@ -1398,7 +1396,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
                 merr = MPI_Group_free(&newgroup);
                 if (merr) MTestPrintError( merr );
 
-                SMPI_VARGET_GLOBAL(interCommName) = "Intercomm by splitting MPI_COMM_WORLD then discarding 0 ranks with MPI_Comm_create";
+                interCommName = "Intercomm by splitting MPI_COMM_WORLD then discarding 0 ranks with MPI_Comm_create";
             }
             else {
                 *comm = MPI_COMM_NULL;
@@ -1407,7 +1405,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
 
        default:
            *comm = MPI_COMM_NULL;
-           SMPI_VARGET_GLOBAL(interCommIdx) = -1;
+           interCommIdx = -1;
            break;
        }
 
@@ -1419,7 +1417,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
            if (size + remsize >= min_size) done = 1;
        }
        else {
-           SMPI_VARGET_GLOBAL(interCommName) = "MPI_COMM_NULL";
+           interCommName = "MPI_COMM_NULL";
            done = 1;
         }
 
@@ -1429,7 +1427,7 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
         /* Advance the comm index whether we are done or not, otherwise we could
          * spin forever trying to allocate a too-small communicator over and
          * over again. */
-        SMPI_VARGET_GLOBAL(interCommIdx)++;
+        interCommIdx++;
 
         if (!done && *comm != MPI_COMM_NULL) {
             /* avoid leaking communicators */
@@ -1448,12 +1446,12 @@ int MTestGetIntercomm( MPI_Comm *comm, int *isLeftGroup, int min_size )
         }
     }
 
-    return SMPI_VARGET_GLOBAL(interCommIdx);
+    return interCommIdx;
 }
 /* Return the name of an intercommunicator */
 const char *MTestGetIntercommName( void )
 {
-    return SMPI_VARGET_GLOBAL(interCommName);
+    return interCommName;
 }
 
 /* Get a communicator of a given minimum size.  Both intra and inter 
@@ -1461,19 +1459,19 @@ const char *MTestGetIntercommName( void )
 int MTestGetComm( MPI_Comm *comm, int min_size )
 {
     int idx=0;
-    SMPI_VARINIT_STATIC_AND_SET(getinter, int, 0);
+    static int getinter = 0;
 
-    if (!SMPI_VARGET_STATIC(getinter)) {
+    if (!getinter) {
        idx = MTestGetIntracomm( comm, min_size );
        if (idx == 0) {
-           SMPI_VARGET_STATIC(getinter) = 1;
+           getinter = 1;
        }
     }
-    if (SMPI_VARGET_STATIC(getinter)) {
+    if (getinter) {
        int isLeft;
        idx = MTestGetIntercomm( comm, &isLeft, min_size );
        if (idx == 0) {
-           SMPI_VARGET_STATIC(getinter) = 0;
+           getinter = 0;
        }
     }
 
@@ -1523,7 +1521,7 @@ void MTestPrintfMsg( int level, const char format[], ... )
 {
     va_list list;
 
-    if (SMPI_VARGET_GLOBAL(verbose) && level >= SMPI_VARGET_GLOBAL(verbose)) {
+    if (verbose && level >= verbose) {
        va_start(list,format);
        vprintf( format, list );
        va_end(list);
@@ -1543,20 +1541,20 @@ static void MTestResourceSummary( FILE *fp )
 {
 #ifdef HAVE_GETRUSAGE
     struct rusage ru;
-    SMPI_VARINIT_STATIC_AND_SET(pfThreshold, int, -2);
+    static int pfThreshold = -2;
     int doOutput = 1;
     if (getrusage( RUSAGE_SELF, &ru ) == 0) {
        /* There is an option to generate output only when a resource
           exceeds a threshold.  To date, only page faults supported. */
-       if (SMPI_VARGET_STATIC(pfThreshold) == -2) {
+       if (pfThreshold == -2) {
            char *p = getenv("MPITEST_RUSAGE_PF");
-           SMPI_VARGET_STATIC(pfThreshold) = -1;
+           pfThreshold = -1;
            if (p) {
-               SMPI_VARGET_STATIC(pfThreshold) = strtol( p, 0, 0 );
+               pfThreshold = strtol( p, 0, 0 );
            }
        }
-       if (SMPI_VARGET_STATIC(pfThreshold) > 0) {
-           doOutput = ru.ru_minflt > SMPI_VARGET_STATIC(pfThreshold);
+       if (pfThreshold > 0) {
+           doOutput = ru.ru_minflt > pfThreshold;
        }
        if (doOutput) {
            /* Cast values to long in case some system has defined them
@@ -1584,48 +1582,47 @@ static void MTestResourceSummary( FILE *fp )
 /*
  * Create MPI Windows
  */
-SMPI_VARINIT_GLOBAL_AND_SET(win_index, int, 0);
-SMPI_VARINIT_GLOBAL(winName, const char *);
+static int win_index = 0;
+static const char *winName;
 /* Use an attribute to remember the type of memory allocation (static,
    malloc, or MPI_Alloc_mem) */
-SMPI_VARINIT_GLOBAL_AND_SET(mem_keyval, int, MPI_KEYVAL_INVALID);
+static int mem_keyval = MPI_KEYVAL_INVALID;
 int MTestGetWin( MPI_Win *win, int mustBePassive )
 {
-    typedef char actbuf_type[1024];
-    SMPI_VARINIT_STATIC(actbuf, actbuf_type);
-    SMPI_VARINIT_STATIC(pasbuf, char *);
+    static char actbuf[1024];
+    static char *pasbuf;
     char        *buf;
     int         n, rank, merr;
     MPI_Info    info;
 
-    if (SMPI_VARGET_GLOBAL(mem_keyval) == MPI_KEYVAL_INVALID) {
+    if (mem_keyval == MPI_KEYVAL_INVALID) {
        /* Create the keyval */
        merr = MPI_Win_create_keyval( MPI_WIN_NULL_COPY_FN, 
                                      MPI_WIN_NULL_DELETE_FN, 
-                                     &SMPI_VARGET_GLOBAL(mem_keyval), 0 );
+                                     &mem_keyval, 0 );
        if (merr) MTestPrintError( merr );
 
     }
 
-    switch (SMPI_VARGET_GLOBAL(win_index)) {
+    switch (win_index) {
     case 0:
        /* Active target window */
-       merr = MPI_Win_create( SMPI_VARGET_STATIC(actbuf), 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD,
+       merr = MPI_Win_create( actbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
                               win );
        if (merr) MTestPrintError( merr );
-       SMPI_VARGET_GLOBAL(winName) = "active-window";
-       merr = MPI_Win_set_attr( *win, SMPI_VARGET_GLOBAL(mem_keyval), (void *)0 );
+       winName = "active-window";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)0 );
        if (merr) MTestPrintError( merr );
        break;
     case 1:
        /* Passive target window */
-       merr = MPI_Alloc_mem( 1024, MPI_INFO_NULL, &SMPI_VARGET_STATIC(pasbuf) );
+       merr = MPI_Alloc_mem( 1024, MPI_INFO_NULL, &pasbuf );
        if (merr) MTestPrintError( merr );
-       merr = MPI_Win_create( SMPI_VARGET_STATIC(pasbuf), 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD,
+       merr = MPI_Win_create( pasbuf, 1024, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
                               win );
        if (merr) MTestPrintError( merr );
-       SMPI_VARGET_GLOBAL(winName) = "passive-window";
-       merr = MPI_Win_set_attr( *win, SMPI_VARGET_GLOBAL(mem_keyval), (void *)2 );
+       winName = "passive-window";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)2 );
        if (merr) MTestPrintError( merr );
        break;
     case 2:
@@ -1640,8 +1637,8 @@ int MTestGetWin( MPI_Win *win, int mustBePassive )
        merr = MPI_Win_create( buf, n, 1, MPI_INFO_NULL, MPI_COMM_WORLD, 
                               win );
        if (merr) MTestPrintError( merr );
-       SMPI_VARGET_GLOBAL(winName) = "active-all-different-win";
-       merr = MPI_Win_set_attr( *win, SMPI_VARGET_GLOBAL(mem_keyval), (void *)1 );
+       winName = "active-all-different-win";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)1 );
        if (merr) MTestPrintError( merr );
        break;
     case 3:
@@ -1661,20 +1658,20 @@ int MTestGetWin( MPI_Win *win, int mustBePassive )
        if (merr) MTestPrintError( merr );
        merr = MPI_Info_free( &info );
        if (merr) MTestPrintError( merr );
-       SMPI_VARGET_GLOBAL(winName) = "active-nolocks-all-different-win";
-       merr = MPI_Win_set_attr( *win, SMPI_VARGET_GLOBAL(mem_keyval), (void *)1 );
+       winName = "active-nolocks-all-different-win";
+       merr = MPI_Win_set_attr( *win, mem_keyval, (void *)1 );
        if (merr) MTestPrintError( merr );
        break;
     default:
-       SMPI_VARGET_GLOBAL(win_index) = -1;
+       win_index = -1;
     }
-    SMPI_VARGET_GLOBAL(win_index)++;
-    return SMPI_VARGET_GLOBAL(win_index);
+    win_index++;
+    return win_index;
 }
 /* Return a pointer to the name associated with a window object */
 const char *MTestGetWinName( void )
 {
-    return SMPI_VARGET_GLOBAL(winName);
+    return winName;
 }
 /* Free the storage associated with a window object */
 void MTestFreeWin( MPI_Win *win )
@@ -1689,7 +1686,7 @@ void MTestFreeWin( MPI_Win *win )
     }
     if (addr) {
        void *val;
-       merr = MPI_Win_get_attr( *win, SMPI_VARGET_GLOBAL(mem_keyval), &val, &flag );
+       merr = MPI_Win_get_attr( *win, mem_keyval, &val, &flag );
        if (merr) MTestPrintError( merr );
        if (flag) {
            if (val == (void *)1) {
@@ -1707,8 +1704,8 @@ void MTestFreeWin( MPI_Win *win )
 }
 static void MTestRMACleanup( void )
 {
-    if (SMPI_VARGET_GLOBAL(mem_keyval) != MPI_KEYVAL_INVALID) {
-       MPI_Win_free_keyval( &SMPI_VARGET_GLOBAL(mem_keyval) );
+    if (mem_keyval != MPI_KEYVAL_INVALID) {
+       MPI_Win_free_keyval( &mem_keyval );
     }
 }
 #else 
index 3970c88..df0bc0b 100644 (file)
@@ -8,3 +8,10 @@ if(HAVE_MC)
   add_executable(dwarf-expression dwarf_expression.c)
   target_link_libraries(dwarf-expression simgrid)
 endif()
+
+set(testsuite_src
+  ${testsuite_src}
+  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf.c
+  ${CMAKE_CURRENT_SOURCE_DIR}/dwarf_expression.c
+  PARENT_SCOPE
+  )
index ae1ccd2..129ab69 100644 (file)
@@ -3,7 +3,9 @@ cmake_minimum_required(VERSION 2.6)
 set(bin_files
   ${bin_files}
   ${CMAKE_CURRENT_SOURCE_DIR}/fix-paje-trace.sh
+  ${CMAKE_CURRENT_SOURCE_DIR}/generate.sh
   ${CMAKE_CURRENT_SOURCE_DIR}/indent
+  ${CMAKE_CURRENT_SOURCE_DIR}/normalize-pointers.py
   ${CMAKE_CURRENT_SOURCE_DIR}/platf_route_rulebased2full.py
   ${CMAKE_CURRENT_SOURCE_DIR}/sg_unit_extractor.pl
   ${CMAKE_CURRENT_SOURCE_DIR}/sg_xml_unit_converter.py
index 8baa979..1082e69 100644 (file)
@@ -33,7 +33,6 @@
 + src/simix/simix_network\.tla
 
 + src/smpi/BUGS
-+ src/smpi/colls/allreduce-rab-reduce-scatter\.c
 + src/smpi/colls/alltoall-bruck\.c
 + src/smpi/fixsrc\.pl
 + src/smpi/myprintloc\.cocci
@@ -46,7 +45,6 @@
 + tools/check_dist_archive
 + tools/check_dist_archive\.exclude
 + tools/generate-multi-jar\.py
-+ tools/normalize-pointers\.py
 + tools/update_copyright_header
 
 + tools/spell/.*
similarity index 100%
rename from generate.sh
rename to tools/generate.sh