msgQ: Assert that charm build supports priorities of requested size
authorRamprasad Venkataraman <ramv@illinois.edu>
Wed, 29 Aug 2012 15:41:02 +0000 (10:41 -0500)
committerRamprasad Venkataraman <ramv@illinois.edu>
Sun, 28 Oct 2012 01:13:13 +0000 (20:13 -0500)
src/ck-core/envelope.h

index 4df839115c3409bcecab4022a6d4677f432db1f3..e336fff2b9efea0364e49dfb8ba3b6e72c62a1da 100644 (file)
@@ -241,6 +241,11 @@ private:
     static envelope *alloc(const UChar type, const UInt size=0, const UShort prio=0)
     {
       CkAssert(type>=NewChareMsg && type<=ForArrayEltMsg);
+#if CMK_USE_STL_MSGQ
+      // Ideally, this should be a static compile-time assert. However we need API changes for that
+      CkAssert(sizeof(CMK_MSG_PRIO_TYPE) >= sizeof(int)*CkPriobitsToInts(prio));
+#endif
+
       register UInt tsize = sizeof(envelope)+ 
             CkMsgAlignLength(size)+
            sizeof(int)*CkPriobitsToInts(prio);