Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Throw std::invalid_argument.
[simgrid.git] / src / smpi / colls / allgather / allgather-loosely-lr.cpp
index 6732afc..5596db8 100644 (file)
@@ -1,16 +1,16 @@
-/* Copyright (c) 2013-2017. The SimGrid Team.
+/* Copyright (c) 2013-2019. 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 "../colls_private.hpp"
 
 namespace simgrid{
 namespace smpi{
 
 
-int Coll_allgather_loosely_lr::allgather(void *sbuf, int scount,
+int Coll_allgather_loosely_lr::allgather(const void *sbuf, int scount,
                                          MPI_Datatype stype, void *rbuf,
                                          int rcount, MPI_Datatype rtype,
                                          MPI_Comm comm)
@@ -32,7 +32,9 @@ if(comm->get_leaders_comm()==MPI_COMM_NULL){
   }
 
   if(comm_size%num_core)
-    THROWF(arg_error,0, "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=%d number of processes ! ",num_core);
+    throw std::invalid_argument(xbt::string_printf(
+        "allgather loosely lr algorithm can't be used with non multiple of NUM_CORE=%d number of processes!",
+        num_core));
 
   rank = comm->rank();
   MPI_Aint rextent, sextent;
@@ -92,10 +94,9 @@ if(comm->get_leaders_comm()==MPI_COMM_NULL){
       if (intra_rank == j) {
         if (i != inter_comm_size - 1) {
 
-          inter_rrequest = Request::irecv((char *)rbuf + inter_recv_offset, rcount, rtype,
-                                         inter_src, tag, comm);
-          inter_srequest_array[inter_srequest_count++] = Request::isend((char *)rbuf + inter_send_offset, scount, stype,
-                                                                       inter_dst, tag, comm);
+          inter_rrequest = Request::irecv((char*)rbuf + inter_recv_offset, rcount, rtype, inter_src, tag, comm);
+          inter_srequest_array[inter_srequest_count++] =
+              Request::isend((char*)rbuf + inter_send_offset, scount, stype, inter_dst, tag, comm);
         }
       }
       //intra_communication