Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simgrid.git
5 years agodon't let sonar think that pimpl_ can be null
Martin Quinson [Tue, 5 Mar 2019 07:03:51 +0000 (08:03 +0100)]
don't let sonar think that pimpl_ can be null

5 years agosonar: pass large parameters as const; don't name unused params
Martin Quinson [Tue, 5 Mar 2019 06:29:53 +0000 (07:29 +0100)]
sonar: pass large parameters as const; don't name unused params

5 years agoSanitize the prototype of Actor::on_exit() callbacks
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.

5 years agoMove ForcefulKillException to the root namespace, along with the other exceptions
Martin Quinson [Mon, 4 Mar 2019 22:28:38 +0000 (23:28 +0100)]
Move ForcefulKillException to the root namespace, along with the other exceptions

5 years agoRename StopRequest into ForcefulKillException to contribute to #325
Martin Quinson [Mon, 4 Mar 2019 22:01:36 +0000 (23:01 +0100)]
Rename StopRequest into ForcefulKillException to contribute to #325

5 years agofurther convert some bits of the documentation
Martin Quinson [Mon, 4 Mar 2019 21:48:53 +0000 (22:48 +0100)]
further convert some bits of the documentation

5 years agoAdd a comment to explain previous changes.
Arnaud Giersch [Sat, 2 Mar 2019 20:50:55 +0000 (21:50 +0100)]
Add a comment to explain previous changes.

5 years agoFix memleak.
Arnaud Giersch [Sat, 2 Mar 2019 13:19:21 +0000 (14:19 +0100)]
Fix memleak.

5 years agoFix use of invalidated iterator.
Arnaud Giersch [Sat, 2 Mar 2019 09:05:58 +0000 (10:05 +0100)]
Fix use of invalidated iterator.

5 years agoUse C++11 <random> for simcall mc_random.
Arnaud Giersch [Fri, 1 Mar 2019 22:16:49 +0000 (23:16 +0100)]
Use C++11 <random> for simcall mc_random.

5 years agoAvoid shadowing outer variables.
Arnaud Giersch [Fri, 1 Mar 2019 13:03:40 +0000 (14:03 +0100)]
Avoid shadowing outer variables.

5 years agoKill unused parameter and please Sonar.
Arnaud Giersch [Fri, 1 Mar 2019 17:37:59 +0000 (18:37 +0100)]
Kill unused parameter and please Sonar.

5 years agoUse specialized vector::swap.
Arnaud Giersch [Fri, 1 Mar 2019 11:49:41 +0000 (12:49 +0100)]
Use specialized vector::swap.

5 years agoUse Rvalue references for exception constructors.
Arnaud Giersch [Fri, 1 Mar 2019 10:27:27 +0000 (11:27 +0100)]
Use Rvalue references for exception constructors.

It seems to be sufficient for now.
Maybe one day we'll need to complete to handle Lvalues.

5 years agoStop setting random seed at initialization.
Arnaud Giersch [Fri, 1 Mar 2019 09:44:14 +0000 (10:44 +0100)]
Stop setting random seed at initialization.

5 years agokill obsolete doc
Martin Quinson [Fri, 1 Mar 2019 22:46:34 +0000 (23:46 +0100)]
kill obsolete doc

There is no need to convert that.

5 years agoconvert another page from old doc to RST
Martin Quinson [Fri, 1 Mar 2019 22:21:58 +0000 (23:21 +0100)]
convert another page from old doc to RST

5 years agodoc improvement
Martin Quinson [Thu, 28 Feb 2019 23:02:27 +0000 (00:02 +0100)]
doc improvement

I hope that this will clarify #325, and #132.

5 years agomv the internal isend function to the class
Frederic Suter [Fri, 1 Mar 2019 19:45:23 +0000 (20:45 +0100)]
mv the internal isend function to the class

5 years agoremove useless simcall for IO too and use better casts
Frederic Suter [Fri, 1 Mar 2019 18:18:14 +0000 (19:18 +0100)]
remove useless simcall for IO too and use better casts

