From: Martin Quinson Date: Wed, 7 Feb 2018 10:24:51 +0000 (+0100) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3.19~244 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8a18a39ea4a00e51fc7c6d2f06a4c0c98fb79759?hp=21ef28ed4570559471a82d7799557741946b0420 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/doc/doxygen/inside_tests.doc b/doc/doxygen/inside_tests.doc index 38732f60b2..21d187f6d7 100644 --- a/doc/doxygen/inside_tests.doc +++ b/doc/doxygen/inside_tests.doc @@ -353,7 +353,7 @@ code scanners are provided as plugin. The one for C++ is not free, but open-source project can use it at no cost. That is what we are doing. Don't miss the great looking dashboard here: -https://nemo.sonarqube.org/overview?id=simgrid +https://sonarcloud.io/dashboard?id=simgrid This tool is enriched by the script @c tools/internal/travis-sonarqube.sh that is run from @c .travis.yml diff --git a/examples/s4u/app-bittorrent/s4u-tracker.cpp b/examples/s4u/app-bittorrent/s4u-tracker.cpp index 129667980e..b3f29a00fa 100644 --- a/examples/s4u/app-bittorrent/s4u-tracker.cpp +++ b/examples/s4u/app-bittorrent/s4u-tracker.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2012-2017. The SimGrid Team. +/* Copyright (c) 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -32,12 +32,13 @@ Tracker::Tracker(std::vector args) void Tracker::operator()() { simgrid::s4u::CommPtr comm = nullptr; - void* received; + void* received = nullptr; while (simgrid::s4u::Engine::getClock() < deadline) { if (comm == nullptr) comm = mailbox->get_async(&received); if (comm->test()) { // Retrieve the data sent by the peer. + xbt_assert(received != nullptr); TrackerQuery* tq = static_cast(received); // Add the peer to our peer list, if not already known. diff --git a/examples/s4u/dht-kademlia/node.cpp b/examples/s4u/dht-kademlia/node.cpp index 2bdd570b71..b5e10fec82 100644 --- a/examples/s4u/dht-kademlia/node.cpp +++ b/examples/s4u/dht-kademlia/node.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010, 2012-2017. The SimGrid Team. +/* Copyright (c) 2010, 2012-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -59,6 +59,7 @@ bool Node::join(unsigned int known_id) /* Second step: Send a FIND_NODE to a a random node in buckets */ unsigned int bucket_id = table->findBucket(known_id)->getId(); + xbt_assert(bucket_id <= identifier_size); for (i = 0; ((bucket_id > i) || (bucket_id + i) <= identifier_size) && i < JOIN_BUCKETS_QUERIES; i++) { if (bucket_id > i) { unsigned int id_in_bucket = get_id_in_prefix(id_, bucket_id - i); diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 21eaa19c75..6690dfca51 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -288,7 +288,6 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI retval = MPI_ERR_TAG; } else { int my_proc_id = simgrid::s4u::Actor::self()->getPid(); - int src_traced = getPid(comm, src); TRACE_smpi_comm_in(my_proc_id, __FUNCTION__, new simgrid::instr::Pt2PtTIData("recv", src, datatype->is_replayable() ? count : count * datatype->size(), @@ -299,7 +298,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI // the src may not have been known at the beginning of the recv (MPI_ANY_SOURCE) if (status != MPI_STATUS_IGNORE) { - src_traced = getPid(comm, status->MPI_SOURCE); + int src_traced = getPid(comm, status->MPI_SOURCE); if (not TRACE_smpi_view_internals()) { TRACE_smpi_recv(src_traced, my_proc_id, tag); } diff --git a/src/surf/plugins/host_dvfs.cpp b/src/surf/plugins/host_dvfs.cpp index 2f6a71839d..985d0d8c4d 100644 --- a/src/surf/plugins/host_dvfs.cpp +++ b/src/surf/plugins/host_dvfs.cpp @@ -40,6 +40,7 @@ public: double sampling_rate; explicit Governor(simgrid::s4u::Host* ptr) : host(ptr) { init(); } + virtual ~Governor() = default; void init() { @@ -89,7 +90,7 @@ public: * freq_next = min_f + load * (max_f - min_f) / 100 * * So they assume that frequency increases by 100 MHz. We will just use - * lowest_pstate - load*pstatesCount(); + * lowest_pstate - load*pstatesCount() */ int max_pstate = host->getPstatesCount() - 1; diff --git a/teshsuite/smpi/coll-allgather/coll-allgather.c b/teshsuite/smpi/coll-allgather/coll-allgather.c index 83ba94a2c3..e5bdc6fd7c 100644 --- a/teshsuite/smpi/coll-allgather/coll-allgather.c +++ b/teshsuite/smpi/coll-allgather/coll-allgather.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int rank; diff --git a/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c index 7e2f35e81a..5bef95a0b9 100644 --- a/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c +++ b/teshsuite/smpi/coll-allgatherv/coll-allgatherv.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int i; diff --git a/teshsuite/smpi/coll-allreduce/coll-allreduce.c b/teshsuite/smpi/coll-allreduce/coll-allreduce.c index c35732fce6..a15eb6060b 100644 --- a/teshsuite/smpi/coll-allreduce/coll-allreduce.c +++ b/teshsuite/smpi/coll-allreduce/coll-allreduce.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int rank; @@ -42,7 +37,6 @@ int main(int argc, char *argv[]) for (i = 0; i < size *mult; i++) printf("%d ", sb[i]); printf("]\n"); - status = MPI_Allreduce(sb, rb, size *maxlen, MPI_INT, MPI_SUM, MPI_COMM_WORLD); printf("[%d] rcvbuf=[", rank); diff --git a/teshsuite/smpi/coll-alltoall/coll-alltoall.c b/teshsuite/smpi/coll-alltoall/coll-alltoall.c index da76146ad3..85c5904fa6 100644 --- a/teshsuite/smpi/coll-alltoall/coll-alltoall.c +++ b/teshsuite/smpi/coll-alltoall/coll-alltoall.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2017. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int rank; diff --git a/teshsuite/smpi/coll-gather/coll-gather.c b/teshsuite/smpi/coll-gather/coll-gather.c index 6c593da19c..4d4b8dfe75 100644 --- a/teshsuite/smpi/coll-gather/coll-gather.c +++ b/teshsuite/smpi/coll-gather/coll-gather.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int rank; diff --git a/teshsuite/smpi/coll-reduce/coll-reduce.c b/teshsuite/smpi/coll-reduce/coll-reduce.c index f1e99c70b2..3cc84b882f 100644 --- a/teshsuite/smpi/coll-reduce/coll-reduce.c +++ b/teshsuite/smpi/coll-reduce/coll-reduce.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2010, 2013-2014. The SimGrid Team. +/* Copyright (c) 2009-2010, 2013-2018. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -10,11 +10,6 @@ #include #include "mpi.h" -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif - int main(int argc, char *argv[]) { int rank; diff --git a/teshsuite/smpi/mpich3-test/coll/coll13.c b/teshsuite/smpi/mpich3-test/coll/coll13.c index 63c36aae03..c3c39f37eb 100644 --- a/teshsuite/smpi/mpich3-test/coll/coll13.c +++ b/teshsuite/smpi/mpich3-test/coll/coll13.c @@ -16,10 +16,6 @@ From: hook@nas.nasa.gov (Edward C. Hook) #include #include -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#define EXIT_FAILURE 1 -#endif int main(int argc, char *argv[]) {