Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simgrid.git
3 years agoNetZone::get_netpoint: gets the netzone's netpoint
Bruno Donassolo [Wed, 21 Apr 2021 18:35:03 +0000 (20:35 +0200)]
NetZone::get_netpoint: gets the netzone's netpoint

New method to get the netpoint used by netzones.
Usefull when describing routes using the netzones (add_route method)

3 years agoAdd some UT for TorusZone
Bruno Donassolo [Wed, 21 Apr 2021 10:02:25 +0000 (12:02 +0200)]
Add some UT for TorusZone

Improve some checks.

3 years agoNew: s4u::create_torus_zone
Bruno Donassolo [Mon, 19 Apr 2021 17:30:26 +0000 (19:30 +0200)]
New: s4u::create_torus_zone

Implements the builder method for Torus zones

NetZone* create_torus_zone(const std::string& name, const NetZone* parent, const std::vector<unsigned int>& dimensions,
                           double bandwidth, double latency, Link::SharingPolicy sharing_policy,
                           const std::function<TorusNetPointCb>& set_netpoint,
                           const std::function<TorusLinkCb>& set_loopback = {},
                           const std::function<TorusLinkCb>& set_limiter  = {});

This builder method allow us to keep hiding the internals of our
NetZones, exporting only a NetZone* to the end-user.

It uses callbacks functions to populate the leaves in the Torus, 3
callbacks can be used:
- set_netpoint: must return a pair NetPoint,Gateway. This allows us to
have complex netzones under each leaf
- set_loopback: The link used to loopback communications
- set_limiter: A limiter link for each leaf

The links inside the Torus are homogeneous and described by the
bandwidth, latency and sharing policy parameters.

As the creation of resources are linked to the netzones (create_host,
create_link functions), we have to add the parent parameter to the
builder function. Otherwise, the user cannot create the resources
associated with the leaves in the callbacks.

Obs.: By now, the sg_platf.cpp isn't using this new builder method.
It will be changed once we have implemented the builder for every
cluster type (fatree, dragonfly).

3 years agoRename VirtualMachine::get_impl() to not hide Host::get_impl().
Arnaud Giersch [Fri, 23 Apr 2021 07:47:07 +0000 (09:47 +0200)]
Rename VirtualMachine::get_impl() to not hide Host::get_impl().

3 years agoMake SIMIX_simcall_name() use the type of observer_ if it exists.
Arnaud Giersch [Thu, 22 Apr 2021 20:45:52 +0000 (22:45 +0200)]
Make SIMIX_simcall_name() use the type of observer_ if it exists.

It gives more information about the kind of simcall being involved,
since most simcalls are nowadays of type RUN_KERNEL or RUN_BLOCKING.

3 years agoUse std::string::rfind to match string prefix.
Arnaud Giersch [Thu, 22 Apr 2021 20:27:08 +0000 (22:27 +0200)]
Use std::string::rfind to match string prefix.

3 years agoUnused #include.
Arnaud Giersch [Thu, 22 Apr 2021 20:17:25 +0000 (22:17 +0200)]
Unused #include.

3 years agoRaise exception for invalid parameters in StarZone
Bruno Donassolo [Thu, 22 Apr 2021 16:47:15 +0000 (18:47 +0200)]
Raise exception for invalid parameters in StarZone

We've talked about using exceptions for invalid parameters in user'
calls.
Adjust for StarZone.
Bonus: We can test it in UT with catch

3 years ago[sonar] Implicit casts should not lower precision.
Arnaud Giersch [Thu, 22 Apr 2021 13:37:36 +0000 (15:37 +0200)]
[sonar] Implicit casts should not lower precision.

3 years agoUse type aid_t for actor ids.
Arnaud Giersch [Thu, 22 Apr 2021 10:55:32 +0000 (12:55 +0200)]
Use type aid_t for actor ids.

3 years agoFactor code for simcall observers with a result.
Arnaud Giersch [Wed, 21 Apr 2021 10:39:19 +0000 (12:39 +0200)]
Factor code for simcall observers with a result.