5 years agoone step further not using kernel execution activities in MSG.
Frederic Suter [Fri, 1 Mar 2019 17:58:38 +0000 (18:58 +0100)]
one step further not using kernel execution activities in MSG.

5 years agoThe creation of the pimpl needs no simcall
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

5 years agoYell when there is an exception, not when there isn't
Frederic Suter [Fri, 1 Mar 2019 17:51:01 +0000 (18:51 +0100)]
Yell when there is an exception, not when there isn't

5 years agomess with MSG tasks
Frederic Suter [Fri, 1 Mar 2019 09:03:36 +0000 (10:03 +0100)]
mess with MSG tasks

5 years agoMake destructors useless.
Arnaud Giersch [Thu, 28 Feb 2019 22:22:03 +0000 (23:22 +0100)]
Make destructors useless.

5 years agoMake capture list explicit.
Arnaud Giersch [Thu, 28 Feb 2019 21:55:04 +0000 (22:55 +0100)]
Make capture list explicit.

5 years agoEmpty callback is optional.
Arnaud Giersch [Thu, 28 Feb 2019 21:51:44 +0000 (22:51 +0100)]
Empty callback is optional.

5 years agoHide std::free to Sonar.
Arnaud Giersch [Thu, 28 Feb 2019 21:43:39 +0000 (22:43 +0100)]
Hide std::free to Sonar.

5 years agoIgnore Sonar issue "Macros should not be used to define constants" in *.h.
Arnaud Giersch [Thu, 28 Feb 2019 21:39:34 +0000 (22:39 +0100)]
Ignore Sonar issue "Macros should not be used to define constants" in *.h.

5 years agoUse default initialization.
Arnaud Giersch [Thu, 28 Feb 2019 21:32:13 +0000 (22:32 +0100)]
Use default initialization.

5 years agoNo static analyzers, myCoords[] and targetCoords[] don't contain garbage.
Arnaud Giersch [Tue, 26 Feb 2019 20:54:53 +0000 (21:54 +0100)]
No static analyzers, myCoords[] and targetCoords[] don't contain garbage.

Save dimensions_.size() in a local variable to help Sonar and Clang, plus other
simplifications.

5 years agoDon't rely on random to generate temporary file names.
Arnaud Giersch [Thu, 28 Feb 2019 14:35:19 +0000 (15:35 +0100)]
Don't rely on random to generate temporary file names.

5 years agoUse C++11 <random> instead of rand().
Arnaud Giersch [Thu, 28 Feb 2019 14:00:06 +0000 (15:00 +0100)]
Use C++11 <random>  instead of rand().

5 years agoRemove never used FindRngStream.cmake.
Arnaud Giersch [Thu, 28 Feb 2019 13:45:22 +0000 (14:45 +0100)]
Remove never used FindRngStream.cmake.

5 years agobetter message for this exception
Frederic Suter [Thu, 28 Feb 2019 12:52:04 +0000 (13:52 +0100)]
better message for this exception

5 years agoadd test related to #220 + fix killsend
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.

5 years agochange exception raised if a StopRequest is catched in Host.off()
Frederic Suter [Thu, 28 Feb 2019 09:12:07 +0000 (10:12 +0100)]
change exception raised if a StopRequest is catched in Host.off()

5 years agoactivity-lifecycle: test exec just as we test sleep
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.

5 years agoDon't give actors a chance to survive their exec if their host is turned off
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.

5 years agoplease sonar: don't declare an empty callback
Martin Quinson [Wed, 27 Feb 2019 23:09:44 +0000 (00:09 +0100)]
please sonar: don't declare an empty callback

5 years agoFix forwarding of the program arguments.
Arnaud Giersch [Wed, 27 Feb 2019 22:36:42 +0000 (23:36 +0100)]
Fix forwarding of the program arguments.

Use a static storage to avoid dangling pointers, and ensure that there is no
out of bound array access.

5 years agoFix Backtrace::operator=.
Arnaud Giersch [Wed, 27 Feb 2019 20:49:32 +0000 (21:49 +0100)]
Fix Backtrace::operator=.

