return surf_parse_get_value_with_unit(string, units);
}
+double surf_parse_get_size(const char *string)
+{
+ const struct unit_scale units[] = {
+ { "TiB", pow(1024, 4) },
+ { "GiB", pow(1024, 3) },
+ { "MiB", pow(1024, 2) },
+ { "KiB", 1024 },
+ { "TB", 1e12 },
+ { "GB", 1e9 },
+ { "MB", 1e6 },
+ { "kB", 1e3 },
+ { "B", 1.0 },
+ { "", 1.0 }, /* default unit is bytes*/
+ { "Tib", 0.125 * pow(1024, 4) },
+ { "Gib", 0.125 * pow(1024, 3) },
+ { "Mib", 0.125 * pow(1024, 2) },
+ { "Kib", 0.125 * 1024 },
+ { "Tb", 0.125 * 1e12 },
+ { "Gb", 0.125 * 1e9 },
+ { "Mb", 0.125 * 1e6 },
+ { "kb", 0.125 * 1e3 },
+ { "b", 0.125 },
+ { NULL, 0 }
+ };
+ return surf_parse_get_value_with_unit(string, units);
+}
+
double surf_parse_get_bandwidth(const char *string)
{
const struct unit_scale units[] = {
storage.id = A_surfxml_storage_id;
storage.type_id = A_surfxml_storage_typeId;
storage.content = A_surfxml_storage_content;
+ storage.content_type = A_surfxml_storage_content___type;
storage.properties = current_property_set;
sg_platf_new_storage(&storage);
current_property_set = NULL;
memset(&storage_type,0,sizeof(storage_type));
storage_type.content = A_surfxml_storage___type_content;
+ storage_type.content_type = A_surfxml_storage___type_content___type;
storage_type.id = A_surfxml_storage___type_id;
storage_type.model = A_surfxml_storage___type_model;
storage_type.properties = current_property_set;
- storage_type.size = surf_parse_get_int(A_surfxml_storage___type_size);
+ storage_type.size = surf_parse_get_size(A_surfxml_storage___type_size);
sg_platf_new_storage_type(&storage_type);
current_property_set = NULL;
}
memset(&mount,0,sizeof(mount));
mount.name = A_surfxml_mount_name;
- mount.id = A_surfxml_mount_id;
+ mount.storageId = A_surfxml_mount_storageId;
sg_platf_new_mount(&mount);
}
sg_platf_new_router(&router);
}
-void STag_surfxml_cluster(void){
+void ETag_surfxml_cluster(void){
s_sg_platf_cluster_cbarg_t cluster;
memset(&cluster,0,sizeof(cluster));
+ cluster.properties = current_property_set;
+
cluster.id = A_surfxml_cluster_id;
cluster.prefix = A_surfxml_cluster_prefix;
cluster.suffix = A_surfxml_cluster_suffix;
cluster.availability_trace = A_surfxml_cluster_availability___file;
cluster.state_trace = A_surfxml_cluster_state___file;
sg_platf_new_cluster(&cluster);
+
+ current_property_set = NULL;
+}
+
+void STag_surfxml_cluster(void){
+ xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
}
void STag_surfxml_cabinet(void){
void STag_surfxml_trace(void){}
void ETag_surfxml_router(void){}
void ETag_surfxml_host___link(void){}
-void ETag_surfxml_cluster(void){}
void ETag_surfxml_cabinet(void){}
void ETag_surfxml_peer(void){}
void STag_surfxml_backbone(void){}