Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 6 Dec 2019 11:50:14 +0000 (12:50 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 6 Dec 2019 11:50:14 +0000 (12:50 +0100)
18 files changed:
.gitignore
CMakeLists.txt
MANIFEST.in
include/simgrid/config.h.in
include/simgrid/msg.h
include/simgrid/simdag.h
include/simgrid/version.h.in [new file with mode: 0644]
src/instr/instr_config.cpp
src/kernel/activity/CommImpl.hpp
src/kernel/activity/MailboxImpl.hpp
src/kernel/activity/MutexImpl.hpp
src/kernel/actor/ActorImpl.hpp
src/simgrid/sg_config.cpp
src/simgrid/sg_version.cpp [new file with mode: 0644]
src/simgrid/version.h.in [deleted file]
src/smpi/bindings/smpi_pmpi.cpp
src/surf/surf_interface.cpp
tools/cmake/DefinePackages.cmake

index c0c4ce0..5940061 100644 (file)
@@ -45,9 +45,9 @@ src/*_unit.c
 ### Generated files
 _*.c
 include/simgrid/config.h
+include/simgrid/version.h
 include/smpi/smpif.h
 src/internal_config.h
-src/simgrid/version.h
 testprog
 ### Cmake files
 CPackConfig.cmake
index 96b68fd..193567c 100644 (file)
@@ -523,14 +523,14 @@ endif()
 
 # Avoid triggering a (full) rebuild by touching the files if they did not really change
 configure_file("${CMAKE_HOME_DIRECTORY}/src/internal_config.h.in"    "${CMAKE_BINARY_DIR}/src/internal_config.h.generated"    @ONLY IMMEDIATE)
-configure_file("${CMAKE_HOME_DIRECTORY}/src/simgrid/version.h.in"    "${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated" @ONLY IMMEDIATE)
+configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/version.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated" @ONLY IMMEDIATE)
 configure_file("${CMAKE_HOME_DIRECTORY}/include/simgrid/config.h.in" "${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated" @ONLY IMMEDIATE)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/internal_config.h.generated ${CMAKE_BINARY_DIR}/src/internal_config.h)
-execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/src/simgrid/version.h)
+execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/version.h)
 execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated ${CMAKE_BINARY_DIR}/include/simgrid/config.h)
 file(REMOVE ${CMAKE_BINARY_DIR}/src/internal_config.h.generated)
 file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/config.h.generated)
-file(REMOVE ${CMAKE_BINARY_DIR}/src/simgrid/version.h.generated)
+file(REMOVE ${CMAKE_BINARY_DIR}/include/simgrid/version.h.generated)
 
 # We need two versions of the SMPI scripts because they contain the path to the library
 # so, it depends of whether SimGrid is installed, or run from the sources (during the build)
index 629e6c2..cd3d19a 100644 (file)
@@ -1978,6 +1978,7 @@ include include/simgrid/simix.hpp
 include include/simgrid/simix/blocking_simcall.hpp
 include include/simgrid/smpi/replay.hpp
 include include/simgrid/storage.h
+include include/simgrid/version.h.in
 include include/simgrid/vm.h
 include include/simgrid/zone.h
 include include/smpi/forward.hpp
@@ -2308,8 +2309,8 @@ include src/simdag/sd_task.cpp
 include src/simdag/simdag_private.hpp
 include src/simgrid/Exception.cpp
 include src/simgrid/sg_config.cpp
+include src/simgrid/sg_version.cpp
 include src/simgrid/util.hpp
-include src/simgrid/version.h.in
 include src/simix/libsmx.cpp
 include src/simix/popping.cpp
 include src/simix/popping_accessors.hpp
index 6fd16ee..b1cc822 100644 (file)
@@ -9,28 +9,6 @@
 #define SIMGRID_PUBLIC_CONFIG_H
 #include <xbt/base.h>
 
-/** Define the version numbers of the used header files.
-  See sg_version_get() 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@
-#define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
-
-SG_BEGIN_DECL
-/** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib), while
-    SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */
-XBT_PUBLIC void sg_version_get(int* major, int* minor, int* patch);
-
-/** Display the version information and some additional blurb. */
-XBT_PUBLIC void sg_version();
-SG_END_DECL
-
-
-/* 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@"
-
 /* Was Jedule compiled in?  */
 #cmakedefine01 SIMGRID_HAVE_JEDULE
 /* Was the Lua support compiled in? */
index a29e549..aa2f024 100644 (file)
@@ -17,6 +17,7 @@
 #include <simgrid/plugins/live_migration.h>
 #include <simgrid/semaphore.h>
 #include <simgrid/storage.h>
+#include <simgrid/version.h>
 #include <simgrid/vm.h>
 #include <simgrid/zone.h>
 #include <xbt.h>
index 4957244..8499305 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <simgrid/host.h>
 #include <simgrid/link.h>
+#include <simgrid/version.h>
 #include <xbt/log.h>
 #include <xbt/sysdep.h>
 
diff --git a/include/simgrid/version.h.in b/include/simgrid/version.h.in
new file mode 100644 (file)
index 0000000..e431481
--- /dev/null
@@ -0,0 +1,35 @@
+/* src/simgrid/version.h - internal versioning info                        */
+
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
+
+/* 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. */
+
+#ifndef SIMGRID_VERSION_H
+#define SIMGRID_VERSION_H
+
+#define SIMGRID_GIT_VERSION   "@GIT_VERSION@"
+
+/** Define the version numbers of the used header files.
+  See sg_version_get() 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@
+#define SIMGRID_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
+
+SG_BEGIN_DECL
+/** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib), while
+    SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */
+XBT_PUBLIC void sg_version_get(int* major, int* minor, int* patch);
+
+/** Display the version information and some additional blurb. */
+XBT_PUBLIC void sg_version();
+SG_END_DECL
+
+
+/* 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@"
+
+#endif /* SIMGRID_PUBLIC_CONFIG_H */
index 0080458..fcddfde 100644 (file)
@@ -6,6 +6,7 @@
 #include "include/xbt/config.hpp"
 #include "simgrid/Exception.hpp"
 #include "simgrid/s4u/Engine.hpp"
+#include "simgrid/version.h"
 #include "src/instr/instr_private.hpp"
 #include "surf/surf.hpp"
 #include "xbt/virtu.h" /* xbt_cmdline */
index 0d2e742..7c0691a 100644 (file)
@@ -49,7 +49,7 @@ public:
   void post() override;
   void finish() override;
 
-  CommImpl::Type type_;        /* Type of the communication (SIMIX_COMM_SEND or SIMIX_COMM_RECEIVE) */
+  CommImpl::Type type_; /* Type of the communication (SEND or RECEIVE) */
 
 #if SIMGRID_HAVE_MC
   MailboxImpl* mbox_cpy = nullptr; /* Copy of the rendez-vous where the comm is queued, MC needs it for DPOR
index e926f18..ac05e66 100644 (file)
@@ -57,4 +57,4 @@ public:
 
 XBT_PRIVATE void SIMIX_mailbox_exit();
 
-#endif /* SIMIX_MAILBOXIMPL_H */
+#endif
index 3655e53..f372ea7 100644 (file)
@@ -51,7 +51,7 @@ public:
 
   s4u::Mutex& mutex() { return piface_; }
 };
