Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge conditional execution and timing macros into emulation module
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 May 2005 13:32:16 +0000 (13:32 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 10 May 2005 13:32:16 +0000 (13:32 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1261 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/gras/Virtu/rl_conditional.c [deleted file]
src/gras/Virtu/rl_emul.c [moved from src/gras/Virtu/rl_chrono.c with 50% similarity]
src/gras/Virtu/sg_conditional.c [deleted file]
src/gras/Virtu/sg_emul.c [moved from src/gras/Virtu/sg_chrono.c with 85% similarity]

diff --git a/src/gras/Virtu/rl_conditional.c b/src/gras/Virtu/rl_conditional.c
deleted file mode 100644 (file)
index 48e3780..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $Id$ */
-
-/* rl_conditional - conditional execution (real life)                       */
-
-/* Copyright (c) 2003, 2004 Martin Quinson. 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 "gras/cond.h"
-#include "gras/Virtu/virtu_rl.h"
-
-int gras_if_RL(void) {
-   return 1;
-}
-
-int gras_if_SG(void) {
-   return 0;
-}
similarity index 50%
rename from src/gras/Virtu/rl_chrono.c
rename to src/gras/Virtu/rl_emul.c
index e7b2597..8ec8fec 100644 (file)
@@ -1,21 +1,19 @@
-/*     $Id$     */
+/* $Id$ */
 
-/* rl_chrono.c - code benchmarking for emulation (fake for real life)       */
+/* rl_emul - Emulation support (real life)                                  */
 
-/* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved.  */
+/* Copyright (c) 2003-5 Arnaud Legrand, Martin Quinson. 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 "xbt/sysdep.h"
-#include "xbt/dict.h"
-#include "gras/chrono.h"
-#include "msg/msg.h"
-#include "portable.h"
+#include "gras/emul.h"
+#include "gras/Virtu/virtu_rl.h"
 #include "gras_modinter.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(chrono,gras,"Benchmarking used code");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(emul,gras,"Emulation support");
 
+/*** Timing macros: nothing to do in RL. Actually do the job and shutup ***/
 
 int gras_bench_always_begin(const char *location,int line) {
   return 0;
@@ -35,3 +33,13 @@ int gras_bench_once_end(void) {
 
 void gras_chrono_init(void)  {}
 void gras_chrono_exit(void)  {}
+
+/*** Conditional execution support ***/
+
+int gras_if_RL(void) {
+   return 1;
+}
+
+int gras_if_SG(void) {
+   return 0;
+}
diff --git a/src/gras/Virtu/sg_conditional.c b/src/gras/Virtu/sg_conditional.c
deleted file mode 100644 (file)
index 696e4d2..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $Id$ */
-
-/* sg_conditional - conditional execution (simulation)                      */
-
-/* Copyright (c) 2003, 2004 Martin Quinson. 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 "gras/cond.h"
-#include "gras/Virtu/virtu_sg.h"
-
-int gras_if_RL(void) {
-   return 0;
-}
-
-int gras_if_SG(void) {
-   return 1;
-}
similarity index 85%
rename from src/gras/Virtu/sg_chrono.c
rename to src/gras/Virtu/sg_emul.c
index 8e61e30..6d70e51 100644 (file)
@@ -1,22 +1,22 @@
-/*     $Id$     */
+/* $Id$ */
 
-/* sg_chrono.c - code benchmarking for emulation                            */
+/* sg_emul - Emulation support (simulation)                                 */
 
-/* Copyright (c) 2005 Martin Quinson, Arnaud Legrand. All rights reserved.  */
+/* Copyright (c) 2003-5 Arnaud Legrand, Martin Quinson. 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 "xbt/sysdep.h"
-#include "xbt/dict.h"
-#include "gras/chrono.h"
-#include "msg/msg.h"
-#include "xbt/xbt_portability.h"
-#include "portable.h"
+#include "gras/emul.h"
+#include "gras/Virtu/virtu_sg.h"
 #include "gras_modinter.h"
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(chrono,gras,"Benchmarking used code");
+#include "xbt/xbt_portability.h" /* timers */
+#include "xbt/dict.h"
+
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(emul,gras,"Emulation support");
 
+/*** Timing macros ***/
 static xbt_os_timer_t timer;
 static int benchmarking = 0;
 static xbt_dict_t benchmark_set = NULL;
@@ -128,3 +128,15 @@ void gras_chrono_exit(void) {
   xbt_dict_free(&benchmark_set);
   xbt_os_timer_free(timer);
 }
+
+/*** Conditional execution support ***/
+
+int gras_if_RL(void) {
+   return 0;
+}
+
+int gras_if_SG(void) {
+   return 1;
+}
+
+