3 years agoCosmetics: make parameter name match with .hpp.
Arnaud Giersch [Wed, 21 Apr 2021 08:57:07 +0000 (10:57 +0200)]
Cosmetics: make parameter name match with .hpp.

3 years agoFactor Activity::wait() and wait_for() through CRTP.
Arnaud Giersch [Wed, 21 Apr 2021 22:02:17 +0000 (00:02 +0200)]
Factor Activity::wait() and wait_for() through CRTP.

3 years agoFactor Activity::cancel() through CRTP.
Arnaud Giersch [Wed, 21 Apr 2021 21:38:18 +0000 (23:38 +0200)]
Factor Activity::cancel() through CRTP.

3 years agoComm::test() is ready to be merged with Activity::test().
Arnaud Giersch [Wed, 21 Apr 2021 21:22:58 +0000 (23:22 +0200)]
Comm::test() is ready to be merged with Activity::test().

3 years agoDefine overridable Activity::complete() to be called on activity completion.
Arnaud Giersch [Wed, 21 Apr 2021 07:57:56 +0000 (09:57 +0200)]
Define overridable Activity::complete() to be called on activity completion.

This adds some assignments of State::FINISHED, but it looks like they were
previously forgotten.  No test is broken.

3 years agoFix TorusZone with limiter links
Bruno Donassolo [Wed, 21 Apr 2021 15:57:05 +0000 (17:57 +0200)]
Fix TorusZone with limiter links

Raises an std::out_of_range exception when it tries to add the limiter
link to routes.

Example:
    <cluster id="bob_cluster" topology="TORUS" topo_parameters="3,2,2"
     prefix="node-" radical="0-11" suffix=".simgrid.org"
     speed="1Gf" bw="125MBps" lat="50us"
     loopback_bw="100MBps" loopback_lat="0" limiter_link="100MBps"/>

Not sure if someone uses this limiter. We don't have any test that uses limiter_link tag inside a
TORUS cluster. It'll be added in with the new C++ interface.

3 years agoReduce scope for variable.
Arnaud Giersch [Tue, 20 Apr 2021 19:35:42 +0000 (21:35 +0200)]
Reduce scope for variable.

3 years agoGlobal--.
Arnaud Giersch [Tue, 20 Apr 2021 13:20:36 +0000 (15:20 +0200)]
Global--.

3 years agoAnother bunch of int -> size_t conversion.
Arnaud Giersch [Tue, 20 Apr 2021 12:58:05 +0000 (14:58 +0200)]
Another bunch of int -> size_t conversion.

3 years agoaid_t for src and dst in smpi::Request.
Arnaud Giersch [Tue, 20 Apr 2021 09:29:38 +0000 (11:29 +0200)]
aid_t for src and dst in smpi::Request.

3 years agoConvert some int -> size_t.
Arnaud Giersch [Tue, 20 Apr 2021 08:03:15 +0000 (10:03 +0200)]
Convert some int -> size_t.

3 years agoPrefer emplace to insert.
Arnaud Giersch [Tue, 20 Apr 2021 07:39:45 +0000 (09:39 +0200)]
Prefer emplace to insert.

3 years agoFor Sonar.
Arnaud Giersch [Tue, 20 Apr 2021 07:22:31 +0000 (09:22 +0200)]
For Sonar.

3 years agoMore aid_t.
Arnaud Giersch [Tue, 20 Apr 2021 07:19:32 +0000 (09:19 +0200)]
More aid_t.

3 years agoAvoid alternative keywords for boolean expressions.
Arnaud Giersch [Tue, 20 Apr 2021 07:09:51 +0000 (09:09 +0200)]
Avoid alternative keywords for boolean expressions.

Plus slight simplifications.

3 years agoReference for std::vector parameters.
Arnaud Giersch [Mon, 19 Apr 2021 20:47:58 +0000 (22:47 +0200)]
Reference for std::vector parameters.

3 years agoFix bound checking.
Arnaud Giersch [Mon, 19 Apr 2021 20:28:41 +0000 (22:28 +0200)]
Fix bound checking.

3 years agoCombine identical conditions.
Arnaud Giersch [Mon, 19 Apr 2021 20:19:41 +0000 (22:19 +0200)]
Combine identical conditions.

