A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge back master branch.
[simgrid.git]
/
src
/
gras
/
gras.c
diff --git
a/src/gras/gras.c
b/src/gras/gras.c
index
f718ca1
..
503651b
100644
(file)
--- a/
src/gras/gras.c
+++ b/
src/gras/gras.c
@@
-1,9
+1,7
@@
-/* $Id$ */
-
/* gras.c -- generic functions not fitting anywhere else */
/* gras.c -- generic functions not fitting anywhere else */
-/* Copyright (c) 200
3, 2004 Martin Quinson. */
-
/
* All rights reserved. */
+/* Copyright (c) 200
4, 2005, 2006, 2007, 2008, 2009, 2010. 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. */
/* 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. */
@@
-31,7
+29,7
@@
static int gras_running_process = 0;
#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
static void gras_sigusr_handler(int sig)
{
#if defined(HAVE_SIGNAL) && defined(HAVE_SIGNAL_H)
static void gras_sigusr_handler(int sig)
{
-
INFO0
("SIGUSR1 received. Display the backtrace");
+
XBT_INFO
("SIGUSR1 received. Display the backtrace");
xbt_backtrace_display_current();
}
xbt_backtrace_display_current();
}
@@
-72,10
+70,10
@@
XBT_LOG_EXTERNAL_CATEGORY(gras_virtu_process);
void gras_init(int *argc, char **argv)
{
void gras_init(int *argc, char **argv)
{
-
+ int first = 0;
gras_procdata_t *pd;
gras_msg_procdata_t msg_pd;
gras_procdata_t *pd;
gras_msg_procdata_t msg_pd;
-
VERB0
("Initialize GRAS");
+
XBT_VERB
("Initialize GRAS");
xbt_getpid = gras_os_getpid;
/* First initialize the XBT */
xbt_getpid = gras_os_getpid;
/* First initialize the XBT */
@@
-85,6
+83,7
@@
void gras_init(int *argc, char **argv)
* - declare process specific data we need (without creating them)
*/
if (gras_running_process == 0) {
* - declare process specific data we need (without creating them)
*/
if (gras_running_process == 0) {
+ first = 1;
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(gras_ddt, gras);
XBT_LOG_CONNECT(gras_ddt_cbps, gras_ddt);
/* Connect our log channels: that must be done manually under windows */
XBT_LOG_CONNECT(gras_ddt, gras);
XBT_LOG_CONNECT(gras_ddt_cbps, gras_ddt);
@@
-112,6
+111,7
@@
void gras_init(int *argc, char **argv)
gras_trp_register();
gras_msg_register();
}
gras_trp_register();
gras_msg_register();
}
+ gras_running_process++;
/*
* Initialize the process specific stuff
/*
* Initialize the process specific stuff
@@
-121,7
+121,7
@@
void gras_init(int *argc, char **argv)
/*
* Initialize the global stuff if it's not the first process created
*/
/*
* Initialize the global stuff if it's not the first process created
*/
- if (
gras_running_process++ == 0
) {
+ if (
first
) {
gras_emul_init();
gras_msg_init();
gras_trp_init();
gras_emul_init();
gras_msg_init();
gras_trp_init();
@@
-145,12
+145,10
@@
void gras_init(int *argc, char **argv)
void gras_exit(void)
{
void gras_exit(void)
{
- gras_procdata_t *pd;
- INFO0("Exiting GRAS");
+ XBT_INFO("Exiting GRAS");
amok_exit();
gras_moddata_leave();
amok_exit();
gras_moddata_leave();
- pd = gras_procdata_get();
- gras_msg_listener_shutdown(pd->listener);
+ gras_msg_listener_shutdown();
gras_process_exit();
if (--gras_running_process == 0) {
gras_msg_exit();
gras_process_exit();
if (--gras_running_process == 0) {
gras_msg_exit();
@@
-159,7
+157,6
@@
void gras_exit(void)
gras_emul_exit();
gras_moddata_exit();
}
gras_emul_exit();
gras_moddata_exit();
}
- xbt_exit();
}
const char *hexa_str(unsigned char *data, int size, int downside)
}
const char *hexa_str(unsigned char *data, int size, int downside)