From: mquinson Date: Tue, 10 May 2005 13:32:16 +0000 (+0000) Subject: Merge conditional execution and timing macros into emulation module X-Git-Tag: v3.3~4093 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/1da99cb4dcc64cf3993af474abf27399722aa09a Merge conditional execution and timing macros into emulation module git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1261 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Virtu/rl_conditional.c b/src/gras/Virtu/rl_conditional.c deleted file mode 100644 index 48e3780b01..0000000000 --- a/src/gras/Virtu/rl_conditional.c +++ /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; -} diff --git a/src/gras/Virtu/rl_chrono.c b/src/gras/Virtu/rl_emul.c similarity index 50% rename from src/gras/Virtu/rl_chrono.c rename to src/gras/Virtu/rl_emul.c index e7b2597da4..8ec8fec2f3 100644 --- a/src/gras/Virtu/rl_chrono.c +++ b/src/gras/Virtu/rl_emul.c @@ -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 index 696e4d2b55..0000000000 --- a/src/gras/Virtu/sg_conditional.c +++ /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; -} diff --git a/src/gras/Virtu/sg_chrono.c b/src/gras/Virtu/sg_emul.c similarity index 85% rename from src/gras/Virtu/sg_chrono.c rename to src/gras/Virtu/sg_emul.c index 8e61e30321..6d70e51c31 100644 --- a/src/gras/Virtu/sg_chrono.c +++ b/src/gras/Virtu/sg_emul.c @@ -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; +} + +