X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/befbbbe1fbb31663a8f91e24ce12df271cf4ae79..f36bb244f8e4874b90572ecb44ed6e2f3fa9592b:/src/smpi/colls/smpi_default_selector.cpp diff --git a/src/smpi/colls/smpi_default_selector.cpp b/src/smpi/colls/smpi_default_selector.cpp index d674e4ad56..41fe01a7cd 100644 --- a/src/smpi/colls/smpi_default_selector.cpp +++ b/src/smpi/colls/smpi_default_selector.cpp @@ -1,13 +1,13 @@ /* 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-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. */ -#include "colls_private.h" -#include "src/smpi/smpi_process.hpp" +#include "colls_private.hpp" +#include "smpi_process.hpp" namespace simgrid{ namespace smpi{ @@ -213,6 +213,8 @@ int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Dat int rank = comm->rank(); int size = comm->size(); + 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()) { return Coll_reduce_ompi_basic_linear::reduce(sendtmpbuf, recvbuf, count, datatype, op, root, comm);