3 /* gras.c -- generic functions not fitting anywhere else */
5 /* Copyright (c) 2003, 2004 Martin Quinson. */
6 /* All rights reserved. */
8 /* This program is free software; you can redistribute it and/or modify it
9 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "xbt/module.h" /* xbt_init/exit */
14 #include "gras_modinter.h" /* module init/exit */
15 #include "xbt_modinter.h" /* module init/exit */
17 #include "gras/core.h"
18 #include "gras/cond.h" /* gras_if_RL() => FIXME: killme when gras/sg works */
19 #include "gras/process.h" /* FIXME: killme and put process_init in modinter */
21 XBT_LOG_NEW_DEFAULT_CATEGORY(gras,"All GRAS categories");
22 static int gras_running_process = 0;
24 void gras_init(int *argc,char **argv, const char *defaultlog) {
26 INFO0("Initialize GRAS");
27 xbt_assert0(gras_if_RL(),"Work in progress. Forget about GRAS simulation for now.");
28 xbt_init_defaultlog(argc,argv,defaultlog);
29 gras_process_init(); /* calls procdata_init, which calls dynar_new */
30 /** init other submodules */
31 if (gras_running_process++ == 0) {
38 void gras_exit(void) {
39 INFO0("Exiting GRAS");
41 if (--gras_running_process == 0) {