Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / smpi / colls / gather / gather-ompi.cpp
index f1fca99..45dfc3a 100644 (file)
@@ -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
@@ -76,7 +76,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;
@@ -106,7 +106,7 @@ int gather__ompi_binomial(const void* sbuf, int scount, MPI_Datatype sdtype, voi
        * children, the most we need is half of the total data elements due
        * 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 +188,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 +270,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);