[MOAB-dev] r5280 - in MOAB/trunk: examples/itaps itaps/imesh src src/io src/parallel test/h5file

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Dec 22 09:36:37 CST 2011


Author: tautges
Date: 2011-12-22 09:36:34 -0600 (Thu, 22 Dec 2011)
New Revision: 5280

Added:
   MOAB/trunk/examples/itaps/ListSetsNTagsCXX.cpp
   MOAB/trunk/examples/itaps/ListSetsNTagsF90.F90
Modified:
   MOAB/trunk/examples/itaps/Makefile.am
   MOAB/trunk/itaps/imesh/iMeshP_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMesh_MOAB.cpp
   MOAB/trunk/itaps/imesh/iMesh_MOAB.hpp
   MOAB/trunk/src/Core.cpp
   MOAB/trunk/src/FileOptions.hpp
   MOAB/trunk/src/io/ReadHDF5.cpp
   MOAB/trunk/src/io/ReadHDF5.hpp
   MOAB/trunk/src/parallel/SharedSetData.cpp
   MOAB/trunk/test/h5file/h5partial.cpp
Log:
Fixing bug in parallel reading, where if a set contains only other sets, and 
the contained sets are read locally (based on containing locally-represented
entities), the containing set is also selected for reading.  This comes up
with NEUMANN sets read from cub files, where those sets contain only the
surface geom_topo sets.  Fixes problem where Nek wasn't running with READ_PART
as the parallel read option.

A few other assorted changes:
- change to listing of set entities in Core::list_entities
- better option processing in iMeshP
- added a few more iMesh example codes

Passes checks in serial and parallel.



Added: MOAB/trunk/examples/itaps/ListSetsNTagsCXX.cpp
===================================================================
--- MOAB/trunk/examples/itaps/ListSetsNTagsCXX.cpp	                        (rev 0)
+++ MOAB/trunk/examples/itaps/ListSetsNTagsCXX.cpp	2011-12-22 15:36:34 UTC (rev 5280)
@@ -0,0 +1,116 @@
+/** ListSetsNTags: list sets & tags from a mesh
+ * 
+ * This program shows how to read and list sets and tags from a mesh
+ *
+ * Usage: SetsNTags <mesh_file_name>
+ *
+ */
+
+#include <iostream>
+#include <cstdlib>
+#include <cstring>
+#include <vector>
+#include "iMesh.h"
+
+#define ERRORR(a) {if (iBase_SUCCESS != err) {std::cout << a << std::endl; return err;}}
+
+int main( int argc, char *argv[] )
+{
+  const char *filename;
+  bool read_par = false;
+  if (argc < 2 || !strcmp(argv[1], "-h")) {
+    std::cout << "Usage: " << argv[0] << " <filename> [-p]" << std::endl;
+    return 0;
+  }
+  else {
+      // Check command line arg
+    filename = argv[1];
+
+    if (argc > 2 && !strcmp(argv[2], "-p")) read_par = true;
+  }
+  
+    // create the Mesh instance
+  iMesh_Instance mesh;
+  int err;
+  iMesh_newMesh(NULL, &mesh, &err, 0);
+  ERRORR("Error creating new mesh.\n");
+  
+  
+  iBase_EntitySetHandle root_set;
+  iMesh_getRootSet(mesh, &root_set, &err);
+  ERRORR("Couldn't get root set.");
+  
+    // load the mesh
+  if (read_par) {
+    const char *opt = " moab:PARALLEL=READ_PART moab:PARTITION=PARALLEL_PARTITION moab:PARTITION_DISTRIBUTE moab:PARALLEL_RESOLVE_SHARED_ENTS moab:DEBUG_PIO=2 moab:DEBUG_IO=2 moab:SETS=SETS ";
+    iMesh_load(mesh, root_set, filename, opt, &err, strlen(filename), strlen(opt));


More information about the moab-dev mailing list