+ xbt_dynar_free(&STag_surfxml_storage_cb_list);
+ xbt_dynar_free(&ETag_surfxml_storage_cb_list);
+ xbt_dynar_free(&STag_surfxml_mstorage_cb_list);
+ xbt_dynar_free(&ETag_surfxml_mstorage_cb_list);
+ xbt_dynar_free(&STag_surfxml_mount_cb_list);
+ xbt_dynar_free(&ETag_surfxml_mount_cb_list);
+ xbt_dynar_free(&STag_surfxml_storage_type_cb_list);
+ xbt_dynar_free(&ETag_surfxml_storage_type_cb_list);
+}
+
+/* Stag and Etag parse functions */
+void ETag_surfxml_router(void) { /* ignored -- do not add content here */ }
+
+void STag_surfxml_platform(void) {
+ _XBT_GNUC_UNUSED double version = surf_parse_get_double(A_surfxml_platform_version);
+
+ 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"
+
+ "Use simgrid_update_xml to update your file automatically. "
+ "This program is installed automatically with SimGrid, or "
+ "available in the tools/ directory of the source archive.\n"
+
+ "Please check also out the SURF section of the ChangeLog for "
+ "the 3.1 version for more information. \n"
+
+ "Last, do not forget to also update your values for "
+ "the calls to MSG_task_create (if any).");
+ 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 "
+ "available in the tools/ directory of the source archive.");
+
+ sg_platf_begin();
+}
+void ETag_surfxml_platform(void){
+ sg_platf_end();
+}
+
+void STag_surfxml_host(void){
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+}
+
+void ETag_surfxml_host(void) {
+ s_sg_platf_host_cbarg_t host;
+ memset(&host,0,sizeof(host));
+
+ host.properties = current_property_set;
+
+ host.id = A_surfxml_host_id;
+ host.power_peak = get_cpu_power(A_surfxml_host_power);
+ host.power_scale = surf_parse_get_double( A_surfxml_host_availability);
+ host.core_amount = surf_parse_get_int(A_surfxml_host_core);
+ host.power_trace = tmgr_trace_new_from_file(A_surfxml_host_availability_file);
+ host.state_trace = tmgr_trace_new_from_file(A_surfxml_host_state_file);
+ xbt_assert((A_surfxml_host_state == A_surfxml_host_state_ON) ||
+ (A_surfxml_host_state == A_surfxml_host_state_OFF), "Invalid state");
+ if (A_surfxml_host_state == A_surfxml_host_state_ON)
+ host.initial_state = SURF_RESOURCE_ON;
+ if (A_surfxml_host_state == A_surfxml_host_state_OFF)
+ host.initial_state = SURF_RESOURCE_OFF;
+ host.coord = A_surfxml_host_coordinates;
+
+ sg_platf_new_host(&host);
+ current_property_set = NULL;
+}
+
+void STag_surfxml_host_link(void){
+ XBT_DEBUG("Create a Host_link for %s",A_surfxml_host_link_id);
+ s_sg_platf_host_link_cbarg_t host_link;
+ memset(&host_link,0,sizeof(host_link));
+
+ host_link.id = A_surfxml_host_link_id;
+ host_link.link_up = A_surfxml_host_link_up;
+ host_link.link_down = A_surfxml_host_link_down;
+ sg_platf_new_host_link(&host_link);
+}
+
+void ETag_surfxml_host_link(void){
+ XBT_DEBUG("End create a Host_link for %s",A_surfxml_host_link_id);
+}
+
+void STag_surfxml_router(void){
+ s_sg_platf_router_cbarg_t router;
+ memset(&router, 0, sizeof(router));
+
+ router.id = A_surfxml_router_id;
+ router.coord = A_surfxml_router_coordinates;
+
+ sg_platf_new_router(&router);
+}
+
+void STag_surfxml_cluster(void){
+ s_sg_platf_cluster_cbarg_t cluster;
+ memset(&cluster,0,sizeof(cluster));
+ cluster.id = A_surfxml_cluster_id;
+ cluster.prefix = A_surfxml_cluster_prefix;
+ cluster.suffix = A_surfxml_cluster_suffix;
+ cluster.radical = A_surfxml_cluster_radical;
+ cluster.power= surf_parse_get_double(A_surfxml_cluster_power);
+ cluster.core_amount = surf_parse_get_int(A_surfxml_cluster_core);
+ cluster.bw = surf_parse_get_double(A_surfxml_cluster_bw);
+ cluster.lat = surf_parse_get_double(A_surfxml_cluster_lat);
+ if(strcmp(A_surfxml_cluster_bb_bw,""))
+ cluster.bb_bw = surf_parse_get_double(A_surfxml_cluster_bb_bw);
+ if(strcmp(A_surfxml_cluster_bb_lat,""))
+ cluster.bb_lat = surf_parse_get_double(A_surfxml_cluster_bb_lat);
+ cluster.router_id = A_surfxml_cluster_router_id;