3 years agoUse std algorithm.
Arnaud Giersch [Mon, 19 Apr 2021 20:16:07 +0000 (22:16 +0200)]
Use std algorithm.

3 years agoUseless indirection.
Arnaud Giersch [Mon, 19 Apr 2021 20:09:58 +0000 (22:09 +0200)]
Useless indirection.

3 years agoSonar const's...
Arnaud Giersch [Mon, 19 Apr 2021 20:02:38 +0000 (22:02 +0200)]
Sonar const's...

3 years agoConvert int -> size_t for TRACE_smpi_send (and below).
Arnaud Giersch [Mon, 19 Apr 2021 19:52:14 +0000 (21:52 +0200)]
Convert int -> size_t for TRACE_smpi_send (and below).

3 years agoMore int -> aid_t.
Arnaud Giersch [Mon, 19 Apr 2021 19:08:54 +0000 (21:08 +0200)]
More int -> aid_t.

3 years agoUse type aid_t for process id. in instr_smpi.
Arnaud Giersch [Mon, 19 Apr 2021 16:32:58 +0000 (18:32 +0200)]
Use type aid_t for process id. in instr_smpi.

3 years agoAdapt leak example to new display.
Augustin Degomme [Mon, 19 Apr 2021 14:07:52 +0000 (16:07 +0200)]
Adapt leak example to new display.
Add another leak and a size change between processes to see what it shows.

3 years agoGroup buffer leaks by origin as well.
Augustin Degomme [Mon, 19 Apr 2021 14:06:55 +0000 (16:06 +0200)]
Group buffer leaks by origin as well.
Keep total size and min/max for each if possible, then display by largest total size.

3 years agoPlug memory leak.
Arnaud Giersch [Mon, 19 Apr 2021 13:55:40 +0000 (15:55 +0200)]
Plug memory leak.

3 years agoConst, once again.
Arnaud Giersch [Mon, 19 Apr 2021 08:16:14 +0000 (10:16 +0200)]
Const, once again.

3 years agoDoc improvement [ci-skip]
Martin Quinson [Mon, 19 Apr 2021 10:54:35 +0000 (12:54 +0200)]
Doc improvement [ci-skip]

3 years agoMerge branch 'master' of framagit.org:simgrid/simgrid
Martin Quinson [Mon, 19 Apr 2021 10:35:48 +0000 (12:35 +0200)]
Merge branch 'master' of framagit.org:simgrid/simgrid

3 years agoFinally rename smpi::Group::actor_pid() back to actor().
Arnaud Giersch [Sun, 18 Apr 2021 19:25:37 +0000 (21:25 +0200)]
Finally rename smpi::Group::actor_pid() back to actor().

3 years agoKill smpi::Group::rank(s4u::Actor*).
Arnaud Giersch [Sun, 18 Apr 2021 19:14:49 +0000 (21:14 +0200)]
Kill smpi::Group::rank(s4u::Actor*).

3 years agoKill smpi::Group::actor(int).
Arnaud Giersch [Sun, 18 Apr 2021 17:01:49 +0000 (19:01 +0200)]
Kill smpi::Group::actor(int).

3 years agoChange smpi::Group::set_mapping to take a pid.
Arnaud Giersch [Sun, 18 Apr 2021 14:29:22 +0000 (16:29 +0200)]
Change smpi::Group::set_mapping to take a pid.

3 years agoAdd assert's to ensure consistency between the two kinds of mapping.
Arnaud Giersch [Sun, 18 Apr 2021 13:25:41 +0000 (15:25 +0200)]
Add assert's to ensure consistency between the two kinds of mapping.

3 years agoDefine new rank_to_pid_map_.
Arnaud Giersch [Sun, 18 Apr 2021 12:50:09 +0000 (14:50 +0200)]
Define new rank_to_pid_map_.

