Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 7 Mar 2016 21:53:02 +0000 (22:53 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 7 Mar 2016 21:53:02 +0000 (22:53 +0100)
12 files changed:
CMakeLists.txt
include/simgrid_config.h.in
include/smpi/smpi.h
include/xbt/ex.h
include/xbt/mmalloc.h
src/simix/RawContext.cpp
src/xbt/automaton/automatonparse_promela.c
src/xbt/mallocator.c
src/xbt/mmalloc/mm_module.c
src/xbt/mmalloc/mmorecore.c
tools/CMakeLists.txt
tools/xbt_exception_checker [deleted file]

index 4459d8d..b0f52fe 100644 (file)
@@ -311,8 +311,8 @@ endif()
 execute_process(
   COMMAND "${CMAKE_C_COMPILER} ${CMAKE_HOME_DIRECTORY}/tools/cmake/test_prog/prog_thread_storage.c"
   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-  RESULT_VARIABLE HAVE_thread_storage_run
-  )
+  RESULT_VARIABLE HAVE_thread_storage_run)
+
 
 if(HAVE_thread_storage_run)
   set(HAVE_THREAD_LOCAL_STORAGE 1)
@@ -341,9 +341,9 @@ if(enable_jedule)
 endif()
 
 if(enable_mallocators)
-  SET(MALLOCATOR_IS_WANTED 1)
+  SET(HAVE_MALLOCATOR 1)
 else()
-  SET(MALLOCATOR_IS_WANTED 0)
+  SET(HAVE_MALLOCATOR 0)
 endif()
 
 if(enable_model-checking AND HAVE_MMALLOC)
@@ -352,7 +352,7 @@ if(enable_model-checking AND HAVE_MMALLOC)
   include(FindLibdw)
 else()
   if(enable_model-checking)
-    message(STATUS "Warning: support for model-checking has been disabled because HAVE_MMALLOC is false")
+    message(STATUS "Warning: support for model-checking has been disabled because you are missing either mmap or __thread.")
   endif()
   SET(HAVE_MC 0)
   SET(HAVE_MMALLOC 0)
@@ -867,12 +867,22 @@ endif()
 message("")
 message("##########################################")
 message("#### Content of src/internal_config.h ####")
+message("##########################################")
 file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/src/internal_config.h config_output)
 LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8) # Pass the file header
 foreach(line ${config_output})
   message("   ${line}")
 endforeach()
-message("####   end of src/internal_config.h   ####")
+message("##########################################")
+message("####   Content of simgrid_config.h    ####")
+message("##########################################")
+file(STRINGS ${CMAKE_CURRENT_BINARY_DIR}/include/simgrid_config.h config_output)
+LIST(REMOVE_AT config_output 0 1 2 3 4 5 6 7 8 9 -1) # Pass the file header
+foreach(line ${config_output})
+  message("   ${line}")
+endforeach()
+message("##########################################")
+message("####   End of configuration headers   ####")
 message("##########################################")
 
 message("\nConfiguration of package `simgrid':")
index f310d59..340f0a8 100644 (file)
@@ -1,4 +1,4 @@
-/* simgrid_config.h - Results of the configure made visible to user code    */
+/* simgrid_config.h - Results of the configure made visible to user code.   */
 
 /* Copyright (c) 2009-2016. The SimGrid Team. All rights reserved.          */
 
@@ -8,44 +8,23 @@
 #ifndef SIMGRID_PUBLIC_CONFIG_H
 #define SIMGRID_PUBLIC_CONFIG_H
 
-/* This file should only contain public declarations, mainly the definitions of SimGrid modules that were compiled in */
-
-/** Define the version numbers of the used header files. 
-    sg_version() can be used to retrieve the version of the dynamic library.
-    But actually, if these numbers don't match, SimGrid refuses to start (so you shouldn't have to care about sg_version() yourself) */
-
+/** Define the version numbers of the used header files. See sg_version() to retrieve the version of the dynamic library. */
 #define SIMGRID_VERSION_MAJOR @SIMGRID_VERSION_MAJOR@
 #define SIMGRID_VERSION_MINOR @SIMGRID_VERSION_MINOR@
 #define SIMGRID_VERSION_PATCH @SIMGRID_VERSION_PATCH@
 
