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
properly split init/start for Exec activities
[simgrid.git]
/
src
/
s4u
/
s4u_Storage.cpp
diff --git
a/src/s4u/s4u_Storage.cpp
b/src/s4u/s4u_Storage.cpp
index
d1b2aa5
..
f0bd686
100644
(file)
--- a/
src/s4u/s4u_Storage.cpp
+++ b/
src/s4u/s4u_Storage.cpp
@@
-1,4
+1,4
@@
-/* Copyright (c) 2006-201
8
. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-201
9
. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
@@
-56,34
+56,38
@@
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));
- res->storage_ = this;
+ return IoPtr(new Io(this, size, type));
+}
+
+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)
{
return res;
}
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 */