5 years agoAnonymize unused parameters.
Arnaud Giersch [Wed, 27 Feb 2019 14:55:56 +0000 (15:55 +0100)]
Anonymize unused parameters.

5 years agoEnforce "Rule-of-Three/Five".
Arnaud Giersch [Wed, 27 Feb 2019 14:11:36 +0000 (15:11 +0100)]
Enforce "Rule-of-Three/Five".

5 years agoAvoid null pointer dereference.
Arnaud Giersch [Tue, 26 Feb 2019 21:54:45 +0000 (22:54 +0100)]
Avoid null pointer dereference.

5 years agosurf_parse_error() never returns, remove dead code after that.
Arnaud Giersch [Tue, 26 Feb 2019 20:34:27 +0000 (21:34 +0100)]
surf_parse_error() never returns, remove dead code after that.

5 years agoRemove dead code after exception throw.
Arnaud Giersch [Tue, 26 Feb 2019 20:32:47 +0000 (21:32 +0100)]
Remove dead code after exception throw.

5 years agoRemove dead code after returrn statement.
Arnaud Giersch [Tue, 26 Feb 2019 20:30:42 +0000 (21:30 +0100)]
Remove dead code after returrn statement.

5 years agoMethod is redundant with base class.
Arnaud Giersch [Tue, 26 Feb 2019 16:29:07 +0000 (17:29 +0100)]
Method is redundant with base class.

5 years agoMark methods as "override".
Arnaud Giersch [Tue, 26 Feb 2019 16:28:41 +0000 (17:28 +0100)]
Mark methods as "override".

5 years agoCapitalize constants.
Arnaud Giersch [Tue, 26 Feb 2019 16:47:53 +0000 (17:47 +0100)]
Capitalize constants.

5 years agoReplace #define with constexpr declarations.
Arnaud Giersch [Tue, 26 Feb 2019 16:23:29 +0000 (17:23 +0100)]
Replace #define with constexpr declarations.

5 years agoKill unused constants.
Arnaud Giersch [Tue, 26 Feb 2019 16:44:17 +0000 (17:44 +0100)]
Kill unused constants.

5 years agofix (#220) ?
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).

Hopefully, this commit does not cause new leaks.

5 years agomake MSG_process_create die if host is off.
Frederic Suter [Wed, 27 Feb 2019 08:31:17 +0000 (09:31 +0100)]
make MSG_process_create die if host is off.
This was requested by adsein long time ago.

5 years agofix typos in warning
Frederic Suter [Wed, 27 Feb 2019 08:15:11 +0000 (09:15 +0100)]
fix typos in warning

5 years agoChange color of "barrier" in trace. It was too close to "computing"
degomme [Tue, 26 Feb 2019 12:07:45 +0000 (13:07 +0100)]
Change color of "barrier" in trace. It was too close to "computing"

5 years agoAdd simple gemm example for SMPI with sampling macros.
degomme [Tue, 26 Feb 2019 10:59:36 +0000 (11:59 +0100)]
Add simple gemm example for SMPI with sampling macros.
Adapted from the proxy app from Codevault.
This could be a good basis for the tuto

5 years agoYet again change the way SMPI_SAMPLE_MACRO works
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.

5 years agofix (#324)
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)

5 years agoBuild still broken with ld 2.31.1. Check only version for gcc.
Arnaud Giersch [Mon, 25 Feb 2019 22:22:10 +0000 (23:22 +0100)]
Build still broken with ld 2.31.1.  Check only version for gcc.

5 years ago[sonar] Improve Cognitive Complexity.
Arnaud Giersch [Mon, 25 Feb 2019 13:58:10 +0000 (14:58 +0100)]
[sonar] Improve Cognitive Complexity.

5 years agoNO_MAX_DURATION is a special value, use (in)equality for testing.
Arnaud Giersch [Mon, 25 Feb 2019 13:39:22 +0000 (14:39 +0100)]
NO_MAX_DURATION is a special value, use (in)equality for testing.

