Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Taking into account last MSG modifications. No need to pass gras-log arguments to...
[simgrid.git] / tools / gras / stub_generator.c
index 5fd470f..29d334a 100644 (file)
@@ -65,34 +65,13 @@ const char* SIM_MAIN_PREEMBULE =
 "int main (int argc,char *argv[]) {\n"
 "  int i,j;\n"
 "\n"
-"  /* Save the gras-log argument of real command line to pass it to all processes */\n"
-"  for (i=1; i<argc; i++) {\n"
-"    if (!strncmp(argv[i],\"--gras-log=\",strlen(\"--gras-log=\"))) {\n"
-"      if (gras_log) {\n"
-"       char *tmp=malloc(strlen(gras_log)+strlen(argv[i])+2);\n"
-"       sprintf(tmp,\"%%s %%s\",gras_log, argv[i]);\n"
-"       free(gras_log);\n"
-"       gras_log=tmp;\n"
-"      } else {\n"
-"         gras_log = strdup(argv[i]);\n"
-"      }\n"
-"      for (j=i+1; j<argc; j++) {\n"
-"      argv[j-1] = argv[j];\n"
-"      } \n"
-"      argv[j-1] = NULL;\n"
-"      argc--;\n"
-"      i--; /* compensate effect of next loop incrementation */\n"
-"    }\n"
-"  }\n"
-"\n"
+"  /*  Simulation setup */\n"
+"  MSG_global_init_args(&argc,argv);\n"
 "  if (argc != 3) {\n"
 "    fprintf(stderr, \"Usage: %%s platform_file application_description.txt [--gras-log=...]\\n\",argv[0]);\n"
 "    exit(1);\n"
 "  }\n"
 "\n"
-"  /*  Simulation setup */\n"
-"  MSG_global_init();\n"
-"  MSG_set_verbosity(MSG_SILENT);\n"
 "  MSG_set_channel_number(10); // GRAS_MAX_CHANNEL hardcoded since Alvin killed its definition\n"
 "  MSG_create_environment(argv[1]);\n"
 "\n"