X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a92d7b716f51a53dea7f59db8524d4add713b910..7e0ed86eb69d0284af8e2bf5590919701c3b0e5f:/src/surf/HostImpl.cpp diff --git a/src/surf/HostImpl.cpp b/src/surf/HostImpl.cpp index b8ca1e8dd9..72f0f72f68 100644 --- a/src/surf/HostImpl.cpp +++ b/src/surf/HostImpl.cpp @@ -25,7 +25,7 @@ namespace surf { * constraint (capacity) of the VM in the PM layer. If the VM does not have any * active task, the dummy CPU action must be deactivated, so that the VM does * not get any CPU share in the PM layer. */ -void HostModel::adjustWeightOfDummyCpuActions() +void HostModel::ignoreEmptyVmInPmLMM() { /* iterate for all virtual machines */ for (s4u::VirtualMachine* ws_vm : vm::VirtualMachineImpl::allVms_) { @@ -38,12 +38,11 @@ void HostModel::adjustWeightOfDummyCpuActions() /* some tasks exist on this VM */ XBT_DEBUG("set the weight of the dummy CPU action on PM to 1"); - /* FIXME: we should use lmm_update_variable_weight() ? */ /* FIXME: If we assign 1.05 and 0.05, the system makes apparently wrong values. */ ws_vm->pimpl_vm_->action_->setPriority(1); } else { - /* no task exits on this VM */ + /* no task exist on this VM */ XBT_DEBUG("set the weight of the dummy CPU action on PM to 0"); ws_vm->pimpl_vm_->action_->setPriority(0); @@ -129,19 +128,9 @@ xbt_dict_t HostImpl::getMountedStorageList() void HostImpl::getAttachedStorageList(std::vector* storages) { - xbt_lib_cursor_t cursor; - char* key; - void** data; - xbt_lib_foreach(storage_lib, cursor, key, data) - { - if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) { - simgrid::surf::StorageImpl* storage = static_cast( - xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); - if (not strcmp(static_cast(storage->attach_), piface_->cname())) { - storages->push_back(storage->cname()); - } - } - } + for (auto s : storage_) + if (not strcmp(static_cast(s.second->attach_), piface_->cname())) + storages->push_back(s.second->piface_.name()); } Action* HostImpl::open(const char* fullpath)