5 years agoMove common test to Action::update_max_duration.
Arnaud Giersch [Mon, 25 Feb 2019 13:20:22 +0000 (14:20 +0100)]
Move common test to Action::update_max_duration.

5 years agoKill now unused functions SIMIX_mutex_{un}ref.
Arnaud Giersch [Sat, 23 Feb 2019 13:31:46 +0000 (14:31 +0100)]
Kill now unused functions SIMIX_mutex_{un}ref.

5 years agoConvert last call to SIMIX_mutex_unref.
Arnaud Giersch [Sat, 23 Feb 2019 13:31:16 +0000 (14:31 +0100)]
Convert last call to SIMIX_mutex_unref.

5 years agofix last issues
Frederic Suter [Mon, 25 Feb 2019 18:09:49 +0000 (19:09 +0100)]
fix last issues
+ counter_ is used by heaps, use id_ instead
+ fix dumb find/replace

5 years agoend objectification of MSG tasks
Frederic Suter [Mon, 25 Feb 2019 16:10:19 +0000 (17:10 +0100)]
end objectification of MSG tasks

5 years agomv counter from msg_task_t to simgrid::msg::Task
Frederic Suter [Mon, 25 Feb 2019 15:48:49 +0000 (16:48 +0100)]
mv counter from msg_task_t to simgrid::msg::Task
this was the last field, MSG tasks are now objects
have to remove the useless layer now!

5 years agomv data from msg_task_t to simgrid::msg::Task
Frederic Suter [Mon, 25 Feb 2019 15:30:39 +0000 (16:30 +0100)]
mv data from msg_task_t to simgrid::msg::Task

5 years agosimplify these tests
Frederic Suter [Mon, 25 Feb 2019 15:14:00 +0000 (16:14 +0100)]
simplify these tests

5 years agomv category from msg_task_t to simgrid::msg::Task
Frederic Suter [Mon, 25 Feb 2019 14:48:36 +0000 (15:48 +0100)]
mv category from msg_task_t to simgrid::msg::Task

5 years agomove name from msg_task_t to simgrid::msg::Task
Frederic Suter [Mon, 25 Feb 2019 14:19:50 +0000 (15:19 +0100)]
move name from msg_task_t to simgrid::msg::Task

5 years agodo not promote bad practices: use "accessor" to get task name
Frederic Suter [Mon, 25 Feb 2019 14:16:32 +0000 (15:16 +0100)]
do not promote bad practices: use "accessor" to get task name

5 years agoobjectify simdata_task_t
Frederic Suter [Mon, 25 Feb 2019 13:16:57 +0000 (14:16 +0100)]
objectify simdata_task_t

5 years agopriority and bound of MSG tasks can only be set BEFORE execution
Frederic Suter [Mon, 25 Feb 2019 10:44:47 +0000 (11:44 +0100)]
priority and bound of MSG tasks can only be set BEFORE execution

this is the rule for S4U, should be the same for MSG.
BTW, the behavior of the LMM is likely to be confused by such dynamic
changes during execution.

Side effect: we should remove the setters in ExecImpl, but there are
used by two simcalls that are tagged as deprected with v3.25

5 years agosource is sender's host. One field is enough
Frederic Suter [Mon, 25 Feb 2019 10:28:36 +0000 (11:28 +0100)]
source is sender's host. One field is enough

5 years agoplay with (parallel) execs. still not satisfying
Frederic Suter [Sat, 23 Feb 2019 12:46:01 +0000 (13:46 +0100)]
play with (parallel) execs. still not satisfying

5 years agoSIMIX_mutex_{un}ref become MutexImpl::{un}ref
Frederic Suter [Sat, 23 Feb 2019 11:27:27 +0000 (12:27 +0100)]
SIMIX_mutex_{un}ref become MutexImpl::{un}ref

5 years agodont call HANDLER
Frederic Suter [Sat, 23 Feb 2019 11:27:13 +0000 (12:27 +0100)]
dont call HANDLER

