[cig-commits] r19614 - short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio

brad at geodynamics.org brad at geodynamics.org
Fri Feb 10 20:16:10 PST 2012


Author: brad
Date: 2012-02-10 20:16:10 -0800 (Fri, 10 Feb 2012)
New Revision: 19614

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc
Log:
Fix for MPI. Don't allow same variable in send/recv for MPI_Allreduce.

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc	2012-02-11 01:36:47 UTC (rev 19613)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5.cc	2012-02-11 04:16:10 UTC (rev 19614)
@@ -146,8 +146,9 @@
     CHECK_PETSC_ERROR(err);
 
     // Account for censored cells
-    int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
-    err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX, 
+    int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+    int cellDepth = 0;
+    err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX, 
 			sieveMesh->comm());CHECK_PETSC_ERROR(err);
     const int depth = (0 == label) ? cellDepth : labelId;
     const std::string labelName = (0 == label) ?
@@ -379,8 +380,9 @@
     const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh = 
       field.mesh().sieveMesh();
     assert(!sieveMesh.isNull());
-    int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
-    err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX, 
+    int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+    int cellDepth = 0;
+    err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX, 
 			sieveMesh->comm());CHECK_PETSC_ERROR(err);
     const int depth = (0 == label) ? cellDepth : labelId;
     const std::string labelName = (0 == label) ?

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2012-02-11 01:36:47 UTC (rev 19613)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterHDF5Ext.cc	2012-02-11 04:16:10 UTC (rev 19614)
@@ -159,8 +159,9 @@
     // Write cells
 
     // Account for censored cells
-    int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
-    err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX, 
+    int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+    int cellDepth = 0;
+    err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX, 
 			sieveMesh->comm());CHECK_PETSC_ERROR(err);
     const int depth = (0 == label) ? cellDepth : labelId;
     const std::string labelName = (0 == label) ?
@@ -440,8 +441,9 @@
     const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh = 
       field.mesh().sieveMesh();
     assert(!sieveMesh.isNull());
-    int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
-    err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX, 
+    int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+    int cellDepth = 0;
+    err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX, 
 			sieveMesh->comm());CHECK_PETSC_ERROR(err);
     const int depth = (0 == label) ? cellDepth : labelId;
     const std::string labelName = (0 == label) ?

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc	2012-02-11 01:36:47 UTC (rev 19613)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/DataWriterVTK.cc	2012-02-11 04:16:10 UTC (rev 19614)
@@ -255,8 +255,9 @@
     //   Cannot just use mesh->depth() because boundaries report the wrong thing
     const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
     assert(!sieveMesh.isNull());
-    int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
-    err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX, 
+    int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+    int cellDepth = 0;
+    err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX, 
 			sieveMesh->comm());CHECK_PETSC_ERROR(err);
     const int depth = (!label) ? cellDepth : labelId;
     const std::string labelName = (!label) ?



More information about the CIG-COMMITS mailing list