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
Kill unused field.
[simgrid.git]
/
src
/
s4u
/
s4u_exec.cpp
diff --git
a/src/s4u/s4u_exec.cpp
b/src/s4u/s4u_exec.cpp
index
ca3623d
..
e7a16ae
100644
(file)
--- a/
src/s4u/s4u_exec.cpp
+++ b/
src/s4u/s4u_exec.cpp
@@
-13,20
+13,25
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_exec, s4u_activity, "S4U asynchronous execut
namespace simgrid {
namespace s4u {
namespace simgrid {
namespace s4u {
-
void
Exec::start()
+
Activity*
Exec::start()
{
pimpl_ = simcall_execution_start(nullptr, flops_amount_, 1 / priority_, 0., host_);
{
pimpl_ = simcall_execution_start(nullptr, flops_amount_, 1 / priority_, 0., host_);
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->setBound(bound_);
state_ = started;
state_ = started;
+ return this;
}
}
-
void
Exec::wait()
+
Activity*
Exec::wait()
{
simcall_execution_wait(pimpl_);
{
simcall_execution_wait(pimpl_);
+ state_ = finished;
+ return this;
}
}
-
void
Exec::wait(double timeout)
+
Activity*
Exec::wait(double timeout)
{
THROW_UNIMPLEMENTED;
{
THROW_UNIMPLEMENTED;
+ return this;
}
bool Exec::test()
}
bool Exec::test()
@@
-55,9
+60,19
@@
ExecPtr Exec::setPriority(double priority)
priority_ = priority;
return this;
}
priority_ = priority;
return this;
}
+
+ExecPtr Exec::setBound(double bound)
+{
+ xbt_assert(state_ == inited, "Cannot change the bound of an exec after its start");
+ bound_ = bound;
+ return this;
+}
+
ExecPtr Exec::setHost(Host* host)
{
ExecPtr Exec::setHost(Host* host)
{
- xbt_assert(state_ == inited, "Cannot change the host of an exec after its start");
+ xbt_assert(state_ == inited || state_ == started, "Cannot change the host of an exec once it's done (state: %d)", state_);
+ if (state_ == started)
+ boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(pimpl_)->migrate(host);
host_ = host;
return this;
}
host_ = host;
return this;
}