5 years agoplease sonar
Frederic Suter [Sat, 23 Feb 2019 11:13:13 +0000 (12:13 +0100)]
please sonar

5 years agoMerge branch 'master' of framagit.org:simgrid/simgrid
Arnaud Giersch [Fri, 22 Feb 2019 21:28:57 +0000 (22:28 +0100)]
Merge branch 'master' of framagit.org:simgrid/simgrid

5 years agomake destructor public
Frederic Suter [Fri, 22 Feb 2019 21:15:05 +0000 (22:15 +0100)]
make destructor public

5 years agoFix build error with mingw.
Arnaud Giersch [Fri, 22 Feb 2019 21:07:01 +0000 (22:07 +0100)]
Fix build error with mingw.

5 years agodo not use xbt_mutex_t in SMPI
Frederic Suter [Fri, 22 Feb 2019 20:32:54 +0000 (21:32 +0100)]
do not use xbt_mutex_t in SMPI

5 years agoconvert maestro-set to S4U
Frederic Suter [Fri, 22 Feb 2019 18:13:15 +0000 (19:13 +0100)]
convert maestro-set to S4U

5 years agodumb me.
Frederic Suter [Fri, 22 Feb 2019 14:55:50 +0000 (15:55 +0100)]
dumb me.

5 years agodeprecate SIMIX_process_{a,de}tach
Frederic Suter [Fri, 22 Feb 2019 13:14:07 +0000 (14:14 +0100)]
deprecate SIMIX_process_{a,de}tach
* replaced by ActorImpl::{a,de}tach
* add sg_actor_{a,de}tach to the C API of actors
* MSG_process_{a,de}tach go to msg_legacy

5 years agoforgot that one
Frederic Suter [Fri, 22 Feb 2019 13:04:04 +0000 (14:04 +0100)]
forgot that one

5 years agostop using old simcalls in our own code
Frederic Suter [Fri, 22 Feb 2019 12:15:37 +0000 (13:15 +0100)]
stop using old simcalls in our own code

5 years agosnake casing
Frederic Suter [Fri, 22 Feb 2019 11:43:27 +0000 (12:43 +0100)]
snake casing

5 years agotrim instr_msg code
Frederic Suter [Fri, 22 Feb 2019 11:29:42 +0000 (12:29 +0100)]
trim instr_msg code

5 years agouse TASK_CANCELED rather than HOST_FAILURE for CancelExeption
Frederic Suter [Fri, 22 Feb 2019 11:28:01 +0000 (12:28 +0100)]
use TASK_CANCELED rather than HOST_FAILURE for CancelExeption

5 years agoMerge branch 'master' of https://framagit.org/simgrid/simgrid
Frederic Suter [Fri, 22 Feb 2019 11:08:29 +0000 (12:08 +0100)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid

5 years agoThrow exception when comm was canceled.
Arnaud Giersch [Fri, 22 Feb 2019 10:03:56 +0000 (11:03 +0100)]
Throw exception when comm was canceled.

5 years agoHandle CancelException in MSG_{comm,test} too.
Arnaud Giersch [Fri, 22 Feb 2019 10:02:35 +0000 (11:02 +0100)]
Handle CancelException in MSG_{comm,test} too.

5 years agoMSG is a C API and should not throw.
Arnaud Giersch [Fri, 22 Feb 2019 10:01:45 +0000 (11:01 +0100)]
MSG is a C API and should not throw.

5 years agoremove doublons caused by extra pop
Frederic Suter [Thu, 21 Feb 2019 20:47:17 +0000 (21:47 +0100)]
remove doublons caused by extra pop

5 years agoremove useless code
Frederic Suter [Thu, 21 Feb 2019 20:36:20 +0000 (21:36 +0100)]
remove useless code
this is handled by callbacks in instr-platform now

5 years agoMerge branch 'master' of https://framagit.org/simgrid/simgrid
Frederic Suter [Thu, 21 Feb 2019 19:32:54 +0000 (20:32 +0100)]
Merge branch 'master' of https://framagit.org/simgrid/simgrid