Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename next_occuring_event() into nextOccuringEvent()
[simgrid.git] / src / surf / storage_n11.cpp
index 21fbb42..7d88c8f 100644 (file)
@@ -110,17 +110,13 @@ Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
   return storage;
 }
 
-double StorageN11Model::next_occuring_event(double /*now*/)
+double StorageN11Model::nextOccuringEvent(double now)
 {
-  XBT_DEBUG("storage_share_resources");
+  double min_completion = StorageModel::nextOccuringEventFull(now);
 
-  double min_completion = shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
-
-  double rate;
-  // Foreach disk
   for(auto storage: p_storageList) {
-    rate = 0;
-    // Foreach write action on disk
+    double rate = 0;
+    // Foreach write action on that disk
     for (auto write_action: storage->writeActions_) {
       rate += lmm_variable_getvalue(write_action->getVariable());
     }
@@ -133,20 +129,19 @@ double StorageN11Model::next_occuring_event(double /*now*/)
 
 void StorageN11Model::updateActionsState(double /*now*/, double delta)
 {
-  StorageAction *action = nullptr;
 
   ActionList *actionSet = getRunningActionSet();
   for(ActionList::iterator it(actionSet->begin()), itNext=it, itend(actionSet->end())
       ; it != itend ; it=itNext) {
     ++itNext;
-    action = static_cast<StorageAction*>(&*it);
+
+    StorageAction *action = static_cast<StorageAction*>(&*it);
 
     if(action->m_type == WRITE){
       // Update the disk usage
       // Update the file size
       // For each action of type write
-      double current_progress =
-          delta * lmm_variable_getvalue(action->getVariable());
+      double current_progress = delta * lmm_variable_getvalue(action->getVariable());
       long int incr = current_progress;
 
       XBT_DEBUG("%s:\n\t progress =  %.2f, current_progress = %.2f, incr = %ld, lrint(1) = %ld, lrint(2) = %ld",
@@ -187,7 +182,6 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta)
       action->setState(Action::State::done);
     }
   }
-  return;
 }
 
 /************
@@ -334,7 +328,6 @@ int StorageN11Action::unref()
 void StorageN11Action::cancel()
 {
   setState(Action::State::failed);
-  return;
 }
 
 void StorageN11Action::suspend()