From 76583dd9c977b4ac4e81e5f1e36b681a0ca77372 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Thu, 13 Nov 2008 23:00:20 +0000
Subject: [PATCH] svn merge -r15661:15698
 https://eris.llnl.gov/svn/slurm/branches/slurm-1.3

---
 Makefile.in                                   |   1 +
 NEWS                                          |   8 +-
 auxdir/Makefile.in                            |   1 +
 auxdir/x_ac_bluegene.m4                       |  20 +-
 configure                                     | 107 ++--
 configure.ac                                  |   3 +
 contribs/Makefile.in                          |   1 +
 contribs/perlapi/Makefile.in                  |   1 +
 contribs/phpext/Makefile.in                   |   1 +
 contribs/python/Makefile.in                   |   1 +
 contribs/python/hostlist/Makefile.in          |   1 +
 contribs/python/hostlist/test/Makefile.in     |   1 +
 contribs/torque/Makefile.in                   |   1 +
 doc/Makefile.in                               |   1 +
 doc/html/Makefile.in                          |   1 +
 doc/man/Makefile.in                           |   1 +
 src/Makefile.in                               |   1 +
 src/api/Makefile.in                           |   1 +
 src/api/pmi.c                                 |   2 +-
 src/common/Makefile.in                        |   1 +
 src/common/node_select.c                      |   4 +
 src/common/parse_config.c                     |   4 +-
 src/common/slurm_protocol_api.c               |  45 ++
 src/common/slurm_protocol_api.h               |  13 +
 src/common/slurmdbd_defs.c                    |  25 +-
 src/database/Makefile.in                      |   1 +
 src/plugins/Makefile.in                       |   1 +
 src/plugins/accounting_storage/Makefile.in    |   1 +
 .../accounting_storage/filetxt/Makefile.in    |   1 +
 .../accounting_storage/mysql/Makefile.in      |   1 +
 .../mysql/accounting_storage_mysql.c          |   4 +-
 .../accounting_storage/none/Makefile.in       |   1 +
 .../accounting_storage/pgsql/Makefile.in      |   1 +
 .../pgsql/accounting_storage_pgsql.c          |   4 +-
 .../accounting_storage/slurmdbd/Makefile.in   |   1 +
 src/plugins/auth/Makefile.in                  |   1 +
 src/plugins/auth/authd/Makefile.in            |   1 +
 src/plugins/auth/munge/Makefile.in            |   1 +
 src/plugins/auth/none/Makefile.in             |   1 +
 src/plugins/checkpoint/Makefile.in            |   1 +
 src/plugins/checkpoint/aix/Makefile.in        |   1 +
 src/plugins/checkpoint/none/Makefile.in       |   1 +
 src/plugins/checkpoint/ompi/Makefile.in       |   1 +
 src/plugins/checkpoint/xlch/Makefile.in       |   1 +
 src/plugins/crypto/Makefile.in                |   1 +
 src/plugins/crypto/munge/Makefile.in          |   1 +
 src/plugins/crypto/openssl/Makefile.in        |   1 +
 src/plugins/jobacct_gather/Makefile.in        |   1 +
 src/plugins/jobacct_gather/aix/Makefile.in    |   1 +
 src/plugins/jobacct_gather/linux/Makefile.in  |   1 +
 src/plugins/jobacct_gather/none/Makefile.in   |   1 +
 src/plugins/jobcomp/Makefile.in               |   1 +
 src/plugins/jobcomp/filetxt/Makefile.in       |   1 +
 src/plugins/jobcomp/mysql/Makefile.in         |   1 +
 src/plugins/jobcomp/mysql/jobcomp_mysql.c     |   4 +-
 src/plugins/jobcomp/none/Makefile.in          |   1 +
 src/plugins/jobcomp/pgsql/Makefile.in         |   1 +
 src/plugins/jobcomp/pgsql/jobcomp_pgsql.c     |   4 +-
 src/plugins/jobcomp/script/Makefile.in        |   1 +
 src/plugins/mpi/Makefile.in                   |   1 +
 src/plugins/mpi/lam/Makefile.in               |   1 +
 src/plugins/mpi/mpich1_p4/Makefile.in         |   1 +
 src/plugins/mpi/mpich1_shmem/Makefile.in      |   1 +
 src/plugins/mpi/mpichgm/Makefile.in           |   1 +
 src/plugins/mpi/mpichmx/Makefile.in           |   1 +
 src/plugins/mpi/mvapich/Makefile.in           |   1 +
 src/plugins/mpi/none/Makefile.in              |   1 +
 src/plugins/mpi/openmpi/Makefile.in           |   1 +
 src/plugins/priority/Makefile.in              |   1 +
 src/plugins/priority/basic/Makefile.in        |   1 +
 src/plugins/priority/multifactor/Makefile.in  |   1 +
 src/plugins/proctrack/Makefile.in             |   1 +
 src/plugins/proctrack/aix/Makefile.in         |   1 +
 src/plugins/proctrack/linuxproc/Makefile.in   |   1 +
 src/plugins/proctrack/pgid/Makefile.in        |   1 +
 src/plugins/proctrack/rms/Makefile.in         |   1 +
 src/plugins/proctrack/sgi_job/Makefile.in     |   1 +
 src/plugins/sched/Makefile.in                 |   1 +
 src/plugins/sched/backfill/Makefile.in        |   1 +
 src/plugins/sched/builtin/Makefile.in         |   1 +
 src/plugins/sched/gang/Makefile.in            |   1 +
 src/plugins/sched/hold/Makefile.in            |   1 +
 src/plugins/sched/wiki/Makefile.in            |   1 +
 src/plugins/sched/wiki2/Makefile.in           |   1 +
 src/plugins/select/Makefile.in                |   1 +
 src/plugins/select/bluegene/Makefile.in       |   1 +
 .../bluegene/block_allocator/Makefile.am      |   1 +
 .../bluegene/block_allocator/Makefile.in      |   1 +
 .../block_allocator/block_allocator.c         |   2 +-
 .../select/bluegene/plugin/Makefile.am        |  19 +
 .../select/bluegene/plugin/Makefile.in        | 156 +++--
 .../bluegene/plugin/bg_record_functions.c     | 162 ++++--
 .../bluegene/plugin/bg_switch_connections.c   | 224 +++++++-
 src/plugins/select/bluegene/plugin/bluegene.c | 166 +++++-
 src/plugins/select/bluegene/plugin/bluegene.h |   7 +
 .../select/bluegene/plugin/dynamic_block.c    | 541 ++++++++++++++++--
 .../select/bluegene/plugin/dynamic_block.h    |   6 +
 src/plugins/select/cons_res/Makefile.in       |   1 +
 src/plugins/select/linear/Makefile.in         |   1 +
 src/plugins/switch/Makefile.in                |   1 +
 src/plugins/switch/elan/Makefile.in           |   1 +
 src/plugins/switch/federation/Makefile.in     |   1 +
 src/plugins/switch/none/Makefile.in           |   1 +
 src/plugins/task/Makefile.in                  |   1 +
 src/plugins/task/affinity/Makefile.in         |   1 +
 src/plugins/task/none/Makefile.in             |   1 +
 src/sacct/Makefile.in                         |   1 +
 src/sacctmgr/Makefile.in                      |   1 +
 src/salloc/Makefile.in                        |   1 +
 src/sattach/Makefile.in                       |   1 +
 src/sbatch/Makefile.in                        |   1 +
 src/sbcast/Makefile.in                        |   1 +
 src/scancel/Makefile.in                       |   1 +
 src/scontrol/Makefile.in                      |   1 +
 src/sinfo/Makefile.in                         |   1 +
 src/slurmctld/Makefile.in                     |   1 +
 src/slurmd/Makefile.in                        |   1 +
 src/slurmd/slurmd/Makefile.in                 |   1 +
 src/slurmd/slurmstepd/Makefile.in             |   1 +
 src/slurmdbd/Makefile.in                      |   1 +
 src/slurmdbd/rpc_mgr.c                        |   9 +-
 src/smap/Makefile.in                          |   1 +
 src/squeue/Makefile.in                        |   1 +
 src/sreport/Makefile.in                       |   1 +
 src/srun/Makefile.am                          |   8 +-
 src/srun/Makefile.in                          |   9 +-
 src/sshare/Makefile.in                        |   1 +
 src/sstat/Makefile.in                         |   1 +
 src/strigger/Makefile.in                      |   1 +
 src/sview/Makefile.in                         |   1 +
 testsuite/Makefile.in                         |   1 +
 testsuite/expect/Makefile.in                  |   1 +
 testsuite/slurm_unit/Makefile.in              |   1 +
 testsuite/slurm_unit/api/Makefile.in          |   1 +
 testsuite/slurm_unit/api/manual/Makefile.in   |   1 +
 testsuite/slurm_unit/common/Makefile.in       |   1 +
 testsuite/slurm_unit/slurmctld/Makefile.in    |   1 +
 testsuite/slurm_unit/slurmd/Makefile.in       |   1 +
 138 files changed, 1418 insertions(+), 250 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index c2bc353e856..2ec1c64ac8c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -119,6 +119,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/NEWS b/NEWS
index efae140763a..d56e97ee8ee 100644
--- a/NEWS
+++ b/NEWS
@@ -94,7 +94,8 @@ documents those changes that are of interest to users and admins.
 
 * Changes in SLURM 1.3.11
 =========================
- -- Bluegene/P support added (minimally tested, but builds correctly).
+ -- Bluegene/P support added (minimally tested, but builds correctly, 
+    no dynamic layout mode).
  -- Fix infinite loop when using accounting_storage/mysql plugin either from
     the slurmctld or slurmdbd daemon.
  -- Added more thread safety for assoc_mgr in the controller.
@@ -110,7 +111,10 @@ documents those changes that are of interest to users and admins.
  -- Add support for srun --cpus-per-task=0. This can be used to spawn tasks
     without allocating resouces for the job step from the job's allocation
     when running multiple job steps with the --exclusive option.
- 
+ -- Remove registration messages from saved messages when bringing down cluster.
+    Without causes deadlock if wrong cluster name is given.
+ -- Correction to build like for srun debugger (export symbols).
+  
 * Changes in SLURM 1.3.10
 =========================
  -- Fix several bugs in the hostlist functions:
diff --git a/auxdir/Makefile.in b/auxdir/Makefile.in
index 96949443d9f..97522a26b90 100644
--- a/auxdir/Makefile.in
+++ b/auxdir/Makefile.in
@@ -77,6 +77,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/auxdir/x_ac_bluegene.m4 b/auxdir/x_ac_bluegene.m4
index e04945b5874..75631a114a9 100644
--- a/auxdir/x_ac_bluegene.m4
+++ b/auxdir/x_ac_bluegene.m4
@@ -15,6 +15,8 @@
 
 AC_DEFUN([X_AC_BGL],
 [
+	ac_bluegene_loaded=no
+
    	AC_ARG_WITH(db2, AS_HELP_STRING(--with-db2-dir=PATH,Specify path to DB2 librarys parent directory), [ trydb2dir=$withval ])
 
 	# test for bluegene emulation mode
@@ -39,8 +41,8 @@ AC_DEFUN([X_AC_BGL],
       		AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
     		AC_MSG_NOTICE([Running in BG/L emulation mode])
 		bg_default_dirs=""
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
 	else
   	   	bg_default_dirs="/bgl/BlueLight/ppcfloor/bglsys /opt/IBM/db2/V8.1 /u/bgdb2cli/sqllib /home/bgdb2cli/sqllib"
 	fi
@@ -97,8 +99,8 @@ AC_DEFUN([X_AC_BGL],
          	AS_HELP_STRING(--with-bg-serial=NAME,set BG_SERIAL value), [bg_serial="$withval"])
      		AC_MSG_RESULT($bg_serial)
      		AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])	
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
   	fi
 
    	AC_SUBST(BG_INCLUDES)
@@ -115,7 +117,7 @@ AC_DEFUN([X_AC_BGP],
     	esac ])	
 
 	# Skip if already set
-   	if test "x$bluegene_loaded" = "xyes" ; then 
+   	if test "x$ac_bluegene_loaded" = "xyes" ; then 
 		bg_default_dirs=""
 	elif test "x$bgp_emulation" = "xyes"; then
 		AC_DEFINE(HAVE_BG, 1, [Define to 1 if emulating or running on Blue Gene system])
