X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/555ebc2e544437445450239b48e7df9b4f371460..f2ecde6af20db46907714e04cee35408df5f5a10:/src/kernel/resource/DiskImpl.cpp diff --git a/src/kernel/resource/DiskImpl.cpp b/src/kernel/resource/DiskImpl.cpp index 7b1fca1b4c..fe2e269513 100644 --- a/src/kernel/resource/DiskImpl.cpp +++ b/src/kernel/resource/DiskImpl.cpp @@ -113,9 +113,13 @@ void DiskImpl::seal() xbt_assert(this->get_model(), "Cannot seal Disk (%s) without setting the model first", get_cname()); lmm::System* maxmin_system = get_model()->get_maxmin_system(); + /* set readwrite constraint if not configured by user */ + if (readwrite_bw_ == -1) { + readwrite_bw_ = std::max(read_bw_.peak, write_bw_.peak); + } this->set_read_constraint(maxmin_system->constraint_new(this, read_bw_.peak * read_bw_.scale)) ->set_write_constraint(maxmin_system->constraint_new(this, write_bw_.peak * write_bw_.scale)) - ->set_constraint(maxmin_system->constraint_new(this, std::max(read_bw_.peak, write_bw_.peak))); + ->set_constraint(maxmin_system->constraint_new(this, readwrite_bw_)); apply_sharing_policy_cfg(); XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw_.peak, write_bw_.peak); Resource::seal();