[MOAB-dev] r1633 - MOAB/trunk

tautges at mcs.anl.gov tautges at mcs.anl.gov
Tue Mar 4 12:18:07 CST 2008


Author: tautges
Date: 2008-03-04 12:18:07 -0600 (Tue, 04 Mar 2008)
New Revision: 1633

Modified:
   MOAB/trunk/MBParallelConventions.h
   MOAB/trunk/mbparallelcomm_test.cpp
Log:
Forgot to commit these files, adding necessary tag names for parallel version.


Modified: MOAB/trunk/MBParallelConventions.h
===================================================================
--- MOAB/trunk/MBParallelConventions.h	2008-03-03 19:17:06 UTC (rev 1632)
+++ MOAB/trunk/MBParallelConventions.h	2008-03-04 18:18:07 UTC (rev 1633)
@@ -37,4 +37,31 @@
  */
 #define PARALLEL_SHARED_PROCS_TAG_NAME "PARALLEL_SHARED_PROCS"
  
+/** \brief Tag storing the handle of a shared entity on the other proc
+ *
+ * This single-valued tag implies an entity is shared with one other proc
+ */
+#define PARALLEL_SHARED_HANDLE_TAG_NAME "PARALLEL_SHARED_HANDLE"
+ 
+/** \brief Tag storing handles of a shared entity on other processors
+ *
+ * This multiple-valued tag implies an entity is shared with multiple
+ * other processors.  Length of tag is application-dependent, and depends on
+ * what the maximum number of processors is which share an entity
+ */
+#define PARALLEL_SHARED_HANDLES_TAG_NAME "PARALLEL_SHARED_HANDLES"
+ 
+/** \brief Tag storing parallel status (as bits in this tag)
+ *
+ * This tag stores various aspects of parallel status in bits; see also 
+ * #define's following, to be used in bit mask operations
+ *
+ * bit 0: shared (0=not shared, 1=shared)
+ * bit 1: !owned (0=owned, 1=not owned)
+ */
+#define PARALLEL_STATUS_TAG_NAME "PARALLEL_STATUS"
+
+#define PSTATUS_SHARED 0x1
+#define PSTATUS_NOT_OWNED 0x2
+ 
 #endif

Modified: MOAB/trunk/mbparallelcomm_test.cpp
===================================================================
--- MOAB/trunk/mbparallelcomm_test.cpp	2008-03-03 19:17:06 UTC (rev 1632)
+++ MOAB/trunk/mbparallelcomm_test.cpp	2008-03-04 18:18:07 UTC (rev 1633)
@@ -20,6 +20,8 @@
 
 #define REALTFI 1
 
+const bool debug = true;
+
 #define ERROR(a, b) {std::cerr << a << std::endl; return b;}
 
 #define PRINT_LAST_ERROR {\
@@ -184,7 +186,25 @@
       if (-1 == nshared)
         std::cerr << "Proc " << rank << " " << shared_ents.size()
                   << " shared vertices." << std::endl;
-  
+
+      if (debug && 2 == nprocs) {
+          // if I'm root, get and print handles on other procs
+        std::vector<MBEntityHandle> sharedh_tags(shared_ents.size());
+        std::fill(sharedh_tags.begin(), sharedh_tags.end(), 0);
+        MBTag dumt, sharedh_tag;
+        result = pcomm->get_shared_proc_tags(dumt, dumt, sharedh_tag, dumt, dumt);
+        result = mbImpl->tag_get_data(sharedh_tag, shared_ents, &sharedh_tags[0]);
+        if (MB_SUCCESS != result) {
+          std::cerr << "Couldn't get shared handle tag." << std::endl;
+        }
+        else {
+          MBRange dum_range;
+          std::copy(sharedh_tags.begin(), sharedh_tags.end(), mb_range_inserter(dum_range));
+          std::cerr << "Shared handles: " << std::endl;
+          dum_range.print();
+        }
+      }
+        
       delete pcomm;
       tmp_result = mbImpl->delete_mesh();
       if (MB_SUCCESS != tmp_result) {




More information about the moab-dev mailing list