From f581799445893c1b953c365fbfb025e3dbcc775a Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 30 Apr 2018 18:30:40 +0200 Subject: [PATCH] Fix build with SimGrid 3.12. Drop compatibility with older versions. --- communicator.cpp | 2 +- communicator.h | 2 +- deployment.cpp | 2 +- hostdata.h | 2 +- main.cpp | 8 +------- messages.h | 2 +- misc.h | 2 +- msg_thread.h | 2 +- neighbor.cpp | 2 +- process.h | 2 +- simgrid_features.h | 16 +++------------- 11 files changed, 13 insertions(+), 29 deletions(-) diff --git a/communicator.cpp b/communicator.cpp index 40752c5..2df6d76 100644 --- a/communicator.cpp +++ b/communicator.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(comm); diff --git a/communicator.h b/communicator.h index 8f3f6bf..c123b1b 100644 --- a/communicator.h +++ b/communicator.h @@ -4,7 +4,7 @@ #define COMMUNICATOR_H #include -#include +#include #include "hostdata.h" #include "messages.h" #include "msg_thread.h" diff --git a/deployment.cpp b/deployment.cpp index 0a5db8c..287ca4f 100644 --- a/deployment.cpp +++ b/deployment.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include diff --git a/hostdata.h b/hostdata.h index aa7884c..2c5379a 100644 --- a/hostdata.h +++ b/hostdata.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "simgrid_features.h" // Helper class that associates instances of itself with each host. diff --git a/main.cpp b/main.cpp index e148574..af47c64 100644 --- a/main.cpp +++ b/main.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include // Creates log categories @@ -234,7 +234,6 @@ int main(int argc, char* argv[]) "Compiled on " << version::date << "\n\n"; if (!parse_res || opt::help_requested) opt::usage(); - res = MSG_clean(); exit(parse_res ? EXIT_NO_FAILURE : EXIT_FAILURE_ARGS); } XBT_INFO("%s v%s (%s)", opt::program_name.c_str(), version::num.c_str(), @@ -308,11 +307,6 @@ int main(int argc, char* argv[]) // Clean the MSG simulation. hostdata::destroy(); - res = MSG_clean(); - if (res != MSG_OK) { - XBT_ERROR("MSG_clean() failed with status %#x", res); - exit_status |= EXIT_FAILURE_CLEAN; - } // Report final simulation status. if (simulated_time >= 0.0) { diff --git a/messages.h b/messages.h index cc6efbc..925047d 100644 --- a/messages.h +++ b/messages.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "simgrid_features.h" #include "synchro.h" #include "sync_queue.h" diff --git a/misc.h b/misc.h index 557bed5..8700b96 100644 --- a/misc.h +++ b/misc.h @@ -20,7 +20,7 @@ namespace misc { /* Defines XBT_XCLOG(...) which behave like XBT_CLOG(...), except that the * given category is not passed through _XBT_LOGV before use. */ -#define XBT_XCLOG(c, p, ...) XBT_CLOG_((*(c)), p, __VA_ARGS__) +#define XBT_XCLOG(c, p, ...) XBT_CLOG((*(c)), p, __VA_ARGS__) #endif // !MISC_H diff --git a/msg_thread.h b/msg_thread.h index 69ce02b..5196c62 100644 --- a/msg_thread.h +++ b/msg_thread.h @@ -2,7 +2,7 @@ #define MSG_THREAD_H #include -#include +#include #include "simgrid_features.h" #include "synchro.h" diff --git a/neighbor.cpp b/neighbor.cpp index e0925da..c3ea8c8 100644 --- a/neighbor.cpp +++ b/neighbor.cpp @@ -1,5 +1,5 @@ #include -#include +#include XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(proc); // needed to compile neighbor.h diff --git a/process.h b/process.h index c9873e0..55ee792 100644 --- a/process.h +++ b/process.h @@ -14,7 +14,7 @@ # define MAP_TEMPLATE std::map #endif #include -#include +#include #include #include "communicator.h" #include "misc.h" diff --git a/simgrid_features.h b/simgrid_features.h index 00ff3a7..3de11a0 100644 --- a/simgrid_features.h +++ b/simgrid_features.h @@ -3,19 +3,9 @@ #include -#if !defined(SIMGRID_VERSION) || SIMGRID_VERSION < 30700UL // == SG < 3.7 == // -# error "Unsupported SimGrid version. Need version >= 3.7" -#endif // ================================================================== // - -#if SIMGRID_VERSION < 30800UL // ============================== SG < 3.8 === // -# define MSG_init(argc, argv) MSG_global_init(argc, argv) -# define msg_error_t MSG_error_t -# define msg_host_t m_host_t -# define msg_process_t m_process_t -# define msg_task_t m_task_t -#else // =================================================================== // -# define MSG_clean() MSG_OK -#endif // ================================================================== // +#if !defined(SIMGRID_VERSION) || SIMGRID_VERSION < 31200UL // == SG < 3.12 == // +# error "Unsupported SimGrid version. Need version >= 3.12" +#endif // =================================================================== // #endif // !SIMGRID_FEATURES_H -- 2.39.5