sscanf(A_surfxml_platform_version, "%lg", &version);
- xbt_assert0((version >= 1.0), "******* BIG FAT WARNING *********\n "
+ xbt_assert((version >= 1.0), "******* BIG FAT WARNING *********\n "
"You're using an ancient XML file.\n"
"Since SimGrid 3.1, units are Bytes, Flops, and seconds "
"instead of MBytes, MFlops and seconds.\n"
"Last, do not forget to also update your values for "
"the calls to MSG_task_create (if any).");
- xbt_assert0((version >= 3.0), "******* BIG FAT WARNING *********\n "
+ xbt_assert((version >= 3.0), "******* BIG FAT WARNING *********\n "
"You're using an old XML file.\n"
"Use simgrid_update_xml to update your file automatically. "
"This program is installed automatically with SimGrid, or "
return;
}
surf_file_to_parse = surf_fopen(file, "r");
- xbt_assert1((surf_file_to_parse), "Unable to open \"%s\"\n", file);
+ xbt_assert((surf_file_to_parse), "Unable to open \"%s\"\n", file);
surf_input_buffer = surf_parse__create_buffer(surf_file_to_parse, 10);
surf_parse__switch_to_buffer(surf_input_buffer);
surf_parse_lineno = 1;
parse_status = surf_parse();
free_data();
surf_parse_close();
- xbt_assert1(!parse_status, "Parse error in %s", file);
+ xbt_assert(!parse_status, "Parse error in %s", file);
}
/* Prop tag functions */
char *value = NULL;
if (!current_property_set)
current_property_set = xbt_dict_new(); // Maybe, it should be make a error
- value = xbt_strdup(A_surfxml_prop_value);
- xbt_dict_set(current_property_set, A_surfxml_prop_id, value, free);
+ if(!strcmp(A_surfxml_prop_id,"coordinates")){
+ if(!strcmp(A_surfxml_prop_value,"yes") && !COORD_HOST_LEVEL)
+ {
+ XBT_INFO("Configuration change: Set '%s' to '%s'", A_surfxml_prop_id, A_surfxml_prop_value);
+ COORD_HOST_LEVEL = xbt_lib_add_level(host_lib,xbt_dynar_free_voidp);
+ COORD_ASR_LEVEL = xbt_lib_add_level(as_router_lib,xbt_dynar_free_voidp);
+ }
+ if(strcmp(A_surfxml_prop_value,"yes"))
+ xbt_die("Setting XML prop coordinates must be \"yes\"");
+ }
+ else{
+ value = xbt_strdup(A_surfxml_prop_value);
+ xbt_dict_set(current_property_set, A_surfxml_prop_id, value, free);
+ }
}
/* Trace management functions */
static void parse_Stag_trace_connect(void)
{
- xbt_assert2(xbt_dict_get_or_null
+ xbt_assert(xbt_dict_get_or_null
(traces_set_list, A_surfxml_trace_connect_trace),
"Cannot connect trace %s to %s: trace unknown",
A_surfxml_trace_connect_trace,
generator = xbt_malloc(q - (p + 6) + 1);
memcpy(generator, p + 6, q - (p + 6));
generator[q - (p + 6)] = '\0';
- xbt_assert1((random =
- xbt_dict_get_or_null(random_data_list, generator)),
- "Random generator %s undefined", generator);
+ random = xbt_dict_get_or_null(random_data_list, generator);
+ xbt_assert(random, "Random generator %s undefined", generator);
power_scale = random_generate(random);
}
} else {