X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8bc85164acb335cf909052b966b2ee4932e06cd7..3907e83884bae6278656e9cd2cb7ef92a8f707fb:/src/smpi/colls/reduce/reduce-ompi.cpp diff --git a/src/smpi/colls/reduce/reduce-ompi.cpp b/src/smpi/colls/reduce/reduce-ompi.cpp index ccdd68e07a..1a8b8b8114 100644 --- a/src/smpi/colls/reduce/reduce-ompi.cpp +++ b/src/smpi/colls/reduce/reduce-ompi.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2020. The SimGrid Team. +/* Copyright (c) 2013-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -22,8 +22,7 @@ #include "../coll_tuned_topo.hpp" #include "../colls_private.hpp" -namespace simgrid{ -namespace smpi{ +namespace simgrid::smpi { int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count, MPI_Datatype datatype, MPI_Op op, @@ -266,8 +265,12 @@ int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int else { int creq = 0; - MPI_Request* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs]; - if (NULL == sreq) { line = __LINE__; ret = -1; goto error_hndl; } + auto* sreq = new (std::nothrow) MPI_Request[max_outstanding_reqs]; + if (nullptr == sreq) { + line = __LINE__; + ret = -1; + goto error_hndl; + } /* post first group of requests */ for (segindex = 0; segindex < max_outstanding_reqs; segindex++) { @@ -520,14 +523,14 @@ int reduce__ompi_in_order_binary(const void *sendbuf, void *recvbuf, if ((root == rank) && (MPI_IN_PLACE == sendbuf)) { tmp_sendbuf = smpi_get_tmp_sendbuffer(text + (count - 1) * ext); - if (NULL == tmp_sendbuf) { + if (nullptr == tmp_sendbuf) { return MPI_ERR_INTERN; } Datatype::copy(recvbuf, count, datatype, tmp_sendbuf, count, datatype); use_this_sendbuf = tmp_sendbuf; } else if (io_root == rank) { tmp_recvbuf = smpi_get_tmp_recvbuffer(text + (count - 1) * ext); - if (NULL == tmp_recvbuf) { + if (nullptr == tmp_recvbuf) { return MPI_ERR_INTERN; } use_this_recvbuf = tmp_recvbuf; @@ -676,6 +679,4 @@ int reduce__ompi_basic_linear(const void *sbuf, void *rbuf, int count, /* copied function (with appropriate renaming) ends here */ - -} -} +} // namespace simgrid::smpi