A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Create Disk::set_readwrite_bandwidth
[simgrid.git]
/
src
/
kernel
/
resource
/
DiskImpl.cpp
diff --git
a/src/kernel/resource/DiskImpl.cpp
b/src/kernel/resource/DiskImpl.cpp
index
7b1fca1
..
fe2e269
100644
(file)
--- 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();
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))
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();
apply_sharing_policy_cfg();
XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw_.peak, write_bw_.peak);
Resource::seal();