Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this writeActions stuff was never used
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 10 Jul 2017 07:35:35 +0000 (09:35 +0200)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 10 Jul 2017 07:35:35 +0000 (09:35 +0200)
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/storage_n11.cpp

index 95c0ffe..8faa657 100644 (file)
@@ -66,7 +66,6 @@ StorageImpl::StorageImpl(Model* model, const char* name, lmm_system_t maxminSyst
     , usedSize_(0)
     , typeId_(type_id)
     , attach_(attach)
     , usedSize_(0)
     , typeId_(type_id)
     , attach_(attach)
-    , writeActions_(std::vector<StorageAction*>())
 {
   content_ = parseContent(content_name);
   turnOn();
 {
   content_ = parseContent(content_name);
   turnOn();
index 4cfb23d..4773a9b 100644 (file)
@@ -169,7 +169,6 @@ public:
   std::map<std::string, sg_size_t>* parseContent(const char* filename);
   static std::unordered_map<std::string, StorageImpl*>* storages;
   static std::unordered_map<std::string, StorageImpl*>* storagesMap() { return StorageImpl::storages; }
   std::map<std::string, sg_size_t>* parseContent(const char* filename);
   static std::unordered_map<std::string, StorageImpl*>* storages;
   static std::unordered_map<std::string, StorageImpl*>* storagesMap() { return StorageImpl::storages; }
-  std::vector<StorageAction*> writeActions_;
 
   lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
   lmm_constraint_t constraintRead_;  /* Constraint for maximum write bandwidth*/
 
   lmm_constraint_t constraintWrite_; /* Constraint for maximum write bandwidth*/
   lmm_constraint_t constraintRead_;  /* Constraint for maximum write bandwidth*/
index 0cd5ebd..03b357c 100644 (file)
@@ -69,19 +69,7 @@ StorageImpl* StorageN11Model::createStorage(const char* id, const char* type_id,
 
 double StorageN11Model::nextOccuringEvent(double now)
 {
 
 double StorageN11Model::nextOccuringEvent(double now)
 {
-  double min_completion = StorageModel::nextOccuringEventFull(now);
-
-  for(auto storage: p_storageList) {
-    double rate = 0;
-    // Foreach write action on that disk
-    for (auto write_action: storage->writeActions_) {
-      rate += lmm_variable_getvalue(write_action->getVariable());
-    }
-    if(rate > 0)
-      min_completion = MIN(min_completion, (storage->size_-storage->usedSize_)/rate);
-  }
-
-  return min_completion;
+  return StorageModel::nextOccuringEventFull(now);
 }
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
 }
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
@@ -173,16 +161,6 @@ StorageAction *StorageN11::open(const char* mount, const char* path)
 StorageAction *StorageN11::close(surf_file_t fd)
 {
   XBT_DEBUG("\tClose file '%s' size '%llu'", fd->cname(), fd->size());
 StorageAction *StorageN11::close(surf_file_t fd)
 {
   XBT_DEBUG("\tClose file '%s' size '%llu'", fd->cname(), fd->size());
-  // unref write actions from storage
-  for (std::vector<StorageAction*>::iterator it = writeActions_.begin(); it != writeActions_.end();) {
-    StorageAction *write_action = *it;
-    if ((write_action->file_) == fd) {
-      write_action->unref();
-      it = writeActions_.erase(it);
-    } else {
-      ++it;
-    }
-  }
   StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, CLOSE);
   return action;
 }
   StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, CLOSE);
   return action;
 }
@@ -241,11 +219,6 @@ StorageN11Action::StorageN11Action(Model* model, double cost, bool failed, Stora
     break;
   case WRITE:
     lmm_expand(model->getMaxminSystem(), storage->constraintWrite_, getVariable(), 1.0);
     break;
   case WRITE:
     lmm_expand(model->getMaxminSystem(), storage->constraintWrite_, getVariable(), 1.0);
-
-    //TODO there is something annoying with what's below. Have to sort it out...
-    //    Action *action = this;
-    //    storage->p_writeActions->push_back(action);
-    //    ref();
     break;
   default:
     THROW_UNIMPLEMENTED;
     break;
   default:
     THROW_UNIMPLEMENTED;