Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
MPI_Comm_dup_with_info
authorAugustin Degomme <adegomme@users.noreply.github.com>
Fri, 26 Apr 2019 21:27:57 +0000 (23:27 +0200)
committerAugustin Degomme <adegomme@users.noreply.github.com>
Fri, 26 Apr 2019 21:27:57 +0000 (23:27 +0200)
src/smpi/bindings/smpi_mpi.cpp
src/smpi/bindings/smpi_pmpi_comm.cpp
src/smpi/mpi/smpi_comm.cpp
teshsuite/smpi/mpich3-test/comm/testlist

index 9debaab..d5c632c 100644 (file)
@@ -99,6 +99,7 @@ WRAPPED_PMPI_CALL(int,MPI_Comm_create,(MPI_Comm comm, MPI_Group group, MPI_Comm
 WRAPPED_PMPI_CALL(int,MPI_Comm_delete_attr ,(MPI_Comm comm, int comm_keyval),(comm,comm_keyval))
 WRAPPED_PMPI_CALL(int,MPI_Comm_disconnect,(MPI_Comm * comm),(comm))
 WRAPPED_PMPI_CALL(int,MPI_Comm_dup,(MPI_Comm comm, MPI_Comm * newcomm),(comm, newcomm))
+WRAPPED_PMPI_CALL(int,MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm),(comm,info,newcomm))
 WRAPPED_PMPI_CALL(int,MPI_Comm_free_keyval,(int* keyval) ,( keyval))
 WRAPPED_PMPI_CALL(int,MPI_Comm_free,(MPI_Comm * comm),(comm))
 WRAPPED_PMPI_CALL(int,MPI_Comm_get_attr ,(MPI_Comm comm, int comm_keyval, void *attribute_val, int *flag),(comm, comm_keyval, attribute_val, flag))
@@ -351,7 +352,6 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_accept,(const char *port_name, MPI_
 UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_call_errhandler,(MPI_Comm comm,int errorcode),(comm, errorcode))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_connect,(const char *port_name, MPI_Info info, int root, MPI_Comm comm, MPI_Comm *newcomm),( port_name, info, root, comm, newcomm))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_create_errhandler,( MPI_Comm_errhandler_fn *function, MPI_Errhandler *errhandler),( function, errhandler))
-UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_dup_with_info,(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm),(comm,info,newcomm))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Comm_get_errhandler,(MPI_Comm comm, MPI_Errhandler* errhandler) ,(comm, errhandler))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_get_parent,( MPI_Comm *parent),( parent))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Comm_join,( int fd, MPI_Comm *intercomm),( fd, intercomm))
@@ -435,3 +435,5 @@ UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(int,MPI_Win_sync,(MPI_Win win),(win))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL_NOFAIL(MPI_Fint, MPI_Errhandler_c2f,(MPI_Errhandler errhandler),(errhandler))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Mprobe,(int source, int tag, MPI_Comm comm, MPI_Message *message, MPI_Status* status) ,(source, tag, comm, message, status))
 UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Mrecv,(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Status* status),(buf, count, datatype, message, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Improbe,(int source, int tag, MPI_Comm comm, int* flag, MPI_Message *message, MPI_Status* status) ,(source, tag, comm, flag, message, status))
+UNIMPLEMENTED_WRAPPED_PMPI_CALL(int,MPI_Imrecv,(void *buf, int count, MPI_Datatype datatype, MPI_Message *message, MPI_Request *request),(buf, count, datatype, message, request))
\ No newline at end of file
index d8d4be3..dc4d87a 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "private.hpp"
 #include "smpi_comm.hpp"
+#include "smpi_info.hpp"
 #include "src/smpi/include/smpi_actor.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(smpi_pmpi);
@@ -105,6 +106,20 @@ int PMPI_Comm_dup(MPI_Comm comm, MPI_Comm * newcomm)
   }
 }
 
+int PMPI_Comm_dup_with_info(MPI_Comm comm, MPI_Info info, MPI_Comm * newcomm)
+{
+  if (comm == MPI_COMM_NULL) {
+    return MPI_ERR_COMM;
+  } else if (newcomm == nullptr) {
+    return MPI_ERR_ARG;
+  } else {
+    comm->dup(newcomm);
+    if(info!=MPI_INFO_NULL)
+      (*newcomm)->set_info(info);
+    return MPI_SUCCESS;
+  }
+}
+
 int PMPI_Comm_create(MPI_Comm comm, MPI_Group group, MPI_Comm * newcomm)
 {
   if (comm == MPI_COMM_NULL) {
index 67dee29..7c13694 100644 (file)
@@ -38,6 +38,7 @@ Comm::Comm(MPI_Group group, MPI_Topology topo, int smp) : group_(group), topo_(t
   non_uniform_map_ = nullptr;
   leaders_map_     = nullptr;
   is_blocked_      = 0;
+  info_            = MPI_INFO_NULL;
 }
 
 void Comm::destroy(Comm* comm)
@@ -519,13 +520,17 @@ void Comm::set_info(MPI_Info info){
 
 MPI_Comm Comm::split_type(int type, int /*key*/, MPI_Info)
 {
-  if(type != MPI_COMM_TYPE_SHARED){
+  //MPI_UNDEFINED can be given to some nodes... but we need them to still perform the smp part which is collective
+  if(type != MPI_COMM_TYPE_SHARED && type != MPI_UNDEFINED){
     return MPI_COMM_NULL;
   }
   this->init_smp();
   this->ref();
   this->get_intra_comm()->ref();
-  return this->get_intra_comm();
+  if(type != MPI_UNDEFINED)
+    return this->get_intra_comm();
+  else
+    return MPI_COMM_NULL;
 }
 
 } // namespace smpi
index fbe2931..8580d3f 100644 (file)
@@ -18,7 +18,7 @@ cmfree 4
 cmsplit 4
 cmsplit2 12
 #probe-intercomm 2
-#cmsplit_type 4 mpiversion=3.0
+cmsplit_type 4 mpiversion=3.0
 comm_create_group 4 mpiversion=3.0
 comm_create_group 8 mpiversion=3.0
 comm_group_half 2 mpiversion=3.0
@@ -32,7 +32,7 @@ comm_group_rand 8 mpiversion=3.0
 #comm_idup 9 mpiversion=3.0
 #comm_idup_mul 2 mpiversion=3.0
 #comm_idup_overlap 2 mpiversion=3.0
-#dup_with_info 2 mpiversion=3.0
-#dup_with_info 4 mpiversion=3.0
-#dup_with_info 9 mpiversion=3.0
+dup_with_info 2 mpiversion=3.0
+dup_with_info 4 mpiversion=3.0
+dup_with_info 9 mpiversion=3.0
 comm_info 6 mpiversion=3.0