+/* Version as a single integer. v3.4 is 30400, v3.16.2 is 31602, v42 will be 420000, and so on. */
+#define SIMGRID_VERSION (100UL * (100UL * (@SIMGRID_VERSION_MAJOR@) + (@SIMGRID_VERSION_MINOR@)) + (@SIMGRID_VERSION_PATCH@))
+
 #define SIMGRID_VERSION_STRING "@SIMGRID_VERSION_STRING@"
 #define SIMGRID_VERSION_BANNER "@SIMGRID_VERSION_BANNER@"
 
-/* Version X.Y.Z will get version number XYZ: all digits concatenated without dots
- * (with Y and Z must be on two positions)*/
-#define MAKE_SIMGRID_VERSION(major, minor, patch)   (100UL * (100UL * (major) + (minor)) + (patch))
-#define SIMGRID_VERSION MAKE_SIMGRID_VERSION(SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR, SIMGRID_VERSION_PATCH)
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H @HAVE_UNISTD_H@
-
-/* Whether mallocators were enabled in ccmake or not. */
-#define MALLOCATOR_COMPILED_IN @MALLOCATOR_IS_WANTED@
-
-/* Define if xbt contexts are based on our threads implementation or not */
-#cmakedefine HAVE_THREAD_CONTEXTS @HAVE_THREAD_CONTEXTS@
-
-/* If __thread is available */
-#cmakedefine HAVE_THREAD_LOCAL_STORAGE @HAVE_THREAD_LOCAL_STORAGE@
-
-/* Define to 1 if mmalloc is compiled in. */
-#cmakedefine HAVE_MMALLOC @HAVE_MMALLOC@
-
-#cmakedefine HAVE_JEDULE @HAVE_JEDULE@ /* Was Jedule compiled in?  */
-#cmakedefine HAVE_MC     @HAVE_MC@     /* Was the model-checking compiled in? */
-#cmakedefine HAVE_NS3    @HAVE_NS3@    /* Was the NS3 support compiled in? */
-#cmakedefine HAVE_LUA    @HAVE_LUA@    /* Was the Lua support compiled in? */
+#cmakedefine HAVE_JEDULE     @HAVE_JEDULE@ /* Was Jedule compiled in?  */
+#cmakedefine HAVE_LUA        @HAVE_LUA@ /* Was the Lua support compiled in? */
+#define HAVE_MALLOCATOR @HAVE_MALLOCATOR@ /* Whether mallocators (object pools) were activated at compilation time. */
+#cmakedefine HAVE_MC         @HAVE_MC@ /* Was the model-checking compiled in? */
+#cmakedefine HAVE_NS3        @HAVE_NS3@ /* Was the NS3 support compiled in? */
 
-#cmakedefine SIMGRID_HAVE_LIBSIG @SIMGRID_HAVE_LIBSIG@
+#cmakedefine SIMGRID_HAVE_LIBSIG @SIMGRID_HAVE_LIBSIG@ /* Used in the public interface xbt/signal.hpp :( */
 
 #endif /* SIMGRID_PUBLIC_CONFIG_H */
index e3eeca7..eaf101b 100644 (file)
@@ -7,10 +7,7 @@
 #ifndef SMPI_H
 #define SMPI_H
 
-#include <simgrid_config.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <sys/time.h>
 
 #include <stddef.h>
index 54a55f3..8ca0a18 100644 (file)
@@ -177,12 +177,8 @@ __ex_mctx_struct} __ex_mctx_t;
  * cleanup that needs to be done regardless of whether an exception is
  * caught. Bypassing these steps will break the exception handling facility.
  * The symptom are likely to be a segfault at the next exception raising point,  
