X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a521b79fb5f8fc07b3f9102cec6de074186fe5c1..72d32c4e88a57f4786f62fec48a1bfa454adbff9:/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp diff --git a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp index 47d62c6755..dfb61008ce 100644 --- a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp +++ b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2020. The SimGrid Team. +/* Copyright (c) 2013-2022. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -155,8 +155,7 @@ #include "../colls_private.hpp" -namespace simgrid { -namespace smpi { +namespace simgrid::smpi { int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, @@ -171,11 +170,11 @@ int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, int block_count; unsigned int inbi; size_t typelng; - char *tmpsend = NULL, *tmprecv = NULL; + char *tmpsend = nullptr, *tmprecv = nullptr; unsigned char* inbuf[2] = {nullptr, nullptr}; ptrdiff_t true_extent, extent; ptrdiff_t block_offset, max_real_segsize; - MPI_Request reqs[2] = {NULL, NULL}; + MPI_Request reqs[2] = {nullptr, nullptr}; const size_t segsize = 1 << 20; /* 1 MB */ int size = comm->size(); int rank = comm->rank(); @@ -231,7 +230,11 @@ int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, /* Allocate and initialize temporary buffers */ inbuf[0] = smpi_get_tmp_sendbuffer(max_real_segsize); - if (NULL == inbuf[0]) { ret = -1; line = __LINE__; goto error_hndl; } + if (nullptr == inbuf[0]) { + ret = -1; + line = __LINE__; + goto error_hndl; + } if (size > 2) { inbuf[1] = smpi_get_tmp_recvbuffer(max_real_segsize); if (nullptr == inbuf[1]) { @@ -392,5 +395,4 @@ int allreduce__ompi_ring_segmented(const void *sbuf, void *rbuf, int count, smpi_free_tmp_buffer(inbuf[1]); return ret; } -} -} +} // namespace simgrid::smpi