- Removed all that was related to the "Storage" type in all APIs and bindings.
"Disks" have been introduced more than a year ago to replace them for the better.
It's time to finish this replacement.
+ - Model iteration order may change simulations.
+ *****************************************
+ *DO NOT MIX 3.27 RESULTS WITH OLDER ONES*
+ *****************************************
+ The order in which the different models (CPU, network, disk, etc) are
+ solved internally has changed in this version. Although rare (no current
+ test raises the problem), this change can result in slightest different simulations
+ results. Take care when comparing simulations from different SimGrid's
+ versions. Sorry for the inconvenience.
S4U:
- Define new template functions Mailbox::get_unique(), returning a std::unique_ptr.
auto model_name = model->get_name();
xbt_assert(models_prio_.find(model_name) == models_prio_.end(),
"Model %s already exists, use model.set_name() to change its name", model_name.c_str());
- int order = -1;
+
for (const auto dep : dependencies) {
xbt_assert(models_prio_.find(dep->get_name()) != models_prio_.end(),
"Model %s doesn't exists. Impossible to use it as dependency.", dep->get_name().c_str());
- if (models_prio_[dep->get_name()].prio > order) {
- order = models_prio_[dep->get_name()].prio;
- }
- }
- models_prio_[model_name] = {++order, std::move(model)};
-
- auto sorted_models = std::vector<std::pair<std::string, ModelStruct>>(models_prio_.begin(), models_prio_.end());
- std::sort(
- sorted_models.begin(), sorted_models.end(),
- [](const std::pair<std::string, ModelStruct>& first, const std::pair<std::string, ModelStruct>& second) -> bool {
- return first.second.prio < second.second.prio;
- });
- models_.clear();
- for (const auto& model : sorted_models) {
- models_.push_back(model.second.ptr.get());
}
+ models_.push_back(model.get());
+ models_prio_[model_name] = std::move(model);
}
} // namespace kernel
std::unordered_map<std::string, actor::ActorCodeFactory> registered_functions; // Maps function names to actor code
actor::ActorCodeFactory default_function; // Function to use as a fallback when the provided name matches nothing
std::vector<resource::Model*> models_;
- struct ModelStruct {
- int prio;
- std::shared_ptr<resource::Model> ptr;
- };
- std::unordered_map<std::string, struct ModelStruct> models_prio_;
+ std::unordered_map<std::string, std::shared_ptr<resource::Model>> models_prio_;
routing::NetZoneImpl* netzone_root_ = nullptr;
friend s4u::Engine;