X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/25cf463b5d392c1b4476f544ab4f025ada984cd6..926d5ddef86348602520f2a40cb5764306aa24c1:/src/instr/instr_config.c diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index 4025598aed..e4f111480d 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -40,8 +40,6 @@ static int trace_disable_destroy; static int trace_configured = 0; static int trace_active = 0; -xbt_dict_t created_categories; //declared in instr_interface.c - static void TRACE_getopts(void) { trace_enabled = xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING); @@ -73,7 +71,9 @@ int TRACE_start() TRACE_paje_start(); /* activate trace */ - xbt_assert (trace_active==0, "Tracing is already active."); + if (trace_active == 1){ + THROWF (tracing_error, 0, "Tracing is already active"); + } trace_active = 1; XBT_DEBUG ("Tracing is on"); @@ -104,8 +104,10 @@ int TRACE_end() TRACE_paje_dump_buffer(1); /* destroy all data structures of tracing (and free) */ - destroyAllContainers(); - instr_paje_free(); + PJ_container_free_all(); + PJ_type_free_all(); + PJ_container_release(); + PJ_type_release(); TRACE_surf_release(); TRACE_smpi_release(); xbt_dict_free(&created_categories); @@ -146,9 +148,8 @@ int TRACE_is_configured(void) int TRACE_smpi_is_enabled(void) { - return (xbt_cfg_get_int(_surf_cfg_set, OPT_TRACING_SMPI) || - TRACE_smpi_is_grouped())&& - TRACE_is_enabled(); + return (trace_smpi_enabled || TRACE_smpi_is_grouped()) + && TRACE_is_enabled(); } int TRACE_smpi_is_grouped(void) @@ -261,7 +262,7 @@ void TRACE_global_init(int *argc, char **argv) NULL, NULL); /* tracing buffer */ - int default_buffer = 0; + int default_buffer = 1; xbt_cfg_register(&_surf_cfg_set, OPT_TRACING_BUFFER, "Buffer trace events to put them in temporal order.", xbt_cfgelm_int, &default_buffer, 0, 1, @@ -393,9 +394,10 @@ void TRACE_generate_triva_uncat_conf (void) char *name, *value; FILE *file = fopen (output, "w"); - xbt_assert (file != NULL, - "Unable to open file (%s) for writing triva graph " - "configuration (uncategorized).", output); + if (file == NULL){ + THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph " + "configuration (uncategorized).", output); + } //open fprintf (file, "{\n"); @@ -449,9 +451,10 @@ void TRACE_generate_triva_cat_conf (void) } FILE *file = fopen (output, "w"); - xbt_assert (file != NULL, - "Unable to open file (%s) for writing triva graph " - "configuration (categorized).", output); + if (file == NULL){ + THROWF (system_error, 1, "Unable to open file (%s) for writing triva graph " + "configuration (categorized).", output); + } //open fprintf (file, "{\n"); @@ -501,16 +504,6 @@ void TRACE_generate_triva_cat_conf (void) } } -void TRACE_set_network_update_mechanism (void) -{ - if (TRACE_is_enabled()){ - if (TRACE_categorized() || TRACE_uncategorized()){ - XBT_INFO ("Tracing resource utilization active, network/optim configuration now set to Full."); - xbt_cfg_set_string (_surf_cfg_set, "network/optim", "Full"); - } - } -} - #undef OPT_TRACING #undef OPT_TRACING_PLATFORM #undef OPT_TRACING_SMPI