Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add constraint for disk bandwidth connexion, read and write
authornavarro <navarro@caraja.(none)>
Fri, 23 Mar 2012 15:47:46 +0000 (16:47 +0100)
committernavarro <navarro@caraja.(none)>
Fri, 23 Mar 2012 15:47:46 +0000 (16:47 +0100)
examples/platforms/storage.xml
src/surf/storage.c
src/surf/storage_private.h

index d808970..280c190 100644 (file)
        <AS id="AS0" routing="Full">
 
                <storage_type id="samsung" model="RAID5" content="storage_content.txt">
-                       <prop id="Bwrite" value="30" />
-                       <prop id="Bread" value="100000000" />
+                       <prop id="Bwrite" value="30000000" /> <!-- 30Mo/s -->
+                       <prop id="Bread" value="100000000" /> <!-- 100Mo/s -->
+                       <prop id="Bconnexion" value="6000000000" /> <!-- 6Go/s -->
                </storage_type>
 
                <storage_type id="crucial" model="SSD" content="storage_content.txt">
                        <prop id="Bwrite" value="80" />
                        <prop id="Bread" value="100000000" />
+                       <prop id="Bconnexion" value="6000000000" />
                </storage_type>
 
                <storage_type id="wdigital" model="RAID0" content="storage_content.txt">
                        <prop id="Bwrite" value="60" />
                        <prop id="Bread" value="100000000" />
+                       <prop id="Bconnexion" value="6000000000" />
                </storage_type>
 
                <storage id="Disk1" typeId="crucial"/>
index c118e15..e4fe016 100644 (file)
@@ -85,7 +85,7 @@ static surf_action_t storage_action_execute (void *storage, double size)
                                                    calloc but it seems to help valgrind... */
 
   GENERIC_LMM_ACTION(action).variable =
-      lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 1);
+      lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 3);
 
   lmm_expand(storage_maxmin_system, STORAGE->constraint,
              GENERIC_LMM_ACTION(action).variable, 1.0);
@@ -133,11 +133,12 @@ static void* storage_create_resource(const char* id, const char* model,const cha
   storage->state_current = SURF_RESOURCE_ON;
 
   storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL);
-  double Bread = atof(xbt_dict_get(storage_type->properties,"Bread"));
-
-  storage->constraint =
-      lmm_constraint_new(storage_maxmin_system, storage,
-          Bread);
+  double Bread  = atof(xbt_dict_get(storage_type->properties,"Bread"));
+  double Bwrite = atof(xbt_dict_get(storage_type->properties,"Bwrite"));
+  double Bconnexion   = atof(xbt_dict_get(storage_type->properties,"Bconnexion"));
+  storage->constraint       = lmm_constraint_new(storage_maxmin_system, storage, Bconnexion);
+  storage->constraint_read  = lmm_constraint_new(storage_maxmin_system, storage, Bread);
+  storage->constraint_write = lmm_constraint_new(storage_maxmin_system, storage, Bwrite);
 
   xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage);
 
index 39b1df0..ca7b6cd 100644 (file)
@@ -11,7 +11,9 @@
 typedef struct storage {
   s_surf_resource_t generic_resource;   /*< Structure with generic data. Needed at begin to interate with SURF */
   e_surf_resource_state_t state_current;        /*< STORAGE current state (ON or OFF) */
-  lmm_constraint_t constraint;
+  lmm_constraint_t constraint;          /* Constraint for maximum bandwidth from connexion */
+  lmm_constraint_t constraint_write;    /* Constraint for maximum write bandwidth*/
+  lmm_constraint_t constraint_read;    /* Constraint for maximum write bandwidth*/
 } s_storage_t, *storage_t;
 
 typedef struct surf_action_storage {