[MOAB-dev] r5351 - MOAB/trunk/src/parallel

jvporter at wisc.edu jvporter at wisc.edu
Wed Jan 25 23:57:04 CST 2012


Author: jvporter
Date: 2012-01-25 23:57:04 -0600 (Wed, 25 Jan 2012)
New Revision: 5351

Modified:
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
Log:
Eliminate warnings in parallel HDF5 writer


Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2012-01-26 05:19:16 UTC (rev 5350)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2012-01-26 05:57:04 UTC (rev 5351)
@@ -42,8 +42,24 @@
 #include "IODebugTrack.hpp"
 #include "FileOptions.hpp"
 
+namespace {
+  template<bool Condition> struct STATIC_ASSERTION;
+  template<> struct STATIC_ASSERTION<true> {};
+}
+
+#define PP_CAT_(a,b) a ## b
+#define PP_CAT(a,b) PP_CAT_(a,b)
+#define STATIC_ASSERT(Condition) \
+  enum { PP_CAT(dummy, __LINE__) = sizeof(::STATIC_ASSERTION<(bool)(Condition)>) }
+
 namespace moab {
 
+// Need an MPI type that we can put handles in
+STATIC_ASSERT(sizeof(unsigned long) >= sizeof(EntityHandle));
+
+// Need an MPI type that we can put file IDs in
+STATIC_ASSERT(sizeof(unsigned long) >= sizeof(id_t));
+
 // This function doesn't do anything useful.  It's just a nice
 // place to set a break point to determine why the reader fails.
 static inline ErrorCode error( ErrorCode rval )
@@ -93,10 +109,10 @@
 #    define VALGRIND_CHECK_MEM_IS_DEFINED(a,b)
 #  endif
 #  ifndef VALGRIND_CHECK_MEM_IS_ADDRESSABLE
-#    define VALGRIND_CHECK_MEM_IS_ADDRESSABLE
+#    define VALGRIND_CHECK_MEM_IS_ADDRESSABLE(a, b)
 #  endif
 #  ifndef VALGRIND_MAKE_MEM_UNDEFINED
-#    define VALGRIND_MAKE_MEM_UNDEFINED
+#    define VALGRIND_MAKE_MEM_UNDEFINED(a, b)
 #  endif
 #endif
 
@@ -989,6 +1005,7 @@
   long max_count;
   long total;  
 };
+STATIC_ASSERT(sizeof(DatasetVals) == 3*sizeof(long));
 
 ErrorCode WriteHDF5Parallel::create_dataset( int num_datasets,
                                              const long* num_owned,
@@ -1012,7 +1029,6 @@


More information about the moab-dev mailing list