From: Arnaud Giersch Date: Tue, 17 Aug 2021 19:01:54 +0000 (+0200) Subject: Pleases somewhat codefactor.io, lgtm, and pvs-studio. X-Git-Tag: v3.29~126^2~15 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2e36738d8ecb3284664acc4d4ee141362c4bf8d1 Pleases somewhat codefactor.io, lgtm, and pvs-studio. --- diff --git a/docs/source/tuto_disk/Dockerfile b/docs/source/tuto_disk/Dockerfile index c496185675..5a58b42ab8 100644 --- a/docs/source/tuto_disk/Dockerfile +++ b/docs/source/tuto_disk/Dockerfile @@ -1,30 +1,26 @@ FROM debian:10.10-slim -RUN echo " \ - deb [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian/20210707T150931Z/ buster main contrib non-free \n\ - deb-src [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian/20210707T150931Z/ buster main contrib non-free \n\ - deb [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian-security/20210707T150931Z/ buster/updates main contrib non-free \n\ - deb-src [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian-security/20210707T150931Z/ buster/updates main contrib non-free" > /etc/apt/sources.list - -RUN apt-get -o Acquire::Check-Valid-Until=false update; - +RUN printf '%s\n' \ + "deb [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian/20210707T150931Z/ buster main contrib non-free" \ + "deb-src [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian/20210707T150931Z/ buster main contrib non-free" \ + "deb [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian-security/20210707T150931Z/ buster/updates main contrib non-free" \ + "deb-src [check-valid-until=no, trusted=yes] http://snapshot.debian.org/archive/debian-security/20210707T150931Z/ buster/updates main contrib non-free" > /etc/apt/sources.list \ +&& \ + apt-get -o Acquire::Check-Valid-Until=false update \ +&& \ + apt-get install -y --no-install-recommends \ # emacs -RUN apt-get install -y \ emacs \ ess \ - elpa-htmlize - + elpa-htmlize \ # R -RUN apt-get install -y \ r-base-core \ r-cran-ggplot2 \ r-cran-dplyr \ r-cran-plyr \ r-cran-jsonlite \ - r-cran-gridextra - + r-cran-gridextra \ # simgrid dependencies -RUN apt install -y \ g++ \ gcc \ git \ @@ -33,12 +29,11 @@ RUN apt install -y \ libboost-dev \ libboost-all-dev \ cmake \ - dpkg-dev - -RUN apt-get install -y \ - curl - -RUN apt-get clean \ + dpkg-dev \ +# misc tools + curl \ +&& \ + apt-get clean \ && rm -rf /var/lib/apt/lists/* # install ox-rst to convert org to rst diff --git a/docs/source/tuto_disk/tuto_disk.cpp b/docs/source/tuto_disk/tuto_disk.cpp index c84dc16a18..d64b98fae2 100644 --- a/docs/source/tuto_disk/tuto_disk.cpp +++ b/docs/source/tuto_disk/tuto_disk.cpp @@ -119,7 +119,6 @@ static double disk_variability(const std::unordered_mapsecond.get_value() * 1e6; double write_bw = pt.get_child("write_bw").begin()->second.get_value() * 1e6; auto* disk = host->create_disk(disk_name, read_bw, write_bw); diff --git a/examples/python/clusters-multicpu/clusters-multicpu.py b/examples/python/clusters-multicpu/clusters-multicpu.py index 53feb77cf3..8184228620 100644 --- a/examples/python/clusters-multicpu/clusters-multicpu.py +++ b/examples/python/clusters-multicpu/clusters-multicpu.py @@ -56,7 +56,7 @@ class Receiver: ##################################################################################################### -def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> typing.Tuple[simgrid.NetPoint, simgrid.NetPoint]: +def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], ident: int) -> typing.Tuple[simgrid.NetPoint, simgrid.NetPoint]: """ Callback to set a cluster leaf/element @@ -77,7 +77,7 @@ def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> :param zone: Cluster netzone being created (usefull to create the hosts/links inside it) :param coord: Coordinates in the cluster - :param id: Internal identifier in the torus (for information) + :param ident: Internal identifier in the torus (for information) :return netpoint, gateway: the netpoint to the StarZone and CPU0 as gateway """ num_cpus = 8 # Number of CPUs in the zone @@ -85,7 +85,7 @@ def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> link_bw = "100GBps" # Link bw connecting the CPU link_lat = "1ns" # Link latency - hostname = "host" + str(id) + hostname = "host" + str(ident) # create the StarZone host_zone = simgrid.NetZone.create_star_zone(hostname) # setting my Torus parent zone @@ -113,13 +113,13 @@ def create_hostzone(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> ##################################################################################################### -def create_limiter(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> simgrid.Link: +def create_limiter(zone: simgrid.NetZone, coord: typing.List[int], ident: int) -> simgrid.Link: """ Callback to create limiter link (1Gbs) for each netpoint The coord parameter depends on the cluster being created: - Torus: Direct translation of the Torus' dimensions, e.g. (0, 0, 0) for a 3-D Torus - - Fat-Tree: A pair (level in the tree, id), e.g. (0, 0) for first leaf in the tree and (1,0) for the first switch at + - Fat-Tree: A pair (level in the tree, ident), e.g. (0, 0) for first leaf in the tree and (1,0) for the first switch at level 1. - Dragonfly: a tuple (group, chassis, blades/routers, nodes), e.g. (0, 0, 0, 0) for first node in the cluster. To identify the router inside a (group, chassis, blade), we use MAX_UINT in the last parameter (e.g. 0, 0, 0, @@ -127,10 +127,10 @@ def create_limiter(zone: simgrid.NetZone, coord: typing.List[int], id: int) -> s :param zone: Torus netzone being created (usefull to create the hosts/links inside it) :param coord: Coordinates in the cluster - :param id: Internal identifier in the torus (for information) + :param ident: Internal identifier in the torus (for information) :return: Limiter link """ - return zone.create_link("limiter-" + str(id), [1e9]).seal() + return zone.create_link("limiter-" + str(ident), [1e9]).seal() def create_torus_cluster(): diff --git a/include/xbt/log.h b/include/xbt/log.h index 50b99cf58e..188944ab83 100644 --- a/include/xbt/log.h +++ b/include/xbt/log.h @@ -91,9 +91,7 @@ typedef enum { void _XBT_LOGV_CTOR(catName)(void) \ { \ XBT_LOG_EXTERNAL_CATEGORY(catName); \ - if (!_XBT_LOGV(catName).initialized) { \ - _xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \ - } \ + (void)_xbt_log_cat_init(&_XBT_LOGV(catName), xbt_log_priority_uninitialized); \ } \ XBT_EXPORT_NO_IMPORT s_xbt_log_category_t _XBT_LOGV(catName) = { \ &_XBT_LOGV(parent), \ diff --git a/src/mc/inspect/DwarfExpression.cpp b/src/mc/inspect/DwarfExpression.cpp index 20e776171b..52a6370d14 100644 --- a/src/mc/inspect/DwarfExpression.cpp +++ b/src/mc/inspect/DwarfExpression.cpp @@ -78,7 +78,7 @@ void execute(const Dwarf_Op* ops, std::size_t n, const ExpressionContext& contex // Pop/drop the top of the stack: case DW_OP_drop: - stack.pop(); + (void)stack.pop(); break; case DW_OP_swap: diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 3798706186..2938475731 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -107,7 +107,7 @@ void AppSide::handle_actor_enabled(const s_mc_message_actor_enabled_t* msg) cons { bool res = mc::actor_is_enabled(kernel::actor::ActorImpl::by_pid(msg->aid)); s_mc_message_int_t answer{MessageType::ACTOR_ENABLED_REPLY, res}; - channel_.send(answer); + xbt_assert(channel_.send(answer) == 0, "Could not send ACTOR_ENABLED_REPLY"); } #define assert_msg_size(_name_, _type_) \ diff --git a/teshsuite/python/platform-mix/platform-mix.py b/teshsuite/python/platform-mix/platform-mix.py index ca018a7d17..2ca7f619ca 100644 --- a/teshsuite/python/platform-mix/platform-mix.py +++ b/teshsuite/python/platform-mix/platform-mix.py @@ -3,9 +3,8 @@ # 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. -from simgrid import Actor, Engine, Comm, Host, Mailbox, NetZone, Link, LinkInRoute, this_actor +from simgrid import Actor, Engine, Host, Mailbox, NetZone, LinkInRoute, this_actor import sys -import functools class Sender: """