X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9104957deccc59e0e804215d5db498fabfd40d29..HEAD:/src/smpi/colls/gather/gather-ompi.cpp diff --git a/src/smpi/colls/gather/gather-ompi.cpp b/src/smpi/colls/gather/gather-ompi.cpp index 3aaaab58b1..d3c9be8e8b 100644 --- a/src/smpi/colls/gather/gather-ompi.cpp +++ b/src/smpi/colls/gather/gather-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 gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) @@ -76,7 +75,7 @@ int gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, voi /* root is not on 0, allocate temp buffer for recv, * rotate data at the end */ tempbuf = smpi_get_tmp_recvbuffer(rtrue_extent + (rcount * size - 1) * rextent); - if (NULL == tempbuf) { + if (nullptr == tempbuf) { err = MPI_ERR_OTHER; line = __LINE__; goto err_hndl; @@ -104,9 +103,9 @@ int gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, voi } else if (!(vrank % 2)) { /* other non-leaf nodes, allocate temp buffer for data received from * children, the most we need is half of the total data elements due - * to the property of binimoal tree */ + * to the property of binomial tree */ tempbuf = smpi_get_tmp_sendbuffer(strue_extent + (scount * size - 1) * sextent); - if (NULL == tempbuf) { + if (nullptr == tempbuf) { err = MPI_ERR_OTHER; line = __LINE__; goto err_hndl; @@ -188,11 +187,11 @@ int gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, voi return MPI_SUCCESS; err_hndl: - if (NULL != tempbuf) - smpi_free_tmp_buffer(tempbuf); + if (nullptr != tempbuf) + smpi_free_tmp_buffer(tempbuf); - XBT_DEBUG("%s:%4d\tError occurred %d, rank %2d", __FILE__, line, err, rank); - return err; + XBT_DEBUG("%s:%4d\tError occurred %d, rank %2d", __FILE__, line, err, rank); + return err; } /* @@ -270,11 +269,12 @@ int gather__ompi_linear_sync(const void *sbuf, int scount, */ char* ptmp; MPI_Request first_segment_req; - MPI_Request* reqs = new (std::nothrow) MPI_Request[size]; - if (NULL == reqs) { + auto* reqs = new (std::nothrow) MPI_Request[size]; + if (nullptr == reqs) { ret = -1; line = __LINE__; - goto error_hndl; } + goto error_hndl; + } typelng=rdtype->size(); rdtype->extent(&lb, &extent); @@ -408,5 +408,4 @@ int gather__ompi_basic_linear(const void* sbuf, int scount, MPI_Datatype sdtype, return MPI_SUCCESS; } -} -} +} // namespace simgrid::smpi