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

brad at geodynamics.org brad at geodynamics.org
Wed Sep 28 17:23:34 PDT 2011


Author: brad
Date: 2011-09-28 17:23:34 -0700 (Wed, 28 Sep 2011)
New Revision: 18985

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc
Log:
Fixed overzealous check (maxConeSize is local to processor).

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc	2011-09-28 22:23:41 UTC (rev 18984)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/topology/SubMesh.cc	2011-09-29 00:23:34 UTC (rev 18985)
@@ -17,7 +17,6 @@
 //
 
 #include <portinfo>
-#include <stdexcept>
 
 #include "SubMesh.hh" // implementation of class methods
 
@@ -25,6 +24,8 @@
 
 #include <Selection.hh> // USES ALE::Selection
 
+#include "pylith/utils/petscerror.h" // USES CHECK_PETSC_ERROR
+
 #include <stdexcept> // USES std::runtime_error
 #include <sstream> // USES std::ostringstream
 #include <cassert> // USES assert()
@@ -140,7 +141,12 @@
   std::string meshLabel = "subdomain_" + std::string(label);
   _mesh->setName(meshLabel);
 
-  if (sieve->getMaxConeSize() <= 0) {
+  int maxConeSizeLocal = sieve->getMaxConeSize();
+  int maxConeSize = 0;
+  int err = MPI_Allreduce(&maxConeSizeLocal, &maxConeSize, 1, MPI_INT, MPI_MAX,
+			  sieve->comm()); CHECK_PETSC_ERROR(err);
+
+  if (maxConeSize <= 0) {
     std::ostringstream msg;
     msg << "Error while creating submesh. Submesh '" 
 	<< label << "' does not contain any cells.\n"



More information about the CIG-COMMITS mailing list