From: Arnaud Giersch Date: Wed, 14 Feb 2018 16:42:08 +0000 (+0100) Subject: Check for negative size (and please scan-build). X-Git-Tag: v3.19~180^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2daa5a2c9ff975f3c77056d09ef42a38467f84dc Check for negative size (and please scan-build). --- diff --git a/src/smpi/colls/smpi_default_selector.cpp b/src/smpi/colls/smpi_default_selector.cpp index f48c4bfe80..bc93034e90 100644 --- a/src/smpi/colls/smpi_default_selector.cpp +++ b/src/smpi/colls/smpi_default_selector.cpp @@ -1,6 +1,6 @@ /* selector with default/naive Simgrid algorithms. These should not be trusted for performance evaluations */ -/* 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 @@ -213,7 +213,7 @@ int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Dat int rank = comm->rank(); int size = comm->size(); - if(size==0) + if (size <= 0) return MPI_ERR_COMM; //non commutative case, use a working algo from openmpi if (op != MPI_OP_NULL && not op->is_commutative()) {