From 431784fbebda861a137730be550d1981776e686d Mon Sep 17 00:00:00 2001
From: Arnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Date: Thu, 17 Mar 2011 17:49:33 +0100
Subject: [PATCH 1/1] SimGrid version <= 3.5 is not supported anymore.

---
 Dep.xml            |  2 +-
 Makefile           | 18 +++---------------
 Plat.xml           |  2 +-
 cluster1000.xml    |  2 +-
 communicator.cpp   |  3 +--
 deployment.xml     |  2 +-
 machines1000.xml   |  2 +-
 misc.h             | 30 ------------------------------
 platform.xml       |  2 +-
 simgrid_features.h | 23 +----------------------
 10 files changed, 11 insertions(+), 75 deletions(-)

diff --git a/Dep.xml b/Dep.xml
index a48504d..821375d 100644
--- a/Dep.xml
+++ b/Dep.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
   <process host="1" function="simulation_main">
     <argument value="777"/>
diff --git a/Makefile b/Makefile
index 2af8eba..751418c 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
-SIMGRID_INSTALL_DIR ?= $(PWD)/simgrid-stable
-#SIMGRID_INSTALL_DIR ?= $(PWD)/simgrid-dev
+#SIMGRID_INSTALL_DIR ?= $(PWD)/simgrid-stable
+SIMGRID_INSTALL_DIR ?= $(PWD)/simgrid-dev
 
 OPTIM_FLAGS += -O3
 DEBUG_FLAGS += -g
@@ -50,14 +50,7 @@ DEFAULT_TARGETS := loba
 FLAVOURED_LOBA := loba-dev loba-stable
 TARGETS := $(DEFAULT_TARGETS)
 
-XML_FILES =						\
-	Dep.xml  Plat.xml				\
-	platform.xml deployment.xml			\
-	cluster1000.xml machines1000.xml
-
-XML_DEV_FILES = $(XML_FILES:%.xml=%_dev.xml)
-
-.PHONY: all full xml clean realclean $(FLAVOURED_LOBA)
+.PHONY: all full clean realclean $(FLAVOURED_LOBA)
 
 all: $(DEFAULT_TARGETS)
 
@@ -68,8 +61,6 @@ full:
 	done
 	$(MAKE) xml $(DEFAULT_TARGETS)
 
-xml: $(XML_DEV_FILES)
-
 clean:
 	$(RM) core core.[0-9]* vgcore.[0-9]*
 	$(RM) localversion
@@ -84,9 +75,6 @@ realclean: clean
 
 .%.d: %.cpp ; $(MAKEDEPEND.CXX)
 
-%_dev.xml: %.xml
-	sed '/DOCTYPE/s,simgrid.dtd,http://simgrid.gforge.inria.fr/&,' $< > $@
-
 $(FLAVOURED_LOBA):
 	$(MAKE) clean
 	$(MAKE) SIMGRID_INSTALL_DIR=$(PWD)/simgrid-$(patsubst loba-%,%,$@) loba
diff --git a/Plat.xml b/Plat.xml
index 81e0687..eea4ead 100644
--- a/Plat.xml
+++ b/Plat.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
  <AS  id="AS0"  routing="Full">
   <host id="1" power="98095000"/>
diff --git a/cluster1000.xml b/cluster1000.xml
index 182e3f8..77b3771 100644
--- a/cluster1000.xml
+++ b/cluster1000.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
 <AS  id="AS0"  routing="Full">
   <cluster id="c" prefix="h-" suffix="" radical="100000-100999"
diff --git a/communicator.cpp b/communicator.cpp
index bd0cb7b..867d19e 100644
--- a/communicator.cpp
+++ b/communicator.cpp
@@ -73,8 +73,7 @@ void communicator::real_flush(sent_comm_type& sent_comm, bool wait)
         std::copy(sent_comm.begin(), sent_comm.end(), comms);
         sent_comm.clear();
         MSG_comm_waitall(comms, size, -1.0);
-        if (!MSG_WAIT_DESTROYS_COMMS)
-            std::for_each(comms, comms + size, comm_check_n_destroy);
+        std::for_each(comms, comms + size, comm_check_n_destroy);
         delete[] comms;
     }
 }
diff --git a/deployment.xml b/deployment.xml
index be75562..8c14384 100644
--- a/deployment.xml
+++ b/deployment.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
   <process host="Tremblay" function="simulation_main">
     <argument value="5"/>
diff --git a/machines1000.xml b/machines1000.xml
index 4c51754..3134038 100644
--- a/machines1000.xml
+++ b/machines1000.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
 <AS  id="AS0"  routing="Full">
   <cluster id="c" prefix="h-" suffix="" radical="100000-100999"
