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
More debug msg, rephrase other debug msg
[simgrid.git]
/
src
/
xbt
/
module.c
diff --git
a/src/xbt/module.c
b/src/xbt/module.c
index
5391c31
..
c7b52bb
100644
(file)
--- a/
src/xbt/module.c
+++ b/
src/xbt/module.c
@@
-13,6
+13,7
@@
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(module,GRAS);
extern void gras_log_exit(void);
GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(module,GRAS);
extern void gras_log_exit(void);
+static int gras_running_process = 0;
struct gras_module_ {
gras_dynar_t *deps;
struct gras_module_ {
gras_dynar_t *deps;
@@
-50,6
+51,7
@@
gras_init_defaultlog(int *argc,char **argv, const char *defaultlog) {
opt=strchr(argv[i],'=');
opt++;
TRYFAIL(gras_log_control_set(opt));
opt=strchr(argv[i],'=');
opt++;
TRYFAIL(gras_log_control_set(opt));
+ DEBUG1("Did apply '%s' as log setting",opt);
/*remove this from argv*/
for (j=i+1; j<*argc; j++) {
argv[j-1] = argv[j];
/*remove this from argv*/
for (j=i+1; j<*argc; j++) {
argv[j-1] = argv[j];
@@
-64,10
+66,13
@@
gras_init_defaultlog(int *argc,char **argv, const char *defaultlog) {
TRYFAIL(gras_log_control_set(defaultlog));
}
TRYFAIL(gras_log_control_set(defaultlog));
}
+ gras_process_init(); /* calls procdata_init, which calls dynar_new */
/** init other submodules */
/** init other submodules */
- gras_msg_init();
- gras_trp_init();
- gras_datadesc_init();
+ if (gras_running_process++ == 0) {
+ gras_msg_init();
+ gras_trp_init();
+ gras_datadesc_init();
+ }
}
/**
}
/**
@@
-77,8
+82,13
@@
gras_init_defaultlog(int *argc,char **argv, const char *defaultlog) {
*/
void
gras_exit(){
*/
void
gras_exit(){
- gras_msg_exit();
- gras_trp_exit();
- gras_datadesc_exit();
+ INFO0("Exiting GRAS");
+ gras_process_exit();
+ if (--gras_running_process == 0) {
+ gras_msg_exit();
+ gras_trp_exit();
+ gras_datadesc_exit();
+ }
gras_log_exit();
gras_log_exit();
+ DEBUG0("Exited GRAS");
}
}