Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'smpi'
[simgrid.git] / src / smpi / smpi_pmpi.c
index 6749928..ba07a45 100644 (file)
@@ -5,7 +5,6 @@
   * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "private.h"
-#include "smpi_coll_private.h"
 #include "smpi_mpi_dt_private.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_pmpi, smpi,
@@ -37,6 +36,7 @@ int PMPI_Init(int *argc, char ***argv)
 
 int PMPI_Finalize(void)
 {
+  smpi_process_finalize();
   smpi_bench_end();
 #ifdef HAVE_TRACING
   TRACE_smpi_finalize(smpi_process_index());
@@ -623,6 +623,8 @@ int PMPI_Comm_rank(MPI_Comm comm, int *rank)
   smpi_bench_end();
   if (comm == MPI_COMM_NULL) {
     retval = MPI_ERR_COMM;
+  } else if (rank == NULL) {
+    retval = MPI_ERR_ARG;
   } else {
     *rank = smpi_comm_rank(comm);
     retval = MPI_SUCCESS;
@@ -648,6 +650,23 @@ int PMPI_Comm_size(MPI_Comm comm, int *size)
   return retval;
 }
 
+int PMPI_Comm_get_name (MPI_Comm comm, char* name, int* len)
+{
+  int retval;
+
+  smpi_bench_end();
+  if (comm == MPI_COMM_NULL)  {
+    retval = MPI_ERR_COMM;
+  } else if (name == NULL || len == NULL)  {
+    retval = MPI_ERR_ARG;
+  } else {
+    smpi_comm_get_name(comm, name, len);
+    retval = MPI_SUCCESS;
+  }
+  smpi_bench_begin();
+  return retval;
+}
+
 int PMPI_Comm_group(MPI_Comm comm, MPI_Group * group)
 {
   int retval;
@@ -745,6 +764,25 @@ int PMPI_Comm_free(MPI_Comm * comm)
   return retval;
 }
 
+int PMPI_Comm_disconnect(MPI_Comm * comm)
+{
+  /* TODO: wait until all communication in comm are done */
+  int retval;
+
+  smpi_bench_end();
+  if (comm == NULL) {
+    retval = MPI_ERR_ARG;
+  } else if (*comm == MPI_COMM_NULL) {
+    retval = MPI_ERR_COMM;
+  } else {
+    smpi_comm_destroy(*comm);
+    *comm = MPI_COMM_NULL;
+    retval = MPI_SUCCESS;
+  }
+  smpi_bench_begin();
+  return retval;
+}
+
 int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
 {
   int retval;