build: autoconf scaffolding to allow configurable msg priority types
authorRamprasad Venkataraman <ramv@illinois.edu>
Tue, 28 Aug 2012 19:57:28 +0000 (14:57 -0500)
committerRamprasad Venkataraman <ramv@illinois.edu>
Sun, 28 Oct 2012 01:13:12 +0000 (20:13 -0500)
src/scripts/configure
src/scripts/configure.in
src/scripts/conv-autoconfig.h.in

index 6f9097a7aedd2b2dd1370380692d59ac7dea2bf6..5daaa356cf36281b08e41fb57a298cb5d3c8d3e6 100755 (executable)
@@ -610,6 +610,7 @@ enable_controlpoint
 with_numa
 with_lbtime_type
 with_refnum_type
+with_prio_type
 with_metis
 '
       ac_precious_vars='build_alias
@@ -1239,6 +1240,7 @@ Optional Packages:
   --with-numa             support memory affinity with NUMA
   --with-lbtime-type=type load balancing timer type
   --with-refnum-type=type size of the envelope refnum field
+  --with-prio-type=type   size of expected message priorities
   --with-metis            support the METIS graph partitioner and associated
                           load balancer
 
@@ -2374,6 +2376,47 @@ else
   test_finish 1
 fi
 
+
+
+# Check whether --with-prio-type was given.
+if test "${with_prio_type+set}" = set; then :
+  withval=$with_prio_type;
+else
+  with_prio_type=bitvec
+fi
+
+
+if test "$with_prio_type" = "char" -o "$with_prio_type" = "short" -o "$with_prio_type" = "int" -o "$with_prio_type" = "long"
+then
+  Echo "Configuring support for message priorities of sizeof type $with_prio_type"
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_USE_STL_MSGQ 1
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_MSG_PRIO_TYPE $with_prio_type
+_ACEOF
+
+elif test "$with_prio_type" = "bitvec"
+then
+  Echo "Configuring support for message priorities of arbitrary size (bitvectors)"
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_USE_STL_MSGQ 0
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define CMK_MSG_PRIO_TYPE $with_prio_type
+_ACEOF
+
+else
+  Echo "Invalid size ($with_prio_type) specified for message priorities. Can only accept char, short, int, long and bitvec"
+  test_finish 1
+fi
+
 #### Check if compiler if 64 bit ####
 cat > $t <<EOT
 #include <stdio.h>
index d6ea4fd390cd5b39213fbbeceb2698eed8b099dc..ccd0dfb8eb949f8b0d45f19b312a3cf366a20f39 100644 (file)
@@ -552,6 +552,27 @@ else
   test_finish 1
 fi
 
+
+AC_ARG_WITH([prio-type],
+            [AS_HELP_STRING([--with-prio-type=type],
+                            [size of expected message priorities])],
+            [], [with_prio_type=bitvec])
+
+if test "$with_prio_type" = "char" -o "$with_prio_type" = "short" -o "$with_prio_type" = "int" -o "$with_prio_type" = "long"
+then
+  Echo "Configuring support for message priorities of sizeof type $with_prio_type"
+  AC_DEFINE_UNQUOTED(CMK_USE_STL_MSGQ, 1, [whether charm scheduler should use an STL-based msg q])
+  AC_DEFINE_UNQUOTED(CMK_MSG_PRIO_TYPE, $with_prio_type, [expected message priorities are sizeof $with_prio_type])
+elif test "$with_prio_type" = "bitvec"
+then
+  Echo "Configuring support for message priorities of arbitrary size (bitvectors)"
+  AC_DEFINE_UNQUOTED(CMK_USE_STL_MSGQ, 0, [whether charm scheduler should use an STL-based msg q])
+  AC_DEFINE_UNQUOTED(CMK_MSG_PRIO_TYPE, $with_prio_type, [expected message priorities are arbitrarily sized])
+else
+  Echo "Invalid size ($with_prio_type) specified for message priorities. Can only accept char, short, int, long and bitvec"
+  test_finish 1
+fi
+
 #### Check if compiler if 64 bit ####
 cat > $t <<EOT
 #include <stdio.h>
index 0cc02ab9382797e52c73293f3e6826a6bfb6ba9f..874fb791156f4a946305443b557e9b7d4f7a023c 100644 (file)
 /* envelope refnum field set to UInt */
 #undef CMK_REFNUM_TYPE
 
+/* Should charm use an STL-based msg q */
+#undef CMK_USE_STL_MSGQ
+
+/* expected size of message priorities fields */
+#undef CMK_MSG_PRIO_TYPE
+
 /* disable replay */
 #undef CMK_REPLAYSYSTEM