-}
-}
-}
-#endif /* SIMIX_MUTEXIMPL_HPP */
+} // namespace activity
+} // namespace kernel
+} // namespace simgrid
+#endif
index e368b49..831fb73 100644 (file)
@@ -3,8 +3,8 @@
 /* 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. */
 
-#ifndef SIMIX_ACTORIMPL_H
-#define SIMIX_ACTORIMPL_H
+#ifndef SIMGRID_KERNEL_ACTOR_ACTORIMPL_HPP
+#define SIMGRID_KERNEL_ACTOR_ACTORIMPL_HPP
 
 #include "simgrid/s4u/Actor.hpp"
 #include "src/simix/popping_private.hpp"
index 57d1311..99640f5 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "simgrid/sg_config.hpp"
 #include "simgrid/instr.h"
+#include "simgrid/version.h"
 #include "src/instr/instr_private.hpp"
 #include "src/internal_config.h"
 #include "src/kernel/lmm/maxmin.hpp"
diff --git a/src/simgrid/sg_version.cpp b/src/simgrid/sg_version.cpp
new file mode 100644 (file)
index 0000000..748c354
--- /dev/null
@@ -0,0 +1,90 @@
+/* Copyright (c) 2019. The SimGrid Team. All rights reserved.          */
+
+/* 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 "simgrid/config.h"
+#include "simgrid/version.h"
+#include "xbt/base.h"
+#include "xbt/log.h"
+#include "xbt/misc.h"
+#include "xbt/sysdep.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_version, surf, "About the versioning of SimGrid");
+
+void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch)
+{
+  if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
+    fprintf(stderr,
+            "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
+            "and then linked against SimGrid %d.%d.%d. Please fix this.\n",
+            lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
+            SIMGRID_VERSION_PATCH);
+    abort();
+  }
+  if (lib_version_patch != SIMGRID_VERSION_PATCH) {
+    if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) {
+      fprintf(
+          stderr,
+          "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
+          "and then linked against SimGrid %d.%d.%d. \n"
+          "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n",
+          lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
+          SIMGRID_VERSION_PATCH);
+      abort();
+    }
+    fprintf(stderr,
+            "Warning: Your program was compiled with SimGrid version %d.%d.%d, "
+            "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n",
+            lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
+            SIMGRID_VERSION_PATCH);
+  }
+}
+
+void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch)
+{
+  *ver_major = SIMGRID_VERSION_MAJOR;
+  *ver_minor = SIMGRID_VERSION_MINOR;
+  *ver_patch = SIMGRID_VERSION_PATCH;
+}
+
+void sg_version()
+{
+  XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION,
+           SIMGRID_INSTALL_PREFIX);
+
+#if SIMGRID_HAVE_MC
+  XBT_HELP("   Model-checking support compiled in.");
+#else
+  XBT_HELP("   Model-checking support disabled at compilation.");
+#endif
+
+#if SIMGRID_HAVE_NS3
+  XBT_HELP("   ns-3 support compiled in.");
+#else
+  XBT_HELP("   ns-3 support disabled at compilation.");
+#endif
+
+#if SIMGRID_HAVE_JEDULE
+  XBT_HELP("   Jedule support compiled in.");
+#else
+  XBT_HELP("   Jedule support disabled at compilation.");
+#endif
+
+#if SIMGRID_HAVE_LUA
+  XBT_HELP("   Lua support compiled in.");
+#else
+  XBT_HELP("   Lua support disabled at compilation.");
+#endif
+
+#if SIMGRID_HAVE_MALLOCATOR
+  XBT_HELP("   Mallocator support compiled in.");
+#else
+  XBT_HELP("   Mallocator support disabled at compilation.");
+#endif
+
+  XBT_HELP("\nTo cite SimGrid in a publication, please use:\n"
+           "   Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
+           "   Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
+           "   Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n"
+           "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319");
+}
diff --git a/src/simgrid/version.h.in b/src/simgrid/version.h.in
deleted file mode 100644 (file)
index 1f3389c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* src/simgrid/version.h - internal versioning info                        */
-
-/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
-
-/* 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. */
-
-#ifndef SIMGRID_VERSION_H
-#define SIMGRID_VERSION_H
-
-#define SIMGRID_GIT_VERSION   "@GIT_VERSION@"
-
-#endif /* SIMGRID_PUBLIC_CONFIG_H */
index 7b40665..f78f90f 100644 (file)
@@ -7,6 +7,7 @@
 #include "simgrid/instr.h"
 #include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/Host.hpp"
