X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/deaf4c6f1cb3026b053ca861fe77313c78385be7..265e908745398dd4e9cc55187aa267650468c57c:/src/surf/storage_n11.cpp diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 73e9415d54..68b0ca302f 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -61,7 +61,7 @@ StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id, "property Bwrite, storage", type_id.c_str()); StorageImpl* storage = - new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, content_name, storage_type->size, attach); + new StorageN11(this, id, maxmin_system_, Bread, Bwrite, type_id, content_name, storage_type->size, attach); storageCreatedCallbacks(storage); XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id.c_str(), type_id.c_str(), @@ -80,13 +80,13 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) for (auto it = std::begin(*getRunningActionSet()); it != std::end(*getRunningActionSet());) { StorageAction& action = static_cast(*it); ++it; // increment iterator here since the following calls to action.finish() may invalidate it - action.updateRemains(lrint(action.getVariable()->get_value() * delta)); + action.update_remains(lrint(action.getVariable()->get_value() * delta)); - if (action.getMaxDuration() > NO_MAX_DURATION) - action.updateMaxDuration(delta); + if (action.get_max_duration() > NO_MAX_DURATION) + action.update_max_duration(delta); - if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) || - ((action.getMaxDuration() > NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) { + if (((action.get_remains_no_update() <= 0) && (action.getVariable()->get_weight() > 0)) || + ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) { action.finish(kernel::resource::Action::State::done); } } @@ -96,8 +96,8 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) * Resource * ************/ -StorageN11::StorageN11(StorageModel* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite, - std::string type_id, std::string content_name, sg_size_t size, std::string attach) +StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread, + double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach) : StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach) { XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size); @@ -139,31 +139,16 @@ StorageN11Action::StorageN11Action(kernel::resource::Model* model, double cost, XBT_OUT(); } -int StorageN11Action::unref() -{ - refcount_--; - if (not refcount_) { - if (stateSetHook_.is_linked()) - simgrid::xbt::intrusive_erase(*stateSet_, *this); - if (getVariable()) - getModel()->getMaxminSystem()->variable_free(getVariable()); - xbt_free(getCategory()); - delete this; - return 1; - } - return 0; -} - void StorageN11Action::cancel() { - setState(Action::State::failed); + set_state(Action::State::failed); } void StorageN11Action::suspend() { XBT_IN("(%p)", this); if (suspended_ != Action::SuspendStates::sleeping) { - getModel()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0); + get_model()->getMaxminSystem()->update_variable_weight(getVariable(), 0.0); suspended_ = Action::SuspendStates::suspended; } XBT_OUT(); @@ -174,21 +159,16 @@ void StorageN11Action::resume() THROW_UNIMPLEMENTED; } -bool StorageN11Action::isSuspended() -{ - return suspended_ == Action::SuspendStates::suspended; -} - -void StorageN11Action::setMaxDuration(double /*duration*/) +void StorageN11Action::set_max_duration(double /*duration*/) { THROW_UNIMPLEMENTED; } -void StorageN11Action::setSharingWeight(double /*priority*/) +void StorageN11Action::set_priority(double /*priority*/) { THROW_UNIMPLEMENTED; } -void StorageN11Action::updateRemainingLazy(double /*now*/) +void StorageN11Action::update_remains_lazy(double /*now*/) { THROW_IMPOSSIBLE; }