[MOAB-dev] commit/MOAB: tautges: Changes to eliminate requirement for MPI2, from Russ Whitesides (LLNL).

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Thu Feb 20 10:27:58 CST 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/eb333bdc81e5/
Changeset:   eb333bdc81e5
Branch:      master
User:        tautges
Date:        2014-02-20 17:27:49
Summary:     Changes to eliminate requirement for MPI2, from Russ Whitesides (LLNL).

Affected #:  2 files

diff --git a/tools/mbcoupler/Coupler.cpp b/tools/mbcoupler/Coupler.cpp
index 29dbb3d..b496441 100644
--- a/tools/mbcoupler/Coupler.cpp
+++ b/tools/mbcoupler/Coupler.cpp
@@ -113,11 +113,22 @@ ErrorCode Coupler::initialize_tree()
   box.bMax.get(&allBoxes[6*my_rank+3]);
   
     // now communicate to get all boxes
-    // use "in place" option
   if (myPc) {
-    int mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
+    int mpi_err;
+#if (MPI_VERSION >= 2)
+      // use "in place" option
+    mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
                                 &allBoxes[0], 6, MPI_DOUBLE, 
                                 myPc->proc_config().proc_comm());
+#else
+    {
+      std::vector<double> allBoxes_tmp(6*myPc->proc_config().proc_size());
+      mpi_err = MPI_Allgather( &allBoxes[6*my_rank], 6, MPI_DOUBLE,
+                                   &allBoxes_tmp[0], 6, MPI_DOUBLE, 
+                                   myPc->proc_config().proc_comm());
+      allBoxes = allBoxes_tmp;
+    }
+#endif
     if (MPI_SUCCESS != mpi_err) return MB_FAILURE;
   }
 

diff --git a/tools/mbcslam/Intx2Mesh.cpp b/tools/mbcslam/Intx2Mesh.cpp
index 22fdc3f..9859d00 100644
--- a/tools/mbcslam/Intx2Mesh.cpp
+++ b/tools/mbcslam/Intx2Mesh.cpp
@@ -483,10 +483,21 @@ ErrorCode Intx2Mesh::build_processor_euler_boxes(EntityHandle euler_set, Range &
   }
 
    // now communicate to get all boxes
-   // use "in place" option
-  int mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
-                               &allBoxes[0], 6, MPI_DOUBLE,
-                               parcomm->proc_config().proc_comm());
+  int mpi_err;
+#if (MPI_VERSION >= 2)
+    // use "in place" option
+  mpi_err = MPI_Allgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL,
+                          &allBoxes[0], 6, MPI_DOUBLE, 
+                          parcomm->proc_config().proc_comm());
+#else
+  {
+    std::vector<double> allBoxes_tmp(6*parcomm->proc_config().proc_size());
+    mpi_err = MPI_Allgather( &allBoxes[6*my_rank], 6, MPI_DOUBLE,
+                             &allBoxes_tmp[0], 6, MPI_DOUBLE, 
+                             parcomm->proc_config().proc_comm());
+    allBoxes = allBoxes_tmp;
+  }
+#endif
   if (MPI_SUCCESS != mpi_err) return MB_FAILURE;
 
   // also process the max number of vertices per cell (4 for quads, but could be more for polygons)

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list