Select the size of the envelop refnum field at configure time
authorPhil Miller <mille121@illinois.edu>
Mon, 28 Feb 2011 23:45:21 +0000 (17:45 -0600)
committerPhil Miller <mille121@illinois.edu>
Mon, 28 Feb 2011 23:45:40 +0000 (17:45 -0600)
src/ck-core/charm.h
src/ck-core/ck.C
src/ck-core/envelope.h
src/scripts/configure
src/scripts/configure.in
src/scripts/conv-autoconfig.h.in

index c751e7ccb2daf380fec50174f5f503fb4393f969..af75321613a2a3b64ef9b8b584196c1736c6b258 100644 (file)
@@ -293,8 +293,8 @@ extern int  CkChareMsgPrep(int eIdx, void *msg,const CkChareID *pCid);
 extern void CkGroupMsgPrep(int eIdx, void *msg, CkGroupID gID);
 extern void CkNodeGroupMsgPrep(int eIdx, void *msg, CkGroupID gID);
 
-extern void CkSetRefNum(void *msg, int ref);
-extern int  CkGetRefNum(void *msg);
+extern void CkSetRefNum(void *msg, CMK_REFNUM_TYPE ref);
+extern CMK_REFNUM_TYPE  CkGetRefNum(void *msg);
 extern int  CkGetSrcPe(void *msg);
 extern int  CkGetSrcNode(void *msg);
 
index 29d0e9fd28e0898faac7dc73e34ff50fa59e295c..a54c3639d2b7b2e5acd34e87da72b41786d75547 100644 (file)
@@ -436,13 +436,13 @@ void CUDACallbackManager(void *fn) {
 #endif
 
 extern "C"
-void CkSetRefNum(void *msg, int ref)
+void CkSetRefNum(void *msg, CMK_REFNUM_TYPE ref)
 {
   UsrToEnv(msg)->setRef(ref);
 }
 
 extern "C"
-int CkGetRefNum(void *msg)
+CMK_REFNUM_TYPE CkGetRefNum(void *msg)
 {
   return UsrToEnv(msg)->getRef();
 }
index b7b7e981a873a492594c7bbba0340b4eaaaa216d..95d5c9c69b5a286082c1033a8c78473595e58785 100644 (file)
@@ -194,9 +194,9 @@ public:
 #endif
 private:
     u_type type;           ///< Depends on message type (attribs.mtype)
-    UShort ref;            ///< Used by futures
+    CMK_REFNUM_TYPE ref;            ///< Used by futures
     s_attribs attribs;
-    UChar align[CkMsgAlignOffset(CmiReservedHeaderSize+sizeof(u_type)+sizeof(UShort)+sizeof(s_attribs))];    ///< padding to make sure sizeof(double) alignment
+    UChar align[CkMsgAlignOffset(CmiReservedHeaderSize+sizeof(u_type)+sizeof(CMK_REFNUM_TYPE)+sizeof(s_attribs))];    ///< padding to make sure sizeof(double) alignment
     
     //This struct should now be sizeof(void*) aligned.
     UShort priobits;   ///< Number of bits of priority data after user data
index 715a44a49cea33c8183e197888d9769ff3ecefbd..735b18237308673483461f38dc2865cd5e2d431b 100755 (executable)
@@ -606,6 +606,7 @@ enable_charmdebug
 enable_replay
 enable_controlpoint
 with_numa
+with_refnum_type
 with_metis
 '
       ac_precious_vars='build_alias
@@ -1230,6 +1231,7 @@ Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-numa             support memory affinity with NUMA
+  --with-refnum-type=type size of the envelope refnum field
   --with-metis            support the METIS graph partitioner and associated
                           load balancer
 
@@ -2172,6 +2174,36 @@ fi
 
 # Perform the tests
 
+
+# Check whether --with-refnum-type was given.
+if test "${with_refnum_type+set}" = set; then :
+  withval=$with_refnum_type;
+else
+  with_refnum_type=no
+fi
+
+
+if test "$with_refnum_type" = "no" -o "$with_refnum_type" = "short"
+then
+  Echo "Setting charm++ envelop refnum field to unsigned short"
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_REFNUM_TYPE unsigned short
+_ACEOF
+
+elif test "$with_refnum_type" = "int"
+then
+  Echo "Setting charm++ envelop refnum field to unsigned int"
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_REFNUM_TYPE unsigned int
+_ACEOF
+
+else
+  Echo "Invalid size specified for refnum field"
+  test_finish 1
+fi
+
 #### Check if compiler if 64 bit ####
 cat > $t <<EOT
 #include <stdio.h>
index ba3f205bfd8285cb5726b7b1514cc9310473b41f..19043abb4ed5af785e07c88fe7dafa5634ec19d3 100644 (file)
@@ -409,6 +409,24 @@ fi
 
 # Perform the tests
 
+AC_ARG_WITH([refnum-type],
+            [AS_HELP_STRING([--with-refnum-type=type],
+                            [size of the envelope refnum field])],
+            [], [with_refnum_type=no])
+
+if test "$with_refnum_type" = "no" -o "$with_refnum_type" = "short"
+then
+  Echo "Setting charm++ envelop refnum field to unsigned short"
+  AC_DEFINE_UNQUOTED(CMK_REFNUM_TYPE, unsigned short, [envelope refnum field set to UShort])
+elif test "$with_refnum_type" = "int"
+then
+  Echo "Setting charm++ envelop refnum field to unsigned int"
+  AC_DEFINE_UNQUOTED(CMK_REFNUM_TYPE, unsigned int, [envelope refnum field set to UInt])
+else
+  Echo "Invalid size specified for refnum field"
+  test_finish 1
+fi
+
 #### Check if compiler if 64 bit ####
 cat > $t <<EOT
 #include <stdio.h>
index 53974c17883d03d03ce716fa5a6e43e7c304bc3a..102177f15e7dfaa3e2996a321507de35cbc2c280 100644 (file)
 /* Python version */
 #undef CMK_PYTHON_VERSION
 
+/* envelope refnum field set to UInt */
+#undef CMK_REFNUM_TYPE
+
 /* disable replay */
 #undef CMK_REPLAYSYSTEM