\li <b>content</b>: default value 0. The file containing the disk
content. (may be moved soon or later to <b>storage</b> tag.
-The tag must contains some predefined prop, as may do some other
-resources tags. This should moved to attributes soon or later.
-<b>storage_type</b> mandatory <b>prop</b> :
+The tag must contains some predefined model prop, as may do some other
+resources tags.
+<b>storage_type</b> mandatory <b>model_prop</b> :
\li <b>Bwrite</b>: value in B/s. Write throughput
\li <b>Bread</b>: value in B/s. Read throughput
\li <b>Bconnexion</b>: value in B/s. Connection throughput (i.e. the
throughput of the storage connector).
+A storage_type can also contain the <b>prop</b> tag. The prop tag allows you
+to define additional information on this storage_type following the
+attribute/value schema. You may want to use it to give information to
+the tool you use for rendering your simulation, for example.
+
+<storage_type id="single_HDD" model="linear_no_lat" size="4000" content_type="txt_unix">
+ <model_prop id="Bwrite" value="30MBps" />
+ <model_prop id="Bread" value="100MBps" />
+ <model_prop id="Bconnection" value="150MBps" />
+ <b><prop id="Brand" value="Western Digital" /></b>
+</storage_type>
+
\subsubsection pf_sto_st storage
<b>storage_type</b> attributes :
<storage_type id="single_HDD" model="linear_no_lat"
content="content/storage_content.txt" size="500GiB"
content_type="txt_unix">
- <prop id="Bwrite" value="30MBps" />
- <prop id="Bread" value="100MBps" />
- <prop id="Bconnection" value="120MBps" />
+ <model_prop id="Bwrite" value="30MBps" />
+ <model_prop id="Bread" value="100MBps" />
+ <model_prop id="Bconnection" value="120MBps" />
</storage_type>
<storage_type id="single_SSD" model="linear_no_lat" size="500GiB">
- <prop id="Bwrite" value="60MBps" />
- <prop id="Bread" value="200MBps" />
- <prop id="Bconnection" value="220MBps" />
+ <model_prop id="Bwrite" value="60MBps" />
+ <model_prop id="Bread" value="200MBps" />
+ <model_prop id="Bconnection" value="220MBps" />
</storage_type>
<storage id="Disk1" typeId="single_HDD" />
const char* content;
const char* content_type;
xbt_dict_t properties;
+ xbt_dict_t model_properties;
sg_size_t size;
} s_sg_platf_storage_type_cbarg_t, *sg_platf_storage_type_cbarg_t;
XBT_PUBLIC(void) ETag_graphxml_edge(void);
/* XML application data. */
+typedef int AT_graphxml_node_name;
+#define AU_graphxml_node_name NULL
typedef int AT_graphxml_edge_source;
#define AU_graphxml_edge_source NULL
-typedef int AT_graphxml_edge_length;
-#define AU_graphxml_edge_length NULL
+typedef int AT_graphxml_node_position___y;
+#define AU_graphxml_node_position___y NULL
typedef int AT_graphxml_node_position___x;
#define AU_graphxml_node_position___x NULL
+typedef int AT_graphxml_edge_data;
+#define AU_graphxml_edge_data NULL
+typedef int AT_graphxml_edge_target;
+#define AU_graphxml_edge_target NULL
typedef enum { AU_graphxml_graph_isDirected, A_graphxml_graph_isDirected_true,A_graphxml_graph_isDirected_false } AT_graphxml_graph_isDirected;
+typedef int AT_graphxml_node_label;
+#define AU_graphxml_node_label NULL
typedef int AT_graphxml_node_data;
#define AU_graphxml_node_data NULL
-typedef int AT_graphxml_edge_name;
-#define AU_graphxml_edge_name NULL
-typedef int AT_graphxml_node_name;
-#define AU_graphxml_node_name NULL
typedef int AT_graphxml_edge_label;
#define AU_graphxml_edge_label NULL
-typedef int AT_graphxml_node_position___y;
-#define AU_graphxml_node_position___y NULL
-typedef int AT_graphxml_edge_target;
-#define AU_graphxml_edge_target NULL
-typedef int AT_graphxml_edge_data;
-#define AU_graphxml_edge_data NULL
-typedef int AT_graphxml_node_label;
-#define AU_graphxml_node_label NULL
+typedef int AT_graphxml_edge_length;
+#define AU_graphxml_edge_length NULL
+typedef int AT_graphxml_edge_name;
+#define AU_graphxml_edge_name NULL
/* FleXML-provided data. */
XBT_PUBLIC_DATA(int) graphxml_pcdata_ix;
XBT_PUBLIC_DATA(char *) graphxml_bufferstack;
#define graphxml_pcdata (graphxml_bufferstack + graphxml_pcdata_ix)
+XBT_PUBLIC_DATA(AT_graphxml_node_name) AX_graphxml_node_name;
+#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name)
+XBT_PUBLIC_DATA(short int) graphxml_node_name_isset;
XBT_PUBLIC_DATA(AT_graphxml_edge_source) AX_graphxml_edge_source;
#define A_graphxml_edge_source (graphxml_bufferstack + AX_graphxml_edge_source)
XBT_PUBLIC_DATA(short int) graphxml_edge_source_isset;
-XBT_PUBLIC_DATA(AT_graphxml_edge_length) AX_graphxml_edge_length;
-#define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length)
-XBT_PUBLIC_DATA(short int) graphxml_edge_length_isset;
+XBT_PUBLIC_DATA(AT_graphxml_node_position___y) AX_graphxml_node_position___y;
+#define A_graphxml_node_position___y (graphxml_bufferstack + AX_graphxml_node_position___y)
+XBT_PUBLIC_DATA(short int) graphxml_node_position___y_isset;
XBT_PUBLIC_DATA(AT_graphxml_node_position___x) AX_graphxml_node_position___x;
#define A_graphxml_node_position___x (graphxml_bufferstack + AX_graphxml_node_position___x)
XBT_PUBLIC_DATA(short int) graphxml_node_position___x_isset;
+XBT_PUBLIC_DATA(AT_graphxml_edge_data) AX_graphxml_edge_data;
+#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data)
+XBT_PUBLIC_DATA(short int) graphxml_edge_data_isset;
+XBT_PUBLIC_DATA(AT_graphxml_edge_target) AX_graphxml_edge_target;
+#define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target)
+XBT_PUBLIC_DATA(short int) graphxml_edge_target_isset;
XBT_PUBLIC_DATA(AT_graphxml_graph_isDirected) AX_graphxml_graph_isDirected;
#define A_graphxml_graph_isDirected AX_graphxml_graph_isDirected
XBT_PUBLIC_DATA(short int) graphxml_graph_isDirected_isset;
+XBT_PUBLIC_DATA(AT_graphxml_node_label) AX_graphxml_node_label;
+#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label)
+XBT_PUBLIC_DATA(short int) graphxml_node_label_isset;
XBT_PUBLIC_DATA(AT_graphxml_node_data) AX_graphxml_node_data;
#define A_graphxml_node_data (graphxml_bufferstack + AX_graphxml_node_data)
XBT_PUBLIC_DATA(short int) graphxml_node_data_isset;
-XBT_PUBLIC_DATA(AT_graphxml_edge_name) AX_graphxml_edge_name;
-#define A_graphxml_edge_name (graphxml_bufferstack + AX_graphxml_edge_name)
-XBT_PUBLIC_DATA(short int) graphxml_edge_name_isset;
-XBT_PUBLIC_DATA(AT_graphxml_node_name) AX_graphxml_node_name;
-#define A_graphxml_node_name (graphxml_bufferstack + AX_graphxml_node_name)
-XBT_PUBLIC_DATA(short int) graphxml_node_name_isset;
XBT_PUBLIC_DATA(AT_graphxml_edge_label) AX_graphxml_edge_label;
#define A_graphxml_edge_label (graphxml_bufferstack + AX_graphxml_edge_label)
XBT_PUBLIC_DATA(short int) graphxml_edge_label_isset;
-XBT_PUBLIC_DATA(AT_graphxml_node_position___y) AX_graphxml_node_position___y;
-#define A_graphxml_node_position___y (graphxml_bufferstack + AX_graphxml_node_position___y)
-XBT_PUBLIC_DATA(short int) graphxml_node_position___y_isset;
-XBT_PUBLIC_DATA(AT_graphxml_edge_target) AX_graphxml_edge_target;
-#define A_graphxml_edge_target (graphxml_bufferstack + AX_graphxml_edge_target)
-XBT_PUBLIC_DATA(short int) graphxml_edge_target_isset;
-XBT_PUBLIC_DATA(AT_graphxml_edge_data) AX_graphxml_edge_data;
-#define A_graphxml_edge_data (graphxml_bufferstack + AX_graphxml_edge_data)
-XBT_PUBLIC_DATA(short int) graphxml_edge_data_isset;
-XBT_PUBLIC_DATA(AT_graphxml_node_label) AX_graphxml_node_label;
-#define A_graphxml_node_label (graphxml_bufferstack + AX_graphxml_node_label)
-XBT_PUBLIC_DATA(short int) graphxml_node_label_isset;
+XBT_PUBLIC_DATA(AT_graphxml_edge_length) AX_graphxml_edge_length;
+#define A_graphxml_edge_length (graphxml_bufferstack + AX_graphxml_edge_length)
+XBT_PUBLIC_DATA(short int) graphxml_edge_length_isset;
+XBT_PUBLIC_DATA(AT_graphxml_edge_name) AX_graphxml_edge_name;
+#define A_graphxml_edge_name (graphxml_bufferstack + AX_graphxml_edge_name)
+XBT_PUBLIC_DATA(short int) graphxml_edge_name_isset;
/* XML application utilities. */
XBT_PUBLIC(int) graphxml_element_context(int);
/* Prototypes of the functions that handle the properties */
XBT_PUBLIC_DATA(xbt_dict_t) current_property_set; /* the prop set for the currently parsed element (also used in SIMIX) */
+/* The same for model_prop set*/
+XBT_PUBLIC_DATA(xbt_dict_t) current_model_property_set;
+
/* surf parse file related (public because called from a test suite) */
XBT_PUBLIC(void) parse_platform_file(const char *file);
<!ATTLIST AS id CDATA #REQUIRED>
<!ATTLIST AS routing (Full|Floyd|Dijkstra|DijkstraCache|None|Vivaldi|Cluster|Cluster_torus) #REQUIRED>
-<!ELEMENT storage_type (prop*)>
+<!ELEMENT storage_type ((model_prop|prop)*)>
<!ATTLIST storage_type id CDATA #REQUIRED>
<!ATTLIST storage_type model CDATA #REQUIRED>
<!ATTLIST storage_type size CDATA #REQUIRED>
<!ELEMENT prop EMPTY>
<!ATTLIST prop id CDATA #REQUIRED> <!-- <!ATTLIST prop key CDATA #REQUIRED> -->
<!ATTLIST prop value CDATA #REQUIRED>
+
+<!ELEMENT model_prop EMPTY>
+<!ATTLIST model_prop id CDATA #REQUIRED> <!-- <!ATTLIST model_prop key CDATA #REQUIRED> -->
+<!ATTLIST model_prop value CDATA #REQUIRED>
* @param content_name [description]
* @param content_type [description]
* @param size [description]
+ * @param model_props Dictionary of model specific properties associated to this Storage
*/
Storage(ModelPtr model, const char *name, xbt_dict_t props,
const char* type_id, char *content_name, char *content_type,
char *content_type;
char *type_id;
xbt_dict_t properties;
+ xbt_dict_t model_properties;
sg_size_t size;
} s_storage_type_t, *storage_type_t;
free(stype->content);
free(stype->content_type);
xbt_dict_free(&(stype->properties));
- xbt_dict_free(&(stype->properties));
+ xbt_dict_free(&(stype->model_properties));
free(stype);
}
XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s' "
"\n\t\tmodel '%s' \n\t\tcontent '%s'\n\t\tcontent_type '%s' "
- "\n\t\tproperties '%p'\n",
+ "\n\t\tproperties '%p''\n",
storage->id,
((storage_type_t) stype)->model,
((storage_type_t) stype)->type_id,
stype->content_type = xbt_strdup(storage_type->content_type);
stype->type_id = xbt_strdup(storage_type->id);
stype->size = storage_type->size;
+ stype->model_properties = storage_type->model_properties;
XBT_DEBUG("ROUTING Create a storage type id '%s' with model '%s', "
"content '%s', and content_type '%s'",
storage_type_t storage_type = (storage_type_t) xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
- double Bread = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bread"));
- double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bwrite"));
- double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->properties, "Bconnection"));
+ double Bread = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bread"));
+ double Bwrite = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bwrite"));
+ double Bconnection = surf_parse_get_bandwidth((char*)xbt_dict_get(storage_type->model_properties, "Bconnection"));
StoragePtr storage = new StorageN11(this, id, properties, p_maxminSystem,
Bread, Bwrite, Bconnection,
sg_size_t *psize = xbt_new(sg_size_t,1);
*psize = action->p_file->size;
-
xbt_dict_t content_dict = action->p_storage->p_content;
xbt_dict_set(content_dict, action->p_file->name, psize, NULL);
}
/* The default current property receiver. Setup in the corresponding opening callbacks. */
xbt_dict_t current_property_set = NULL;
+xbt_dict_t current_model_property_set = NULL;
xbt_dict_t as_current_property_set = NULL;
int AS_TAG = 0;
char* as_name_tab[1024];
AS_TAG = 0;
XBT_DEBUG("STag_surfxml_storage___type");
xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
+ xbt_assert(current_model_property_set == NULL, "Someone forgot to reset the model property set to NULL in its closing tag (or XML malformed)");
}
void ETag_surfxml_storage___type(void)
{
storage_type.id = A_surfxml_storage___type_id;
storage_type.model = A_surfxml_storage___type_model;
storage_type.properties = current_property_set;
+ storage_type.model_properties = current_model_property_set;
storage_type.size = surf_parse_get_size(A_surfxml_storage___type_size);
sg_platf_new_storage_type(&storage_type);
current_property_set = NULL;
+ current_model_property_set = NULL;
}
void STag_surfxml_mstorage(void)
{
argv[(argc) - 1] = xbt_strdup(A_surfxml_argument_value);
}
+void STag_surfxml_model___prop(void){
+ if (!current_model_property_set)
+ current_model_property_set = xbt_dict_new_homogeneous(xbt_free_f);
+
+ xbt_dict_set(current_model_property_set, A_surfxml_model___prop_id, xbt_strdup(A_surfxml_model___prop_value), NULL);
+}
+
/* ***************************************** */
/* TUTORIAL: New TAG */
void STag_surfxml_gpu(void)
void STag_surfxml_backbone(void){}
void ETag_surfxml_link___ctn(void){}
void ETag_surfxml_argument(void){}
+void ETag_surfxml_model___prop(void){}
/* Open and Close parse file */
<AS id="AS0" routing="Full">
<!-- STORAGE TYPES -->
<storage_type id="crucial" model="SSD" size="500">
- <prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
- <prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
- <prop id="Bconnection" value="150000000" /> <!-- 150Mo/s -->
+ <model_prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
+ <model_prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
+ <model_prop id="Bconnection" value="150000000" /> <!-- 150Mo/s -->
</storage_type>
<storage_type id="single_HDD" model="linear_no_lat" size="500GiB" content_type="txt_unix">
- <prop id="Bwrite" value="30MBps" />
- <prop id="Bread" value="100MBps" />
- <prop id="Bconnection" value="150MBps" />
+ <model_prop id="Bwrite" value="30MBps" />
+ <model_prop id="Bread" value="100MBps" />
+ <model_prop id="Bconnection" value="150MBps" />
</storage_type>
<storage_type id="single_SSD" model="linear_no_lat"
content="content/storage_content.txt" size="500GiB">
- <prop id="Bwrite" value="30MBps" />
- <prop id="Bread" value="100MBps" />
- <prop id="Bconnection" value="150MBps" />
+ <model_prop id="Bwrite" value="30MBps" />
+ <model_prop id="Bread" value="100MBps" />
+ <model_prop id="Bconnection" value="150MBps" />
</storage_type>
<!-- DISKS -->