#include "xbt/misc.h"
#include "xbt/sysdep.h"
#include "xbt/function_types.h"
+#include "xbt/dynar.h"
SG_BEGIN_DECL()
/* Get the name of the UNIX process englobing the world */
XBT_PUBLIC_DATA(char*) xbt_binary_name;
+ /** Contains all the parameters we got from the command line (including argv[0]) */
+ XBT_PUBLIC_DATA(xbt_dynar_t) xbt_cmdline;
+
/**
*
* Time management functions, returns the system time or sleeps a process. They work both on the simulated and real systems(GRAS).
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "instr/instr_private.h"
+#include "xbt/virtu.h" /* sg_cmdline */
#ifdef HAVE_TRACING
fprintf (tracing_file, "#[");
unsigned int cpt;
char *str;
- xbt_dynar_foreach (sg_cmdline, cpt, str){
+ xbt_dynar_foreach (xbt_cmdline, cpt, str){
fprintf(tracing_file, "%s ",str);
}
fprintf (tracing_file, "]\n");
*ver_patch = SIMGRID_VERSION_PATCH;
}
-xbt_dynar_t sg_cmdline = NULL;
-
void surf_init(int *argc, char **argv)
{
XBT_DEBUG("Create all Libs");
SURF_WKS_LEVEL = xbt_lib_add_level(host_lib,surf_resource_free);
SURF_LINK_LEVEL = xbt_lib_add_level(link_lib,surf_resource_free);
- sg_cmdline = xbt_dynar_new(sizeof(char*),NULL);
- int i;
- for (i=0;i<*argc;i++) {
- xbt_dynar_push(sg_cmdline,&(argv[i]));
- }
xbt_init(argc, argv);
if (!model_list)
model_list = xbt_dynar_new(sizeof(surf_model_private_t), NULL);
#endif
xbt_dynar_free(&surf_path);
- xbt_dynar_free(&sg_cmdline);
xbt_lib_free(&host_lib);
xbt_lib_free(&link_lib);
/* module handling */
-/* Copyright (c) 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2006-2012. 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. */
char *xbt_binary_name = NULL; /* Name of the system process containing us (mandatory to retrieve neat backtraces) */
+xbt_dynar_t xbt_cmdline = NULL; /* all we got in argv */
+
int xbt_initialized = 0;
int _surf_do_model_check = 0;
xbt_os_thread_mod_postexit();
free(xbt_binary_name);
+ xbt_dynar_free(&xbt_cmdline);
+
#ifdef MMALLOC_WANT_OVERRIDE_LEGACY
mmalloc_postexit();
#endif
}
xbt_binary_name = xbt_strdup(argv[0]);
+ xbt_cmdline = xbt_dynar_new(sizeof(char*),NULL);
+ int i;
+ for (i=0;i<*argc;i++) {
+ xbt_dynar_push(xbt_cmdline,&(argv[i]));
+ }
+
srand((unsigned int) time(NULL));
xbt_log_init(argc, argv);