[MOAB-dev] r5140 - MOAB/trunk/test/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Aug 30 13:14:08 CDT 2011


Author: kraftche
Date: 2011-08-30 13:14:08 -0500 (Tue, 30 Aug 2011)
New Revision: 5140

Modified:
   MOAB/trunk/test/parallel/parallel_hdf5_test.cc
Log:
add test to verify that parallel HDF5 write works when some procs have no data

Modified: MOAB/trunk/test/parallel/parallel_hdf5_test.cc
===================================================================
--- MOAB/trunk/test/parallel/parallel_hdf5_test.cc	2011-08-30 18:13:47 UTC (rev 5139)
+++ MOAB/trunk/test/parallel/parallel_hdf5_test.cc	2011-08-30 18:14:08 UTC (rev 5140)
@@ -56,6 +56,7 @@
 void test_write_different_element_types();
 void test_write_different_tags();
 void test_write_polygons();
+void test_write_unbalanced();
 
 const char PARTITION_TAG[] = "PARTITION";
 
@@ -193,6 +194,8 @@
     MPI_Barrier(MPI_COMM_WORLD);
     result += RUN_TEST( test_write_polygons );
     MPI_Barrier(MPI_COMM_WORLD);
+    result += RUN_TEST( test_write_unbalanced );
+    MPI_Barrier(MPI_COMM_WORLD);
   }
   
   MPI_Finalize();
@@ -1332,4 +1335,91 @@
 }
 
 
+// Some processes have no mesh to write
+void test_write_unbalanced()
+{
+  const char file_name[] = "test_write_unbalanced.h5m";
+  int numproc, rank;
+  MPI_Comm_size( MPI_COMM_WORLD, &numproc );
+  MPI_Comm_rank( MPI_COMM_WORLD, &rank    );
+  Core moab;
+  Interface &mb = moab;
+  ErrorCode rval;
+  Tag idtag;
+  
+  rval = mb.tag_get_handle( GLOBAL_ID_TAG_NAME, 1, MB_TYPE_INTEGER, idtag, MB_TAG_CREAT );
+  CHECK_ERR(rval);
+  
+    // create a shared set
+  const int two = 2;
+  Range entities, sets;
 
+  EntityHandle set;
+  rval = mb.create_meshset( MESHSET_SET, set );
+  CHECK_ERR(rval);
+  rval = mb.tag_set_data( idtag, &set, 1, &two );
+  CHECK_ERR(rval);
+  sets.insert( set );
+


More information about the moab-dev mailing list