+#include "simgrid/version.h"
 #include "smpi_comm.hpp"
 #include "smpi_datatype_derived.hpp"
 #include "smpi_status.hpp"
index 3f3dc80..05ea270 100644 (file)
@@ -9,7 +9,6 @@
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/resource/profile/FutureEvtSet.hpp"
 #include "src/kernel/resource/profile/Profile.hpp"
-#include "src/simgrid/version.h"
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/xml/platf.hpp"
 #include "src/xbt_modinter.h" /* whether initialization was already done */
@@ -214,81 +213,6 @@ int find_model_description(const std::vector<surf_model_description_t>& table, c
   return -1;
 }
 
-void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch)
-{
-  if ((lib_version_major != SIMGRID_VERSION_MAJOR) || (lib_version_minor != SIMGRID_VERSION_MINOR)) {
-    fprintf(stderr, "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
-                    "and then linked against SimGrid %d.%d.%d. Please fix this.\n",
-            lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
-            SIMGRID_VERSION_PATCH);
-    abort();
-  }
-  if (lib_version_patch != SIMGRID_VERSION_PATCH) {
-    if (SIMGRID_VERSION_PATCH > 89 || lib_version_patch > 89) {
-      fprintf(
-          stderr,
-          "FATAL ERROR: Your program was compiled with SimGrid version %d.%d.%d, "
-          "and then linked against SimGrid %d.%d.%d. \n"
-          "One of them is a development version, and should not be mixed with the stable release. Please fix this.\n",
-          lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
-          SIMGRID_VERSION_PATCH);
-      abort();
-    }
-    fprintf(stderr, "Warning: Your program was compiled with SimGrid version %d.%d.%d, "
-                    "and then linked against SimGrid %d.%d.%d. Proceeding anyway.\n",
-            lib_version_major, lib_version_minor, lib_version_patch, SIMGRID_VERSION_MAJOR, SIMGRID_VERSION_MINOR,
-            SIMGRID_VERSION_PATCH);
-  }
-}
-
-void sg_version_get(int* ver_major, int* ver_minor, int* ver_patch)
-{
-  *ver_major = SIMGRID_VERSION_MAJOR;
-  *ver_minor = SIMGRID_VERSION_MINOR;
-  *ver_patch = SIMGRID_VERSION_PATCH;
-}
-
-void sg_version()
-{
-  XBT_HELP("This program was linked against %s (git: %s), found in %s.", SIMGRID_VERSION_STRING, SIMGRID_GIT_VERSION,
-           SIMGRID_INSTALL_PREFIX);
-
-#if SIMGRID_HAVE_MC
-  XBT_HELP("   Model-checking support compiled in.");
-#else
-  XBT_HELP("   Model-checking support disabled at compilation.");
-#endif
-
-#if SIMGRID_HAVE_NS3
-  XBT_HELP("   ns-3 support compiled in.");
-#else
-  XBT_HELP("   ns-3 support disabled at compilation.");
-#endif
-
-#if SIMGRID_HAVE_JEDULE
-  XBT_HELP("   Jedule support compiled in.");
-#else
-  XBT_HELP("   Jedule support disabled at compilation.");
-#endif
-
-#if SIMGRID_HAVE_LUA
-  XBT_HELP("   Lua support compiled in.");
-#else
-  XBT_HELP("   Lua support disabled at compilation.");
-#endif
-
-#if SIMGRID_HAVE_MALLOCATOR
-  XBT_HELP("   Mallocator support compiled in.");
-#else
-  XBT_HELP("   Mallocator support disabled at compilation.");
-#endif
-
-  XBT_HELP("\nTo cite SimGrid in a publication, please use:\n"
-           "   Henri Casanova, Arnaud Giersch, Arnaud Legrand, Martin Quinson, Frédéric Suter. \n"
-           "   Versatile, Scalable, and Accurate Simulation of Distributed Applications and Platforms. \n"
-           "   Journal of Parallel and Distributed Computing, Elsevier, 2014, 74 (10), pp.2899-2917.\n"
-           "The pdf file and a BibTeX entry for LaTeX users can be found at http://hal.inria.fr/hal-01017319");
-}
 
 void surf_init(int *argc, char **argv)
 {
index a709fd7..3db1ff9 100644 (file)
@@ -463,6 +463,7 @@ set(S4U_SRC
 set(SIMGRID_SRC
   src/simgrid/Exception.cpp
   src/simgrid/sg_config.cpp
+  src/simgrid/sg_version.cpp
   src/simgrid/util.hpp
   )
 
@@ -791,8 +792,8 @@ set(headers_to_install
   )
 set(source_of_generated_headers
   include/simgrid/config.h.in
+  include/simgrid/version.h.in
   src/internal_config.h.in
-  src/simgrid/version.h.in
   include/smpi/mpif.h.in)
 
 ### depend of some variables setted upper