From: Arnaud Giersch Date: Thu, 22 Nov 2012 15:48:09 +0000 (+0100) Subject: Remove more references to gras. X-Git-Tag: v3_9_rc1~91^2~47^2~28 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/08b1a7bab15ffcf8d79befb2ae9ff128724808eb Remove more references to gras. --- diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index b80bd3a4bf..45df87432b 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -313,7 +313,6 @@ set(LUA_SRC src/bindings/lua/lua_platf.c src/bindings/lua/lua_process.c src/bindings/lua/lua_state_cloner.c - src/bindings/lua/lua_stub_generator.c src/bindings/lua/lua_task.c src/bindings/lua/lua_utils.c src/bindings/lua/simgrid_lua.c diff --git a/examples/platforms/content/storage_content.txt b/examples/platforms/content/storage_content.txt index c7d4a04b36..4a13ec42d7 100644 --- a/examples/platforms/content/storage_content.txt +++ b/examples/platforms/content/storage_content.txt @@ -329,7 +329,6 @@ -rw-r--r-- 1 user user 43212 2011-10-05 16:04 ./doc/simgrid/html/MSG_ex_asynchronous_communications.html -rw-r--r-- 1 user user 30326 2011-10-05 16:04 ./doc/simgrid/html/Paje_MSG_screenshot_thn.jpg -rw-r--r-- 1 user user 0 2011-10-05 16:04 ./doc/simgrid/html/GRAS_tut.html --rw-r--r-- 1 user user 244 2011-10-05 16:04 ./doc/simgrid/html/gras.html -rw-r--r-- 1 user user 17605 2011-10-05 16:04 ./doc/simgrid/html/GRAS_tut_tour_callbacks.html -rw-r--r-- 1 user user 2783 2011-10-05 16:04 ./doc/simgrid/html/structsurf__network__model__extension__public.html -rw-r--r-- 1 user user 2621 2011-10-05 16:04 ./doc/simgrid/html/structsurf__model__description.html @@ -517,7 +516,6 @@ -rw-r--r-- 1 user user 510 2011-10-05 16:04 ./include/smpi/mpi.h -rw-r--r-- 1 user user 3187 2011-10-05 16:04 ./include/smpi/smpi_cocci.h -rw-r--r-- 1 user user 24101 2011-10-05 16:04 ./include/smpi/smpi.h --rw-r--r-- 1 user user 896 2011-10-05 16:04 ./include/gras.h -rw-r--r-- 1 user user 3626 2011-10-05 16:04 ./include/xbt/fifo.h -rw-r--r-- 1 user user 7459 2011-10-05 16:04 ./include/xbt/dict.h -rw-r--r-- 1 user user 2111 2011-10-05 16:04 ./include/xbt/str.h @@ -553,16 +551,6 @@ -rw-r--r-- 1 user user 9553 2011-10-05 16:04 ./include/xbt/dynar.h -rw-r--r-- 1 user user 1444 2011-10-05 16:04 ./include/xbt/heap.h -rw-r--r-- 1 user user 876 2011-10-05 16:04 ./include/xbt.h --rw-r--r-- 1 user user 2023 2011-10-05 16:04 ./include/gras/timer.h --rw-r--r-- 1 user user 5531 2011-10-05 16:04 ./include/gras/transport.h --rw-r--r-- 1 user user 27038 2011-10-05 16:04 ./include/gras/datadesc.h --rw-r--r-- 1 user user 2475 2011-10-05 16:04 ./include/gras/process.h --rw-r--r-- 1 user user 2680 2011-10-05 16:04 ./include/gras/virtu.h --rw-r--r-- 1 user user 7119 2011-10-05 16:04 ./include/gras/emul.h --rw-r--r-- 1 user user 981 2011-10-05 16:04 ./include/gras/module.h --rw-r--r-- 1 user user 12302 2011-10-05 16:04 ./include/gras/messages.h --rw-r--r-- 1 user user 3571 2011-10-05 16:04 ./include/amok/peermanagement.h --rw-r--r-- 1 user user 6945 2011-10-05 16:04 ./include/amok/bandwidth.h -rw-r--r-- 1 user user 4635 2011-10-05 16:04 ./include/msg/datatypes.h -rw-r--r-- 1 user user 12038 2011-10-05 16:04 ./include/msg/msg.h -rw-r--r-- 1 user user 3641 2012-03-13 14:44 ./include/simgrid_config.h diff --git a/src/bindings/lua/lua_stub_generator.c b/src/bindings/lua/lua_stub_generator.c deleted file mode 100644 index 0b13f2691d..0000000000 --- a/src/bindings/lua/lua_stub_generator.c +++ /dev/null @@ -1,356 +0,0 @@ -/* lua_stub_generator - creates the main() to use a GRAS program */ - -/* Copyright (c) 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. */ - -#include "simgrid_lua.h" -#include "xbt.h" -#include -#include - -#define WARN "/***********\n * DO NOT EDIT! THIS FILE HAS BEEN AUTOMATICALLY GENERATED FROM %s BY gras_stub_generator\n ***********/\n" -#define SIM_SOURCENAME "_%s_simulator.c" -#define SIM_OBJNAME "_%s_simulator.o" -#define SIM_BINARYNAME "%s_simulator" -#define SIM_SOURCENAME_LDADD "%s_simulator_LDADD" -#define SIM_SOURCENAME_SOURCES "%s_simulator_SOURCES" -#define RL_SOURCENAME "_%s_%s.c" -#define RL_OBJNAME "_%s_%s.o" -#define RL_BINARYNAME "%s_%s" -#define RL_SOURCENAME_LDADD "%s_%s_LDADD" -#define RL_SOURCENAME_SOURCES "%s_%s_SOURCES" -#define MAKEFILE_FILENAME_AM "%s.Makefile.am" -#define MAKEFILE_FILENAME_LOCAL "%s.mk" -#define MAKEFILE_FILENAME_REMOTE "%s.Makefile.remote" -#define DEPLOYMENT "%s.deploy.sh" - -/**********************************************/ -/**** Generate the file for the simulator *****/ -/**********************************************/ - -const char *SIM_PREEMBULE = - "/* specific to Borland Compiler */\n" - "#ifdef __BORLANDC__\n" - "#pragma hdrstop\n" - "#endif\n\n" - "#include \n" - "#include \n" - "#include \"msg/msg.h\"\n" - "#include \n" "\n" "char *gras_log=NULL;\n"; - - -#define SIM_LAUNCH_FUNC \ -"int launch_%s(int argc, char **argv) {\n" \ -" char **myargv=argv;\n" \ -" int myargc=argc;\n" \ -" int i;\n" \ -" int retcode;\n"\ -" \n"\ -" if (gras_log) {\n"\ -" myargv=malloc((argc+1) * sizeof(char**));\n" \ -" for (i=0; i_simulator.c */ - filename = xbt_new(char, strlen(project) + strlen(SIM_SOURCENAME)); - sprintf(filename, SIM_SOURCENAME, project); - - OUT = fopen(filename, "w"); - - xbt_assert(OUT, "Unable to open %s for writing", filename); - - fprintf(OUT, "%s", SIM_PREEMBULE); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, "int %s(int argc,char *argv[]);\n", key); - } - - fprintf(OUT, "\n"); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, "int launch_%s(int argc,char *argv[]);\n", key); - } - - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, SIM_LAUNCH_FUNC, key, key); - } - - fprintf(OUT, "%s", "/* specific to Borland Compiler */\n" - "#ifdef __BORLANDDC__\n" "#pragma argsused\n" "#endif\n\n"); - - fprintf(OUT, "%s", "int main (int argc,char *argv[]) {\n" - "\n" - " /* Simulation setup */\n" - " gras_global_init(&argc,argv);\n" - " if (argc != 2) {\n" - " fprintf(stderr, \"Usage: lua platform_script.lua [--log=...]\\n\");\n" - " exit(1);\n" " }\n" "\n"); - fprintf(OUT, "\n" " /* Application deployment */\n"); - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, " gras_function_register(\"%s\", launch_%s);\n", key, - key); - } - fprintf(OUT, "%s", SIM_MAIN_POSTEMBULE); - fclose(OUT); - free(filename); -} - -/**********************************************/ -/**** Generate the file for the real life *****/ -/**********************************************/ - -void generate_rl(const char *project) -{ - xbt_dict_cursor_t cursor = NULL; - char *key = NULL; - void *data = NULL; - char *filename = NULL; - FILE *OUT = NULL; - - xbt_dict_foreach(process_function_set, cursor, key, data) { - filename = - xbt_new(char, - strlen(project) + strlen(RL_SOURCENAME) + strlen(key)); - - sprintf(filename, RL_SOURCENAME, project, key); - - OUT = fopen(filename, "w"); - xbt_assert(OUT, "Unable to open %s for writing", filename); - - fprintf(OUT, "/* specific to Borland Compiler */\n" - "#ifdef __BORLANDC__\n" - "#pragma hdrstop\n" - "#endif\n\n" - "#include \n" - "#include \n" - "#include \n" - "\n" - "XBT_PUBLIC_DATA(const char *) _gras_procname;\n" - "/* user code */\n" - "int %s(int argc, char *argv[]);\n" - "\n" - "/* specific to Borland Compiler */\n" - "#ifdef __BORLANDC__\n" - "#pragma argsused\n" - "#endif\n\n" - "int main(int argc, char *argv[]){\n" - " int errcode;\n" - "\n" - " _gras_procname = \"%s\";\n" - " errcode=%s(argc,argv);\n" - " \n" " return errcode;\n" "}\n", key, key, key); - fclose(OUT); - free(filename); - } -} - -void generate_makefile_am(const char *project) -{ - xbt_dict_cursor_t cursor = NULL; - char *key = NULL; - void *data = NULL; - char *filename = NULL; - FILE *OUT = NULL; - - filename = xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_AM)); - sprintf(filename, MAKEFILE_FILENAME_AM, project); - - OUT = fopen(filename, "w"); - xbt_assert(OUT, "Unable to open %s for writing", filename); - - fprintf(OUT, "# AUTOMAKE variable definition\n"); - fprintf(OUT, "INCLUDES= @CFLAGS_SimGrid@\n\n"); - fprintf(OUT, "PROGRAMS="); - fprintf(OUT, SIM_BINARYNAME, project); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, " "); - fprintf(OUT, RL_BINARYNAME, project, key); - } - - fprintf(OUT, "\n\n"); - fprintf(OUT, SIM_SOURCENAME_SOURCES, project); - fprintf(OUT, "=\t"); - fprintf(OUT, SIM_SOURCENAME, project); - fprintf(OUT, " %s.c\n", project); - fprintf(OUT, SIM_SOURCENAME_LDADD, project); - fprintf(OUT, "=\tpath/to/libsimgrid.a\n\n"); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, RL_SOURCENAME_SOURCES, project, key); - fprintf(OUT, "=\t"); - fprintf(OUT, RL_SOURCENAME, project, key); - fprintf(OUT, " %s.c\n", project); - fprintf(OUT, RL_SOURCENAME_LDADD, project, key); - fprintf(OUT, "=\tpath/to/libgras.a\n\n"); - } - - fprintf(OUT, - "\n# cleanup temps (allowing the user to add extra clean files)\n"); - fprintf(OUT, "CLEANFILES?= \n"); - fprintf(OUT, "CLEANFILES+= "); - fprintf(OUT, SIM_SOURCENAME, project); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, " "); - fprintf(OUT, RL_SOURCENAME, project, key); - } - fprintf(OUT, "\n"); - - fprintf(OUT, "\n# generate temps\n"); - fprintf(OUT, - "\n# A rule to generate the source file each time the deployment file changes\n"); - - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, RL_SOURCENAME, project, key); - fprintf(OUT, " "); - } - fprintf(OUT, SIM_SOURCENAME, project); - fclose(OUT); -} - -void generate_makefile_local(const char *project) -{ - xbt_dict_cursor_t cursor = NULL; - char *key = NULL; - void *data = NULL; - char *filename = NULL; - FILE *OUT = NULL; - - filename = - xbt_new(char, strlen(project) + strlen(MAKEFILE_FILENAME_LOCAL)); - sprintf(filename, MAKEFILE_FILENAME_LOCAL, project); - - OUT = fopen(filename, "w"); - xbt_assert(OUT, "Unable to open %s for writing", filename); - free(filename); - - fprintf(OUT, - "\n" - "####\n" - "#### THIS FILE WAS GENERATED, DO NOT EDIT BEFORE RENAMING IT\n" - "####\n\n\n"); - - fprintf(OUT, "## Variable declarations\n" - "PROJECT_NAME=%s\n" "DISTDIR=gras-$(PROJECT_NAME)\n\n", project); - - fprintf(OUT, - "# Set the GRAS_ROOT environment variable to the path under which you installed SimGrid\n" - "# Compilation will fail if you don't do so\n" - "GRAS_ROOT?= $(shell if [ -e /usr/local/lib/libgras.so ] ; then echo /usr/local ; else echo \"\\\"<<<< GRAS_ROOT undefined !!! >>>>\\\"\"; fi)\n\n" - "# You can fiddle the following to make it fit your taste\n" - "INCLUDES = -I$(GRAS_ROOT)/include\n" - "CFLAGS ?= -O3 -w -g -Wall\n" - "LIBS_SIM = -lm -L$(GRAS_ROOT)/lib/ -lsimgrid\n" - "LIBS_RL = -lm -L$(GRAS_ROOT)/lib/ -lgras\n" "LIBS = \n" "\n"); - - fprintf(OUT, "PRECIOUS_C_FILES ?= %s.c\n", project); - - fprintf(OUT, "GENERATED_C_FILES = "); - fprintf(OUT, SIM_SOURCENAME " ", project); - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, RL_SOURCENAME " ", project, key); - } - fprintf(OUT, "\n"); - - fprintf(OUT, "OBJ_FILES = $(patsubst %%.c,%%.o,$(PRECIOUS_C_FILES))\n"); - - fprintf(OUT, "BIN_FILES = "); - - fprintf(OUT, SIM_BINARYNAME " ", project); - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, RL_BINARYNAME " ", project, key); - } - fprintf(OUT, "\n"); - - fprintf(OUT, - "\n" - "## By default, build all the binaries\n" - "all: $(BIN_FILES)\n" "\n"); - - //No Need to generate source files, already done. - - fprintf(OUT, "\n## Generate the binaries\n"); - fprintf(OUT, SIM_BINARYNAME ": " SIM_OBJNAME " $(OBJ_FILES)\n", project, - project); - fprintf(OUT, - "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS_SIM) $(LIBS) $(LDADD) -o $@ \n"); - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, RL_BINARYNAME " : " RL_OBJNAME " $(OBJ_FILES)\n", project, - key, project, key); - fprintf(OUT, - "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS_RL) $(LIBS) $(LDADD) -o $@ \n"); - } - fprintf(OUT, - "\n" - "%%: %%.o\n" - "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) $^ $(LIBS) $(LDADD) -o $@ \n" - "\n" - "%%.o: %%.c\n" - "\t$(CC) $(INCLUDES) $(DEFS) $(CFLAGS) -c -o $@ $<\n" "\n"); - - fprintf(OUT, - "## Rules for tarballs and cleaning\n" - "DIST_FILES= $(EXTRA_DIST) $(GENERATED_C_FILES) $(PRECIOUS_C_FILES) " - MAKEFILE_FILENAME_LOCAL " " /*MAKEFILE_FILENAME_REMOTE */ "\n" - "distdir: $(DIST_FILES)\n" "\trm -rf $(DISTDIR)\n" - "\tmkdir -p $(DISTDIR)\n" "\tcp $^ $(DISTDIR)\n" "\n" - "dist: clean distdir\n" - "\ttar c $(DISTDIR) | gzip -c9 > $(DISTDIR).tar.gz\n" "\n", - project /*, project */ ); - - fprintf(OUT, - "clean:\n" - "\trm -f $(CLEANFILES) $(BIN_FILES) $(OBJ_FILES) *~ %s.o " - SIM_OBJNAME, project, project); - xbt_dict_foreach(process_function_set, cursor, key, data) { - fprintf(OUT, " " RL_OBJNAME, project, key); - } - fprintf(OUT, - "\n" - "\trm -rf $(DISTDIR)\n" - "\n" ".SUFFIXES:\n" ".PHONY : clean\n" "\n"); - fclose(OUT); -} - -static void print(void *p) -{ - printf("%p", p); -} diff --git a/src/bindings/lua/simgrid_lua.c b/src/bindings/lua/simgrid_lua.c index 6eb8d7ef21..05e9584e2b 100644 --- a/src/bindings/lua/simgrid_lua.c +++ b/src/bindings/lua/simgrid_lua.c @@ -13,7 +13,6 @@ #include "msg/msg.h" #include "simdag/simdag.h" #include "surf/surfxml_parse.h" -#include "gras.h" #include XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua, bindings, "Lua Bindings"); @@ -24,74 +23,6 @@ int luaopen_simgrid(lua_State *L); static void sglua_register_c_functions(lua_State *L); static int run_lua_code(int argc, char **argv); -/* ********************************************************************************* */ -/* lua_stub_generator functions */ -/* ********************************************************************************* */ - -xbt_dict_t process_function_set; -xbt_dynar_t process_list; -xbt_dict_t machine_set; -static s_process_t process; - -void s_process_free(void *process) -{ - s_process_t *p = (s_process_t *) process; - int i; - for (i = 0; i < p->argc; i++) - free(p->argv[i]); - free(p->argv); - free(p->host); -} - -static int gras_add_process_function(lua_State * L) -{ - const char *arg; - const char *process_host = luaL_checkstring(L, 1); - const char *process_function = luaL_checkstring(L, 2); - - if (xbt_dict_is_empty(machine_set) - || xbt_dict_is_empty(process_function_set) - || xbt_dynar_is_empty(process_list)) { - process_function_set = xbt_dict_new_homogeneous(NULL); - process_list = xbt_dynar_new(sizeof(s_process_t), s_process_free); - machine_set = xbt_dict_new_homogeneous(NULL); - } - - xbt_dict_set(machine_set, process_host, NULL, NULL); - xbt_dict_set(process_function_set, process_function, NULL, NULL); - - process.argc = 1; - process.argv = xbt_new(char *, 1); - process.argv[0] = xbt_strdup(process_function); - process.host = strdup(process_host); - - lua_pushnil(L); - while (lua_next(L, 3) != 0) { - arg = lua_tostring(L, -1); - process.argc++; - process.argv = - xbt_realloc(process.argv, (process.argc) * sizeof(char *)); - process.argv[(process.argc) - 1] = xbt_strdup(arg); - - XBT_DEBUG("index = %f , arg = %s \n", lua_tonumber(L, -2), - lua_tostring(L, -1)); - lua_pop(L, 1); - } - lua_pop(L, 1); - //add to the process list - xbt_dynar_push(process_list, &process); - return 0; -} - -static int gras_generate(lua_State * L) -{ - const char *project_name = luaL_checkstring(L, 1); - generate_sim(project_name); - generate_rl(project_name); - generate_makefile_local(project_name); - return 0; -} - /* ********************************************************************************* */ /* simgrid API */ /* ********************************************************************************* */ @@ -216,17 +147,6 @@ static int sd_register_platform(lua_State * L) return 0; } -/* - * Register platform for gras - */ -static int gras_register_platform(lua_State * L) -{ - //surf_parse = console_parse_platform; - surf_parse_reset_callbacks(); - gras_create_environment(NULL); - return 0; -} - /** * Register applicaiton for MSG */ @@ -238,17 +158,6 @@ static int msg_register_application(lua_State * L) return 0; } -/* - * Register application for gras - */ -static int gras_register_application(lua_State * L) -{ - gras_function_register_default(run_lua_code); - //surf_parse = console_parse_application; - gras_launch_application(NULL); - return 0; -} - static const luaL_Reg simgrid_functions[] = { {"create_environment", create_environment}, {"launch_application", launch_application}, @@ -263,11 +172,6 @@ static const luaL_Reg simgrid_functions[] = { {"msg_register_platform", msg_register_platform}, {"sd_register_platform", sd_register_platform}, {"msg_register_application", msg_register_application}, - {"gras_register_platform", gras_register_platform}, - {"gras_register_application", gras_register_application}, - /* gras sub generator method */ - {"gras_set_process_function", gras_add_process_function}, - {"gras_generate", gras_generate}, {NULL, NULL} }; diff --git a/src/bindings/lua/simgrid_lua.h b/src/bindings/lua/simgrid_lua.h index 5a426ddad4..2400d7f37a 100644 --- a/src/bindings/lua/simgrid_lua.h +++ b/src/bindings/lua/simgrid_lua.h @@ -8,7 +8,6 @@ #include "xbt/dynar.h" #include -extern xbt_dict_t process_function_set; extern xbt_dynar_t process_list; extern xbt_dict_t machine_set; diff --git a/teshsuite/xbt/parallel_log_crashtest.c b/teshsuite/xbt/parallel_log_crashtest.c index 4f773c362d..6578c3bee5 100644 --- a/teshsuite/xbt/parallel_log_crashtest.c +++ b/teshsuite/xbt/parallel_log_crashtest.c @@ -6,7 +6,7 @@ /* 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.h" +#include "xbt.h" #include "xbt/synchro.h" XBT_LOG_NEW_DEFAULT_CATEGORY(synchro_crashtest, "Logs of this example"); @@ -39,7 +39,7 @@ int crasher(int argc, char *argv[]) int i; xbt_thread_t *crashers; - gras_init(&argc, argv); + xbt_init(&argc, argv); /* initializations of the philosopher mecanisms */ id = xbt_new0(int, crasher_amount); @@ -63,7 +63,6 @@ int crasher(int argc, char *argv[]) xbt_free(crashers); xbt_free(id); - gras_exit(); return 0; } diff --git a/testsuite/xbt/log_usage.c b/testsuite/xbt/log_usage.c index 16a24ee825..bc50dddcd4 100644 --- a/testsuite/xbt/log_usage.c +++ b/testsuite/xbt/log_usage.c @@ -10,9 +10,7 @@ #pragma hdrstop #endif -#include "gras.h" - - +#include "xbt.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(test, top, "Logging specific to this test");