3 years agoLookup for parent process (like in Group::rank(s4u::Actor*).
Arnaud Giersch [Sun, 18 Apr 2021 13:19:44 +0000 (15:19 +0200)]
Lookup for parent process (like in Group::rank(s4u::Actor*).

3 years agoIn smpi::Group, 'index' is in fact a PID. Fix type and rename.
Arnaud Giersch [Sun, 18 Apr 2021 09:29:36 +0000 (11:29 +0200)]
In smpi::Group, 'index' is in fact a PID. Fix type and rename.

3 years agoKill a TODO (-1 is correct for an invalid PID).
Arnaud Giersch [Sun, 18 Apr 2021 19:19:38 +0000 (21:19 +0200)]
Kill a TODO (-1 is correct for an invalid PID).

3 years agoMPI_SOURCE is a rank; src_traced should be a PID.
Arnaud Giersch [Sun, 18 Apr 2021 09:53:53 +0000 (11:53 +0200)]
MPI_SOURCE is a rank; src_traced should be a PID.

3 years agoFix comment.
Arnaud Giersch [Sun, 18 Apr 2021 09:38:55 +0000 (11:38 +0200)]
Fix comment.

3 years agoPass large parameter by const reference.
Arnaud Giersch [Sun, 18 Apr 2021 08:32:08 +0000 (10:32 +0200)]
Pass large parameter by const reference.

3 years agoMinor cleanups (useless stuff).
Arnaud Giersch [Sat, 17 Apr 2021 19:12:19 +0000 (21:12 +0200)]
Minor cleanups (useless stuff).

3 years agoalso requalify mc version of the tesh
Augustin Degomme [Sun, 18 Apr 2021 10:22:44 +0000 (12:22 +0200)]
also requalify mc version of the tesh

3 years agoGroup leak reports by type/file/line (for handles, will see for buffer later).
Augustin Degomme [Sun, 18 Apr 2021 09:54:44 +0000 (11:54 +0200)]
Group leak reports by type/file/line (for handles, will see for buffer later).
And split reporting.

3 years agoSonar polishing.
Arnaud Giersch [Sat, 17 Apr 2021 09:21:27 +0000 (11:21 +0200)]
Sonar polishing.

3 years agoPointer-to-const parameters in smpi::Group.
Arnaud Giersch [Sat, 17 Apr 2021 08:56:54 +0000 (10:56 +0200)]
Pointer-to-const parameters in smpi::Group.

3 years agoReduce code duplication (and fix bug in Group::difference).
Arnaud Giersch [Sat, 17 Apr 2021 08:52:12 +0000 (10:52 +0200)]
Reduce code duplication (and fix bug in Group::difference).

3 years agoA for-loop with 'num' modified in the body is too complex according to Sonar.
Arnaud Giersch [Fri, 16 Apr 2021 22:11:41 +0000 (00:11 +0200)]
A for-loop with 'num' modified in the body is too complex according to Sonar.

3 years agoFix smpi::Group::intersection().
Arnaud Giersch [Fri, 16 Apr 2021 21:26:14 +0000 (23:26 +0200)]
Fix smpi::Group::intersection().

Using 'size2' for controlling the first loop was a bug (spotted by Sonar).

3 years agoFix Group::group_union().
Arnaud Giersch [Fri, 16 Apr 2021 21:21:02 +0000 (23:21 +0200)]
Fix Group::group_union().

Included ranks from group2 were not good.

3 years agoSimplify smpi::Group::difference().
Arnaud Giersch [Fri, 16 Apr 2021 21:36:00 +0000 (23:36 +0200)]
Simplify smpi::Group::difference().

3 years agoReview smpi::Group::*excl() and smpi::Group::*incl().
Arnaud Giersch [Fri, 16 Apr 2021 19:41:27 +0000 (21:41 +0200)]
Review smpi::Group::*excl() and smpi::Group::*incl().

Mostly cosmetic changes.

3 years agoKill redundant member 'size_' from smpi::Group.
Arnaud Giersch [Fri, 16 Apr 2021 20:51:42 +0000 (22:51 +0200)]
Kill redundant member 'size_' from smpi::Group.

3 years agoMinor changes in smpi::Group.
Arnaud Giersch [Fri, 16 Apr 2021 16:32:28 +0000 (18:32 +0200)]
Minor changes in smpi::Group.

3 years agoRemove unused option from example.
Arnaud Giersch [Fri, 16 Apr 2021 19:26:02 +0000 (21:26 +0200)]
Remove unused option from example.

3 years agoSimplify loop searching for a bypass route.
Arnaud Giersch [Fri, 16 Apr 2021 14:09:05 +0000 (16:09 +0200)]
Simplify loop searching for a bypass route.

3 years agoPrefer a do-while in this case, and rewrite without 'break'.
Arnaud Giersch [Fri, 16 Apr 2021 12:59:10 +0000 (14:59 +0200)]
Prefer a do-while in this case, and rewrite without 'break'.

3 years agoUse std::find_if when looking for a matching comm.
Arnaud Giersch [Fri, 16 Apr 2021 12:29:23 +0000 (14:29 +0200)]
Use std::find_if when looking for a matching comm.

3 years agoReplace C-style arrays and remove const_cast.
Arnaud Giersch [Fri, 16 Apr 2021 09:29:22 +0000 (11:29 +0200)]
Replace C-style arrays and remove const_cast.

Define local class EngineWrapper to encapsulate common code.

3 years agoUse const& for std::string parameters.
Arnaud Giersch [Fri, 16 Apr 2021 08:59:45 +0000 (10:59 +0200)]
Use const& for std::string parameters.

3 years agoPointer-to-const.
Arnaud Giersch [Thu, 15 Apr 2021 21:07:15 +0000 (23:07 +0200)]
Pointer-to-const.

3 years agoFix build with older clang.
Arnaud Giersch [Fri, 16 Apr 2021 13:23:17 +0000 (15:23 +0200)]
Fix build with older clang.

3 years agoplease clang take 2
SUTER Frederic [Fri, 16 Apr 2021 12:26:08 +0000 (14:26 +0200)]
please clang take 2

3 years agoplease clang
SUTER Frederic [Fri, 16 Apr 2021 12:15:08 +0000 (14:15 +0200)]
please clang

3 years agoSome code improvements.
Bruno Donassolo [Fri, 16 Apr 2021 10:33:57 +0000 (12:33 +0200)]
Some code improvements.

Avoid unnecessary map lookups.

Thanks @agiersch for the review

3 years agoadd wrappers with scalars on the user side
SUTER Frederic [Fri, 16 Apr 2021 10:05:38 +0000 (12:05 +0200)]
add wrappers with scalars on the user side

3 years agosimplification
SUTER Frederic [Thu, 15 Apr 2021 14:03:18 +0000 (16:03 +0200)]
simplification

3 years agocosmetics
SUTER Frederic [Thu, 15 Apr 2021 13:55:30 +0000 (15:55 +0200)]
cosmetics

3 years agocosmetics
SUTER Frederic [Tue, 13 Apr 2021 18:26:04 +0000 (20:26 +0200)]
cosmetics

3 years agos4u::NetZone::create_router.
Bruno Donassolo [Thu, 15 Apr 2021 13:33:43 +0000 (15:33 +0200)]
s4u::NetZone::create_router.

Export create_router to s4u so we can use in C++ platforms.

3 years agoPlease sonar, just a little
Bruno Donassolo [Thu, 15 Apr 2021 08:59:15 +0000 (10:59 +0200)]
Please sonar, just a little

3 years agoUse rule-of-three, and hope to please sonar without breaking clang13 builds.
Arnaud Giersch [Thu, 15 Apr 2021 07:43:35 +0000 (09:43 +0200)]
Use rule-of-three, and hope to please sonar without breaking clang13 builds.

3 years agoRevert "Delete the implicitely defined move constructor."
Arnaud Giersch [Wed, 14 Apr 2021 21:45:10 +0000 (23:45 +0200)]
Revert "Delete the implicitely defined move constructor."

This reverts commit c26d236dedf486357690800a0d5527871ef45620.

Clang 13 fails with "The specified type does not meet the requirements of
Cpp17MoveInsertable"

AFAICT, the std::deque makes a noexcept constructor impossible.

3 years agoFinally provide a noexcept move constructor.
Arnaud Giersch [Wed, 14 Apr 2021 21:30:54 +0000 (23:30 +0200)]
Finally provide a noexcept move constructor.

Previous commit (f7cf88e9b8 Delete the implicitely defined move constructor.)
was causing clang 13 to fail with: "The specified type does not meet the
requirements of Cpp17MoveInsertable".

3 years agoUse emplace_back to add a new property_set.
Arnaud Giersch [Wed, 14 Apr 2021 19:53:21 +0000 (21:53 +0200)]
Use emplace_back to add a new property_set.

Sonar S6003.

3 years agoMinor Sonar smells (const, etc).
Arnaud Giersch [Wed, 14 Apr 2021 19:37:50 +0000 (21:37 +0200)]
Minor Sonar smells (const, etc).

3 years agoMove a \n.
Arnaud Giersch [Wed, 14 Apr 2021 19:21:52 +0000 (21:21 +0200)]
Move a \n.

3 years agoDelete the implicitely defined move constructor.
Arnaud Giersch [Wed, 14 Apr 2021 14:13:59 +0000 (16:13 +0200)]
Delete the implicitely defined move constructor.

Fix for sonar issue S5018: Move and swap operations should be "noexcept"

3 years agoDisable copy for actor::ProcessArg.
Arnaud Giersch [Wed, 14 Apr 2021 12:21:14 +0000 (14:21 +0200)]
Disable copy for actor::ProcessArg.

Also fix sonar issue S5018: Move and swap operations should be "noexcept"

3 years agoDelete the implicitely defined move constructor.
Arnaud Giersch [Wed, 14 Apr 2021 11:22:58 +0000 (13:22 +0200)]
Delete the implicitely defined move constructor.

Fix for sonar issue S5018: Move and swap operations should be "noexcept"

Anyway, AFAICT, the implicit move constructor here does nothing more than the copy-constructor.

3 years agoSonar requires a comment for empty functions.
Arnaud Giersch [Wed, 14 Apr 2021 06:56:37 +0000 (08:56 +0200)]
Sonar requires a comment for empty functions.

3 years agoSimplify add_route methods.
Bruno Donassolo [Wed, 14 Apr 2021 15:53:28 +0000 (17:53 +0200)]
Simplify add_route methods.

Leave only one add_route method, as it was initially.
Deprecate old add_route which uses LinkImpl*, s4u is the interface we want
with user.

3 years agoVivaldi on top of StarZone
Bruno Donassolo [Mon, 12 Apr 2021 14:08:26 +0000 (16:08 +0200)]
Vivaldi on top of StarZone

Implement Vivaldi on top of StarZone.
This allows the easy usage of Vivaldi on C++ platforms (no need to
access specific methods from Vivaldi NetZone.

Platform creation from XML is unchanged.

3 years agoAdjust add_route to accept route between netzones
Bruno Donassolo [Tue, 13 Apr 2021 18:36:23 +0000 (20:36 +0200)]
Adjust add_route to accept route between netzones

3 years agoStarZone: implement get_graph method
Bruno Donassolo [Tue, 13 Apr 2021 15:24:11 +0000 (17:24 +0200)]
StarZone: implement get_graph method

Add get_graph for StarZone. A top node named with the zone's name is
created to be the center of the star.

3 years agoNew netzone: Star Zone
Bruno Donassolo [Fri, 9 Apr 2021 17:46:42 +0000 (19:46 +0200)]
New netzone: Star Zone

Implements a netzone following a star topology.
Components inside the Star topology are connected by default (through no
links), users can add routes using the NetZone::add_route method:
- netpoint -> nullptr(*): links used in all outgoing communications
- nullptr(*) -> netpoint: links used in all incoming communication
- netpoint -> netpoint: loopback

Duplicated links in a route inside the Star Zone are removed.

Added UTs for StarZone, some tests are disabled since they check the
xbt_assert and would stop the test execution.

3 years ago[ci-skip] Update lua tesh files with deprecation warning.
Arnaud Giersch [Tue, 13 Apr 2021 15:56:08 +0000 (17:56 +0200)]
[ci-skip] Update lua tesh files with deprecation warning.

3 years agoconstify
SUTER Frederic [Tue, 13 Apr 2021 15:31:00 +0000 (17:31 +0200)]
constify