Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
functioning MPI_Comm_get_name, MPI_Comm_set_name
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index 144f28d..07a2904 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-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. */
@@ -49,6 +49,18 @@ int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
   }
 }
 
+int PMPI_Comm_set_name (MPI_Comm comm, char* name)
+{
+  if (comm == MPI_COMM_NULL)  {
+    return MPI_ERR_COMM;
+  } else if (name == nullptr)  {
+    return MPI_ERR_ARG;
+  } else {
+    comm->set_name(name);
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 {
   if (comm == MPI_COMM_NULL) {