From 457d884e1b609d6821ebdc64d80826f556fd9cc7 Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Mon, 22 May 2017 23:39:09 +0200 Subject: [PATCH] remove unvalidated Bconnection attribute --- examples/msg/io-remote/io-remote.tesh | 16 ++++++++-------- examples/platforms/storage/remote_io.xml | 1 - examples/platforms/storage/storage.xml | 2 -- src/surf/storage_interface.cpp | 6 +++--- src/surf/storage_interface.hpp | 4 ++-- src/surf/storage_n11.cpp | 12 +++++------- src/surf/storage_n11.hpp | 3 +-- 7 files changed, 19 insertions(+), 25 deletions(-) diff --git a/examples/msg/io-remote/io-remote.tesh b/examples/msg/io-remote/io-remote.tesh index e0123bed58..46b251e2e5 100644 --- a/examples/msg/io-remote/io-remote.tesh +++ b/examples/msg/io-remote/io-remote.tesh @@ -44,9 +44,9 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/ > [ 0.001469] (4@ dave) Offset is now at: 0 > [ 0.001469] (4@ dave) Opened file 'c:\Windows\Professional.xml' > [ 0.001469] (4@ dave) Try to write 31 MiB to 'c:\Windows\Professional.xml' -> [ 0.003559] (1@alice) Have read 101663 from 'c:\Windows\setupact.log'. Offset is now at: 101663 -> [ 0.003559] (1@alice) Seek back to the begining of the stream... -> [ 0.003559] (1@alice) Offset is now at: 0 +> [ 0.003741] (1@alice) Have read 101663 from 'c:\Windows\setupact.log'. Offset is now at: 101663 +> [ 0.003741] (1@alice) Seek back to the begining of the stream... +> [ 0.003741] (1@alice) Offset is now at: 0 > [ 0.276315] (3@ carl) Have read 12710497 from '/scratch/lib/libsimgrid.so.3.6.2'. Offset is now at: 12710497 > [ 0.276315] (3@ carl) Seek back to the begining of the stream... > [ 0.276315] (3@ carl) Offset is now at: 0 @@ -55,10 +55,10 @@ $ ${bindir:=.}/io-remote$EXEEXT ${srcdir:=.}/storage/remote_io.xml ${srcdir:=.}/ > [ 0.387036] (2@ bob) Offset is now at: 0 > [ 0.387036] (2@ bob) Opened file '/scratch/doc/simgrid/examples/platforms/g5k.xml' > [ 0.387036] (2@ bob) Try to write 16 MiB to '/scratch/doc/simgrid/examples/platforms/g5k.xml' -> [ 0.528029] (4@ dave) Have written 32646144 bytes to 'c:\Windows\Professional.xml'. -> [ 0.528029] (4@ dave) Move 'c:\Windows\Professional.xml' (of size 32646144) from 'dave' to 'carl' +> [ 0.528211] (4@ dave) Have written 32646144 bytes to 'c:\Windows\Professional.xml'. +> [ 0.528211] (4@ dave) Move 'c:\Windows\Professional.xml' (of size 32646144) from 'dave' to 'carl' > [ 0.819921] (2@ bob) Have written 17436672 bytes to '/scratch/doc/simgrid/examples/platforms/g5k.xml'. > [ 0.819921] (2@ bob) Copy '/scratch/doc/simgrid/examples/platforms/g5k.xml' (of size 17436672) from 'bob' to 'alice' -> [ 1.843786] (0@ ) Init: 60 MiB used on 'Disk1' -> [ 1.843786] (0@ ) Init: 2297 MiB used on 'Disk2' -> [ 1.843786] (0@ ) Simulation time 1.84379 +> [ 1.843969] (0@ ) Init: 60 MiB used on 'Disk1' +> [ 1.843969] (0@ ) Init: 2297 MiB used on 'Disk2' +> [ 1.843969] (0@ ) Simulation time 1.84397 diff --git a/examples/platforms/storage/remote_io.xml b/examples/platforms/storage/remote_io.xml index 069fdf91cd..16a0dfde4a 100644 --- a/examples/platforms/storage/remote_io.xml +++ b/examples/platforms/storage/remote_io.xml @@ -9,7 +9,6 @@ - diff --git a/examples/platforms/storage/storage.xml b/examples/platforms/storage/storage.xml index 9d1fa4f39e..1402e680f9 100644 --- a/examples/platforms/storage/storage.xml +++ b/examples/platforms/storage/storage.xml @@ -9,13 +9,11 @@ - - diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 1aef9a97a8..50c66f4eaf 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -50,8 +50,8 @@ StorageModel::~StorageModel(){ ************/ Storage::Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, - double bconnection, const char* type_id, const char* content_name, sg_size_t size, const char* attach) - : Resource(model, name, lmm_constraint_new(maxminSystem, this, bconnection)) + const char* type_id, const char* content_name, sg_size_t size, const char* attach) + : Resource(model, name, lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite))) , size_(size) , usedSize_(0) , typeId_(xbt_strdup(type_id)) @@ -60,7 +60,7 @@ Storage::Storage(Model* model, const char* name, lmm_system_t maxminSystem, doub content_ = parseContent(content_name); attach_ = xbt_strdup(attach); turnOn(); - XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size); + XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size); constraintRead_ = lmm_constraint_new(maxminSystem, this, bread); constraintWrite_ = lmm_constraint_new(maxminSystem, this, bwrite); } diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index 42e8640dd4..9e79f47658 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -80,8 +80,8 @@ class Storage : public simgrid::surf::Resource, public: /** @brief Storage constructor */ - Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, double bconnection, - const char* type_id, const char* content_name, sg_size_t size, const char* attach); + Storage(Model* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, const char* type_id, + const char* content_name, sg_size_t size, const char* attach); ~Storage(); diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index b28b61e473..8c4f4e8703 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -68,11 +68,9 @@ Storage* StorageN11Model::createStorage(const char* id, const char* type_id, con surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(), "property Bread, storage", type_id); double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(), "property Bwrite, storage", type_id); - double Bconnection = surf_parse_get_bandwidth(storage_type->model_properties->at("Bconnection").c_str(), - "property Bconnection, storage", type_id); - Storage* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, Bconnection, type_id, (char*)content_name, - storage_type->size, (char*)attach); + Storage* storage = new StorageN11(this, id, maxminSystem_, Bread, Bwrite, type_id, (char*)content_name, + storage_type->size, (char*)attach); storageCreatedCallbacks(storage); xbt_lib_set(storage_lib, id, SURF_STORAGE_LEVEL, storage); @@ -162,10 +160,10 @@ void StorageN11Model::updateActionsState(double /*now*/, double delta) ************/ StorageN11::StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, - double bconnection, const char* type_id, char* content_name, sg_size_t size, char* attach) - : Storage(model, name, maxminSystem, bread, bwrite, bconnection, type_id, content_name, size, attach) + const char* type_id, char* content_name, sg_size_t size, char* attach) + : Storage(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach) { - XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size); + XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size); } StorageAction *StorageN11::open(const char* mount, const char* path) diff --git a/src/surf/storage_n11.hpp b/src/surf/storage_n11.hpp index 734b7400bf..9c8d8665ea 100644 --- a/src/surf/storage_n11.hpp +++ b/src/surf/storage_n11.hpp @@ -40,8 +40,7 @@ public: class StorageN11 : public Storage { public: StorageN11(StorageModel* model, const char* name, lmm_system_t maxminSystem, double bread, double bwrite, - double bconnection, const char* type_id, char* content_name, sg_size_t size, char* attach); - + const char* type_id, char* content_name, sg_size_t size, char* attach); StorageAction *open(const char* mount, const char* path); StorageAction *close(surf_file_t fd); StorageAction *ls(const char *path); -- 2.20.1