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
use a travis badge with the travis logo
[simgrid.git]
/
src
/
s4u
/
s4u_Storage.cpp
diff --git
a/src/s4u/s4u_Storage.cpp
b/src/s4u/s4u_Storage.cpp
index
d1b2aa5
..
799240f
100644
(file)
--- a/
src/s4u/s4u_Storage.cpp
+++ b/
src/s4u/s4u_Storage.cpp
@@
-56,34
+56,41
@@
void Storage::set_property(std::string key, std::string value)
simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
}
simgrid::simix::simcall([this, key, value] { this->pimpl_->set_property(key, value); });
}
-IoPtr Storage::io_init(sg_size_t size)
+IoPtr Storage::io_init(sg_size_t size
, Io::OpType type
)
{
{
- IoPtr res = IoPtr(new Io(size));
+ IoPtr res = IoPtr(new Io(size
, type
));
res->storage_ = this;
return res;
}
res->storage_ = this;
return res;
}
+IoPtr Storage::read_async(sg_size_t size)
+{
+
+ IoPtr res = io_init(size, Io::OpType::READ);
+ res->start();
+ return res;
+}
+
sg_size_t Storage::read(sg_size_t size)
{
sg_size_t Storage::read(sg_size_t size)
{
- IoPtr i = io_init(size);
- i->set_io_type(Io::OpType::READ);
+ IoPtr i = io_init(size, Io::OpType::READ);
i->start()->wait();
return i->get_performed_ioops();
}
i->start()->wait();
return i->get_performed_ioops();
}
-
sg_size_t Storage::write
(sg_size_t size)
+
IoPtr Storage::write_async
(sg_size_t size)
{
{
- IoPtr i = io_init(size);
-
i->set_io_type(
Io::OpType::WRITE);
-
i->start()->wai
t();
- return
i->get_performed_ioops()
;
+
+
IoPtr res = io_init(size,
Io::OpType::WRITE);
+
res->star
t();
+ return
res
;
}
}
-// Deprecated functions
-void getStorageList(std::map<std::string, Storage*>* whereTo)
+sg_size_t Storage::write(sg_size_t size)
{
{
- for (auto const& s : simgrid::s4u::Engine::get_instance()->get_all_storages())
- whereTo->insert({s->get_name(), s});
+ IoPtr i = io_init(size, Io::OpType::WRITE);
+ i->start()->wait();
+ return i->get_performed_ioops();
}
} /* namespace s4u */
}
} /* namespace s4u */