Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix 2 java tesh
[simgrid.git] / src / surf / storage_interface.cpp
index 554c9a2..d0c8e8f 100644 (file)
@@ -15,7 +15,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_storage, surf, "Logging specific to the SUR
 
 xbt_lib_t storage_lib;
 int MSG_STORAGE_LEVEL          = -1; // Msg storage level
-int ROUTING_STORAGE_LEVEL      = -1; // Routing for storage level
 int SURF_STORAGE_LEVEL = -1;
 simgrid::surf::StorageModel *surf_storage_model = nullptr;
 
@@ -50,10 +49,8 @@ StorageModel::~StorageModel(){
  ************/
 
 Storage::Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite,
-                 double bconnection, const char* type_id, const char* content_name, const char* content_type,
-                 sg_size_t size, const char* attach)
-    : Resource(model, name, lmm_constraint_new(maxminSystem, this, bconnection))
-    , contentType_(xbt_strdup(content_type))
+                 const char* type_id, const char* content_name, sg_size_t size, const char* attach)
+    : Resource(model, name, lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite)))
     , size_(size)
     , usedSize_(0)
     , typeId_(xbt_strdup(type_id))
@@ -62,7 +59,7 @@ Storage::Storage(Model* model, const char* name, lmm_system_t maxminSystem, doub
   content_ = parseContent(content_name);
   attach_  = xbt_strdup(attach);
   turnOn();
-  XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size);
+  XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);
   constraintRead_  = lmm_constraint_new(maxminSystem, this, bread);
   constraintWrite_ = lmm_constraint_new(maxminSystem, this, bwrite);
 }
@@ -75,14 +72,13 @@ Storage::~Storage(){
     delete content_;
   }
   free(typeId_);
-  free(contentType_);
   free(attach_);
 }
 
 std::map<std::string, sg_size_t*>* Storage::parseContent(const char* filename)
 {
   usedSize_ = 0;
-  if ((!filename) || (strcmp(filename, "") == 0))
+  if ((not filename) || (strcmp(filename, "") == 0))
     return nullptr;
 
   std::map<std::string, sg_size_t*>* parse_content = new std::map<std::string, sg_size_t*>();
@@ -104,7 +100,7 @@ std::map<std::string, sg_size_t*>* Storage::parseContent(const char* filename)
       *psize = size;
       parse_content->insert({tokens.front(), psize});
     }
-  } while (!fs->eof());
+  } while (not fs->eof());
   delete fs;
   return parse_content;
 }