diff --git a/misc.h b/misc.h
index 47a6928..557bed5 100644
--- a/misc.h
+++ b/misc.h
@@ -17,36 +17,6 @@ namespace misc {
 #define LOG_ISENABLED(priority) \
     (_XBT_LOG_ISENABLEDV((*_XBT_LOGV(default)), (priority)))
 
-#ifndef XBT_CLOG
-#  define XBT_CLOG_(catv, prio, ...)                                    \
-    do {                                                                \
-        if (_XBT_LOG_ISENABLEDV(catv, prio)) {                          \
-            s_xbt_log_event_t _log_ev;                                  \
-            _log_ev.cat = &(catv);                                      \
-            _log_ev.priority = (prio);                                  \
-            _log_ev.fileName = __FILE__;                                \
-            _log_ev.functionName = _XBT_FUNCTION;                       \
-            _log_ev.lineNum = __LINE__;                                 \
-            memset(_log_ev.buffer, 0, XBT_LOG_BUFF_SIZE);               \
-            _xbt_log_event_log(&_log_ev, __VA_ARGS__);                  \
-        }                                                               \
-    }  while (0)
-#  define XBT_CLOG(c, p, ...) XBT_CLOG_(_XBT_LOGV(c), p, __VA_ARGS__)
-#  define XBT_CDEBUG(c, ...) XBT_CLOG(c, xbt_log_priority_debug, __VA_ARGS__)
-#  define XBT_CVERB(c, ...) XBT_CLOG(c, xbt_log_priority_verbose, __VA_ARGS__)
-#  define XBT_CINFO(c, ...) XBT_CLOG(c, xbt_log_priority_info, __VA_ARGS__)
-#  define XBT_CWARN(c, ...) XBT_CLOG(c, xbt_log_priority_warning, __VA_ARGS__)
-#  define XBT_CERROR(c, ...) XBT_CLOG(c, xbt_log_priority_error, __VA_ARGS__)
-#  define XBT_CCRITICAL(c, ...) XBT_CLOG(c, xbt_log_priority_critical, __VA_ARGS__)
-#  define XBT_LOG(...) XBT_CLOG_((*_XBT_LOGV(default)), __VA_ARGS__)
-#  define XBT_DEBUG(...) XBT_LOG(xbt_log_priority_debug, __VA_ARGS__)
-#  define XBT_VERB(...) XBT_LOG(xbt_log_priority_verbose, __VA_ARGS__)
-#  define XBT_INFO(...) XBT_LOG(xbt_log_priority_info, __VA_ARGS__)
-#  define XBT_WARN(...) XBT_LOG(xbt_log_priority_warning, __VA_ARGS__)
-#  define XBT_ERROR(...) XBT_LOG(xbt_log_priority_error, __VA_ARGS__)
-#  define XBT_CRITICAL(...) XBT_LOG(xbt_log_priority_critical, __VA_ARGS__)
-#endif
-
 /* Defines XBT_XCLOG(...) which behave like XBT_CLOG(...), except that the
  * given category is not passed through _XBT_LOGV before use.
  */
diff --git a/platform.xml b/platform.xml
index 677cd63..60c1e0a 100644
--- a/platform.xml
+++ b/platform.xml
@@ -1,5 +1,5 @@
 <?xml version='1.0'?>
-<!DOCTYPE platform SYSTEM "simgrid.dtd">
+<!DOCTYPE platform SYSTEM "http://simgrid.gforge.inria.fr/simgrid.dtd">
 <platform version="3">
  <AS  id="AS0"  routing="Full">
   <!-- ljlkj -->
diff --git a/simgrid_features.h b/simgrid_features.h
index 75a1521..0b74575 100644
--- a/simgrid_features.h
+++ b/simgrid_features.h
@@ -1,29 +1,8 @@
 #ifndef SIMGRID_FEATURES_H
 #define SIMGRID_FEATURES_H
 
-/* What is defined here:
- * =====================
- *
- * MSG_WAIT_DESTROYS_COMMS      1 if MSG_wait destroys communications
- *                              (has changed after SimGrid 3.5)
- *
- * MSG_comm_get_status(comm)    MSG_OK on SG 3.5 where it does not exist.
- */
-
 #if !defined(SIMGRID_VERSION) // ========== SimGrid <= 3.5 ============= //
-
-#define MSG_WAIT_DESTROYS_COMMS 1
-
-inline
-MSG_error_t MSG_comm_get_status(msg_comm_t /*comm*/)
-{
-    return MSG_OK;
-}
-
-#else  // ================================= SimGrid > 3.5 ============== //
-
-#define MSG_WAIT_DESTROYS_COMMS 0
-
+#  error "Unsupported SimGrid version.  Need version > 3.5"
 #endif  // ============================================================= //
 
 #endif // !SIMGRID_FEATURES_H
-- 
2.39.5