Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix Manifest.in
[simgrid.git] / src / smpi / bindings / smpi_pmpi_request.cpp
index 96bb98b03e9f908a5b58244369f47aef762aa787..94bb62be2adfae7cbee124d49dc3a97a665b4656 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2023. 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. */
@@ -437,7 +437,10 @@ int PMPI_Sendrecv_replace(void* buf, int count, MPI_Datatype datatype, int dst,
   CHECK_BUFFER(1, buf, count, datatype)
 
   int size = datatype->get_extent() * count;
-  xbt_assert(size > 0);
+  if (size == 0)
+    return MPI_SUCCESS;
+  else if (size <0)
+    return MPI_ERR_ARG;
   std::vector<char> recvbuf(size);
   retval =
       MPI_Sendrecv(buf, count, datatype, dst, sendtag, recvbuf.data(), count, datatype, src, recvtag, comm, status);