Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill all horizontal tabs
[simgrid.git] / src / smpi / colls / bcast / bcast-mvapich-smp.cpp
index 73e5f60..8ac87db 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2013-2014. The SimGrid Team.
+/* Copyright (c) 2013-2017. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -73,6 +73,8 @@ extern int mv2_intra_node_knomial_factor;
 #define mv2_bcast_large_msg            512*1024
 #define mv2_knomial_intra_node_threshold 131072
 #define mv2_scatter_rd_inter_leader_bcast 1
+namespace simgrid{
+namespace smpi{
 int Coll_bcast_mvapich2_inter_node::bcast(void *buffer,
                                                  int count,
                                                  MPI_Datatype datatype,
@@ -316,24 +318,22 @@ int Coll_bcast_mvapich2_intra_node::bcast(void *buffer,
 #endif
         ) {
 
-        if (!is_contig || !is_homogeneous) {
-            tmp_buf=(void *)smpi_get_tmp_sendbuffer(nbytes);
-
-            /* TODO: Pipeline the packing and communication */
-           // position = 0;
-/*            if (rank == root) {*/
-/*                mpi_errno =*/
-/*                    MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes, &position);*/
-/*                if (mpi_errno)*/
-/*                    MPIU_ERR_POP(mpi_errno);*/
-/*            }*/
+      if (not is_contig || not is_homogeneous) {
+        tmp_buf = (void*)smpi_get_tmp_sendbuffer(nbytes);
+
+        /* TODO: Pipeline the packing and communication */
+        // position = 0;
+        /*            if (rank == root) {*/
+        /*                mpi_errno =*/
+        /*                    MPIR_Pack_impl(buffer, count, datatype, tmp_buf, nbytes, &position);*/
+        /*                if (mpi_errno)*/
+        /*                    MPIU_ERR_POP(mpi_errno);*/
+        /*            }*/
         }
 
         shmem_comm = comm->get_intra_comm();
-        if (!is_contig || !is_homogeneous) {
-            mpi_errno =
-                MPIR_Bcast_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE,
-                                                 root, comm);
+        if (not is_contig || not is_homogeneous) {
+          mpi_errno = MPIR_Bcast_inter_node_helper_MV2(tmp_buf, nbytes, MPI_BYTE, root, comm);
         } else {
             mpi_errno =
                 MPIR_Bcast_inter_node_helper_MV2(buffer, count, datatype, root,
@@ -342,20 +342,15 @@ int Coll_bcast_mvapich2_intra_node::bcast(void *buffer,
 
         /* We are now done with the inter-node phase */
             if (nbytes <= mv2_knomial_intra_node_threshold) {
-                if (!is_contig || !is_homogeneous) {
-                    mpi_errno = MPIR_Shmem_Bcast_MV2(tmp_buf, nbytes, MPI_BYTE,
-                                                     root, shmem_comm);
+              if (not is_contig || not is_homogeneous) {
+                mpi_errno = MPIR_Shmem_Bcast_MV2(tmp_buf, nbytes, MPI_BYTE, root, shmem_comm);
                 } else {
                     mpi_errno = MPIR_Shmem_Bcast_MV2(buffer, count, datatype,
                                                      root, shmem_comm);
                 }
             } else {
-                if (!is_contig || !is_homogeneous) {
-                    mpi_errno =
-                        MPIR_Knomial_Bcast_intra_node_MV2(tmp_buf, nbytes,
-                                                          MPI_BYTE,
-                                                          INTRA_NODE_ROOT,
-                                                          shmem_comm);
+              if (not is_contig || not is_homogeneous) {
+                mpi_errno = MPIR_Knomial_Bcast_intra_node_MV2(tmp_buf, nbytes, MPI_BYTE, INTRA_NODE_ROOT, shmem_comm);
                 } else {
                     mpi_errno =
                         MPIR_Knomial_Bcast_intra_node_MV2(buffer, count,
@@ -388,3 +383,6 @@ int Coll_bcast_mvapich2_intra_node::bcast(void *buffer,
     return mpi_errno;
 
 }
+
+}
+}