[MOAB-dev] r5111 - in MOAB/trunk: . src/moab src/parallel src/parallel/moab test/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Wed Aug 24 17:26:44 CDT 2011


Author: kraftche
Date: 2011-08-24 17:26:38 -0500 (Wed, 24 Aug 2011)
New Revision: 5111

Added:
   MOAB/trunk/src/parallel/SharedSetData.cpp
   MOAB/trunk/src/parallel/SharedSetData.hpp
Modified:
   MOAB/trunk/configure.ac
   MOAB/trunk/src/moab/RangeMap.hpp
   MOAB/trunk/src/parallel/Makefile.am
   MOAB/trunk/src/parallel/ParallelComm.cpp
   MOAB/trunk/src/parallel/moab/ParallelComm.hpp
   MOAB/trunk/test/parallel/parallel_unit_tests.cpp
Log:
Manage shared set data and resolving shared sets in ParallelComm

Modified: MOAB/trunk/configure.ac
===================================================================
--- MOAB/trunk/configure.ac	2011-08-24 22:14:00 UTC (rev 5110)
+++ MOAB/trunk/configure.ac	2011-08-24 22:26:38 UTC (rev 5111)
@@ -298,7 +298,7 @@
 ################################################################################
 
 dnl FATHOM_CHECK_BOOST( [boost/pool/object_pool.hpp] )
-MK_CHECK_UNORDERED_MAP([CPPFLAGS="$CPPFLAGS -DUNORDERED_MAP_NS=$result -DHAVE_UNORDERED_MAP=${incdir}unordered_map"])
+MK_CHECK_UNORDERED_MAP([CPPFLAGS="$CPPFLAGS -DUNORDERED_MAP_NS=$result -DHAVE_UNORDERED_MAP=${incdir}unordered_map -DHAVE_UNORDERED_SET=${incdir}unordered_set"])
 
 ################################################################################
 #                              MPI OPTIONS

Modified: MOAB/trunk/src/moab/RangeMap.hpp
===================================================================
--- MOAB/trunk/src/moab/RangeMap.hpp	2011-08-24 22:14:00 UTC (rev 5110)
+++ MOAB/trunk/src/moab/RangeMap.hpp	2011-08-24 22:26:38 UTC (rev 5111)
@@ -82,6 +82,9 @@
   /** Find the value corresponding to the specified key.  Returns NullVal if not found */
   inline ValType find( KeyType key ) const;
   
+  /** Find the value corresponding to the specified key.  Returns false if not found */
+  inline bool find( KeyType key, ValType& val_out ) const;
+  
   /** Check if range contains key */
   inline bool exists( KeyType key ) const;
   
@@ -234,6 +237,20 @@
 }
 
 template <typename KeyType, typename ValType, ValType NullVal> inline
+bool RangeMap<KeyType,ValType,NullVal>::find( KeyType key, ValType& val ) const
+{
+  Range search = { key, 1, NullVal };
+  typename RangeList::const_iterator i = std::lower_bound( data.begin(), data.end(), search );
+  if (i == data.end() || i->begin > key) {
+    val = NullVal;
+    return false;
+  }
+  
+  val = i->value + key - i->begin;
+  return true;
+}
+
+template <typename KeyType, typename ValType, ValType NullVal> inline
 bool RangeMap<KeyType,ValType,NullVal>::exists( KeyType key ) const
 {
   Range search = { key, 1, NullVal };

Modified: MOAB/trunk/src/parallel/Makefile.am


More information about the moab-dev mailing list