Frederic Suter [Tue, 5 Mar 2019 22:43:51 +0000 (23:43 +0100)]
s4u::Exec now has 2 child classes
s4u::ExecSeq and s4u::ExecPar
side effects:
+ no more C-style host list in HostImpl and ptaskLO7
+ Sequential execution can have a timeout
TODO:
+ get rid of ExecImplPtr in MSG
+ check and clean
Martin Quinson [Mon, 4 Mar 2019 23:38:28 +0000 (00:38 +0100)]
Sanitize the prototype of Actor::on_exit() callbacks
Changes on_exit(function<void(int failed, void*data)>, data)
into on_exit(function<void(bool failed)>)
So, we are using bool for boolean values, and we don't force the user
to build a closure on void* data manually. If you want to pass a data
to the callback, just use the C++ formalism: [data](bool failed){...}
Other changes on the way (that excalated quickly)
- Document some recent changes to the internals in ChangeLog
- Document this_actor::on_exit() and Actor::on_exit() in doxygen
- Also sanitize the prototype of MSG_process_on_exit(). Was taking a
(void*,void*) function; now takes a (int, void*) one. This was too
weird to use void* to denote integers -- I actually doubt it ever
worked the way it was written, but the tests are too poor to be
sure: the only usage of this function ignores the return value.
- Also add a new test in activity-lifetime: test_sleep_restart_end
Commented for now as it breaks miserably.
Frederic Suter [Fri, 1 Mar 2019 17:52:08 +0000 (18:52 +0100)]
The creation of the pimpl needs no simcall
Now that init and start are split, creating the ExecImpl in init (the
constructor) has no impact on the simulation kernel. The action is
created by start().
This slightly modifies the ordering of the output in one tesh file
Frederic Suter [Thu, 28 Feb 2019 12:46:12 +0000 (13:46 +0100)]
add test related to #220 + fix killsend
If the test and the launched actors share a scheduling round, the
outer test comes first and execute the asserts before the actors are
able to end their execution. As we want to control the status of the
actors when they end, let the outer test wait a bit before asserting.
Martin Quinson [Thu, 28 Feb 2019 01:34:12 +0000 (02:34 +0100)]
activity-lifecycle: test exec just as we test sleep
We should also try to cancel all these nice actions. And at some
point, we should probably come up with a DSL or find another way to
factorize some code.
Martin Quinson [Thu, 28 Feb 2019 01:30:53 +0000 (02:30 +0100)]
Don't give actors a chance to survive their exec if their host is turned off
Before, they received an HostFailureException that they could catch to
survive. Now, they are simply killed (once their on_exit callbacks are
executed).
This is more consistent with what happens with sleep actions, and thus
fixes the github issue #325.
Frederic Suter [Wed, 27 Feb 2019 13:49:06 +0000 (14:49 +0100)]
fix (#220) ?
If an actor ends right after a dsend, the Comm should not be canceled
to let the receiver a chance to catch it.
It was removed in Comm::cancel(), now it's not, and the destructor has
to be a bit more careful.
As the comm was canceled, if the receive is posted later, it nevers
find its matching send and may stall forever or timeout.
This changed the output of the chord example (using dsend), but I
suspect it was not so correct before with some dsend being canceled
and the corresponding receive ending on timeout.
This also highlighted an issue in Java. The cleanup function for dsend
is now called at the end of the simulation and get_current_thread_env
crashed (because the current thread is maestro).
degomme [Tue, 26 Feb 2019 10:58:12 +0000 (11:58 +0100)]
Yet again change the way SMPI_SAMPLE_MACRO works
There is no need anymore to have the body of the loop inside the macro. Kudos to Arnaud L for the ideas.
now usage is just turning
for(x;y;z) into SMPI_SAMPLE_GLOBAL(x,y,z,iters,thres)
Time injection will be done only once for all the section, speeding up the simulation.
TODO : iterator value will not be correct at the end of the loop for now.
Not important if iterator is local to the loop, but may be annoying if not.
Frederic Suter [Tue, 26 Feb 2019 10:28:47 +0000 (11:28 +0100)]
fix (#324)
Throw a HostFailureException when one tries to create (or attach) an
actor an a host that is not on.
If this happens during the parsing of the deployment file, just let it
go.
for MSG, we could die if this happens (we don't for now)