Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Wed, 18 Jun 2014 15:29:41 +0000 (17:29 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Wed, 18 Jun 2014 15:29:41 +0000 (17:29 +0200)
CMakeLists.txt
examples/msg/ns3/One_cluster-d.xml
examples/msg/ns3/ns3.tesh
src/mc/mc_global.c
src/simix/smx_global.c
src/smpi/private.h
src/smpi/smpi_global.c

index 73b8dfd..a97eb96 100644 (file)
@@ -103,6 +103,12 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
   if(${GCC_NEED_VERSION} GREATER  COMPILER_C_VERSION_MAJOR_MINOR)
     message(FATAL_ERROR "Gcc must be to version ${GCC_NEED_VERSION} current version ${COMPILER_C_VERSION_MAJOR_MINOR}")
   endif()
+  
+  if(COMPILER_C_VERSION_MAJOR_MINOR STRGREATER "4.8")
+    set (CMAKE_AR gcc-ar)
+    set (CMAKE_RANLIB gcc-ranlib)
+  endif()
+  
 endif()
 
 exec_program("${CMAKE_LINKER} --version" OUTPUT_VARIABLE "LINKER_VERSION")
index ff7e71f..d59e88a 100644 (file)
@@ -2,13 +2,13 @@
 <!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
 
-  <process host="c-2.me" function="master">
+  <process host="node-2.acme.org" function="master">
       <argument value="100"/>
-      <argument value="c-6.me"/>
+      <argument value="node-6.acme.org"/>
       <argument value="1"/>
   </process>
 
-  <process host="c-6.me" function="slave">
+  <process host="node-6.acme.org" function="slave">
     <argument value="1"/>
   </process>
      
index 52094b2..b2f9d85 100644 (file)
@@ -29,7 +29,7 @@ p One cluster
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/cluster.xml ${srcdir:=.}/examples/msg/ns3/One_cluster-d.xml --cfg=network/model:NS3
 > [0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
 > [0.000000] [surf_config/INFO] Switching workstation model to compound since you changed the network and/or cpu model(s)
-> [c-6.me:slave:(2) 0.006755] [msg_test/INFO] FLOW[1] : Receive 100 bytes from c-2.me to c-6.me
+> [node-6.acme.org:slave:(2) 0.006755] [msg_test/INFO] FLOW[1] : Receive 100 bytes from node-2.acme.org to node-6.acme.org
 
 p Two clusters
 
index f596b2a..5ca58db 100644 (file)
@@ -1451,6 +1451,8 @@ void MC_dump_stack_liveness(xbt_fifo_t stack){
 
 void MC_print_statistics(mc_stats_t stats)
 {
+  xbt_mheap_t previous_heap = mmalloc_get_current_heap();
+
   if(stats->expanded_pairs == 0){
     XBT_INFO("Expanded states = %lu", stats->expanded_states);
     XBT_INFO("Visited states = %lu", stats->visited_states);
@@ -1459,6 +1461,7 @@ void MC_print_statistics(mc_stats_t stats)
     XBT_INFO("Visited pairs = %lu", stats->visited_pairs);
   }
   XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
+
   MC_SET_RAW_MEM;
   if((_sg_mc_dot_output_file != NULL) && (_sg_mc_dot_output_file[0]!='\0')){
     fprintf(dot_output, "}\n");
@@ -1470,7 +1473,7 @@ void MC_print_statistics(mc_stats_t stats)
     if (_sg_mc_send_determinism)
       XBT_INFO("Send-deterministic : %s", !initial_state_safety->send_deterministic ? "No" : "Yes");
   }
-  MC_UNSET_RAW_MEM;
+  mmalloc_set_current_heap(previous_heap);
 }
 
 void MC_assert(int prop)
index 6de8bc3..0b2b78c 100644 (file)
 #include "mc/mc.h"
 #include "simgrid/sg_config.h"
 
+#ifdef HAVE_MC
+#include "mc/mc_private.h"
+#endif
+
+#ifdef HAVE_SMPI
+#include "smpi/private.h"
+#endif
+
 XBT_LOG_NEW_CATEGORY(simix, "All SIMIX categories");
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_kernel, simix,
                                 "Logging specific to SIMIX (kernel)");
@@ -58,7 +66,23 @@ static void _XBT_CALL segvhandler(int signum, siginfo_t *siginfo, void *context)
               "siginfo = {si_signo = %d, si_errno = %d, si_code = %d, si_addr = %p}\n",
               siginfo->si_signo, siginfo->si_errno, siginfo->si_code, siginfo->si_addr);
     }
+  } else  if (siginfo->si_signo == SIGSEGV) {
+    fprintf(stderr, "Segmentation fault.\n");
+#ifdef HAVE_SMPI
+    if (smpi_enabled() && !smpi_privatize_global_variables) {
+      fprintf(stderr,
+        "Try to enable SMPI variable privatization with --cfg:smpi/privatize_global_variable:yes.\n");
+    }
+#endif
   }
+#ifdef HAVE_MC
+  if (MC_is_active()) {
+    if (mc_stack_safety) {
+      MC_dump_stack_safety(mc_stack_safety);
+    }
+    MC_print_statistics(mc_stats);
+  }
+#endif
   raise(signum);
 }
 
index b98f679..2b8ce55 100644 (file)
@@ -166,6 +166,7 @@ void smpi_comm_copy_buffer_callback(smx_action_t comm,
 
 void print_request(const char *message, MPI_Request request);
 
+int smpi_enabled(void);
 void smpi_global_init(void);
 void smpi_global_destroy(void);
 
index 775e84a..0072cda 100644 (file)
@@ -354,6 +354,10 @@ static void smpi_check_options(){
    }
 }
 
+int smpi_enabled(void) {
+  return process_data != NULL;
+}
+
 void smpi_global_init(void)
 {
   int i;