From 3bd99877105c107dbf2e174c36d014811a07b7e2 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Tue, 10 Sep 2019 11:12:16 +0200 Subject: [PATCH 1/1] need to delay signal after properties are set --- src/kernel/resource/DiskImpl.hpp | 2 +- src/surf/disk_s19.cpp | 1 - src/surf/sg_platf.cpp | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/kernel/resource/DiskImpl.hpp b/src/kernel/resource/DiskImpl.hpp index dde80f529b..79abb67563 100644 --- a/src/kernel/resource/DiskImpl.hpp +++ b/src/kernel/resource/DiskImpl.hpp @@ -59,7 +59,7 @@ public: /** @brief Public interface */ s4u::Disk piface_; - + s4u::Disk* get_iface() { return &piface_; } /** @brief Check if the Storage is used (if an action currently uses its resources) */ bool is_used() override; diff --git a/src/surf/disk_s19.cpp b/src/surf/disk_s19.cpp index c8730947ed..4198e10035 100644 --- a/src/surf/disk_s19.cpp +++ b/src/surf/disk_s19.cpp @@ -66,7 +66,6 @@ DiskS19::DiskS19(DiskModel* model, const std::string& name, lmm::System* maxminS : DiskImpl(model, name, maxminSystem, read_bw, write_bw) { XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw, write_bw); - s4u::Disk::on_creation(this->piface_); } DiskAction* DiskS19::io_start(sg_size_t size, s4u::Io::OpType type) diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 218cfb8784..8a080b8f2e 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -337,11 +337,11 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet simgrid::kernel::resource::DiskImpl* sg_platf_new_disk(simgrid::kernel::routing::DiskCreationArgs* disk) { simgrid::kernel::resource::DiskImpl* d = surf_disk_model->createDisk(disk->id, disk->read_bw, disk->write_bw); - if (disk->properties) { d->set_properties(*disk->properties); delete disk->properties; } + simgrid::s4u::Disk::on_creation(*d->get_iface()); return d; } -- 2.20.1