- * ie far away from the point where you did the mistake. If you suspect
- * that kind of error in your code, have a look at the little script
- * <tt>tools/xbt_exception_checker</tt> in the CVS. It extracts all the TRY
- * blocks from a set of C files you give it and display them (and only
- * them) on the standard output. You can then grep for the forbidden 
- * keywords on that output.
+ * ie far away from the point where you did the mistake. Finding the problem can 
+ * reveal challenging, unfortunately.
  *   
  * The CLEANUP and CATCH blocks are regular ISO-C language statement
  * blocks without any restrictions. You are even allowed to throw (and, in the
index 419a836..fb62d48 100644 (file)
@@ -10,7 +10,7 @@
 #ifndef MMALLOC_H
 #define MMALLOC_H 1
 
-#include <simgrid_config.h>
+#include "src/internal_config.h"
 #ifdef HAVE_MMALLOC
 
 #ifdef HAVE_STDDEF_H
index d131015..96cedd1 100644 (file)
 #include <utility>
 #include <functional>
 
-#include <xbt/log.h>
-#include <xbt/parmap.h>
-#include <xbt/dynar.h>
+#include "src/internal_config.h" 
+
+#include "xbt/log.h"
+#include "xbt/parmap.h"
+#include "xbt/dynar.h"
 
 #include "smx_private.h"
 #include "smx_private.hpp"
index 44758e3..2ed7b56 100644 (file)
@@ -7,6 +7,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "xbt/automaton.h"
+#include "src/internal_config.h"
 #include <errno.h>
 #include <string.h>             /* strerror */
 
index f355354..04d9cc2 100644 (file)
@@ -6,6 +6,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 "src/internal_config.h"
 #include "xbt/mallocator.h"
 #include "xbt/asserts.h"
 #include "xbt/sysdep.h"
@@ -77,7 +78,7 @@ void xbt_mallocator_initialization_is_done(int protect)
 
 /** used by the module to know if it's time to activate the mallocators yet */
 static inline int xbt_mallocator_is_active(void) {
-#if MALLOCATOR_COMPILED_IN
+#if HAVE_MALLOCATOR
   return initialization_done && !MC_is_active();
 #else
   return 0;
index 3440236..fea22d3 100644 (file)
@@ -27,6 +27,7 @@
    not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include "src/internal_config.h"
 #include <sys/types.h>
 #include <fcntl.h>              /* After sys/types.h, at least for dpx/2.  */
 #include <sys/stat.h>
index b99f322..e78ba90 100644 (file)
@@ -10,6 +10,7 @@
 
    Contributed by Fred Fish at Cygnus Support.   fnf@cygnus.com */
 
+#include "src/internal_config.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>             /* Prototypes for lseek */
 #endif
index 002deb0..dc03730 100644 (file)
@@ -7,7 +7,6 @@ set(bin_files
   ${CMAKE_CURRENT_SOURCE_DIR}/sg_unit_extractor.pl
   ${CMAKE_CURRENT_SOURCE_DIR}/sg_xml_unit_converter.py
   ${CMAKE_CURRENT_SOURCE_DIR}/simgrid_update_xml.pl
-  ${CMAKE_CURRENT_SOURCE_DIR}/xbt_exception_checker
   ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/fig2dev_postprocessor.pl
   ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/index_create.pl
   ${CMAKE_CURRENT_SOURCE_DIR}/doxygen/xbt_log_extract_hierarchy.pl
diff --git a/tools/xbt_exception_checker b/tools/xbt_exception_checker
deleted file mode 100755 (executable)
index 3ebadcc..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#! /bin/bash
-
-# This little script parse a list of C files, and extract the TRY blocks of it.
-# Martin Quinson, 2006. 
-# Demerdierensiesich licence.
-
-# It can reveal usefull when you have a segfault on exception throwing. This
-# is often the symptom that something somewhere got out of a TRY block with
-# return, goto, break or such. This is forbiden because some extra cleanups
-# must be performed at the end of the block.
-
-# So, if it happens to you, you may find this script usefull: let it extract
-# all the TRY blocks of your project, and grep for the forbidden keywords
-# given above.
-
-# You obviously have to adapt it to your case. The proper solution would be
-# to accept the extra -I pathes from the command line. 
-# Patch welcome ;)
-
-for file in `find -name '*.c'` ; do
-
-base=`dirname $file`
-cmd="cat $file \
-      | cpp -I/home/mquinson/CVSIMPORT/gras/gras/include \
-            -I/home/mquinson/CVSIMPORT/gras/gras/src \
-           -I/home/mquinson/CVSIMPORT/gras/gras/src/include \
-           -I$base \
-           -D__XBT_EX_H__ -D_XBT_LOG_H_ \
-      | sed -n -e '/TRY/,/CATCH/p' \
-      | sed -e 's/^.*TRY.*$/----------------/' -e '/CATCH/d'"
-
-err=`eval $cmd 2>&1 >/dev/null`
-if [ -n "$err" ] ; then
-  echo "XXXXXXXXXX ERROR IN FILE $file"
-  echo $err
-fi
-
-if [ -n "`eval $cmd 2>/dev/null`" ] ; then
-  echo "XXX FILE $file"
-  eval "$cmd" 2>/dev/null
-fi
-
-done