@@ -123,8 +125,8 @@ AC_DEFUN([X_AC_BGP],
       		AC_DEFINE(HAVE_FRONT_END, 1, [Define to 1 if running slurmd on front-end only])
     		AC_MSG_NOTICE([Running in BG/P emulation mode])
 		bg_default_dirs=""
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
 	else
 		bg_default_dirs="/bgsys/drivers/ppcfloor"
 	fi	
@@ -173,8 +175,8 @@ AC_DEFUN([X_AC_BGP],
     		AC_ARG_WITH(bg-serial,, [bg_serial="$withval"])
      		AC_MSG_RESULT($bg_serial)
      		AC_DEFINE_UNQUOTED(BG_SERIAL, "$bg_serial", [Define the BG_SERIAL value])	
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
    	fi
 
    	AC_SUBST(BG_INCLUDES)
diff --git a/configure b/configure
index 0c720174948..e19d5186cae 100755
--- a/configure
+++ b/configure
@@ -916,6 +916,9 @@ PTHREAD_CC
 PTHREAD_LIBS
 PTHREAD_CFLAGS
 BG_INCLUDES
+BLUEGENE_LOADED_TRUE
+BLUEGENE_LOADED_FALSE
+BLUEGENE_LOADED
 SEMAPHORE_SOURCES
 SEMAPHORE_LIBS
 NCURSES
@@ -7126,7 +7129,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 7129 "configure"' > conftest.$ac_ext
+  echo '#line 7132 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9232,11 +9235,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9235: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9238: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9239: \$? = $ac_status" >&5
+   echo "$as_me:9242: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9522,11 +9525,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9525: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9528: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9529: \$? = $ac_status" >&5
+   echo "$as_me:9532: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -9626,11 +9629,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9629: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9632: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:9633: \$? = $ac_status" >&5
+   echo "$as_me:9636: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12003,7 +12006,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12006 "configure"
+#line 12009 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12103,7 +12106,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12106 "configure"
+#line 12109 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -14504,11 +14507,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14507: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14510: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:14511: \$? = $ac_status" >&5
+   echo "$as_me:14514: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -14608,11 +14611,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:14611: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:14614: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:14615: \$? = $ac_status" >&5
+   echo "$as_me:14618: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16206,11 +16209,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16209: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16212: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16213: \$? = $ac_status" >&5
+   echo "$as_me:16216: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16310,11 +16313,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16313: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16316: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16317: \$? = $ac_status" >&5
+   echo "$as_me:16320: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -18530,11 +18533,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18533: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18536: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18537: \$? = $ac_status" >&5
+   echo "$as_me:18540: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18820,11 +18823,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18823: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18826: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:18827: \$? = $ac_status" >&5
+   echo "$as_me:18830: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -18924,11 +18927,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:18927: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:18930: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:18931: \$? = $ac_status" >&5
+   echo "$as_me:18934: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -22778,17 +22781,13 @@ echo "$as_me: WARNING: Unable to locate PLPA processor affinity functions" >&2;}
 #
   cpuset_default_dir="/dev/cpuset"
 
-# Check whether --with-cpuset_dir was given.
-if test "${with_cpuset_dir+set}" = set; then
-  withval=$with_cpuset_dir; try_path=$withval
+# Check whether --with-cpusetdir was given.
+if test "${with_cpusetdir+set}" = set; then
+  withval=$with_cpusetdir; try_path=$withval
 fi
 
   for cpuset_dir in $try_path "" $cpuset_default_dir; do
-{ echo "$as_me:$LINENO: WARNING: cpuset_dir $cpuset_dir testing" >&5
-echo "$as_me: WARNING: cpuset_dir $cpuset_dir testing" >&2;}
     if test -d "$cpuset_dir" ; then
-{ echo "$as_me:$LINENO: WARNING: cpuset $cpuset_dir found" >&5
-echo "$as_me: WARNING: cpuset $cpuset_dir found" >&2;}
 
 cat >>confdefs.h <<_ACEOF
 #define CPUSET_DIR "$cpuset_dir"
@@ -24668,6 +24667,8 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 LIBS="$PTHREAD_LIBS $LIBS"
 
 
+	ac_bluegene_loaded=no
+
 
 # Check whether --with-db2 was given.
 if test "${with_db2+set}" = set; then
@@ -24720,8 +24721,8 @@ _ACEOF
     		{ echo "$as_me:$LINENO: Running in BG/L emulation mode" >&5
 echo "$as_me: Running in BG/L emulation mode" >&6;}
 		bg_default_dirs=""
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
 	else
   	   	bg_default_dirs="/bgl/BlueLight/ppcfloor/bglsys /opt/IBM/db2/V8.1 /u/bgdb2cli/sqllib /home/bgdb2cli/sqllib"
 	fi
@@ -24856,8 +24857,8 @@ cat >>confdefs.h <<_ACEOF
 #define BG_SERIAL "$bg_serial"
 _ACEOF
 
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
   	fi
 
 
@@ -24877,7 +24878,7 @@ fi
 
 
 	# Skip if already set
-   	if test "x$bluegene_loaded" = "xyes" ; then
+   	if test "x$ac_bluegene_loaded" = "xyes" ; then
 		bg_default_dirs=""
 	elif test "x$bgp_emulation" = "xyes"; then
 
@@ -24898,8 +24899,8 @@ _ACEOF
     		{ echo "$as_me:$LINENO: Running in BG/P emulation mode" >&5
 echo "$as_me: Running in BG/P emulation mode" >&6;}
 		bg_default_dirs=""
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
 	else
 		bg_default_dirs="/bgsys/drivers/ppcfloor"
 	fi
@@ -25023,12 +25024,22 @@ cat >>confdefs.h <<_ACEOF
 #define BG_SERIAL "$bg_serial"
 _ACEOF
 
- 		#define bluegene_loaded so we don't load another bluegene conf
-		bluegene_loaded=yes
+ 		#define ac_bluegene_loaded so we don't load another bluegene conf
+		ac_bluegene_loaded=yes
    	fi
 
 
 
+ if test "x$ac_bluegene_loaded" = "xyes"; then
+  BLUEGENE_LOADED_TRUE=
+  BLUEGENE_LOADED_FALSE='#'
+else
+  BLUEGENE_LOADED_TRUE='#'
+  BLUEGENE_LOADED_FALSE=
+fi
+
+
+
 
 	# This is here to avoid a bug in the gcc compiler 3.4.6
 	# Without this flag there is a bug when pointing to other functions
@@ -27641,6 +27652,13 @@ echo "$as_me: error: conditional \"HAVE_UNSETENV\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${BLUEGENE_LOADED_TRUE}" && test -z "${BLUEGENE_LOADED_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"BLUEGENE_LOADED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BLUEGENE_LOADED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${HAVE_SOME_CURSES_TRUE}" && test -z "${HAVE_SOME_CURSES_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"HAVE_SOME_CURSES\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -28543,6 +28561,9 @@ PTHREAD_CC!$PTHREAD_CC$ac_delim
 PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim
 PTHREAD_CFLAGS!$PTHREAD_CFLAGS$ac_delim
 BG_INCLUDES!$BG_INCLUDES$ac_delim
+BLUEGENE_LOADED_TRUE!$BLUEGENE_LOADED_TRUE$ac_delim
+BLUEGENE_LOADED_FALSE!$BLUEGENE_LOADED_FALSE$ac_delim
+BLUEGENE_LOADED!$BLUEGENE_LOADED$ac_delim
 SEMAPHORE_SOURCES!$SEMAPHORE_SOURCES$ac_delim
 SEMAPHORE_LIBS!$SEMAPHORE_LIBS$ac_delim
 NCURSES!$NCURSES$ac_delim
@@ -28585,9 +28606,6 @@ HAVE_OPENSSL_FALSE!$HAVE_OPENSSL_FALSE$ac_delim
 HAVE_OPENSSL!$HAVE_OPENSSL$ac_delim
 MUNGE_LIBS!$MUNGE_LIBS$ac_delim
 MUNGE_CPPFLAGS!$MUNGE_CPPFLAGS$ac_delim
-MUNGE_LDFLAGS!$MUNGE_LDFLAGS$ac_delim
-WITH_MUNGE_TRUE!$WITH_MUNGE_TRUE$ac_delim
-WITH_MUNGE_FALSE!$WITH_MUNGE_FALSE$ac_delim
 _ACEOF
 
   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
@@ -28629,6 +28647,9 @@ _ACEOF
 ac_delim='%!_!# '
 for ac_last_try in false false false false false :; do
   cat >conf$$subs.sed <<_ACEOF
+MUNGE_LDFLAGS!$MUNGE_LDFLAGS$ac_delim
+WITH_MUNGE_TRUE!$WITH_MUNGE_TRUE$ac_delim
+WITH_MUNGE_FALSE!$WITH_MUNGE_FALSE$ac_delim
 AUTHD_LIBS!$AUTHD_LIBS$ac_delim
 AUTHD_CFLAGS!$AUTHD_CFLAGS$ac_delim
 WITH_AUTHD_TRUE!$WITH_AUTHD_TRUE$ac_delim
@@ -28637,7 +28658,7 @@ UTIL_LIBS!$UTIL_LIBS$ac_delim
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 6; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
diff --git a/configure.ac b/configure.ac
index 8b7c16a3b18..fff07f932f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,9 @@ LIBS="$PTHREAD_LIBS $LIBS"
 
 X_AC_BGL
 X_AC_BGP
+AM_CONDITIONAL(BLUEGENE_LOADED, test "x$ac_bluegene_loaded" = "xyes")
+AC_SUBST(BLUEGENE_LOADED)
+
 X_AC_CFLAGS
 X_AC_XCPU
 X_AC_SLURM_SEMAPHORE
diff --git a/contribs/Makefile.in b/contribs/Makefile.in
index 901ac4182b6..ebdd17bfd67 100644
--- a/contribs/Makefile.in
+++ b/contribs/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/perlapi/Makefile.in b/contribs/perlapi/Makefile.in
index 67200500231..aa466269e98 100644
--- a/contribs/perlapi/Makefile.in
+++ b/contribs/perlapi/Makefile.in
@@ -76,6 +76,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/phpext/Makefile.in b/contribs/phpext/Makefile.in
index 55b80355e5d..d281afffae1 100644
--- a/contribs/phpext/Makefile.in
+++ b/contribs/phpext/Makefile.in
@@ -76,6 +76,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/python/Makefile.in b/contribs/python/Makefile.in
index 9b6fb5d4208..19e505d1f50 100644
--- a/contribs/python/Makefile.in
+++ b/contribs/python/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/python/hostlist/Makefile.in b/contribs/python/hostlist/Makefile.in
index 0b11691ae72..0e7f64a34c5 100644
--- a/contribs/python/hostlist/Makefile.in
+++ b/contribs/python/hostlist/Makefile.in
@@ -89,6 +89,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/python/hostlist/test/Makefile.in b/contribs/python/hostlist/test/Makefile.in
index cd158472188..2e3e8347168 100644
--- a/contribs/python/hostlist/test/Makefile.in
+++ b/contribs/python/hostlist/test/Makefile.in
@@ -76,6 +76,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/contribs/torque/Makefile.in b/contribs/torque/Makefile.in
index 61cb0815871..6346d7bb496 100644
--- a/contribs/torque/Makefile.in
+++ b/contribs/torque/Makefile.in
@@ -83,6 +83,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 97976e86629..3a50b00121d 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in
index 9b93fd11f59..442cdd633c3 100644
--- a/doc/html/Makefile.in
+++ b/doc/html/Makefile.in
@@ -87,6 +87,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in
index c59a2bad3da..54ec39ac1bc 100644
--- a/doc/man/Makefile.in
+++ b/doc/man/Makefile.in
@@ -84,6 +84,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/Makefile.in b/src/Makefile.in
index 292ab1514cd..0055bd8bc21 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/api/Makefile.in b/src/api/Makefile.in
index a820b5d8e1a..2435a69519c 100644
--- a/src/api/Makefile.in
+++ b/src/api/Makefile.in
@@ -136,6 +136,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/api/pmi.c b/src/api/pmi.c
index 3ddac7b7243..a0c0f53d376 100644
--- a/src/api/pmi.c
+++ b/src/api/pmi.c
@@ -760,7 +760,7 @@ int PMI_Get_clique_ranks( int ranks[], int length )
 	env = getenv("SLURM_GTIDS");
 	if (env) {
 		int i = 0;
-		char *tid, *tids, *last;
+		char *tid, *tids, *last = NULL;
 		tids = strdup(env);
 		tid = strtok_r(tids, ",", &last);
 		while (tid) {
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 44cc57217ab..50adee465e3 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -185,6 +185,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/common/node_select.c b/src/common/node_select.c
index c20ec1a62c9..a85a927ba40 100644
--- a/src/common/node_select.c
+++ b/src/common/node_select.c
@@ -658,8 +658,10 @@ static int _unpack_node_info(bg_info_record_t *bg_info_record, Buf buffer)
 	bg_info_record->state     = (int) uint16_tmp;
 	safe_unpack16(&uint16_tmp, buffer);
 	bg_info_record->conn_type = (int) uint16_tmp;
+#ifdef HAVE_BGL
 	safe_unpack16(&uint16_tmp, buffer);
 	bg_info_record->node_use = (int) uint16_tmp;
+#endif
 	safe_unpack16(&uint16_tmp, buffer);
 	bg_info_record->quarter = (int) uint16_tmp;
 	safe_unpack16(&uint16_tmp, buffer);
@@ -680,8 +682,10 @@ static int _unpack_node_info(bg_info_record_t *bg_info_record, Buf buffer)
 		bg_info_record->ionode_inx = bitfmt2int(bp_inx_str);
 		xfree(bp_inx_str);
 	}
+#ifdef HAVE_BGL
 	safe_unpackstr_xmalloc(&bg_info_record->blrtsimage,   &uint32_tmp, 
 			       buffer);
+#endif
 	safe_unpackstr_xmalloc(&bg_info_record->linuximage,   &uint32_tmp, 
 			       buffer);
 	safe_unpackstr_xmalloc(&bg_info_record->mloaderimage, &uint32_tmp, 
diff --git a/src/common/parse_config.c b/src/common/parse_config.c
index e6356d5de66..bcbed7f1f58 100644
--- a/src/common/parse_config.c
+++ b/src/common/parse_config.c
@@ -67,7 +67,7 @@
 static regex_t keyvalue_re;
 static char *keyvalue_pattern =
 	"^[[:space:]]*"
-	"([[:alpha:]]+)" /* key */
+	"([[:alnum:]]+)" /* key */
 	"[[:space:]]*=[[:space:]]*"
 	"((\"([^\"]*)\")|([^[:space:]]+))" /* value: quoted with whitespace,
 					    * or unquoted and no whitespace */
@@ -235,6 +235,7 @@ static int _keyvalue_regex(const char *line,
 	*value = NULL;
 	*remaining = (char *)line;
 	memset(pmatch, 0, sizeof(regmatch_t)*nmatch);
+	
 	if (regexec(&keyvalue_re, line, nmatch, pmatch, 0)
 	    == REG_NOMATCH) {
 		return -1;
@@ -243,7 +244,6 @@ static int _keyvalue_regex(const char *line,
 	*key = (char *)(xstrndup(line + pmatch[1].rm_so,
 				 pmatch[1].rm_eo - pmatch[1].rm_so));
 
-
 	if (pmatch[4].rm_so != -1) {
 		*value = (char *)(xstrndup(line + pmatch[4].rm_so,
 					   pmatch[4].rm_eo - pmatch[4].rm_so));
diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c
index d2034a72aba..3d524f427f7 100644
--- a/src/common/slurm_protocol_api.c
+++ b/src/common/slurm_protocol_api.c
@@ -961,6 +961,29 @@ uint32_t slurm_get_accounting_storage_port(void)
 	
 }
 
+/* slurm_set_accounting_storage_port
+ * sets the storage port in slurmctld_conf object
+ * RET 0 or error code
+ */
+int slurm_set_accounting_storage_port(uint32_t storage_port)
+{
+	slurm_ctl_conf_t *conf;
+
+	if(slurmdbd_conf) {
+		slurmdbd_conf->storage_port = storage_port;
+	} else {
+		conf = slurm_conf_lock();
+		if (storage_port == 0) {
+			error("can't have storage port of 0");
+			return SLURM_ERROR;
+		}
+		
+		conf->accounting_storage_port = storage_port;
+		slurm_conf_unlock();
+	}
+	return 0;	
+}
+
 /* slurm_get_jobacct_gather_type
  * returns the job accounting type from the slurmctld_conf object
  * RET char *    - job accounting type,  MUST be xfreed by caller
@@ -1106,6 +1129,28 @@ uint32_t slurm_get_jobcomp_port(void)
 	
 }
 
+/* slurm_set_jobcomp_port
+ * sets the jobcomp port in slurmctld_conf object
+ * RET 0 or error code
+ */
+int slurm_set_jobcomp_port(uint32_t port)
+{
+	slurm_ctl_conf_t *conf;
+
+	if(slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		if (port == 0) {
+			error("can't have jobcomp port of 0");
+			return SLURM_ERROR;
+		}
+		
+		conf->job_comp_port = port;
+		slurm_conf_unlock();
+	}
+	return 0;
+}
+
 /* slurm_get_proctrack_type
  * get ProctrackType from slurmctld_conf object
  * RET char *   - proctrack type, MUST be xfreed by caller
diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h
index 14d47c10a55..5086125f26d 100644
--- a/src/common/slurm_protocol_api.h
+++ b/src/common/slurm_protocol_api.h
@@ -331,6 +331,12 @@ char *slurm_get_accounting_storage_pass(void);
  */
 uint32_t slurm_get_accounting_storage_port(void);
 
+/* slurm_set_accounting_storage_port
+ * sets the storage port in slurmctld_conf object
+ * RET 0 or error code
+ */
+int slurm_set_accounting_storage_port(uint32_t storage_port);
+
 /* slurm_get_jobacct_gather_type
  * returns the job accounting type from slurmctld_conf object
  * RET char *    - job accounting type,  MUST be xfreed by caller
@@ -379,6 +385,13 @@ char *slurm_get_jobcomp_pass(void);
  */
 uint32_t slurm_get_jobcomp_port(void);
 
+/* slurm_set_jobcomp_port
+ * sets the jobcomp port in slurmctld_conf object
+ * RET 0 or error code
+ */
+int slurm_set_jobcomp_port(uint32_t port);
+
+
 /* slurm_get_propagate_prio_process
  * return the PropagatePrioProcess flag from slurmctld_conf object
  */
diff --git a/src/common/slurmdbd_defs.c b/src/common/slurmdbd_defs.c
index 2899222f6d7..64f6381e792 100644
--- a/src/common/slurmdbd_defs.c
+++ b/src/common/slurmdbd_defs.c
@@ -324,9 +324,10 @@ static void _open_slurmdbd_fd(void)
 	if (slurmdbd_host == NULL)
 		slurmdbd_host = xstrdup(DEFAULT_STORAGE_HOST);
 	
-	if (slurmdbd_port == 0) 
+	if (slurmdbd_port == 0) {
 		slurmdbd_port = SLURMDBD_PORT;
-	
+		slurm_set_accounting_storage_port(slurmdbd_port);
+	}
 	slurm_set_addr(&dbd_addr, slurmdbd_port, slurmdbd_host);
 	if (dbd_addr.sin_port == 0)
 		error("Unable to locate SlurmDBD host %s:%u", 
@@ -1571,6 +1572,8 @@ static void _save_dbd_state(void)
 	char *dbd_fname;
 	Buf buffer;
 	int fd, rc, wrote = 0;
+	uint16_t msg_type;
+	uint32_t offset;
 
 	dbd_fname = slurm_get_state_save_location();
 	xstrcat(dbd_fname, "/dbd.messages");
@@ -1579,6 +1582,24 @@ static void _save_dbd_state(void)
 		error("slurmdbd: Creating state save file %s", dbd_fname);
 	} else if (agent_list) {
 		while ((buffer = list_dequeue(agent_list))) {
+			/* We do not want to store registration
+			   messages.  If an admin puts in an incorrect
+			   cluster name we can get a deadlock unless
+			   they add the bogus cluster name to the
+			   accounting system.
+			*/
+			offset = get_buf_offset(buffer);
+			if (offset < 2) {
+				free_buf(buffer);
+				continue;
+			}
+			set_buf_offset(buffer, 0);
+			unpack16(&msg_type, buffer);
+			set_buf_offset(buffer, offset);
+			if(msg_type == DBD_REGISTER_CTLD) {
+				free_buf(buffer);
+				continue;
+			}
 			rc = _save_dbd_rec(fd, buffer);
 			free_buf(buffer);
 			if (rc != SLURM_SUCCESS)
diff --git a/src/database/Makefile.in b/src/database/Makefile.in
index e03bb214f5a..9aa18bfbb9b 100644
--- a/src/database/Makefile.in
+++ b/src/database/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 43094b806d7..535e15e0a82 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/Makefile.in b/src/plugins/accounting_storage/Makefile.in
index 20d35d8c2af..9731af796da 100644
--- a/src/plugins/accounting_storage/Makefile.in
+++ b/src/plugins/accounting_storage/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/filetxt/Makefile.in b/src/plugins/accounting_storage/filetxt/Makefile.in
index c4e2a20bea2..afded661eef 100644
--- a/src/plugins/accounting_storage/filetxt/Makefile.in
+++ b/src/plugins/accounting_storage/filetxt/Makefile.in
@@ -111,6 +111,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/mysql/Makefile.in b/src/plugins/accounting_storage/mysql/Makefile.in
index a12bd05c23d..82e780a9051 100644
--- a/src/plugins/accounting_storage/mysql/Makefile.in
+++ b/src/plugins/accounting_storage/mysql/Makefile.in
@@ -116,6 +116,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
index 1b111dbe5c1..f1a56343c90 100644
--- a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
+++ b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
@@ -2069,8 +2069,10 @@ static mysql_db_info_t *_mysql_acct_create_db_info()
 {
 	mysql_db_info_t *db_info = xmalloc(sizeof(mysql_db_info_t));
 	db_info->port = slurm_get_accounting_storage_port();
-	if(!db_info->port) 
+	if(!db_info->port) {
 		db_info->port = 3306;
+		slurm_set_accounting_storage_port(db_info->port);
+	}
 	db_info->host = slurm_get_accounting_storage_host();	
 	db_info->user = slurm_get_accounting_storage_user();	
 	db_info->pass = slurm_get_accounting_storage_pass();	
diff --git a/src/plugins/accounting_storage/none/Makefile.in b/src/plugins/accounting_storage/none/Makefile.in
index 38bb59ace99..0d12f95f14b 100644
--- a/src/plugins/accounting_storage/none/Makefile.in
+++ b/src/plugins/accounting_storage/none/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/pgsql/Makefile.in b/src/plugins/accounting_storage/pgsql/Makefile.in
index e9ec8ea928f..717c7cb2c0e 100644
--- a/src/plugins/accounting_storage/pgsql/Makefile.in
+++ b/src/plugins/accounting_storage/pgsql/Makefile.in
@@ -115,6 +115,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c
index 074164b67fa..ce2b95fcf04 100644
--- a/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c
+++ b/src/plugins/accounting_storage/pgsql/accounting_storage_pgsql.c
@@ -136,8 +136,10 @@ static pgsql_db_info_t *_pgsql_acct_create_db_info()
 	db_info->port = slurm_get_accounting_storage_port();
 	/* it turns out it is better if using defaults to let postgres
 	   handle them on it's own terms */
-	if(!db_info->port)
+	if(!db_info->port) {
 		db_info->port = 5432;
+		slurm_set_accounting_storage_port(db_info->port);
+	}
 	db_info->host = slurm_get_accounting_storage_host();
 	if(!db_info->host)
 		db_info->host = xstrdup("localhost");
diff --git a/src/plugins/accounting_storage/slurmdbd/Makefile.in b/src/plugins/accounting_storage/slurmdbd/Makefile.in
index 964f57db258..6e330dc9882 100644
--- a/src/plugins/accounting_storage/slurmdbd/Makefile.in
+++ b/src/plugins/accounting_storage/slurmdbd/Makefile.in
@@ -111,6 +111,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/auth/Makefile.in b/src/plugins/auth/Makefile.in
index 493144ceb61..2dcfff1a2c8 100644
--- a/src/plugins/auth/Makefile.in
+++ b/src/plugins/auth/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/auth/authd/Makefile.in b/src/plugins/auth/authd/Makefile.in
index 088eca683fe..4570591654e 100644
--- a/src/plugins/auth/authd/Makefile.in
+++ b/src/plugins/auth/authd/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/auth/munge/Makefile.in b/src/plugins/auth/munge/Makefile.in
index 7d1ec2e57f5..fc5afeb89d0 100644
--- a/src/plugins/auth/munge/Makefile.in
+++ b/src/plugins/auth/munge/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/auth/none/Makefile.in b/src/plugins/auth/none/Makefile.in
index 80c72fe0c3c..8fcead4ff98 100644
--- a/src/plugins/auth/none/Makefile.in
+++ b/src/plugins/auth/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/checkpoint/Makefile.in b/src/plugins/checkpoint/Makefile.in
index dead96c3896..8b489ba099c 100644
--- a/src/plugins/checkpoint/Makefile.in
+++ b/src/plugins/checkpoint/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/checkpoint/aix/Makefile.in b/src/plugins/checkpoint/aix/Makefile.in
index 4015bb9202e..b23f830a247 100644
--- a/src/plugins/checkpoint/aix/Makefile.in
+++ b/src/plugins/checkpoint/aix/Makefile.in
@@ -113,6 +113,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/checkpoint/none/Makefile.in b/src/plugins/checkpoint/none/Makefile.in
index cad3af7ab41..136deac83a9 100644
--- a/src/plugins/checkpoint/none/Makefile.in
+++ b/src/plugins/checkpoint/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/checkpoint/ompi/Makefile.in b/src/plugins/checkpoint/ompi/Makefile.in
index 0e2c3e196bd..004a19ccd71 100644
--- a/src/plugins/checkpoint/ompi/Makefile.in
+++ b/src/plugins/checkpoint/ompi/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/checkpoint/xlch/Makefile.in b/src/plugins/checkpoint/xlch/Makefile.in
index 42cd308ea6f..4fc893d94cd 100644
--- a/src/plugins/checkpoint/xlch/Makefile.in
+++ b/src/plugins/checkpoint/xlch/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/crypto/Makefile.in b/src/plugins/crypto/Makefile.in
index 0ef0f90927a..9f06fc33d5d 100644
--- a/src/plugins/crypto/Makefile.in
+++ b/src/plugins/crypto/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/crypto/munge/Makefile.in b/src/plugins/crypto/munge/Makefile.in
index 89ed70b0c46..9295eb36cd4 100644
--- a/src/plugins/crypto/munge/Makefile.in
+++ b/src/plugins/crypto/munge/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/crypto/openssl/Makefile.in b/src/plugins/crypto/openssl/Makefile.in
index 81b74f2f769..374e611db27 100644
--- a/src/plugins/crypto/openssl/Makefile.in
+++ b/src/plugins/crypto/openssl/Makefile.in
@@ -115,6 +115,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobacct_gather/Makefile.in b/src/plugins/jobacct_gather/Makefile.in
index db8074826a7..fb1e94ee60f 100644
--- a/src/plugins/jobacct_gather/Makefile.in
+++ b/src/plugins/jobacct_gather/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobacct_gather/aix/Makefile.in b/src/plugins/jobacct_gather/aix/Makefile.in
index a10ba903c92..269da5a5295 100644
--- a/src/plugins/jobacct_gather/aix/Makefile.in
+++ b/src/plugins/jobacct_gather/aix/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobacct_gather/linux/Makefile.in b/src/plugins/jobacct_gather/linux/Makefile.in
index 552c0de0156..7f325c3a0e5 100644
--- a/src/plugins/jobacct_gather/linux/Makefile.in
+++ b/src/plugins/jobacct_gather/linux/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobacct_gather/none/Makefile.in b/src/plugins/jobacct_gather/none/Makefile.in
index d068842ff28..1676177a8d5 100644
--- a/src/plugins/jobacct_gather/none/Makefile.in
+++ b/src/plugins/jobacct_gather/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/Makefile.in b/src/plugins/jobcomp/Makefile.in
index ed937b96b46..9968dc5b93f 100644
--- a/src/plugins/jobcomp/Makefile.in
+++ b/src/plugins/jobcomp/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/filetxt/Makefile.in b/src/plugins/jobcomp/filetxt/Makefile.in
index 66f53ffec2c..1479a028e9d 100644
--- a/src/plugins/jobcomp/filetxt/Makefile.in
+++ b/src/plugins/jobcomp/filetxt/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/mysql/Makefile.in b/src/plugins/jobcomp/mysql/Makefile.in
index e90c0e90b09..7e4b73be663 100644
--- a/src/plugins/jobcomp/mysql/Makefile.in
+++ b/src/plugins/jobcomp/mysql/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/mysql/jobcomp_mysql.c b/src/plugins/jobcomp/mysql/jobcomp_mysql.c
index 8911392d5d2..da1289f5e94 100644
--- a/src/plugins/jobcomp/mysql/jobcomp_mysql.c
+++ b/src/plugins/jobcomp/mysql/jobcomp_mysql.c
@@ -132,8 +132,10 @@ static mysql_db_info_t *_mysql_jobcomp_create_db_info()
 {
 	mysql_db_info_t *db_info = xmalloc(sizeof(mysql_db_info_t));
 	db_info->port = slurm_get_jobcomp_port();
-	if(!db_info->port) 
+	if(!db_info->port) {
 		db_info->port = 3306;
+		slurm_set_jobcomp_port(db_info->port);
+	}
 	db_info->host = slurm_get_jobcomp_host();	
 	db_info->user = slurm_get_jobcomp_user();	
 	db_info->pass = slurm_get_jobcomp_pass();	
diff --git a/src/plugins/jobcomp/none/Makefile.in b/src/plugins/jobcomp/none/Makefile.in
index 1de2df8c7e0..1a5fc7ad040 100644
--- a/src/plugins/jobcomp/none/Makefile.in
+++ b/src/plugins/jobcomp/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/pgsql/Makefile.in b/src/plugins/jobcomp/pgsql/Makefile.in
index 571ec965b88..ef262b2c1e8 100644
--- a/src/plugins/jobcomp/pgsql/Makefile.in
+++ b/src/plugins/jobcomp/pgsql/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c
index 6f53bc0df5d..0c9b545b669 100644
--- a/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c
+++ b/src/plugins/jobcomp/pgsql/jobcomp_pgsql.c
@@ -132,8 +132,10 @@ static pgsql_db_info_t *_pgsql_jobcomp_create_db_info()
 	db_info->port = slurm_get_jobcomp_port();
 	/* it turns out it is better if using defaults to let postgres
 	   handle them on it's own terms */
-	if(!db_info->port)
+	if(!db_info->port) {
 		db_info->port = 5432;
+		slurm_set_jobcomp_port(db_info->port);
+	}
 	db_info->host = slurm_get_jobcomp_host();
 	db_info->user = slurm_get_jobcomp_user();	
 	db_info->pass = slurm_get_jobcomp_pass();	
diff --git a/src/plugins/jobcomp/script/Makefile.in b/src/plugins/jobcomp/script/Makefile.in
index 3c9136ac931..c78fb5a1ad6 100644
--- a/src/plugins/jobcomp/script/Makefile.in
+++ b/src/plugins/jobcomp/script/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/Makefile.in b/src/plugins/mpi/Makefile.in
index 8a92ad404d3..8bddee6b7c7 100644
--- a/src/plugins/mpi/Makefile.in
+++ b/src/plugins/mpi/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/lam/Makefile.in b/src/plugins/mpi/lam/Makefile.in
index 0f003b858fe..936abcc2074 100644
--- a/src/plugins/mpi/lam/Makefile.in
+++ b/src/plugins/mpi/lam/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/mpich1_p4/Makefile.in b/src/plugins/mpi/mpich1_p4/Makefile.in
index 7b9a0d5c97a..7e51e58fc61 100644
--- a/src/plugins/mpi/mpich1_p4/Makefile.in
+++ b/src/plugins/mpi/mpich1_p4/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/mpich1_shmem/Makefile.in b/src/plugins/mpi/mpich1_shmem/Makefile.in
index 9dffc9d5878..871ae717b7e 100644
--- a/src/plugins/mpi/mpich1_shmem/Makefile.in
+++ b/src/plugins/mpi/mpich1_shmem/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/mpichgm/Makefile.in b/src/plugins/mpi/mpichgm/Makefile.in
index c5004cdd2db..776e1cd5c4b 100644
--- a/src/plugins/mpi/mpichgm/Makefile.in
+++ b/src/plugins/mpi/mpichgm/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/mpichmx/Makefile.in b/src/plugins/mpi/mpichmx/Makefile.in
index d40cf452ac9..a15c6b41127 100644
--- a/src/plugins/mpi/mpichmx/Makefile.in
+++ b/src/plugins/mpi/mpichmx/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/mvapich/Makefile.in b/src/plugins/mpi/mvapich/Makefile.in
index f838a83251f..5159999c82e 100644
--- a/src/plugins/mpi/mvapich/Makefile.in
+++ b/src/plugins/mpi/mvapich/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/none/Makefile.in b/src/plugins/mpi/none/Makefile.in
index 77b5324f9ef..156366a5df7 100644
--- a/src/plugins/mpi/none/Makefile.in
+++ b/src/plugins/mpi/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/mpi/openmpi/Makefile.in b/src/plugins/mpi/openmpi/Makefile.in
index 127621bf1fe..8fcb4fd7144 100644
--- a/src/plugins/mpi/openmpi/Makefile.in
+++ b/src/plugins/mpi/openmpi/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/priority/Makefile.in b/src/plugins/priority/Makefile.in
index a41b7087170..c260acbc6c8 100644
--- a/src/plugins/priority/Makefile.in
+++ b/src/plugins/priority/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/priority/basic/Makefile.in b/src/plugins/priority/basic/Makefile.in
index 95fc851d760..6e3dfcf7db3 100644
--- a/src/plugins/priority/basic/Makefile.in
+++ b/src/plugins/priority/basic/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/priority/multifactor/Makefile.in b/src/plugins/priority/multifactor/Makefile.in
index 0425a28fbac..e91f9f19c4d 100644
--- a/src/plugins/priority/multifactor/Makefile.in
+++ b/src/plugins/priority/multifactor/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/Makefile.in b/src/plugins/proctrack/Makefile.in
index a78faad3ce0..a6685e0d93b 100644
--- a/src/plugins/proctrack/Makefile.in
+++ b/src/plugins/proctrack/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/aix/Makefile.in b/src/plugins/proctrack/aix/Makefile.in
index 449862c50d4..22b4a04bd68 100644
--- a/src/plugins/proctrack/aix/Makefile.in
+++ b/src/plugins/proctrack/aix/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/linuxproc/Makefile.in b/src/plugins/proctrack/linuxproc/Makefile.in
index 851cc99624a..a1da265e3df 100644
--- a/src/plugins/proctrack/linuxproc/Makefile.in
+++ b/src/plugins/proctrack/linuxproc/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/pgid/Makefile.in b/src/plugins/proctrack/pgid/Makefile.in
index b44deb35612..b0db7eaf4e7 100644
--- a/src/plugins/proctrack/pgid/Makefile.in
+++ b/src/plugins/proctrack/pgid/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/rms/Makefile.in b/src/plugins/proctrack/rms/Makefile.in
index 97b5d417478..f3ef3dd042e 100644
--- a/src/plugins/proctrack/rms/Makefile.in
+++ b/src/plugins/proctrack/rms/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/proctrack/sgi_job/Makefile.in b/src/plugins/proctrack/sgi_job/Makefile.in
index 89035d60e22..5951792a90e 100644
--- a/src/plugins/proctrack/sgi_job/Makefile.in
+++ b/src/plugins/proctrack/sgi_job/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/Makefile.in b/src/plugins/sched/Makefile.in
index 2440d811d65..481114b7dc1 100644
--- a/src/plugins/sched/Makefile.in
+++ b/src/plugins/sched/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/backfill/Makefile.in b/src/plugins/sched/backfill/Makefile.in
index fc91512c9ee..4d9918c0b60 100644
--- a/src/plugins/sched/backfill/Makefile.in
+++ b/src/plugins/sched/backfill/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/builtin/Makefile.in b/src/plugins/sched/builtin/Makefile.in
index 27a7d63a769..48c0391b7f3 100644
--- a/src/plugins/sched/builtin/Makefile.in
+++ b/src/plugins/sched/builtin/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/gang/Makefile.in b/src/plugins/sched/gang/Makefile.in
index ccc5c31955c..71feada22e6 100644
--- a/src/plugins/sched/gang/Makefile.in
+++ b/src/plugins/sched/gang/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/hold/Makefile.in b/src/plugins/sched/hold/Makefile.in
index 453378553d0..f3e45e76ed4 100644
--- a/src/plugins/sched/hold/Makefile.in
+++ b/src/plugins/sched/hold/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/wiki/Makefile.in b/src/plugins/sched/wiki/Makefile.in
index a29baf0c80b..d2363779644 100644
--- a/src/plugins/sched/wiki/Makefile.in
+++ b/src/plugins/sched/wiki/Makefile.in
@@ -110,6 +110,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/sched/wiki2/Makefile.in b/src/plugins/sched/wiki2/Makefile.in
index aa31a995493..be49fc2ccf2 100644
--- a/src/plugins/sched/wiki2/Makefile.in
+++ b/src/plugins/sched/wiki2/Makefile.in
@@ -113,6 +113,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/select/Makefile.in b/src/plugins/select/Makefile.in
index 1528c0132f0..59db5bdddf3 100644
--- a/src/plugins/select/Makefile.in
+++ b/src/plugins/select/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/select/bluegene/Makefile.in b/src/plugins/select/bluegene/Makefile.in
index 3fca2c689e4..e6e6eba3dbf 100644
--- a/src/plugins/select/bluegene/Makefile.in
+++ b/src/plugins/select/bluegene/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/select/bluegene/block_allocator/Makefile.am b/src/plugins/select/bluegene/block_allocator/Makefile.am
index 5061e0daa4a..bbc7f300e98 100644
--- a/src/plugins/select/bluegene/block_allocator/Makefile.am
+++ b/src/plugins/select/bluegene/block_allocator/Makefile.am
@@ -21,6 +21,7 @@ INCLUDES = -I$(top_srcdir) $(BG_INCLUDES)
 
 
 # making a .la
+
 noinst_LTLIBRARIES = libbluegene_block_allocator.la 
 libbluegene_block_allocator_la_SOURCES =    \
 	block_allocator.c bridge_linker.c block_allocator.h bridge_linker.h
diff --git a/src/plugins/select/bluegene/block_allocator/Makefile.in b/src/plugins/select/bluegene/block_allocator/Makefile.in
index a48c96e7687..954b9e87ac1 100644
--- a/src/plugins/select/bluegene/block_allocator/Makefile.in
+++ b/src/plugins/select/bluegene/block_allocator/Makefile.in
@@ -103,6 +103,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/select/bluegene/block_allocator/block_allocator.c b/src/plugins/select/bluegene/block_allocator/block_allocator.c
index 4a2a4a9aca4..e851fd8778d 100644
--- a/src/plugins/select/bluegene/block_allocator/block_allocator.c
+++ b/src/plugins/select/bluegene/block_allocator/block_allocator.c
@@ -267,6 +267,7 @@ extern int parse_blockreq(void **dest, slurm_parser_enum_t type,
 	blockreq_t *n = NULL;
 	hostlist_t hl = NULL;
 	char temp[BUFSIZE];
+
 	tbl = s_p_hashtbl_create(block_options);
 	s_p_parse_line(tbl, *leftover, leftover);
 	if(!value) {
@@ -304,7 +305,6 @@ extern int parse_blockreq(void **dest, slurm_parser_enum_t type,
 		;
 #endif
 	}
-
 	if (!s_p_get_uint16(&n->small128, "128CNBlocks", tbl)) {
 #ifdef HAVE_BGL
 		s_p_get_uint16(&n->small128, "Quarters", tbl);
diff --git a/src/plugins/select/bluegene/plugin/Makefile.am b/src/plugins/select/bluegene/plugin/Makefile.am
index da526d6e79e..c57a2733000 100644
--- a/src/plugins/select/bluegene/plugin/Makefile.am
+++ b/src/plugins/select/bluegene/plugin/Makefile.am
@@ -7,6 +7,8 @@ PLUGIN_FLAGS = -module -avoid-version --export-dynamic -lm
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(BG_INCLUDES)
 
+if BLUEGENE_LOADED
+
 pkglib_LTLIBRARIES = select_bluegene.la libsched_if64.la
 
 # Blue Gene node selection plugin.
@@ -51,3 +53,20 @@ slurm_epilog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
 force:
 $(select_bluegene_la_LIBADD) $(sfree_LDADD) : force
 	@cd `dirname $@` && $(MAKE) `basename $@`
+
+else
+EXTRA_select_bluegene_la_SOURCES = select_bluegene.c \
+				bg_boot_time.h \
+				bg_job_place.c bg_job_place.h \
+				bg_job_run.c bg_job_run.h \
+				bg_block_info.c bg_block_info.h \
+				bg_record_functions.c bg_record_functions.h \
+				bluegene.c bluegene.h \
+				state_test.c state_test.h \
+				bg_switch_connections.c \
+				block_sys.c \
+				dynamic_block.c dynamic_block.h \
+				defined_block.c defined_block.h \
+				../wrap_rm_api.h
+
+endif
diff --git a/src/plugins/select/bluegene/plugin/Makefile.in b/src/plugins/select/bluegene/plugin/Makefile.in
index a4c38a2a88e..a5d3e2cf438 100644
--- a/src/plugins/select/bluegene/plugin/Makefile.in
+++ b/src/plugins/select/bluegene/plugin/Makefile.in
@@ -36,8 +36,8 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-sbin_PROGRAMS = slurm_prolog$(EXEEXT) slurm_epilog$(EXEEXT) \
-	sfree$(EXEEXT)
+@BLUEGENE_LOADED_TRUE@sbin_PROGRAMS = slurm_prolog$(EXEEXT) \
+@BLUEGENE_LOADED_TRUE@	slurm_epilog$(EXEEXT) sfree$(EXEEXT)
 subdir = src/plugins/select/bluegene/plugin
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -79,39 +79,66 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(sbindir)"
 pkglibLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 libsched_if64_la_LIBADD =
-am_libsched_if64_la_OBJECTS = libsched_if64.lo
+am__libsched_if64_la_SOURCES_DIST = libsched_if64.c
+@BLUEGENE_LOADED_TRUE@am_libsched_if64_la_OBJECTS = libsched_if64.lo
 libsched_if64_la_OBJECTS = $(am_libsched_if64_la_OBJECTS)
 libsched_if64_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(libsched_if64_la_LDFLAGS) $(LDFLAGS) -o $@
-select_bluegene_la_DEPENDENCIES =  \
-	../block_allocator/libbluegene_block_allocator.la
-am_select_bluegene_la_OBJECTS = select_bluegene.lo bg_job_place.lo \
-	bg_job_run.lo bg_block_info.lo bg_record_functions.lo \
-	bluegene.lo state_test.lo bg_switch_connections.lo \
-	block_sys.lo dynamic_block.lo defined_block.lo
+@BLUEGENE_LOADED_TRUE@am_libsched_if64_la_rpath = -rpath $(pkglibdir)
+@BLUEGENE_LOADED_TRUE@select_bluegene_la_DEPENDENCIES = ../block_allocator/libbluegene_block_allocator.la
+am__select_bluegene_la_SOURCES_DIST = select_bluegene.c bg_boot_time.h \
+	bg_job_place.c bg_job_place.h bg_job_run.c bg_job_run.h \
+	bg_block_info.c bg_block_info.h bg_record_functions.c \
+	bg_record_functions.h bluegene.c bluegene.h state_test.c \
+	state_test.h bg_switch_connections.c block_sys.c \
+	dynamic_block.c dynamic_block.h defined_block.c \
+	defined_block.h ../wrap_rm_api.h
+@BLUEGENE_LOADED_TRUE@am_select_bluegene_la_OBJECTS =  \
+@BLUEGENE_LOADED_TRUE@	select_bluegene.lo bg_job_place.lo \
+@BLUEGENE_LOADED_TRUE@	bg_job_run.lo bg_block_info.lo \
+@BLUEGENE_LOADED_TRUE@	bg_record_functions.lo bluegene.lo \
+@BLUEGENE_LOADED_TRUE@	state_test.lo bg_switch_connections.lo \
+@BLUEGENE_LOADED_TRUE@	block_sys.lo dynamic_block.lo \
+@BLUEGENE_LOADED_TRUE@	defined_block.lo
+am__EXTRA_select_bluegene_la_SOURCES_DIST = select_bluegene.c \
+	bg_boot_time.h bg_job_place.c bg_job_place.h bg_job_run.c \
+	bg_job_run.h bg_block_info.c bg_block_info.h \
+	bg_record_functions.c bg_record_functions.h bluegene.c \
+	bluegene.h state_test.c state_test.h bg_switch_connections.c \
+	block_sys.c dynamic_block.c dynamic_block.h defined_block.c \
+	defined_block.h ../wrap_rm_api.h
 select_bluegene_la_OBJECTS = $(am_select_bluegene_la_OBJECTS)
 select_bluegene_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(select_bluegene_la_LDFLAGS) $(LDFLAGS) -o $@
+@BLUEGENE_LOADED_TRUE@am_select_bluegene_la_rpath = -rpath \
+@BLUEGENE_LOADED_TRUE@	$(pkglibdir)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(sbin_PROGRAMS)
-am_sfree_OBJECTS = sfree.$(OBJEXT) opts.$(OBJEXT) \
-	bridge_linker.$(OBJEXT)
+am__sfree_SOURCES_DIST = sfree.c sfree.h opts.c \
+	../block_allocator/bridge_linker.c \
+	../block_allocator/bridge_linker.h
+@BLUEGENE_LOADED_TRUE@am_sfree_OBJECTS = sfree.$(OBJEXT) \
+@BLUEGENE_LOADED_TRUE@	opts.$(OBJEXT) bridge_linker.$(OBJEXT)
 sfree_OBJECTS = $(am_sfree_OBJECTS)
-sfree_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@sfree_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
 sfree_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(sfree_LDFLAGS) \
 	$(LDFLAGS) -o $@
-am_slurm_epilog_OBJECTS = slurm_epilog.$(OBJEXT)
+am__slurm_epilog_SOURCES_DIST = slurm_epilog.c
+@BLUEGENE_LOADED_TRUE@am_slurm_epilog_OBJECTS =  \
+@BLUEGENE_LOADED_TRUE@	slurm_epilog.$(OBJEXT)
 slurm_epilog_OBJECTS = $(am_slurm_epilog_OBJECTS)
-slurm_epilog_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@slurm_epilog_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
 slurm_epilog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(slurm_epilog_LDFLAGS) $(LDFLAGS) -o $@
-am_slurm_prolog_OBJECTS = slurm_prolog.$(OBJEXT)
+am__slurm_prolog_SOURCES_DIST = slurm_prolog.c
+@BLUEGENE_LOADED_TRUE@am_slurm_prolog_OBJECTS =  \
+@BLUEGENE_LOADED_TRUE@	slurm_prolog.$(OBJEXT)
 slurm_prolog_OBJECTS = $(am_slurm_prolog_OBJECTS)
-slurm_prolog_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@slurm_prolog_DEPENDENCIES = $(top_builddir)/src/api/libslurmhelper.la
 slurm_prolog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 	$(slurm_prolog_LDFLAGS) $(LDFLAGS) -o $@
@@ -128,11 +155,13 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
 	$(LDFLAGS) -o $@
 SOURCES = $(libsched_if64_la_SOURCES) $(select_bluegene_la_SOURCES) \
-	$(sfree_SOURCES) $(slurm_epilog_SOURCES) \
-	$(slurm_prolog_SOURCES)
-DIST_SOURCES = $(libsched_if64_la_SOURCES) \
-	$(select_bluegene_la_SOURCES) $(sfree_SOURCES) \
+	$(EXTRA_select_bluegene_la_SOURCES) $(sfree_SOURCES) \
 	$(slurm_epilog_SOURCES) $(slurm_prolog_SOURCES)
+DIST_SOURCES = $(am__libsched_if64_la_SOURCES_DIST) \
+	$(am__select_bluegene_la_SOURCES_DIST) \
+	$(am__EXTRA_select_bluegene_la_SOURCES_DIST) \
+	$(am__sfree_SOURCES_DIST) $(am__slurm_epilog_SOURCES_DIST) \
+	$(am__slurm_prolog_SOURCES_DIST)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -146,6 +175,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -307,41 +337,55 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 PLUGIN_FLAGS = -module -avoid-version --export-dynamic -lm
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src/common $(BG_INCLUDES)
-pkglib_LTLIBRARIES = select_bluegene.la libsched_if64.la
+@BLUEGENE_LOADED_TRUE@pkglib_LTLIBRARIES = select_bluegene.la libsched_if64.la
 
 # Blue Gene node selection plugin.
-select_bluegene_la_SOURCES = select_bluegene.c \
-				bg_boot_time.h \
-				bg_job_place.c bg_job_place.h \
-				bg_job_run.c bg_job_run.h \
-				bg_block_info.c bg_block_info.h \
-				bg_record_functions.c bg_record_functions.h \
-				bluegene.c bluegene.h \
-				state_test.c state_test.h \
-				bg_switch_connections.c \
-				block_sys.c \
-				dynamic_block.c dynamic_block.h \
-				defined_block.c defined_block.h \
-				../wrap_rm_api.h
-
-select_bluegene_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
-select_bluegene_la_LIBADD = ../block_allocator/libbluegene_block_allocator.la 
+@BLUEGENE_LOADED_TRUE@select_bluegene_la_SOURCES = select_bluegene.c \
+@BLUEGENE_LOADED_TRUE@				bg_boot_time.h \
+@BLUEGENE_LOADED_TRUE@				bg_job_place.c bg_job_place.h \
+@BLUEGENE_LOADED_TRUE@				bg_job_run.c bg_job_run.h \
+@BLUEGENE_LOADED_TRUE@				bg_block_info.c bg_block_info.h \
+@BLUEGENE_LOADED_TRUE@				bg_record_functions.c bg_record_functions.h \
+@BLUEGENE_LOADED_TRUE@				bluegene.c bluegene.h \
+@BLUEGENE_LOADED_TRUE@				state_test.c state_test.h \
+@BLUEGENE_LOADED_TRUE@				bg_switch_connections.c \
+@BLUEGENE_LOADED_TRUE@				block_sys.c \
+@BLUEGENE_LOADED_TRUE@				dynamic_block.c dynamic_block.h \
+@BLUEGENE_LOADED_TRUE@				defined_block.c defined_block.h \
+@BLUEGENE_LOADED_TRUE@				../wrap_rm_api.h
+
+@BLUEGENE_LOADED_TRUE@select_bluegene_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+@BLUEGENE_LOADED_TRUE@select_bluegene_la_LIBADD = ../block_allocator/libbluegene_block_allocator.la 
 
 # MPIRUN dynamic lib.
-libsched_if64_la_SOURCES = libsched_if64.c 
-libsched_if64_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
-sfree_LDADD = $(top_builddir)/src/api/libslurmhelper.la
-slurm_prolog_LDADD = $(top_builddir)/src/api/libslurmhelper.la
-slurm_epilog_LDADD = $(top_builddir)/src/api/libslurmhelper.la
-sfree_SOURCES = sfree.c sfree.h opts.c \
-		../block_allocator/bridge_linker.c \
-		../block_allocator/bridge_linker.h 
-
-slurm_prolog_SOURCES = slurm_prolog.c
-slurm_epilog_SOURCES = slurm_epilog.c
-sfree_LDFLAGS = -export-dynamic -lm $(CMD_LDFLAGS) 
-slurm_prolog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
-slurm_epilog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
+@BLUEGENE_LOADED_TRUE@libsched_if64_la_SOURCES = libsched_if64.c 
+@BLUEGENE_LOADED_TRUE@libsched_if64_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+@BLUEGENE_LOADED_TRUE@sfree_LDADD = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@slurm_prolog_LDADD = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@slurm_epilog_LDADD = $(top_builddir)/src/api/libslurmhelper.la
+@BLUEGENE_LOADED_TRUE@sfree_SOURCES = sfree.c sfree.h opts.c \
+@BLUEGENE_LOADED_TRUE@		../block_allocator/bridge_linker.c \
+@BLUEGENE_LOADED_TRUE@		../block_allocator/bridge_linker.h 
+
+@BLUEGENE_LOADED_TRUE@slurm_prolog_SOURCES = slurm_prolog.c
+@BLUEGENE_LOADED_TRUE@slurm_epilog_SOURCES = slurm_epilog.c
+@BLUEGENE_LOADED_TRUE@sfree_LDFLAGS = -export-dynamic -lm $(CMD_LDFLAGS) 
+@BLUEGENE_LOADED_TRUE@slurm_prolog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
+@BLUEGENE_LOADED_TRUE@slurm_epilog_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
+@BLUEGENE_LOADED_FALSE@EXTRA_select_bluegene_la_SOURCES = select_bluegene.c \
+@BLUEGENE_LOADED_FALSE@				bg_boot_time.h \
+@BLUEGENE_LOADED_FALSE@				bg_job_place.c bg_job_place.h \
+@BLUEGENE_LOADED_FALSE@				bg_job_run.c bg_job_run.h \
+@BLUEGENE_LOADED_FALSE@				bg_block_info.c bg_block_info.h \
+@BLUEGENE_LOADED_FALSE@				bg_record_functions.c bg_record_functions.h \
+@BLUEGENE_LOADED_FALSE@				bluegene.c bluegene.h \
+@BLUEGENE_LOADED_FALSE@				state_test.c state_test.h \
+@BLUEGENE_LOADED_FALSE@				bg_switch_connections.c \
+@BLUEGENE_LOADED_FALSE@				block_sys.c \
+@BLUEGENE_LOADED_FALSE@				dynamic_block.c dynamic_block.h \
+@BLUEGENE_LOADED_FALSE@				defined_block.c defined_block.h \
+@BLUEGENE_LOADED_FALSE@				../wrap_rm_api.h
+
 all: all-am
 
 .SUFFIXES:
@@ -403,9 +447,9 @@ clean-pkglibLTLIBRARIES:
 	  rm -f "$${dir}/so_locations"; \
 	done
 libsched_if64.la: $(libsched_if64_la_OBJECTS) $(libsched_if64_la_DEPENDENCIES) 
-	$(libsched_if64_la_LINK) -rpath $(pkglibdir) $(libsched_if64_la_OBJECTS) $(libsched_if64_la_LIBADD) $(LIBS)
+	$(libsched_if64_la_LINK) $(am_libsched_if64_la_rpath) $(libsched_if64_la_OBJECTS) $(libsched_if64_la_LIBADD) $(LIBS)
 select_bluegene.la: $(select_bluegene_la_OBJECTS) $(select_bluegene_la_DEPENDENCIES) 
-	$(select_bluegene_la_LINK) -rpath $(pkglibdir) $(select_bluegene_la_OBJECTS) $(select_bluegene_la_LIBADD) $(LIBS)
+	$(select_bluegene_la_LINK) $(am_select_bluegene_la_rpath) $(select_bluegene_la_OBJECTS) $(select_bluegene_la_LIBADD) $(LIBS)
 install-sbinPROGRAMS: $(sbin_PROGRAMS)
 	@$(NORMAL_INSTALL)
 	test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@@ -691,9 +735,9 @@ uninstall-am: uninstall-pkglibLTLIBRARIES uninstall-sbinPROGRAMS
 	uninstall-sbinPROGRAMS
 
 
-force:
-$(select_bluegene_la_LIBADD) $(sfree_LDADD) : force
-	@cd `dirname $@` && $(MAKE) `basename $@`
+@BLUEGENE_LOADED_TRUE@force:
+@BLUEGENE_LOADED_TRUE@$(select_bluegene_la_LIBADD) $(sfree_LDADD) : force
+@BLUEGENE_LOADED_TRUE@	@cd `dirname $@` && $(MAKE) `basename $@`
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
diff --git a/src/plugins/select/bluegene/plugin/bg_record_functions.c b/src/plugins/select/bluegene/plugin/bg_record_functions.c
index c25e8c367a4..c79866501dc 100644
--- a/src/plugins/select/bluegene/plugin/bg_record_functions.c
+++ b/src/plugins/select/bluegene/plugin/bg_record_functions.c
@@ -627,10 +627,14 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 	int i, len;
 	int small_size = 0;
 	int small_count = 0;
+#ifdef HAVE_BGL
+	int node_cnt = 0;
 	uint16_t quarter = 0;
 	uint16_t nodecard = 0;
-	int node_cnt = 0;
-	
+#else
+	bitstr_t *ionodes = bit_alloc(bluegene_numpsets);
+	int start=0;
+#endif
 	if(!records) {
 		fatal("add_bg_record: no records list given");
 	}
@@ -738,7 +742,9 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 		}
 	} else {
 		debug("adding a small block");
-#ifdef HAVE_BGL
+#ifdef HAVE_BGL // remove this clause when other works.  Only here to
+		// perserve old code 
+
 		/* if the ionode cnt for small32 is 0 then don't
 		   allow a nodecard allocation 
 		*/
@@ -753,7 +759,7 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 
 		if(blockreq->small32==0 && blockreq->small128==0) {
 			info("No specs given for this small block, "
-			     "I am spliting this block into 4 small128");
+			     "I am spliting this block into 4 128CnBlocks");
 			blockreq->small128=4;
 		}		
 
@@ -762,7 +768,7 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 		if(i != bluegene_bp_node_cnt)
 			fatal("There is an error in your bluegene.conf file.\n"
 			      "I am unable to request %d nodes consisting of "
-			      "%u small32 and\n%u small128 in one "
+			      "%u 32CnBlocks and\n%u 128CnBlocks in one "
 			      "base partition with %u nodes.", 
 			      i, bluegene_bp_node_cnt, 
 			      blockreq->small32, blockreq->small128);
@@ -807,31 +813,55 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 		}
 		list_iterator_destroy(itr);
 		destroy_bg_record(bg_record);
-#else
+#else // remove this when testing.  Only here to perserve old code the
+      // code below is already for bgl
 		/* if the ionode cnt for small32 is 0 then don't
 		   allow a sub quarter allocation 
 		*/
-		if(!bluegene_nodecard_ionode_cnt) {
-			if(blockreq->small16) 
+		if(bluegene_nodecard_ionode_cnt < 2) {
+			if(!bluegene_nodecard_ionode_cnt && blockreq->small32) 
 				fatal("There is an error in your "
 				      "bluegene.conf file.\n"
-				      "Can't create a 16 node block with "
-				      "Numpsets=%u. (Try setting it to 32)",
+				      "Can't create a 32 node block with "
+				      "Numpsets=%u. (Try setting it "
+				      "to at least 16)",
 				      bluegene_numpsets);
-			if(blockreq->small32) 
+#ifndef HAVE_BGL
+			if(blockreq->small16) 
 				fatal("There is an error in your "
 				      "bluegene.conf file.\n"
-				      "Can't create a 32 node block with "
-				      "Numpsets=%u. (Try setting it to 32)",
+				      "Can't create a 16 node block with "
+				      "Numpsets=%u. (Try setting it to "
+				      "at least 32)",
 				      bluegene_numpsets);
-			if(blockreq->small64) 
+			if((bluegene_io_ratio < 0.5) && blockreq->small64) 
 				fatal("There is an error in your "
 				      "bluegene.conf file.\n"
 				      "Can't create a 64 node block with "
-				      "Numpsets=%u. (Try setting it to 32)",
+				      "Numpsets=%u. (Try setting it "
+				      "to at least 8)",
 				      bluegene_numpsets);
+#endif
 		}
 
+#ifdef HAVE_BGL
+		if(blockreq->small32==0 && blockreq->small128==0) {
+			info("No specs given for this small block, "
+			     "I am spliting this block into 4 128CnBlocks");
+			blockreq->small128=4;
+		}		
+
+		i = (blockreq->small32*bluegene_nodecard_node_cnt) + 
+			(blockreq->small128*bluegene_quarter_node_cnt);
+		if(i != bluegene_bp_node_cnt)
+			fatal("There is an error in your bluegene.conf file.\n"
+			      "I am unable to request %d nodes consisting of "
+			      "%u 32CnBlocks and\n%u 128CnBlocks in one "
+			      "base partition with %u nodes.", 
+			      i, blockreq->small32, blockreq->small128,
+			      bluegene_bp_node_cnt);
+		small_count = blockreq->small32+blockreq->small128; 
+#else
 		if(!blockreq->small16 && !blockreq->small32 
 		   && !blockreq->small64 && !blockreq->small128 
 		   && !blockreq->small256) {
@@ -852,15 +882,15 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 			      "%u 64CNBlocks, %u 128CNBlocks, "
 			      "and %u 256CNBlocks\n"
 			      "in one base partition with %u nodes.", 
-			      i, bluegene_bp_node_cnt, 
-			      blockreq->small16, blockreq->small32, 
+			      i, blockreq->small16, blockreq->small32, 
 			      blockreq->small64, blockreq->small128, 
-			      blockreq->small256);
+			      blockreq->small256, bluegene_bp_node_cnt);
 		small_count = blockreq->small16
 			+ blockreq->small32
 			+ blockreq->small64
 			+ blockreq->small128
 			+ blockreq->small256; 
+#endif
 		/* Automatically create 2-way split if 
 		 * conn_type == SELECT_SMALL in bluegene.conf
 		 * Here we go through each node listed and do the same thing
@@ -868,41 +898,87 @@ extern int add_bg_record(List records, List used_nodes, blockreq_t *blockreq)
 		 */
 		itr = list_iterator_create(bg_record->bg_block_list);
 		while ((ba_node = list_next(itr)) != NULL) {
-			/* break base partition up into 16 parts */
-			small_size = 16;
-			node_cnt = 0;
-			quarter = 0;
-			nodecard = 0;
-			for(i=0; i<small_count; i++) {
-				if(i == blockreq->small32) {
-					/* break base partition 
-					   up into 4 parts */
-					small_size = 4;
-				}
-									
-				if(small_size == 4)
-					nodecard = (uint16_t)NO_VAL;
-				else
-					nodecard = i%4; 
+#ifndef HAVE_BGL
+			for(i=0; i<blockreq->small16; i++) {
+				bit_nset(ionodes, start, start);
 				found_record = create_small_record(bg_record,
-								   quarter,
-								   nodecard);
-								 
+								   ionodes, 16);
 				/* this needs to be an append so we
 				   keep things in the order we got
 				   them, they will be sorted later */
 				list_append(records, found_record);
-				node_cnt += bluegene_bp_node_cnt/small_size;
-				if(node_cnt == 128) {
-					node_cnt = 0;
-					quarter++;
-				}
+				bit_nclear(ionodes, start, start);
+				start++;
+			}
+#endif
+			if((small_size = bluegene_nodecard_ionode_cnt))
+				small_size--;
+			for(i=0; i<blockreq->small32; i++) {
+				bit_nset(ionodes, start, start+small_size);
+				found_record = create_small_record(bg_record,
+								   ionodes, 32);
+				/* this needs to be an append so we
+				   keep things in the order we got
+				   them, they will be sorted later */
+				list_append(records, found_record);
+				bit_nclear(ionodes, start, start+small_size);
+				start+=small_size+1;
+			}
+
+#ifndef HAVE_BGL
+			if((small_size = bluegene_nodecard_ionode_cnt * 2))
+				small_size--;
+			for(i=0; i<blockreq->small64; i++) {
+				bit_nset(ionodes, start, start+small_size);
+				found_record = create_small_record(bg_record,
+								   ionodes, 64);
+				/* this needs to be an append so we
+				   keep things in the order we got
+				   them, they will be sorted later */
+				list_append(records, found_record);
+				bit_nclear(ionodes, start, start+small_size);
+				start+=small_size+1;
+			}
+#endif
+			if((small_size = bluegene_quarter_ionode_cnt))
+				small_size--;
+			for(i=0; i<blockreq->small128; i++) {
+				bit_nset(ionodes, start, start+small_size);
+				found_record = create_small_record(
+					bg_record, ionodes, 128);
+				/* this needs to be an append so we
+				   keep things in the order we got
+				   them, they will be sorted later */
+				list_append(records, found_record);
+				bit_nclear(ionodes, start, start+small_size);
+				start+=small_size+1;
 			}
+
+#ifndef HAVE_BGL
+			if((small_size = bluegene_quarter_ionode_cnt * 2))
+				small_size--;
+			for(i=0; i<blockreq->small256; i++) {
+				bit_nset(ionodes, start, start+small_size);
+				found_record = create_small_record(
+					bg_record, ionodes, 256);
+				/* this needs to be an append so we
+				   keep things in the order we got
+				   them, they will be sorted later */
+				list_append(records, found_record);
+				bit_nclear(ionodes, start, start+small_size);
+				start+=small_size+1;
+			}
+#endif
 		}
 		list_iterator_destroy(itr);
 		destroy_bg_record(bg_record);
-#endif
+#endif // remove this when done testing
 	} 
+
+#ifndef HAVE_BGL
+	FREE_NULL_BITMAP(ionodes);
+#endif
+	
 	return SLURM_SUCCESS;
 }
 
diff --git a/src/plugins/select/bluegene/plugin/bg_switch_connections.c b/src/plugins/select/bluegene/plugin/bg_switch_connections.c
index 6661c1b91ac..fcc0c819e5e 100644
--- a/src/plugins/select/bluegene/plugin/bg_switch_connections.c
+++ b/src/plugins/select/bluegene/plugin/bg_switch_connections.c
@@ -315,8 +315,10 @@ static int _used_switches(ba_node_t* ba_node)
 	}
 	return switch_count;
 }
+
+#ifdef HAVE_BGL
 extern int configure_small_block(bg_record_t *bg_record)
-	{
+{
 	int rc = SLURM_SUCCESS;
 #ifdef HAVE_BG_FILES	
 	bool small = true;
@@ -347,6 +349,8 @@ extern int configure_small_block(bg_record_t *bg_record)
 	}
 
 	num_ncards = bg_record->node_cnt/bluegene_nodecard_node_cnt;
+	if(num_ncards < 1)
+		num_ncards = 1;
 
 	if ((rc = bridge_set_data(bg_record->bg_block,
 				  RM_PartitionNodeCardNum,
@@ -494,6 +498,224 @@ cleanup:
 	return rc;
 }
 
+#else
+
+extern int configure_small_block(bg_record_t *bg_record)
+{
+	int rc = SLURM_SUCCESS;
+#ifdef HAVE_BG_FILES	
+	bool small = true;
+	ListIterator itr;
+	ba_node_t* ba_node = NULL;
+	rm_BP_t *curr_bp = NULL;
+	rm_bp_id_t bp_id = NULL;
+	rm_nodecard_id_t nc_char = NULL;
+	int nc_id = 0;
+	int num_ncards = 0, sub_nodecard = 0, ionode_card = 0;
+	rm_nodecard_t *ncard;
+	rm_nodecard_list_t *ncard_list = NULL;
+	rm_quarter_t quarter;
+	int num, i;
+	int use_nc[16];
+	double nc_pos = 0;
+#endif
+	xassert(bg_record->ionode_bitmap);
+	if(bg_record->bp_count != 1) {
+		error("Requesting small block with %d bps, needs to be 1.",
+		      bg_record->bp_count);
+		return SLURM_ERROR;
+	}
+	
+#ifdef HAVE_BG_FILES	
+	/* set that we are doing a small block */
+	if ((rc = bridge_set_data(bg_record->bg_block, RM_PartitionSmall, 
+				  &small)) != STATUS_OK) {
+		
+		fatal("bridge_set_data(RM_PartitionPsetsPerBP)", 
+		      bg_err_str(rc));
+	}
+
+	num_ncards = bg_record->node_cnt/bluegene_nodecard_node_cnt;
+	if(num_ncards < 1) {
+		num_ncards = 1;
+		sub_nodecard = 1;
+	}
+	memset(use_nc, 0, sizeof(use_nc));
+
+	/* find out how many nodecards to get for each ionode */
+		
+	for(i = 0; i<bluegene_numpsets; i++) {
+		if(bit_test(bg_record->ionode_bitmap, i)) {
+			if(bluegene_nc_ratio > 1) {
+				for(j=0; j<bluegene_nc_ratio; j++)
+					use_nc[(int)nc_pos+j] = 1;
+			} else {
+				use_nc[(int)nc_pos] = 1;
+				if(i%2)
+					ionode_card = 1;
+			}
+		}
+		nc_pos += bluegene_nc_ratio;
+	}
+
+	if ((rc = bridge_set_data(bg_record->bg_block,
+				  RM_PartitionNodeCardNum,
+				  &num_ncards))
+	    != STATUS_OK) {
+		
+		fatal("bridge_set_data: RM_PartitionBPNum: %s", 
+		      bg_err_str(rc));
+	}
+	
+			
+	itr = list_iterator_create(bg_record->bg_block_list);
+	ba_node = list_next(itr);
+	list_iterator_destroy(itr);
+
+	if (_get_bp_by_location(bg, ba_node->coord, &curr_bp) 
+	    == SLURM_ERROR) {
+		fatal("_get_bp_by_location()");
+	}
+	
+	/* Set the one BP */
+	
+	if ((rc = bridge_set_data(bg_record->bg_block,
+				  RM_PartitionBPNum,
+				  &bg_record->bp_count)) 
+	    != STATUS_OK) {
+		
+		fatal("bridge_set_data: RM_PartitionBPNum: %s", 
+		      bg_err_str(rc));
+		return SLURM_ERROR;
+	}	
+	if ((rc = bridge_set_data(bg_record->bg_block,
+				  RM_PartitionFirstBP, 
+				  curr_bp)) 
+	    != STATUS_OK) {
+		
+		fatal("bridge_set_data("
+		      "BRIDGE_PartitionFirstBP): %s", 
+		      bg_err_str(rc));
+		return SLURM_ERROR;
+	}
+	
+	
+	/* find the bp_id of the bp to get the small32 */
+	if ((rc = bridge_get_data(curr_bp, RM_BPID, &bp_id))
+	    != STATUS_OK) {
+		error("bridge_get_data(): %d", rc);
+		return SLURM_ERROR;
+	}
+
+	
+	if(!bp_id) {
+		error("No BP ID was returned from database");
+		return SLURM_ERROR;
+	}
+
+	if ((rc = bridge_get_nodecards(bp_id, &ncard_list))
+	    != STATUS_OK) {
+		error("bridge_get_nodecards(%s): %d",
+		      bp_id, rc);
+		free(bp_id);
+		return SLURM_ERROR;
+	}
+	free(bp_id);
+		
+			
+	if((rc = bridge_get_data(ncard_list, RM_NodeCardListSize, &num))
+	   != STATUS_OK) {
+		error("bridge_get_data(RM_NodeCardListSize): %s",
+		      bg_err_str(rc));
+		return SLURM_ERROR;
+	}
+	num_ncards = 0;
+	for(i=0; i<num; i++) {
+		if (i) {
+			if ((rc = bridge_get_data(ncard_list, 
+						  RM_NodeCardListNext, 
+						  &ncard)) != STATUS_OK) {
+				error("bridge_get_data"
+				      "(RM_NodeCardListNext): %s",
+				      rc);
+				rc = SLURM_ERROR;
+				goto cleanup;
+			}
+		} else {
+			if ((rc = bridge_get_data(ncard_list, 
+						  RM_NodeCardListFirst, 
+						  &ncard)) != STATUS_OK) {
+				error("bridge_get_data"
+				      "(RM_NodeCardListFirst): %s",
+				      rc);
+				rc = SLURM_ERROR;
+				goto cleanup;
+			}
+		}
+		
+		if ((rc = bridge_get_data(ncard, 
+					  RM_NodeCardID, 
+					  &nc_char)) != STATUS_OK) {
+			error("bridge_get_data(RM_NodeCardID): %d",rc);
+			rc = SLURM_ERROR;
+			goto cleanup;
+		}
+
+		if(!nc_char) {
+			error("No NodeCard ID was returned from database");
+			return SLURM_ERROR;
+		}
+
+		nc_id = atoi((char*)nc_char+1);
+		free(nc_char);
+
+		if(!use_nc[nc_id])
+			continue;
+	
+		if (num_ncards) {
+			if ((rc = bridge_set_data(bg_record->bg_block,
+						  RM_PartitionNextNodeCard, 
+						  ncard)) 
+			    != STATUS_OK) {
+				
+				fatal("bridge_set_data("
+				      "RM_PartitionNextNodeCard): %s", 
+				      bg_err_str(rc));
+			}
+		} else {
+			if ((rc = bridge_set_data(bg_record->bg_block,
+						  RM_PartitionFirstNodeCard, 
+						  ncard)) 
+			    != STATUS_OK) {
+				
+				fatal("bridge_set_data("
+				      "RM_PartitionFirstNodeCard): %s", 
+				      bg_err_str(rc));
+			}
+		}
+		
+		num_ncards++;
+		
+		if(!sub_nodecard) 
+			continue;
+		/* FIX ME: we need to put the correct IO node here but
+		   there is no documentation to do that yet, so we
+		   don't have the ability to do that just yet */
+		error("We don't have the logic to make sub nodecard blocks");
+		rc = SLURM_ERROR;
+		goto cleanup;
+	}
+cleanup:
+	if ((rc = bridge_free_nodecard_list(ncard_list)) != STATUS_OK) {
+		error("bridge_free_nodecard_list(): %s", bg_err_str(rc));
+		return SLURM_ERROR;
+	}
+#endif
+	debug2("making the small block");
+	return rc;
+}
+#endif
+
 /**
  * connect the given switch up with the given connections
  */
diff --git a/src/plugins/select/bluegene/plugin/bluegene.c b/src/plugins/select/bluegene/plugin/bluegene.c
index 5d4dc0fd620..7a8d1e6a890 100644
--- a/src/plugins/select/bluegene/plugin/bluegene.c
+++ b/src/plugins/select/bluegene/plugin/bluegene.c
@@ -66,12 +66,19 @@ List bg_ramdiskimage_list = NULL;
 #ifdef HAVE_BGL
 char *default_blrtsimage = NULL;
 #endif
+List bg_valid_small32 = NULL;
+List bg_valid_small64 = NULL;
+List bg_valid_small128 = NULL;
+List bg_valid_small256 = NULL;
 char *default_linuximage = NULL;
 char *default_mloaderimage = NULL, *default_ramdiskimage = NULL;
 char *bridge_api_file = NULL; 
 char *bg_slurm_user_name = NULL;
 char *bg_slurm_node_prefix = NULL;
 bg_layout_t bluegene_layout_mode = NO_VAL;
+double bluegene_io_ratio = 0.0;
+double bluegene_nc_ratio = 0.0;
+uint16_t bluegene_proc_ratio = 0;
 uint16_t bluegene_numpsets = 0;
 uint16_t bluegene_bp_node_cnt = 0;
 uint16_t bluegene_quarter_node_cnt = 0;
@@ -108,6 +115,7 @@ static int  _bg_record_cmpf_inc(bg_record_t *rec_a, bg_record_t *rec_b);
 static int _delete_old_blocks(List bg_found_block_list);
 static char *_get_bg_conf(void);
 static int  _reopen_bridge_log(void);
+static void _destroy_bitmap(void *object);
 
 /* Initialize all plugin variables */
 extern int init_bg(void)
@@ -194,6 +202,23 @@ extern void fini_bg(void)
 		list_destroy(bg_ramdiskimage_list);
 		bg_ramdiskimage_list = NULL;
 	}
+	
+	if(bg_valid_small32) {
+		list_destroy(bg_valid_small32);
+		bg_valid_small32 = NULL;
+	}
+	if(bg_valid_small64) {
+		list_destroy(bg_valid_small64);
+		bg_valid_small64 = NULL;
+	}
+	if(bg_valid_small128) {
+		list_destroy(bg_valid_small128);
+		bg_valid_small128 = NULL;
+	}
+	if(bg_valid_small256) {
+		list_destroy(bg_valid_small256);
+		bg_valid_small256 = NULL;
+	}
 
 #ifdef HAVE_BGL
 	xfree(default_blrtsimage);
@@ -649,8 +674,13 @@ extern int bg_reboot_block(bg_record_t *bg_record)
 #endif
 		}
 		
-		if ((bg_record->state == RM_PARTITION_CONFIGURING)
-		    ||  (bg_record->state == RM_PARTITION_ERROR)) {
+		if (bg_record->state == RM_PARTITION_CONFIGURING) {
+			if(!block_exist_in_list(bg_booted_block_list,
+						bg_record))
+				list_push(bg_booted_block_list, bg_record);
+			break;
+		} else if (bg_record->state == RM_PARTITION_ERROR) {
+			remove_from_bg_list(bg_booted_block_list, bg_record);
 			break;
 		}
 		slurm_mutex_unlock(&block_state_mutex);			
@@ -1122,15 +1152,112 @@ extern int read_bg_conf(void)
 		list_push(bg_mloaderimage_list, image);		
 	}
 
+	if (!s_p_get_uint16(
+		    &bluegene_bp_node_cnt, "BasePartitionNodeCnt", tbl)) {
+		error("BasePartitionNodeCnt not configured in bluegene.conf "
+		      "defaulting to 512 as BasePartitionNodeCnt");
+		bluegene_bp_node_cnt = 512;
+		bluegene_quarter_node_cnt = 128;
+	} else {
+		if(bluegene_bp_node_cnt<=0)
+			fatal("You should have more than 0 nodes "
+			      "per base partition");
+
+		bluegene_quarter_node_cnt = bluegene_bp_node_cnt/4;
+	}
+
+	/* select_p_node_init needs to be called before this to set
+	   this up correctly
+	*/
+	bluegene_proc_ratio = procs_per_node/bluegene_bp_node_cnt;
+	if(!bluegene_proc_ratio)
+		fatal("We appear to have less than 1 proc on a cnode.  "
+		      "You specified %u for BasePartitionNodeCnt "
+		      "in the blugene.conf and %u procs "
+		      "for each node in the slurm.conf",
+		      bluegene_bp_node_cnt, procs_per_node);
+
+	if (!s_p_get_uint16(
+		    &bluegene_nodecard_node_cnt, "NodeCardNodeCnt", tbl)) {
+		error("NodeCardNodeCnt not configured in bluegene.conf "
+		      "defaulting to 32 as NodeCardNodeCnt");
+		bluegene_nodecard_node_cnt = 32;
+	}
+	
+	if(bluegene_nodecard_node_cnt<=0)
+		fatal("You should have more than 0 nodes per nodecard");
+
 	if (!s_p_get_uint16(&bluegene_numpsets, "Numpsets", tbl))
 		fatal("Warning: Numpsets not configured in bluegene.conf");
 
 	if(bluegene_numpsets) {
+		bitstr_t *tmp_bitmap = NULL;
+		int small_size = 1;
+
 		bluegene_quarter_ionode_cnt = bluegene_numpsets/4;
 		bluegene_nodecard_ionode_cnt = bluegene_quarter_ionode_cnt/4;
+
+		bluegene_nc_ratio = 
+			((double)bluegene_bp_node_cnt 
+			 / (double)bluegene_nodecard_node_cnt) 
+			/ (double)bluegene_numpsets;
+		bluegene_io_ratio = 
+			(double)bluegene_numpsets /
+			((double)bluegene_bp_node_cnt 
+			 / (double)bluegene_nodecard_node_cnt);
+
+		/* below we are creating all the possible bitmaps for
+		 * each size of small block
+		 */
 		if((int)bluegene_nodecard_ionode_cnt < 1) {
 			bluegene_nodecard_ionode_cnt = 0;
+		} else {
+			bg_valid_small32 = list_create(_destroy_bitmap);
+			if((small_size = bluegene_nodecard_ionode_cnt))
+				small_size--;
+			i = 0;
+			while(i<bluegene_numpsets) {
+				tmp_bitmap = bit_alloc(bluegene_numpsets);
+				bit_nset(tmp_bitmap, i, i+small_size);
+				i += small_size+1;
+				list_append(bg_valid_small32, tmp_bitmap);
+			}
 		}
+
+		bg_valid_small128 = list_create(_destroy_bitmap);
+		if((small_size = bluegene_quarter_ionode_cnt))
+			small_size--;
+		i = 0;
+		while(i<bluegene_numpsets) {
+			tmp_bitmap = bit_alloc(bluegene_numpsets);
+			bit_nset(tmp_bitmap, i, i+small_size);
+			i += small_size+1;
+			list_append(bg_valid_small128, tmp_bitmap);
+		}
+
+#ifndef HAVE_BGL
+		bg_valid_small64 = list_create(_destroy_bitmap);
+		if((small_size = bluegene_nodecard_ionode_cnt * 2))
+			small_size--;
+		i = 0;
+		while(i<bluegene_numpsets) {
+			tmp_bitmap = bit_alloc(bluegene_numpsets);
+			bit_nset(tmp_bitmap, i, i+small_size);
+			i += small_size+1;
+			list_append(bg_valid_small64, tmp_bitmap);
+		}
+
+		bg_valid_small256 = list_create(_destroy_bitmap);
+		if((small_size = bluegene_quarter_ionode_cnt * 2))
+			small_size--;
+		i = 0;
+		while(i<bluegene_numpsets) {
+			tmp_bitmap = bit_alloc(bluegene_numpsets);
+			bit_nset(tmp_bitmap, i, i+small_size);
+			i += small_size+1;
+			list_append(bg_valid_small256, tmp_bitmap);
+		}
+#endif			
 	} else {
 		fatal("your numpsets is 0");
 	}
@@ -1159,30 +1286,11 @@ extern int read_bg_conf(void)
 		}
 		xfree(layout);
 	}
-	if (!s_p_get_uint16(
-		    &bluegene_bp_node_cnt, "BasePartitionNodeCnt", tbl)) {
-		error("BasePartitionNodeCnt not configured in bluegene.conf "
-		      "defaulting to 512 as BasePartitionNodeCnt");
-		bluegene_bp_node_cnt = 512;
-		bluegene_quarter_node_cnt = 128;
-	} else {
-		if(bluegene_bp_node_cnt<=0)
-			fatal("You should have more than 0 nodes "
-			      "per base partition");
-
-		bluegene_quarter_node_cnt = bluegene_bp_node_cnt/4;
-	}
-
-	if (!s_p_get_uint16(
-		    &bluegene_nodecard_node_cnt, "NodeCardNodeCnt", tbl)) {
-		error("NodeCardNodeCnt not configured in bluegene.conf "
-		      "defaulting to 32 as NodeCardNodeCnt");
-		bluegene_nodecard_node_cnt = 32;
-	}
-	
-	if(bluegene_nodecard_node_cnt<=0)
-		fatal("You should have more than 0 nodes per nodecard");
 
+#ifndef HAVE_BGL
+	if(bluegene_layout_mode == LAYOUT_DYNAMIC)
+		fatal("Dynamic layout mode is only supported on a BGL system.");
+#endif
 
 	/* add blocks defined in file */
 	if(bluegene_layout_mode != LAYOUT_DYNAMIC) {
@@ -1615,3 +1723,11 @@ static int _reopen_bridge_log(void)
 	return rc;
 }
 
+static void _destroy_bitmap(void *object)
+{
+	bitstr_t *bitstr = (bitstr_t *)object;
+
+	if(bitstr) {
+		FREE_NULL_BITMAP(bitstr);
+	}
+}
diff --git a/src/plugins/select/bluegene/plugin/bluegene.h b/src/plugins/select/bluegene/plugin/bluegene.h
index f06c08aca34..459f2b95657 100644
--- a/src/plugins/select/bluegene/plugin/bluegene.h
+++ b/src/plugins/select/bluegene/plugin/bluegene.h
@@ -63,6 +63,9 @@ extern char *bridge_api_file;
 extern char *bg_slurm_user_name;
 extern char *bg_slurm_node_prefix;
 extern bg_layout_t bluegene_layout_mode;
+extern double bluegene_io_ratio;
+extern double bluegene_nc_ratio;
+extern uint16_t bluegene_proc_ratio;
 extern uint16_t bluegene_numpsets;
 extern uint16_t bluegene_bp_node_cnt;
 extern uint16_t bluegene_nodecard_node_cnt;
@@ -83,6 +86,10 @@ extern List bg_blrtsimage_list;
 extern List bg_linuximage_list;
 extern List bg_mloaderimage_list;
 extern List bg_ramdiskimage_list;
+extern List bg_valid_small32;
+extern List bg_valid_small64;
+extern List bg_valid_small128;
+extern List bg_valid_small256;
 
 extern bool agent_fini;
 extern pthread_mutex_t block_state_mutex;
diff --git a/src/plugins/select/bluegene/plugin/dynamic_block.c b/src/plugins/select/bluegene/plugin/dynamic_block.c
index 71a7f0eaaa1..7848d565935 100644
--- a/src/plugins/select/bluegene/plugin/dynamic_block.c
+++ b/src/plugins/select/bluegene/plugin/dynamic_block.c
@@ -57,12 +57,13 @@ extern List create_dynamic_block(List block_list,
 	bg_record_t *bg_record = NULL;
 	List results = NULL;
 	List new_blocks = NULL;
-	uint16_t num_small128=0, num_small32=0;
 	bitstr_t *my_bitmap = NULL;
 	int geo[BA_SYSTEM_DIMENSIONS];
 	int i;
 	blockreq_t blockreq;
 
+	memset(&blockreq, 0, sizeof(blockreq_t));
+
 	slurm_mutex_lock(&block_state_mutex);
 	if(my_block_list) {
 		reset_ba_system(true);
@@ -123,7 +124,7 @@ extern List create_dynamic_block(List block_list,
 		xfree(nodes);
 		FREE_NULL_BITMAP(bitmap);
 	}
-
+#ifdef HAVE_BGL
 	if(request->size==1 && request->procs < bluegene_bp_node_cnt) {
 		request->conn_type = SELECT_SMALL;
 		if(request->procs == (procs_per_node/16)) {
@@ -135,8 +136,8 @@ extern List create_dynamic_block(List block_list,
 				goto finished;
 			}
 
-			num_small32=4;
-			num_small128=3;
+			blockreq.small32=4;
+			blockreq.small128=3;
 		} else {
 			if(!bluegene_quarter_ionode_cnt) {
 				error("can't create this size %d "
@@ -145,7 +146,7 @@ extern List create_dynamic_block(List block_list,
 				      bluegene_numpsets);
 				goto finished;
 			}
-			num_small128=4;
+			blockreq.small128=4;
 		}
 		new_blocks = list_create(destroy_bg_record);
 		if(_breakup_blocks(block_list, new_blocks, 
@@ -158,7 +159,81 @@ extern List create_dynamic_block(List block_list,
 		} else 
 			goto finished;
 	}
-	
+#else
+	if(request->size==1 && request->procs < bluegene_bp_node_cnt) {
+		int cnodes = request->procs / bluegene_proc_ratio;
+		if(cnodes < bluegene_quarter_node_cnt) {
+			if(!bluegene_nodecard_ionode_cnt) {
+				error("can't create this size %d "
+				      "on this system numpsets is %d",
+				      request->procs,
+				      bluegene_numpsets);
+				goto finished;
+			}
+		} else {
+			if(!bluegene_quarter_ionode_cnt) {
+				error("can't create this size %d "
+				      "on this system numpsets is %d",
+				      request->procs,
+				      bluegene_numpsets);
+				goto finished;
+			}
+		}
+		switch(cnodes) {
+		case 16:
+			request->small16 = 1;
+			
+			blockreq.small16 = 2;
+			blockreq.small32 = 1;
+			blockreq.small64 = 1;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 32:
+			request->small32 = 1;
+			
+			blockreq.small32 = 2;
+			blockreq.small64 = 1;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 64:
+			request->small64 = 1;
+			
+			blockreq.small64 = 2;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 128:
+			request->small128 = 1;
+			
+			blockreq.small128 = 2;
+			blockreq.small256 = 1;
+			break;
+		case 256:
+			request->small256 = 1;
+			
+			blockreq.small256 = 2;
+			break;
+		default:
+			error("This size %d is unknown on this system", cnodes);
+			goto finished;
+			break;
+		}
+
+		request->conn_type = SELECT_SMALL;
+		new_blocks = list_create(destroy_bg_record);
+		if(_breakup_blocks(block_list, new_blocks, 
+				   request, my_block_list)
+		   != SLURM_SUCCESS) {
+			list_destroy(new_blocks);
+			new_blocks = NULL;
+			debug2("small block not able to be placed");
+			//rc = SLURM_ERROR;
+		} else 
+			goto finished;
+	}
+#endif	
 	if(request->conn_type == SELECT_NAV)
 		request->conn_type = SELECT_TORUS;
 	
@@ -243,7 +318,6 @@ no_list:
 	
 	/*set up bg_record(s) here */
 	new_blocks = list_create(destroy_bg_record);
-	memset(&blockreq, 0, sizeof(blockreq_t));
 
 	blockreq.block = request->save_name;
 #ifdef HAVE_BGL
@@ -253,8 +327,6 @@ no_list:
 	blockreq.mloaderimage = request->mloaderimage;
 	blockreq.ramdiskimage = request->ramdiskimage;
 	blockreq.conn_type = request->conn_type;
-	blockreq.small32 = num_small32;
-	blockreq.small128 = num_small128;
 
 	add_bg_record(new_blocks, results, &blockreq);
 
@@ -275,6 +347,7 @@ finished:
 	return new_blocks;
 }
 
+#ifdef HAVE_BGL
 extern bg_record_t *create_small_record(bg_record_t *bg_record, 
 					uint16_t quarter, uint16_t nodecard)
 {
@@ -314,9 +387,8 @@ extern bg_record_t *create_small_record(bg_record_t *bg_record,
 		found_record->bp_count = 1;
 	}
 	found_record->nodes = xstrdup(bg_record->nodes);
-#ifdef HAVE_BGL
+
 	found_record->blrtsimage = xstrdup(bg_record->blrtsimage);
-#endif
 	found_record->linuximage = xstrdup(bg_record->linuximage);
 	found_record->mloaderimage = xstrdup(bg_record->mloaderimage);
 	found_record->ramdiskimage = xstrdup(bg_record->ramdiskimage);
@@ -325,9 +397,8 @@ extern bg_record_t *create_small_record(bg_record_t *bg_record,
 				
 	found_record->conn_type = SELECT_SMALL;
 				
-#ifdef HAVE_BGL
 	found_record->node_use = SELECT_COPROCESSOR_MODE;
-#endif
+
 	if(nodecard != (uint16_t) NO_VAL)
 		small_size = 16;
 	found_record->cpus_per_bp = procs_per_node/small_size;
@@ -341,8 +412,74 @@ extern bg_record_t *create_small_record(bg_record_t *bg_record,
 	return found_record;
 }
 
+#else
+extern bg_record_t *create_small_record(bg_record_t *bg_record, 
+					bitstr_t *ionodes, int size)
+{
+	bg_record_t *found_record = NULL;
+	ListIterator itr = NULL;
+	ba_node_t *new_ba_node = NULL;
+	ba_node_t *ba_node = NULL;
+	char bitstring[BITSIZE];
+	found_record = (bg_record_t*) xmalloc(sizeof(bg_record_t));
+				
+	found_record->job_running = NO_JOB_RUNNING;
+	found_record->user_name = xstrdup(bg_record->user_name);
+	found_record->user_uid = bg_record->user_uid;
+	found_record->bg_block_list = list_create(destroy_ba_node);
+	itr = list_iterator_create(bg_record->bg_block_list);
+	ba_node = list_next(itr);
+	list_iterator_destroy(itr);
+	if(!ba_node)
+		error("you gave me a list with no ba_nodes");
+	else {
+		int i=0,j=0;
+		new_ba_node = ba_copy_node(ba_node);
+		for (i=0; i<BA_SYSTEM_DIMENSIONS; i++){
+			for(j=0;j<NUM_PORTS_PER_NODE;j++) {
+				ba_node->axis_switch[i].int_wire[j].used = 0;	
+				if(i!=X) {
+					if(j==3 || j==4) 
+						ba_node->axis_switch[i].
+							int_wire[j].
+							used = 1;	
+				}
+				ba_node->axis_switch[i].int_wire[j].
+					port_tar = j;
+			}
+		}
+		list_append(found_record->bg_block_list, new_ba_node);
+		found_record->bp_count = 1;
+	}
+	found_record->nodes = xstrdup(bg_record->nodes);
+#ifdef HAVE_BGL
+	found_record->blrtsimage = xstrdup(bg_record->blrtsimage);
+#endif
+	found_record->linuximage = xstrdup(bg_record->linuximage);
+	found_record->mloaderimage = xstrdup(bg_record->mloaderimage);
+	found_record->ramdiskimage = xstrdup(bg_record->ramdiskimage);
+
+	process_nodes(found_record, false);
+				
+	found_record->conn_type = SELECT_SMALL;
+				
+#ifdef HAVE_BGL
+	found_record->node_use = SELECT_COPROCESSOR_MODE;
+#endif
+	xassert(bluegene_proc_ratio);
+	found_record->cpus_per_bp = bluegene_proc_ratio * size;
+	found_record->node_cnt = size;
+
+	found_record->ionode_bitmap = bit_copy(ionodes);
+	bit_fmt(bitstring, BITSIZE, found_record->ionode_bitmap);
+	found_record->ionodes = xstrdup(bitstring);
+	return found_record;
+}
+#endif
+
 /*********************** Local Functions *************************/
 
+#ifdef HAVE_BGL
 static int _split_block(List block_list, List new_blocks,
 			bg_record_t *bg_record, int procs) 
 {
@@ -461,13 +598,11 @@ static int _breakup_blocks(List block_list, List new_blocks,
 			debug2("found it here %s, %s",
 			       bg_record->bg_block_id,
 			       bg_record->nodes);
-			request->save_name = xmalloc(4);
-			snprintf(request->save_name,
-				 4,
-				 "%c%c%c",
-				 alpha_num[bg_record->start[X]],
-				 alpha_num[bg_record->start[Y]],
-				 alpha_num[bg_record->start[Z]]);
+			request->save_name = xstrdup_printf(
+				"%c%c%c",
+				alpha_num[bg_record->start[X]],
+				alpha_num[bg_record->start[Y]],
+				alpha_num[bg_record->start[Z]]);
 			rc = SLURM_SUCCESS;
 			goto finished;
 		}
@@ -483,13 +618,11 @@ static int _breakup_blocks(List block_list, List new_blocks,
 			debug2("1 got %d on quarter %d",
 			       total_proc_cnt, last_quarter);
 			if(total_proc_cnt == request->procs) {
-				request->save_name = xmalloc(4);
-				snprintf(request->save_name, 
-					 4,
-					 "%c%c%c",
-					 alpha_num[bg_record->start[X]],
-					 alpha_num[bg_record->start[Y]],
-					 alpha_num[bg_record->start[Z]]);
+				request->save_name = xstrdup_printf(
+					"%c%c%c",
+					alpha_num[bg_record->start[X]],
+					alpha_num[bg_record->start[Y]],
+					alpha_num[bg_record->start[Z]]);
 				if(!my_block_list) {
 					rc = SLURM_SUCCESS;
 					goto finished;	
@@ -553,13 +686,11 @@ static int _breakup_blocks(List block_list, List new_blocks,
 			debug2("found it here %s, %s",
 			       bg_record->bg_block_id,
 			       bg_record->nodes);
-			request->save_name = xmalloc(4);
-			snprintf(request->save_name,
-				 4,
-				 "%c%c%c",
-				 alpha_num[bg_record->start[X]],
-				 alpha_num[bg_record->start[Y]],
-				 alpha_num[bg_record->start[Z]]);
+			request->save_name = xstrdup_printf(
+				"%c%c%c",
+				alpha_num[bg_record->start[X]],
+				alpha_num[bg_record->start[Y]],
+				alpha_num[bg_record->start[Z]]);
 			rc = SLURM_SUCCESS;
 			goto finished;
 		} 
@@ -576,13 +707,11 @@ static int _breakup_blocks(List block_list, List new_blocks,
 			debug2("got %d on quarter %d",
 			       total_proc_cnt, last_quarter);
 			if(total_proc_cnt == request->procs) {
-				request->save_name = xmalloc(4);
-				snprintf(request->save_name,
-					 4,
-					 "%c%c%c",
-					 alpha_num[bg_record->start[X]],
-					 alpha_num[bg_record->start[Y]],
-					 alpha_num[bg_record->start[Z]]);
+				request->save_name = xstrdup_printf(
+					"%c%c%c",
+					alpha_num[bg_record->start[X]],
+					alpha_num[bg_record->start[Y]],
+					alpha_num[bg_record->start[Z]]);
 				if(!my_block_list) {
 					rc = SLURM_SUCCESS;
 					goto finished;	
@@ -624,13 +753,326 @@ found_one:
 		debug2("going to split %s, %s",
 		       found_record->bg_block_id,
 		       tmp_char);
-		request->save_name = xmalloc(4);
-		snprintf(request->save_name, 
-			 4,
-			 "%c%c%c",
-			 alpha_num[found_record->start[X]],
-			 alpha_num[found_record->start[Y]],
-			 alpha_num[found_record->start[Z]]);
+		request->save_name = xstrdup_printf(
+			"%c%c%c",
+			alpha_num[found_record->start[X]],
+			alpha_num[found_record->start[Y]],
+			alpha_num[found_record->start[Z]]);
+		if(!my_block_list) {
+			rc = SLURM_SUCCESS;
+			goto finished;	
+		}
+		_split_block(block_list, new_blocks,
+			     found_record, request->procs);
+		remove_from_bg_list(block_list, bg_record);
+		destroy_bg_record(bg_record);
+		remove_from_bg_list(bg_list, found_record);
+		temp_list = list_create(NULL);
+		list_push(temp_list, found_record);
+		num_block_to_free++;
+		free_block_list(temp_list);
+		list_destroy(temp_list);
+		rc = SLURM_SUCCESS;
+		goto finished;
+	}
+	
+finished:
+	list_iterator_destroy(itr);
+		
+	return rc;
+}
+#else
+
+static int _split_block(List block_list, List new_blocks,
+			bg_record_t *bg_record, int procs) 
+{
+//	bg_record_t *found_record = NULL;
+	bool full_bp = false; 
+	int small_count = 0;
+	int small_size = 0;
+	uint16_t num_nodecard = 0, num_quarter = 0;
+	int i;
+	int node_cnt = 0;
+	uint16_t quarter = 0;
+	uint16_t nodecard = 0;
+	int cnodes = procs / bluegene_proc_ratio;
+	bitstr_t *ionodes = bit_alloc(bluegene_numpsets);
+	blockreq_t blockreq;
+	
+	switch(bg_record->node_cnt) {
+	case 16:
+		error("We got a 16 we should never have this");
+		goto finished;
+		break;
+	case 32:
+		
+		break;
+	case 64:
+		
+		break;
+	case 128:
+		
+		break;
+	case 256:
+		
+		break;
+	default:
+		full_bp = true;
+		break;
+	}
+		
+	if(bg_record->quarter == (uint16_t) NO_VAL)
+		full_bp = true;
+	
+	if(procs == (procs_per_node/16) && bluegene_nodecard_ionode_cnt) {
+		switch(cnodes) {
+		case 16:
+			
+			blockreq.small16 = 2;
+			blockreq.small32 = 1;
+			blockreq.small64 = 1;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 32:
+			
+			blockreq.small32 = 2;
+			blockreq.small64 = 1;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 64:
+			blockreq.small64 = 2;
+			blockreq.small128 = 1;
+			blockreq.small256 = 1;
+			break;
+		case 128:
+				
+			blockreq.small128 = 2;
+			blockreq.small256 = 1;
+			break;
+		case 256:
+			
+			blockreq.small256 = 2;
+			break;
+		default:
+			error("This size %d is unknown on this system", cnodes);
+			goto finished;
+			break;
+		}
+		num_nodecard=4;
+		if(full_bp)
+			num_quarter=3;
+	} else if(full_bp) {
+		num_quarter = 4;
+	} else {
+		error("you asked for something that was already this size");
+		return SLURM_ERROR;
+	}
+	debug2("asking for %d 32s from a %d block",
+	       num_nodecard, bg_record->node_cnt);
+	small_count = num_nodecard+num_quarter; 
+
+	/* break base partition up into 16 parts */
+	small_size = bluegene_bp_node_cnt/bluegene_nodecard_node_cnt;
+	node_cnt = 0;
+	if(!full_bp)
+		quarter = bg_record->quarter;
+	else
+		quarter = 0;
+	nodecard = 0;
+	for(i=0; i<small_count; i++) {
+		if(i == num_nodecard) {
+			/* break base partition up into 4 parts */
+			small_size = 4;
+		}
+		
+		if(small_size == 4)
+			nodecard = (uint16_t)NO_VAL;
+		else
+			nodecard = i%4; 
+/* 		found_record = create_small_record(bg_record, */
+/* 						   quarter, */
+/* 						   nodecard); */
+//		list_append(new_blocks, found_record);
+				
+		node_cnt += bluegene_bp_node_cnt/small_size;
+		if(node_cnt == 128) {
+			node_cnt = 0;
+			quarter++;
+		}
+	}
+finished:
+	FREE_NULL_BITMAP(ionodes);
+	return SLURM_SUCCESS;
+}
+
+static int _breakup_blocks(List block_list, List new_blocks,
+			   ba_request_t *request, List my_block_list)
+{
+	int rc = SLURM_ERROR;
+	bg_record_t *bg_record = NULL;
+	ListIterator itr;
+	int search_cnt = 0;
+	int total_cnode_cnt=0;
+	uint16_t last_quarter = (uint16_t) NO_VAL;
+	char tmp_char[256];
+	bitstr_t *ionodes = bit_alloc(bluegene_numpsets);
+	int cnodes = request->procs / bluegene_proc_ratio;
+	debug2("proc count = %d cnodes = %d size = %d",
+	       request->procs, cnodes, request->size);
+	
+	itr = list_iterator_create(block_list);	
+	/* First try with free blocks a midplane or less.  Then try with the
+	 * smallest blocks.
+	 */
+again:		
+	while ((bg_record = (bg_record_t *) list_next(itr)) != NULL) {
+		if(bg_record->job_running != NO_JOB_RUNNING)
+			continue;
+		/* on the third time through look for just a block
+		 * that isn't used */
+		
+		/* check for free blocks on the first and second time */
+		if((search_cnt < 2)
+		   && (bg_record->state != RM_PARTITION_FREE))
+				continue;
+		/* check small blocks first */
+		if((search_cnt == 0)
+		   && (bg_record->node_cnt > bluegene_bp_node_cnt))
+				continue;
+		
+		if (request->avail_node_bitmap &&
+		    !bit_super_set(bg_record->bitmap,
+				   request->avail_node_bitmap)) {
+			debug2("bg block %s has nodes not usable by this job",
+			       bg_record->bg_block_id);
+			continue;
+		}
+
+		if(request->start_req) {
+			if ((request->start[X] != bg_record->start[X])
+			    || (request->start[Y] != bg_record->start[Y])
+			    || (request->start[Z] != bg_record->start[Z])) {
+				debug4("small got %c%c%c looking for %c%c%c",
+				       alpha_num[bg_record->start[X]],
+				       alpha_num[bg_record->start[Y]],
+				       alpha_num[bg_record->start[Z]],
+				       alpha_num[request->start[X]],
+				       alpha_num[request->start[Y]],
+				       alpha_num[request->start[Z]]);
+				continue;
+			}
+			debug3("small found %c%c%c looking for %c%c%c",
+			       alpha_num[bg_record->start[X]],
+			       alpha_num[bg_record->start[Y]],
+			       alpha_num[bg_record->start[Z]],
+			       alpha_num[request->start[X]],
+			       alpha_num[request->start[Y]],
+			       alpha_num[request->start[Z]]);
+		}
+
+		if(bg_record->node_cnt == cnodes) {
+			debug2("found it here %s, %s",
+			       bg_record->bg_block_id,
+			       bg_record->nodes);
+			request->save_name = xstrdup_printf(
+				"%c%c%c",
+				alpha_num[bg_record->start[X]],
+				alpha_num[bg_record->start[Y]],
+				alpha_num[bg_record->start[Z]]);
+			rc = SLURM_SUCCESS;
+			goto finished;
+		}
+		/* lets see if we can combine some small ones */
+		if(bg_record->node_cnt < cnodes) {
+			bit_and(ionodes, bg_record->ionode_bitmap);
+			switch(cnodes) {
+			case 16:
+				break;
+			case 32:
+				break;
+			case 64:
+				break;
+			case 128:
+				break;
+			case 256:
+				break;
+			default:
+				error("We shouldn't be here with this size %d",
+				      cnodes);
+				goto finished;
+				break;				
+			}
+			if(last_quarter != bg_record->quarter){
+				last_quarter = bg_record->quarter;
+				total_cnode_cnt = cnodes;
+			} else {
+				total_cnode_cnt += cnodes;
+			}
+			debug2("1 got %d on quarter %d",
+			       total_cnode_cnt, last_quarter);
+			if(total_cnode_cnt == cnodes) {
+				request->save_name = xstrdup_printf(
+					"%c%c%c",
+					alpha_num[bg_record->start[X]],
+					alpha_num[bg_record->start[Y]],
+					alpha_num[bg_record->start[Z]]);
+				if(!my_block_list) {
+					rc = SLURM_SUCCESS;
+					goto finished;	
+				}
+						
+/* 				bg_record = create_small_record( */
+/* 					bg_record, */
+/* 					last_quarter, */
+/* 					(uint16_t) NO_VAL); */
+/* 				list_append(new_blocks, bg_record); */
+							
+				rc = SLURM_SUCCESS;
+				goto finished;	
+			}
+			continue;
+		}
+		/* we found a block that is bigger than requested */
+		break;
+	}
+	
+	if(!bg_record && (search_cnt < 2)) {
+		search_cnt++;
+		list_iterator_reset(itr);
+		last_quarter = (uint16_t) NO_VAL;
+		goto again;
+	}
+
+	if(bg_record) {
+		List temp_list = NULL;
+		bg_record_t *found_record = NULL;
+
+		if(bg_record->original) {
+			debug3("This was a copy");
+			found_record = bg_record->original;
+		} else {
+			debug3("looking for original");
+			found_record = find_org_in_bg_list(
+				bg_list, bg_record);
+		}
+		if(!found_record) {
+			error("this record wasn't found in the list!");
+			rc = SLURM_ERROR;
+			goto finished;
+		}
+		
+		format_node_name(found_record, tmp_char, sizeof(tmp_char));
+			
+		debug2("going to split %s, %s",
+		       found_record->bg_block_id,
+		       tmp_char);
+		request->save_name = xstrdup_printf(
+			"%c%c%c",
+			alpha_num[found_record->start[X]],
+			alpha_num[found_record->start[Y]],
+			alpha_num[found_record->start[Z]]);
 		if(!my_block_list) {
 			rc = SLURM_SUCCESS;
 			goto finished;	
@@ -650,7 +1092,10 @@ found_one:
 	}
 	
 finished:
+	FREE_NULL_BITMAP(ionodes);	
 	list_iterator_destroy(itr);
 		
 	return rc;
 }
+
+#endif
diff --git a/src/plugins/select/bluegene/plugin/dynamic_block.h b/src/plugins/select/bluegene/plugin/dynamic_block.h
index c98aadf1a32..06ad3d706f6 100644
--- a/src/plugins/select/bluegene/plugin/dynamic_block.h
+++ b/src/plugins/select/bluegene/plugin/dynamic_block.h
@@ -44,6 +44,12 @@
 extern List create_dynamic_block(List block_list,
 				 ba_request_t *request, List my_block_list);
 
+#ifdef HAVE_BGL 
 extern bg_record_t *create_small_record(bg_record_t *bg_record, 
 					uint16_t quarter, uint16_t nodecard);
+#else
+extern bg_record_t *create_small_record(bg_record_t *bg_record, 
+					bitstr_t *ionodes, int size);
+#endif
+
 #endif /* _BLUEGENE_DYNAMIC_BLOCK_H_ */
diff --git a/src/plugins/select/cons_res/Makefile.in b/src/plugins/select/cons_res/Makefile.in
index b98591c6df7..ede76eb026b 100644
--- a/src/plugins/select/cons_res/Makefile.in
+++ b/src/plugins/select/cons_res/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/select/linear/Makefile.in b/src/plugins/select/linear/Makefile.in
index 6eeefaec2bd..17de5b3cebd 100644
--- a/src/plugins/select/linear/Makefile.in
+++ b/src/plugins/select/linear/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/switch/Makefile.in b/src/plugins/switch/Makefile.in
index a4587d1df8f..43a39123920 100644
--- a/src/plugins/switch/Makefile.in
+++ b/src/plugins/switch/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/switch/elan/Makefile.in b/src/plugins/switch/elan/Makefile.in
index f98e5006949..211b717e022 100644
--- a/src/plugins/switch/elan/Makefile.in
+++ b/src/plugins/switch/elan/Makefile.in
@@ -114,6 +114,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/switch/federation/Makefile.in b/src/plugins/switch/federation/Makefile.in
index e0f5f292f9b..80d48b6cfa6 100644
--- a/src/plugins/switch/federation/Makefile.in
+++ b/src/plugins/switch/federation/Makefile.in
@@ -117,6 +117,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/switch/none/Makefile.in b/src/plugins/switch/none/Makefile.in
index f68cbd1a402..5585070560d 100644
--- a/src/plugins/switch/none/Makefile.in
+++ b/src/plugins/switch/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/task/Makefile.in b/src/plugins/task/Makefile.in
index deabe6e026b..cab8c096eda 100644
--- a/src/plugins/task/Makefile.in
+++ b/src/plugins/task/Makefile.in
@@ -90,6 +90,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/task/affinity/Makefile.in b/src/plugins/task/affinity/Makefile.in
index c52ed708d91..b9c5acd9348 100644
--- a/src/plugins/task/affinity/Makefile.in
+++ b/src/plugins/task/affinity/Makefile.in
@@ -120,6 +120,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/plugins/task/none/Makefile.in b/src/plugins/task/none/Makefile.in
index a8a0b0cd67d..2f9ce951ba0 100644
--- a/src/plugins/task/none/Makefile.in
+++ b/src/plugins/task/none/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sacct/Makefile.in b/src/sacct/Makefile.in
index 6ea7cd17deb..8d075ad2b31 100644
--- a/src/sacct/Makefile.in
+++ b/src/sacct/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sacctmgr/Makefile.in b/src/sacctmgr/Makefile.in
index d40fb0a9942..25b6804c253 100644
--- a/src/sacctmgr/Makefile.in
+++ b/src/sacctmgr/Makefile.in
@@ -109,6 +109,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/salloc/Makefile.in b/src/salloc/Makefile.in
index 8a8321a9489..f9008d5dce0 100644
--- a/src/salloc/Makefile.in
+++ b/src/salloc/Makefile.in
@@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sattach/Makefile.in b/src/sattach/Makefile.in
index 778c65fb4be..a024c851781 100644
--- a/src/sattach/Makefile.in
+++ b/src/sattach/Makefile.in
@@ -105,6 +105,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sbatch/Makefile.in b/src/sbatch/Makefile.in
index e3609ea9cc2..e651ccf00f6 100644
--- a/src/sbatch/Makefile.in
+++ b/src/sbatch/Makefile.in
@@ -104,6 +104,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sbcast/Makefile.in b/src/sbcast/Makefile.in
index dbb68faa572..6177bba8b8c 100644
--- a/src/sbcast/Makefile.in
+++ b/src/sbcast/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/scancel/Makefile.in b/src/scancel/Makefile.in
index 7e149c5e1c5..542c363fac0 100644
--- a/src/scancel/Makefile.in
+++ b/src/scancel/Makefile.in
@@ -106,6 +106,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/scontrol/Makefile.in b/src/scontrol/Makefile.in
index e27720ce943..1e174c34e57 100644
--- a/src/scontrol/Makefile.in
+++ b/src/scontrol/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sinfo/Makefile.in b/src/sinfo/Makefile.in
index a867a797407..2c43b38e696 100644
--- a/src/sinfo/Makefile.in
+++ b/src/sinfo/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in
index 509d3fd2ca6..d2e307c1f17 100644
--- a/src/slurmctld/Makefile.in
+++ b/src/slurmctld/Makefile.in
@@ -112,6 +112,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmd/Makefile.in b/src/slurmd/Makefile.in
index 3f76527516c..8550eb1c298 100644
--- a/src/slurmd/Makefile.in
+++ b/src/slurmd/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmd/slurmd/Makefile.in b/src/slurmd/slurmd/Makefile.in
index 13c7f21a5bd..1035da9a8aa 100644
--- a/src/slurmd/slurmd/Makefile.in
+++ b/src/slurmd/slurmd/Makefile.in
@@ -111,6 +111,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmd/slurmstepd/Makefile.in b/src/slurmd/slurmstepd/Makefile.in
index 7b1bbc1d318..e36851d7677 100644
--- a/src/slurmd/slurmstepd/Makefile.in
+++ b/src/slurmd/slurmstepd/Makefile.in
@@ -113,6 +113,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmdbd/Makefile.in b/src/slurmdbd/Makefile.in
index 8f725dcefbb..3bb71e1c911 100644
--- a/src/slurmdbd/Makefile.in
+++ b/src/slurmdbd/Makefile.in
@@ -106,6 +106,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/slurmdbd/rpc_mgr.c b/src/slurmdbd/rpc_mgr.c
index 6175170583d..0ffb3ec30ce 100644
--- a/src/slurmdbd/rpc_mgr.c
+++ b/src/slurmdbd/rpc_mgr.c
@@ -222,14 +222,13 @@ static void * _service_connection(void *arg)
 			rc = proc_req(
 				conn, msg, msg_size, first, &buffer, &uid);
 			first = false;
-			if (rc == ESLURM_ACCESS_DENIED
-			    || rc == SLURM_PROTOCOL_VERSION_ERROR) {
-				fini = true;
-			} else if (rc != SLURM_SUCCESS) {
+			if (rc != SLURM_SUCCESS) {
 				error("Processing last message from "
 				      "connection %d(%s) uid(%d)",
 				      conn->newsockfd, conn->ip, uid);
-				//fini = true;
+				if (rc == ESLURM_ACCESS_DENIED
+				    || rc == SLURM_PROTOCOL_VERSION_ERROR) 
+					fini = true;
 			}
 		} else {
 			buffer = make_dbd_rc_msg(conn->rpc_version,
diff --git a/src/smap/Makefile.in b/src/smap/Makefile.in
index 3e2a65e2079..39b58755e4f 100644
--- a/src/smap/Makefile.in
+++ b/src/smap/Makefile.in
@@ -121,6 +121,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/squeue/Makefile.in b/src/squeue/Makefile.in
index ca617dd254b..f957057b2aa 100644
--- a/src/squeue/Makefile.in
+++ b/src/squeue/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sreport/Makefile.in b/src/sreport/Makefile.in
index b472594ce1b..ddc79ca269e 100644
--- a/src/sreport/Makefile.in
+++ b/src/sreport/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/srun/Makefile.am b/src/srun/Makefile.am
index 5809c715abf..f16818e2a87 100644
--- a/src/srun/Makefile.am
+++ b/src/srun/Makefile.am
@@ -35,10 +35,10 @@ force:
 $(convenience_libs) : force
 	@cd `dirname $@` && $(MAKE) `basename $@`
 
-# debugging information is required for symbols in the attach 
-# module so that a debugger can attach to spawned tasks
-attach.o : attach.c
-	$(COMPILE) -c -g -o attach.o $(srcdir)/attach.c 
+# debugging information is required for symbols in the debugger 
+# module so that a debugger can debugger to spawned tasks
+debugger.o : debugger.c
+	$(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c 
 
 install-exec-local:
 	umask 022; \
diff --git a/src/srun/Makefile.in b/src/srun/Makefile.in
index 87d077da051..04eae681e58 100644
--- a/src/srun/Makefile.in
+++ b/src/srun/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
@@ -584,10 +585,10 @@ force:
 $(convenience_libs) : force
 	@cd `dirname $@` && $(MAKE) `basename $@`
 
-# debugging information is required for symbols in the attach 
-# module so that a debugger can attach to spawned tasks
-attach.o : attach.c
-	$(COMPILE) -c -g -o attach.o $(srcdir)/attach.c 
+# debugging information is required for symbols in the debugger 
+# module so that a debugger can debugger to spawned tasks
+debugger.o : debugger.c
+	$(COMPILE) -c -g -o debugger.o $(srcdir)/debugger.c 
 
 install-exec-local:
 	umask 022; \
diff --git a/src/sshare/Makefile.in b/src/sshare/Makefile.in
index fc1f4cc4f6b..0cd93fadbd1 100644
--- a/src/sshare/Makefile.in
+++ b/src/sshare/Makefile.in
@@ -105,6 +105,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sstat/Makefile.in b/src/sstat/Makefile.in
index 978f3f10065..b64dce76766 100644
--- a/src/sstat/Makefile.in
+++ b/src/sstat/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/strigger/Makefile.in b/src/strigger/Makefile.in
index 0182c39af9e..74967650146 100644
--- a/src/strigger/Makefile.in
+++ b/src/strigger/Makefile.in
@@ -107,6 +107,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/src/sview/Makefile.in b/src/sview/Makefile.in
index 4ac9f03e205..117661aff77 100644
--- a/src/sview/Makefile.in
+++ b/src/sview/Makefile.in
@@ -125,6 +125,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index 665e64e38ce..8f0cefcd724 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -95,6 +95,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in
index 066d5ed60ee..98fdfeb485c 100644
--- a/testsuite/expect/Makefile.in
+++ b/testsuite/expect/Makefile.in
@@ -76,6 +76,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/Makefile.in b/testsuite/slurm_unit/Makefile.in
index 6697112ab69..9531a6e88f6 100644
--- a/testsuite/slurm_unit/Makefile.in
+++ b/testsuite/slurm_unit/Makefile.in
@@ -88,6 +88,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/api/Makefile.in b/testsuite/slurm_unit/api/Makefile.in
index d5d7b66f001..1a39202f482 100644
--- a/testsuite/slurm_unit/api/Makefile.in
+++ b/testsuite/slurm_unit/api/Makefile.in
@@ -108,6 +108,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/api/manual/Makefile.in b/testsuite/slurm_unit/api/manual/Makefile.in
index a9f8c0c2db9..4b2b4d6a321 100644
--- a/testsuite/slurm_unit/api/manual/Makefile.in
+++ b/testsuite/slurm_unit/api/manual/Makefile.in
@@ -130,6 +130,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/common/Makefile.in b/testsuite/slurm_unit/common/Makefile.in
index e6136caff1b..f1efa016476 100644
--- a/testsuite/slurm_unit/common/Makefile.in
+++ b/testsuite/slurm_unit/common/Makefile.in
@@ -116,6 +116,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/slurmctld/Makefile.in b/testsuite/slurm_unit/slurmctld/Makefile.in
index 01fa982519f..cc12fd7093d 100644
--- a/testsuite/slurm_unit/slurmctld/Makefile.in
+++ b/testsuite/slurm_unit/slurmctld/Makefile.in
@@ -79,6 +79,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
diff --git a/testsuite/slurm_unit/slurmd/Makefile.in b/testsuite/slurm_unit/slurmd/Makefile.in
index 5231f2e2188..50b756aef77 100644
--- a/testsuite/slurm_unit/slurmd/Makefile.in
+++ b/testsuite/slurm_unit/slurmd/Makefile.in
@@ -79,6 +79,7 @@ AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BG_INCLUDES = @BG_INCLUDES@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
-- 
GitLab