From a5874a3934cf370ab4e614021157a25303df158b Mon Sep 17 00:00:00 2001
From: Gennaro Oliva <oliva.g@na.icar.cnr.it>
Date: Wed, 1 Jun 2016 10:25:07 +0200
Subject: [PATCH] Imported Upstream version 16.05.0

---
 .gitignore                                    |    2 +-
 AUTHORS                                       |    1 +
 BUILD.NOTES                                   |    1 -
 CONTRIBUTING.md                               |   65 +
 ChangeLog                                     |    0
 META                                          |   18 +-
 Makefile.am                                   |    8 +-
 Makefile.in                                   |   62 +-
 NEWS                                          |  298 +-
 RELEASE_NOTES                                 |  583 +-
 aclocal.m4                                    |  231 +-
 autogen.sh                                    |    3 -
 auxdir/Makefile.am                            |   10 +-
 auxdir/Makefile.in                            |   30 +-
 auxdir/ax_check_zlib.m4                       |  139 +
 auxdir/config.guess                           |   47 +-
 auxdir/config.sub                             |   36 +-
 auxdir/install-sh                             |   23 +-
 auxdir/libtool.m4                             | 2521 ++++----
 auxdir/ltmain.sh                              | 5533 +++++++++++------
 auxdir/ltoptions.m4                           |  127 +-
 auxdir/ltsugar.m4                             |    7 +-
 auxdir/ltversion.m4                           |   12 +-
 auxdir/lt~obsolete.m4                         |    7 +-
 auxdir/type_socklen_t.m4                      |    2 -
 auxdir/x_ac__system_configuration.m4          |    2 -
 auxdir/x_ac_affinity.m4                       |    2 -
 auxdir/x_ac_aix.m4                            |    2 -
 auxdir/x_ac_blcr.m4                           |   77 +-
 auxdir/x_ac_bluegene.m4                       |    2 -
 auxdir/x_ac_cflags.m4                         |   24 -
 auxdir/x_ac_cray.m4                           |    4 +
 auxdir/x_ac_databases.m4                      |    5 +-
 auxdir/x_ac_debug.m4                          |    2 -
 auxdir/x_ac_elan.m4                           |   64 -
 auxdir/x_ac_federation.m4                     |   53 -
 auxdir/x_ac_freeipmi.m4                       |   84 +-
 auxdir/x_ac_gpl_licensed.m4                   |    2 -
 auxdir/x_ac_hwloc.m4                          |   90 +-
 auxdir/x_ac_json.m4                           |   81 +-
 auxdir/x_ac_lua.m4                            |    2 -
 auxdir/x_ac_lz4.m4                            |   88 +
 auxdir/x_ac_munge.m4                          |   77 +-
 auxdir/x_ac_ncurses.m4                        |    2 -
 auxdir/x_ac_netloc.m4                         |  103 +-
 auxdir/x_ac_ofed.m4                           |   91 +-
 auxdir/x_ac_pam.m4                            |    2 -
 auxdir/x_ac_pmix.m4                           |   89 +
 auxdir/x_ac_ptrace.m4                         |    2 -
 auxdir/x_ac_readline.m4                       |    2 -
 auxdir/x_ac_rrdtool.m4                        |   44 +-
 auxdir/x_ac_setpgrp.m4                        |    2 -
 auxdir/x_ac_setproctitle.m4                   |    2 -
 auxdir/x_ac_sgi_job.m4                        |    2 -
 auxdir/x_ac_slurm_ssl.m4                      |    2 -
 auxdir/x_ac_sun_const.m4                      |   36 -
 config.h.in                                   |   23 +-
 config.xml.in                                 |   60 -
 configure                                     | 4326 ++++++++-----
 configure.ac                                  |   33 +-
 contribs/Makefile.am                          |    3 +-
 contribs/Makefile.in                          |   23 +-
 contribs/README                               |    8 -
 contribs/cray/Makefile.am                     |   38 +-
 contribs/cray/Makefile.in                     |  230 +-
 contribs/cray/capmc_resume.c                  |  717 +++
 contribs/cray/capmc_suspend.c                 |  543 ++
 contribs/cray/csm/Makefile.in                 |   20 +-
 contribs/cray/slurm.conf.template             |    1 -
 contribs/lua/Makefile.in                      |   20 +-
 contribs/mic/Makefile.in                      |   20 +-
 contribs/openlava/Makefile.am                 |   31 +
 contribs/openlava/Makefile.in                 |  678 ++
 contribs/openlava/bjobs.pl                    |  210 +
 contribs/openlava/bkill.pl                    |  154 +
 contribs/openlava/bsub.pl                     |  399 ++
 contribs/openlava/lsid.pl                     |  140 +
 contribs/pam/Makefile.in                      |   20 +-
 contribs/pam/pam_slurm.c                      |    2 +-
 contribs/pam_slurm_adopt/Makefile.in          |   20 +-
 contribs/pam_slurm_adopt/helper.c             |    3 +-
 contribs/perlapi/Makefile.in                  |   20 +-
 contribs/perlapi/libslurm/Makefile.in         |   20 +-
 contribs/perlapi/libslurm/perl/Slurm.xs       |    5 +-
 contribs/perlapi/libslurm/perl/job.c          |    3 +-
 contribs/perlapi/libslurm/perl/node.c         |    8 +-
 contribs/perlapi/libslurm/perl/partition.c    |    9 +-
 contribs/perlapi/libslurm/perl/slurm-perl.h   |    4 +-
 contribs/perlapi/libslurmdb/Makefile.in       |   20 +-
 contribs/phpext/Makefile.in                   |   20 +-
 contribs/phpext/slurm_php/config.m4.in        |    2 -
 contribs/pmi2/Makefile.in                     |   20 +-
 contribs/pmi2/pmi2_util.h                     |   12 +-
 contribs/pmi2/testpmi2.c                      |    2 +-
 contribs/ptrace.patch                         |  126 -
 contribs/seff/Makefile.am                     |   27 +
 contribs/seff/Makefile.in                     |  675 ++
 contribs/seff/seff                            |  222 +
 contribs/seff/smail.in                        |   48 +
 contribs/sgather/Makefile.in                  |   20 +-
 contribs/sgi/Makefile.in                      |   20 +-
 contribs/sjobexit/Makefile.in                 |   20 +-
 contribs/slurmdb-direct/Makefile.in           |   20 +-
 contribs/torque/Makefile.in                   |   20 +-
 contribs/torque/qsub.pl                       |  148 +-
 doc/Makefile.in                               |   20 +-
 doc/html/Makefile.am                          |    5 +-
 doc/html/Makefile.in                          |   25 +-
 doc/html/authplugins.shtml                    |    3 +-
 doc/html/bluegene.shtml                       |    8 +-
 doc/html/burst_buffer.shtml                   |   30 +-
 doc/html/cgroups.shtml                        |   11 +-
 doc/html/configurator.easy.html.in            |    2 +
 doc/html/configurator.html.in                 |   24 +-
 doc/html/cons_res.shtml                       |    6 +-
 doc/html/cons_res_share.shtml                 |   74 +-
 doc/html/cpu_management.shtml                 |   22 +-
 doc/html/cray_alps.shtml                      |   10 +-
 doc/html/documentation.shtml                  |   17 +-
 doc/html/download.shtml                       |   21 +-
 doc/html/faq.shtml                            |  156 +-
 doc/html/gang_scheduling.shtml                |   16 +-
 doc/html/ibm-pe.shtml                         |    6 +-
 doc/html/intel_knl.shtml                      |  245 +
 doc/html/launch_plugins.shtml                 |    4 +-
 doc/html/man_index.shtml                      |    3 +-
 doc/html/mc_support.shtml                     |    4 +-
 doc/html/mcs.shtml                            |  126 +
 doc/html/mcs_plugins.shtml                    |  109 +
 doc/html/moab.shtml                           |    4 +-
 doc/html/mpi_guide.shtml                      |   10 +
 doc/html/mpiplugins.shtml                     |    1 +
 doc/html/news.shtml                           |  104 +-
 doc/html/node_features_plugins.shtml          |  174 +
 doc/html/preempt.shtml                        |   40 +-
 doc/html/qos.shtml                            |    7 +-
 doc/html/quickstart.shtml                     |   10 +-
 doc/html/quickstart_admin.shtml               |   28 +-
 doc/html/reservations.shtml                   |    7 +
 doc/html/resource_limits.shtml                |   23 +-
 doc/html/rpc.shtml                            |  204 +-
 doc/html/select_design.shtml                  |    7 +-
 doc/html/selectplugins.shtml                  |   11 +-
 doc/html/sun_const.shtml                      |  160 -
 doc/html/switchplugins.shtml                  |    2 +-
 doc/html/team.shtml                           |    8 +-
 doc/html/topology.shtml                       |    3 +-
 doc/man/Makefile.in                           |   20 +-
 doc/man/man1/Makefile.in                      |   20 +-
 doc/man/man1/sacct.1                          |   10 +-
 doc/man/man1/sacctmgr.1                       |   51 +-
 doc/man/man1/salloc.1                         |   79 +-
 doc/man/man1/sbatch.1                         |  119 +-
 doc/man/man1/sbcast.1                         |   12 +-
 doc/man/man1/scontrol.1                       |   91 +-
 doc/man/man1/sinfo.1                          |   61 +-
 doc/man/man1/squeue.1                         |   59 +-
 doc/man/man1/sreport.1                        |    3 +
 doc/man/man1/srun.1                           |  139 +-
 doc/man/man3/Makefile.in                      |   20 +-
 doc/man/man5/Makefile.am                      |    2 +
 doc/man/man5/Makefile.in                      |   22 +-
 doc/man/man5/burst_buffer.conf.5              |   24 +-
 doc/man/man5/cgroup.conf.5                    |    4 +-
 doc/man/man5/knl.conf.5                       |  173 +
 doc/man/man5/slurm.conf.5                     |  447 +-
 doc/man/man5/slurmdbd.conf.5                  |   21 +-
 doc/man/man8/Makefile.in                      |   20 +-
 doc/man/man8/slurmd.8                         |    8 +-
 doc/man/man8/slurmdbd.8                       |    5 +
 etc/Makefile.am                               |   31 +
 etc/Makefile.in                               |  650 ++
 etc/cgroup.release_common.example.in          |    2 +-
 etc/layouts.d.unit.conf.example               |   30 +
 etc/slurm.conf.example                        |    1 -
 slurm.spec                                    |  168 +-
 slurm/slurm.h.in                              |  977 +--
 slurm/slurm_errno.h                           |   41 +-
 slurm/slurmdb.h                               |  102 +-
 slurm/spank.h                                 |   19 +-
 src/Makefile.am                               |    1 +
 src/Makefile.in                               |   28 +-
 src/api/Makefile.in                           |   20 +-
 src/api/allocate.c                            |    6 +-
 src/api/allocate_msg.c                        |   21 +-
 src/api/block_info.c                          |    6 +-
 src/api/burst_buffer_info.c                   |   58 +-
 src/api/checkpoint.c                          |    1 -
 src/api/complete.c                            |    1 -
 src/api/config_info.c                         |  251 +-
 src/api/init_msg.c                            |    5 +-
 src/api/job_info.c                            |  695 +--
 src/api/job_step_info.c                       |   13 +-
 src/api/layout_info.c                         |    4 +-
 src/api/node_info.c                           |  280 +-
 src/api/partition_info.c                      |   47 +-
 src/api/pmi.c                                 |   46 +-
 src/api/pmi_server.c                          |   22 +-
 src/api/pmi_server.h                          |    3 +-
 src/api/reconfigure.c                         |    1 -
 src/api/signal.c                              |    4 +-
 src/api/slurm_pmi.c                           |   45 +-
 src/api/slurm_pmi.h                           |   28 +-
 src/api/step_ctx.h                            |    2 -
 src/api/step_io.c                             |   38 +-
 src/api/step_io.h                             |    1 -
 src/api/step_launch.c                         |  115 +-
 src/api/step_launch.h                         |    2 -
 src/api/submit.c                              |    1 -
 src/api/suspend.c                             |    1 -
 src/api/update_config.c                       |   25 +-
 src/bcast/Makefile.am                         |   13 +
 src/bcast/Makefile.in                         |  786 +++
 src/bcast/file_bcast.c                        |  561 ++
 src/{common => bcast}/file_bcast.h            |   26 +-
 src/common/Makefile.am                        |    9 +-
 src/common/Makefile.in                        |   99 +-
 src/common/arg_desc.c                         |    3 +-
 src/common/assoc_mgr.c                        |  192 +-
 src/common/bitstring.c                        |    2 +-
 src/common/callerid.c                         |   12 +-
 src/common/cbuf.c                             |   12 +-
 src/common/cbuf.h                             |    4 +-
 src/common/checkpoint.c                       |    1 -
 src/common/checkpoint.h                       |    1 -
 src/common/cpu_frequency.c                    |   83 +-
 src/common/daemonize.c                        |    1 -
 src/common/daemonize.h                        |    3 +-
 src/common/eio.c                              |   11 +-
 src/common/env.c                              |   31 +-
 src/common/env.h                              |    6 +-
 src/common/fd.h                               |    4 +-
 src/common/file_bcast.c                       |  412 --
 src/common/forward.c                          |   26 +-
 src/common/forward.h                          |    2 -
 src/common/getopt.c                           |    6 +-
 src/common/gres.c                             |  436 +-
 src/common/gres.h                             |   20 +
 src/common/hostlist.c                         |   15 +-
 src/common/hostlist.h                         |    4 +-
 src/common/io_hdr.c                           |    1 -
 src/common/io_hdr.h                           |    1 -
 src/common/job_options.c                      |    3 +-
 src/common/job_options.h                      |    1 -
 src/common/job_resources.c                    |  257 +-
 src/common/job_resources.h                    |    4 +
 src/common/layouts_mgr.c                      |   75 +-
 src/common/layouts_mgr.h                      |    2 +-
 src/common/list.c                             |    4 +-
 src/common/list.h                             |    4 +-
 src/common/log.c                              |   24 +-
 src/common/macros.h                           |  159 +-
 src/common/mapping.h                          |    4 -
 src/common/mpi.c                              |    2 +-
 src/common/node_conf.c                        |  127 +-
 src/common/node_conf.h                        |   18 +-
 src/common/node_features.c                    |  421 ++
 src/common/node_features.h                    |   96 +
 src/common/node_select.c                      |   28 +-
 src/common/node_select.h                      |    7 +-
 src/common/optz.c                             |    3 +-
 src/common/parse_config.c                     |   79 +-
 src/common/parse_config.h                     |    2 -
 src/common/parse_spec.c                       |    7 +-
 src/common/parse_time.c                       |   14 +-
 src/common/parse_time.h                       |    1 -
 src/common/parse_value.c                      |   42 +-
 src/common/parse_value.h                      |    2 -
 src/common/plugin.c                           |    4 +-
 src/common/plugrack.c                         |   12 +-
 src/common/plugstack.c                        |   19 +-
 src/common/power.c                            |    2 +-
 src/common/proc_args.c                        |  139 +-
 src/common/proc_args.h                        |    3 +-
 src/common/read_config.c                      |  447 +-
 src/common/read_config.h                      |   13 +-
 src/common/safeopen.c                         |    1 -
 src/common/safeopen.h                         |    1 -
 src/common/siphash.h                          |   68 +
 src/common/siphash24.c                        |  165 +
 .../sicp.h => common/siphash_slurm.c}         |   52 +-
 src/common/slurm_accounting_storage.c         |   29 +-
 src/common/slurm_accounting_storage.h         |   15 +
 src/common/slurm_acct_gather_energy.c         |   47 +-
 src/common/slurm_acct_gather_filesystem.c     |   47 +-
 src/common/slurm_acct_gather_infiniband.c     |   47 +-
 src/common/slurm_acct_gather_profile.c        |   42 +-
 src/common/slurm_auth.c                       |    2 +-
 src/common/slurm_cred.c                       |    4 +-
 src/common/slurm_errno.c                      |   20 +-
 src/common/slurm_jobacct_gather.c             |   51 +-
 src/common/slurm_mcs.c                        |  239 +
 src/common/slurm_mcs.h                        |   64 +
 src/common/slurm_protocol_api.c               |  343 +-
 src/common/slurm_protocol_api.h               |   45 +-
 src/common/slurm_protocol_common.h            |    7 +-
 src/common/slurm_protocol_defs.c              |  628 +-
 src/common/slurm_protocol_defs.h              |   91 +-
 src/common/slurm_protocol_pack.c              | 1996 ++++--
 src/common/slurm_protocol_pack.h              |    7 +
 .../slurm_protocol_socket_implementation.c    |   42 +-
 src/common/slurm_protocol_util.c              |    8 +-
 src/common/slurm_resource_info.c              |   94 +-
 src/common/slurm_resource_info.h              |    1 -
 src/common/slurm_rlimits_info.c               |   10 +-
 src/common/slurm_rlimits_info.h               |    2 -
 src/common/slurm_route.c                      |   25 +-
 src/common/slurm_route.h                      |    6 +-
 src/common/slurm_selecttype_info.c            |   30 +-
 src/common/slurm_step_layout.c                |   59 +-
 src/common/slurm_step_layout.h                |    2 -
 src/common/slurmdb_defs.c                     |  311 +-
 src/common/slurmdb_defs.h                     |   21 +-
 src/common/slurmdb_pack.c                     |  636 +-
 src/common/slurmdbd_defs.c                    |  187 +-
 src/common/slurmdbd_defs.h                    |    1 +
 src/common/stepd_api.c                        |    1 -
 src/common/stepd_api.h                        |    1 -
 src/common/strnatcmp.c                        |    2 +-
 src/common/switch.h                           |    2 +-
 src/common/uid.c                              |    4 +-
 src/common/uid.h                              |    1 -
 src/common/util-net.c                         |   56 +-
 src/common/util-net.h                         |    9 +-
 src/common/working_cluster.c                  |   19 +-
 src/common/working_cluster.h                  |    5 +
 src/common/xassert.c                          |    1 -
 src/common/xassert.h                          |    5 +-
 src/common/xcgroup_read_config.c              |    2 +-
 src/common/xhash.c                            |   44 +-
 src/common/xmalloc.c                          |    5 +-
 src/common/xmalloc.h                          |    1 -
 src/common/xsignal.h                          |    1 -
 src/common/xstring.h                          |    4 +-
 src/database/Makefile.in                      |   20 +-
 src/database/mysql_common.c                   |   10 +-
 src/db_api/Makefile.in                        |   20 +-
 src/db_api/cluster_report_functions.c         |   12 +-
 src/db_api/job_report_functions.c             |   20 +-
 src/db_api/user_report_functions.c            |    8 +-
 src/layouts/Makefile.in                       |   20 +-
 src/layouts/power/Makefile.in                 |   20 +-
 src/layouts/unit/Makefile.in                  |   20 +-
 src/plugins/Makefile.am                       |    2 +
 src/plugins/Makefile.in                       |   22 +-
 src/plugins/accounting_storage/Makefile.in    |   20 +-
 .../accounting_storage/common/Makefile.in     |   20 +-
 .../accounting_storage/common/common_as.c     |    8 +-
 .../accounting_storage/common/common_as.h     |    2 -
 .../accounting_storage/filetxt/Makefile.in    |   20 +-
 .../filetxt/accounting_storage_filetxt.c      |   16 +-
 .../filetxt/filetxt_jobacct_process.c         |   13 +-
 .../accounting_storage/mysql/Makefile.am      |    1 +
 .../accounting_storage/mysql/Makefile.in      |   32 +-
 .../mysql/accounting_storage_mysql.c          |   62 +-
 .../mysql/accounting_storage_mysql.h          |    4 +-
 .../accounting_storage/mysql/as_mysql_acct.c  |    2 +-
 .../mysql/as_mysql_archive.c                  |  213 +-
 .../accounting_storage/mysql/as_mysql_assoc.c |  312 +-
 .../accounting_storage/mysql/as_mysql_assoc.h |    3 +
 .../mysql/as_mysql_cluster.c                  |   11 +-
 .../mysql/as_mysql_convert.c                  |    2 +-
 .../mysql/as_mysql_fix_lost_jobs.c            |  143 +
 .../mysql/as_mysql_fix_lost_jobs.h}           |   19 +-
 .../accounting_storage/mysql/as_mysql_job.c   |    2 +-
 .../mysql/as_mysql_jobacct_process.c          |    3 +-
 .../accounting_storage/mysql/as_mysql_qos.c   |   91 +
 .../mysql/as_mysql_resource.c                 |    8 -
 .../mysql/as_mysql_rollup.c                   |   19 +-
 .../accounting_storage/mysql/as_mysql_tres.c  |    6 +-
 .../accounting_storage/mysql/as_mysql_usage.c |    6 +-
 .../accounting_storage/mysql/as_mysql_user.c  |   16 +-
 .../accounting_storage/none/Makefile.in       |   20 +-
 .../none/accounting_storage_none.c            |   16 +-
 .../accounting_storage/slurmdbd/Makefile.in   |   20 +-
 .../slurmdbd/accounting_storage_slurmdbd.c    |   35 +-
 src/plugins/acct_gather_energy/Makefile.in    |   20 +-
 .../acct_gather_energy/cray/Makefile.in       |   20 +-
 .../acct_gather_energy/ibmaem/Makefile.in     |   20 +-
 .../acct_gather_energy/ipmi/Makefile.in       |   20 +-
 .../ipmi/acct_gather_energy_ipmi.c            |    6 +-
 .../acct_gather_energy/none/Makefile.in       |   20 +-
 .../acct_gather_energy/rapl/Makefile.in       |   20 +-
 .../rapl/acct_gather_energy_rapl.c            |    4 +-
 .../acct_gather_filesystem/Makefile.in        |   20 +-
 .../acct_gather_filesystem/lustre/Makefile.in |   20 +-
 .../lustre/acct_gather_filesystem_lustre.c    |    5 +-
 .../acct_gather_filesystem/none/Makefile.in   |   20 +-
 .../acct_gather_infiniband/Makefile.in        |   20 +-
 .../acct_gather_infiniband/none/Makefile.in   |   20 +-
 .../acct_gather_infiniband/ofed/Makefile.in   |   20 +-
 src/plugins/acct_gather_profile/Makefile.in   |   20 +-
 .../acct_gather_profile/hdf5/Makefile.in      |   20 +-
 .../hdf5/acct_gather_profile_hdf5.c           |   35 +-
 .../acct_gather_profile/hdf5/hdf5_api.c       |    4 +-
 .../acct_gather_profile/hdf5/hdf5_api.h       |    1 +
 .../hdf5/sh5util/Makefile.in                  |   20 +-
 .../hdf5/sh5util/libsh5util_old/Makefile.in   |   20 +-
 .../hdf5/sh5util/libsh5util_old/hdf5_api.c    |   48 +-
 .../hdf5/sh5util/libsh5util_old/sh5util.c     |   22 +-
 .../hdf5/sh5util/sh5util.c                    |  611 +-
 .../acct_gather_profile/none/Makefile.in      |   20 +-
 src/plugins/auth/Makefile.am                  |    2 +-
 src/plugins/auth/Makefile.in                  |   22 +-
 src/plugins/auth/authd/Makefile.am            |   20 -
 src/plugins/auth/authd/auth_authd.c           |  367 --
 src/plugins/auth/munge/Makefile.in            |   20 +-
 src/plugins/auth/munge/auth_munge.c           |    3 +-
 src/plugins/auth/none/Makefile.in             |   20 +-
 src/plugins/auth/none/auth_none.c             |    2 +-
 src/plugins/burst_buffer/Makefile.in          |   20 +-
 src/plugins/burst_buffer/common/Makefile.in   |   20 +-
 .../burst_buffer/common/burst_buffer_common.c |  450 +-
 .../burst_buffer/common/burst_buffer_common.h |   52 +-
 src/plugins/burst_buffer/cray/Makefile.in     |   20 +-
 .../burst_buffer/cray/burst_buffer_cray.c     | 1000 +--
 src/plugins/burst_buffer/generic/Makefile.in  |   20 +-
 .../generic/burst_buffer_generic.c            | 1144 +---
 src/plugins/checkpoint/Makefile.in            |   20 +-
 src/plugins/checkpoint/aix/Makefile.in        |   20 +-
 src/plugins/checkpoint/aix/checkpoint_aix.c   |    5 +-
 src/plugins/checkpoint/blcr/Makefile.in       |   20 +-
 src/plugins/checkpoint/blcr/checkpoint_blcr.c |   16 +-
 src/plugins/checkpoint/none/Makefile.in       |   20 +-
 src/plugins/checkpoint/none/checkpoint_none.c |    4 +-
 src/plugins/checkpoint/ompi/Makefile.in       |   20 +-
 src/plugins/checkpoint/ompi/checkpoint_ompi.c |    4 +-
 src/plugins/checkpoint/poe/Makefile.in        |   20 +-
 src/plugins/checkpoint/poe/checkpoint_poe.c   |   12 +-
 src/plugins/core_spec/Makefile.in             |   20 +-
 src/plugins/core_spec/cray/Makefile.in        |   20 +-
 src/plugins/core_spec/cray/core_spec_cray.c   |    8 +
 src/plugins/core_spec/none/Makefile.in        |   20 +-
 src/plugins/crypto/Makefile.in                |   20 +-
 src/plugins/crypto/munge/Makefile.in          |   20 +-
 src/plugins/crypto/openssl/Makefile.in        |   20 +-
 src/plugins/ext_sensors/Makefile.in           |   20 +-
 src/plugins/ext_sensors/none/Makefile.in      |   20 +-
 src/plugins/ext_sensors/rrd/Makefile.in       |   20 +-
 src/plugins/ext_sensors/rrd/ext_sensors_rrd.c |   10 +-
 src/plugins/gres/Makefile.in                  |   20 +-
 src/plugins/gres/gpu/Makefile.in              |   20 +-
 src/plugins/gres/gpu/gres_gpu.c               |    4 +-
 src/plugins/gres/mic/Makefile.in              |   20 +-
 src/plugins/gres/mic/gres_mic.c               |    4 +-
 src/plugins/gres/nic/Makefile.in              |   20 +-
 src/plugins/gres/nic/gres_nic.c               |    4 +-
 src/plugins/job_container/Makefile.in         |   20 +-
 src/plugins/job_container/cncu/Makefile.in    |   20 +-
 .../job_container/cncu/job_container_cncu.c   |   96 +-
 src/plugins/job_container/none/Makefile.in    |   20 +-
 src/plugins/job_submit/Makefile.am            |    1 -
 src/plugins/job_submit/Makefile.in            |   21 +-
 .../job_submit/all_partitions/Makefile.in     |   20 +-
 src/plugins/job_submit/cnode/Makefile.am      |   13 -
 .../job_submit/cnode/job_submit_cnode.c       |  191 -
 src/plugins/job_submit/cray/Makefile.in       |   20 +-
 src/plugins/job_submit/defaults/Makefile.in   |   20 +-
 src/plugins/job_submit/logging/Makefile.in    |   20 +-
 src/plugins/job_submit/lua/Makefile.in        |   20 +-
 src/plugins/job_submit/lua/job_submit_lua.c   |  357 +-
 src/plugins/job_submit/partition/Makefile.in  |   20 +-
 .../partition/job_submit_partition.c          |    8 +-
 src/plugins/job_submit/pbs/Makefile.in        |   20 +-
 src/plugins/job_submit/pbs/job_submit_pbs.c   |   18 +-
 .../job_submit/require_timelimit/Makefile.in  |   20 +-
 src/plugins/job_submit/throttle/Makefile.in   |   20 +-
 src/plugins/jobacct_gather/Makefile.in        |   20 +-
 src/plugins/jobacct_gather/aix/Makefile.in    |   20 +-
 src/plugins/jobacct_gather/cgroup/Makefile.in |   20 +-
 .../cgroup/jobacct_gather_cgroup.c            |   13 +-
 .../cgroup/jobacct_gather_cgroup_blkio.c      |  650 +-
 .../cgroup/jobacct_gather_cgroup_cpuacct.c    |    8 +-
 .../cgroup/jobacct_gather_cgroup_memory.c     |    8 +-
 src/plugins/jobacct_gather/common/Makefile.in |   20 +-
 .../jobacct_gather/common/common_jag.c        |    2 +-
 src/plugins/jobacct_gather/linux/Makefile.in  |   20 +-
 src/plugins/jobacct_gather/none/Makefile.in   |   20 +-
 src/plugins/jobcomp/Makefile.in               |   20 +-
 src/plugins/jobcomp/elasticsearch/Makefile.am |    2 +-
 src/plugins/jobcomp/elasticsearch/Makefile.in |   22 +-
 .../elasticsearch/jobcomp_elasticsearch.c     |   23 +-
 src/plugins/jobcomp/filetxt/Makefile.in       |   20 +-
 .../jobcomp/filetxt/filetxt_jobcomp_process.c |   47 +-
 src/plugins/jobcomp/mysql/Makefile.in         |   20 +-
 src/plugins/jobcomp/mysql/jobcomp_mysql.c     |    2 -
 src/plugins/jobcomp/none/Makefile.in          |   20 +-
 src/plugins/jobcomp/script/Makefile.in        |   20 +-
 src/plugins/jobcomp/script/jobcomp_script.c   |   25 +-
 src/plugins/launch/Makefile.in                |   20 +-
 src/plugins/launch/aprun/Makefile.in          |   20 +-
 src/plugins/launch/aprun/launch_aprun.c       |    5 -
 src/plugins/launch/poe/Makefile.in            |   20 +-
 src/plugins/launch/poe/launch_poe.c           |   20 +-
 src/plugins/launch/runjob/Makefile.in         |   20 +-
 src/plugins/launch/runjob/launch_runjob.c     |    7 +-
 src/plugins/launch/slurm/Makefile.in          |   20 +-
 src/plugins/launch/slurm/launch_slurm.c       |    7 +-
 src/plugins/launch/slurm/task_state.c         |    1 -
 src/plugins/launch/slurm/task_state.h         |    1 -
 src/plugins/mcs/Makefile.am                   |    3 +
 src/plugins/mcs/Makefile.in                   |  800 +++
 src/plugins/mcs/group/Makefile.am             |   13 +
 src/plugins/mcs/group/Makefile.in             |  832 +++
 src/plugins/mcs/group/mcs_group.c             |  380 ++
 src/plugins/mcs/none/Makefile.am              |   13 +
 .../{auth/authd => mcs/none}/Makefile.in      |   61 +-
 src/plugins/mcs/none/mcs_none.c               |  107 +
 src/plugins/mcs/user/Makefile.am              |   13 +
 .../cnode => mcs/user}/Makefile.in            |   59 +-
 src/plugins/mcs/user/mcs_user.c               |  142 +
 src/plugins/mpi/Makefile.am                   |    3 +
 src/plugins/mpi/Makefile.in                   |   29 +-
 src/plugins/mpi/lam/Makefile.in               |   20 +-
 src/plugins/mpi/lam/lam.h                     |    1 -
 src/plugins/mpi/lam/mpi_lam.c                 |    1 -
 src/plugins/mpi/mpich1_p4/Makefile.in         |   20 +-
 src/plugins/mpi/mpich1_p4/mpich1_p4.c         |    4 +-
 src/plugins/mpi/mpich1_shmem/Makefile.in      |   20 +-
 src/plugins/mpi/mpichgm/Makefile.in           |   20 +-
 src/plugins/mpi/mpichgm/mpi_mpichgm.c         |    1 -
 src/plugins/mpi/mpichgm/mpichgm.c             |    3 +-
 src/plugins/mpi/mpichgm/mpichgm.h             |    3 +-
 src/plugins/mpi/mpichmx/Makefile.in           |   20 +-
 src/plugins/mpi/mvapich/Makefile.in           |   20 +-
 src/plugins/mpi/mvapich/mvapich.c             |    6 +-
 src/plugins/mpi/none/Makefile.in              |   20 +-
 src/plugins/mpi/none/mpi_none.c               |    3 +-
 src/plugins/mpi/openmpi/Makefile.in           |   20 +-
 src/plugins/mpi/openmpi/mpi_openmpi.c         |    1 -
 src/plugins/mpi/pmi2/Makefile.in              |   20 +-
 src/plugins/mpi/pmi2/client.c                 |   37 +-
 src/plugins/mpi/pmi2/info.c                   |   20 +-
 src/plugins/mpi/pmi2/kvs.c                    |   49 +-
 src/plugins/mpi/pmi2/nameserv.c               |    6 +-
 src/plugins/mpi/pmi2/pmi1.c                   |   10 +-
 src/plugins/mpi/pmi2/pmi2.c                   |   30 +-
 src/plugins/mpi/pmi2/ring.c                   |    2 +-
 src/plugins/mpi/pmi2/setup.c                  |   28 +-
 src/plugins/mpi/pmi2/spawn.c                  |   17 +-
 src/plugins/mpi/pmi2/tree.c                   |   48 -
 src/plugins/mpi/pmi2/tree.h                   |    1 -
 src/plugins/mpi/pmix/Makefile.am              |   22 +
 src/plugins/mpi/pmix/Makefile.in              |  854 +++
 src/plugins/mpi/pmix/TODO                     |    5 +
 src/plugins/mpi/pmix/mpi_pmix.c               |  174 +
 src/plugins/mpi/pmix/node_leader/fileops.c    |  251 +
 src/plugins/mpi/pmix/node_leader/fileops.h    |    9 +
 src/plugins/mpi/pmix/node_leader/ln_leader.c  |  207 +
 src/plugins/mpi/pmix/pmixp_agent.c            |  368 ++
 .../mpi/pmix/pmixp_agent.h}                   |   22 +-
 src/plugins/mpi/pmix/pmixp_client.c           |  716 +++
 src/plugins/mpi/pmix/pmixp_client.h           |   52 +
 src/plugins/mpi/pmix/pmixp_coll.c             |  664 ++
 src/plugins/mpi/pmix/pmixp_coll.h             |  201 +
 src/plugins/mpi/pmix/pmixp_common.h           |  116 +
 src/plugins/mpi/pmix/pmixp_debug.h            |  113 +
 src/plugins/mpi/pmix/pmixp_dmdx.c             |  470 ++
 src/plugins/mpi/pmix/pmixp_dmdx.h             |   51 +
 src/plugins/mpi/pmix/pmixp_info.c             |  336 +
 src/plugins/mpi/pmix/pmixp_info.h             |  278 +
 src/plugins/mpi/pmix/pmixp_io.c               |  448 ++
 src/plugins/mpi/pmix/pmixp_io.h               |  126 +
 src/plugins/mpi/pmix/pmixp_nspaces.c          |  197 +
 src/plugins/mpi/pmix/pmixp_nspaces.h          |  102 +
 src/plugins/mpi/pmix/pmixp_server.c           |  484 ++
 src/plugins/mpi/pmix/pmixp_server.h           |   61 +
 src/plugins/mpi/pmix/pmixp_state.c            |  179 +
 src/plugins/mpi/pmix/pmixp_state.h            |   88 +
 src/plugins/mpi/pmix/pmixp_utils.c            |  419 ++
 src/plugins/mpi/pmix/pmixp_utils.h            |   59 +
 src/plugins/mpi/pmix/tests/pmix_client.c      |  368 ++
 src/plugins/mpi/pmix/tests/test_common.c      |   15 +
 src/plugins/mpi/pmix/tests/test_common.h      |   51 +
 src/plugins/node_features/Makefile.am         |    3 +
 src/plugins/node_features/Makefile.in         |  800 +++
 .../node_features/knl_cray/Makefile.am        |   21 +
 .../node_features/knl_cray/Makefile.in        |  845 +++
 .../knl_cray/node_features_knl_cray.c         | 1961 ++++++
 src/plugins/power/Makefile.in                 |   20 +-
 src/plugins/power/common/Makefile.in          |   20 +-
 src/plugins/power/common/power_common.c       |    2 +-
 src/plugins/power/cray/Makefile.in            |   20 +-
 src/plugins/power/cray/power_cray.c           |   62 +-
 src/plugins/power/none/Makefile.in            |   20 +-
 src/plugins/preempt/Makefile.in               |   20 +-
 src/plugins/preempt/job_prio/Makefile.in      |   20 +-
 .../preempt/job_prio/preempt_job_prio.c       |   12 +-
 src/plugins/preempt/none/Makefile.in          |   20 +-
 .../preempt/partition_prio/Makefile.in        |   20 +-
 .../partition_prio/preempt_partition_prio.c   |   11 +-
 src/plugins/preempt/qos/Makefile.in           |   20 +-
 src/plugins/priority/Makefile.in              |   20 +-
 src/plugins/priority/basic/Makefile.in        |   20 +-
 src/plugins/priority/basic/priority_basic.c   |   21 +-
 src/plugins/priority/multifactor/Makefile.in  |   20 +-
 .../multifactor/priority_multifactor.c        |   34 +-
 src/plugins/proctrack/Makefile.in             |   20 +-
 src/plugins/proctrack/aix/Makefile.in         |   20 +-
 src/plugins/proctrack/cgroup/Makefile.in      |   20 +-
 .../proctrack/cgroup/proctrack_cgroup.c       |   10 +-
 src/plugins/proctrack/cray/Makefile.in        |   20 +-
 src/plugins/proctrack/cray/proctrack_cray.c   |   35 +
 src/plugins/proctrack/linuxproc/Makefile.in   |   20 +-
 src/plugins/proctrack/linuxproc/kill_tree.c   |    2 +-
 src/plugins/proctrack/lua/Makefile.in         |   20 +-
 src/plugins/proctrack/lua/proctrack_lua.c     |    2 +-
 src/plugins/proctrack/pgid/Makefile.in        |   20 +-
 src/plugins/proctrack/sgi_job/Makefile.in     |   20 +-
 src/plugins/route/Makefile.in                 |   20 +-
 src/plugins/route/default/Makefile.in         |   20 +-
 src/plugins/route/default/route_default.c     |    4 +-
 src/plugins/route/topology/Makefile.in        |   20 +-
 src/plugins/route/topology/route_topology.c   |   10 +-
 src/plugins/sched/Makefile.in                 |   20 +-
 src/plugins/sched/backfill/Makefile.in        |   20 +-
 src/plugins/sched/backfill/backfill.c         |  284 +-
 src/plugins/sched/backfill/backfill_wrapper.c |   10 +-
 src/plugins/sched/builtin/Makefile.in         |   20 +-
 src/plugins/sched/builtin/builtin.c           |   10 +-
 src/plugins/sched/builtin/builtin_wrapper.c   |   10 +-
 src/plugins/sched/hold/Makefile.in            |   20 +-
 src/plugins/sched/wiki/Makefile.in            |   20 +-
 src/plugins/sched/wiki/get_jobs.c             |    8 +-
 src/plugins/sched/wiki/get_nodes.c            |    4 +-
 src/plugins/sched/wiki/msg.c                  |   30 +-
 src/plugins/sched/wiki2/Makefile.in           |   20 +-
 src/plugins/sched/wiki2/cancel_job.c          |    6 +-
 src/plugins/sched/wiki2/event.c               |    4 +-
 src/plugins/sched/wiki2/get_jobs.c            |    2 +-
 src/plugins/sched/wiki2/get_nodes.c           |   28 +-
 src/plugins/sched/wiki2/job_will_run.c        |    6 +-
 src/plugins/sched/wiki2/msg.c                 |   44 +-
 src/plugins/select/Makefile.in                |   20 +-
 src/plugins/select/alps/Makefile.in           |   20 +-
 src/plugins/select/alps/basil_interface.c     |    4 +-
 src/plugins/select/alps/libalps/Makefile.in   |   20 +-
 .../select/alps/libalps/basil_request.c       |   10 +-
 .../select/alps/libalps/parser_common.c       |   16 +-
 .../select/alps/libemulate/Makefile.in        |   20 +-
 src/plugins/select/alps/select_alps.c         |    8 +-
 src/plugins/select/bluegene/Makefile.in       |   20 +-
 src/plugins/select/bluegene/ba/Makefile.in    |   20 +-
 .../select/bluegene/ba/block_allocator.c      |    8 +-
 src/plugins/select/bluegene/ba/wire_test.c    |    2 -
 .../select/bluegene/ba_bgq/Makefile.in        |   20 +-
 .../select/bluegene/ba_bgq/block_allocator.c  |    1 -
 .../select/bluegene/ba_bgq/wire_test.c        |    2 -
 src/plugins/select/bluegene/ba_common.c       |    4 +-
 src/plugins/select/bluegene/ba_common.h       |    6 +-
 src/plugins/select/bluegene/bg_core.c         |    2 -
 src/plugins/select/bluegene/bg_core.h         |    2 -
 .../select/bluegene/bg_defined_block.c        |    8 +-
 .../select/bluegene/bg_defined_block.h        |    2 -
 .../select/bluegene/bg_dynamic_block.c        |    2 -
 .../select/bluegene/bg_dynamic_block.h        |    2 -
 src/plugins/select/bluegene/bg_job_info.c     |    4 +-
 src/plugins/select/bluegene/bg_job_place.c    |   24 +-
 src/plugins/select/bluegene/bg_job_run.c      |   10 +-
 .../select/bluegene/bg_list_functions.c       |   12 +-
 .../select/bluegene/bg_list_functions.h       |    2 -
 src/plugins/select/bluegene/bg_read_config.c  |   10 +-
 .../select/bluegene/bg_record_functions.c     |    8 +-
 .../select/bluegene/bg_record_functions.h     |    2 -
 src/plugins/select/bluegene/bl/Makefile.in    |   20 +-
 .../select/bluegene/bl/bridge_linker.c        |   10 +-
 .../select/bluegene/bl/bridge_status.c        |   14 +-
 .../bluegene/bl/bridge_switch_connections.c   |    4 +-
 .../bluegene/bl/bridge_switch_connections.h   |    2 -
 .../select/bluegene/bl_bgq/Makefile.in        |   20 +-
 .../select/bluegene/bl_bgq/bridge_linker.cc   |    4 +-
 .../select/bluegene/bl_bgq/bridge_status.cc   |    4 +-
 src/plugins/select/bluegene/libsched_if64.c   |    2 -
 src/plugins/select/bluegene/select_bluegene.c |   32 +-
 src/plugins/select/bluegene/sfree/Makefile.in |   20 +-
 src/plugins/select/bluegene/sfree/opts.c      |    1 -
 src/plugins/select/bluegene/sfree/sfree.c     |    9 +-
 src/plugins/select/bluegene/slurm_epilog.c    |    2 -
 src/plugins/select/cons_res/Makefile.in       |   20 +-
 src/plugins/select/cons_res/dist_tasks.c      |  167 +-
 src/plugins/select/cons_res/dist_tasks.h      |    2 -
 src/plugins/select/cons_res/job_test.c        |  232 +-
 src/plugins/select/cons_res/job_test.h        |    2 -
 src/plugins/select/cons_res/select_cons_res.c |  156 +-
 src/plugins/select/cons_res/select_cons_res.h |    5 +-
 src/plugins/select/cray/Makefile.am           |    2 +-
 src/plugins/select/cray/Makefile.in           |   25 +-
 src/plugins/select/cray/ccm.c                 |  710 +++
 src/plugins/select/cray/ccm.h                 |  106 +
 src/plugins/select/cray/select_cray.c         |  518 +-
 src/plugins/select/linear/Makefile.in         |   20 +-
 src/plugins/select/linear/select_linear.c     |   28 +-
 src/plugins/select/other/Makefile.in          |   20 +-
 src/plugins/select/other/other_select.c       |    6 +-
 src/plugins/select/other/other_select.h       |    4 +-
 src/plugins/select/serial/Makefile.in         |   20 +-
 src/plugins/select/serial/job_test.c          |    6 +-
 src/plugins/select/serial/select_serial.c     |  107 +-
 src/plugins/slurmctld/Makefile.in             |   20 +-
 src/plugins/slurmctld/dynalloc/msg.c          |   15 +-
 src/plugins/slurmctld/nonstop/Makefile.in     |   20 +-
 src/plugins/slurmctld/nonstop/do_work.c       |  104 +-
 src/plugins/slurmctld/nonstop/msg.c           |   33 +-
 src/plugins/slurmctld/nonstop/read_config.c   |    4 +-
 src/plugins/slurmd/Makefile.in                |   20 +-
 src/plugins/switch/Makefile.in                |   20 +-
 src/plugins/switch/cray/Makefile.in           |   20 +-
 src/plugins/switch/cray/cookies.c             |   18 +-
 src/plugins/switch/cray/gpu.c                 |    4 +-
 src/plugins/switch/cray/scaling.c             |    2 +-
 src/plugins/switch/cray/switch_cray.c         |   67 +-
 src/plugins/switch/cray/switch_cray.h         |   10 +-
 src/plugins/switch/cray/util.c                |    2 +-
 src/plugins/switch/generic/Makefile.in        |   20 +-
 src/plugins/switch/generic/switch_generic.c   |   46 +-
 src/plugins/switch/none/Makefile.in           |   20 +-
 src/plugins/switch/nrt/Makefile.in            |   20 +-
 src/plugins/switch/nrt/libpermapi/Makefile.in |   20 +-
 src/plugins/switch/nrt/libpermapi/shr_64.c    |   28 +-
 src/plugins/switch/nrt/nrt.c                  |  123 +-
 src/plugins/switch/nrt/switch_nrt.c           |   32 +-
 src/plugins/task/Makefile.in                  |   20 +-
 src/plugins/task/affinity/Makefile.in         |   20 +-
 src/plugins/task/affinity/affinity.c          |    5 +-
 src/plugins/task/affinity/affinity.h          |    1 -
 src/plugins/task/affinity/dist_tasks.c        |   19 +-
 src/plugins/task/affinity/numa.c              |    3 +-
 src/plugins/task/affinity/schedutils.c        |    1 -
 src/plugins/task/affinity/task_affinity.c     |   83 +-
 src/plugins/task/cgroup/Makefile.in           |   20 +-
 src/plugins/task/cgroup/task_cgroup.c         |    2 +-
 src/plugins/task/cgroup/task_cgroup_cpuset.c  |  120 +-
 src/plugins/task/cgroup/task_cgroup_devices.c |   11 +-
 src/plugins/task/cgroup/task_cgroup_memory.c  |    9 +-
 src/plugins/task/cray/Makefile.in             |   20 +-
 src/plugins/task/cray/task_cray.c             |   58 +-
 src/plugins/task/none/Makefile.in             |   20 +-
 src/plugins/topology/3d_torus/Makefile.in     |   20 +-
 src/plugins/topology/3d_torus/hilbert_slurm.c |    8 +-
 .../topology/3d_torus/topology_3d_torus.c     |    2 +-
 src/plugins/topology/Makefile.in              |   20 +-
 src/plugins/topology/hypercube/Makefile.in    |   20 +-
 .../topology/hypercube/topology_hypercube.c   |    6 +-
 src/plugins/topology/node_rank/Makefile.in    |   20 +-
 src/plugins/topology/none/Makefile.in         |   20 +-
 src/plugins/topology/tree/Makefile.in         |   20 +-
 src/plugins/topology/tree/topology_tree.c     |    6 +-
 src/sacct/Makefile.in                         |   20 +-
 src/sacct/options.c                           |   34 +-
 src/sacct/print.c                             |   48 +-
 src/sacct/process.c                           |    2 -
 src/sacct/sacct.h                             |    5 +-
 src/sacctmgr/Makefile.am                      |    1 +
 src/sacctmgr/Makefile.in                      |   34 +-
 src/sacctmgr/account_functions.c              |    6 +-
 src/sacctmgr/archive_functions.c              |    5 +-
 src/sacctmgr/association_functions.c          |    4 +-
 src/sacctmgr/cluster_functions.c              |    7 +-
 src/sacctmgr/common.c                         |  210 +-
 src/sacctmgr/config_functions.c               |    3 +
 src/sacctmgr/event_functions.c                |   51 +-
 src/sacctmgr/file_functions.c                 |   59 +-
 src/sacctmgr/lost_jobs_functions.c            |  236 +
 src/sacctmgr/qos_functions.c                  |   71 +-
 src/sacctmgr/reservation_functions.c          |    3 +-
 src/sacctmgr/resource_functions.c             |    8 +-
 src/sacctmgr/sacctmgr.c                       |   10 +-
 src/sacctmgr/sacctmgr.h                       |    8 +
 src/sacctmgr/user_functions.c                 |   31 +-
 src/salloc/Makefile.in                        |   20 +-
 src/salloc/opt.c                              |  130 +-
 src/salloc/opt.h                              |    4 +-
 src/salloc/salloc.c                           |   48 +-
 src/salloc/salloc.h                           |    1 -
 src/sattach/Makefile.in                       |   20 +-
 src/sattach/attach.c                          |    1 -
 src/sattach/attach.h                          |    3 -
 src/sattach/opt.c                             |    9 +-
 src/sattach/opt.h                             |    1 -
 src/sattach/sattach.c                         |   20 +-
 src/sbatch/Makefile.in                        |   20 +-
 src/sbatch/opt.c                              |  441 +-
 src/sbatch/opt.h                              |    6 +-
 src/sbatch/sbatch.c                           |   70 +-
 src/sbcast/Makefile.am                        |    4 +-
 src/sbcast/Makefile.in                        |   26 +-
 src/sbcast/opts.c                             |   36 +-
 src/sbcast/sbcast.c                           |    3 +-
 src/sbcast/sbcast.h                           |    4 +-
 src/scancel/Makefile.in                       |   20 +-
 src/scancel/opt.c                             |   36 +-
 src/scancel/scancel.c                         |   56 +-
 src/scontrol/Makefile.in                      |   20 +-
 src/scontrol/create_res.c                     |   49 +-
 src/scontrol/info_assoc_mgr.c                 |  138 +-
 src/scontrol/info_block.c                     |    2 +-
 src/scontrol/info_job.c                       |   27 -
 src/scontrol/info_layout.c                    |   10 +-
 src/scontrol/info_lics.c                      |   52 +-
 src/scontrol/info_node.c                      |    8 +-
 src/scontrol/info_part.c                      |    2 +-
 src/scontrol/info_res.c                       |    2 +-
 src/scontrol/scontrol.c                       |   41 +-
 src/scontrol/scontrol.h                       |    2 +-
 src/scontrol/update_job.c                     |   49 +-
 src/scontrol/update_node.c                    |   11 +-
 src/scontrol/update_part.c                    |   39 +-
 src/scontrol/update_powercap.c                |    4 +-
 src/sdiag/Makefile.in                         |   20 +-
 src/sinfo/Makefile.in                         |   20 +-
 src/sinfo/opts.c                              |  175 +-
 src/sinfo/print.c                             |   83 +-
 src/sinfo/print.h                             |   22 +-
 src/sinfo/sinfo.c                             |   21 +-
 src/sinfo/sinfo.h                             |    9 +-
 src/sinfo/sort.c                              |   82 +-
 src/slurmctld/Makefile.am                     |    7 +-
 src/slurmctld/Makefile.in                     |   36 +-
 src/slurmctld/acct_policy.c                   |  653 +-
 src/slurmctld/agent.c                         |   55 +-
 src/slurmctld/backup.c                        |    4 +-
 src/slurmctld/burst_buffer.c                  |    4 +-
 src/slurmctld/controller.c                    |  216 +-
 src/slurmctld/front_end.c                     |   43 +-
 src/slurmctld/gang.c                          |   61 +-
 src/slurmctld/groups.c                        |   23 +-
 src/slurmctld/job_mgr.c                       | 1342 ++--
 src/slurmctld/job_scheduler.c                 |  586 +-
 src/slurmctld/job_scheduler.h                 |   14 +-
 src/slurmctld/job_submit.c                    |    6 +-
 src/slurmctld/licenses.c                      |    6 +-
 src/slurmctld/node_mgr.c                      |  462 +-
 src/slurmctld/node_scheduler.c                |  666 +-
 src/slurmctld/node_scheduler.h                |   29 +
 src/slurmctld/partition_mgr.c                 |  328 +-
 src/slurmctld/ping_nodes.c                    |    4 +-
 src/slurmctld/port_mgr.c                      |    4 +-
 src/slurmctld/power_save.c                    |  162 +-
 src/slurmctld/power_save.h                    |   63 +
 src/slurmctld/powercapping.c                  |    4 +-
 src/slurmctld/preempt.c                       |    6 +-
 src/slurmctld/proc_req.c                      |  225 +-
 src/slurmctld/read_config.c                   |  322 +-
 src/slurmctld/read_config.h                   |   15 +
 src/slurmctld/reservation.c                   |  491 +-
 src/slurmctld/sched_plugin.c                  |   18 +-
 src/slurmctld/sicp.c                          |  480 --
 src/slurmctld/slurmctld.h                     |   74 +-
 src/slurmctld/slurmctld_plugstack.c           |    2 +-
 src/slurmctld/state_save.c                    |    5 +-
 src/slurmctld/step_mgr.c                      |  225 +-
 src/slurmctld/trigger_mgr.c                   |   14 +-
 src/slurmd/Makefile.in                        |   20 +-
 src/slurmd/common/Makefile.in                 |   20 +-
 src/slurmd/common/core_spec_plugin.c          |    2 +-
 src/slurmd/common/job_container_plugin.c      |    2 +-
 src/slurmd/common/reverse_tree.h              |    1 -
 src/slurmd/common/reverse_tree_math.c         |    1 -
 src/slurmd/common/reverse_tree_math.h         |    1 -
 src/slurmd/common/setproctitle.c              |    1 -
 src/slurmd/common/setproctitle.h              |    1 -
 src/slurmd/common/slurmd_cgroup.c             |   24 +-
 src/slurmd/common/slurmd_cgroup.h             |    7 +-
 src/slurmd/common/task_plugin.c               |    2 +-
 src/slurmd/common/xcgroup.c                   |  245 +-
 src/slurmd/common/xcgroup.h                   |   35 +-
 src/slurmd/common/xcpuinfo.c                  |   44 +-
 src/slurmd/slurmd/Makefile.am                 |   21 +-
 src/slurmd/slurmd/Makefile.in                 |   41 +-
 src/slurmd/slurmd/get_mach_stat.c             |   25 +-
 src/slurmd/slurmd/req.c                       |  778 ++-
 src/slurmd/slurmd/req.h                       |    6 +-
 src/slurmd/slurmd/slurmd.c                    |  153 +-
 src/slurmd/slurmd/slurmd.h                    |    9 +-
 src/slurmd/slurmd/slurmd_plugstack.c          |    2 +-
 src/slurmd/slurmstepd/Makefile.in             |   20 +-
 src/slurmd/slurmstepd/fname.c                 |  273 +-
 src/slurmd/slurmstepd/io.c                    |   31 +-
 src/slurmd/slurmstepd/io.h                    |    1 -
 src/slurmd/slurmstepd/mgr.c                   |   57 +-
 src/slurmd/slurmstepd/pam_ses.c               |    1 -
 src/slurmd/slurmstepd/pam_ses.h               |    1 -
 src/slurmd/slurmstepd/pdebug.c                |    4 +-
 src/slurmd/slurmstepd/req.c                   |   60 +-
 src/slurmd/slurmstepd/req.h                   |    1 -
 src/slurmd/slurmstepd/slurmstepd.c            |   41 +-
 src/slurmd/slurmstepd/slurmstepd.h            |    1 -
 src/slurmd/slurmstepd/slurmstepd_job.c        |   38 +-
 src/slurmd/slurmstepd/slurmstepd_job.h        |    1 -
 .../slurmstepd/step_terminate_monitor.c       |   20 +-
 src/slurmd/slurmstepd/task.c                  |   55 +-
 src/slurmd/slurmstepd/task.h                  |    5 +-
 src/slurmd/slurmstepd/ulimits.c               |    2 -
 src/slurmdbd/Makefile.am                      |    2 -
 src/slurmdbd/Makefile.in                      |   28 +-
 src/slurmdbd/proc_req.c                       |   38 +-
 src/slurmdbd/read_config.c                    |   20 +-
 src/slurmdbd/read_config.h                    |    1 +
 src/slurmdbd/rpc_mgr.c                        |   11 +-
 src/slurmdbd/slurmdbd.c                       |   96 +-
 src/smap/Makefile.am                          |    3 +-
 src/smap/Makefile.in                          |   27 +-
 src/smap/configure_functions.c                |   14 +-
 src/smap/job_functions.c                      |   11 +-
 src/smap/opts.c                               |   14 +-
 src/smap/partition_functions.c                |    4 +-
 src/smd/Makefile.in                           |   20 +-
 src/sprio/Makefile.in                         |   20 +-
 src/sprio/sprio.c                             |    2 +-
 src/squeue/Makefile.in                        |   20 +-
 src/squeue/opts.c                             |  238 +-
 src/squeue/print.c                            |  126 +-
 src/squeue/print.h                            |   20 +-
 src/squeue/sort.c                             |   36 +-
 src/sreport/Makefile.in                       |   20 +-
 src/sreport/cluster_reports.c                 |   11 +
 src/sreport/common.c                          |   17 +-
 src/sreport/job_reports.c                     |   16 +-
 src/sreport/resv_reports.c                    |    4 +
 src/sreport/sreport.c                         |   21 +-
 src/sreport/sreport.h                         |    1 +
 src/sreport/user_reports.c                    |    4 +
 src/srun/Makefile.am                          |    2 +
 src/srun/Makefile.in                          |   21 +-
 src/srun/libsrun/Makefile.in                  |   20 +-
 src/srun/libsrun/allocate.c                   |   12 +-
 src/srun/libsrun/allocate.h                   |    1 -
 src/srun/libsrun/debugger.c                   |    1 -
 src/srun/libsrun/fname.c                      |  152 +-
 src/srun/libsrun/launch.c                     |    2 +-
 src/srun/libsrun/opt.c                        |  169 +-
 src/srun/libsrun/opt.h                        |    6 +-
 src/srun/libsrun/srun_job.c                   |   29 +-
 src/srun/libsrun/srun_job.h                   |    6 +-
 src/srun/srun.c                               |    6 +-
 src/srun_cr/Makefile.in                       |   20 +-
 src/srun_cr/srun_cr.c                         |    4 +-
 src/sshare/Makefile.in                        |   20 +-
 src/sshare/process.c                          |   15 +-
 src/sshare/sshare.c                           |   59 +-
 src/sstat/Makefile.in                         |   20 +-
 src/sstat/options.c                           |   32 +-
 src/sstat/print.c                             |   48 +-
 src/sstat/process.c                           |    2 -
 src/sstat/sstat.c                             |   27 +-
 src/sstat/sstat.h                             |    2 -
 src/strigger/Makefile.in                      |   20 +-
 src/sview/Makefile.am                         |    2 -
 src/sview/Makefile.in                         |   22 +-
 src/sview/bb_info.c                           |   65 +-
 src/sview/block_info.c                        |   52 +-
 src/sview/common.c                            |   20 +-
 src/sview/defaults.c                          |   36 +-
 src/sview/front_end_info.c                    |   24 +-
 src/sview/grid.c                              |    4 +-
 src/sview/job_info.c                          |  273 +-
 src/sview/node_info.c                         |  232 +-
 src/sview/part_info.c                         |  367 +-
 src/sview/popups.c                            |   39 +-
 src/sview/resv_info.c                         |  121 +-
 src/sview/sview.c                             |    6 +-
 src/sview/sview.h                             |    6 +-
 testsuite/Makefile.in                         |   20 +-
 testsuite/expect/Makefile.am                  |   46 +-
 testsuite/expect/Makefile.in                  |   66 +-
 testsuite/expect/README                       |   68 +-
 testsuite/expect/globals                      |  355 +-
 testsuite/expect/globals_accounting           |    5 +-
 testsuite/expect/inc21.21_tests               |   46 +-
 testsuite/expect/inc21.30.1                   |    4 +-
 testsuite/expect/inc21.30.2                   |    4 +-
 testsuite/expect/inc21.30.3                   |    2 +-
 testsuite/expect/inc21.30.4                   |    2 +-
 testsuite/expect/inc21.30.5                   |    4 +-
 testsuite/expect/inc21.30.7                   |    2 +-
 testsuite/expect/inc21.30.8                   |    6 +-
 testsuite/expect/inc21.34_tests               |  106 +-
 testsuite/expect/inc22.1.1                    |  421 +-
 testsuite/expect/inc22.1.2                    |   17 +-
 testsuite/expect/inc22.1.3                    |   29 +-
 testsuite/expect/inc22.1.4                    |   62 +-
 testsuite/expect/inc3.11.1                    |   20 +-
 testsuite/expect/inc3.11.5                    |    1 +
 testsuite/expect/inc3.11.7                    |   18 +-
 testsuite/expect/inc3.11.8                    |   90 +-
 .../expect/mpi-testscripts/script.slurm.sh    |    2 +-
 testsuite/expect/regression                   |    8 +
 testsuite/expect/regression.py                |    7 +
 testsuite/expect/slurm_status                 |   43 +
 testsuite/expect/test1.100                    |    6 +-
 testsuite/expect/test1.102                    |   71 +
 testsuite/expect/test1.103                    |   91 +
 testsuite/expect/test1.104                    |  284 +
 testsuite/expect/test1.105                    |   98 +
 testsuite/expect/test1.106                    |   78 +
 testsuite/expect/test1.107                    |   96 +
 testsuite/expect/test1.108                    |   76 +
 testsuite/expect/test1.109                    |   80 +
 testsuite/expect/test1.110                    |   87 +
 testsuite/expect/test1.111                    |  101 +
 testsuite/expect/test1.112                    |  100 +
 testsuite/expect/test1.14                     |   13 +-
 testsuite/expect/test1.19                     |   33 +
 testsuite/expect/test1.30                     |    4 +-
 testsuite/expect/test1.31                     |   16 +-
 testsuite/expect/test1.42                     |    2 +-
 testsuite/expect/test1.47                     |    2 +-
 testsuite/expect/test1.59                     |    3 +-
 testsuite/expect/test1.69                     |   10 +-
 testsuite/expect/test1.74                     |   13 +-
 testsuite/expect/test1.76                     |    2 +-
 testsuite/expect/test1.76.bash                |    2 +-
 testsuite/expect/test1.76.batch               |    2 +-
 testsuite/expect/test1.77                     |   10 +-
 testsuite/expect/test1.80                     |    6 +-
 testsuite/expect/test1.81                     |    2 +-
 testsuite/expect/test1.83                     |    5 +
 testsuite/expect/test1.84                     |   14 +-
 testsuite/expect/test1.86                     |    2 +-
 testsuite/expect/test1.87                     |    2 +-
 testsuite/expect/test1.89                     |    6 +-
 testsuite/expect/test1.89.prog.c              |    9 +-
 testsuite/expect/test1.90                     |    2 +-
 testsuite/expect/test1.90.prog.c              |   14 +-
 testsuite/expect/test1.91                     |   12 +-
 testsuite/expect/test1.91.prog.c              |   60 +-
 testsuite/expect/test1.97                     |    4 +-
 testsuite/expect/test12.2                     |    8 +-
 testsuite/expect/test12.4                     |   45 +-
 testsuite/expect/test12.7                     |  143 +-
 testsuite/expect/test12.8                     |   14 +-
 testsuite/expect/test13.1                     |   14 -
 testsuite/expect/test14.10                    |    8 +-
 testsuite/expect/test15.19                    |    2 +-
 testsuite/expect/test15.30                    |   68 +
 testsuite/expect/test15.31                    |   88 +
 testsuite/expect/test15.32                    |  279 +
 testsuite/expect/test15.33                    |  104 +
 testsuite/expect/test15.34                    |   72 +
 testsuite/expect/test15.35                    |   96 +
 testsuite/expect/test15.36                    |   77 +
 testsuite/expect/test15.37                    |  157 +
 testsuite/expect/test15.38                    |  135 +
 testsuite/expect/test17.11                    |   38 +-
 testsuite/expect/test17.12                    |  338 +-
 testsuite/expect/test17.17                    |    8 +-
 testsuite/expect/test17.21                    |   11 +-
 testsuite/expect/test17.28                    |    9 +-
 testsuite/expect/test17.36                    |   81 +-
 testsuite/expect/test17.37                    |   14 +-
 testsuite/expect/test17.39                    |   23 +-
 testsuite/expect/test17.42                    |   92 +
 testsuite/expect/test17.44                    |  131 +
 testsuite/expect/test17.5                     |   52 +
 testsuite/expect/test17.51                    |  461 ++
 testsuite/expect/test17.52                    |  477 ++
 testsuite/expect/test17.53                    |   80 +
 testsuite/expect/test17.54                    |  109 +
 testsuite/expect/test17.55                    |  261 +
 testsuite/expect/test17.56                    |  113 +
 testsuite/expect/test17.57                    |   80 +
 testsuite/expect/test17.58                    |  113 +
 testsuite/expect/test17.59                    |   84 +
 testsuite/expect/test17.60                    |  143 +
 testsuite/expect/test17.61                    |  136 +
 testsuite/expect/test17.62                    |  126 +
 testsuite/expect/test2.25                     |    2 +-
 testsuite/expect/test2.7                      |    2 +-
 testsuite/expect/test2.8                      |   27 +-
 testsuite/expect/test20.13                    |  227 +
 testsuite/expect/test21.21                    |    6 +-
 testsuite/expect/test21.30                    |   41 +-
 testsuite/expect/test21.33                    |  234 +
 testsuite/expect/test21.34                    |    5 +
 testsuite/expect/test21.36                    |  253 +
 testsuite/expect/test22.1                     |  467 +-
 testsuite/expect/test23.2                     |   14 +-
 testsuite/expect/test28.6                     |    7 +-
 testsuite/expect/test28.7                     |    8 +-
 testsuite/expect/test3.11                     |   43 +-
 testsuite/expect/test3.15                     |   12 +-
 testsuite/expect/test3.16                     |  149 +
 testsuite/expect/test3.7                      |   14 +-
 testsuite/expect/test30.1                     |    9 +-
 testsuite/expect/test31.1                     |   45 +-
 testsuite/expect/test33.1.prog.c              |    4 +-
 testsuite/expect/test36.1                     |   85 +
 testsuite/expect/test36.2                     |  127 +
 testsuite/expect/test36.3                     |  158 +
 testsuite/expect/test36.4                     |  121 +
 testsuite/expect/test4.12                     |    2 +-
 testsuite/expect/test4.13                     |    6 +-
 testsuite/expect/test4.14                     |    2 +-
 testsuite/expect/test4.3                      |    4 +-
 testsuite/expect/test5.11                     |    2 +-
 testsuite/expect/test5.9                      |    2 +
 testsuite/expect/test6.15                     |  173 +
 testsuite/expect/test6.7                      |   11 +-
 testsuite/expect/test7.12.prog.c              |    3 +-
 testsuite/expect/test7.17                     |   14 +-
 testsuite/expect/test7.4                      |    8 -
 testsuite/expect/test7.6                      |    4 -
 testsuite/expect/test7.9                      |   10 +-
 testsuite/expect/test8.5                      |    6 +-
 testsuite/expect/test9.8                      |   27 +-
 testsuite/slurm_unit/Makefile.in              |   20 +-
 testsuite/slurm_unit/api/Makefile.in          |   20 +-
 testsuite/slurm_unit/api/manual/Makefile.in   |   20 +-
 testsuite/slurm_unit/common/Makefile.in       |   20 +-
 testsuite/slurm_unit/common/pack-test.c       |    2 -
 testsuite/slurm_unit/common/runqsw.c          |  268 -
 1111 files changed, 65038 insertions(+), 23659 deletions(-)
 create mode 100644 CONTRIBUTING.md
 delete mode 100644 ChangeLog
 create mode 100644 auxdir/ax_check_zlib.m4
 delete mode 100644 auxdir/x_ac_cflags.m4
 delete mode 100644 auxdir/x_ac_elan.m4
 delete mode 100644 auxdir/x_ac_federation.m4
 create mode 100644 auxdir/x_ac_lz4.m4
 create mode 100644 auxdir/x_ac_pmix.m4
 delete mode 100644 auxdir/x_ac_sun_const.m4
 delete mode 100644 config.xml.in
 create mode 100644 contribs/cray/capmc_resume.c
 create mode 100644 contribs/cray/capmc_suspend.c
 create mode 100644 contribs/openlava/Makefile.am
 create mode 100644 contribs/openlava/Makefile.in
 create mode 100644 contribs/openlava/bjobs.pl
 create mode 100644 contribs/openlava/bkill.pl
 create mode 100644 contribs/openlava/bsub.pl
 create mode 100644 contribs/openlava/lsid.pl
 delete mode 100644 contribs/ptrace.patch
 create mode 100644 contribs/seff/Makefile.am
 create mode 100644 contribs/seff/Makefile.in
 create mode 100755 contribs/seff/seff
 create mode 100755 contribs/seff/smail.in
 create mode 100644 doc/html/intel_knl.shtml
 create mode 100644 doc/html/mcs.shtml
 create mode 100644 doc/html/mcs_plugins.shtml
 create mode 100644 doc/html/node_features_plugins.shtml
 delete mode 100644 doc/html/sun_const.shtml
 create mode 100644 doc/man/man5/knl.conf.5
 create mode 100644 etc/Makefile.am
 create mode 100644 etc/Makefile.in
 create mode 100644 etc/layouts.d.unit.conf.example
 create mode 100644 src/bcast/Makefile.am
 create mode 100644 src/bcast/Makefile.in
 create mode 100644 src/bcast/file_bcast.c
 rename src/{common => bcast}/file_bcast.h (79%)
 delete mode 100644 src/common/file_bcast.c
 create mode 100644 src/common/node_features.c
 create mode 100644 src/common/node_features.h
 create mode 100644 src/common/siphash.h
 create mode 100644 src/common/siphash24.c
 rename src/{slurmctld/sicp.h => common/siphash_slurm.c} (68%)
 create mode 100644 src/common/slurm_mcs.c
 create mode 100644 src/common/slurm_mcs.h
 create mode 100644 src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.c
 rename src/{slurmdbd/agent.h => plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.h} (82%)
 delete mode 100644 src/plugins/auth/authd/Makefile.am
 delete mode 100644 src/plugins/auth/authd/auth_authd.c
 delete mode 100644 src/plugins/job_submit/cnode/Makefile.am
 delete mode 100644 src/plugins/job_submit/cnode/job_submit_cnode.c
 create mode 100644 src/plugins/mcs/Makefile.am
 create mode 100644 src/plugins/mcs/Makefile.in
 create mode 100644 src/plugins/mcs/group/Makefile.am
 create mode 100644 src/plugins/mcs/group/Makefile.in
 create mode 100644 src/plugins/mcs/group/mcs_group.c
 create mode 100644 src/plugins/mcs/none/Makefile.am
 rename src/plugins/{auth/authd => mcs/none}/Makefile.in (94%)
 create mode 100644 src/plugins/mcs/none/mcs_none.c
 create mode 100644 src/plugins/mcs/user/Makefile.am
 rename src/plugins/{job_submit/cnode => mcs/user}/Makefile.in (94%)
 create mode 100644 src/plugins/mcs/user/mcs_user.c
 create mode 100644 src/plugins/mpi/pmix/Makefile.am
 create mode 100644 src/plugins/mpi/pmix/Makefile.in
 create mode 100644 src/plugins/mpi/pmix/TODO
 create mode 100644 src/plugins/mpi/pmix/mpi_pmix.c
 create mode 100644 src/plugins/mpi/pmix/node_leader/fileops.c
 create mode 100644 src/plugins/mpi/pmix/node_leader/fileops.h
 create mode 100644 src/plugins/mpi/pmix/node_leader/ln_leader.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_agent.c
 rename src/{slurmdbd/agent.c => plugins/mpi/pmix/pmixp_agent.h} (78%)
 create mode 100644 src/plugins/mpi/pmix/pmixp_client.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_client.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_coll.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_coll.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_common.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_debug.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_dmdx.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_dmdx.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_info.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_info.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_io.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_io.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_nspaces.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_nspaces.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_server.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_server.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_state.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_state.h
 create mode 100644 src/plugins/mpi/pmix/pmixp_utils.c
 create mode 100644 src/plugins/mpi/pmix/pmixp_utils.h
 create mode 100644 src/plugins/mpi/pmix/tests/pmix_client.c
 create mode 100644 src/plugins/mpi/pmix/tests/test_common.c
 create mode 100644 src/plugins/mpi/pmix/tests/test_common.h
 create mode 100644 src/plugins/node_features/Makefile.am
 create mode 100644 src/plugins/node_features/Makefile.in
 create mode 100644 src/plugins/node_features/knl_cray/Makefile.am
 create mode 100644 src/plugins/node_features/knl_cray/Makefile.in
 create mode 100644 src/plugins/node_features/knl_cray/node_features_knl_cray.c
 create mode 100644 src/plugins/select/cray/ccm.c
 create mode 100644 src/plugins/select/cray/ccm.h
 create mode 100644 src/sacctmgr/lost_jobs_functions.c
 create mode 100644 src/slurmctld/power_save.h
 delete mode 100644 src/slurmctld/sicp.c
 create mode 100755 testsuite/expect/slurm_status
 create mode 100755 testsuite/expect/test1.102
 create mode 100755 testsuite/expect/test1.103
 create mode 100755 testsuite/expect/test1.104
 create mode 100755 testsuite/expect/test1.105
 create mode 100755 testsuite/expect/test1.106
 create mode 100755 testsuite/expect/test1.107
 create mode 100755 testsuite/expect/test1.108
 create mode 100755 testsuite/expect/test1.109
 create mode 100755 testsuite/expect/test1.110
 create mode 100755 testsuite/expect/test1.111
 create mode 100755 testsuite/expect/test1.112
 create mode 100755 testsuite/expect/test15.30
 create mode 100755 testsuite/expect/test15.31
 create mode 100755 testsuite/expect/test15.32
 create mode 100755 testsuite/expect/test15.33
 create mode 100755 testsuite/expect/test15.34
 create mode 100755 testsuite/expect/test15.35
 create mode 100755 testsuite/expect/test15.36
 create mode 100755 testsuite/expect/test15.37
 create mode 100755 testsuite/expect/test15.38
 create mode 100755 testsuite/expect/test17.42
 create mode 100755 testsuite/expect/test17.44
 create mode 100755 testsuite/expect/test17.51
 create mode 100755 testsuite/expect/test17.52
 create mode 100755 testsuite/expect/test17.53
 create mode 100755 testsuite/expect/test17.54
 create mode 100755 testsuite/expect/test17.55
 create mode 100755 testsuite/expect/test17.56
 create mode 100755 testsuite/expect/test17.57
 create mode 100755 testsuite/expect/test17.58
 create mode 100755 testsuite/expect/test17.59
 create mode 100755 testsuite/expect/test17.60
 create mode 100755 testsuite/expect/test17.61
 create mode 100755 testsuite/expect/test17.62
 create mode 100755 testsuite/expect/test20.13
 create mode 100755 testsuite/expect/test21.33
 create mode 100755 testsuite/expect/test21.36
 create mode 100755 testsuite/expect/test3.16
 create mode 100755 testsuite/expect/test36.1
 create mode 100755 testsuite/expect/test36.2
 create mode 100755 testsuite/expect/test36.3
 create mode 100755 testsuite/expect/test36.4
 create mode 100755 testsuite/expect/test6.15
 delete mode 100644 testsuite/slurm_unit/common/runqsw.c

diff --git a/.gitignore b/.gitignore
index 1ac7c1fc7..4ebfb4c7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,10 +4,10 @@
 .deps
 .libs
 Makefile
+autom4te.cache
 /config.h
 /config.log
 /config.status
-/config.xml
 /contribs/cray/opt_modulefiles_slurm
 /contribs/cray/slurmconfgen.py
 /contribs/perlapi/libslurm/perl/Makefile.PL
diff --git a/AUTHORS b/AUTHORS
index c489c7379..52d1d8c5f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -44,3 +44,4 @@ Keven Tew <tew1(at)llnl.gov>
 Prashanth Tamraparni <prashanth.tamraparni(at)hp.com>
 Jay Windley <jwindley(at)lnxi.com>
 Ann-Marie Wunderlin<Anne-Marie.Wunderlin(at)Bull.com>
+Artem Y. Polyakov <artemp(at)mellanox.com>
diff --git a/BUILD.NOTES b/BUILD.NOTES
index 6a78cf62c..46948bad4 100644
--- a/BUILD.NOTES
+++ b/BUILD.NOTES
@@ -49,7 +49,6 @@ Linux cluster (See BlueGene and AIX specific notes below for some differences).
 	%_slurm_sysconfdir      /etc/slurm
 	%_with_debug            1
 	%_with_sgijob		1
-	%_with_elan		1   (ONLY ON SYSTEMS WITH ELAN SWITCH)
    NOTE: build will make a tar-ball based upon ALL of the files in your current
    local directory. If that includes scratch files, everyone will get those
    files in the tar-ball. For that reason, it is a good idea to clone a clean
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 000000000..61ac4b9ee
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,65 @@
+NOTES FOR GITHUB DEVELOPERS
+---------------------------
+
+The official issue tracker for Slurm is at
+  http://bugs.schedmd.com/
+
+We welcome code contributions and patches, but **we do not accept Pull Requests
+through Github at this time.** Please submit patches as attachments to new
+bugs under "Contributions" category.
+
+CODING GUIDELINES
+-----------------
+Slurm loosely follows the Linux Kernel style guidelines
+(https://www.kernel.org/doc/Documentation/CodingStyle). If in doubt, please
+follow their example.
+
+A brief overview, with some notable exceptions:
+- Tabs not spaces, tabs are 8-spaces wide.
+- Lines should be less than 80-characters wide.
+- Use K&R style for braces.
+- Slurm does use typedef's for certain types, ignore Chapter 5 of the kernel
+  guidelines.
+- Comments can be in either C-style `/* comment */` or C++ style  `// comment`
+  formats. Follow the rest of Chapter 8's recommendations for multi-line
+  comments though.
+
+BUILD SYSTEM CHANGES
+--------------------
+Please submit changes to `Makefile.in`, but not to `Makefile.am`. We will
+regenerate those files to minimize the differences in the commit. We want to
+avoid noise generated by differences in libtool installations.
+
+Changes to `configure.ac` or `auxdir/*` will take additional time to review -
+Slurm is built on a wide variety of distributions and architectures, and even
+minor differences can cause unintended consequences.
+
+PATCH SUBMISSION
+----------------
+An entry in `NEWS` should describe the change or new functionality.
+
+Please break patches up into logically separate chunks, while ensuring that
+each patch can still be compiled. (Anticipate that a developer using `git
+bisect` may pick any intermediate commit at some point.)
+
+If you decided to reformat a file, please submit non-functional changes
+(spelling corrections, formatting discrepancies) in a separate patch. This
+makes reviewing substantially easier, and allows us to focus our attention on
+the functional differences.
+
+If you make an automated change (changing a function name, fixing a pervasive
+spelling mistake), please send the command/regex used to generate the changes
+along with the patch, or note it in the commit message.
+
+While not required, we encourage use of `git format-patch` to geneate the
+patch. This ensures the relevant author line and commit message stay attached.
+Plain `diff`'d output is also okay. In either case, please attach them to the
+bug for us to review. Spelling corrections or documentation improvements can be
+suggested without attaching the patch as long as you describe their location.
+
+LEGAL
+-----
+
+We ask that a contributor licensing agreement be signed for all substantial
+contributions. Please see http://slurm.schedmd.com/contributor.html for
+details.
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index e69de29bb..000000000
diff --git a/META b/META
index 711ed7c67..8193c0126 100644
--- a/META
+++ b/META
@@ -1,26 +1,26 @@
 ##
-# $Id$
-##
 # Metadata for RPM/TAR makefile targets
 ##
 # See src/api/Makefile.am for guidance on setting API_ values
 ##
   Meta:		1
   Name:		slurm
-  Major:	15
-  Minor:	08
-  Micro:	11
-  Version:	15.08.11
+  Major:	16
+  Minor:	05
+  Micro:	0
+  Version:	16.05.0
   Release:	1
+# Include leading zero for all pre-releases
 
 ##
 #  When making a new Major/Minor version update
 #  src/common/slurm_protocol_common.h
 #  with a new SLURM_PROTOCOL_VERSION signifing the old one and the version
 #  it was so the slurmdbd can continue to send the old protocol version.
-#  In src/common/slurm_protocol_util.c check_header_version(),
-#  and _get_slurm_version()
+#  In src/common/slurm_protocol_util.c check_header_version()
 #  need to be updated also when changes are added also.
+#  In src/plugins/slurmctld/nonstop/msg.c needs to have version_string updated.
+#  The META of libsmd needs to reflect this version and API_CURRENT as well.
 #
 #  NOTE: The API version can not be the same as the Slurm version above.  The
 #        version in the code is referenced as a uint16_t which if 1403 was the
@@ -31,6 +31,6 @@
 #        the config.h file that may be used throughout Slurm, so don't remove
 #	 them.
 ##
-  API_CURRENT:	29
+  API_CURRENT:	30
   API_AGE:	0
   API_REVISION:	0
diff --git a/Makefile.am b/Makefile.am
index 46161d912..b1258cf5f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
 
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I auxdir
-SUBDIRS    = auxdir src testsuite doc
+SUBDIRS    = auxdir src testsuite doc etc
 
 EXTRA_DIST =			\
 	etc/bluegene.conf.example \
@@ -11,6 +11,7 @@ EXTRA_DIST =			\
 	etc/init.d.slurm.in	\
 	etc/init.d.slurmdbd.in	\
 	etc/layouts.d.power.conf.example \
+	etc/layouts.d.unit.conf.example \
 	etc/slurm.conf.example	\
 	etc/slurm.epilog.clean	\
 	etc/slurmctld.service.in \
@@ -28,8 +29,7 @@ EXTRA_DIST =			\
 	LICENSE.OpenSSL		\
 	NEWS			\
 	ChangeLog		\
-	META			\
-	config.xml
+	META
 
 pkginclude_HEADERS =		\
 	slurm/pmi.h		\
@@ -40,7 +40,7 @@ pkginclude_HEADERS =		\
 	slurm/spank.h
 
 MAINTAINERCLEANFILES = 					\
-	aclocal.m4 config.guess config.xml		\
+	aclocal.m4 config.guess				\
 	config.h.in config.sub configure install-sh 	\
 	ltconfig ltmain.sh missing mkinstalldirs 	\
 	slurm/slurm.h					\
diff --git a/Makefile.in b/Makefile.in
index 523d5f1c4..81127f9bb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -142,13 +143,9 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h $(top_builddir)/slurm/slurm.h
-CONFIG_CLEAN_FILES = config.xml \
-	contribs/perlapi/libslurm/perl/Makefile.PL \
+CONFIG_CLEAN_FILES = contribs/perlapi/libslurm/perl/Makefile.PL \
 	contribs/perlapi/libslurmdb/perl/Makefile.PL \
-	contribs/phpext/slurm_php/config.m4 \
-	etc/cgroup.release_common.example etc/init.d.slurm \
-	etc/init.d.slurmdbd etc/slurmctld.service etc/slurmd.service \
-	etc/slurmdbd.service
+	contribs/phpext/slurm_php/config.m4
 CONFIG_CLEAN_VPATH_FILES =
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -237,22 +234,14 @@ CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
-	$(srcdir)/config.xml.in $(top_srcdir)/auxdir/compile \
-	$(top_srcdir)/auxdir/config.guess \
+	$(top_srcdir)/auxdir/compile $(top_srcdir)/auxdir/config.guess \
 	$(top_srcdir)/auxdir/config.sub \
 	$(top_srcdir)/auxdir/install-sh $(top_srcdir)/auxdir/ltmain.sh \
 	$(top_srcdir)/auxdir/missing \
 	$(top_srcdir)/contribs/perlapi/libslurm/perl/Makefile.PL.in \
 	$(top_srcdir)/contribs/perlapi/libslurmdb/perl/Makefile.PL.in \
 	$(top_srcdir)/contribs/phpext/slurm_php/config.m4.in \
-	$(top_srcdir)/etc/cgroup.release_common.example.in \
-	$(top_srcdir)/etc/init.d.slurm.in \
-	$(top_srcdir)/etc/init.d.slurmdbd.in \
-	$(top_srcdir)/etc/slurmctld.service.in \
-	$(top_srcdir)/etc/slurmd.service.in \
-	$(top_srcdir)/etc/slurmdbd.service.in \
-	$(top_srcdir)/slurm/slurm.h.in AUTHORS COPYING ChangeLog \
-	INSTALL NEWS
+	$(top_srcdir)/slurm/slurm.h.in AUTHORS COPYING INSTALL NEWS
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -299,8 +288,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -400,6 +387,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -438,6 +429,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -481,6 +475,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -531,6 +528,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -545,7 +543,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I auxdir
-SUBDIRS = auxdir src testsuite doc
+SUBDIRS = auxdir src testsuite doc etc
 EXTRA_DIST = \
 	etc/bluegene.conf.example \
 	etc/cgroup.conf.example \
@@ -554,6 +552,7 @@ EXTRA_DIST = \
 	etc/init.d.slurm.in	\
 	etc/init.d.slurmdbd.in	\
 	etc/layouts.d.power.conf.example \
+	etc/layouts.d.unit.conf.example \
 	etc/slurm.conf.example	\
 	etc/slurm.epilog.clean	\
 	etc/slurmctld.service.in \
@@ -571,8 +570,7 @@ EXTRA_DIST = \
 	LICENSE.OpenSSL		\
 	NEWS			\
 	ChangeLog		\
-	META			\
-	config.xml
+	META
 
 pkginclude_HEADERS = \
 	slurm/pmi.h		\
@@ -583,7 +581,7 @@ pkginclude_HEADERS = \
 	slurm/spank.h
 
 MAINTAINERCLEANFILES = \
-	aclocal.m4 config.guess config.xml		\
+	aclocal.m4 config.guess				\
 	config.h.in config.sub configure install-sh 	\
 	ltconfig ltmain.sh missing mkinstalldirs 	\
 	slurm/slurm.h					\
@@ -649,26 +647,12 @@ slurm/stamp-h2: $(top_srcdir)/slurm/slurm.h.in $(top_builddir)/config.status
 
 distclean-hdr:
 	-rm -f config.h stamp-h1 slurm/slurm.h slurm/stamp-h2
-config.xml: $(top_builddir)/config.status $(srcdir)/config.xml.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
 contribs/perlapi/libslurm/perl/Makefile.PL: $(top_builddir)/config.status $(top_srcdir)/contribs/perlapi/libslurm/perl/Makefile.PL.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 contribs/perlapi/libslurmdb/perl/Makefile.PL: $(top_builddir)/config.status $(top_srcdir)/contribs/perlapi/libslurmdb/perl/Makefile.PL.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 contribs/phpext/slurm_php/config.m4: $(top_builddir)/config.status $(top_srcdir)/contribs/phpext/slurm_php/config.m4.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/cgroup.release_common.example: $(top_builddir)/config.status $(top_srcdir)/etc/cgroup.release_common.example.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/init.d.slurm: $(top_builddir)/config.status $(top_srcdir)/etc/init.d.slurm.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/init.d.slurmdbd: $(top_builddir)/config.status $(top_srcdir)/etc/init.d.slurmdbd.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/slurmctld.service: $(top_builddir)/config.status $(top_srcdir)/etc/slurmctld.service.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/slurmd.service: $(top_builddir)/config.status $(top_srcdir)/etc/slurmd.service.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
-etc/slurmdbd.service: $(top_builddir)/config.status $(top_srcdir)/etc/slurmdbd.service.in
-	cd $(top_builddir) && $(SHELL) ./config.status $@
 
 mostlyclean-libtool:
 	-rm -f *.lo
diff --git a/NEWS b/NEWS
index d7f958a0c..08a221bfb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,298 @@
 This file describes changes in recent versions of Slurm. It primarily
 documents those changes that are of interest to users and administrators.
 
+* Changes in Slurm 16.05.0
+==========================
+ -- Update seff to fix warnings with ncpus, and list slurm-perlapi dependency
+    in spec file.
+ -- Fix testsuite to consistent use /usr/bin/env {bash,expect} construct.
+ -- Cray - Ensure that step completion messages get to the database.
+ -- Fix step cpus_per_task calculation for heterogeneous job allocation.
+ -- Fix --with-json= configure option to use specified path.
+ -- Add back thread_id to "thread_id" LogTimeFormat to distinguish between
+    mutliple threads with the same name. Now displays thread name and id.
+ -- Change how Slurm determines the NUMA count of a node. Ignore KNL NUMA
+    that only include memory.
+ -- Cray - Fix node list parsing in capmc_suspend/resume programs.
+ -- Fix sbatch #BSUB parsing for -W and -M options.
+ -- Fix GRES task layout bug that could cause slurmctld to abort.
+ -- Fix to --gres-flags=enforce-binding logic when multiple sockets needed.
+
+* Changes in Slurm 16.05.0rc2
+=============================
+ -- Cray node shutdown/reboot scripts, perform operations on all nodes in one
+    capmc command. Only if that fails, issue the operations in parallel on
+    individual nodes. Required for scalability.
+ -- Cleanup two minor Coverity warnings.
+ -- Make it so the tres units in a job's formatted string are converted like
+    they are in a step.
+ -- Correct partition's MaxCPUsPerNode enforcement when nodes are shared by
+    multiple partitions.
+ -- node_feature/knl_cray - Prevent slurmctld GRES errors for "hbm" references.
+ -- Display thread name instead of thread id and remove process name in stderr
+    logging for "thread_id" LogTimeFormat.
+ -- Log IP address of bad incomming message to slurmctld.
+ -- If a user requests tasks, nodes and ntasks-per-node and
+    tasks-per-node/nodes != tasks print warning and ignore ntasks-per-node.
+ -- Release CPU "owner" file locks.
+ -- Fix for job step memory allocation: Reject invalid step at submit time
+    rather than leaving it queued.
+ -- Whenever possible, avoid allocating nodes that require a reboot.
+
+* Changes in Slurm 16.05.0rc1
+==============================
+ -- Remove the SchedulerParameters option of "assoc_limit_continue", making it
+    the default value. Add option of "assoc_limit_stop". If "assoc_limit_stop"
+    is set and a job cannot start due to association limits, then do not attempt
+    to initiate any lower priority jobs in that partition. Setting this can
+    decrease system throughput and utlization, but avoid potentially starving
+    larger jobs by preventing them from launching indefinitely.
+ -- Update a node's socket and cores per socket counts as needed after a node
+    boot to reflect configuration changes which can occur on KNL processors.
+    Note that the node's total core count must not change, only the distribution
+    of cores across varying socket counts (KNL NUMA nodes treated as sockets by
+    Slurm).
+ -- Rename partition configuration from "Shared" to "OverSubscribe". Rename
+    salloc, sbatch, srun option from "--shared" to "--oversubscribe". The old
+    options will continue to function. Output field names also changed in
+    scontrol, sinfo, squeue and sview.
+ -- Add SLURM_UMASK environment variable to user job.
+ -- knl_conf: Added new configuration parameter of CapmcPollFreq.
+ -- squeue: remove errant spaces in column formats for "squeue -o %all".
+ -- Add ARRAY_TASKS mail option to send emails to each task in a job array.
+ -- Change default compression library for sbcast to lz4.
+ -- select/cray - Initiate step node health check at start of step termination
+    rather than after application completely ends so that NHC can capture
+    information about hung (non-killable) processes.
+ -- Add --units=[KMGTP] option to sacct to display values in specific unit type.
+ -- Modify sacct and sacctmgr to display TRES values in converted units.
+ -- Modify sacctmgr to accept TRES values with [KMGTP] suffixes.
+ -- Replace hash function with more modern SipHash functions.
+ -- Add "--with-cray_dir" build/configure option.
+ -- BB- Only send stage_out email when stage_out is set in script.
+ -- Add r/w locking to file_bcast receive functions in slurmd.
+ -- Add TopologyParam option of "TopoOptional" to optimize network topology
+    only for jobs requesting it.
+ -- Fix build on FreeBSD.
+ -- Configuration parameter "CpuFreqDef" used to set default governor for job
+    step not specifying --cpu-freq (previously the parameter was unused).
+ -- Fix sshare -o<format> to correctly display new lengths.
+ -- Update documentation to rename Shared option to OverSubscribe.
+ -- Update documentation to rename partition Priority option to PriorityTier.
+ -- Prevent changing of QOS on running jobs.
+ -- Update accounting when changing QOS on pending jobs.
+ -- Add support to ntasks_per_socket in task/affinity.
+ -- Generate init.d and systemd service scripts in etc/ through Make rather
+    than at configure time to ensure all variable substitutions happen.
+ -- Use TaskPluginParam for default task binding if no user specified CPU
+    binding. User --cpu_bind option takes precident over default. No longer
+    any error if user --cpu_bind option does not match TaskPluginParam.
+ -- Make sacct and sattach work with older slurmd versions.
+ -- Fix protocol handling between 15.08 and 16.05 for 'scontrol show config'.
+ -- Enable prefixes (e.g. info, debug, etc.) in slurmstepd debugging.
+
+* Changes in Slurm 16.05.0pre2
+==============================
+ -- Split partition's "Priority" field into "PriorityTier" (used to order
+    partitions for scheduling and preemption) plus "PriorityJobFactor" (used by
+    priority/multifactor plugin in calculating job priority, which is used to
+    order jobs within a partition for scheduling).
+ -- Revert call to getaddrinfo, restoring gethostbyaddr (introduced in Slurm
+    16.05.0pre1) which was failing on some systems.
+ -- knl_cray.conf - Added AllowMCDRAM, AllowNUMA and ALlowUserBoot
+    configuration options.
+ -- Add node_features_p_user_update() function to node_features plugin.
+ -- Don't print Weight=1 lines in 'scontrol write config' (its the default).
+ -- Remove PARAMS macro from slurm.h.
+ -- Remove BEGIN_C_DECLS and END_C_DECLS macros.
+ -- Check that PowerSave mode configured for node_features/knl_cray plugin.
+    It is required to reconfigure and reboot nodes.
+ -- Update documentation to reflect new cgroup default location change from
+    /cgroup to /sys/fs/cgroup.
+ -- If NodeHealthCheckProgram configured HealthCheckInterval is non-zero, then
+    modify slurmd to run it before registering with slurmctld.
+ -- Fix for tasks being packed onto cores when the requested --cpus-per-task is
+    greater than the number of threads on a core and --ntasks-per-core is 1.
+ -- Make it so jobs/steps track ':' named gres/tres, before hand gres/gpu:tesla
+    would only track gres/gpu, now it will track both gres/gpu and
+    gres/gpu:tesla as separate gres if configured like
+    AccountingStorageTRES=gres/gpu,gres/gpu:tesla
+ -- Added new job dependency type of "aftercorr" which will start a task of a
+    job array after the corresponding task of another job array completes.
+ -- Increase default MaxTasksPerNode configuration parameter from 128 to 512.
+ -- Enable sbcast data compression logic (compress option previously ignored).
+ -- Add --compress option to srun command for use with --bcast option.
+ -- Add TCPTimeout option to slurm[dbd].conf. Decouples MessageTimeout from TCP
+    connections.
+ -- Don't call primary controller for every RPC when backup is in control.
+ -- Add --gres-flags=enforce-binding option to salloc, sbatch and srun commands.
+    If set, the only CPUs available to the job will be those bound to the
+    selected GRES (i.e. the CPUs identifed in the gres.conf file will be
+    strictly enforced rather than advisory).
+ -- Change how a node's allocated CPU count is calculated to avoid double
+    counting CPUs allocated to multiple jobs at the same time.
+ -- Added SchedulingParameters option of "bf_min_prio_reserve". Jobs below
+    the specified threshold will not have resources reserved for them.
+ -- Added "sacctmgr show lostjobs" to report any orphaned jobs in the database.
+ -- When a stepd is about to shutdown and send it's response to srun
+    make the wait to return data only hit after 500 nodes and configurable
+    based on the TcpTimeout value.
+ -- Add functionality to reset the lft and rgt values of the association table
+    with the slurmdbd.
+ -- Add SchedulerParameter no_env_cache, if set no env cache will be use when
+    launching a job, instead the job will fail and drain the node if the env
+    isn't loaded normally.
+
+* Changes in Slurm 16.05.0pre1
+==============================
+ -- Add sbatch "--wait" option that waits for job completion before exiting.
+    Exit code will match that of spawned job.
+ -- Modify advanced reservation save/restore logic for core reservations to
+    support configuration changes (changes in configured nodes or cores counts).
+ -- Allow ControlMachine, BackupController, DbdHost and DbdBackupHost to be
+    either short or long hostname.
+ -- Job output and error files can now contain "%" character by specifying
+    a file name with two consecutive "%" characters. For example,
+    "sbatch -o "slurm.%%.%j" for job ID 123 will generate an output file named
+    "slurm.%.123".
+ -- Pass user name in Prolog RPC from controller to slurmd when using
+    PrologFlags=Alloc. Allows SLURM_JOB_USER env variable to be set when using
+    Native Slurm on a Cray.
+ -- Add "NumTasks" to job information visible to Slurm commands.
+ -- Add mail wrapper script "smail" that will include job statistics in email
+    notification messages.
+ -- Remove vestigial "SICP" job option (inter-cluster job option). Completely
+    different logic will be forthcoming.
+ -- Fix case where the primary and backup dbds would both be performing rollup.
+ -- Add an ack reply from slurmd to slurmstepd when job setup is done and the
+    job is ready to be executed.
+ -- Removed support for authd. authd has not been developed and supported since
+    several years. 
+ -- Introduce a new parameter requeue_setup_env_fail in SchedulerParameters.
+    A job that fails to setup the environment will be requeued and the node
+    drained.
+ -- Add ValidateTimeout and OtherTimeout to "scontrol show burst" output.
+ -- Increase default sbcast buffer size from 512KB to 8MB.
+ -- Enable the hdf5 profiling of the batch step.
+ -- Eliminate redundant environment and script files for job arrays.
+ -- Stop searching sbatch scripts for #PBS directives after 100 lines of
+    non-comments. Stop parsing #PBS or #SLURM directives after 1024 characters
+    into a line. Required for decent perforamnce with huge scripts.
+ -- Add debug flag for timing Cray portions of the code.
+ -- Remove all *.la files from RPMs.
+ -- Add Multi-Category Security (MCS) infrastructure to permit nodes to be bound
+    to specific users or groups.
+ -- Install the pmi2 unix sockets in slurmd spool directory instead of /tmp.
+ -- Implement the getaddrinfo and getnameinfo instead of gethostbyaddr and
+    gethostbyname.
+ -- Finished PMIx implementation.
+ -- Implemented the --without=package option for configure.
+ -- Fix sshare to show each individual cluster with -M,--clusters option.
+ -- Added --deadline option to salloc, sbatch and srun. Jobs which can not be
+    completed by the user specified deadline will be terminated with a state of
+    "Deadline" or "DL".
+ -- Implemented and documented PMIX protocol which is used to bootstrap an
+    MPI job. PMIX is an alternative to PMI and PMI2.
+ -- Change default CgroupMountpoint (in cgroup.conf) from "/cgroup" to
+    "/sys/fs/cgroup" to match current standard.
+ -- Add #BSUB options to sbatch to read in from the batch script.
+ -- HDF: Change group name of node from nodename to nodeid.
+ -- The partition-specific SelectTypeParameters parameter can now be used to
+    change the memory allocation tracking specification in the global
+    SelectTypeParameters configuration parameter. Supported partition-specific
+    values are CR_Core, CR_Core_Memory, CR_Socket and CR_Socket_Memory. If the
+    global SelectTypeParameters value includes memory allocation management and
+    the partition-specific value does not, then memory allocation management for
+    that partition will NOT be supported (i.e. memory can be over-allocated).
+    Likewise the global SelectTypeParameters might not include memory management
+    while the partition-specific value does.
+ -- Burst buffer/cray - Add support for multiple buffer pools including support
+    for different resource granularity by pool.
+ -- Burst buffer advanced reservation units treated as bytes (per documentation)
+    rather than GB.
+ -- Add an "scontrol top <jobid>" command to re-order the priorities of a user's
+    pending jobs. May be disabled with the "disable_user_top" option in the
+    SchedulerParameters configuration parameter.
+ -- Modify sview to display negative job nice values.
+ -- Increase job's nice value field from 16 to 32 bits.
+ -- Remove deprecated job_submit/cnode plugin.
+ -- Enhance slurm.conf option EnforcePartLimit to include options like "ANY" and
+    "ALL".  "Any" is equivalent to "Yes" and "All" will check all partitions
+    a job is submitted to and if any partition limit is violated the job will
+    be rejected even if it could possibly run on another partition.
+ -- Add "features_act" field (currently active features) to the node
+    information. Output of scontrol, sinfo, and sview changed accordingly.
+    The field previously displayed as "Features" is now "AvailableFeatures"
+    while the new field is displayed as "ActiveFeatures".
+ -- Remove Sun Constellation, IBM Federation Switches (replaced by NRT switch
+    plugin) and long-defunct Quadrics Elan support.
+ -- Add -M<clusters> option to sreport.
+ -- Rework group caching to work better in environments with
+    enumeration disabled. Removed CacheGroups config directive, group
+    membership lists are now always cached, controlled by
+    GroupUpdateTime parameter. GroupUpdateForce parameter default
+    value changed to 1.
+ -- Add reservation flag of "purge_comp" which will purge an advanced
+    reservation once it has no more active (pending, suspended or running) jobs.
+ -- Add new configuration parameter "KNLPlugins" and plugin infrastructure.
+ -- Add optional job "features" to node reboot RPC.
+ -- Add slurmd "-b" option to report node rebooted at daemon start time. Used
+    for testing purposes.
+ -- contribs/cray: Add framework for powering nodes up and down.
+ -- For job constraint, convert comma separator to "&".
+ -- Add Max*PerAccount options for QOS.
+ -- Protect slurm_mutex_* calls with abort() on failure.
+
+* Changes in Slurm 15.08.13
+===========================
+
+* Changes in Slurm 15.08.12
+===========================
+ -- Do not attempt to power down a node which has never responded if the
+    slurmctld daemon restarts without state.
+ -- Fix for possible slurmstepd segfault on invalid user ID.
+ -- MySQL - Fix for possible race condition when archiving multiple clusters
+    at the same time.
+ -- Fix compile for when you don't have hwloc.
+ -- Fix issue where daemons would only listen on specific address given in
+    slurm.conf instead of all.  If looking for specific addresses use
+    TopologyParam options No*InAddrAny.
+ -- Cray - Better robustness when dealing with the aeld interface.
+ -- job_submit.lua - add array_inx value for job arrays.
+ -- Perlapi - Remove unneeded/undefined mutex.
+ -- Fix issue when TopologyParam=NoInAddrAny is set the responses wouldn't
+    make it to the slurmctld when using message aggregation.
+ -- MySQL - Fix potential memory leak when rolling up data.
+ -- Fix issue with clustername file when running on NFS with root_squash.
+ -- Fix race condition with respects to cleaning up the profiling threads
+    when in use.
+ -- Fix issues when building on NetBSD.
+ -- Fix jobcomp/elasticsearch build when libcurl is installed in a
+    non-standard location.
+ -- Fix MemSpecLimit to explicitly require TaskPlugin=task/cgroup and
+    ConstrainRAMSpace set in cgroup.conf.
+ -- MYSQL - Fix order of operations issue where if the database is locked up
+    and the slurmctld doesn't wait long enough for the response it would give
+    up leaving the connection open and create a situation where the next message
+    sent could receive the response of the first one.
+ -- Fix CFULL_BLOCK distribution type.
+ -- Prevent sbatch from trying to enable debug messages when using job arrays.
+ -- Prevent sbcast from enabling "--preserve" when specifying a jobid.
+ -- Prevent wrong error message from spank plugin stack on GLOB_NOSPACE error.
+ -- Fix proctrack/lua plugin to prevent possible deadlock.
+ -- Prevent infinite loop in slurmstepd if execve fails.
+ -- Prevent multiple responses to REQUEST_UPDATE_JOB_STEP message.
+ -- Prevent possible deadlock in acct_gather_filesystem/lustre on error.
+ -- Make it so --mail-type=NONE didn't throw an invalid error.
+ -- If no default account is given for a user when creating (only a list of
+    accounts) no default account is printed, previously NULL was printed.
+ -- Fix for tracking a node's allocated CPUs with gang scheduling.
+ -- Fix Hidden error during _rpc_forward_data call.
+ -- Fix bug resulting from wrong order-of-operations in _connect_srun_cr(),
+    and two others that cause incorrect debug messages.
+ -- Fix backwards compatibility with sreport going to <= 14.11 coming from
+    >= 15.08 for some reports.
+
 * Changes in Slurm 15.08.11
 ===========================
  -- Fix for job "--contiguous" option that could cause job allocation/launch
@@ -15,7 +307,7 @@ documents those changes that are of interest to users and administrators.
  -- burst_buffer/cray - Fix for script creating or deleting persistent buffer
     would fail "paths" operation and hold the job.
  -- power/cray - Prevent possible divide by zero.
- -- power/cray - Fix bug introduced in 15.08.10 preventing operation in many
+ -- power/cray - Fix bug introduced in 15.08.10 preventin operation in many
     cases.
  -- Prevent deadlock for flow of data to the slurmdbd when sending reservation
     that wasn't set up correctly.
@@ -62,6 +354,8 @@ documents those changes that are of interest to users and administrators.
     select/cons_res plugin. Bug introduced in 15.08.9.
  -- Avoid double calculation on partition QOS if the job is using the same QOS.
  -- Do not change a job's time limit when updating unrelated field in a job.
+ -- Fix situation on a heterogeneous memory cluster where the order of
+    constraints mattered in a job.
 
 * Changes in Slurm 15.08.9
 ==========================
@@ -290,6 +584,8 @@ documents those changes that are of interest to users and administrators.
     cons_res plugin.
  -- Strip flags from a job state in qstat wrapper before evaluating.
  -- Add missing job states from the qstat wrapper.
+ -- Cleanup output routines to reduce number of fixed-sized buffer function
+    calls and allow for unexpectedly large strings.
 
 * Changes in Slurm 15.08.6
 ==========================
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index 347490800..de0a057d9 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,5 +1,5 @@
-RELEASE NOTES FOR SLURM VERSION 15.08
-12 May 2015
+RELEASE NOTES FOR SLURM VERSION 16.05
+27 April 2016
 
 IMPORTANT NOTES:
 ANY JOBS WITH A JOB ID ABOVE 2,147,463,647 WILL BE PURGED WHEN SLURM IS
@@ -7,7 +7,7 @@ UPGRADED FROM AN OLDER VERSION! Reduce your configured MaxJobID value as needed
 prior to upgrading in order to eliminate these jobs.
 
 If using the slurmdbd (Slurm DataBase Daemon) you must update this first.
-The 15.08 slurmdbd will work with Slurm daemons of version 14.03 and above.
+The 16.05 slurmdbd will work with Slurm daemons of version 14.11 and above.
 You will not need to update all clusters at the same time, but it is very
 important to update slurmdbd first and having it running before updating
 any other clusters making use of it.  No real harm will come from updating
@@ -32,445 +32,204 @@ upgrading Slurm to a new major release.
 
 HIGHLIGHTS
 ==========
- -- Added TRES (Trackable resources) to track utilization of memory, GRES,
-    burst buffer, license, and any other configurable resources in the
-    accounting database.
- -- Add configurable billing weight that takes into consideration any TRES when
-    calculating a job's resource utilization.
- -- Add configurable prioritization factor that takes into consideration any
-    TRES when calculating a job's resource utilization.
- -- Add burst buffer support infrastructure. Currently available plugin include
-    burst_buffer/generic (uses administrator supplied programs to manage file
-    staging) and burst_buffer/cray (uses Cray APIs to manage buffers).
- -- Add power capping support for Cray systems with automatic rebalancing of
-    power allocation between nodes.
- -- Modify slurmctld outgoing RPC logic to support more parallel tasks (up to
-    85 RPCs and 256 pthreads; the old logic supported up to 21 RPCs and 256
-    threads).
- -- Add support for job dependencies joined with OR operator (e.g.
-    "--depend=afterok:123?afternotok:124").
- -- Add advance reservation flag of "replace" that causes allocated resources
-    to be replaced with idle resources. This maintains a pool of available
-    resources that maintains a constant size (to the extent possible).
- -- Permit PreemptType=qos and PreemptMode=suspend,gang to be used together.
-    A high-priority QOS job will now oversubscribe resources and gang schedule,
-    but only if there are insufficient resources for the job to be started
-    without preemption. NOTE: That with PreemptType=qos, the partition's
-    Shared=FORCE:# configuration option will permit one job more per resource
-    to be run than than specified, but only if started by preemption.
- -- A partition can now have an associated QOS.  This will allow a partition
-    to have all the limits a QOS has.  If a limit is set in both QOS
-    the partition QOS will override the job's QOS unless the job's QOS has the
-    'OverPartQOS' flag set.
- -- Expanded --cpu-freq parameters to include min-max:governor specifications.
-    --cpu-freq now supported on salloc and sbatch.
- -- Add support for optimized job allocations with respect to SGI Hypercube
-    topology.
-    NOTE: Only supported with select/linear plugin.
-    NOTE: The program contribs/sgi/netloc_to_topology can be used to build
-    Slurm's topology.conf file.
- -- Add the ability for a compute node to be allocated to multiple jobs, but
-    restricted to a single user. Added "--exclusive=user" option to salloc,
-    the scontrol and sview commands. Added new partition configuration parameter
-    "ExclusiveUser=yes|no".
- -- Verify that all plugin version numbers are identical to the component
-    attempting to load them. Without this verification, the plugin can reference
-    Slurm functions in the caller which differ (e.g. the underlying function's
-    arguments could have changed between Slurm versions).
-    NOTE: All plugins (except SPANK) must be built against the identical
-    version of Slurm in order to be used by any Slurm command or daemon. This
-    should eliminate some very difficult to diagnose problems due to use of old
-    plugins.
- -- Optimize resource allocation for systems with dragonfly networks.
- -- Added plugin to record job completion information using Elasticsearch.
-    Libcurl is required for build. Configure slurm.conf as follows
-    JobCompType=jobcomp/elasticsearch
-    JobCompLoc=http://YOUR_ELASTICSEARCH_SERVER:9200
- -- DATABASE SCHEME HAS CHANGED.  WHEN UPDATING THE MIGRATION PROCESS MAY TAKE
-    SOME AMOUNT OF TIME DEPENDING ON HOW LARGE YOUR DATABASE IS.  WHILE UPDATING
-    NO RECORDS WILL BE LOST, BUT THE SLURMDBD MAY NOT BE RESPONSIVE DURING THE
-    UPDATE. IT WILL ALSO NOT BE POSSIBLE TO AUTOMATICALLY REVERT THE DATABASE
-    TO THE FORMAT FOR AN EARLIER VERSION OF SLURM. PLAN ACCORDINGLY.
- -- The performance of Profiling with HDF5 is improved. In addition, internal
-    structures are changed to make it easier to add new profile types,
-    particularly energy sensors. This has introduced an operational issue. See
-    OTHER CHANGES.
- -- MPI/MVAPICH plugin now requires Munge for authentication.
- -- In order to support inter-cluster job dependencies, the MaxJobID
-    configuration parameter default value has been reduced from 4,294,901,760
-    to 2,147,418,112 and it's maximum value is now 2,147,463,647.
-    ANY JOBS WITH A JOB ID ABOVE 2,147,463,647 WILL BE PURGED WHEN SLURM IS
-    UPGRADED FROM AN OLDER VERSION!
+ -- Implemented and documented PMIX protocol which is used to bootstrap an
+    MPI job. PMIX is an alternative to PMI and PMI2.
+ -- Change default CgroupMountpoint (in cgroup.conf) from "/cgroup" to
+    "/sys/fs/cgroup" to match current standard.
+ -- Add Multi-Category Security (MCS) infrastructure to permit nodes to be bound
+    to specific users or groups.
+ -- Added --deadline option to salloc, sbatch and srun. Jobs which can not be
+    completed by the user specified deadline will be terminated with a state of
+    "Deadline" or "DL".
+ -- Add an "scontrol top <jobid>" command to re-order the priorities of a user's
+    pending jobs. May be disabled with the "disable_user_top" option in the
+    SchedulerParameters configuration parameter.
+ -- Added new job dependency type of "aftercorr" which will start a task of a
+    job array after the corresponding task of another job array completes.
+ -- Add --gres-flags=enforce-binding option to salloc, sbatch and srun commands.
+    If set, the only CPUs available to the job will be those bound to the
+    selected GRES (i.e. the CPUs identifed in the gres.conf file will be
+    strictly enforced rather than advisory).
+ -- Added wrappers for LSF/OpenLava commands
+ -- Added Grid Engine options to qsub command wrapper.
 
 RPMBUILD CHANGES
 ================
-
+ -- Remove all *.la files from RPMs.
+ -- Implemented the --without=package option for configure.
 
 CONFIGURATION FILE CHANGES (see man appropriate man page for details)
 =====================================================================
- -- Remove DynAllocPort configuration parameter.
- -- Added new configuration parameters to support burst buffers:
-    BurstBufferParameters, and BurstBufferType.
- -- Added SchedulerParameters option of "bf_busy_nodes". When selecting
-    resources for pending jobs to reserve for future execution (i.e. the job
-    can not be started immediately), then preferentially select nodes that are
-    in use. This will tend to leave currently idle resources available for
-    backfilling longer running jobs, but may result in allocations having less
-    than optimal network topology. This option is currently only supported by
-    the select/cons_res plugin.
- -- Added "EioTimeout" parameter to slurm.conf. It is the number of seconds srun
-    waits for slurmstepd to close the TCP/IP connection used to relay data
-    between the user application and srun when the user application terminates.
- -- Remove the CR_ALLOCATE_FULL_SOCKET configuration option.  It is now the
-    default.
- -- Added DebugFlags values of "CpuFrequency", "Power" and "SICP".
- -- Added CpuFreqGovernors which lists governors allowed to be set with
-    --cpu-freq on salloc, sbatch, and srun.
- -- Interpret a partition configuration of "Nodes=ALL" in slurm.conf as
-    including all nodes defined in the cluster.
- -- Added new configuration parameters PowerParameters and PowerPlugin.
- -- Add AuthInfo option of "cred_expire=#" to specify the lifetime of a job
-    step credential. The default value was changed from 1200 to 120 seconds.
-    This value also controls how long a requeued job must wait before it can
-    be started again.
- -- Added LaunchParameters configuration parameter.
- -- Added new partition configuration parameter "ExclusiveUser=yes|no".
- -- Add TopologyParam configuration parameter. Optional value of "dragonfly"
-    is supported.
- -- Added a slurm.conf parameter "PrologEpilogTimeout" to control how long
-    prolog/epilog can run.
- -- Add PrologFlags option of "Contain" to create a proctrack container at
-    job resource allocation time.
-
-DBD CONFIGURATION FILE CHANGES (see "man slurmdbd.conf" for details)
-====================================================================
-
+ -- New configuration parameter NodeFeaturesPlugins added.
+ -- Change default CgroupMountpoint (in cgroup.conf) from "/cgroup" to
+    "/sys/fs/cgroup" to match current standard.
+ -- Introduce a new parameter "requeue_setup_env_fail" in SchedulerParameters.
+    If set, a job that fails to setup the environment will be requeued and the
+    node drained.
+ -- The partition-specific SelectTypeParameters parameter can now be used to
+    change the memory allocation tracking specification in the global
+    SelectTypeParameters configuration parameter. Supported partition-specific
+    values are CR_Core, CR_Core_Memory, CR_Socket and CR_Socket_Memory. If the
+    global SelectTypeParameters value includes memory allocation management and
+    the partition-specific value does not, then memory allocation management for
+    that partition will NOT be supported (i.e. memory can be over-allocated).
+    Likewise the global SelectTypeParameters might not include memory management
+    while the partition-specific value does.
+ -- Split partition's "Priority" field into "PriorityTier" (used to order
+    partitions for scheduling and preemption) plus "PriorityJobFactor" (used by
+    priority/multifactor plugin in calculating job priority, which is used to
+    order jobs within a partition for scheduling). If only "Priority" is
+    specified, that value will be used for both the "PriorityTier" and
+    "PriorityJobFactor" value.
+ -- New configuration file "knl.conf" added specifically for Intel Knights
+    Landing processor support.
+ -- Make it so jobs/steps track ':' named gres/tres, before hand gres/gpu:tesla
+    would only track gres/gpu, now it will track both gres/gpu and
+    gres/gpu:tesla as separate gres if configured like
+    AccountingStorageTRES=gres/gpu,gres/gpu:tesla
+ -- Add TCPTimeout option to slurm[dbd].conf. Decouples MessageTimeout from TCP
+    connections.
+ -- Added SchedulingParameters option of "bf_min_prio_reserve". Jobs below
+    the specified threshold will not have resources reserved for them.
+ -- Add SchedulerParameter "no_env_cache", if set no environment cache will be
+    used when launching a job, instead the job will fail and drain the node if
+    the environment isn't loaded normally.
+ -- Remove the SchedulerParameters option of "assoc_limit_continue", making it
+    the default value. Add option of "assoc_limit_stop". If "assoc_limit_stop"
+    is set and a job cannot start due to association limits, then do not attempt
+    to initiate any lower priority jobs in that partition. Setting this can
+    decrease system throughput and utlization, but avoid potentially starving
+    larger jobs by preventing them from launching indefinitely.
+ -- Rename partition configuration from "Shared" to "OverSubscribe". Rename
+    salloc, sbatch, srun option from "--shared" to "--oversubscribe". The old
+    options will continue to function. Output field names also changed in
+    scontrol, sinfo, squeue and sview.
+ -- Add TopologyParam option of "TopoOptional" to optimize network topology
+    only for jobs requesting it.
+ -- Configuration parameter "CpuFreqDef" used to set default governor for job
+    step not specifying --cpu-freq (previously the parameter was unused)
+ -- Use TaskPluginParam for default task binding if no user specified CPU
+    binding. User --cpu_bind option takes precident over default. No longer
+    any error if user --cpu_bind option does not match TaskPluginParam.
 
 COMMAND CHANGES (see man pages for details)
 ===========================================
- -- Added "--cpu_freq" option to salloc and sbatch.
- -- Add sbcast support for file transfer to resources allocated to a job step
-    rather than a job allocation (e.g. "sbcast -j 123.4 ...").
- -- Added new job state of STOPPED indicating processes have been stopped with a
-    SIGSTOP (using scancel or sview), but retain its allocated CPUs. Job state
-    returns to RUNNING when SIGCONT is sent (also using scancel or sview).
- -- The task_dist_states variable has been split into "flags" and "base"
-    components. Added SLURM_DIST_PACK_NODES and SLURM_DIST_NO_PACK_NODES values
-    to give user greater control over task distribution. The srun --dist options
-    has been modified to accept a "Pack" and "NoPack" option. These options can
-    be used to override the CR_PACK_NODE configuration option.
- -- Added BurstBuffer specification to advanced reservation.
- -- For advanced reservation, replace flag "License_only" with flag "Any_Nodes".
-    It can be used to indicate the advanced reservation resources (licenses
-    and/or burst buffers) can be used with any compute nodes.
- -- Add "--sicp" (available for inter-cluster dependencies) and "--power"
-    (specify power management options) to salloc, sbatch and srun commands.
- -- Added "--mail=stage_out" option to job submission commands to notify user
-    when burst buffer state out is complete.
- -- Require a "Reason" when using scontrol to set a node state to DOWN.
- -- Mail notifications on job BEGIN, END and FAIL now apply to a job array as a
-    whole rather than generating individual email messages for each task in the
-    job array.
- -- Remove srun --max-launch-time option. The option has not been functional
-    or documented since Slurm version 2.0.
- -- Add "--thread-spec" option to salloc, sbatch and srun commands. This is
-    the count of threads reserved for system use per node.
- -- Introduce new sbatch option '--kill-on-invalid-dep=yes|no' which allows
-    users to specify which behavior they want if a job dependency is not
-    satisfied.
- -- Add scontrol options to view and modify layouts tables.
- -- Add srun --accel-bind option to control how tasks are bound to GPUs and NIC
-    Generic RESources (GRES).
- -- Add sreport -T/--tres option to identify Trackable RESources (TRES) to
-    report.
+ -- sbatch to read OpenLava/LSF/#BSUB options from the batch script.
+ -- Add sbatch "--wait" option that waits for job completion before exiting.
+    Exit code will match that of spawned job.
+ -- Job output and error files can now contain "%" character by specifying
+    a file name with two consecutive "%" characters. For example,
+    "sbatch -o "slurm.%%.%j" for job ID 123 will generate an output file named
+    "slurm.%.123".
+ -- Increase default sbcast buffer size from 512KB to 8MB.
+ -- Add "ValidateTimeout" and "OtherTimeout" to "scontrol show burst" output.
+ -- Implemented the checking configuration functionality using the new -C
+    options of slurmctld. To check for configuration errors in slurm.conf
+    run: 'slurmctld -C'.
+ -- Burst buffer advanced reservation units treated as bytes (per documentation)
+    rather than GB.
+ -- Add "features_act" field (currently active features) to the node
+    information. Output of scontrol, sinfo, and sview changed accordingly.
+    The field previously displayed as "Features" is now "AvailableFeatures"
+    while the new field is displayed as "ActiveFeatures".
+ -- Enable sbcast data compression logic (compress option previously ignored).
+ -- Add --compress option to srun command for use with --bcast option.
+ -- Added "sacctmgr show lostjobs" to report any orphaned jobs in the database.
+ -- Add reservation flag of "purge_comp" which will purge an advanced
+    reservation once it has no more active (pending, suspended or running) jobs.
+ -- Add ARRAY_TASKS mail option to send emails to each task in a job array.
 
 OTHER CHANGES
 =============
- -- SPANK naming changes: For environment variables set using the
-    spank_job_control_setenv() function, the values were available in the
-    slurm_spank_job_prolog() and slurm_spank_job_epilog() functions using
-    getenv where the name was given a prefix of "SPANK_". That prefix has
-    been removed for consistency with the environment variables available in
-    the Prolog and Epilog scripts.
- -- job_submit/lua: Enable reading and writing job environment variables.
-    For example: if (job_desc.environment.LANGUAGE == "en_US") then ...
- -- The format of HDF5 node-step files has changed, so the sh5util program that
-    merges them into job files has changed. The command line options to sh5util
-    have not changed and will continue to service both versions for the next
-    few releases of Slurm.
- -- Add environment variables SLURM_ARRAY_TASK_MAX, SLURM_ARRAY_TASK_MIN,
-    SLURM_ARRAY_TASK_STEP for job arrays.
+ -- Add mail wrapper script "smail" that will include job statistics in email
+    notification messages.
+ -- Removed support for authd. authd has not been developed and supported since
+    several years.
+ -- Enable the hdf5 profiling of the batch step.
+ -- Eliminate redundant environment and script files for job arrays. This
+    greatly reduces the number of files involved in managing job arrays.
+ -- Burst buffer/cray - Add support for multiple buffer pools including support
+    for different resource granularity by pool.
+ -- Stop searching sbatch scripts for #PBS directives after 100 lines of
+    non-comments. Stop parsing #PBS or #SLURM directives after 1024 characters
+    into a line. Required for decent perforamnce with huge scripts.
+ -- New node features plugin infrastructure added. Currently used for support
+    of Intel Knights Landing processor.
+ -- If NodeHealthCheckProgram configured HealthCheckInterval is non-zero, then
+    modify slurmd to run it before registering with slurmctld.
+ -- select/cray - Initiate step node health check at start of step termination
+    rather than after application completely ends so that NHC can capture
+    information about hung (non-killable) processes.
+ -- Display thread name along with thread id and remove process name in stderr
+    logging for "thread_id" LogTimeFormat.
 
 API CHANGES
 ===========
+Removed PARAMS macro from slurm.h.
+Removed BEGIN_C_DECLS and END_C_DECLS macros from slurm.h.
 
 Changed members of the following structs
 ========================================
- -- Changed the following fields in struct struct job_descriptor:
-    cpu_freq renamed cpu_freq_max.
-    task_dist changed from 16 to 32 bit.
- -- Changed the following fields in struct job_info:
-    cpu_freq renamed cpu_freq_max.
-    job_state changed from 16 to 32 bit.
- -- Changed the following fields in struct slurm_ctl_conf:
-    min_job_age, task_plugin_param changed from 16 to 32 bit.
-    bf_cycle_sum changed from 32 to 64 bit.
- -- Changed the following fields in struct slurm_step_ctx_params_t:
-    cpu_freq renamed cpu_freq_max.
-    task_dist changed from 16 to 32 bit.
- -- Changed the following fields in struct slurm_step_launch_params_t:
-    cpu_freq renamed cpu_freq_max.
-    task_dist changed from 16 to 32 bit.
- -- Changed the following fields in struct slurm_step_layout_t:
-    task_dist changed from 16 to 32 bit.
- -- Changed the following fields in struct job_step_info_t:
-    cpu_freq renamed cpu_freq_max.
-    state changed from 16 to 32 bit.
- -- Changed the following fields in struct resource_allocation_response_msg_t:
-    cpu_freq renamed cpu_freq_max.
- -- Changed the following fields in struct stats_info_response_msg:
-    bf_cycle_sum changed from 32 to 64 bits.
- -- Changed the following fields in struct acct_gather_energy:
-    base_consumed_energy, consumed_energy, previous_consumed_energy
-    changed from 32 to 64 bits.
- -- Changed the following fields in struct ext_sensors_data:
-    consumed_energy changed from 32 to 64 bits.
+In burst_buffer_info_t, Changed gres_cnt to pool_cnt
+	Changed gres_ptr to pool_ptr
+In burst_buffer_pool_t: Changed avail_cnt to total_space
+In job_desc_msg_t: Changed nice from 16 to 32-bits
+In partition_info_t: Split priority into priority_job_factor and priority_tier
+In slurm_job_info_t: Changed nice from 16 to 32-bits
 
 Added members to the following struct definitions
 =================================================
- -- Added the following fields to struct acct_gather_node_resp_msg:
-    sensor_cnt
- -- Added the following fields to struct slurm_ctl_conf:
-    accounting_storage_tres, bb_type, cpu_freq_govs,
-    eio_timeout, launch_params, msg_aggr_params, power_parameters,
-    power_plugin, priority_weight_tres, prolog_epilog_timeout
-    topology_param.
- -- Added the following fields to struct job_descriptor:
-    bit_flags, burst_buffer, clusters, cpu_freq_min,
-    cpu_freq_gov, power_flags, sicp_mode
-    tres_req_cnt.
- -- Added the following fields to struct job_info:
-    bitflags, burst_buffer, cpu_freq_min, cpu_freq_gov,
-    billable_tres, power_flags, sicp_mode tres_req_str, tres_alloc_str.
- -- Added the following fields to struct slurm_step_ctx_params_t:
-    cpu_freq_min, cpu_freq_gov.
- -- Added the following fields to struct slurm_step_launch_params_t:
-    accel_bind_type, cpu_freq_min, cpu_freq_gov.
- -- Added the following fields to struct job_step_info_t:
-    cpu_freq_min, cpu_freq_gov task_dist, tres_alloc_str.
- -- Added the following fields to struct resource_allocation_response_msg_t:
-    account, cpu_freq_min, cpu_freq_gov, env_size, environment, qos
-    resv_name.
- -- Added the following fields to struct reserve_info_t:
-    burst_buffer, core_cnt, resv_watts, tres_str.
- -- Added the following fields to struct resv_desc_msg_t:
-    burst_buffer, core_cnt, resv_watts, tres_str.
- -- Added the following fields to struct node_info_t:
-    free_mem, power, owner, tres_fmt_str.
- -- Added the following fields to struct partition_info:
-    billing_weights_str, qos_char, tres_fmt_str
-
-Added the following struct definitions
-======================================
- -- Added power_mgmt_data_t: Power managment data stucture
- -- Added sicp_info_t: sicp data structure
- -- Added sicp_info_msg_t: sicp data structure message
- -- Added layout_info_msg_t: layout message data structure
- -- Added update_layout_msg_t: layout update message data structure
- -- Added step_alloc_info_msg_t: Step allocation message data structure.
- -- Added powercap_info_msg_t: Powercap information data structure.
- -- Added update_powercap_msg_t: Update message for powercap info
-    data structure.
- -- Added will_run_response_msg_t: Data structure to test if a job can run.
- -- Added assoc_mgr_info_msg_t: Association manager information data structure.
- -- Added assoc_mgr_info_request_msg_t: Association manager request message.
- -- Added network_callerid_msg_t: Network callerid data structure.
- -- Added burst_buffer_gres_t: Burst buffer gres data structure.
- -- Added burst_buffer_resv_t: Burst buffer reservation data structure.
- -- Added burst_buffer_use_t: Burst buffer user information.
- -- Added burst_buffer_info_t: Burst buffer information data structure.
- -- Added burst_buffer_info_msg_t: Burst buffer message data structure.
-
-Changed the following enums and #defines
-========================================
- -- Added INFINITE64: 64 bit infinite value.
- -- Added NO_VAL: 64 bit no val value.
- -- Added SLURM_EXTERN_CONT: Job step id of external process container.
- -- Added DEFAULT_EIO_SHUTDOWN_WAIT: Time to wait after eio shutdown signal.
- -- Added MAIL_JOB_STAGE_OUT: Mail job stage out flag.
- -- Added CPU_FREQ_GOV_MASK: Mask for all defined cpu-frequency governors.
- -- Added JOB_LAUNCH_FAILED: Job launch failed state.
- -- Added JOB_STOPPED: Job stopped state.
- -- Added SLURM_DIST*: Slurm distribution flags.
- -- Added CPU_FREQ_GOV_MASK: Cpu frequency gov mask
- -- Added CPU_FREQ_*_OLD: Vestigial values for transition from v14.11 systems.
- -- Added PRIORITY_FLAGS_MAX_TRES: Flag for max tres limit.
- -- Added KILL_INV_DEP and NO_KILL_INV_DEP: Invalid dependency flags.
- -- Added CORE_SPEC_THREAD: Flag for thread count
- -- Changed WAIT_QOS/ASSOC_*: changed to tres values.
- -- Added WAIT_ASSOC/QOS_GRP/MAX_*: Association tres states.
- -- Added ENERGY_DATA_*: sensor count and node energy added to
-    jobacct_data_type enum
- -- Added accel_bind_type: enum for accel bind type
- -- Added SLURM_POWER_FLAGS_LEVEL: Slurm power cap flag.
- -- Added PART_FLAG_EXCLUSIVE_USER: mask for exclusive allocation of nodes.
- -- Added PART_FLAG_EXC_USER_CLR: mask to clear exclusive allocation of nodes.
- -- Added RESERVE_FLAG_ANY_NODES: mask to allow usage for any compute node.
- -- Added RESERVE_FLAG_NO_ANY_NODES: mask to clear any compute node flag.
- -- Added RESERVE_FLAG_REPLACE: Replace job resources flag.
- -- Added DEBUG_FLAG_*: Debug flags for burst buffer, cpu freq, power
-    managment, sicp, DB archive, and tres.
- -- Added PROLOG_FLAG_CONTAIN: Proctrack plugin container flag
- -- Added ASSOC_MGR_INFO_FLAG_*: Association manager info flags for
-    association, user, and qos.
- -- Added BB_FLAG_DISABLE_PERSISTENT: Disable peristant burst buffers.
- -- Added BB_FLAG_ENABLE_PERSISTENT: Enable peristant burst buffers.
- -- Added BB_FLAG_EMULATE_CRAY: Using dw_wlm_cli emulator flag
- -- Added BB_FLAG_PRIVATE_DATA: Flag to allow buffer to be seen by owner.
- -- Added BB_STATE_*: Burst buffer state masks
-
-Added the following API's
-=========================
- -- Added slurm_job_will_run2 to determine of a job could execute immediately.
- -- Added APIs to load, print, and update layouts:
-    slurm_print_layout_info, slurm_load_layout, slurm_update_layout.
- -- Added APIs to free and get association manager information:
-    slurm_load_assoc_mgr_info, slurm_free_assoc_mgr_info_msg,
-    slurm_free_assoc_mgr_info_request_msg
- -- Added APIs to get cpu allocation from node name or id:
-    slurm_job_cpus_allocated_str_on_node_id,
-    slurm_job_cpus_allocated_str_on_node
- -- Added APIs to load, free, print, and update powercap information
-    slurm_load_powercap, slurm_free_powercap_info_msg,
-    slurm_print_powercap_info_msg, slurm_update_powercap
- -- Added slurm_burst_buffer_state_string to translate state number to string
-    equivalent
- -- Added APIs to load, free, and print burst buffer information
-    slurm_load_burst_buffer_info, slurm_free_burst_buffer_info_msg,
-    slurm_print_burst_buffer_info_msg, slurm_print_burst_buffer_record
- -- Added slurm_network_callerid to get the job id of a job based upon network
-    socket information.
-
-Changed the following API's
-============================
- -- slurm_get_node_energy - Changed argument
-    acct_gather_energy_t **acct_gather_energy to uint16_t *sensors_cnt
-    and acct_gather_energy_t **energy
- -- slurm_sbcast_lookup - Added step_id argument
-
-DBD API Changes
-===============
-
-Changed members of the following structs
-========================================
- -- Changed slurmdb_association_cond_t to slurmdb_assoc_cond_t:
- -- Changed the following fields in struct slurmdb_account_cond_t:
-    slurmdb_association_cond_t *assoc_cond changed to
-    slurmdb_assoc_cond_t *assoc_cond
- -- Changed the following fields in struct slurmdb_assoc_rec:
-    slurmdb_association_rec *assoc_next to
-    slurmdb_assoc_rec *assoc_next
-    slurmdb_association_rec *assoc_next_id to
-    slurmdb_assoc_rec *assoc_next_id
-    assoc_mgr_association_usage_t *usage to
-    slurmdb_assoc_usage_t *usage
- -- Changed the following fields in struct slurmdb_cluster_rec_t:
-    slurmdb_association_rec_t *root_assoc to
-    slurmdb_assoc_rec_t *root_assoc
- -- Changed the following fields in struct slurmdb_job_rec_t:
-    state changed from 16 to 32 bit
- -- Changed the following fields in struct slurmdb_qos_rec_t:
-    assoc_mgr_qos_usage_t *usage to slurmdb_qos_usage_t *usage
- -- Changed the following fields in struct slurmdb_step_rec_t:
-    task_dist was changed from 16 to 32 bit
- -- Changed the following fields in struct slurmdb_wckey_cond_t:
-    slurmdb_association_cond_t *assoc_cond to slurmdb_assoc_cond_t *assoc_cond
- -- Changed the following fields in struct slurmdb_hierarchical_rec_t:
-    slurmdb_association_cond_t *assoc_cond to slurmdb_assoc_cond_t *assoc_cond
+In burst_buffer_info_t: Added other_timeout and validate_timeout
+In burst_buffer_resv_t: Added pool
+In job_desc_msg_t: Added deadline, mcs_label
+In node_info_t: Added features_act and mcs_label
+In resource_allocation_response_msg_t: Added ntasks_per_board, ntasks_per_core,
+	ntasks_per_socket
+In slurm_job_info_t: Added deadline, num_tasks, mcs_label
+In slurm_ctl_conf_t: Added mcs_plugin, mcs_plugin_params, tcp_timeout, and
+	node_features_plugins
+In slurm_step_launch_params_t: Added ntasks_per_board, ntasks_per_core,
+	ntasks_per_socket
+In update_node_msg_t: Added features_act
+In slurm_job_info_t: Added start_protocol_ver
+In slurm_step_layout_t: Added start_protocol_ver
+In job_step_info_t: Added start_protocol_ver
 
 Added the following struct definitions
 ======================================
- -- Added slurmdb_tres_rec_t: Tres data structure for the slurmdbd.
- -- Added slurmdb_assoc_cond_t: Slurmdbd association condition.
- -- Added slurmdb_tres_cond_t: Tres condition data structure.
- -- Added slurmdb_assoc_usage: Slurmdbd association usage limits.
- -- Added slurmdbd_qos_usage_t: slurmdbd qos usage data structure.
+Added top_job_msg_t for user to reorder his jobs
 
-Added members to the following struct definitions
-=================================================
- -- Added the following fields to struct slurmdb_accounting_rec_t:
-    tres_rec
- -- Added the following fields to struct slurmdb_assoc_rec_t:
-    accounting_list, grp_tres, grp_tre_ctld, grp_tres_mins, grp_tres_mins_ctld,
-    grp_tres_run_mins, grp_tres_run_mins_ctld, max_tres_mins_pj,
-    max_tres_mins_ctld, max_tres_run_mins, max_tres_run_mins_ctld,
-    max_tres_pj, max_tres_ctld, max_tres_pn, max_tres_pn_ctld
- -- Added the following fields to struct slurmdb_cluser_rec_t:
-    tres_str
- -- Added the following fields to struct slurmdb_cluster_accounting_rec_t:
-    tres_rec
- -- Added the following fields to struct slurmdb_event_rec_t:
-    tres_str
- -- Added the following fields to struct slurmdb_job_rec_t:
-    tres_alloc_str, tres_req_str
- -- Added the following fields to struct slurmdb_qos_rec_t:
-    grp_tres, grp_tres_ctld, grp_tres_mins, grp_tres_mins_ctld,
-    grp_tres_run_mins, grp_tres_run_mins_ctld, max_tres_mins_pj,
-    max_tres_mins_pj_ctld, max_tres_pj, max_tres_pj_ctld, max_tres_pn,
-    max_tres_pn_ctld, max_tres_pn, max_tres_pn_ctld, max_tres_pu,
-    max_tres_pu_ctld, max_tres_run_mins_pu, max_tres_run_mins_pu_ctld,
-    min_tres_pj, min_tres_pj_ctld
- -- Added the following fields to struct slurmdb_reservation_rec_t:
-    tres_str, tres_list
- -- Added the following fields to struct slurmdb_step_rec_t:
-    req_cpufreq_min, req_cpufreq_max, req_cpufreq_gov, tres_alloc_str
- -- Added the following fields to struct slurmdb_used_limits_t:
-    tres, tres_run_mins
- -- Added the following fields to struct slurmdb_report_assoc_rec_t:
-    tres_list
- -- Added the following fields to struct slurmdb_report_user_rec_t:
-    tres_list
- -- Added the following fields to struct slurmdb_report_cluster_rec_t:
-    accounting_list, tres_list
- -- Added the following fields to struct slurmdb_report_job_grouping_t:
-    tres_list
- -- Added the following fields to struct slurmdb_report_acct_grouping_t:
-    tres_list
- -- Added the following fields to struct slurmdb_report_cluster_grouping_t:
-    tres_list
+Removed members from the following struct definitions
+=====================================================
+In burst_buffer_resv_t: Removed gres_cnt and gres_ptr
 
-Added the following enums and #defines
+Changed the following enums and #defines
 ========================================
--- Added QOS_FLAG_PART_QOS: partition qos flag
+Added DEBUG_FLAG_TIME_CRAY and DEBUG_FLAG_NODE_FEATURES
+Added RESERVE_FLAG_PURGE_COMP
+Added JOB_DEADLINE (job state)
+Added MAIL_ARRAY_TASK (mail flag)
+Changed MAX_TASKS_PER_NODE from 128 to 512
+Changed NICE_OFFSET from 10000 to 0x80000000
+Added new job state/wait reasons: FAIL_DEADLINE, WAIT_QOS_MAX_BB_PER_ACCT,
+	WAIT_QOS_MAX_CPU_PER_ACCT, WAIT_QOS_MAX_ENERGY_PER_ACCT,
+	WAIT_QOS_MAX_GRES_PER_ACCT, WAIT_QOS_MAX_NODE_PER_ACCT,
+	WAIT_QOS_MAX_LIC_PER_ACCT, WAIT_QOS_MAX_MEM_PER_ACCT,
+	WAIT_QOS_MAX_UNK_PER_ACCT, WAIT_QOS_MAX_JOB_PER_ACCT,
+	WAIT_QOS_MAX_SUB_JOB_PER_ACCT
+Added new partition limit enforcement flags: PARTITION_ENFORCE_NONE,
+	PARTITION_ENFORCE_ALL, PARTITION_ENFORCE_ANY
+Added select plugin IDs: SELECT_PLUGIN_BLUEGENE, SELECT_PLUGIN_CONS_RES,
+	SELECT_PLUGIN_LINEAR, SELECT_PLUGIN_ALPS, SELECT_PLUGIN_SERIAL,
+	SELECT_PLUGIN_CRAY_LINEAR, SELECT_PLUGIN_CRAY_CONS_RES
+Added job flags: GRES_ENFORCE_BIND and TEST_NOW_ONLY
+Added job resource sharing flags: JOB_SHARED_NONE, JOB_SHARED_OK,
+	JOB_SHARED_USER, JOB_SHARED_MCS
 
 Added the following API's
 =========================
- -- slurmdb_get_first_avail_cluster() - Get the first cluster that will run
-    a job
- -- slurmdb_destroy_assoc_usage() - Helper function
- -- slurmdb_destroy_qos_usage() - Helper function
- -- slurmdb_free_assoc_mgr_state_msg() - Helper function
- -- slurmdb_free_assoc_rec_members() - Helper function
- -- slurmdb_destroy_assoc_rec() - Helper function
- -- slurmdb_free_qos_rec_members() - Helper function
- -- slurmdb_destroy_tres_rec_noalloc() - Helper function
- -- slurmdb_destroy_tres_rec() - Helper function
- -- slurmdb_destroy_tres_cond() - Helper function
- -- slurmdb_destroy_assoc_cond() - Helper function
- -- slurmdb_init_assoc_rec() - Helper function
- -- slurmdb_init_tres_cond() - Helper function
- -- slurmdb_tres_add() - Add tres to accounting
- -- slurmdb_tres_get() - Get tres info from accounting
+Added slurm_top_job() function to reorder a user's jobs
 
 Changed the following API's
 ============================
- -- slurmdb_associations_get() - Changed assoc_cond arg type to
-    slurmdb_assoc_cond_t
- -- slurmdb_associations_modify() - Changed assoc_cond arg type to
-    slurmdb_assoc_cond_t and assoc arg type to slurmdb_assoc_rec_t
- -- slurmdb_associations_remove() - Changed assoc_cond arg type to
-    slurmdb_assoc_cond_t
- -- slurmdb_report_cluster_account_by_user(),
-    slurmdb_report_cluster_user_by_account(), slurmdb_problems_get() - Changed
-    assoc_cond arg type to slurmdb_assoc_cond_t
- -- slurmdb_init_qos_rec() - added init_val argument
+Added use_protocol_ver parameter to slurm_job_step_stat().
diff --git a/aclocal.m4 b/aclocal.m4
index 684e9ecfe..50e83caeb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -258,19 +258,8 @@ AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run
 
   no_gtk=""
 
-  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
-
-  if test x$PKG_CONFIG != xno ; then
-    if pkg-config --atleast-pkgconfig-version 0.7 ; then
-      :
-    else
-      echo "*** pkg-config too old; version 0.7 or better required."
-      no_gtk=yes
-      PKG_CONFIG=no
-    fi
-  else
-    no_gtk=yes
-  fi
+  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+  PKG_PROG_PKG_CONFIG([0.7])
 
   min_gtk_version=ifelse([$1], ,2.0.0,$1)
   AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
@@ -429,32 +418,63 @@ main ()
   rm -f conf.gtktest
 ])
 
-# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-# 
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29.1)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -476,18 +496,19 @@ if test -n "$PKG_CONFIG"; then
 		PKG_CONFIG=""
 	fi
 fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
 
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists.  Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
 AC_DEFUN([PKG_CHECK_EXISTS],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 if test -n "$PKG_CONFIG" && \
@@ -497,8 +518,10 @@ m4_ifvaln([$3], [else
   $3])dnl
 fi])
 
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
 m4_define([_PKG_CONFIG],
 [if test -n "$$1"; then
     pkg_cv_[]$1="$$1"
@@ -510,10 +533,11 @@ m4_define([_PKG_CONFIG],
  else
     pkg_failed=untried
 fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
 
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -521,19 +545,17 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
 else
         _pkg_short_errors_supported=no
 fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
 
 
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
 AC_DEFUN([PKG_CHECK_MODULES],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -587,16 +609,40 @@ else
         AC_MSG_RESULT([yes])
 	$3
 fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl   [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
 
 
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
 AC_DEFUN([PKG_INSTALLDIR],
 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
 m4_pushdef([pkg_description],
@@ -607,16 +653,18 @@ AC_ARG_WITH([pkgconfigdir],
 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
 m4_popdef([pkg_default])
 m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
+])dnl PKG_INSTALLDIR
 
 
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
 m4_pushdef([pkg_description],
@@ -627,13 +675,15 @@ AC_ARG_WITH([noarch-pkgconfigdir],
 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
 m4_popdef([pkg_default])
 m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
+])dnl PKG_NOARCH_INSTALLDIR
 
 
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
 AC_DEFUN([PKG_CHECK_VAR],
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
@@ -642,7 +692,7 @@ _PKG_CONFIG([$1], [variable="][$3]["], [$2])
 AS_VAR_COPY([$1], [pkg_cv_][$1])
 
 AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
+])dnl PKG_CHECK_VAR
 
 # Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
@@ -1810,6 +1860,7 @@ AC_SUBST([am__tar])
 AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
+m4_include([auxdir/ax_check_zlib.m4])
 m4_include([auxdir/ax_lib_hdf5.m4])
 m4_include([auxdir/ax_pthread.m4])
 m4_include([auxdir/libtool.m4])
@@ -1823,7 +1874,6 @@ m4_include([auxdir/x_ac_affinity.m4])
 m4_include([auxdir/x_ac_aix.m4])
 m4_include([auxdir/x_ac_blcr.m4])
 m4_include([auxdir/x_ac_bluegene.m4])
-m4_include([auxdir/x_ac_cflags.m4])
 m4_include([auxdir/x_ac_cray.m4])
 m4_include([auxdir/x_ac_curl.m4])
 m4_include([auxdir/x_ac_databases.m4])
@@ -1836,6 +1886,7 @@ m4_include([auxdir/x_ac_hwloc.m4])
 m4_include([auxdir/x_ac_iso.m4])
 m4_include([auxdir/x_ac_json.m4])
 m4_include([auxdir/x_ac_lua.m4])
+m4_include([auxdir/x_ac_lz4.m4])
 m4_include([auxdir/x_ac_man2html.m4])
 m4_include([auxdir/x_ac_munge.m4])
 m4_include([auxdir/x_ac_ncurses.m4])
@@ -1843,6 +1894,7 @@ m4_include([auxdir/x_ac_netloc.m4])
 m4_include([auxdir/x_ac_nrt.m4])
 m4_include([auxdir/x_ac_ofed.m4])
 m4_include([auxdir/x_ac_pam.m4])
+m4_include([auxdir/x_ac_pmix.m4])
 m4_include([auxdir/x_ac_printf_null.m4])
 m4_include([auxdir/x_ac_ptrace.m4])
 m4_include([auxdir/x_ac_readline.m4])
@@ -1851,4 +1903,3 @@ m4_include([auxdir/x_ac_setpgrp.m4])
 m4_include([auxdir/x_ac_setproctitle.m4])
 m4_include([auxdir/x_ac_sgi_job.m4])
 m4_include([auxdir/x_ac_slurm_ssl.m4])
-m4_include([auxdir/x_ac_sun_const.m4])
diff --git a/autogen.sh b/autogen.sh
index 355aeadef..4aac712a3 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,8 +1,5 @@
 #!/bin/sh
 #
-# $Id$
-# $Source$
-#
 # Run this script to generate aclocal.m4, config.h.in, 
 # Makefile.in's, and ./configure...
 # 
diff --git a/auxdir/Makefile.am b/auxdir/Makefile.am
index 494bd06e5..48c2120a0 100644
--- a/auxdir/Makefile.am
+++ b/auxdir/Makefile.am
@@ -1,10 +1,10 @@
 ##****************************************************************************
-## $Id$
-##****************************************************************************
 ## Process this file with automake to produce Makefile.in.
 ##****************************************************************************
 
 EXTRA_DIST = \
+    ax_check_zlib.m4 \
+    ax_lib_hdf5.m4 \
     ax_pthread.m4 \
     slurm.m4 \
     test-driver \
@@ -14,15 +14,12 @@ EXTRA_DIST = \
     x_ac_aix.m4 \
     x_ac_blcr.m4 \
     x_ac_bluegene.m4 \
-    x_ac_cflags.m4 \
     x_ac_cray.m4 \
     x_ac_curl.m4 \
     x_ac_databases.m4 \
     x_ac_debug.m4 \
     x_ac_dlfcn.m4 \
-    x_ac_elan.m4 \
     x_ac_env.m4 \
-    x_ac_federation.m4 \
     x_ac_gpl_licensed.m4 \
     x_ac_hwloc.m4 \
     x_ac_iso.m4 \
@@ -39,5 +36,4 @@ EXTRA_DIST = \
     x_ac_readline.m4 \
     x_ac_setproctitle.m4 \
     x_ac_sgi_job.m4 \
-    x_ac_slurm_ssl.m4 \
-    x_ac_sun_const.m4
+    x_ac_slurm_ssl.m4
diff --git a/auxdir/Makefile.in b/auxdir/Makefile.in
index 31bd1ee9b..903f01b17 100644
--- a/auxdir/Makefile.in
+++ b/auxdir/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = auxdir
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -161,14 +162,12 @@ am__can_run_installinfo = \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 am__DIST_COMMON = $(srcdir)/Makefile.in compile config.guess \
-	config.sub depcomp install-sh ltmain.sh missing
+	config.sub install-sh ltmain.sh missing
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -268,6 +267,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -306,6 +309,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -349,6 +355,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -399,6 +408,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -412,6 +422,8 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = \
+    ax_check_zlib.m4 \
+    ax_lib_hdf5.m4 \
     ax_pthread.m4 \
     slurm.m4 \
     test-driver \
@@ -421,15 +433,12 @@ EXTRA_DIST = \
     x_ac_aix.m4 \
     x_ac_blcr.m4 \
     x_ac_bluegene.m4 \
-    x_ac_cflags.m4 \
     x_ac_cray.m4 \
     x_ac_curl.m4 \
     x_ac_databases.m4 \
     x_ac_debug.m4 \
     x_ac_dlfcn.m4 \
-    x_ac_elan.m4 \
     x_ac_env.m4 \
-    x_ac_federation.m4 \
     x_ac_gpl_licensed.m4 \
     x_ac_hwloc.m4 \
     x_ac_iso.m4 \
@@ -446,8 +455,7 @@ EXTRA_DIST = \
     x_ac_readline.m4 \
     x_ac_setproctitle.m4 \
     x_ac_sgi_job.m4 \
-    x_ac_slurm_ssl.m4 \
-    x_ac_sun_const.m4
+    x_ac_slurm_ssl.m4
 
 all: all-am
 
diff --git a/auxdir/ax_check_zlib.m4 b/auxdir/ax_check_zlib.m4
new file mode 100644
index 000000000..6a15a82f6
--- /dev/null
+++ b/auxdir/ax_check_zlib.m4
@@ -0,0 +1,139 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_check_zlib.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_ZLIB([action-if-found], [action-if-not-found])
+#
+# DESCRIPTION
+#
+#   This macro searches for an installed zlib library. If nothing was
+#   specified when calling configure, it searches first in /usr/local and
+#   then in /usr, /opt/local and /sw. If the --with-zlib=DIR is specified,
+#   it will try to find it in DIR/include/zlib.h and DIR/lib/libz.a. If
+#   --without-zlib is specified, the library is not searched at all.
+#
+#   If either the header file (zlib.h) or the library (libz) is not found,
+#   shell commands 'action-if-not-found' is run. If 'action-if-not-found' is
+#   not specified, the configuration exits on error, asking for a valid zlib
+#   installation directory or --without-zlib.
+#
+#   If both header file and library are found, shell commands
+#   'action-if-found' is run. If 'action-if-found' is not specified, the
+#   default action appends '-I${ZLIB_HOME}/include' to CPFLAGS, appends
+#   '-L$ZLIB_HOME}/lib' to LDFLAGS, prepends '-lz' to LIBS, and calls
+#   AC_DEFINE(HAVE_LIBZ). You should use autoheader to include a definition
+#   for this symbol in a config.h file. Sample usage in a C/C++ source is as
+#   follows:
+#
+#     #ifdef HAVE_LIBZ
+#     #include <zlib.h>
+#     #endif /* HAVE_LIBZ */
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Loic Dachary <loic@senga.org>
+#   Copyright (c) 2010 Bastien Chevreux <bach@chevreux.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 14
+
+AU_ALIAS([CHECK_ZLIB], [AX_CHECK_ZLIB])
+AC_DEFUN([AX_CHECK_ZLIB],
+#
+# Handle user hints
+#
+[AC_MSG_CHECKING(if zlib is wanted)
+zlib_places="/usr/local /usr /opt/local /sw"
+AC_ARG_WITH([zlib],
+[  --with-zlib=DIR         root directory path of zlib installation @<:@defaults to
+                          /usr/local or /usr if not found in /usr/local@:>@
+  --without-zlib          to disable zlib usage completely],
+[if test "$withval" != no ; then
+  AC_MSG_RESULT(yes)
+  if test -d "$withval"
+  then
+    zlib_places="$withval $zlib_places"
+  else
+    AC_MSG_WARN([Sorry, $withval does not exist, checking usual places])
+  fi
+else
+  zlib_places=
+  AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(yes)])
+
+#
+# Locate zlib, if wanted
+#
+if test -n "${zlib_places}"
+then
+  # check the user supplied or any other more or less 'standard' place:
+  #   Most UNIX systems      : /usr/local and /usr
+  #   MacPorts / Fink on OSX : /opt/local respectively /sw
+  for ZLIB_HOME in ${zlib_places} ; do
+    if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
+    ZLIB_HOME=""
+  done
+
+  ZLIB_OLD_LDFLAGS=$LDFLAGS
+  ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+  if test -n "${ZLIB_HOME}"; then
+        LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+        CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+  fi
+  AC_LANG_SAVE
+  AC_LANG_C
+  AC_CHECK_LIB([z], [inflateEnd], [zlib_cv_libz=yes], [zlib_cv_libz=no])
+  AC_CHECK_HEADER([zlib.h], [zlib_cv_zlib_h=yes], [zlib_cv_zlib_h=no])
+  AC_LANG_RESTORE
+
+  # Restore variables
+  LDFLAGS="$ZLIB_OLD_LDFLAGS"
+  CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+
+  if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
+  then
+    #
+    # If both library and header were found, action-if-found
+    #
+    m4_ifblank([$1],[
+		ZLIB_CPPFLAGS="-I${ZLIB_HOME}/include"
+                ZLIB_LDFLAGS="-L${ZLIB_HOME}/lib"
+		ZLIB_LIBS="-lz"
+                AC_DEFINE([HAVE_LIBZ], [1],
+                          [Define to 1 if you have `z' library (-lz)])
+               ],[])
+  fi
+fi
+AC_SUBST(ZLIB_LIBS)
+AC_SUBST(ZLIB_CPPFLAGS)
+AC_SUBST(ZLIB_LDFLAGS)
+
+])
diff --git a/auxdir/config.guess b/auxdir/config.guess
index 1f5c50c0d..16592509d 100755
--- a/auxdir/config.guess
+++ b/auxdir/config.guess
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2014 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2014-03-23'
+timestamp='2015-08-20'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@ timestamp='2014-03-23'
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 #
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
 
 
 me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -168,20 +168,27 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	# Note: NetBSD doesn't particularly care about the vendor
 	# portion of the name.  We always set it to "unknown".
 	sysctl="sysctl -n hw.machine_arch"
-	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
-	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+	    /sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || \
+	    echo unknown)`
 	case "${UNAME_MACHINE_ARCH}" in
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
 	    sh3eb) machine=sh-unknown ;;
 	    sh5el) machine=sh5le-unknown ;;
+	    earmv*)
+		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+		machine=${arch}${endian}-unknown
+		;;
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
 	# to ELF recently, or will in the future.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -197,6 +204,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		os=netbsd
 		;;
 	esac
+	# Determine ABI tags.
+	case "${UNAME_MACHINE_ARCH}" in
+	    earm*)
+		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+		;;
+	esac
 	# The OS release
 	# Debian GNU/NetBSD machines have a different userland, and
 	# thus, need a distinct triplet. However, they do not need
@@ -207,13 +221,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 		release='-gnu'
 		;;
 	    *)
-		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
 		;;
 	esac
 	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 	# contains redundant information, the shorter form:
 	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-	echo "${machine}-${os}${release}"
+	echo "${machine}-${os}${release}${abi}"
 	exit ;;
     *:Bitrig:*:*)
 	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -235,6 +249,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     *:MirBSD:*:*)
 	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 	exit ;;
+    *:Sortix:*:*)
+	echo ${UNAME_MACHINE}-unknown-sortix
+	exit ;;
     alpha:OSF1:*:*)
 	case $UNAME_RELEASE in
 	*4.0)
@@ -579,8 +596,9 @@ EOF
 	else
 		IBM_ARCH=powerpc
 	fi
-	if [ -x /usr/bin/oslevel ] ; then
-		IBM_REV=`/usr/bin/oslevel`
+	if [ -x /usr/bin/lslpp ] ; then
+		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
 	else
 		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 	fi
@@ -932,6 +950,9 @@ EOF
     crisv32:Linux:*:*)
 	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
+    e2k:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     frv:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
@@ -1020,7 +1041,7 @@ EOF
 	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
 	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
diff --git a/auxdir/config.sub b/auxdir/config.sub
index bba4efb80..1acc966a3 100755
--- a/auxdir/config.sub
+++ b/auxdir/config.sub
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2014 Free Software Foundation, Inc.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
 
-timestamp='2014-09-11'
+timestamp='2015-08-20'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ timestamp='2014-09-11'
 # of the GNU General Public License, version 3 ("GPLv3").
 
 
-# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+# Please send patches to <config-patches@gnu.org>.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -68,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2015 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,7 +117,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
   kopensolaris*-gnu* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
@@ -255,12 +255,13 @@ case $basic_machine in
 	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
+	| ba \
 	| be32 | be64 \
 	| bfin \
 	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
-	| epiphany \
-	| fido | fr30 | frv \
+	| e2k | epiphany \
+	| fido | fr30 | frv | ft32 \
 	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
@@ -305,7 +306,7 @@ case $basic_machine in
 	| riscv32 | riscv64 \
 	| rl78 | rx \
 	| score \
-	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
 	| sh64 | sh64le \
 	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
 	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -313,6 +314,7 @@ case $basic_machine in
 	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
 	| ubicom32 \
 	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+	| visium \
 	| we32k \
 	| x86 | xc16x | xstormy16 | xtensa \
 	| z8k | z80)
@@ -327,6 +329,9 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
+	leon|leon[3-9])
+		basic_machine=sparc-$basic_machine
+		;;
 	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
@@ -372,12 +377,13 @@ case $basic_machine in
 	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
+	| ba-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
 	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
-	| elxsi-* \
+	| e2k-* | elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
 	| h8300-* | h8500-* \
 	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@@ -424,12 +430,13 @@ case $basic_machine in
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
 	| pyramid-* \
+	| riscv32-* | riscv64-* \
 	| rl78-* | romp-* | rs6000-* | rx-* \
 	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
 	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
 	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
 	| sparclite-* \
-	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
 	| tahoe-* \
 	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
 	| tile*-* \
@@ -437,6 +444,7 @@ case $basic_machine in
 	| ubicom32-* \
 	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
 	| vax-* \
+	| visium-* \
 	| we32k-* \
 	| x86-* | x86_64-* | xc16x-* | xps100-* \
 	| xstormy16-* | xtensa*-* \
@@ -513,6 +521,9 @@ case $basic_machine in
 		basic_machine=i386-pc
 		os=-aros
 		;;
+        asmjs)
+		basic_machine=asmjs-unknown
+		;;
 	aux)
 		basic_machine=m68k-apple
 		os=-aux
@@ -774,6 +785,9 @@ case $basic_machine in
 		basic_machine=m68k-isi
 		os=-sysv
 		;;
+	leon-*|leon[3-9]-*)
+		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+		;;
 	m68knommu)
 		basic_machine=m68k-unknown
 		os=-linux
@@ -1365,7 +1379,7 @@ case $os in
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
 	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-	      | -aos* | -aros* \
+	      | -aos* | -aros* | -cloudabi* | -sortix* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
 	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
 	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
diff --git a/auxdir/install-sh b/auxdir/install-sh
index 0b0fdcbba..59990a104 100755
--- a/auxdir/install-sh
+++ b/auxdir/install-sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2014-09-12.12; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -324,34 +324,41 @@ do
             # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
             ;;
           *)
+            # $RANDOM is not portable (e.g. dash);  use it when possible to
+            # lower collision chance
             tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+            trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
 
+            # As "mkdir -p" follows symlinks and we work in /tmp possibly;  so
+            # create the $tmpdir first (and fail if unsuccessful) to make sure
+            # that nobody tries to guess the $tmpdir name.
             if (umask $mkdir_umask &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+                $mkdirprog $mkdir_mode "$tmpdir" &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
             then
               if test -z "$dir_arg" || {
                    # Check for POSIX incompatibilities with -m.
                    # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
                    # other-writable bit of parent directory when it shouldn't.
                    # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   test_tmpdir="$tmpdir/a"
+                   ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
                    case $ls_ld_tmpdir in
                      d????-?r-*) different_mode=700;;
                      d????-?--*) different_mode=755;;
                      *) false;;
                    esac &&
-                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                   $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
                      test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
                    }
                  }
               then posix_mkdir=:
               fi
-              rmdir "$tmpdir/d" "$tmpdir"
+              rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
             else
               # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+              rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
             fi
             trap '' 0;;
         esac;;
diff --git a/auxdir/libtool.m4 b/auxdir/libtool.m4
index d7c043f4f..10ab2844c 100644
--- a/auxdir/libtool.m4
+++ b/auxdir/libtool.m4
@@ -1,8 +1,6 @@
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
+#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
 #   Written by Gordon Matzigkeit, 1996
 #
 # This file is free software; the Free Software Foundation gives
@@ -10,36 +8,30 @@
 # modifications, as long as this notice is preserved.
 
 m4_define([_LT_COPYING], [dnl
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ])
 
-# serial 57 LT_INIT
+# serial 58 LT_INIT
 
 
 # LT_PREREQ(VERSION)
@@ -67,7 +59,7 @@ esac
 # LT_INIT([OPTIONS])
 # ------------------
 AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
 AC_BEFORE([$0], [LT_LANG])dnl
 AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -91,7 +83,7 @@ dnl Parse OPTIONS
 _LT_SET_OPTIONS([$0], [$1])
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -111,26 +103,43 @@ dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
 dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
 
 
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in @S|@*""; do
+      case $cc_temp in
+        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
 # _LT_CC_BASENAME(CC)
 # -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
 m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
 ])
 
 
 # _LT_FILEUTILS_DEFAULTS
 # ----------------------
 # It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
 m4_defun([_LT_FILEUTILS_DEFAULTS],
 [: ${CP="cp -f"}
 : ${MV="mv -f"}
@@ -177,15 +186,16 @@ m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
 m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
 
 _LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 ])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -198,7 +208,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -209,14 +219,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -269,14 +279,14 @@ no_glob_subst='s/\*/\\\*/g'
 
 # _LT_PROG_LTMAIN
 # ---------------
-# Note that this code is called both from `configure', and `config.status'
+# Note that this code is called both from 'configure', and 'config.status'
 # now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
 # so we pass a copy along to make sure it has a sensible value anyway.
 m4_defun([_LT_PROG_LTMAIN],
 [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
 _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 ])# _LT_PROG_LTMAIN
 
 
@@ -286,7 +296,7 @@ ltmain="$ac_aux_dir/ltmain.sh"
 
 # So that we can recreate a full libtool script including additional
 # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
 # label.
 
 
@@ -421,8 +431,8 @@ m4_define([_lt_decl_all_varnames],
 
 # _LT_CONFIG_STATUS_DECLARE([VARNAME])
 # ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'.  VARNAME
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'.  VARNAME
 # must have a single quote delimited value for this to work.
 m4_define([_LT_CONFIG_STATUS_DECLARE],
 [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -446,7 +456,7 @@ m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
 # Output comment and list of tags supported by the script
 m4_defun([_LT_LIBTOOL_TAGS],
 [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
+available_tags='_LT_TAGS'dnl
 ])
 
 
@@ -474,7 +484,7 @@ m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
 # _LT_LIBTOOL_CONFIG_VARS
 # -----------------------
 # Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
 # script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
 # section) are produced by _LT_LIBTOOL_TAG_VARS.
 m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -500,8 +510,8 @@ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
 # Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
 # variables for single and double quote escaping we saved from calls
 # to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'.  Finally, any additional code accumulated
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'.  Finally, any additional code accumulated
 # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
 m4_defun([_LT_CONFIG_COMMANDS],
 [AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -547,7 +557,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_quote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -560,7 +570,7 @@ for var in lt_decl_all_varnames([[ \
 ]], lt_decl_dquote_varnames); do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[[\\\\\\\`\\"\\\$]]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -576,7 +586,7 @@ _LT_OUTPUT_LIBTOOL_INIT
 # Generate a child script FILE with all initialization necessary to
 # reuse the environment learned by the parent script, and make the
 # file executable.  If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins.  After this
+# '#!' sequence but before initialization text begins.  After this
 # macro, additional text can be appended to FILE to form the body of
 # the child script.  The macro ends with non-zero status if the
 # file could not be fully written (such as if the disk is full).
@@ -598,7 +608,7 @@ AS_SHELL_SANITIZE
 _AS_PREPARE
 exec AS_MESSAGE_FD>&1
 _ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
 m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
 
 # LT_OUTPUT
@@ -621,7 +631,7 @@ exec AS_MESSAGE_LOG_FD>>config.log
 } >&AS_MESSAGE_LOG_FD
 
 lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
 for use in further configure time tests before the real libtool is
 generated.
 
@@ -643,7 +653,7 @@ Copyright (C) 2011 Free Software Foundation, Inc.
 This config.lt script is free software; the Free Software Foundation
 gives unlimited permision to copy, distribute and modify it."
 
-while test $[#] != 0
+while test 0 != $[#]
 do
   case $[1] in
     --version | --v* | -V )
@@ -656,10 +666,10 @@ do
       lt_cl_silent=: ;;
 
     -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
 
     *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
   esac
   shift
 done
@@ -685,7 +695,7 @@ chmod +x "$CONFIG_LT"
 # open by configure.  Here we exec the FD to /dev/null, effectively closing
 # config.log, so it can be properly (re)opened and appended to by config.lt.
 lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
   lt_config_lt_args="$lt_config_lt_args --quiet"
 exec AS_MESSAGE_LOG_FD>/dev/null
 $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -705,32 +715,47 @@ m4_defun([_LT_CONFIG],
 _LT_CONFIG_SAVE_COMMANDS([
   m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
   m4_if(_LT_TAG, [C], [
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
 _LT_COPYING
 _LT_LIBTOOL_TAGS
 
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
 # ### BEGIN LIBTOOL CONFIG
 _LT_LIBTOOL_CONFIG_VARS
 _LT_LIBTOOL_TAG_VARS
 # ### END LIBTOOL CONFIG
 
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
 _LT_EOF
 
   case $host_os in
@@ -739,7 +764,7 @@ _LT_EOF
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -756,8 +781,6 @@ _LT_EOF
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  _LT_PROG_REPLACE_SHELLFNS
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -775,7 +798,6 @@ _LT_EOF
 [m4_if([$1], [], [
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'], [])
 ])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -974,7 +996,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 
     AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
       [lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -992,7 +1014,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1010,7 +1032,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
       AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
 	[lt_cv_ld_exported_symbols_list=yes],
 	[lt_cv_ld_exported_symbols_list=no])
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
     ])
 
     AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1032,7 +1054,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&AS_MESSAGE_LOG_FD
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1042,32 +1064,32 @@ _LT_EOF
     ])
     case $host_os in
     rhapsody* | darwin1.[[012]])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[[012]]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]][[,.]]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -1087,29 +1109,29 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
   _LT_TAGVAR(hardcode_direct, $1)=no
   _LT_TAGVAR(hardcode_automatic, $1)=yes
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
     m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
                   [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
   else
     _LT_TAGVAR(whole_archive_flag_spec, $1)=''
   fi
   _LT_TAGVAR(link_all_deplibs, $1)=yes
-  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
     m4_if([$1], [CXX],
-[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+[   if test yes != "$lt_cv_apple_cc_single_mod"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 ],[])
   else
@@ -1129,7 +1151,7 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
 # Allow to override them for all tags through lt_cv_aix_libpath.
 m4_defun([_LT_SYS_MODULE_PATH_AIX],
 [m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
+if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1147,7 +1169,7 @@ else
     _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
   fi],[])
   if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
-    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
   fi
   ])
   aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1167,8 +1189,8 @@ m4_define([_LT_SHELL_INIT],
 # -----------------------
 # Find how we can fake an echo command that does not interpret backslash.
 # In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
 m4_defun([_LT_PROG_ECHO_BACKSLASH],
 [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
 ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1196,10 +1218,10 @@ fi
 # Invoke $ECHO with all args, space-separated.
 func_echo_all ()
 {
-    $ECHO "$*" 
+    $ECHO "$*"
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) AC_MSG_RESULT([printf]) ;;
   print*) AC_MSG_RESULT([print -r]) ;;
   *) AC_MSG_RESULT([cat]) ;;
@@ -1225,16 +1247,17 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
 AC_DEFUN([_LT_WITH_SYSROOT],
 [AC_MSG_CHECKING([for sysroot])
 AC_ARG_WITH([sysroot],
-[  --with-sysroot[=DIR] Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+  [Search for dependent libraries within DIR (or the compiler's sysroot
+   if not specified).])],
 [], [with_sysroot=no])
 
 dnl lt_sysroot will always be passed unquoted.  We quote it here
 dnl in case the user passed a directory name.
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -1244,14 +1267,14 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_RESULT([$with_sysroot])
    AC_MSG_ERROR([The sysroot must be an absolute path.])
    ;;
 esac
 
  AC_MSG_RESULT([${lt_sysroot:-no}])
 _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+[dependent libraries, and where our libraries should be installed.])])
 
 # _LT_ENABLE_LOCK
 # ---------------
@@ -1259,31 +1282,33 @@ m4_defun([_LT_ENABLE_LOCK],
 [AC_ARG_ENABLE([libtool-lock],
   [AS_HELP_STRING([--disable-libtool-lock],
     [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -1312,9 +1337,46 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1333,10 +1395,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -1355,10 +1417,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -1376,19 +1438,20 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
     [AC_LANG_PUSH(C)
      AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
      AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if AC_TRY_EVAL(ac_compile); then
     case `/usr/bin/file conftest.o` in
@@ -1396,7 +1459,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -1405,7 +1468,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -1421,7 +1484,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 ])# _LT_ENABLE_LOCK
 
 
@@ -1440,11 +1503,11 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      [echo conftest.$ac_objext > conftest.lst
       lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
       AC_TRY_EVAL([lt_ar_try])
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	AC_TRY_EVAL([lt_ar_try])
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -1452,7 +1515,7 @@ AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
      ])
   ])
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -1483,7 +1546,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -1519,7 +1582,7 @@ AC_CACHE_CHECK([$1], [$2],
   [$2=no
    m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
+   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -1546,7 +1609,7 @@ AC_CACHE_CHECK([$1], [$2],
    $RM conftest*
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$5], , :, [$5])
 else
     m4_if([$6], , :, [$6])
@@ -1568,7 +1631,7 @@ AC_DEFUN([_LT_LINKER_OPTION],
 m4_require([_LT_DECL_SED])dnl
 AC_CACHE_CHECK([$1], [$2],
   [$2=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $3"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1587,10 +1650,10 @@ AC_CACHE_CHECK([$1], [$2],
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 ])
 
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
     m4_if([$4], , :, [$4])
 else
     m4_if([$5], , :, [$5])
@@ -1611,7 +1674,7 @@ AC_DEFUN([LT_CMD_MAX_LEN],
 AC_MSG_CHECKING([the maximum length of command line arguments])
 AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -1651,7 +1714,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1702,22 +1765,22 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -1733,7 +1796,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
     ;;
   esac
 ])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
 else
   AC_MSG_RESULT(none)
@@ -1761,7 +1824,7 @@ m4_defun([_LT_HEADER_DLFCN],
 # ----------------------------------------------------------------
 m4_defun([_LT_TRY_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
   [$4]
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1808,9 +1871,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -1836,7 +1899,7 @@ int main ()
   return status;
 }]
 _LT_EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -1857,7 +1920,7 @@ rm -fr conftest*
 # ------------------
 AC_DEFUN([LT_SYS_DLOPEN_SELF],
 [m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -1867,44 +1930,52 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ])
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     AC_CHECK_FUNC([shl_load],
-	  [lt_cv_dlopen="shl_load"],
+	  [lt_cv_dlopen=shl_load],
       [AC_CHECK_LIB([dld], [shl_load],
-	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
 	[AC_CHECK_FUNC([dlopen],
-	      [lt_cv_dlopen="dlopen"],
+	      [lt_cv_dlopen=dlopen],
 	  [AC_CHECK_LIB([dl], [dlopen],
-		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
 	    [AC_CHECK_LIB([svld], [dlopen],
-		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
 	      [AC_CHECK_LIB([dld], [dld_link],
-		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
 	      ])
 	    ])
 	  ])
@@ -1913,21 +1984,21 @@ else
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1937,7 +2008,7 @@ else
 	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
     ])
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
 	  lt_cv_dlopen_self_static, [dnl
@@ -1947,9 +2018,9 @@ else
       ])
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -2041,8 +2112,8 @@ m4_defun([_LT_COMPILER_FILE_LOCKS],
 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 _LT_COMPILER_C_O([$1])
 
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   AC_MSG_CHECKING([if we can lock with hard links])
   hard_links=yes
@@ -2052,8 +2123,8 @@ if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" !=
   ln conftest.a conftest.b 2>&5 || hard_links=no
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+  if test no = "$hard_links"; then
+    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
     need_locks=warn
   fi
 else
@@ -2080,8 +2151,8 @@ objdir=$lt_cv_objdir
 _LT_DECL([], [objdir], [0],
          [The name of the directory that contains temporary libtool files])dnl
 m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
-  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+  [Define to the sub-directory where libtool stores uninstalled libraries.])
 ])# _LT_CHECK_OBJDIR
 
 
@@ -2093,15 +2164,15 @@ m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
 _LT_TAGVAR(hardcode_action, $1)=
 if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
    test -n "$_LT_TAGVAR(runpath_var, $1)" ||
-   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
 
   # We can hardcode non-existent directories.
-  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
   else
@@ -2115,12 +2186,12 @@ else
 fi
 AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
 
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
-   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -2144,7 +2215,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       AC_MSG_RESULT([yes])
@@ -2162,6 +2233,47 @@ _LT_DECL([], [striplib], [1])
 ])# _LT_CMD_STRIPLIB
 
 
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x@S|@2 in
+    x)
+        ;;
+    *:)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+        ;;
+    x:*)
+        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+        ;;
+    *)
+        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
 # _LT_SYS_DYNAMIC_LINKER([TAG])
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
@@ -2172,17 +2284,18 @@ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_OBJDUMP])dnl
 m4_require([_LT_DECL_SED])dnl
 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
 AC_MSG_CHECKING([dynamic linker characteristics])
 m4_if([$1],
 	[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -2198,28 +2311,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -2233,7 +2353,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -2242,7 +2362,7 @@ fi])
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -2259,14 +2379,17 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[[4-9]]*)
@@ -2274,41 +2397,91 @@ aix[[4-9]]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[[01]] | aix4.[[01]].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -2318,18 +2491,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -2337,8 +2510,8 @@ beos*)
 bsdi[[45]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2350,7 +2523,7 @@ bsdi[[45]]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -2359,8 +2532,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -2376,17 +2549,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
 m4_if([$1], [],[
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -2395,8 +2568,8 @@ m4_if([$1], [],[
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -2423,7 +2596,7 @@ m4_if([$1], [],[
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2436,8 +2609,8 @@ m4_if([$1], [],[
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -2450,7 +2623,7 @@ m4_if([$1], [],[
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -2463,8 +2636,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2477,8 +2650,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2496,12 +2669,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -2531,10 +2705,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -2552,14 +2726,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -2567,8 +2742,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -2577,8 +2752,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2591,8 +2766,8 @@ interix[[3-9]]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2603,7 +2778,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -2611,8 +2786,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -2631,8 +2806,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -2641,13 +2816,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -2672,7 +2867,12 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -2704,12 +2904,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -2719,7 +2919,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -2728,58 +2928,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -2790,8 +3000,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -2801,11 +3011,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -2813,8 +3023,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -2835,24 +3045,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -2870,7 +3080,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -2878,8 +3088,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -2888,20 +3098,30 @@ uts4*)
   ;;
 esac
 AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
 _LT_DECL([], [variables_saved_for_relink], [1],
     [Variables whose values should be saved in libtool wrapper scripts and
     restored at link time])
@@ -2934,39 +3154,41 @@ _LT_DECL([], [hardcode_into_libs], [0],
     [Whether we should hardcode library paths into libraries])
 _LT_DECL([], [sys_lib_search_path_spec], [2],
     [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
-    [Run-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+    [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
 ])# _LT_SYS_DYNAMIC_LINKER
 
 
 # _LT_PATH_TOOL_PREFIX(TOOL)
 # --------------------------
-# find a file program which can recognize shared library
+# find a file program that can recognize shared library
 AC_DEFUN([_LT_PATH_TOOL_PREFIX],
 [m4_require([_LT_DECL_EGREP])dnl
 AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
 [case $MAGIC_CMD in
 [[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
 dnl $ac_dummy forces splitting on constant user-supplied paths.
 dnl POSIX.2 word splitting is done only on the output of word expansions,
 dnl not every word.  This closes a longstanding sh security hole.
   ac_dummy="m4_if([$2], , $PATH, [$2])"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+    if test -f "$ac_dir/$1"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -2989,11 +3211,11 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   AC_MSG_RESULT($MAGIC_CMD)
 else
@@ -3011,7 +3233,7 @@ dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
 
 # _LT_PATH_MAGIC
 # --------------
-# find a file program which can recognize a shared library
+# find a file program that can recognize a shared library
 m4_defun([_LT_PATH_MAGIC],
 [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
 if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3038,16 +3260,16 @@ m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
 AC_ARG_WITH([gnu-ld],
     [AS_HELP_STRING([--with-gnu-ld],
 	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
+    [test no = "$withval" || with_gnu_ld=yes],
     [with_gnu_ld=no])dnl
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   AC_MSG_CHECKING([for ld used by $CC])
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3061,7 +3283,7 @@ if test "$GCC" = yes; then
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -3072,37 +3294,37 @@ if test "$GCC" = yes; then
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
 AC_CACHE_VAL(lt_cv_path_LD,
 [if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi])
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   AC_MSG_RESULT($LD)
 else
@@ -3156,13 +3378,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -3173,6 +3395,43 @@ _LT_TAGDECL([], [reload_cmds], [2])dnl
 ])# _LT_CMD_RELOAD
 
 
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+  [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
 # _LT_CHECK_MAGIC_METHOD
 # ----------------------
 # how to check for library dependencies
@@ -3188,13 +3447,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[[4-9]]*)
@@ -3221,8 +3480,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -3318,8 +3576,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3372,6 +3630,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 ])
 
@@ -3412,33 +3673,38 @@ AC_DEFUN([LT_PATH_NM],
 AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
 [if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3449,21 +3715,21 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi])
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
     # Let the user override the test.
   else
     AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -3471,8 +3737,8 @@ else
     esac
   fi
   AC_SUBST([DUMPBIN])
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -3518,8 +3784,8 @@ lt_cv_sharedlib_from_linklib_cmd,
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3531,7 +3797,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 ])
@@ -3558,13 +3824,28 @@ AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool
     lt_cv_path_mainfest_tool=yes
   fi
   rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
 ])# _LT_PATH_MANIFEST_TOOL
 
 
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+  test DEF = "`$SED -n dnl
+    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
+    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
+    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
+    -e q dnl                          Only consider the first "real" line
+    $1`" dnl
+])# _LT_DLL_DEF_P
+
+
 # LT_LIB_M
 # --------
 # check for math library
@@ -3576,11 +3857,11 @@ case $host in
   # These system don't have libm, or don't need it
   ;;
 *-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
   AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
   ;;
 *)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  AC_CHECK_LIB(m, cos, LIBM=-lm)
   ;;
 esac
 AC_SUBST([LIBM])
@@ -3599,7 +3880,7 @@ m4_defun([_LT_COMPILER_NO_RTTI],
 
 _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3651,7 +3932,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[[ABCDGISTW]]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[[ABCDEGRST]]'
   fi
   ;;
@@ -3684,14 +3965,44 @@ case `$NM -V 2>&1` in
   symcode='[[ABCDGIRSTW]]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -3709,21 +4020,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK ['"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx]"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -3763,11 +4077,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT@&t@_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT@&t@_DLSYM_CONST
 #else
@@ -3793,7 +4107,7 @@ lt__PROGRAM__LTX_preloaded_symbols[[]] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -3813,9 +4127,9 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
-	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -3836,7 +4150,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -3863,12 +4177,16 @@ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
     [Take the output of nm and produce a listing of raw symbols and C names])
 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
     [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+    [Transform the output of nm into a list of symbols to manually relocate])
 _LT_DECL([global_symbol_to_c_name_address],
     [lt_cv_sys_global_symbol_to_c_name_address], [1],
     [Transform the output of nm in a C name address pair])
 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
     [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+    [The name lister interface])
 _LT_DECL([], [nm_file_list_spec], [1],
     [Specify filename containing input files for $NM])
 ]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3884,17 +4202,18 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)=
 
 m4_if([$1], [CXX], [
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -3905,8 +4224,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -3922,6 +4241,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -3971,7 +4295,7 @@ m4_if([$1], [CXX], [
     case $host_os in
       aix[[4-9]]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	else
@@ -4012,14 +4336,14 @@ m4_if([$1], [CXX], [
 	case $cc_basename in
 	  CC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -4056,7 +4380,7 @@ m4_if([$1], [CXX], [
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4201,17 +4525,18 @@ m4_if([$1], [CXX], [
   fi
 ],
 [
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
     _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
       ;;
 
     amigaos*)
@@ -4222,8 +4547,8 @@ m4_if([$1], [CXX], [
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -4240,6 +4565,11 @@ m4_if([$1], [CXX], [
       # (--disable-auto-import) libraries
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -4310,7 +4640,7 @@ m4_if([$1], [CXX], [
     case $host_os in
     aix*)
       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       else
@@ -4318,11 +4648,30 @@ m4_if([$1], [CXX], [
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       m4_if([$1], [GCJ], [],
 	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      case $host_os in
+      os2*)
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -4338,7 +4687,7 @@ m4_if([$1], [CXX], [
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -4349,7 +4698,7 @@ m4_if([$1], [CXX], [
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4374,6 +4723,12 @@ m4_if([$1], [CXX], [
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -4471,7 +4826,7 @@ m4_if([$1], [CXX], [
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
 	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
       fi
@@ -4500,7 +4855,7 @@ m4_if([$1], [CXX], [
   fi
 ])
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     _LT_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
@@ -4566,17 +4921,21 @@ m4_if([$1], [CXX], [
   case $host_os in
   aix[[4-9]]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
     else
-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -4625,9 +4984,9 @@ m4_if([$1], [CXX], [
   # included in the symbol list
   _LT_TAGVAR(include_expsyms, $1)=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4643,7 +5002,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -4651,7 +5010,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   linux* | k*bsd*-gnu | gnu*)
@@ -4664,7 +5023,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -4686,24 +5045,24 @@ dnl Note also adjust exclude_expsyms for C++ above.
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       _LT_TAGVAR(whole_archive_flag_spec, $1)=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4716,7 +5075,7 @@ dnl Note also adjust exclude_expsyms for C++ above.
     case $host_os in
     aix[[3-9]]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
@@ -4735,7 +5094,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -4751,7 +5110,7 @@ _LT_EOF
 	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4761,7 +5120,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
       # as there is no search path for DLLs.
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
       _LT_TAGVAR(always_export_symbols, $1)=no
       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -4769,61 +5128,89 @@ _LT_EOF
       _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
 
     haiku*)
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
     interix[[3-9]]*)
       _LT_TAGVAR(hardcode_direct, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -4834,42 +5221,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  _LT_TAGVAR(compiler_needs_object, $1)=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -4883,8 +5275,8 @@ _LT_EOF
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -4902,8 +5294,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
@@ -4915,7 +5307,7 @@ _LT_EOF
 	_LT_TAGVAR(ld_shlibs, $1)=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -4930,9 +5322,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -4949,15 +5341,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
       fi
       ;;
     esac
 
-    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
       runpath_var=
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
       _LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4973,7 +5365,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -4981,34 +5373,57 @@ _LT_EOF
       ;;
 
     aix[[4-9]]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -5027,13 +5442,21 @@ _LT_EOF
       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[[012]]|aix4.[[012]].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -5052,62 +5475,80 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	_LT_TAGVAR(link_all_deplibs, $1)=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       _LT_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
         _LT_SYS_MODULE_PATH_AIX([$1])
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
 	 _LT_SYS_MODULE_PATH_AIX([$1])
-	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	  fi
 	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+	  else
+	    # used by -dlpreopen to get the symbols
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -5116,7 +5557,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             _LT_TAGVAR(archive_expsym_cmds, $1)=''
         ;;
       m68k)
@@ -5146,16 +5587,17 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5164,18 +5606,18 @@ _LT_EOF
 	# Don't use ranlib
 	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -5184,7 +5626,7 @@ _LT_EOF
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -5234,33 +5676,33 @@ _LT_EOF
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_direct, $1)=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5268,25 +5710,25 @@ _LT_EOF
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 	m4_if($1, [], [
@@ -5294,14 +5736,14 @@ _LT_EOF
 	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
 	  _LT_LINKER_OPTION([if $CC understands -b],
 	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
 	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	case $host_cpu in
@@ -5312,7 +5754,7 @@ _LT_EOF
 	*)
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -5323,16 +5765,16 @@ _LT_EOF
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
 	# This should be the same for all languages, so no per-tag cache variable.
 	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
 	  [lt_cv_irix_exported_symbol],
-	  [save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	  [save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   AC_LINK_IFELSE(
 	     [AC_LANG_SOURCE(
 	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5345,21 +5787,32 @@ _LT_EOF
       end]])])],
 	      [lt_cv_irix_exported_symbol=yes],
 	      [lt_cv_irix_exported_symbol=no])
-           LDFLAGS="$save_LDFLAGS"])
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+           LDFLAGS=$save_LDFLAGS])
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
+	_LT_TAGVAR(link_all_deplibs, $1)=no
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(inherit_rpath, $1)=yes
       _LT_TAGVAR(link_all_deplibs, $1)=yes
       ;;
 
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
     netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
@@ -5374,7 +5827,7 @@ _LT_EOF
     newsos6)
       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       _LT_TAGVAR(hardcode_direct, $1)=yes
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       ;;
@@ -5382,27 +5835,19 @@ _LT_EOF
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	_LT_TAGVAR(hardcode_direct, $1)=yes
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	     ;;
-	   *)
-	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	fi
       else
 	_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5413,33 +5858,53 @@ _LT_EOF
       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
       _LT_TAGVAR(hardcode_minus_L, $1)=yes
       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
       else
 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5450,24 +5915,24 @@ _LT_EOF
 
     solaris*)
       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -5477,11 +5942,11 @@ _LT_EOF
       solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	fi
@@ -5491,10 +5956,10 @@ _LT_EOF
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -5543,43 +6008,43 @@ _LT_EOF
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
       _LT_TAGVAR(link_all_deplibs, $1)=yes
-      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -5594,17 +6059,17 @@ _LT_EOF
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
 	;;
       esac
     fi
   fi
 ])
 AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
 _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
 
@@ -5621,7 +6086,7 @@ x|xyes)
   # Assume -lc should be added
   _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $_LT_TAGVAR(archive_cmds, $1) in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -5701,12 +6166,12 @@ _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
 _LT_TAGDECL([], [hardcode_libdir_separator], [1],
     [Whether we need a single "-rpath" flag with a separated argument])
 _LT_TAGDECL([], [hardcode_direct], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary])
 _LT_TAGDECL([], [hardcode_direct_absolute], [0],
-    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
     DIR into the resulting binary and the resulting library dependency is
-    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    "absolute", i.e impossible to change by setting $shlibpath_var if the
     library is relocated])
 _LT_TAGDECL([], [hardcode_minus_L], [0],
     [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -5747,10 +6212,10 @@ dnl    [Compiler flag to generate thread safe objects])
 # ------------------------
 # Ensure that the configuration variables for a C compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_C_CONFIG],
 [m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
 AC_LANG_PUSH(C)
 
 # Source file extension for C test sources.
@@ -5790,18 +6255,18 @@ if test -n "$compiler"; then
   LT_SYS_DLOPEN_SELF
   _LT_CMD_STRIPLIB
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   AC_MSG_CHECKING([if libtool supports shared libraries])
   AC_MSG_RESULT([$can_build_shared])
 
   AC_MSG_CHECKING([whether to build shared libraries])
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -5809,8 +6274,12 @@ if test -n "$compiler"; then
     ;;
 
   aix[[4-9]]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -5818,13 +6287,13 @@ if test -n "$compiler"; then
 
   AC_MSG_CHECKING([whether to build static libraries])
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   AC_MSG_RESULT([$enable_static])
 
   _LT_CONFIG($1)
 fi
 AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
 ])# _LT_LANG_C_CONFIG
 
 
@@ -5832,14 +6301,14 @@ CC="$lt_save_CC"
 # --------------------------
 # Ensure that the configuration variables for a C++ compiler are suitably
 # defined.  These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_CXX_CONFIG],
 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
 m4_require([_LT_DECL_EGREP])dnl
 m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   AC_PROG_CXXCPP
 else
   _lt_caught_CXX_error=yes
@@ -5881,7 +6350,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -5923,35 +6392,35 @@ if test "$_lt_caught_CXX_error" != yes; then
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
     else
       _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
       LT_PATH_LD
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           _LT_TAGVAR(whole_archive_flag_spec, $1)=
         fi
@@ -5987,18 +6456,30 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=no
         ;;
       aix[[4-9]]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
           case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -6008,6 +6489,13 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        ;;
 	      esac
 	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
 	    ;;
           esac
 
@@ -6026,13 +6514,21 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
         _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
-        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          _LT_TAGVAR(hardcode_direct, $1)=no
+          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+          ;;
+        esac
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[[012]]|aix4.[[012]].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -6050,64 +6546,84 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         _LT_TAGVAR(always_export_symbols, $1)=yes
-        if test "$aix_use_runtimelinking" = yes; then
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # The "-G" linker flag allows undefined symbols.
+          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
           _LT_SYS_MODULE_PATH_AIX([$1])
-          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
 	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
 	    _LT_SYS_MODULE_PATH_AIX([$1])
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
 	    fi
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+	    else
+	      # used by -dlpreopen to get the symbols
+	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
           fi
         fi
         ;;
@@ -6117,7 +6633,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  _LT_TAGVAR(ld_shlibs, $1)=no
 	fi
@@ -6145,57 +6661,58 @@ if test "$_lt_caught_CXX_error" != yes; then
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 	  # Don't use ranlib
 	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
 	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
 	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
 	  _LT_TAGVAR(always_export_symbols, $1)=no
 	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    _LT_TAGVAR(ld_shlibs, $1)=no
 	  fi
@@ -6206,6 +6723,34 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_DARWIN_LINKER_FEATURES($1)
 	;;
 
+      os2*)
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	shrext_cmds=.dll
+	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+
       dgux*)
         case $cc_basename in
           ec++*)
@@ -6241,14 +6786,14 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       haiku*)
-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         _LT_TAGVAR(link_all_deplibs, $1)=yes
         ;;
 
       hpux9*)
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
         _LT_TAGVAR(hardcode_direct, $1)=yes
         _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
 				             # but as the default
@@ -6260,7 +6805,7 @@ if test "$_lt_caught_CXX_error" != yes; then
             _LT_TAGVAR(ld_shlibs, $1)=no
             ;;
           aCC*)
-            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -6269,11 +6814,11 @@ if test "$_lt_caught_CXX_error" != yes; then
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               _LT_TAGVAR(ld_shlibs, $1)=no
@@ -6283,15 +6828,15 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
 	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
               ;;
           esac
         fi
@@ -6317,13 +6862,13 @@ if test "$_lt_caught_CXX_error" != yes; then
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -6334,20 +6879,20 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -6362,22 +6907,22 @@ if test "$_lt_caught_CXX_error" != yes; then
       interix[[3-9]]*)
 	_LT_TAGVAR(hardcode_direct, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -6386,17 +6931,17 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
 	    ;;
         esac
-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
         _LT_TAGVAR(inherit_rpath, $1)=yes
         ;;
@@ -6409,8 +6954,8 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -6419,10 +6964,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6436,59 +6981,59 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6502,18 +7047,18 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -6521,10 +7066,10 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      _LT_TAGVAR(compiler_needs_object, $1)=yes
 
 	      # Not sure whether something based on
@@ -6582,22 +7127,17 @@ if test "$_lt_caught_CXX_error" != yes; then
         _LT_TAGVAR(ld_shlibs, $1)=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	_LT_TAGVAR(ld_shlibs, $1)=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  _LT_TAGVAR(hardcode_direct, $1)=yes
 	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
 	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -6613,9 +7153,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
 	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	    # Archives containing C++ object files must be created using
@@ -6633,17 +7173,17 @@ if test "$_lt_caught_CXX_error" != yes; then
           cxx*)
 	    case $host in
 	      osf3*)
-	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
 		;;
 	    esac
@@ -6658,21 +7198,21 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
 	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -6718,9 +7258,9 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    # Sun C++ 4.2, 5.x and Centerline C++
             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
 	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6728,7 +7268,7 @@ if test "$_lt_caught_CXX_error" != yes; then
 	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -6745,30 +7285,30 @@ if test "$_lt_caught_CXX_error" != yes; then
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -6776,11 +7316,11 @@ if test "$_lt_caught_CXX_error" != yes; then
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
 		*)
-		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -6789,52 +7329,52 @@ if test "$_lt_caught_CXX_error" != yes; then
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
-      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
-	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
 	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
 	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
-	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
 	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
 	_LT_TAGVAR(link_all_deplibs, $1)=yes
-	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
-	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+              '"$_LT_TAGVAR(old_archive_cmds, $1)"
 	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
-	      '"$_LT_TAGVAR(reload_cmds, $1)"
+              '"$_LT_TAGVAR(reload_cmds, $1)"
 	    ;;
 	  *)
-	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -6865,10 +7405,10 @@ if test "$_lt_caught_CXX_error" != yes; then
     esac
 
     AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
 
-    _LT_TAGVAR(GCC, $1)="$GXX"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$GXX
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -6895,7 +7435,7 @@ if test "$_lt_caught_CXX_error" != yes; then
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 AC_LANG_POP
 ])# _LT_LANG_CXX_CONFIG
@@ -6917,13 +7457,14 @@ AC_REQUIRE([_LT_DECL_SED])
 AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case @S|@2 in
+  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
   esac
 } # func_stripname_cnf
 ])# _LT_FUNC_STRIPNAME_CNF
 
+
 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
 # ---------------------------------
 # Figure out "hidden" library dependencies from verbose
@@ -7007,13 +7548,13 @@ if AC_TRY_EVAL(ac_compile); then
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -7029,16 +7570,16 @@ if AC_TRY_EVAL(ac_compile); then
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
 	   else
-	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -7046,9 +7587,9 @@ if AC_TRY_EVAL(ac_compile); then
 	 esac
        else
 	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
-	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)=$prev$p
 	 else
-	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
 	 fi
        fi
        prev=
@@ -7063,15 +7604,15 @@ if AC_TRY_EVAL(ac_compile); then
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
-	   _LT_TAGVAR(predep_objects, $1)="$p"
+	   _LT_TAGVAR(predep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
 	 fi
        else
 	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
-	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	   _LT_TAGVAR(postdep_objects, $1)=$p
 	 else
 	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
 	 fi
@@ -7102,51 +7643,6 @@ interix[[3-9]]*)
   _LT_TAGVAR(postdep_objects,$1)=
   _LT_TAGVAR(postdeps,$1)=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 ])
 
@@ -7155,7 +7651,7 @@ case " $_LT_TAGVAR(postdeps, $1) " in
 esac
  _LT_TAGVAR(compiler_lib_search_dirs, $1)=
 if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 _LT_TAGDECL([], [compiler_lib_search_dirs], [1],
     [The directories searched by this compiler when creating a shared library])
@@ -7175,10 +7671,10 @@ _LT_TAGDECL([], [compiler_lib_search_path], [1],
 # --------------------------
 # Ensure that the configuration variables for a Fortran 77 compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_F77_CONFIG],
 [AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
   _lt_disable_F77=yes
 fi
 
@@ -7215,7 +7711,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the F77 compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
+if test yes != "$_lt_disable_F77"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7237,7 +7733,7 @@ if test "$_lt_disable_F77" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${F77-"f77"}
@@ -7251,21 +7747,25 @@ if test "$_lt_disable_F77" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7273,11 +7773,11 @@ if test "$_lt_disable_F77" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$G77"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$G77
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7294,9 +7794,9 @@ if test "$_lt_disable_F77" != yes; then
   fi # test -n "$compiler"
 
   GCC=$lt_save_GCC
-  CC="$lt_save_CC"
-  CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
 
 AC_LANG_POP
 ])# _LT_LANG_F77_CONFIG
@@ -7306,11 +7806,11 @@ AC_LANG_POP
 # -------------------------
 # Ensure that the configuration variables for a Fortran compiler are
 # suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_FC_CONFIG],
 [AC_LANG_PUSH(Fortran)
 
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
   _lt_disable_FC=yes
 fi
 
@@ -7347,7 +7847,7 @@ _LT_TAGVAR(objext, $1)=$objext
 # the FC compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
+if test yes != "$_lt_disable_FC"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="\
       subroutine t
@@ -7369,7 +7869,7 @@ if test "$_lt_disable_FC" != yes; then
   _LT_LINKER_BOILERPLATE
 
   # Allow CC to be a program name with arguments.
-  lt_save_CC="$CC"
+  lt_save_CC=$CC
   lt_save_GCC=$GCC
   lt_save_CFLAGS=$CFLAGS
   CC=${FC-"f95"}
@@ -7385,21 +7885,25 @@ if test "$_lt_disable_FC" != yes; then
     AC_MSG_RESULT([$can_build_shared])
 
     AC_MSG_CHECKING([whether to build shared libraries])
-    test "$can_build_shared" = "no" && enable_shared=no
+    test no = "$can_build_shared" && enable_shared=no
 
     # On AIX, shared libraries and static libraries use the same namespace, and
     # are all built from PIC.
     case $host_os in
       aix3*)
-        test "$enable_shared" = yes && enable_static=no
+        test yes = "$enable_shared" && enable_static=no
         if test -n "$RANLIB"; then
           archive_cmds="$archive_cmds~\$RANLIB \$lib"
           postinstall_cmds='$RANLIB $lib'
         fi
         ;;
       aix[[4-9]]*)
-	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-	  test "$enable_shared" = yes && enable_static=no
+	if test ia64 != "$host_cpu"; then
+	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+	  yes,aix,yes) ;;		# shared object as lib.so file only
+	  yes,svr4,*) ;;		# shared object as lib.so archive member only
+	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+	  esac
 	fi
         ;;
     esac
@@ -7407,11 +7911,11 @@ if test "$_lt_disable_FC" != yes; then
 
     AC_MSG_CHECKING([whether to build static libraries])
     # Make sure either enable_shared or enable_static is yes.
-    test "$enable_shared" = yes || enable_static=yes
+    test yes = "$enable_shared" || enable_static=yes
     AC_MSG_RESULT([$enable_static])
 
-    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
-    _LT_TAGVAR(LD, $1)="$LD"
+    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+    _LT_TAGVAR(LD, $1)=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -7431,7 +7935,7 @@ if test "$_lt_disable_FC" != yes; then
   GCC=$lt_save_GCC
   CC=$lt_save_CC
   CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
+fi # test yes != "$_lt_disable_FC"
 
 AC_LANG_POP
 ])# _LT_LANG_FC_CONFIG
@@ -7441,7 +7945,7 @@ AC_LANG_POP
 # --------------------------
 # Ensure that the configuration variables for the GNU Java Compiler compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GCJ_CONFIG],
 [AC_REQUIRE([LT_PROG_GCJ])dnl
 AC_LANG_SAVE
@@ -7475,7 +7979,7 @@ CC=${GCJ-"gcj"}
 CFLAGS=$GCJFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7512,7 +8016,7 @@ CFLAGS=$lt_save_CFLAGS
 # --------------------------
 # Ensure that the configuration variables for the GNU Go compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_GO_CONFIG],
 [AC_REQUIRE([LT_PROG_GO])dnl
 AC_LANG_SAVE
@@ -7546,7 +8050,7 @@ CC=${GOC-"gccgo"}
 CFLAGS=$GOFLAGS
 compiler=$CC
 _LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
 _LT_CC_BASENAME([$compiler])
 
 # Go did not exist at the time GCC didn't implicitly link libc in.
@@ -7583,7 +8087,7 @@ CFLAGS=$lt_save_CFLAGS
 # -------------------------
 # Ensure that the configuration variables for the Windows resource compiler
 # are suitably defined.  These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
 m4_defun([_LT_LANG_RC_CONFIG],
 [AC_REQUIRE([LT_PROG_RC])dnl
 AC_LANG_SAVE
@@ -7599,7 +8103,7 @@ _LT_TAGVAR(objext, $1)=$objext
 lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
 
 # Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code=$lt_simple_compile_test_code
 
 # ltmain only uses $CC for tagged configurations so make sure $CC is set.
 _LT_TAG_COMPILER
@@ -7609,7 +8113,7 @@ _LT_COMPILER_BOILERPLATE
 _LT_LINKER_BOILERPLATE
 
 # Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
 lt_save_CFLAGS=$CFLAGS
 lt_save_GCC=$GCC
 GCC=
@@ -7638,7 +8142,7 @@ AC_DEFUN([LT_PROG_GCJ],
 [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
   [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
     [AC_CHECK_TOOL(GCJ, gcj,)
-      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
       AC_SUBST(GCJFLAGS)])])[]dnl
 ])
 
@@ -7749,7 +8253,7 @@ lt_ac_count=0
 # Add /usr/xpg4/bin/sed as it is typically found on Solaris
 # along with /bin/sed that truncates output.
 for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
+  test ! -f "$lt_ac_sed" && continue
   cat /dev/null > conftest.in
   lt_ac_count=0
   echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7766,9 +8270,9 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
     $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
     cmp -s conftest.out conftest.nl || break
     # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
+    test 10 -lt "$lt_ac_count" && break
     lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
+    if test "$lt_ac_count" -gt "$lt_ac_max"; then
       lt_ac_max=$lt_ac_count
       lt_cv_path_SED=$lt_ac_sed
     fi
@@ -7792,27 +8296,7 @@ dnl AC_DEFUN([LT_AC_PROG_SED], [])
 # Find out whether the shell is Bourne or XSI compatible,
 # or has some other useful features.
 m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
   lt_unset=false
@@ -7836,102 +8320,9 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
 ])# _LT_CHECK_SHELL_FEATURES
 
 
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
-    case ${1} in
-      */*) func_dirname_result="${1%/*}${2}" ;;
-      *  ) func_dirname_result="${3}" ;;
-    esac
-    func_basename_result="${1##*/}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
-    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
-    # positional parameters, so assign one to ordinary parameter first.
-    func_stripname_result=${3}
-    func_stripname_result=${func_stripname_result#"${1}"}
-    func_stripname_result=${func_stripname_result%"${2}"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
-    func_split_long_opt_name=${1%%=*}
-    func_split_long_opt_arg=${1#*=}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
-    func_split_short_opt_arg=${1#??}
-    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
-  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
-    case ${1} in
-      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
-      *)    func_lo2o_result=${1} ;;
-    esac])
-
-  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
-
-  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
-
-  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
-
-  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
-    func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
-    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
 # _LT_PATH_CONVERSION_FUNCTIONS
 # -----------------------------
-# Determine which file name conversion functions should be used by
+# Determine what file name conversion functions should be used by
 # func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
 # for certain cross-compile configurations and native mingw.
 m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
diff --git a/auxdir/ltmain.sh b/auxdir/ltmain.sh
index bffda5418..147d758ab 100644
--- a/auxdir/ltmain.sh
+++ b/auxdir/ltmain.sh
@@ -1,9 +1,12 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+##               by inline-source v2014-01-03.01
 
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
 # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
 # This is free software; see the source for copying conditions.  There is NO
 # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
@@ -23,881 +26,2112 @@
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-#       --config             show all configuration variables
-#       --debug              enable verbose shell tracing
-#   -n, --dry-run            display commands without modifying any files
-#       --features           display basic configuration information and exit
-#       --mode=MODE          use operation mode MODE
-#       --preserve-dup-deps  don't remove duplicate dependency libraries
-#       --quiet, --silent    don't print informational messages
-#       --no-quiet, --no-silent
-#                            print informational messages (default)
-#       --no-warn            don't display warning messages
-#       --tag=TAG            use configuration variables from tag TAG
-#   -v, --verbose            print more informational messages than default
-#       --no-verbose         don't print the extra informational messages
-#       --version            print version information
-#   -h, --help, --help-all   print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-#         clean              remove files from the build directory
-#         compile            compile a source file into a libtool object
-#         execute            automatically set library path, then run a program
-#         finish             complete the installation of libtool libraries
-#         install            install libraries or executables
-#         link               create a library or an executable
-#         uninstall          remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.  When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-#         host-triplet:	$host
-#         shell:		$SHELL
-#         compiler:		$LTCC
-#         compiler flags:		$LTCFLAGS
-#         linker:		$LD (gnu? $with_gnu_ld)
-#         $progname:	(GNU libtool) 2.4.2 Debian-2.4.2-1.11
-#         automake:	$automake_version
-#         autoconf:	$autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
 
 PROGRAM=libtool
 PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.11"
-TIMESTAMP=""
-package_revision=1.3337
+VERSION="2.4.6 Debian-2.4.6-0.1"
+package_revision=2.4.6
 
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+#   . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
   emulate sh
   NULLCMD=:
-  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
 else
-  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
 fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
-  eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
 
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 do
-  eval "if test \"\${$lt_var+set}\" = set; then
-          save_$lt_var=\$$lt_var
-          $lt_var=C
-	  export $lt_var
-	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
-	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+  eval "if test set = \"\${$_G_var+set}\"; then
+          save_$_G_var=\$$_G_var
+          $_G_var=C
+	  export $_G_var
+	  _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+	  _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
 	fi"
 done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
 
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp	$nl"
+
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
 
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
 
 
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+    test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+    _G_progs_list=$1
+    _G_check_func=$2
+    _G_PATH=${3-"$PATH"}
+
+    _G_path_prog_max=0
+    _G_path_prog_found=false
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+    for _G_dir in $_G_PATH; do
+      IFS=$_G_save_IFS
+      test -z "$_G_dir" && _G_dir=.
+      for _G_prog_name in $_G_progs_list; do
+        for _exeext in '' .EXE; do
+          _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+          func_executable_p "$_G_path_prog" || continue
+          case `"$_G_path_prog" --version 2>&1` in
+            *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+            *)     $_G_check_func $_G_path_prog
+		   func_path_progs_result=$func_check_prog_result
+		   ;;
+          esac
+          $_G_path_prog_found && break 3
+        done
+      done
+    done
+    IFS=$_G_save_IFS
+    test -z "$func_path_progs_result" && {
+      echo "no acceptable sed could be found in \$PATH" >&2
+      exit 1
+    }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+  _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+  for _G_i in 1 2 3 4 5 6 7; do
+    _G_sed_script=$_G_sed_script$nl$_G_sed_script
+  done
+  echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+  _G_sed_script=
+
+  func_check_prog_sed ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo '' >> conftest.nl
+      "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  rm -f conftest.sed
+  SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+  func_check_prog_grep ()
+  {
+    _G_path_prog=$1
+
+    _G_count=0
+    _G_path_prog_max=0
+    printf 0123456789 >conftest.in
+    while :
+    do
+      cat conftest.in conftest.in >conftest.tmp
+      mv conftest.tmp conftest.in
+      cp conftest.in conftest.nl
+      echo 'GREP' >> conftest.nl
+      "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+      diff conftest.out conftest.nl >/dev/null 2>&1 || break
+      _G_count=`expr $_G_count + 1`
+      if test "$_G_count" -gt "$_G_path_prog_max"; then
+        # Best one so far, save it but keep looking for a better one
+        func_check_prog_result=$_G_path_prog
+        _G_path_prog_max=$_G_count
+      fi
+      # 10*(2^10) chars as input seems more than enough
+      test 10 -lt "$_G_count" && break
+    done
+    rm -f conftest.in conftest.tmp conftest.nl conftest.out
+  }
+
+  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables.  These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
 
 : ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
 : ${MAKE="make"}
 : ${MKDIR="mkdir"}
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" 	$lt_nl"
 
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
 
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
-    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-} # func_dirname may be replaced by extended shell implementation
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
 
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
 
-# func_basename file
-func_basename ()
-{
-    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
 
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-#   dirname:  Compute the dirname of FILE.  If nonempty,
-#             add APPEND to the result, otherwise set result
-#             to NONDIR_REPLACEMENT.
-#             value returned in "$func_dirname_result"
-#   basename: Compute filename of FILE.
-#             value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
-    # Extract subdirectory from the argument.
-    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
-    if test "X$func_dirname_result" = "X${1}"; then
-      func_dirname_result="${3}"
-    else
-      func_dirname_result="$func_dirname_result${2}"
-    fi
-    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
 
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same.  If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion.  Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'.  '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+  s/$_G_bs4/&\\
+/g
+  s/^$_G_bs2$_G_dollar/$_G_bs&/
+  s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+  s/\n//g"
 
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
-    case ${2} in
-      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
-    esac
-} # func_stripname may be replaced by extended shell implementation
 
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
 
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
-		s@/\./@/@g
-		t dotsl
-		s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
 
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-#             value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
-  # Start from root dir and reassemble the path.
-  func_normal_abspath_result=
-  func_normal_abspath_tpath=$1
-  func_normal_abspath_altnamespace=
-  case $func_normal_abspath_tpath in
-    "")
-      # Empty path, that just means $cwd.
-      func_stripname '' '/' "`pwd`"
-      func_normal_abspath_result=$func_stripname_result
-      return
-    ;;
-    # The next three entries are used to spot a run of precisely
-    # two leading slashes without using negated character classes;
-    # we take advantage of case's first-match behaviour.
-    ///*)
-      # Unusual form of absolute path, do nothing.
-    ;;
-    //*)
-      # Not necessarily an ordinary path; POSIX reserves leading '//'
-      # and for example Cygwin uses it to access remote file shares
-      # over CIFS/SMB, so we conserve a leading double slash if found.
-      func_normal_abspath_altnamespace=/
-    ;;
-    /*)
-      # Absolute path, do nothing.
-    ;;
-    *)
-      # Relative path, prepend $cwd.
-      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
-    ;;
-  esac
-  # Cancel out all the simple stuff to save iterations.  We also want
-  # the path to end with a slash for ease of parsing, so make sure
-  # there is one (and only one) here.
-  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
-  while :; do
-    # Processed it all yet?
-    if test "$func_normal_abspath_tpath" = / ; then
-      # If we ascended to the root using ".." the result may be empty now.
-      if test -z "$func_normal_abspath_result" ; then
-        func_normal_abspath_result=/
-      fi
-      break
-    fi
-    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcar"`
-    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-        -e "$pathcdr"`
-    # Figure out what to do with it
-    case $func_normal_abspath_tcomponent in
-      "")
-        # Trailing empty path component, ignore it.
-      ;;
-      ..)
-        # Parent dir; strip last assembled component from result.
-        func_dirname "$func_normal_abspath_result"
-        func_normal_abspath_result=$func_dirname_result
-      ;;
-      *)
-        # Actual path component, append it.
-        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
-      ;;
-    esac
-  done
-  # Restore leading double-slash if one was found on entry.
-  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
 
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-#             value returned in "$func_relative_path_result"
-func_relative_path ()
-{
-  func_relative_path_result=
-  func_normal_abspath "$1"
-  func_relative_path_tlibdir=$func_normal_abspath_result
-  func_normal_abspath "$2"
-  func_relative_path_tbindir=$func_normal_abspath_result
-
-  # Ascend the tree starting from libdir
-  while :; do
-    # check if we have found a prefix of bindir
-    case $func_relative_path_tbindir in
-      $func_relative_path_tlibdir)
-        # found an exact match
-        func_relative_path_tcancelled=
-        break
-        ;;
-      $func_relative_path_tlibdir*)
-        # found a matching prefix
-        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
-        func_relative_path_tcancelled=$func_stripname_result
-        if test -z "$func_relative_path_result"; then
-          func_relative_path_result=.
-        fi
-        break
-        ;;
-      *)
-        func_dirname $func_relative_path_tlibdir
-        func_relative_path_tlibdir=${func_dirname_result}
-        if test "x$func_relative_path_tlibdir" = x ; then
-          # Have to descend all the way to the root!
-          func_relative_path_result=../$func_relative_path_result
-          func_relative_path_tcancelled=$func_relative_path_tbindir
-          break
-        fi
-        func_relative_path_result=../$func_relative_path_result
-        ;;
-    esac
-  done
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+#    debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
 
-  # Now calculate path; take care to avoid doubling-up slashes.
-  func_stripname '' '/' "$func_relative_path_result"
-  func_relative_path_result=$func_stripname_result
-  func_stripname '/' '/' "$func_relative_path_tcancelled"
-  if test "x$func_stripname_result" != x ; then
-    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
-  fi
+# By convention, finish your script with:
+#
+#    exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
 
-  # Normalisation. If bindir is libdir, return empty string,
-  # else relative path ending with a slash; either way, target
-  # file name can be directly appended.
-  if test ! -z "$func_relative_path_result"; then
-    func_stripname './' '' "$func_relative_path_result/"
-    func_relative_path_result=$func_stripname_result
-  fi
-}
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
 
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
 
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
 case $progpath in
   [\\/]*|[A-Za-z]:\\*) ;;
   *[\\/]*)
-     progdir=$func_dirname_result
+     progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
      progdir=`cd "$progdir" && pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
   *)
-     save_IFS="$IFS"
+     _G_IFS=$IFS
      IFS=${PATH_SEPARATOR-:}
      for progdir in $PATH; do
-       IFS="$save_IFS"
+       IFS=$_G_IFS
        test -x "$progdir/$progname" && break
      done
-     IFS="$save_IFS"
+     IFS=$_G_IFS
      test -n "$progdir" || progdir=`pwd`
-     progpath="$progdir/$progname"
+     progpath=$progdir/$progname
      ;;
 esac
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
 
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
 
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes.  A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
-  s/$bs4/&\\
-/g
-  s/^$bs2$dollar/$bs&/
-  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
-  s/\n//g"
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
 
-# Standard options:
 opt_dry_run=false
-opt_help=false
 opt_quiet=false
 opt_verbose=false
-opt_warning=:
 
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
-}
+# Categories 'all' and 'none' are always available.  Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
 
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
-    $opt_verbose && func_echo ${1+"$@"}
+# By default, display warnings according to 'opt_warning_types'.  Set
+# 'warning_func'  to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
 
-    # A bug in bash halts the script if the last line of a function
-    # fails when set -e is in force, so we need another command to
-    # work around that:
-    :
-}
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
 
-# func_echo_all arg...
-# Invoke $ECHO with all args, space-separated.
-func_echo_all ()
-{
-    $ECHO "$*"
-}
 
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
-    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
-}
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
 
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
-    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
 
-    # bash bug again:
-    :
-}
 
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
 {
-    func_error ${1+"$@"}
-    exit $EXIT_FAILURE
-}
+    $debug_cmd
+
+    test -t 1 && {
+      # COLORTERM and USE_ANSI_COLORS environment variables take
+      # precedence, because most terminfo databases neglect to describe
+      # whether color sequences are supported.
+      test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+      if test 1 = "$USE_ANSI_COLORS"; then
+        # Standard ANSI escape sequences
+        tc_reset=''
+        tc_bold='';   tc_standout=''
+        tc_red='';   tc_green=''
+        tc_blue='';  tc_cyan=''
+      else
+        # Otherwise trust the terminfo database after all.
+        test -n "`tput sgr0 2>/dev/null`" && {
+          tc_reset=`tput sgr0`
+          test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+          tc_standout=$tc_bold
+          test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+          test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+          test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+          test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+          test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+        }
+      fi
+    }
 
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
-    func_error ${1+"$@"}
-    func_fatal_error "$help"
+    require_term_colors=:
 }
-help="Try \`$progname --help' for more information."  ## default
 
 
-# func_grep expression filename
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+  # We should try to minimise forks, especially on Windows where they are
+  # unreasonably slow, so skip the feature probes when bash or zsh are
+  # being used:
+  if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+    : ${_G_HAVE_ARITH_OP="yes"}
+    : ${_G_HAVE_XSI_OPS="yes"}
+    # The += operator was introduced in bash 3.1
+    case $BASH_VERSION in
+      [12].* | 3.0 | 3.0*) ;;
+      *)
+        : ${_G_HAVE_PLUSEQ_OP="yes"}
+        ;;
+    esac
+  fi
+
+  # _G_HAVE_PLUSEQ_OP
+  # Can be empty, in which case the shell is probed, "yes" if += is
+  # useable or anything else if it does not work.
+  test -z "$_G_HAVE_PLUSEQ_OP" \
+    && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+    && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_append ()
+  {
+    $debug_cmd
+
+    eval "$1+=\$2"
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_append ()
+  {
+    $debug_cmd
+
+    eval "$1=\$$1\$2"
+  }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+  eval 'func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1+=\\ \$func_quote_for_eval_result"
+  }'
+else
+  func_append_quoted ()
+  {
+    $debug_cmd
+
+    func_quote_for_eval "$2"
+    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+  }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE.  For example:
+#
+#   func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
+{
+    $debug_cmd
+
+    eval _G_current_value='`$ECHO $'$1'`'
+    _G_delim=`expr "$2" : '\(.\)'`
+
+    case $_G_delim$_G_current_value$_G_delim in
+      *"$2$_G_delim"*) ;;
+      *) func_append "$@" ;;
+    esac
+}
+
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+  test -z "$_G_HAVE_ARITH_OP" \
+    && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+    && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+  eval 'func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=$(( $* ))
+  }'
+else
+  func_arith ()
+  {
+    $debug_cmd
+
+    func_arith_result=`expr "$@"`
+  }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  # If this shell supports suffix pattern removal, then use it to avoid
+  # forking. Hide the definitions single quotes in case the shell chokes
+  # on unsupported syntax...
+  _b='func_basename_result=${1##*/}'
+  _d='case $1 in
+        */*) func_dirname_result=${1%/*}$2 ;;
+        *  ) func_dirname_result=$3        ;;
+      esac'
+
+else
+  # ...otherwise fall back to using sed.
+  _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+  _d='func_dirname_result=`$ECHO "$1"  |$SED "$sed_dirname"`
+      if test "X$func_dirname_result" = "X$1"; then
+        func_dirname_result=$3
+      else
+        func_append func_dirname_result "$2"
+      fi'
+fi
+
+eval 'func_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+    $debug_cmd
+
+    '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+    $debug_cmd
+
+    '"$_b"'
+    '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+    $debug_cmd
+
+    _G_message=$*
+
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    _G_infix=$1; shift
+    _G_indent=$_G_infix
+    _G_prefix="$progname: $_G_infix: "
+    _G_message=$*
+
+    # Strip color escape sequences before counting printable length
+    for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+    do
+      test -n "$_G_tc" && {
+        _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+        _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+      }
+    done
+    _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`"  " ## exclude from sc_prohibit_nested_quotes
+
+    func_echo_infix_1_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_infix_1_IFS
+      $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+      _G_prefix=$_G_indent
+    done
+    IFS=$func_echo_infix_1_IFS
+}
+
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "  $tc_standout${tc_red}error$tc_reset" "$*" >&2
+}
+
+
+# func_fatal_error ARG...
+# -----------------------
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    $debug_cmd
+
+    func_error "$*"
+    exit $EXIT_FAILURE
+}
+
+
+# func_grep EXPRESSION FILENAME
+# -----------------------------
 # Check whether EXPRESSION matches any line of FILENAME, without output.
 func_grep ()
 {
+    $debug_cmd
+
     $GREP "$1" "$2" >/dev/null 2>&1
 }
 
 
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+  test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=${#1}
+  }'
+else
+  func_len ()
+  {
+    $debug_cmd
+
+    func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+  }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
 # Make sure the entire path to DIRECTORY-PATH is available.
 func_mkdir_p ()
 {
-    my_directory_path="$1"
-    my_dir_list=
+    $debug_cmd
 
-    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+    _G_directory_path=$1
+    _G_dir_list=
 
-      # Protect directory names starting with `-'
-      case $my_directory_path in
-        -*) my_directory_path="./$my_directory_path" ;;
+    if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+      # Protect directory names starting with '-'
+      case $_G_directory_path in
+        -*) _G_directory_path=./$_G_directory_path ;;
       esac
 
       # While some portion of DIR does not yet exist...
-      while test ! -d "$my_directory_path"; do
+      while test ! -d "$_G_directory_path"; do
         # ...make a list in topmost first order.  Use a colon delimited
 	# list incase some portion of path contains whitespace.
-        my_dir_list="$my_directory_path:$my_dir_list"
+        _G_dir_list=$_G_directory_path:$_G_dir_list
 
         # If the last portion added has no slash in it, the list is done
-        case $my_directory_path in */*) ;; *) break ;; esac
+        case $_G_directory_path in */*) ;; *) break ;; esac
 
         # ...otherwise throw away the child directory and loop
-        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+        _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
       done
-      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+      _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
 
-      save_mkdir_p_IFS="$IFS"; IFS=':'
-      for my_dir in $my_dir_list; do
-	IFS="$save_mkdir_p_IFS"
-        # mkdir can fail with a `File exist' error if two processes
+      func_mkdir_p_IFS=$IFS; IFS=:
+      for _G_dir in $_G_dir_list; do
+	IFS=$func_mkdir_p_IFS
+        # mkdir can fail with a 'File exist' error if two processes
         # try to create one of the directories concurrently.  Don't
         # stop in that case!
-        $MKDIR "$my_dir" 2>/dev/null || :
+        $MKDIR "$_G_dir" 2>/dev/null || :
       done
-      IFS="$save_mkdir_p_IFS"
+      IFS=$func_mkdir_p_IFS
 
       # Bail out if we (or some other process) failed to create a directory.
-      test -d "$my_directory_path" || \
-        func_fatal_error "Failed to create \`$1'"
+      test -d "$_G_directory_path" || \
+        func_fatal_error "Failed to create '$1'"
     fi
 }
 
 
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
 # Make a temporary directory that won't clash with other running
 # libtool processes, and avoids race conditions if possible.  If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
 func_mktempdir ()
 {
-    my_template="${TMPDIR-/tmp}/${1-$progname}"
+    $debug_cmd
+
+    _G_template=${TMPDIR-/tmp}/${1-$progname}
 
-    if test "$opt_dry_run" = ":"; then
+    if test : = "$opt_dry_run"; then
       # Return a directory name, but don't create it in dry-run mode
-      my_tmpdir="${my_template}-$$"
+      _G_tmpdir=$_G_template-$$
     else
 
       # If mktemp works, use that first and foremost
-      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+      _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
 
-      if test ! -d "$my_tmpdir"; then
+      if test ! -d "$_G_tmpdir"; then
         # Failing that, at least try and use $RANDOM to avoid a race
-        my_tmpdir="${my_template}-${RANDOM-0}$$"
+        _G_tmpdir=$_G_template-${RANDOM-0}$$
 
-        save_mktempdir_umask=`umask`
+        func_mktempdir_umask=`umask`
         umask 0077
-        $MKDIR "$my_tmpdir"
-        umask $save_mktempdir_umask
+        $MKDIR "$_G_tmpdir"
+        umask $func_mktempdir_umask
       fi
 
       # If we're not in dry-run mode, bomb out on failure
-      test -d "$my_tmpdir" || \
-        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+      test -d "$_G_tmpdir" || \
+        func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
+    fi
+
+    $ECHO "$_G_tmpdir"
+}
+
+
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
+{
+    $debug_cmd
+
+    # These SED scripts presuppose an absolute path with a trailing slash.
+    _G_pathcar='s|^/\([^/]*\).*$|\1|'
+    _G_pathcdr='s|^/[^/]*||'
+    _G_removedotparts=':dotsl
+		s|/\./|/|g
+		t dotsl
+		s|/\.$|/|'
+    _G_collapseslashes='s|/\{1,\}|/|g'
+    _G_finalslash='s|/*$|/|'
+
+    # Start from root dir and reassemble the path.
+    func_normal_abspath_result=
+    func_normal_abspath_tpath=$1
+    func_normal_abspath_altnamespace=
+    case $func_normal_abspath_tpath in
+      "")
+        # Empty path, that just means $cwd.
+        func_stripname '' '/' "`pwd`"
+        func_normal_abspath_result=$func_stripname_result
+        return
+        ;;
+      # The next three entries are used to spot a run of precisely
+      # two leading slashes without using negated character classes;
+      # we take advantage of case's first-match behaviour.
+      ///*)
+        # Unusual form of absolute path, do nothing.
+        ;;
+      //*)
+        # Not necessarily an ordinary path; POSIX reserves leading '//'
+        # and for example Cygwin uses it to access remote file shares
+        # over CIFS/SMB, so we conserve a leading double slash if found.
+        func_normal_abspath_altnamespace=/
+        ;;
+      /*)
+        # Absolute path, do nothing.
+        ;;
+      *)
+        # Relative path, prepend $cwd.
+        func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+        ;;
+    esac
+
+    # Cancel out all the simple stuff to save iterations.  We also want
+    # the path to end with a slash for ease of parsing, so make sure
+    # there is one (and only one) here.
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+    while :; do
+      # Processed it all yet?
+      if test / = "$func_normal_abspath_tpath"; then
+        # If we ascended to the root using ".." the result may be empty now.
+        if test -z "$func_normal_abspath_result"; then
+          func_normal_abspath_result=/
+        fi
+        break
+      fi
+      func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcar"`
+      func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+          -e "$_G_pathcdr"`
+      # Figure out what to do with it
+      case $func_normal_abspath_tcomponent in
+        "")
+          # Trailing empty path component, ignore it.
+          ;;
+        ..)
+          # Parent dir; strip last assembled component from result.
+          func_dirname "$func_normal_abspath_result"
+          func_normal_abspath_result=$func_dirname_result
+          ;;
+        *)
+          # Actual path component, append it.
+          func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+          ;;
+      esac
+    done
+    # Restore leading double-slash if one was found on entry.
+    func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+    $debug_cmd
+
+    $opt_quiet || func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+    $debug_cmd
+
+    func_relative_path_result=
+    func_normal_abspath "$1"
+    func_relative_path_tlibdir=$func_normal_abspath_result
+    func_normal_abspath "$2"
+    func_relative_path_tbindir=$func_normal_abspath_result
+
+    # Ascend the tree starting from libdir
+    while :; do
+      # check if we have found a prefix of bindir
+      case $func_relative_path_tbindir in
+        $func_relative_path_tlibdir)
+          # found an exact match
+          func_relative_path_tcancelled=
+          break
+          ;;
+        $func_relative_path_tlibdir*)
+          # found a matching prefix
+          func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+          func_relative_path_tcancelled=$func_stripname_result
+          if test -z "$func_relative_path_result"; then
+            func_relative_path_result=.
+          fi
+          break
+          ;;
+        *)
+          func_dirname $func_relative_path_tlibdir
+          func_relative_path_tlibdir=$func_dirname_result
+          if test -z "$func_relative_path_tlibdir"; then
+            # Have to descend all the way to the root!
+            func_relative_path_result=../$func_relative_path_result
+            func_relative_path_tcancelled=$func_relative_path_tbindir
+            break
+          fi
+          func_relative_path_result=../$func_relative_path_result
+          ;;
+      esac
+    done
+
+    # Now calculate path; take care to avoid doubling-up slashes.
+    func_stripname '' '/' "$func_relative_path_result"
+    func_relative_path_result=$func_stripname_result
+    func_stripname '/' '/' "$func_relative_path_tcancelled"
+    if test -n "$func_stripname_result"; then
+      func_append func_relative_path_result "/$func_stripname_result"
+    fi
+
+    # Normalisation. If bindir is libdir, return '.' else relative path.
+    if test -n "$func_relative_path_result"; then
+      func_stripname './' '' "$func_relative_path_result"
+      func_relative_path_result=$func_stripname_result
     fi
 
-    $ECHO "$my_tmpdir"
+    test -n "$func_relative_path_result" || func_relative_path_result=.
+
+    :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+#   i) func_quote_for_eval_result
+#      double-quoted, suitable for a subsequent eval
+#  ii) func_quote_for_eval_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.
+func_quote_for_eval ()
+{
+    $debug_cmd
+
+    func_quote_for_eval_unquoted_result=
+    func_quote_for_eval_result=
+    while test 0 -lt $#; do
+      case $1 in
+        *[\\\`\"\$]*)
+	  _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+        *)
+          _G_unquoted_arg=$1 ;;
+      esac
+      if test -n "$func_quote_for_eval_unquoted_result"; then
+	func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+      else
+        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+      fi
+
+      case $_G_unquoted_arg in
+        # Double-quote args containing shell metacharacters to delay
+        # word splitting, command substitution and variable expansion
+        # for a subsequent eval.
+        # Many Bourne shells cannot handle close brackets correctly
+        # in scan sets, so we specify it separately.
+        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+          _G_quoted_arg=\"$_G_unquoted_arg\"
+          ;;
+        *)
+          _G_quoted_arg=$_G_unquoted_arg
+	  ;;
+      esac
+
+      if test -n "$func_quote_for_eval_result"; then
+	func_append func_quote_for_eval_result " $_G_quoted_arg"
+      else
+        func_append func_quote_for_eval_result "$_G_quoted_arg"
+      fi
+      shift
+    done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    $debug_cmd
+
+    case $1 in
+      *[\\\`\"]*)
+	_G_arg=`$ECHO "$1" | $SED \
+	    -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        _G_arg=$1 ;;
+    esac
+
+    case $_G_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        _G_arg=\"$_G_arg\"
+        ;;
+    esac
+
+    func_quote_for_expand_result=$_G_arg
+}
+
+
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_stripname ()
+  {
+    $debug_cmd
+
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary variable first.
+    func_stripname_result=$3
+    func_stripname_result=${func_stripname_result#"$1"}
+    func_stripname_result=${func_stripname_result%"$2"}
+  }'
+else
+  func_stripname ()
+  {
+    $debug_cmd
+
+    case $2 in
+      .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+      *)  func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+    esac
+  }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    func_quote_for_expand "$_G_cmd"
+    eval "func_notquiet $func_quote_for_expand_result"
+
+    $opt_dry_run || {
+      eval "$_G_cmd"
+      _G_status=$?
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fail_exp=${2-':'}
+
+    $opt_quiet || {
+      func_quote_for_expand "$_G_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    $opt_dry_run || {
+      eval "$_G_user_locale
+	    $_G_cmd"
+      _G_status=$?
+      eval "$_G_safe_locale"
+      if test 0 -ne "$_G_status"; then
+	eval "(exit $_G_status); $_G_fail_exp"
+      fi
+    }
+}
+
+
+# func_tr_sh
+# ----------
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+    $debug_cmd
+
+    case $1 in
+    [0-9]* | *[!a-zA-Z0-9_]*)
+      func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+      ;;
+    * )
+      func_tr_sh_result=$1
+      ;;
+    esac
+}
+
+
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $debug_cmd
+
+    $opt_verbose && func_echo "$*"
+
+    :
+}
+
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
+{
+    $debug_cmd
+
+    $require_term_colors
+
+    func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
+}
+
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+    $debug_cmd
+
+    # CATEGORY must be in the warning_categories list!
+    case " $warning_categories " in
+      *" $1 "*) ;;
+      *) func_internal_error "invalid warning category '$1'" ;;
+    esac
+
+    _G_category=$1
+    shift
+
+    case " $opt_warning_types " in
+      *" $_G_category "*) $warning_func ${1+"$@"} ;;
+    esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+    $debug_cmd
+
+    printf '%s\n%s\n' "$1" "$2" \
+      | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false.  Use it like this:
+#
+#  func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+    $debug_cmd
+
+    test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary@gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+#   #!/bin/sh
+#   . relative/path/to/funclib.sh
+#   . relative/path/to/options-parser
+#   scriptversion=1.0
+#   func_options ${1+"$@"}
+#   eval set dummy "$func_options_result"; shift
+#   ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'.  Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+       --debug        enable verbose shell tracing
+   -W, --warnings=CATEGORY
+                      report the warnings falling in CATEGORY [all]
+   -v, --verbose      verbosely report processing
+       --version      print version information and exit
+   -h, --help         print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+       'all'          show all warnings
+       'none'         turn off all the warnings
+       'error'        warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code.  A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+    $debug_cmd
+
+    func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns.  FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not accept hook functions." ;;
+    esac
+
+    eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+    $debug_cmd
+
+    eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+    $debug_cmd
+
+    case " $hookable_fns " in
+      *" $1 "*) ;;
+      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+    esac
+
+    eval _G_hook_fns=\$$1_hooks; shift
+
+    for _G_hook in $_G_hook_fns; do
+      eval $_G_hook '"$@"'
+
+      # store returned options list back into positional
+      # parameters for next 'cmd' execution.
+      eval _G_hook_result=\$${_G_hook}_result
+      eval set dummy "$_G_hook_result"; shift
+    done
+
+    func_quote_for_eval ${1+"$@"}
+    func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'.  Like this:
+#
+#    my_options_prep ()
+#    {
+#        $debug_cmd
+#
+#        # Extend the existing usage message.
+#        usage_message=$usage_message'
+#      -s, --silent       don'\''t print informational messages
+#    '
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_options_prep_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_options_prep my_options_prep
+#
+#
+#    my_silent_option ()
+#    {
+#        $debug_cmd
+#
+#        # Note that for efficiency, we parse as many options as we can
+#        # recognise in a loop before passing the remainder back to the
+#        # caller on the first unrecognised argument we encounter.
+#        while test $# -gt 0; do
+#          opt=$1; shift
+#          case $opt in
+#            --silent|-s) opt_silent=: ;;
+#            # Separate non-argument short options:
+#            -s*)         func_split_short_opt "$_G_opt"
+#                         set dummy "$func_split_short_opt_name" \
+#                             "-$func_split_short_opt_arg" ${1+"$@"}
+#                         shift
+#                         ;;
+#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#          esac
+#        done
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_silent_option_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_parse_options my_silent_option
+#
+#
+#    my_option_validation ()
+#    {
+#        $debug_cmd
+#
+#        $opt_silent && $opt_verbose && func_fatal_help "\
+#    '--silent' and '--verbose' options are mutually exclusive."
+#
+#        func_quote_for_eval ${1+"$@"}
+#        my_option_validation_result=$func_quote_for_eval_result
+#    }
+#    func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse.  It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+    $debug_cmd
+
+    func_options_prep ${1+"$@"}
+    eval func_parse_options \
+        ${func_options_prep_result+"$func_options_prep_result"}
+    eval func_validate_options \
+        ${func_parse_options_result+"$func_parse_options_result"}
+
+    eval func_run_hooks func_options \
+        ${func_validate_options_result+"$func_validate_options_result"}
+
+    # save modified positional parameters for caller
+    func_options_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters.  If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
 {
-    case $1 in
-      *[\\\`\"\$]*)
-	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
-      *)
-        func_quote_for_eval_unquoted_result="$1" ;;
-    esac
+    $debug_cmd
 
-    case $func_quote_for_eval_unquoted_result in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting, command substitution and and variable
-      # expansion for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
-        ;;
-      *)
-        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
-    esac
+    # Option defaults:
+    opt_verbose=false
+    opt_warning_types=
+
+    func_run_hooks func_options_prep ${1+"$@"}
+
+    # save modified positional parameters for caller
+    func_options_prep_result=$func_run_hooks_result
 }
 
 
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
 {
-    case $1 in
-      *[\\\`\"]*)
-	my_arg=`$ECHO "$1" | $SED \
-	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        my_arg="$1" ;;
-    esac
+    $debug_cmd
 
-    case $my_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
-        my_arg="\"$my_arg\""
-        ;;
-    esac
+    func_parse_options_result=
 
-    func_quote_for_expand_result="$my_arg"
-}
+    # this just eases exit handling
+    while test $# -gt 0; do
+      # Defer to hook functions for initial option parsing, so they
+      # get priority in the event of reusing an option name.
+      func_run_hooks func_parse_options ${1+"$@"}
 
+      # Adjust func_parse_options positional parameters to match
+      eval set dummy "$func_run_hooks_result"; shift
 
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+      # Break out of the loop if we already parsed every option.
+      test $# -gt 0 || break
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --debug|-x)   debug_cmd='set -x'
+                      func_echo "enabling shell trace mode"
+                      $debug_cmd
+                      ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                      set dummy --warnings none ${1+"$@"}
+                      shift
+		      ;;
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$my_cmd"
-      my_status=$?
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
+        --warnings|--warning|-W)
+                      test $# = 0 && func_missing_arg $_G_opt && break
+                      case " $warning_categories $1" in
+                        *" $1 "*)
+                          # trailing space prevents matching last $1 above
+                          func_append_uniq opt_warning_types " $1"
+                          ;;
+                        *all)
+                          opt_warning_types=$warning_categories
+                          ;;
+                        *none)
+                          opt_warning_types=none
+                          warning_func=:
+                          ;;
+                        *error)
+                          opt_warning_types=$warning_categories
+                          warning_func=func_fatal_error
+                          ;;
+                        *)
+                          func_fatal_error \
+                             "unsupported warning category: '$1'"
+                          ;;
+                      esac
+                      shift
+                      ;;
+
+        --verbose|-v) opt_verbose=: ;;
+        --version)    func_version ;;
+        -\?|-h)       func_usage ;;
+        --help)       func_help ;;
+
+	# Separate optargs to long options (plugins may need this):
+	--*=*)        func_split_equals "$_G_opt"
+	              set dummy "$func_split_equals_lhs" \
+                          "$func_split_equals_rhs" ${1+"$@"}
+                      shift
+                      ;;
+
+       # Separate optargs to short options:
+        -W*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        # Separate non-argument short options:
+        -\?*|-h*|-v*|-x*)
+                      func_split_short_opt "$_G_opt"
+                      set dummy "$func_split_short_opt_name" \
+                          "-$func_split_short_opt_arg" ${1+"$@"}
+                      shift
+                      ;;
+
+        --)           break ;;
+        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+      esac
+    done
+
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    func_parse_options_result=$func_quote_for_eval_result
 }
 
 
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
-# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.  Use the saved locale for evaluation.
-func_show_eval_locale ()
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
 {
-    my_cmd="$1"
-    my_fail_exp="${2-:}"
+    $debug_cmd
 
-    ${opt_silent-false} || {
-      func_quote_for_expand "$my_cmd"
-      eval "func_echo $func_quote_for_expand_result"
-    }
+    # Display all warnings if -W was not given.
+    test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
-    if ${opt_dry_run-false}; then :; else
-      eval "$lt_user_locale
-	    $my_cmd"
-      my_status=$?
-      eval "$lt_safe_locale"
-      if test "$my_status" -eq 0; then :; else
-	eval "(exit $my_status); $my_fail_exp"
-      fi
-    fi
-}
+    func_run_hooks func_validate_options ${1+"$@"}
 
-# func_tr_sh
-# Turn $1 into a string suitable for a shell variable name.
-# Result is stored in $func_tr_sh_result.  All characters
-# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
-# if $1 begins with a digit, a '_' is prepended as well.
-func_tr_sh ()
-{
-  case $1 in
-  [0-9]* | *[!a-zA-Z0-9_]*)
-    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
-    ;;
-  * )
-    func_tr_sh_result=$1
-    ;;
-  esac
+    # Bail if the options were screwed!
+    $exit_cmd $EXIT_FAILURE
+
+    # save modified positional parameters for caller
+    func_validate_options_result=$func_run_hooks_result
 }
 
 
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
-    $opt_debug
 
-    $SED -n '/(C)/!b go
-	:more
-	/\./!{
-	  N
-	  s/\n# / /
-	  b more
-	}
-	:go
-	/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //
-	s/^# *$//
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
-        p
-     }' < "$progpath"
-     exit $?
-}
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
 
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
 {
-    $opt_debug
+    $debug_cmd
 
-    $SED -n '/^# Usage:/,/^#  *.*--help/ {
-        s/^# //
-	s/^# *$//
-	s/\$progname/'$progname'/
-	p
-    }' < "$progpath"
-    echo
-    $ECHO "run \`$progname --help | more' for full usage"
-    exit $?
+    eval \$ECHO \""Usage: $usage"\"
+    eval \$ECHO \""$fatal_help"\"
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
 }
 
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
 func_help ()
 {
-    $opt_debug
-
-    $SED -n '/^# Usage:/,/# Report bugs to/ {
-	:print
-        s/^# //
-	s/^# *$//
-	s*\$progname*'$progname'*
-	s*\$host*'"$host"'*
-	s*\$SHELL*'"$SHELL"'*
-	s*\$LTCC*'"$LTCC"'*
-	s*\$LTCFLAGS*'"$LTCFLAGS"'*
-	s*\$LD*'"$LD"'*
-	s/\$with_gnu_ld/'"$with_gnu_ld"'/
-	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
-	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
-	p
-	d
-     }
-     /^# .* home page:/b print
-     /^# General help using/b print
-     ' < "$progpath"
-    ret=$?
-    if test -z "$1"; then
-      exit $ret
-    fi
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message"
+    exit 0
 }
 
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
 # Echo program name prefixed message to standard error and set global
 # exit_cmd.
 func_missing_arg ()
 {
-    $opt_debug
+    $debug_cmd
 
-    func_error "missing argument for $1."
+    func_error "Missing argument for '$1'."
     exit_cmd=exit
 }
 
 
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+    && (eval 'x=a/b/c;
+      test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+    && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=${1%%=*}
+      func_split_equals_rhs=${1#*=}
+      test "x$func_split_equals_lhs" = "x$1" \
+        && func_split_equals_rhs=
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_equals ()
+  {
+      $debug_cmd
+
+      func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+      func_split_equals_rhs=
+      test "x$func_split_equals_lhs" = "x$1" \
+        || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+  }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
 # Set func_split_short_opt_name and func_split_short_opt_arg shell
 # variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+  # This is an XSI compatible shell, allowing a faster implementation...
+  eval 'func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_arg=${1#??}
+      func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+  }'
+else
+  # ...otherwise fall back to using expr, which is often a shell builtin.
+  func_split_short_opt ()
+  {
+      $debug_cmd
+
+      func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+      func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+  }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
 {
-    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
-    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+    $debug_cmd
 
-    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
-    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+    func_usage_message
+    $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+    exit 0
+}
 
 
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
 {
-    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
-    my_sed_long_arg='1s/^--[^=]*=//'
+    $debug_cmd
 
-    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
-    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
+    eval \$ECHO \""Usage: $usage"\"
+    echo
+    $SED -n 's|^# ||
+        /^Written by/{
+          x;p;x
+        }
+	h
+	/^Written by/q' < "$progpath"
+    echo
+    eval \$ECHO \""$usage_message"\"
+}
 
-exit_cmd=:
 
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $debug_cmd
 
+    printf '%s\n' "$progname $scriptversion"
+    $SED -n '
+        /(C)/!b go
+        :more
+        /\./!{
+          N
+          s|\n# | |
+          b more
+        }
+        :go
+        /^# Written by /,/# warranty; / {
+          s|^# ||
+          s|^# *$||
+          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+          p
+        }
+        /^# Written by / {
+          s|^# ||
+          p
+        }
+        /^warranty; /q' < "$progpath"
 
+    exit $?
+}
 
 
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
 
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6'
 
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end.  This prevents here-documents from being
-# left over by shells.
-exec_cmd=
 
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
 {
-    eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+    $debug_cmd
 
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
-    func_quote_for_eval "${2}"
-    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+    _G_message=$*
 
+    func_echo_IFS=$IFS
+    IFS=$nl
+    for _G_line in $_G_message; do
+      IFS=$func_echo_IFS
+      $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+    done
+    IFS=$func_echo_IFS
+}
 
-# func_arith arithmetic-term...
-func_arith ()
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
 {
-    func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+    $debug_cmd
 
+    $warning_func ${1+"$@"}
+}
 
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
-    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
 
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
+
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+
+usage='$progpath [OPTION]... [MODE-ARG]...'
+
+# Short help message in response to '-h'.
+usage_message="Options:
+       --config             show all configuration variables
+       --debug              enable verbose shell tracing
+   -n, --dry-run            display commands without modifying any files
+       --features           display basic configuration information and exit
+       --mode=MODE          use operation mode MODE
+       --no-warnings        equivalent to '-Wnone'
+       --preserve-dup-deps  don't remove duplicate dependency libraries
+       --quiet, --silent    don't print informational messages
+       --tag=TAG            use configuration variables from tag TAG
+   -v, --verbose            print more informational messages than default
+       --version            print version information
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [all]
+   -h, --help, --help-all   print short, long, or detailed help message
+"
 
-# func_lo2o object
-func_lo2o ()
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
 {
-    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+    $debug_cmd
+
+    func_usage_message
+    $ECHO "$long_help_message
+
+MODE must be one of the following:
+
+       clean           remove files from the build directory
+       compile         compile a source file into a libtool object
+       execute         automatically set library path, then run a program
+       finish          complete the installation of libtool libraries
+       install         install libraries or executables
+       link            create a library or an executable
+       uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+       host-triplet:   $host
+       shell:          $SHELL
+       compiler:       $LTCC
+       compiler flags: $LTCFLAGS
+       linker:         $LD (gnu? $with_gnu_ld)
+       version:        $progname (GNU libtool) 2.4.6
+       automake:       `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+       autoconf:       `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool@gnu.org>.
+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+    exit 0
+}
 
 
-# func_xform libobj-or-source
-func_xform ()
-{
-    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+  eval 'func_lo2o ()
+  {
+    case $1 in
+      *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+      *   ) func_lo2o_result=$1               ;;
+    esac
+  }'
+
+  # func_xform LIBOBJ-OR-SOURCE
+  # ---------------------------
+  # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+  # suffix to a '.lo' libtool-object suffix.
+  eval 'func_xform ()
+  {
+    func_xform_result=${1%.*}.lo
+  }'
+else
+  # ...otherwise fall back to using sed.
+  func_lo2o ()
+  {
+    func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+  }
+
+  func_xform ()
+  {
+    func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+  }
+fi
 
 
-# func_fatal_configuration arg...
+# func_fatal_configuration ARG...
+# -------------------------------
 # Echo program name prefixed message to standard error, followed by
 # a configuration failure hint, and exit.
 func_fatal_configuration ()
 {
-    func_error ${1+"$@"}
-    func_error "See the $PACKAGE documentation for more information."
-    func_fatal_error "Fatal configuration error."
+    func__fatal_error ${1+"$@"} \
+      "See the $PACKAGE documentation for more information." \
+      "Fatal configuration error."
 }
 
 
 # func_config
+# -----------
 # Display the configuration for all the tags in this script.
 func_config ()
 {
@@ -915,17 +2149,19 @@ func_config ()
     exit $?
 }
 
+
 # func_features
+# -------------
 # Display the features supported by this script.
 func_features ()
 {
     echo "host: $host"
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       echo "enable shared libraries"
     else
       echo "disable shared libraries"
     fi
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       echo "enable static libraries"
     else
       echo "disable static libraries"
@@ -934,314 +2170,350 @@ func_features ()
     exit $?
 }
 
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
 # Verify that TAGNAME is valid, and either flag an error and exit, or
 # enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
 # variable here.
 func_enable_tag ()
 {
-  # Global variable:
-  tagname="$1"
+    # Global variable:
+    tagname=$1
 
-  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
-  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
-  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+    re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+    re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+    sed_extractcf=/$re_begincf/,/$re_endcf/p
 
-  # Validate tagname.
-  case $tagname in
-    *[!-_A-Za-z0-9,/]*)
-      func_fatal_error "invalid tag name: $tagname"
-      ;;
-  esac
+    # Validate tagname.
+    case $tagname in
+      *[!-_A-Za-z0-9,/]*)
+        func_fatal_error "invalid tag name: $tagname"
+        ;;
+    esac
 
-  # Don't test for the "default" C tag, as we know it's
-  # there but not specially marked.
-  case $tagname in
-    CC) ;;
+    # Don't test for the "default" C tag, as we know it's
+    # there but not specially marked.
+    case $tagname in
+        CC) ;;
     *)
-      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
-	taglist="$taglist $tagname"
-
-	# Evaluate the configuration.  Be careful to quote the path
-	# and the sed script, to avoid splitting on whitespace, but
-	# also don't use non-portable quotes within backquotes within
-	# quotes we have to do it in 2 steps:
-	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
-	eval "$extractedcf"
-      else
-	func_error "ignoring unknown tag $tagname"
-      fi
-      ;;
-  esac
+        if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	  taglist="$taglist $tagname"
+
+	  # Evaluate the configuration.  Be careful to quote the path
+	  # and the sed script, to avoid splitting on whitespace, but
+	  # also don't use non-portable quotes within backquotes within
+	  # quotes we have to do it in 2 steps:
+	  extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	  eval "$extractedcf"
+        else
+	  func_error "ignoring unknown tag $tagname"
+        fi
+        ;;
+    esac
 }
 
+
 # func_check_version_match
+# ------------------------
 # Ensure that we are using m4 macros, and libtool script from the same
 # release of libtool.
 func_check_version_match ()
 {
-  if test "$package_revision" != "$macro_revision"; then
-    if test "$VERSION" != "$macro_version"; then
-      if test -z "$macro_version"; then
-        cat >&2 <<_LT_EOF
+    if test "$package_revision" != "$macro_revision"; then
+      if test "$VERSION" != "$macro_version"; then
+        if test -z "$macro_version"; then
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from an older release.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      else
-        cat >&2 <<_LT_EOF
+        else
+          cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
 $progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
 $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
 $progname: and run autoconf again.
 _LT_EOF
-      fi
-    else
-      cat >&2 <<_LT_EOF
+        fi
+      else
+        cat >&2 <<_LT_EOF
 $progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
 $progname: but the definition of this LT_INIT comes from revision $macro_revision.
 $progname: You should recreate aclocal.m4 with macros from revision $package_revision
 $progname: of $PACKAGE $VERSION and run autoconf again.
 _LT_EOF
-    fi
+      fi
 
-    exit $EXIT_MISMATCH
-  fi
+      exit $EXIT_MISMATCH
+    fi
 }
 
 
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
-  shift; set dummy --mode clean ${1+"$@"}; shift
-  ;;
-compile|compil|compi|comp|com|co|c)
-  shift; set dummy --mode compile ${1+"$@"}; shift
-  ;;
-execute|execut|execu|exec|exe|ex|e)
-  shift; set dummy --mode execute ${1+"$@"}; shift
-  ;;
-finish|finis|fini|fin|fi|f)
-  shift; set dummy --mode finish ${1+"$@"}; shift
-  ;;
-install|instal|insta|inst|ins|in|i)
-  shift; set dummy --mode install ${1+"$@"}; shift
-  ;;
-link|lin|li|l)
-  shift; set dummy --mode link ${1+"$@"}; shift
-  ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
-  shift; set dummy --mode uninstall ${1+"$@"}; shift
-  ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+    $debug_mode
 
+    # Option defaults:
+    opt_config=false
+    opt_dlopen=
+    opt_dry_run=false
+    opt_help=false
+    opt_mode=
+    opt_preserve_dup_deps=false
+    opt_quiet=false
 
+    nonopt=
+    preserve_args=
 
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+    # Shorthand for --mode=foo, only valid as the first argument
+    case $1 in
+    clean|clea|cle|cl)
+      shift; set dummy --mode clean ${1+"$@"}; shift
+      ;;
+    compile|compil|compi|comp|com|co|c)
+      shift; set dummy --mode compile ${1+"$@"}; shift
+      ;;
+    execute|execut|execu|exec|exe|ex|e)
+      shift; set dummy --mode execute ${1+"$@"}; shift
+      ;;
+    finish|finis|fini|fin|fi|f)
+      shift; set dummy --mode finish ${1+"$@"}; shift
+      ;;
+    install|instal|insta|inst|ins|in|i)
+      shift; set dummy --mode install ${1+"$@"}; shift
+      ;;
+    link|lin|li|l)
+      shift; set dummy --mode link ${1+"$@"}; shift
+      ;;
+    uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+      shift; set dummy --mode uninstall ${1+"$@"}; shift
+      ;;
+    esac
+
+    # Pass back the list of options.
+    func_quote_for_eval ${1+"$@"}
+    libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
 
 
-# Parse options once, thoroughly.  This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
 {
-  # this just eases exit handling
-  while test $# -gt 0; do
-    opt="$1"
-    shift
-    case $opt in
-      --debug|-x)	opt_debug='set -x'
-			func_echo "enabling shell trace mode"
-			$opt_debug
-			;;
-      --dry-run|--dryrun|-n)
-			opt_dry_run=:
-			;;
-      --config)
-			opt_config=:
-func_config
-			;;
-      --dlopen|-dlopen)
-			optarg="$1"
-			opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
-			shift
-			;;
-      --preserve-dup-deps)
-			opt_preserve_dup_deps=:
-			;;
-      --features)
-			opt_features=:
-func_features
-			;;
-      --finish)
-			opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
-			;;
-      --help)
-			opt_help=:
-			;;
-      --help-all)
-			opt_help_all=:
-opt_help=': help-all'
-			;;
-      --mode)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_mode="$optarg"
-case $optarg in
-  # Valid mode arguments:
-  clean|compile|execute|finish|install|link|relink|uninstall) ;;
-
-  # Catch anything else as an error
-  *) func_error "invalid argument for $opt"
-     exit_cmd=exit
-     break
-     ;;
-esac
-			shift
-			;;
-      --no-silent|--no-quiet)
-			opt_silent=false
-func_append preserve_args " $opt"
-			;;
-      --no-warning|--no-warn)
-			opt_warning=false
-func_append preserve_args " $opt"
-			;;
-      --no-verbose)
-			opt_verbose=false
-func_append preserve_args " $opt"
-			;;
-      --silent|--quiet)
-			opt_silent=:
-func_append preserve_args " $opt"
-        opt_verbose=false
-			;;
-      --verbose|-v)
-			opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
-			;;
-      --tag)
-			test $# = 0 && func_missing_arg $opt && break
-			optarg="$1"
-			opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
-			shift
-			;;
-
-      -\?|-h)		func_usage				;;
-      --help)		func_help				;;
-      --version)	func_version				;;
-
-      # Separate optargs to long options:
-      --*=*)
-			func_split_long_opt "$opt"
-			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      # Separate non-argument short options:
-      -\?*|-h*|-n*|-v*)
-			func_split_short_opt "$opt"
-			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
-			shift
-			;;
-
-      --)		break					;;
-      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
-      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
-    esac
-  done
+    $debug_cmd
 
-  # Validate options:
+    # Perform our own loop to consume as many options as possible in
+    # each iteration.
+    while test $# -gt 0; do
+      _G_opt=$1
+      shift
+      case $_G_opt in
+        --dry-run|--dryrun|-n)
+                        opt_dry_run=:
+                        ;;
+
+        --config)       func_config ;;
+
+        --dlopen|-dlopen)
+                        opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+                        shift
+                        ;;
+
+        --preserve-dup-deps)
+                        opt_preserve_dup_deps=: ;;
+
+        --features)     func_features ;;
+
+        --finish)       set dummy --mode finish ${1+"$@"}; shift ;;
+
+        --help)         opt_help=: ;;
+
+        --help-all)     opt_help=': help-all' ;;
+
+        --mode)         test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_mode=$1
+                        case $1 in
+                          # Valid mode arguments:
+                          clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+                          # Catch anything else as an error
+                          *) func_error "invalid argument for $_G_opt"
+                             exit_cmd=exit
+                             break
+                             ;;
+                        esac
+                        shift
+                        ;;
+
+        --no-silent|--no-quiet)
+                        opt_quiet=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-warnings|--no-warning|--no-warn)
+                        opt_warning=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --no-verbose)
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --silent|--quiet)
+                        opt_quiet=:
+                        opt_verbose=false
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+        --tag)          test $# = 0 && func_missing_arg $_G_opt && break
+                        opt_tag=$1
+                        func_append preserve_args " $_G_opt $1"
+                        func_enable_tag "$1"
+                        shift
+                        ;;
+
+        --verbose|-v)   opt_quiet=false
+                        opt_verbose=:
+                        func_append preserve_args " $_G_opt"
+                        ;;
+
+	# An option not handled by this hook function:
+        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+      esac
+    done
 
-  # save first non-option argument
-  if test "$#" -gt 0; then
-    nonopt="$opt"
-    shift
-  fi
 
-  # preserve --debug
-  test "$opt_debug" = : || func_append preserve_args " --debug"
+    # save modified positional parameters for caller
+    func_quote_for_eval ${1+"$@"}
+    libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
 
-  case $host in
-    *cygwin* | *mingw* | *pw32* | *cegcc*)
-      # don't eliminate duplications in $postdeps and $predeps
-      opt_duplicate_compiler_generated_deps=:
-      ;;
-    *)
-      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
-      ;;
-  esac
 
-  $opt_help || {
-    # Sanity checks first:
-    func_check_version_match
 
-    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
-      func_fatal_configuration "not configured to build any kind of library"
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+    # save first non-option argument
+    if test 0 -lt $#; then
+      nonopt=$1
+      shift
     fi
 
-    # Darwin sucks
-    eval std_shrext=\"$shrext_cmds\"
+    # preserve --debug
+    test : = "$debug_cmd" || func_append preserve_args " --debug"
 
-    # Only execute mode is allowed to have -dlopen flags.
-    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
-      func_error "unrecognized option \`-dlopen'"
-      $ECHO "$help" 1>&2
-      exit $EXIT_FAILURE
-    fi
+    case $host in
+      # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+      # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+      *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+        # don't eliminate duplications in $postdeps and $predeps
+        opt_duplicate_compiler_generated_deps=:
+        ;;
+      *)
+        opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+        ;;
+    esac
 
-    # Change the help message to a mode-specific one.
-    generic_help="$help"
-    help="Try \`$progname --help --mode=$opt_mode' for more information."
-  }
+    $opt_help || {
+      # Sanity checks first:
+      func_check_version_match
+
+      test yes != "$build_libtool_libs" \
+        && test yes != "$build_old_libs" \
+        && func_fatal_configuration "not configured to build any kind of library"
+
+      # Darwin sucks
+      eval std_shrext=\"$shrext_cmds\"
+
+      # Only execute mode is allowed to have -dlopen flags.
+      if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+        func_error "unrecognized option '-dlopen'"
+        $ECHO "$help" 1>&2
+        exit $EXIT_FAILURE
+      fi
 
+      # Change the help message to a mode-specific one.
+      generic_help=$help
+      help="Try '$progname --help --mode=$opt_mode' for more information."
+    }
 
-  # Bail if the options were screwed
-  $exit_cmd $EXIT_FAILURE
+    # Pass back the unparsed argument list
+    func_quote_for_eval ${1+"$@"}
+    libtool_validate_options_result=$func_quote_for_eval_result
 }
+func_add_hook func_validate_options libtool_validate_options
 
 
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
 
 
 ## ----------- ##
 ##    Main.    ##
 ## ----------- ##
 
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+  $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
 # func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function is only a basic sanity check; it will hardly flush out
 # determined imposters.
 func_lalib_p ()
 {
     test -f "$1" &&
-      $SED -e 4q "$1" 2>/dev/null \
-        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+      $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
 # This function implements the same check as func_lalib_p without
 # resorting to external programs.  To this end, it redirects stdin and
 # closes it afterwards, without saving the original file descriptor.
 # As a safety measure, use it only where a negative result would be
-# fatal anyway.  Works if `file' does not exist.
+# fatal anyway.  Works if 'file' does not exist.
 func_lalib_unsafe_p ()
 {
     lalib_p=no
@@ -1249,13 +2521,13 @@ func_lalib_unsafe_p ()
 	for lalib_p_l in 1 2 3 4
 	do
 	    read lalib_p_line
-	    case "$lalib_p_line" in
+	    case $lalib_p_line in
 		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
 	    esac
 	done
 	exec 0<&5 5<&-
     fi
-    test "$lalib_p" = yes
+    test yes = "$lalib_p"
 }
 
 # func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@ func_lalib_unsafe_p ()
 # determined imposters.
 func_ltwrapper_script_p ()
 {
-    func_lalib_p "$1"
+    test -f "$1" &&
+      $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
 }
 
 # func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@ func_ltwrapper_scriptname ()
 {
     func_dirname_and_basename "$1" "" "."
     func_stripname '' '.exe' "$func_basename_result"
-    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
 }
 
 # func_ltwrapper_p file
@@ -1308,11 +2581,13 @@ func_ltwrapper_p ()
 # FAIL_CMD may read-access the current command in variable CMD!
 func_execute_cmds ()
 {
-    $opt_debug
+    $debug_cmd
+
     save_ifs=$IFS; IFS='~'
     for cmd in $1; do
-      IFS=$save_ifs
+      IFS=$sp$nl
       eval cmd=\"$cmd\"
+      IFS=$save_ifs
       func_show_eval "$cmd" "${2-:}"
     done
     IFS=$save_ifs
@@ -1324,10 +2599,11 @@ func_execute_cmds ()
 # Note that it is not necessary on cygwin/mingw to append a dot to
 # FILE even if both FILE and FILE.exe exist: automatic-append-.exe
 # behavior happens only for exec(3), not for open(2)!  Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
 func_source ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $1 in
     */* | *\\*)	. "$1" ;;
     *)		. "./$1" ;;
@@ -1354,10 +2630,10 @@ func_resolve_sysroot ()
 # store the result into func_replace_sysroot_result.
 func_replace_sysroot ()
 {
-  case "$lt_sysroot:$1" in
+  case $lt_sysroot:$1 in
   ?*:"$lt_sysroot"*)
     func_stripname "$lt_sysroot" '' "$1"
-    func_replace_sysroot_result="=$func_stripname_result"
+    func_replace_sysroot_result='='$func_stripname_result
     ;;
   *)
     # Including no sysroot.
@@ -1374,7 +2650,8 @@ func_replace_sysroot ()
 # arg is usually of the form 'gcc ...'
 func_infer_tag ()
 {
-    $opt_debug
+    $debug_cmd
+
     if test -n "$available_tags" && test -z "$tagname"; then
       CC_quoted=
       for arg in $CC; do
@@ -1393,7 +2670,7 @@ func_infer_tag ()
 	for z in $available_tags; do
 	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
 	    # Evaluate the configuration.
-	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
 	    CC_quoted=
 	    for arg in $CC; do
 	      # Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@ func_infer_tag ()
 	# line option must be used.
 	if test -z "$tagname"; then
 	  func_echo "unable to infer tagged configuration"
-	  func_fatal_error "specify a tag with \`--tag'"
+	  func_fatal_error "specify a tag with '--tag'"
 #	else
 #	  func_verbose "using $tagname tagged configuration"
 	fi
@@ -1434,15 +2711,15 @@ func_infer_tag ()
 # but don't create it if we're doing a dry run.
 func_write_libtool_object ()
 {
-    write_libobj=${1}
-    if test "$build_libtool_libs" = yes; then
-      write_lobj=\'${2}\'
+    write_libobj=$1
+    if test yes = "$build_libtool_libs"; then
+      write_lobj=\'$2\'
     else
       write_lobj=none
     fi
 
-    if test "$build_old_libs" = yes; then
-      write_oldobj=\'${3}\'
+    if test yes = "$build_old_libs"; then
+      write_oldobj=\'$3\'
     else
       write_oldobj=none
     fi
@@ -1450,7 +2727,7 @@ func_write_libtool_object ()
     $opt_dry_run || {
       cat >${write_libobj}T <<EOF
 # $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -1462,7 +2739,7 @@ pic_object=$write_lobj
 non_pic_object=$write_oldobj
 
 EOF
-      $MV "${write_libobj}T" "${write_libobj}"
+      $MV "${write_libobj}T" "$write_libobj"
     }
 }
 
@@ -1482,8 +2759,9 @@ EOF
 # be empty on error (or when ARG is empty)
 func_convert_core_file_wine_to_w32 ()
 {
-  $opt_debug
-  func_convert_core_file_wine_to_w32_result="$1"
+  $debug_cmd
+
+  func_convert_core_file_wine_to_w32_result=$1
   if test -n "$1"; then
     # Unfortunately, winepath does not exit with a non-zero error code, so we
     # are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@ func_convert_core_file_wine_to_w32 ()
     # *an error message* to stdout. So we must check for both error code of
     # zero AND non-empty stdout, which explains the odd construction:
     func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
-    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+    if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
       func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
-        $SED -e "$lt_sed_naive_backslashify"`
+        $SED -e "$sed_naive_backslashify"`
     else
       func_convert_core_file_wine_to_w32_result=
     fi
@@ -1514,18 +2792,19 @@ func_convert_core_file_wine_to_w32 ()
 # are convertible, then the result may be empty.
 func_convert_core_path_wine_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # unfortunately, winepath doesn't convert paths, only file names
-  func_convert_core_path_wine_to_w32_result=""
+  func_convert_core_path_wine_to_w32_result=
   if test -n "$1"; then
     oldIFS=$IFS
     IFS=:
     for func_convert_core_path_wine_to_w32_f in $1; do
       IFS=$oldIFS
       func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
-      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+      if test -n "$func_convert_core_file_wine_to_w32_result"; then
         if test -z "$func_convert_core_path_wine_to_w32_result"; then
-          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+          func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
         else
           func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
         fi
@@ -1554,7 +2833,8 @@ func_convert_core_path_wine_to_w32 ()
 # environment variable; do not put it in $PATH.
 func_cygpath ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
     func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
     if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@ func_cygpath ()
     fi
   else
     func_cygpath_result=
-    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+    func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
   fi
 }
 #end: func_cygpath
@@ -1574,10 +2854,11 @@ func_cygpath ()
 # result in func_convert_core_msys_to_w32_result.
 func_convert_core_msys_to_w32 ()
 {
-  $opt_debug
+  $debug_cmd
+
   # awkward: cmd appends spaces to result
   func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
-    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+    $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
 }
 #end: func_convert_core_msys_to_w32
 
@@ -1588,13 +2869,14 @@ func_convert_core_msys_to_w32 ()
 # func_to_host_file_result to ARG1).
 func_convert_file_check ()
 {
-  $opt_debug
-  if test -z "$2" && test -n "$1" ; then
+  $debug_cmd
+
+  if test -z "$2" && test -n "$1"; then
     func_error "Could not determine host file name corresponding to"
-    func_error "  \`$1'"
+    func_error "  '$1'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback:
-    func_to_host_file_result="$1"
+    func_to_host_file_result=$1
   fi
 }
 # end func_convert_file_check
@@ -1606,10 +2888,11 @@ func_convert_file_check ()
 # func_to_host_file_result to a simplistic fallback value (see below).
 func_convert_path_check ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$4" && test -n "$3"; then
     func_error "Could not determine the host path corresponding to"
-    func_error "  \`$3'"
+    func_error "  '$3'"
     func_error "Continuing, but uninstalled executables may not work."
     # Fallback.  This is a deliberately simplistic "conversion" and
     # should not be "improved".  See libtool.info.
@@ -1618,7 +2901,7 @@ func_convert_path_check ()
       func_to_host_path_result=`echo "$3" |
         $SED -e "$lt_replace_pathsep_chars"`
     else
-      func_to_host_path_result="$3"
+      func_to_host_path_result=$3
     fi
   fi
 }
@@ -1630,9 +2913,10 @@ func_convert_path_check ()
 # and appending REPL if ORIG matches BACKPAT.
 func_convert_path_front_back_pathsep ()
 {
-  $opt_debug
+  $debug_cmd
+
   case $4 in
-  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+  $1 ) func_to_host_path_result=$3$func_to_host_path_result
     ;;
   esac
   case $4 in
@@ -1646,7 +2930,7 @@ func_convert_path_front_back_pathsep ()
 ##################################################
 # $build to $host FILE NAME CONVERSION FUNCTIONS #
 ##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@ func_convert_path_front_back_pathsep ()
 # in func_to_host_file_result.
 func_to_host_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   $to_host_file_cmd "$1"
 }
 # end func_to_host_file
@@ -1669,7 +2954,8 @@ func_to_host_file ()
 # in (the comma separated) LAZY, no conversion takes place.
 func_to_tool_file ()
 {
-  $opt_debug
+  $debug_cmd
+
   case ,$2, in
     *,"$to_tool_file_cmd",*)
       func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@ func_to_tool_file ()
 # Copy ARG to func_to_host_file_result.
 func_convert_file_noop ()
 {
-  func_to_host_file_result="$1"
+  func_to_host_file_result=$1
 }
 # end func_convert_file_noop
 
@@ -1698,11 +2984,12 @@ func_convert_file_noop ()
 # func_to_host_file_result.
 func_convert_file_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result=$func_convert_core_msys_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1714,8 +3001,9 @@ func_convert_file_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_file_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
     # LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@ func_convert_file_cygwin_to_w32 ()
 # and a working winepath. Returns result in func_to_host_file_result.
 func_convert_file_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_file_wine_to_w32 "$1"
-    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1747,12 +3036,13 @@ func_convert_file_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_file_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     func_convert_core_msys_to_w32 "$1"
     func_cygpath -u "$func_convert_core_msys_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1765,13 +3055,14 @@ func_convert_file_msys_to_cygwin ()
 # in func_to_host_file_result.
 func_convert_file_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_file_result="$1"
+  $debug_cmd
+
+  func_to_host_file_result=$1
   if test -n "$1"; then
     # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
     func_convert_core_file_wine_to_w32 "$1"
     func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
-    func_to_host_file_result="$func_cygpath_result"
+    func_to_host_file_result=$func_cygpath_result
   fi
   func_convert_file_check "$1" "$func_to_host_file_result"
 }
@@ -1781,7 +3072,7 @@ func_convert_file_nix_to_cygwin ()
 #############################################
 # $build to $host PATH CONVERSION FUNCTIONS #
 #############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
 #
 # In each case, ARG is the path to be converted from $build to $host format.
 # The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@ func_convert_file_nix_to_cygwin ()
 to_host_path_cmd=
 func_init_to_host_path_cmd ()
 {
-  $opt_debug
+  $debug_cmd
+
   if test -z "$to_host_path_cmd"; then
     func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
-    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+    to_host_path_cmd=func_convert_path_$func_stripname_result
   fi
 }
 
@@ -1818,7 +3110,8 @@ func_init_to_host_path_cmd ()
 # in func_to_host_path_result.
 func_to_host_path ()
 {
-  $opt_debug
+  $debug_cmd
+
   func_init_to_host_path_cmd
   $to_host_path_cmd "$1"
 }
@@ -1829,7 +3122,7 @@ func_to_host_path ()
 # Copy ARG to func_to_host_path_result.
 func_convert_path_noop ()
 {
-  func_to_host_path_result="$1"
+  func_to_host_path_result=$1
 }
 # end func_convert_path_noop
 
@@ -1840,8 +3133,9 @@ func_convert_path_noop ()
 # func_to_host_path_result.
 func_convert_path_msys_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from ARG.  MSYS
     # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@ func_convert_path_msys_to_w32 ()
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result=$func_convert_core_msys_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@ func_convert_path_msys_to_w32 ()
 # func_to_host_file_result.
 func_convert_path_cygwin_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
@@ -1883,14 +3178,15 @@ func_convert_path_cygwin_to_w32 ()
 # a working winepath.  Returns result in func_to_host_file_result.
 func_convert_path_nix_to_w32 ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
-    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
     func_convert_path_check : ";" \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,15 +3200,16 @@ func_convert_path_nix_to_w32 ()
 # Returns result in func_to_host_file_result.
 func_convert_path_msys_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # See func_convert_path_msys_to_w32:
     func_stripname : : "$1"
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@ func_convert_path_msys_to_cygwin ()
 # func_to_host_file_result.
 func_convert_path_nix_to_cygwin ()
 {
-  $opt_debug
-  func_to_host_path_result="$1"
+  $debug_cmd
+
+  func_to_host_path_result=$1
   if test -n "$1"; then
     # Remove leading and trailing path separator characters from
     # ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@ func_convert_path_nix_to_cygwin ()
     func_to_host_path_tmp1=$func_stripname_result
     func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
     func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
-    func_to_host_path_result="$func_cygpath_result"
+    func_to_host_path_result=$func_cygpath_result
     func_convert_path_check : : \
       "$func_to_host_path_tmp1" "$func_to_host_path_result"
     func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@ func_convert_path_nix_to_cygwin ()
 # end func_convert_path_nix_to_cygwin
 
 
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+  $debug_cmd
+
+  func_dll_def_p_tmp=`$SED -n \
+    -e 's/^[	 ]*//' \
+    -e '/^\(;.*\)*$/d' \
+    -e 's/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p' \
+    -e q \
+    "$1"`
+  test DEF = "$func_dll_def_p_tmp"
+}
+
+
 # func_mode_compile arg...
 func_mode_compile ()
 {
-    $opt_debug
+    $debug_cmd
+
     # Get the compilation command and the source file.
     base_compile=
-    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    srcfile=$nonopt  #  always keep a non-empty value in "srcfile"
     suppress_opt=yes
     suppress_output=
     arg_mode=normal
@@ -1965,12 +3281,12 @@ func_mode_compile ()
       case $arg_mode in
       arg  )
 	# do not "continue".  Instead, add this to base_compile
-	lastarg="$arg"
+	lastarg=$arg
 	arg_mode=normal
 	;;
 
       target )
-	libobj="$arg"
+	libobj=$arg
 	arg_mode=normal
 	continue
 	;;
@@ -1980,7 +3296,7 @@ func_mode_compile ()
 	case $arg in
 	-o)
 	  test -n "$libobj" && \
-	    func_fatal_error "you cannot specify \`-o' more than once"
+	    func_fatal_error "you cannot specify '-o' more than once"
 	  arg_mode=target
 	  continue
 	  ;;
@@ -2009,12 +3325,12 @@ func_mode_compile ()
 	  func_stripname '-Wc,' '' "$arg"
 	  args=$func_stripname_result
 	  lastarg=
-	  save_ifs="$IFS"; IFS=','
+	  save_ifs=$IFS; IFS=,
 	  for arg in $args; do
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 	    func_append_quoted lastarg "$arg"
 	  done
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
 	  func_stripname ' ' '' "$lastarg"
 	  lastarg=$func_stripname_result
 
@@ -2027,8 +3343,8 @@ func_mode_compile ()
 	  # Accept the current argument as the source file.
 	  # The previous "srcfile" becomes the current argument.
 	  #
-	  lastarg="$srcfile"
-	  srcfile="$arg"
+	  lastarg=$srcfile
+	  srcfile=$arg
 	  ;;
 	esac  #  case $arg
 	;;
@@ -2043,13 +3359,13 @@ func_mode_compile ()
       func_fatal_error "you must specify an argument for -Xcompile"
       ;;
     target)
-      func_fatal_error "you must specify a target with \`-o'"
+      func_fatal_error "you must specify a target with '-o'"
       ;;
     *)
       # Get the name of the library object.
       test -z "$libobj" && {
 	func_basename "$srcfile"
-	libobj="$func_basename_result"
+	libobj=$func_basename_result
       }
       ;;
     esac
@@ -2069,7 +3385,7 @@ func_mode_compile ()
     case $libobj in
     *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
     *)
-      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      func_fatal_error "cannot determine name of library object from '$libobj'"
       ;;
     esac
 
@@ -2078,8 +3394,8 @@ func_mode_compile ()
     for arg in $later; do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes = "$build_libtool_libs" \
+	  || func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	continue
 	;;
@@ -2105,17 +3421,17 @@ func_mode_compile ()
     func_quote_for_eval "$libobj"
     test "X$libobj" != "X$func_quote_for_eval_result" \
       && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
-      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+      && func_warning "libobj name '$libobj' may not contain shell special characters."
     func_dirname_and_basename "$obj" "/" ""
-    objname="$func_basename_result"
-    xdir="$func_dirname_result"
-    lobj=${xdir}$objdir/$objname
+    objname=$func_basename_result
+    xdir=$func_dirname_result
+    lobj=$xdir$objdir/$objname
 
     test -z "$base_compile" && \
       func_fatal_help "you must specify a compilation command"
 
     # Delete any leftover library objects.
-    if test "$build_old_libs" = yes; then
+    if test yes = "$build_old_libs"; then
       removelist="$obj $lobj $libobj ${libobj}T"
     else
       removelist="$lobj $libobj ${libobj}T"
@@ -2127,16 +3443,16 @@ func_mode_compile ()
       pic_mode=default
       ;;
     esac
-    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+    if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
       # non-PIC code in shared libraries is not supported
       pic_mode=default
     fi
 
     # Calculate the filename of the output object if compiler does
     # not support -o with -c
-    if test "$compiler_c_o" = no; then
-      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
-      lockfile="$output_obj.lock"
+    if test no = "$compiler_c_o"; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+      lockfile=$output_obj.lock
     else
       output_obj=
       need_locks=no
@@ -2145,12 +3461,12 @@ func_mode_compile ()
 
     # Lock this critical section if it is needed
     # We use this script file to make the link, it avoids creating a new file
-    if test "$need_locks" = yes; then
+    if test yes = "$need_locks"; then
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
 	sleep 2
       done
-    elif test "$need_locks" = warn; then
+    elif test warn = "$need_locks"; then
       if test -f "$lockfile"; then
 	$ECHO "\
 *** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@ func_mode_compile ()
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2180,11 +3496,11 @@ compiler."
     qsrcfile=$func_quote_for_eval_result
 
     # Only build a PIC object if we are building libtool libraries.
-    if test "$build_libtool_libs" = yes; then
+    if test yes = "$build_libtool_libs"; then
       # Without this assignment, base_compile gets emptied.
       fbsd_hideous_sh_bug=$base_compile
 
-      if test "$pic_mode" != no; then
+      if test no != "$pic_mode"; then
 	command="$base_compile $qsrcfile $pic_flag"
       else
 	# Don't build PIC code
@@ -2201,7 +3517,7 @@ compiler."
       func_show_eval_locale "$command"	\
           'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2228,20 +3544,20 @@ compiler."
       fi
 
       # Allow error messages only from the first compilation.
-      if test "$suppress_opt" = yes; then
+      if test yes = "$suppress_opt"; then
 	suppress_output=' >/dev/null 2>&1'
       fi
     fi
 
     # Only build a position-dependent object if we build old libraries.
-    if test "$build_old_libs" = yes; then
-      if test "$pic_mode" != yes; then
+    if test yes = "$build_old_libs"; then
+      if test yes != "$pic_mode"; then
 	# Don't build PIC code
 	command="$base_compile $qsrcfile$pie_flag"
       else
 	command="$base_compile $qsrcfile $pic_flag"
       fi
-      if test "$compiler_c_o" = yes; then
+      if test yes = "$compiler_c_o"; then
 	func_append command " -o $obj"
       fi
 
@@ -2250,7 +3566,7 @@ compiler."
       func_show_eval_locale "$command" \
         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
 
-      if test "$need_locks" = warn &&
+      if test warn = "$need_locks" &&
 	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
 	$ECHO "\
 *** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@ $srcfile
 
 This indicates that another process is trying to use the same
 temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together.  If you
+your compiler does not support '-c' and '-o' together.  If you
 repeat this compilation, it may succeed, by chance, but you had better
 avoid parallel builds (make -j) in this platform, or get a better
 compiler."
@@ -2281,7 +3597,7 @@ compiler."
       func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
 
       # Unlock the critical section if it was locked
-      if test "$need_locks" != no; then
+      if test no != "$need_locks"; then
 	removelist=$lockfile
         $RM "$lockfile"
       fi
@@ -2291,7 +3607,7 @@ compiler."
 }
 
 $opt_help || {
-  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+  test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
 }
 
 func_mode_help ()
@@ -2311,7 +3627,7 @@ func_mode_help ()
 Remove files from the build directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@ This mode accepts the following additional options:
   -no-suppress      do not suppress compiler output for multiple passes
   -prefer-pic       try to build PIC objects only
   -prefer-non-pic   try to build non-PIC objects only
-  -shared           do not build a \`.o' file suitable for static linking
-  -static           only build a \`.o' file suitable for static linking
+  -shared           do not build a '.o' file suitable for static linking
+  -static           only build a '.o' file suitable for static linking
   -Wc,FLAG          pass FLAG directly to the compiler
 
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
 from the given SOURCEFILE.
 
 The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
         ;;
 
       execute)
@@ -2352,7 +3668,7 @@ This mode accepts the following additional options:
 
   -dlopen FILE      add the directory containing FILE to the library path
 
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
 flags.
 
 If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@ Complete the installation of libtool libraries.
 Each LIBDIR is a directory that contains libtool libraries.
 
 The commands that this mode executes may require superuser privileges.  Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
         ;;
 
       install)
@@ -2381,7 +3697,7 @@ the \`--dry-run' option if you just want to see what would be executed."
 Install executables or libraries.
 
 INSTALL-COMMAND is the installation command.  The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
 
 The following components of INSTALL-COMMAND are treated specially:
 
@@ -2407,7 +3723,7 @@ The following components of LINK-COMMAND are treated specially:
   -avoid-version    do not add a version suffix if possible
   -bindir BINDIR    specify path to binaries directory (for systems where
                     libraries must be found in the PATH setting at runtime)
-  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlopen FILE      '-dlpreopen' FILE if it cannot be dlopened at runtime
   -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
   -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
   -export-symbols SYMFILE
@@ -2421,7 +3737,8 @@ The following components of LINK-COMMAND are treated specially:
   -no-install       link a not-installable executable
   -no-undefined     declare that a library does not refer to external symbols
   -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
-  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -objectlist FILE  use a list of object files found in FILE to specify objects
+  -os2dllname NAME  force a short DLL name on OS/2 (no effect on other OSes)
   -precious-files-regex REGEX
                     don't remove output files matching REGEX
   -release RELEASE  specify package release information
@@ -2441,20 +3758,20 @@ The following components of LINK-COMMAND are treated specially:
   -Xlinker FLAG     pass linker-specific FLAG directly to the linker
   -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
 
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
 
-Every other argument is treated as a filename.  Files ending in \`.la' are
+Every other argument is treated as a filename.  Files ending in '.la' are
 treated as uninstalled libtool libraries, other files are standard or library
 object files.
 
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
 required, except when creating a convenience library.
 
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
 
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
 is created, otherwise an executable program is created."
         ;;
 
@@ -2465,7 +3782,7 @@ is created, otherwise an executable program is created."
 Remove libraries from an installation directory.
 
 RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm').  RM-OPTIONS are options (such as '-f') to be passed
 to RM.
 
 If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@ Otherwise, only FILE itself is deleted using RM."
         ;;
 
       *)
-        func_fatal_help "invalid operation mode \`$opt_mode'"
+        func_fatal_help "invalid operation mode '$opt_mode'"
         ;;
     esac
 
     echo
-    $ECHO "Try \`$progname --help' for more information about other modes."
+    $ECHO "Try '$progname --help' for more information about other modes."
 }
 
 # Now that we've collected a possible --mode arg, show help if necessary
 if $opt_help; then
-  if test "$opt_help" = :; then
+  if test : = "$opt_help"; then
     func_mode_help
   else
     {
@@ -2491,7 +3808,7 @@ if $opt_help; then
       for opt_mode in compile link execute install finish uninstall clean; do
 	func_mode_help
       done
-    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    } | $SED -n '1p; 2,$s/^Usage:/  or: /p'
     {
       func_help noexit
       for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@ if $opt_help; then
 	func_mode_help
       done
     } |
-    sed '1d
+    $SED '1d
       /^When reporting/,/^Report/{
 	H
 	d
@@ -2516,16 +3833,17 @@ fi
 # func_mode_execute arg...
 func_mode_execute ()
 {
-    $opt_debug
+    $debug_cmd
+
     # The first argument is the command name.
-    cmd="$nonopt"
+    cmd=$nonopt
     test -z "$cmd" && \
       func_fatal_help "you must specify a COMMAND"
 
     # Handle -dlopen flags immediately.
     for file in $opt_dlopen; do
       test -f "$file" \
-	|| func_fatal_help "\`$file' is not a file"
+	|| func_fatal_help "'$file' is not a file"
 
       dir=
       case $file in
@@ -2535,7 +3853,7 @@ func_mode_execute ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+	  || func_fatal_help "'$lib' is not a valid libtool archive"
 
 	# Read the libtool library.
 	dlname=
@@ -2546,18 +3864,18 @@ func_mode_execute ()
 	if test -z "$dlname"; then
 	  # Warn if it was a shared library.
 	  test -n "$library_names" && \
-	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	    func_warning "'$file' was not linked with '-export-dynamic'"
 	  continue
 	fi
 
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 
 	if test -f "$dir/$objdir/$dlname"; then
 	  func_append dir "/$objdir"
 	else
 	  if test ! -f "$dir/$dlname"; then
-	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	    func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
 	  fi
 	fi
 	;;
@@ -2565,18 +3883,18 @@ func_mode_execute ()
       *.lo)
 	# Just add the directory containing the .lo file.
 	func_dirname "$file" "" "."
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	;;
 
       *)
-	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
 	continue
 	;;
       esac
 
       # Get the absolute pathname.
       absdir=`cd "$dir" && pwd`
-      test -n "$absdir" && dir="$absdir"
+      test -n "$absdir" && dir=$absdir
 
       # Now add the directory to shlibpath_var.
       if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@ func_mode_execute ()
 
     # This variable tells wrapper scripts just to set shlibpath_var
     # rather than running their programs.
-    libtool_execute_magic="$magic"
+    libtool_execute_magic=$magic
 
     # Check if any of the arguments is a wrapper script.
     args=
@@ -2601,12 +3919,12 @@ func_mode_execute ()
 	if func_ltwrapper_script_p "$file"; then
 	  func_source "$file"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	elif func_ltwrapper_executable_p "$file"; then
 	  func_ltwrapper_scriptname "$file"
 	  func_source "$func_ltwrapper_scriptname_result"
 	  # Transform arg to wrapped name.
-	  file="$progdir/$program"
+	  file=$progdir/$program
 	fi
 	;;
       esac
@@ -2614,7 +3932,15 @@ func_mode_execute ()
       func_append_quoted args "$file"
     done
 
-    if test "X$opt_dry_run" = Xfalse; then
+    if $opt_dry_run; then
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    else
       if test -n "$shlibpath_var"; then
 	# Export the shlibpath_var.
 	eval "export $shlibpath_var"
@@ -2631,25 +3957,18 @@ func_mode_execute ()
       done
 
       # Now prepare to actually exec the command.
-      exec_cmd="\$cmd$args"
-    else
-      # Display what would be done.
-      if test -n "$shlibpath_var"; then
-	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
-	echo "export $shlibpath_var"
-      fi
-      $ECHO "$cmd$args"
-      exit $EXIT_SUCCESS
+      exec_cmd=\$cmd$args
     fi
 }
 
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
 
 
 # func_mode_finish arg...
 func_mode_finish ()
 {
-    $opt_debug
+    $debug_cmd
+
     libs=
     libdirs=
     admincmds=
@@ -2663,11 +3982,11 @@ func_mode_finish ()
 	if func_lalib_unsafe_p "$opt"; then
 	  func_append libs " $opt"
 	else
-	  func_warning "\`$opt' is not a valid libtool archive"
+	  func_warning "'$opt' is not a valid libtool archive"
 	fi
 
       else
-	func_fatal_error "invalid argument \`$opt'"
+	func_fatal_error "invalid argument '$opt'"
       fi
     done
 
@@ -2682,12 +4001,12 @@ func_mode_finish ()
       # Remove sysroot references
       if $opt_dry_run; then
         for lib in $libs; do
-          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+          echo "removing references to $lt_sysroot and '=' prefixes from $lib"
         done
       else
         tmpdir=`func_mktempdir`
         for lib in $libs; do
-	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	  $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 	    > $tmpdir/tmp-la
 	  mv -f $tmpdir/tmp-la $lib
 	done
@@ -2712,7 +4031,7 @@ func_mode_finish ()
     fi
 
     # Exit here if they wanted silent mode.
-    $opt_silent && exit $EXIT_SUCCESS
+    $opt_quiet && exit $EXIT_SUCCESS
 
     if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
       echo "----------------------------------------------------------------------"
@@ -2723,27 +4042,27 @@ func_mode_finish ()
       echo
       echo "If you ever happen to want to link against installed libraries"
       echo "in a given directory, LIBDIR, you must either use libtool, and"
-      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "specify the full pathname of the library, or use the '-LLIBDIR'"
       echo "flag during linking and do at least one of the following:"
       if test -n "$shlibpath_var"; then
-	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "   - add LIBDIR to the '$shlibpath_var' environment variable"
 	echo "     during execution"
       fi
       if test -n "$runpath_var"; then
-	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "   - add LIBDIR to the '$runpath_var' environment variable"
 	echo "     during linking"
       fi
       if test -n "$hardcode_libdir_flag_spec"; then
 	libdir=LIBDIR
 	eval flag=\"$hardcode_libdir_flag_spec\"
 
-	$ECHO "   - use the \`$flag' linker flag"
+	$ECHO "   - use the '$flag' linker flag"
       fi
       if test -n "$admincmds"; then
 	$ECHO "   - have your system administrator run these commands:$admincmds"
       fi
       if test -f /etc/ld.so.conf; then
-	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+	echo "   - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
       fi
       echo
 
@@ -2762,18 +4081,20 @@ func_mode_finish ()
     exit $EXIT_SUCCESS
 }
 
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
 
 
 # func_mode_install arg...
 func_mode_install ()
 {
-    $opt_debug
+    $debug_cmd
+
     # There may be an optional sh(1) argument at the beginning of
     # install_prog (especially on Windows NT).
-    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+    if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
        # Allow the use of GNU shtool's install command.
-       case $nonopt in *shtool*) :;; *) false;; esac; then
+       case $nonopt in *shtool*) :;; *) false;; esac
+    then
       # Aesthetically quote it.
       func_quote_for_eval "$nonopt"
       install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@ func_mode_install ()
     opts=
     prev=
     install_type=
-    isdir=no
+    isdir=false
     stripme=
     no_mode=:
     for arg
@@ -2813,7 +4134,7 @@ func_mode_install ()
       fi
 
       case $arg in
-      -d) isdir=yes ;;
+      -d) isdir=: ;;
       -f)
 	if $install_cp; then :; else
 	  prev=$arg
@@ -2831,7 +4152,7 @@ func_mode_install ()
       *)
 	# If the previous option needed an argument, then skip it.
 	if test -n "$prev"; then
-	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	  if test X-m = "X$prev" && test -n "$install_override_mode"; then
 	    arg2=$install_override_mode
 	    no_mode=false
 	  fi
@@ -2856,7 +4177,7 @@ func_mode_install ()
       func_fatal_help "you must specify an install program"
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prev' option requires an argument"
+      func_fatal_help "the '$prev' option requires an argument"
 
     if test -n "$install_override_mode" && $no_mode; then
       if $install_cp; then :; else
@@ -2878,19 +4199,19 @@ func_mode_install ()
     dest=$func_stripname_result
 
     # Check to see that the destination is a directory.
-    test -d "$dest" && isdir=yes
-    if test "$isdir" = yes; then
-      destdir="$dest"
+    test -d "$dest" && isdir=:
+    if $isdir; then
+      destdir=$dest
       destname=
     else
       func_dirname_and_basename "$dest" "" "."
-      destdir="$func_dirname_result"
-      destname="$func_basename_result"
+      destdir=$func_dirname_result
+      destname=$func_basename_result
 
       # Not a directory, so check to see that there is only one file specified.
       set dummy $files; shift
       test "$#" -gt 1 && \
-	func_fatal_help "\`$dest' is not a directory"
+	func_fatal_help "'$dest' is not a directory"
     fi
     case $destdir in
     [\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@ func_mode_install ()
 	case $file in
 	*.lo) ;;
 	*)
-	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  func_fatal_help "'$destdir' must be an absolute directory name"
 	  ;;
 	esac
       done
@@ -2908,7 +4229,7 @@ func_mode_install ()
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     staticlibs=
     future_libdirs=
@@ -2928,7 +4249,7 @@ func_mode_install ()
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$file" \
-	  || func_fatal_help "\`$file' is not a valid libtool archive"
+	  || func_fatal_help "'$file' is not a valid libtool archive"
 
 	library_names=
 	old_library=
@@ -2950,7 +4271,7 @@ func_mode_install ()
 	fi
 
 	func_dirname "$file" "/" ""
-	dir="$func_dirname_result"
+	dir=$func_dirname_result
 	func_append dir "$objdir"
 
 	if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@ func_mode_install ()
 	  # are installed into $libdir/../bin (currently, that works fine)
 	  # but it's something to keep an eye on.
 	  test "$inst_prefix_dir" = "$destdir" && \
-	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+	    func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
 
 	  if test -n "$inst_prefix_dir"; then
 	    # Stick the inst_prefix_dir data into the link command.
@@ -2973,29 +4294,36 @@ func_mode_install ()
 	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 	  fi
 
-	  func_warning "relinking \`$file'"
+	  func_warning "relinking '$file'"
 	  func_show_eval "$relink_command" \
-	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	    'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
 	fi
 
 	# See the names of the shared library.
 	set dummy $library_names; shift
 	if test -n "$1"; then
-	  realname="$1"
+	  realname=$1
 	  shift
 
-	  srcname="$realname"
-	  test -n "$relink_command" && srcname="$realname"T
+	  srcname=$realname
+	  test -n "$relink_command" && srcname=${realname}T
 
 	  # Install the shared library and build the symlinks.
 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
 	      'exit $?'
-	  tstripme="$stripme"
+	  tstripme=$stripme
 	  case $host_os in
 	  cygwin* | mingw* | pw32* | cegcc*)
 	    case $realname in
 	    *.dll.a)
-	      tstripme=""
+	      tstripme=
+	      ;;
+	    esac
+	    ;;
+	  os2*)
+	    case $realname in
+	    *_dll.a)
+	      tstripme=
 	      ;;
 	    esac
 	    ;;
@@ -3006,7 +4334,7 @@ func_mode_install ()
 
 	  if test "$#" -gt 0; then
 	    # Delete the old symlinks, and create new ones.
-	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # Try 'ln -sf' first, because the 'ln' binary might depend on
 	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
 	    # so we also need to try rm && ln -s.
 	    for linkname
@@ -3017,14 +4345,14 @@ func_mode_install ()
 	  fi
 
 	  # Do each command in the postinstall commands.
-	  lib="$destdir/$realname"
+	  lib=$destdir/$realname
 	  func_execute_cmds "$postinstall_cmds" 'exit $?'
 	fi
 
 	# Install the pseudo-library for information purposes.
 	func_basename "$file"
-	name="$func_basename_result"
-	instname="$dir/$name"i
+	name=$func_basename_result
+	instname=$dir/${name}i
 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
 
 	# Maybe install the static library, too.
@@ -3036,11 +4364,11 @@ func_mode_install ()
 
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@ func_mode_install ()
 	  staticdest=$func_lo2o_result
 	  ;;
 	*.$objext)
-	  staticdest="$destfile"
+	  staticdest=$destfile
 	  destfile=
 	  ;;
 	*)
-	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  func_fatal_help "cannot copy a libtool object to '$destfile'"
 	  ;;
 	esac
 
@@ -3063,7 +4391,7 @@ func_mode_install ()
 	  func_show_eval "$install_prog $file $destfile" 'exit $?'
 
 	# Install the old object if enabled.
-	if test "$build_old_libs" = yes; then
+	if test yes = "$build_old_libs"; then
 	  # Deduce the name of the old-style object file.
 	  func_lo2o "$file"
 	  staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@ func_mode_install ()
       *)
 	# Figure out destination file name, if it wasn't already specified.
 	if test -n "$destname"; then
-	  destfile="$destdir/$destname"
+	  destfile=$destdir/$destname
 	else
 	  func_basename "$file"
-	  destfile="$func_basename_result"
-	  destfile="$destdir/$destfile"
+	  destfile=$func_basename_result
+	  destfile=$destdir/$destfile
 	fi
 
 	# If the file is missing, and there is a .exe on the end, strip it
 	# because it is most likely a libtool script we actually want to
 	# install
-	stripped_ext=""
+	stripped_ext=
 	case $file in
 	  *.exe)
 	    if test ! -f "$file"; then
 	      func_stripname '' '.exe' "$file"
 	      file=$func_stripname_result
-	      stripped_ext=".exe"
+	      stripped_ext=.exe
 	    fi
 	    ;;
 	esac
@@ -3119,19 +4447,19 @@ func_mode_install ()
 
 	  # Check the variables that should have been set.
 	  test -z "$generated_by_libtool_version" && \
-	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+	    func_fatal_error "invalid libtool wrapper script '$wrapper'"
 
-	  finalize=yes
+	  finalize=:
 	  for lib in $notinst_deplibs; do
 	    # Check to see that each library is installed.
 	    libdir=
 	    if test -f "$lib"; then
 	      func_source "$lib"
 	    fi
-	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
 	    if test -n "$libdir" && test ! -f "$libfile"; then
-	      func_warning "\`$lib' has not been installed in \`$libdir'"
-	      finalize=no
+	      func_warning "'$lib' has not been installed in '$libdir'"
+	      finalize=false
 	    fi
 	  done
 
@@ -3139,29 +4467,29 @@ func_mode_install ()
 	  func_source "$wrapper"
 
 	  outputname=
-	  if test "$fast_install" = no && test -n "$relink_command"; then
+	  if test no = "$fast_install" && test -n "$relink_command"; then
 	    $opt_dry_run || {
-	      if test "$finalize" = yes; then
+	      if $finalize; then
 	        tmpdir=`func_mktempdir`
 		func_basename "$file$stripped_ext"
-		file="$func_basename_result"
-	        outputname="$tmpdir/$file"
+		file=$func_basename_result
+	        outputname=$tmpdir/$file
 	        # Replace the output file specification.
 	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
 
-	        $opt_silent || {
+	        $opt_quiet || {
 	          func_quote_for_expand "$relink_command"
 		  eval "func_echo $func_quote_for_expand_result"
 	        }
 	        if eval "$relink_command"; then :
 	          else
-		  func_error "error: relink \`$file' with the above command before installing it"
+		  func_error "error: relink '$file' with the above command before installing it"
 		  $opt_dry_run || ${RM}r "$tmpdir"
 		  continue
 	        fi
-	        file="$outputname"
+	        file=$outputname
 	      else
-	        func_warning "cannot relink \`$file'"
+	        func_warning "cannot relink '$file'"
 	      fi
 	    }
 	  else
@@ -3198,10 +4526,10 @@ func_mode_install ()
 
     for file in $staticlibs; do
       func_basename "$file"
-      name="$func_basename_result"
+      name=$func_basename_result
 
       # Set up the ranlib parameters.
-      oldlib="$destdir/$name"
+      oldlib=$destdir/$name
       func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
       tool_oldlib=$func_to_tool_file_result
 
@@ -3216,18 +4544,18 @@ func_mode_install ()
     done
 
     test -n "$future_libdirs" && \
-      func_warning "remember to run \`$progname --finish$future_libdirs'"
+      func_warning "remember to run '$progname --finish$future_libdirs'"
 
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       $opt_dry_run && current_libdirs=" -n$current_libdirs"
-      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+      exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
     else
       exit $EXIT_SUCCESS
     fi
 }
 
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
 
 
 # func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@ test "$opt_mode" = install && func_mode_install ${1+"$@"}
 # a dlpreopen symbol table.
 func_generate_dlsyms ()
 {
-    $opt_debug
-    my_outputname="$1"
-    my_originator="$2"
-    my_pic_p="${3-no}"
-    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    $debug_cmd
+
+    my_outputname=$1
+    my_originator=$2
+    my_pic_p=${3-false}
+    my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
     my_dlsyms=
 
-    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+    if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
       if test -n "$NM" && test -n "$global_symbol_pipe"; then
-	my_dlsyms="${my_outputname}S.c"
+	my_dlsyms=${my_outputname}S.c
       else
 	func_error "not configured to extract global symbols from dlpreopened files"
       fi
@@ -3255,7 +4584,7 @@ func_generate_dlsyms ()
       "") ;;
       *.c)
 	# Discover the nlist of each of the dlfiles.
-	nlist="$output_objdir/${my_outputname}.nm"
+	nlist=$output_objdir/$my_outputname.nm
 
 	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
 
@@ -3263,34 +4592,36 @@ func_generate_dlsyms ()
 	func_verbose "creating $output_objdir/$my_dlsyms"
 
 	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
 
 #ifdef __cplusplus
 extern \"C\" {
 #endif
 
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 #endif
 
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
 # define LT_DLSYM_CONST const
 #endif
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* External symbol declarations for the compiler. */\
 "
 
-	if test "$dlself" = yes; then
-	  func_verbose "generating symbol list for \`$output'"
+	if test yes = "$dlself"; then
+	  func_verbose "generating symbol list for '$output'"
 
 	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
 
@@ -3298,7 +4629,7 @@ extern \"C\" {
 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	  for progfile in $progfiles; do
 	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
-	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
 	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
 	  done
 
@@ -3318,10 +4649,10 @@ extern \"C\" {
 
 	  # Prepare the list of exported symbols
 	  if test -z "$export_symbols"; then
-	    export_symbols="$output_objdir/$outputname.exp"
+	    export_symbols=$output_objdir/$outputname.exp
 	    $opt_dry_run || {
 	      $RM $export_symbols
-	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 	      case $host in
 	      *cygwin* | *mingw* | *cegcc* )
                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@ extern \"C\" {
 	    }
 	  else
 	    $opt_dry_run || {
-	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
 	      eval '$MV "$nlist"T "$nlist"'
 	      case $host in
@@ -3345,22 +4676,22 @@ extern \"C\" {
 	fi
 
 	for dlprefile in $dlprefiles; do
-	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_verbose "extracting global C symbols from '$dlprefile'"
 	  func_basename "$dlprefile"
-	  name="$func_basename_result"
+	  name=$func_basename_result
           case $host in
 	    *cygwin* | *mingw* | *cegcc* )
 	      # if an import library, we need to obtain dlname
 	      if func_win32_import_lib_p "$dlprefile"; then
 	        func_tr_sh "$dlprefile"
 	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
-	        dlprefile_dlbasename=""
+	        dlprefile_dlbasename=
 	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 	          # Use subshell, to avoid clobbering current variable values
 	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
-	          if test -n "$dlprefile_dlname" ; then
+	          if test -n "$dlprefile_dlname"; then
 	            func_basename "$dlprefile_dlname"
-	            dlprefile_dlbasename="$func_basename_result"
+	            dlprefile_dlbasename=$func_basename_result
 	          else
 	            # no lafile. user explicitly requested -dlpreopen <import library>.
 	            $sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@ extern \"C\" {
 	          fi
 	        fi
 	        $opt_dry_run || {
-	          if test -n "$dlprefile_dlbasename" ; then
+	          if test -n "$dlprefile_dlbasename"; then
 	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 	          else
 	            func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@ extern \"C\" {
 	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
 	  fi
 
+	  func_show_eval '$RM "${nlist}I"'
+	  if test -n "$global_symbol_to_import"; then
+	    eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+	  fi
+
 	  echo >> "$output_objdir/$my_dlsyms" "\
 
 /* The mapping between symbol names and symbols.  */
@@ -3432,11 +4768,30 @@ typedef struct {
   void *address;
 } lt_dlsymlist;
 extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+  LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+  for (; symbol->name; ++symbol)
+    {"
+	    $SED 's/.*/      if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+	    echo >> "$output_objdir/$my_dlsyms" "\
+    }
+}"
+	  fi
+	  echo >> "$output_objdir/$my_dlsyms" "\
 LT_DLSYM_CONST lt_dlsymlist
 lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
-  { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+
+	  if test -s "$nlist"I; then
+	    echo >> "$output_objdir/$my_dlsyms" "\
+  {\"@INIT@\", (void *) &lt_syminit},"
+	  fi
 
 	  case $need_lib_prefix in
 	  no)
@@ -3478,9 +4833,7 @@ static const void *lt_preloaded_setup() {
 	  *-*-hpux*)
 	    pic_flag_for_symtable=" $pic_flag"  ;;
 	  *)
-	    if test "X$my_pic_p" != Xno; then
-	      pic_flag_for_symtable=" $pic_flag"
-	    fi
+	    $my_pic_p && pic_flag_for_symtable=" $pic_flag"
 	    ;;
 	  esac
 	  ;;
@@ -3497,10 +4850,10 @@ static const void *lt_preloaded_setup() {
 	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
 
 	# Clean up the generated files.
-	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
 
 	# Transform the symbol file into the correct name.
-	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	symfileobj=$output_objdir/${my_outputname}S.$objext
 	case $host in
 	*cygwin* | *mingw* | *cegcc* )
 	  if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@ static const void *lt_preloaded_setup() {
 	esac
 	;;
       *)
-	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	func_fatal_error "unknown suffix for '$my_dlsyms'"
 	;;
       esac
     else
@@ -3532,6 +4885,32 @@ static const void *lt_preloaded_setup() {
     fi
 }
 
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $debug_cmd
+
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
 # func_win32_libid arg
 # return the library type of file 'arg'
 #
@@ -3541,8 +4920,9 @@ static const void *lt_preloaded_setup() {
 # Despite the name, also deal with 64 bit binaries.
 func_win32_libid ()
 {
-  $opt_debug
-  win32_libid_type="unknown"
+  $debug_cmd
+
+  win32_libid_type=unknown
   win32_fileres=`file -L $1 2>/dev/null`
   case $win32_fileres in
   *ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@ func_win32_libid ()
     # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
        $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
-      func_to_tool_file "$1" func_convert_file_msys_to_w32
-      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
-	$SED -n -e '
+      case $nm_interface in
+      "MS dumpbin")
+	if func_cygming_ms_implib_p "$1" ||
+	   func_cygming_gnu_implib_p "$1"
+	then
+	  win32_nmres=import
+	else
+	  win32_nmres=
+	fi
+	;;
+      *)
+	func_to_tool_file "$1" func_convert_file_msys_to_w32
+	win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	  $SED -n -e '
 	    1,100{
 		/ I /{
-		    s,.*,import,
+		    s|.*|import|
 		    p
 		    q
 		}
 	    }'`
+	;;
+      esac
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@ func_win32_libid ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib ()
 {
-  $opt_debug
+  $debug_cmd
+
   sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 }
 
@@ -3610,7 +5004,8 @@ func_cygming_dll_for_implib ()
 # specified import library.
 func_cygming_dll_for_implib_fallback_core ()
 {
-  $opt_debug
+  $debug_cmd
+
   match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
   $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
     $SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@ func_cygming_dll_for_implib_fallback_core ()
       /./p' |
     # we now have a list, one entry per line, of the stringified
     # contents of the appropriate section of all members of the
-    # archive which possess that section. Heuristic: eliminate
-    # all those which have a first or second character that is
+    # archive that possess that section. Heuristic: eliminate
+    # all those that have a first or second character that is
     # a '.' (that is, objdump's representation of an unprintable
     # character.) This should work for all archives with less than
     # 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@ func_cygming_dll_for_implib_fallback_core ()
     $SED -e '/^\./d;/^.\./d;q'
 }
 
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
-  test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
-  $opt_debug
-  func_to_tool_file "$1" func_convert_file_msys_to_w32
-  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
-  test -n "$func_cygming_ms_implib_tmp"
-}
-
 # func_cygming_dll_for_implib_fallback ARG
 # Platform-specific function to extract the
 # name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@ func_cygming_ms_implib_p ()
 #    $sharedlib_from_linklib_result
 func_cygming_dll_for_implib_fallback ()
 {
-  $opt_debug
-  if func_cygming_gnu_implib_p "$1" ; then
+  $debug_cmd
+
+  if func_cygming_gnu_implib_p "$1"; then
     # binutils import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
-  elif func_cygming_ms_implib_p "$1" ; then
+  elif func_cygming_ms_implib_p "$1"; then
     # ms-generated import library
     sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
   else
     # unknown
-    sharedlib_from_linklib_result=""
+    sharedlib_from_linklib_result=
   fi
 }
 
@@ -3712,10 +5084,11 @@ func_cygming_dll_for_implib_fallback ()
 # func_extract_an_archive dir oldlib
 func_extract_an_archive ()
 {
-    $opt_debug
-    f_ex_an_ar_dir="$1"; shift
-    f_ex_an_ar_oldlib="$1"
-    if test "$lock_old_archive_extraction" = yes; then
+    $debug_cmd
+
+    f_ex_an_ar_dir=$1; shift
+    f_ex_an_ar_oldlib=$1
+    if test yes = "$lock_old_archive_extraction"; then
       lockfile=$f_ex_an_ar_oldlib.lock
       until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 	func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@ func_extract_an_archive ()
     fi
     func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 		   'stat=$?; rm -f "$lockfile"; exit $stat'
-    if test "$lock_old_archive_extraction" = yes; then
+    if test yes = "$lock_old_archive_extraction"; then
       $opt_dry_run || rm -f "$lockfile"
     fi
     if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@ func_extract_an_archive ()
 # func_extract_archives gentop oldlib ...
 func_extract_archives ()
 {
-    $opt_debug
-    my_gentop="$1"; shift
+    $debug_cmd
+
+    my_gentop=$1; shift
     my_oldlibs=${1+"$@"}
-    my_oldobjs=""
-    my_xlib=""
-    my_xabs=""
-    my_xdir=""
+    my_oldobjs=
+    my_xlib=
+    my_xabs=
+    my_xdir=
 
     for my_xlib in $my_oldlibs; do
       # Extract the objects.
       case $my_xlib in
-	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
 	*) my_xabs=`pwd`"/$my_xlib" ;;
       esac
       func_basename "$my_xlib"
-      my_xlib="$func_basename_result"
+      my_xlib=$func_basename_result
       my_xlib_u=$my_xlib
       while :; do
         case " $extracted_archives " in
@@ -3765,7 +5139,7 @@ func_extract_archives ()
 	esac
       done
       extracted_archives="$extracted_archives $my_xlib_u"
-      my_xdir="$my_gentop/$my_xlib_u"
+      my_xdir=$my_gentop/$my_xlib_u
 
       func_mkdir_p "$my_xdir"
 
@@ -3778,22 +5152,23 @@ func_extract_archives ()
 	  cd $my_xdir || exit $?
 	  darwin_archive=$my_xabs
 	  darwin_curdir=`pwd`
-	  darwin_base_archive=`basename "$darwin_archive"`
+	  func_basename "$darwin_archive"
+	  darwin_base_archive=$func_basename_result
 	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
 	  if test -n "$darwin_arches"; then
 	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
 	    darwin_arch=
 	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
-	    for darwin_arch in  $darwin_arches ; do
-	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
-	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
-	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	    for darwin_arch in  $darwin_arches; do
+	      func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+	      cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+	      func_extract_an_archive "`pwd`" "$darwin_base_archive"
 	      cd "$darwin_curdir"
-	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	      $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
 	    done # $darwin_arches
             ## Okay now we've a bunch of thin objects, gotta fatten them up :)
-	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
 	    darwin_file=
 	    darwin_files=
 	    for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@ func_extract_archives ()
       my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
     done
 
-    func_extract_archives_result="$my_oldobjs"
+    func_extract_archives_result=$my_oldobjs
 }
 
 
@@ -3830,7 +5205,7 @@ func_extract_archives ()
 #
 # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 # variable will take.  If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
 # the $objdir directory.  This is a cygwin/mingw-specific
 # behavior.
 func_emit_wrapper ()
@@ -3841,7 +5216,7 @@ func_emit_wrapper ()
 #! $SHELL
 
 # $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # The $output program cannot be directly executed until all the libtool
 # libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@ _LTECHO_EOF'
 
 # Very basic option parsing. These options are (a) specific to
 # the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
 # windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
 # this pattern).
 #
 # There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@ func_parse_lt_options ()
 
   # Print the debug banner immediately:
   if test -n \"\$lt_option_debug\"; then
-    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+    echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
   fi
 }
 
@@ -3944,7 +5319,7 @@ func_lt_dump_args ()
   lt_dump_args_N=1;
   for lt_arg
   do
-    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
     lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
   done
 }
@@ -3958,7 +5333,7 @@ func_exec_program_core ()
   *-*-mingw | *-*-os2* | *-cegcc*)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@ func_exec_program_core ()
   *)
     $ECHO "\
       if test -n \"\$lt_option_debug\"; then
-        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
         func_lt_dump_args \${1+\"\$@\"} 1>&2
       fi
       exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@ func_exec_program ()
   test -n \"\$absdir\" && thisdir=\"\$absdir\"
 "
 
-	if test "$fast_install" = yes; then
+	if test yes = "$fast_install"; then
 	  $ECHO "\
   program=lt-'$outputname'$exeext
   progdir=\"\$thisdir/$objdir\"
 
   if test ! -f \"\$progdir/\$program\" ||
-     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
        test \"X\$file\" != \"X\$progdir/\$program\"; }; then
 
     file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@ func_exec_program ()
     if test -n \"\$relink_command\"; then
       if relink_command_output=\`eval \$relink_command 2>&1\`; then :
       else
-	$ECHO \"\$relink_command_output\" >&2
+	\$ECHO \"\$relink_command_output\" >&2
 	$RM \"\$progdir/\$file\"
 	exit 1
       fi
@@ -4101,7 +5476,7 @@ func_exec_program ()
 	fi
 
 	# Export our shlibpath_var if we have one.
-	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
 	  $ECHO "\
     # Add our own library path to $shlibpath_var
     $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@ func_exec_program ()
     fi
   else
     # The program doesn't exist.
-    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
     \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
     \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
     exit 1
@@ -4140,7 +5515,7 @@ func_emit_cwrapperexe_src ()
 	cat <<EOF
 
 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
-   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+   Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 
    The $output program cannot be directly executed until all the libtool
    libraries that it depends on are installed.
@@ -4175,47 +5550,45 @@ EOF
 #include <fcntl.h>
 #include <sys/stat.h>
 
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
 /* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
 # ifdef __STRICT_ANSI__
 int _putenv (const char *);
 # endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # ifdef __STRICT_ANSI__
 char *realpath (const char *, char *);
 int putenv (char *);
 int setenv (const char *, const char *, int);
 # endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
 #endif
 
 /* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
 # define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-#  define _INTPTR_T_DEFINED
-#  define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
 # define setmode _setmode
 # define stat    _stat
 # define chmod   _chmod
 # define getcwd  _getcwd
 # define putenv  _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
 # define HAVE_SETENV
 # define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
 #endif
 
-#if defined(PATH_MAX)
+#if defined PATH_MAX
 # define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
 # define LT_PATHMAX MAXPATHLEN
 #else
 # define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@ int setenv (const char *, const char *, int);
 # define PATH_SEPARATOR ':'
 #endif
 
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
-  defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+  defined __OS2__
 # define HAVE_DOS_BASED_FILE_SYSTEM
 # define FOPEN_WB "wb"
 # ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@ int setenv (const char *, const char *, int);
 
 #define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
 #define XFREE(stale) do { \
-  if (stale) { free ((void *) stale); stale = 0; } \
+  if (stale) { free (stale); stale = 0; } \
 } while (0)
 
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
 static int lt_debug = 1;
 #else
 static int lt_debug = 0;
@@ -4300,11 +5673,16 @@ void lt_dump_script (FILE *f);
 EOF
 
 	    cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
 const char * LIB_PATH_VARNAME = "$shlibpath_var";
 EOF
 
-	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	    if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
               func_to_host_path "$temp_rpath"
 	      cat <<EOF
 const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@ const char * EXE_PATH_VALUE   = "";
 EOF
 	    fi
 
-	    if test "$fast_install" = yes; then
+	    if test yes = "$fast_install"; then
 	      cat <<EOF
 const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
 EOF
@@ -4357,12 +5735,12 @@ main (int argc, char *argv[])
   char *actual_cwrapper_name;
   char *target_name;
   char *lt_argv_zero;
-  intptr_t rval = 127;
+  int rval = 127;
 
   int i;
 
   program_name = (char *) xstrdup (base_name (argv[0]));
-  newargz = XMALLOC (char *, argc + 1);
+  newargz = XMALLOC (char *, (size_t) argc + 1);
 
   /* very simple arg parsing; don't want to rely on getopt
    * also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@ main (int argc, char *argv[])
   newargc=0;
   for (i = 1; i < argc; i++)
     {
-      if (strcmp (argv[i], dumpscript_opt) == 0)
+      if (STREQ (argv[i], dumpscript_opt))
 	{
 EOF
-	    case "$host" in
+	    case $host in
 	      *mingw* | *cygwin* )
 		# make stdout use "unix" line endings
 		echo "          setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@ EOF
 	  lt_dump_script (stdout);
 	  return 0;
 	}
-      if (strcmp (argv[i], debug_opt) == 0)
+      if (STREQ (argv[i], debug_opt))
 	{
           lt_debug = 1;
           continue;
 	}
-      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+      if (STREQ (argv[i], ltwrapper_option_prefix))
         {
           /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
              namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@ EOF
 EOF
 	    cat <<EOF
   /* The GNU banner must be the first non-error debug message */
-  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
 EOF
 	    cat <<"EOF"
   lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@ EOF
 		cat <<"EOF"
   /* execv doesn't actually work on mingw as expected on unix */
   newargz = prepare_spawn (newargz);
-  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
   if (rval == -1)
     {
       /* failed to start process */
@@ -4569,7 +5947,7 @@ base_name (const char *name)
 {
   const char *base;
 
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   /* Skip over the disk name in MSDOS pathnames. */
   if (isalpha ((unsigned char) name[0]) && name[1] == ':')
     name += 2;
@@ -4628,7 +6006,7 @@ find_executable (const char *wrapper)
   const char *p_next;
   /* static buffer for getcwd */
   char tmp[LT_PATHMAX + 1];
-  int tmp_len;
+  size_t tmp_len;
   char *concat_name;
 
   lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@ find_executable (const char *wrapper)
     return NULL;
 
   /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
   if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
     {
       concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@ find_executable (const char *wrapper)
 	    return concat_name;
 	  XFREE (concat_name);
 	}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
     }
 #endif
 
@@ -4679,7 +6057,7 @@ find_executable (const char *wrapper)
 	      for (q = p; *q; q++)
 		if (IS_PATH_SEPARATOR (*q))
 		  break;
-	      p_len = q - p;
+	      p_len = (size_t) (q - p);
 	      p_next = (*q == '\0' ? q : q + 1);
 	      if (p_len == 0)
 		{
@@ -4798,7 +6176,7 @@ strendzap (char *str, const char *pat)
   if (patlen <= len)
     {
       str += len - patlen;
-      if (strcmp (str, pat) == 0)
+      if (STREQ (str, pat))
 	*str = '\0';
     }
   return str;
@@ -4863,7 +6241,7 @@ lt_setenv (const char *name, const char *value)
     char *str = xstrdup (value);
     setenv (name, str, 1);
 #else
-    int len = strlen (name) + 1 + strlen (value) + 1;
+    size_t len = strlen (name) + 1 + strlen (value) + 1;
     char *str = XMALLOC (char, len);
     sprintf (str, "%s=%s", name, value);
     if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
   char *new_value;
   if (orig_value && *orig_value)
     {
-      int orig_value_len = strlen (orig_value);
-      int add_len = strlen (add);
+      size_t orig_value_len = strlen (orig_value);
+      size_t add_len = strlen (add);
       new_value = XMALLOC (char, add_len + orig_value_len + 1);
       if (to_end)
         {
@@ -4912,10 +6290,10 @@ lt_update_exe_path (const char *name, const char *value)
     {
       char *new_value = lt_extend_str (getenv (name), value, 0);
       /* some systems can't cope with a ':'-terminated path #' */
-      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+      size_t len = strlen (new_value);
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
         {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
         }
       lt_setenv (name, new_value);
       XFREE (new_value);
@@ -5082,27 +6460,47 @@ EOF
 # True if ARG is an import lib, as indicated by $file_magic_cmd
 func_win32_import_lib_p ()
 {
-    $opt_debug
+    $debug_cmd
+
     case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
     *import*) : ;;
     *) false ;;
     esac
 }
 
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+    $debug_cmd
+
+    case " $compile_command " in
+    *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+      suncc_use_cstd_abi=no
+      ;;
+    *)
+      suncc_use_cstd_abi=yes
+      ;;
+    esac
+}
+
 # func_mode_link arg...
 func_mode_link ()
 {
-    $opt_debug
+    $debug_cmd
+
     case $host in
     *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
       # It is impossible to link a dll without this setting, and
       # we shouldn't force the makefile maintainer to figure out
-      # which system we are compiling for in order to pass an extra
+      # what system we are compiling for in order to pass an extra
       # flag for every libtool invocation.
       # allow_undefined=no
 
       # FIXME: Unfortunately, there are problems with the above when trying
-      # to make a dll which has undefined symbols, in which case not
+      # to make a dll that has undefined symbols, in which case not
       # even a static library is built.  For now, we need to specify
       # -no-undefined on the libtool link line when we can be certain
       # that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@ func_mode_link ()
     module=no
     no_install=no
     objs=
+    os2dllname=
     non_pic_objects=
     precious_files_regex=
     prefer_static_libs=no
-    preload=no
+    preload=false
     prev=
     prevarg=
     release=
@@ -5161,7 +6560,7 @@ func_mode_link ()
     vinfo=
     vinfo_number=no
     weak_libs=
-    single_module="${wl}-single_module"
+    single_module=$wl-single_module
     func_infer_tag $base_compile
 
     # We need to know -static, to get the right output filenames.
@@ -5169,15 +6568,15 @@ func_mode_link ()
     do
       case $arg in
       -shared)
-	test "$build_libtool_libs" != yes && \
-	  func_fatal_configuration "can not build a shared library"
+	test yes != "$build_libtool_libs" \
+	  && func_fatal_configuration "cannot build a shared library"
 	build_old_libs=no
 	break
 	;;
       -all-static | -static | -static-libtool-libs)
 	case $arg in
 	-all-static)
-	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	  if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
 	    func_warning "complete static linking is impossible in this configuration"
 	  fi
 	  if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@ func_mode_link ()
 
     # Go through the arguments, transforming them on the way.
     while test "$#" -gt 0; do
-      arg="$1"
+      arg=$1
       shift
       func_quote_for_eval "$arg"
       qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@ func_mode_link ()
 
 	case $prev in
 	bindir)
-	  bindir="$arg"
+	  bindir=$arg
 	  prev=
 	  continue
 	  ;;
 	dlfiles|dlprefiles)
-	  if test "$preload" = no; then
+	  $preload || {
 	    # Add the symbol object into the linking commands.
 	    func_append compile_command " @SYMFILE@"
 	    func_append finalize_command " @SYMFILE@"
-	    preload=yes
-	  fi
+	    preload=:
+	  }
 	  case $arg in
 	  *.la | *.lo) ;;  # We handle these cases below.
 	  force)
-	    if test "$dlself" = no; then
+	    if test no = "$dlself"; then
 	      dlself=needless
 	      export_dynamic=yes
 	    fi
@@ -5249,9 +6648,9 @@ func_mode_link ()
 	    continue
 	    ;;
 	  self)
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      dlself=yes
-	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	    elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
 	      dlself=yes
 	    else
 	      dlself=needless
@@ -5261,7 +6660,7 @@ func_mode_link ()
 	    continue
 	    ;;
 	  *)
-	    if test "$prev" = dlfiles; then
+	    if test dlfiles = "$prev"; then
 	      func_append dlfiles " $arg"
 	    else
 	      func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@ func_mode_link ()
 	  esac
 	  ;;
 	expsyms)
-	  export_symbols="$arg"
+	  export_symbols=$arg
 	  test -f "$arg" \
-	    || func_fatal_error "symbol file \`$arg' does not exist"
+	    || func_fatal_error "symbol file '$arg' does not exist"
 	  prev=
 	  continue
 	  ;;
 	expsyms_regex)
-	  export_symbols_regex="$arg"
+	  export_symbols_regex=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5297,7 +6696,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	inst_prefix)
-	  inst_prefix_dir="$arg"
+	  inst_prefix_dir=$arg
+	  prev=
+	  continue
+	  ;;
+	mllvm)
+	  # Clang does not use LLVM to link, so we can simply discard any
+	  # '-mllvm $arg' options when doing the link step.
 	  prev=
 	  continue
 	  ;;
@@ -5321,21 +6726,21 @@ func_mode_link ()
 
 		if test -z "$pic_object" ||
 		   test -z "$non_pic_object" ||
-		   test "$pic_object" = none &&
-		   test "$non_pic_object" = none; then
-		  func_fatal_error "cannot find name of object for \`$arg'"
+		   test none = "$pic_object" &&
+		   test none = "$non_pic_object"; then
+		  func_fatal_error "cannot find name of object for '$arg'"
 		fi
 
 		# Extract subdirectory from the argument.
 		func_dirname "$arg" "/" ""
-		xdir="$func_dirname_result"
+		xdir=$func_dirname_result
 
-		if test "$pic_object" != none; then
+		if test none != "$pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  pic_object="$xdir$pic_object"
+		  pic_object=$xdir$pic_object
 
-		  if test "$prev" = dlfiles; then
-		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		  if test dlfiles = "$prev"; then
+		    if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		      func_append dlfiles " $pic_object"
 		      prev=
 		      continue
@@ -5346,7 +6751,7 @@ func_mode_link ()
 		  fi
 
 		  # CHECK ME:  I think I busted this.  -Ossama
-		  if test "$prev" = dlprefiles; then
+		  if test dlprefiles = "$prev"; then
 		    # Preload the old-style object.
 		    func_append dlprefiles " $pic_object"
 		    prev=
@@ -5354,23 +6759,23 @@ func_mode_link ()
 
 		  # A PIC object.
 		  func_append libobjs " $pic_object"
-		  arg="$pic_object"
+		  arg=$pic_object
 		fi
 
 		# Non-PIC object.
-		if test "$non_pic_object" != none; then
+		if test none != "$non_pic_object"; then
 		  # Prepend the subdirectory the object is found in.
-		  non_pic_object="$xdir$non_pic_object"
+		  non_pic_object=$xdir$non_pic_object
 
 		  # A standard non-PIC object
 		  func_append non_pic_objects " $non_pic_object"
-		  if test -z "$pic_object" || test "$pic_object" = none ; then
-		    arg="$non_pic_object"
+		  if test -z "$pic_object" || test none = "$pic_object"; then
+		    arg=$non_pic_object
 		  fi
 		else
 		  # If the PIC object exists, use it instead.
 		  # $xdir was prepended to $pic_object above.
-		  non_pic_object="$pic_object"
+		  non_pic_object=$pic_object
 		  func_append non_pic_objects " $non_pic_object"
 		fi
 	      else
@@ -5378,7 +6783,7 @@ func_mode_link ()
 		if $opt_dry_run; then
 		  # Extract subdirectory from the argument.
 		  func_dirname "$arg" "/" ""
-		  xdir="$func_dirname_result"
+		  xdir=$func_dirname_result
 
 		  func_lo2o "$arg"
 		  pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@ func_mode_link ()
 		  func_append libobjs " $pic_object"
 		  func_append non_pic_objects " $non_pic_object"
 	        else
-		  func_fatal_error "\`$arg' is not a valid libtool object"
+		  func_fatal_error "'$arg' is not a valid libtool object"
 		fi
 	      fi
 	    done
 	  else
-	    func_fatal_error "link input file \`$arg' does not exist"
+	    func_fatal_error "link input file '$arg' does not exist"
 	  fi
 	  arg=$save_arg
 	  prev=
 	  continue
 	  ;;
+	os2dllname)
+	  os2dllname=$arg
+	  prev=
+	  continue
+	  ;;
 	precious_regex)
-	  precious_files_regex="$arg"
+	  precious_files_regex=$arg
 	  prev=
 	  continue
 	  ;;
 	release)
-	  release="-$arg"
+	  release=-$arg
 	  prev=
 	  continue
 	  ;;
@@ -5415,7 +6825,7 @@ func_mode_link ()
 	    func_fatal_error "only absolute run-paths are allowed"
 	    ;;
 	  esac
-	  if test "$prev" = rpath; then
+	  if test rpath = "$prev"; then
 	    case "$rpath " in
 	    *" $arg "*) ;;
 	    *) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@ func_mode_link ()
 	  continue
 	  ;;
 	shrext)
-	  shrext_cmds="$arg"
+	  shrext_cmds=$arg
 	  prev=
 	  continue
 	  ;;
@@ -5470,7 +6880,7 @@ func_mode_link ()
 	esac
       fi # test -n "$prev"
 
-      prevarg="$arg"
+      prevarg=$arg
 
       case $arg in
       -all-static)
@@ -5484,7 +6894,7 @@ func_mode_link ()
 
       -allow-undefined)
 	# FIXME: remove this flag sometime in the future.
-	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	func_fatal_error "'-allow-undefined' must not be used because it is the default"
 	;;
 
       -avoid-version)
@@ -5516,7 +6926,7 @@ func_mode_link ()
 	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
 	  func_fatal_error "more than one -exported-symbols argument is not allowed"
 	fi
-	if test "X$arg" = "X-export-symbols"; then
+	if test X-export-symbols = "X$arg"; then
 	  prev=expsyms
 	else
 	  prev=expsyms_regex
@@ -5550,9 +6960,9 @@ func_mode_link ()
 	func_stripname "-L" '' "$arg"
 	if test -z "$func_stripname_result"; then
 	  if test "$#" -gt 0; then
-	    func_fatal_error "require no space between \`-L' and \`$1'"
+	    func_fatal_error "require no space between '-L' and '$1'"
 	  else
-	    func_fatal_error "need path for \`-L' option"
+	    func_fatal_error "need path for '-L' option"
 	  fi
 	fi
 	func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@ func_mode_link ()
 	*)
 	  absdir=`cd "$dir" && pwd`
 	  test -z "$absdir" && \
-	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
-	  dir="$absdir"
+	    func_fatal_error "cannot determine absolute directory name of '$dir'"
+	  dir=$absdir
 	  ;;
 	esac
 	case "$deplibs " in
@@ -5599,7 +7009,7 @@ func_mode_link ()
 	;;
 
       -l*)
-	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	if test X-lc = "X$arg" || test X-lm = "X$arg"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
 	    # These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@ func_mode_link ()
 	    ;;
 	  *-*-os2*)
 	    # These systems don't actually have a C library (as such)
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
-	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	    # Do not include libc due to us having libc/libc_r.
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-rhapsody* | *-*-darwin1.[012])
 	    # Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@ func_mode_link ()
 	    ;;
 	  *-*-sco3.2v5* | *-*-sco5v6*)
 	    # Causes problems with __ctype
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 	    # Compiler inserts libc in the correct place for threads to work
-	    test "X$arg" = "X-lc" && continue
+	    test X-lc = "X$arg" && continue
 	    ;;
 	  esac
-	elif test "X$arg" = "X-lc_r"; then
+	elif test X-lc_r = "X$arg"; then
 	 case $host in
-	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
 	   # Do not include libc_r directly, use -pthread flag.
 	   continue
 	   ;;
@@ -5639,6 +7049,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -mllvm)
+	prev=mllvm
+	continue
+	;;
+
       -module)
 	module=yes
 	continue
@@ -5668,7 +7083,7 @@ func_mode_link ()
 	;;
 
       -multi_module)
-	single_module="${wl}-multi_module"
+	single_module=$wl-multi_module
 	continue
 	;;
 
@@ -5682,8 +7097,8 @@ func_mode_link ()
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
 	  # The PATH hackery in wrapper scripts is required on Windows
 	  # and Darwin in order for the loader to find any dlls it needs.
-	  func_warning "\`-no-install' is ignored for $host"
-	  func_warning "assuming \`-no-fast-install' instead"
+	  func_warning "'-no-install' is ignored for $host"
+	  func_warning "assuming '-no-fast-install' instead"
 	  fast_install=no
 	  ;;
 	*) no_install=yes ;;
@@ -5701,6 +7116,11 @@ func_mode_link ()
 	continue
 	;;
 
+      -os2dllname)
+	prev=os2dllname
+	continue
+	;;
+
       -o) prev=output ;;
 
       -precious-files-regex)
@@ -5788,14 +7208,14 @@ func_mode_link ()
 	func_stripname '-Wc,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $func_quote_for_eval_result"
 	  func_append compiler_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5804,15 +7224,15 @@ func_mode_link ()
 	func_stripname '-Wl,' '' "$arg"
 	args=$func_stripname_result
 	arg=
-	save_ifs="$IFS"; IFS=','
+	save_ifs=$IFS; IFS=,
 	for flag in $args; do
-	  IFS="$save_ifs"
+	  IFS=$save_ifs
           func_quote_for_eval "$flag"
 	  func_append arg " $wl$func_quote_for_eval_result"
 	  func_append compiler_flags " $wl$func_quote_for_eval_result"
 	  func_append linker_flags " $func_quote_for_eval_result"
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 	func_stripname ' ' '' "$arg"
 	arg=$func_stripname_result
 	;;
@@ -5835,7 +7255,7 @@ func_mode_link ()
       # -msg_* for osf cc
       -msg_*)
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       # Flags to be passed through unchanged, with rationale:
@@ -5847,25 +7267,49 @@ func_mode_link ()
       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
       # -F/path              path to uninstalled frameworks, gcc on darwin
       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # -fstack-protector*   stack protector flags for GCC
       # @file                GCC response files
       # -tp=*                Portland pgcc target processor selection
       # --sysroot=*          for sysroot support
-      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -specs=*             GCC specs files
+      # -stdlib=*            select c++ std lib with clang
+      # -fsanitize=*         Clang/GCC memory and address sanitizer
       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
       -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+      -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+      -specs=*|-fsanitize=*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
         func_append compile_command " $arg"
         func_append finalize_command " $arg"
         func_append compiler_flags " $arg"
         continue
         ;;
 
+      -Z*)
+        if test os2 = "`expr $host : '.*\(os2\)'`"; then
+          # OS/2 uses -Zxxx to specify OS/2-specific options
+	  compiler_flags="$compiler_flags $arg"
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  case $arg in
+	  -Zlinker | -Zstack)
+	    prev=xcompiler
+	    ;;
+	  esac
+	  continue
+        else
+	  # Otherwise treat like 'Some other compiler flag' below
+	  func_quote_for_eval "$arg"
+	  arg=$func_quote_for_eval_result
+        fi
+	;;
+
       # Some other compiler flag.
       -* | +*)
         func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
 
       *.$objext)
@@ -5886,21 +7330,21 @@ func_mode_link ()
 
 	  if test -z "$pic_object" ||
 	     test -z "$non_pic_object" ||
-	     test "$pic_object" = none &&
-	     test "$non_pic_object" = none; then
-	    func_fatal_error "cannot find name of object for \`$arg'"
+	     test none = "$pic_object" &&
+	     test none = "$non_pic_object"; then
+	    func_fatal_error "cannot find name of object for '$arg'"
 	  fi
 
 	  # Extract subdirectory from the argument.
 	  func_dirname "$arg" "/" ""
-	  xdir="$func_dirname_result"
+	  xdir=$func_dirname_result
 
-	  if test "$pic_object" != none; then
+	  test none = "$pic_object" || {
 	    # Prepend the subdirectory the object is found in.
-	    pic_object="$xdir$pic_object"
+	    pic_object=$xdir$pic_object
 
-	    if test "$prev" = dlfiles; then
-	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	    if test dlfiles = "$prev"; then
+	      if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
 		func_append dlfiles " $pic_object"
 		prev=
 		continue
@@ -5911,7 +7355,7 @@ func_mode_link ()
 	    fi
 
 	    # CHECK ME:  I think I busted this.  -Ossama
-	    if test "$prev" = dlprefiles; then
+	    if test dlprefiles = "$prev"; then
 	      # Preload the old-style object.
 	      func_append dlprefiles " $pic_object"
 	      prev=
@@ -5919,23 +7363,23 @@ func_mode_link ()
 
 	    # A PIC object.
 	    func_append libobjs " $pic_object"
-	    arg="$pic_object"
-	  fi
+	    arg=$pic_object
+	  }
 
 	  # Non-PIC object.
-	  if test "$non_pic_object" != none; then
+	  if test none != "$non_pic_object"; then
 	    # Prepend the subdirectory the object is found in.
-	    non_pic_object="$xdir$non_pic_object"
+	    non_pic_object=$xdir$non_pic_object
 
 	    # A standard non-PIC object
 	    func_append non_pic_objects " $non_pic_object"
-	    if test -z "$pic_object" || test "$pic_object" = none ; then
-	      arg="$non_pic_object"
+	    if test -z "$pic_object" || test none = "$pic_object"; then
+	      arg=$non_pic_object
 	    fi
 	  else
 	    # If the PIC object exists, use it instead.
 	    # $xdir was prepended to $pic_object above.
-	    non_pic_object="$pic_object"
+	    non_pic_object=$pic_object
 	    func_append non_pic_objects " $non_pic_object"
 	  fi
 	else
@@ -5943,7 +7387,7 @@ func_mode_link ()
 	  if $opt_dry_run; then
 	    # Extract subdirectory from the argument.
 	    func_dirname "$arg" "/" ""
-	    xdir="$func_dirname_result"
+	    xdir=$func_dirname_result
 
 	    func_lo2o "$arg"
 	    pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7395,7 @@ func_mode_link ()
 	    func_append libobjs " $pic_object"
 	    func_append non_pic_objects " $non_pic_object"
 	  else
-	    func_fatal_error "\`$arg' is not a valid libtool object"
+	    func_fatal_error "'$arg' is not a valid libtool object"
 	  fi
 	fi
 	;;
@@ -5967,11 +7411,11 @@ func_mode_link ()
 	# A libtool-controlled library.
 
 	func_resolve_sysroot "$arg"
-	if test "$prev" = dlfiles; then
+	if test dlfiles = "$prev"; then
 	  # This library was specified with -dlopen.
 	  func_append dlfiles " $func_resolve_sysroot_result"
 	  prev=
-	elif test "$prev" = dlprefiles; then
+	elif test dlprefiles = "$prev"; then
 	  # The library was specified with -dlpreopen.
 	  func_append dlprefiles " $func_resolve_sysroot_result"
 	  prev=
@@ -5986,7 +7430,7 @@ func_mode_link ()
 	# Unknown arguments in both finalize_command and compile_command need
 	# to be aesthetically quoted because they are evaled later.
 	func_quote_for_eval "$arg"
-	arg="$func_quote_for_eval_result"
+	arg=$func_quote_for_eval_result
 	;;
       esac # arg
 
@@ -5998,9 +7442,9 @@ func_mode_link ()
     done # argument parsing loop
 
     test -n "$prev" && \
-      func_fatal_help "the \`$prevarg' option requires an argument"
+      func_fatal_help "the '$prevarg' option requires an argument"
 
-    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+    if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
       eval arg=\"$export_dynamic_flag_spec\"
       func_append compile_command " $arg"
       func_append finalize_command " $arg"
@@ -6009,20 +7453,23 @@ func_mode_link ()
     oldlibs=
     # calculate the name of the file, without its directory
     func_basename "$output"
-    outputname="$func_basename_result"
-    libobjs_save="$libobjs"
+    outputname=$func_basename_result
+    libobjs_save=$libobjs
 
     if test -n "$shlibpath_var"; then
       # get the directories listed in $shlibpath_var
-      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+      eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
     else
       shlib_search_path=
     fi
     eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
     eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
 
+    # Definition is injected by LT_CONFIG during libtool generation.
+    func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
     func_dirname "$output" "/" ""
-    output_objdir="$func_dirname_result$objdir"
+    output_objdir=$func_dirname_result$objdir
     func_to_tool_file "$output_objdir/"
     tool_output_objdir=$func_to_tool_file_result
     # Create the object directory.
@@ -6045,7 +7492,7 @@ func_mode_link ()
     # Find all interdependent deplibs by searching for libraries
     # that are linked more than once (e.g. -la -lb -la)
     for deplib in $deplibs; do
-      if $opt_preserve_dup_deps ; then
+      if $opt_preserve_dup_deps; then
 	case "$libs " in
 	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	esac
@@ -6053,7 +7500,7 @@ func_mode_link ()
       func_append libs " $deplib"
     done
 
-    if test "$linkmode" = lib; then
+    if test lib = "$linkmode"; then
       libs="$predeps $libs $compiler_lib_search_path $postdeps"
 
       # Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7532,7 @@ func_mode_link ()
 	  case $file in
 	  *.la) ;;
 	  *)
-	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
 	    ;;
 	  esac
 	done
@@ -6093,7 +7540,7 @@ func_mode_link ()
     prog)
 	compile_deplibs=
 	finalize_deplibs=
-	alldeplibs=no
+	alldeplibs=false
 	newdlfiles=
 	newdlprefiles=
 	passes="conv scan dlopen dlpreopen link"
@@ -6105,32 +7552,32 @@ func_mode_link ()
     for pass in $passes; do
       # The preopen pass in lib mode reverses $deplibs; put it back here
       # so that -L comes before libs that need it for instance...
-      if test "$linkmode,$pass" = "lib,link"; then
+      if test lib,link = "$linkmode,$pass"; then
 	## FIXME: Find the place where the list is rebuilt in the wrong
 	##        order, and fix it there properly
         tmp_deplibs=
 	for deplib in $deplibs; do
 	  tmp_deplibs="$deplib $tmp_deplibs"
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
       fi
 
-      if test "$linkmode,$pass" = "lib,link" ||
-	 test "$linkmode,$pass" = "prog,scan"; then
-	libs="$deplibs"
+      if test lib,link = "$linkmode,$pass" ||
+	 test prog,scan = "$linkmode,$pass"; then
+	libs=$deplibs
 	deplibs=
       fi
-      if test "$linkmode" = prog; then
+      if test prog = "$linkmode"; then
 	case $pass in
-	dlopen) libs="$dlfiles" ;;
-	dlpreopen) libs="$dlprefiles" ;;
+	dlopen) libs=$dlfiles ;;
+	dlpreopen) libs=$dlprefiles ;;
 	link)
 	  libs="$deplibs %DEPLIBS%"
 	  test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 	  ;;
 	esac
       fi
-      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+      if test lib,dlpreopen = "$linkmode,$pass"; then
 	# Collect and forward deplibs of preopened libtool libs
 	for lib in $dlprefiles; do
 	  # Ignore non-libtool-libs
@@ -6151,26 +7598,26 @@ func_mode_link ()
 	    esac
 	  done
 	done
-	libs="$dlprefiles"
+	libs=$dlprefiles
       fi
-      if test "$pass" = dlopen; then
+      if test dlopen = "$pass"; then
 	# Collect dlpreopened libraries
-	save_deplibs="$deplibs"
+	save_deplibs=$deplibs
 	deplibs=
       fi
 
       for deplib in $libs; do
 	lib=
-	found=no
+	found=false
 	case $deplib in
 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
         |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    func_append compiler_flags " $deplib"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6180,13 +7627,13 @@ func_mode_link ()
 	  continue
 	  ;;
 	-l*)
-	  if test "$linkmode" != lib && test "$linkmode" != prog; then
-	    func_warning "\`-l' is ignored for archives/objects"
+	  if test lib != "$linkmode" && test prog != "$linkmode"; then
+	    func_warning "'-l' is ignored for archives/objects"
 	    continue
 	  fi
 	  func_stripname '-l' '' "$deplib"
 	  name=$func_stripname_result
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 	  else
 	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6194,31 +7641,22 @@ func_mode_link ()
 	  for searchdir in $searchdirs; do
 	    for search_ext in .la $std_shrext .so .a; do
 	      # Search the libtool library
-	      lib="$searchdir/lib${name}${search_ext}"
+	      lib=$searchdir/lib$name$search_ext
 	      if test -f "$lib"; then
-		if test "$search_ext" = ".la"; then
-		  found=yes
+		if test .la = "$search_ext"; then
+		  found=:
 		else
-		  found=no
+		  found=false
 		fi
 		break 2
 	      fi
 	    done
 	  done
-	  if test "$found" != yes; then
-	    # deplib doesn't seem to be a libtool library
-	    if test "$linkmode,$pass" = "prog,link"; then
-	      compile_deplibs="$deplib $compile_deplibs"
-	      finalize_deplibs="$deplib $finalize_deplibs"
-	    else
-	      deplibs="$deplib $deplibs"
-	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
-	    fi
-	    continue
-	  else # deplib is a libtool library
+	  if $found; then
+	    # deplib is a libtool library
 	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
 	    # We need to do some special things here, and not later.
-	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 	      case " $predeps $postdeps " in
 	      *" $deplib "*)
 		if func_lalib_p "$lib"; then
@@ -6226,19 +7664,19 @@ func_mode_link ()
 		  old_library=
 		  func_source "$lib"
 		  for l in $old_library $library_names; do
-		    ll="$l"
+		    ll=$l
 		  done
-		  if test "X$ll" = "X$old_library" ; then # only static version available
-		    found=no
+		  if test "X$ll" = "X$old_library"; then # only static version available
+		    found=false
 		    func_dirname "$lib" "" "."
-		    ladir="$func_dirname_result"
+		    ladir=$func_dirname_result
 		    lib=$ladir/$old_library
-		    if test "$linkmode,$pass" = "prog,link"; then
+		    if test prog,link = "$linkmode,$pass"; then
 		      compile_deplibs="$deplib $compile_deplibs"
 		      finalize_deplibs="$deplib $finalize_deplibs"
 		    else
 		      deplibs="$deplib $deplibs"
-		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
 		    fi
 		    continue
 		  fi
@@ -6247,15 +7685,25 @@ func_mode_link ()
 	      *) ;;
 	      esac
 	    fi
+	  else
+	    # deplib doesn't seem to be a libtool library
+	    if test prog,link = "$linkmode,$pass"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
 	  fi
 	  ;; # -l
 	*.ltframework)
-	  if test "$linkmode,$pass" = "prog,link"; then
+	  if test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$deplib $compile_deplibs"
 	    finalize_deplibs="$deplib $finalize_deplibs"
 	  else
 	    deplibs="$deplib $deplibs"
-	    if test "$linkmode" = lib ; then
+	    if test lib = "$linkmode"; then
 		case "$new_inherited_linker_flags " in
 		    *" $deplib "*) ;;
 		    * ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6268,18 +7716,18 @@ func_mode_link ()
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
-	    test "$pass" = conv && continue
+	    test conv = "$pass" && continue
 	    newdependency_libs="$deplib $newdependency_libs"
 	    func_stripname '-L' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  prog)
-	    if test "$pass" = conv; then
+	    if test conv = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	      continue
 	    fi
-	    if test "$pass" = scan; then
+	    if test scan = "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6290,13 +7738,13 @@ func_mode_link ()
 	    func_append newlib_search_path " $func_resolve_sysroot_result"
 	    ;;
 	  *)
-	    func_warning "\`-L' is ignored for archives/objects"
+	    func_warning "'-L' is ignored for archives/objects"
 	    ;;
 	  esac # linkmode
 	  continue
 	  ;; # -L
 	-R*)
-	  if test "$pass" = link; then
+	  if test link = "$pass"; then
 	    func_stripname '-R' '' "$deplib"
 	    func_resolve_sysroot "$func_stripname_result"
 	    dir=$func_resolve_sysroot_result
@@ -6314,7 +7762,7 @@ func_mode_link ()
 	  lib=$func_resolve_sysroot_result
 	  ;;
 	*.$libext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
 	    continue
 	  fi
@@ -6325,21 +7773,26 @@ func_mode_link ()
 	    case " $dlpreconveniencelibs " in
 	    *" $deplib "*) ;;
 	    *)
-	      valid_a_lib=no
+	      valid_a_lib=false
 	      case $deplibs_check_method in
 		match_pattern*)
 		  set dummy $deplibs_check_method; shift
 		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
 		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
 		    | $EGREP "$match_pattern_regex" > /dev/null; then
-		    valid_a_lib=yes
+		    valid_a_lib=:
 		  fi
 		;;
 		pass_all)
-		  valid_a_lib=yes
+		  valid_a_lib=:
 		;;
 	      esac
-	      if test "$valid_a_lib" != yes; then
+	      if $valid_a_lib; then
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      else
 		echo
 		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
 		echo "*** I have the capability to make that library automatically link in when"
@@ -6347,18 +7800,13 @@ func_mode_link ()
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because the file extensions .$libext of this argument makes me believe"
 		echo "*** that it is just a static archive that I should not use here."
-	      else
-		echo
-		$ECHO "*** Warning: Linking the shared library $output against the"
-		$ECHO "*** static library $deplib is not portable!"
-		deplibs="$deplib $deplibs"
 	      fi
 	      ;;
 	    esac
 	    continue
 	    ;;
 	  prog)
-	    if test "$pass" != link; then
+	    if test link != "$pass"; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      compile_deplibs="$deplib $compile_deplibs"
@@ -6369,10 +7817,10 @@ func_mode_link ()
 	  esac # linkmode
 	  ;; # *.$libext
 	*.lo | *.$objext)
-	  if test "$pass" = conv; then
+	  if test conv = "$pass"; then
 	    deplibs="$deplib $deplibs"
-	  elif test "$linkmode" = prog; then
-	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	  elif test prog = "$linkmode"; then
+	    if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
 	      # If there is no dlopen support or we're linking statically,
 	      # we need to preload.
 	      func_append newdlprefiles " $deplib"
@@ -6385,22 +7833,20 @@ func_mode_link ()
 	  continue
 	  ;;
 	%DEPLIBS%)
-	  alldeplibs=yes
+	  alldeplibs=:
 	  continue
 	  ;;
 	esac # case $deplib
 
-	if test "$found" = yes || test -f "$lib"; then :
-	else
-	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
-	fi
+	$found || test -f "$lib" \
+	  || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
 
 	# Check to see that this really is a libtool archive.
 	func_lalib_unsafe_p "$lib" \
-	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+	  || func_fatal_error "'$lib' is not a valid libtool archive"
 
 	func_dirname "$lib" "" "."
-	ladir="$func_dirname_result"
+	ladir=$func_dirname_result
 
 	dlname=
 	dlopen=
@@ -6430,19 +7876,19 @@ func_mode_link ()
 	  done
 	fi
 	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
-	if test "$linkmode,$pass" = "lib,link" ||
-	   test "$linkmode,$pass" = "prog,scan" ||
-	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	if test lib,link = "$linkmode,$pass" ||
+	   test prog,scan = "$linkmode,$pass" ||
+	   { test prog != "$linkmode" && test lib != "$linkmode"; }; then
 	  test -n "$dlopen" && func_append dlfiles " $dlopen"
 	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
 	fi
 
-	if test "$pass" = conv; then
+	if test conv = "$pass"; then
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  if test -z "$libdir"; then
 	    if test -z "$old_library"; then
-	      func_fatal_error "cannot find name of link library for \`$lib'"
+	      func_fatal_error "cannot find name of link library for '$lib'"
 	    fi
 	    # It is a libtool convenience library, so add in its objects.
 	    func_append convenience " $ladir/$objdir/$old_library"
@@ -6450,15 +7896,15 @@ func_mode_link ()
 	    tmp_libs=
 	    for deplib in $dependency_libs; do
 	      deplibs="$deplib $deplibs"
-	      if $opt_preserve_dup_deps ; then
+	      if $opt_preserve_dup_deps; then
 		case "$tmp_libs " in
 		*" $deplib "*) func_append specialdeplibs " $deplib" ;;
 		esac
 	      fi
 	      func_append tmp_libs " $deplib"
 	    done
-	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
-	    func_fatal_error "\`$lib' is not a convenience library"
+	  elif test prog != "$linkmode" && test lib != "$linkmode"; then
+	    func_fatal_error "'$lib' is not a convenience library"
 	  fi
 	  continue
 	fi # $pass = conv
@@ -6467,26 +7913,26 @@ func_mode_link ()
 	# Get the name of the library we link against.
 	linklib=
 	if test -n "$old_library" &&
-	   { test "$prefer_static_libs" = yes ||
-	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	   { test yes = "$prefer_static_libs" ||
+	     test built,no = "$prefer_static_libs,$installed"; }; then
 	  linklib=$old_library
 	else
 	  for l in $old_library $library_names; do
-	    linklib="$l"
+	    linklib=$l
 	  done
 	fi
 	if test -z "$linklib"; then
-	  func_fatal_error "cannot find name of link library for \`$lib'"
+	  func_fatal_error "cannot find name of link library for '$lib'"
 	fi
 
 	# This library was specified with -dlopen.
-	if test "$pass" = dlopen; then
-	  if test -z "$libdir"; then
-	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
-	  fi
+	if test dlopen = "$pass"; then
+	  test -z "$libdir" \
+	    && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
 	  if test -z "$dlname" ||
-	     test "$dlopen_support" != yes ||
-	     test "$build_libtool_libs" = no; then
+	     test yes != "$dlopen_support" ||
+	     test no = "$build_libtool_libs"
+	  then
 	    # If there is no dlname, no dlopen support or we're linking
 	    # statically, we need to preload.  We also need to preload any
 	    # dependent libraries so libltdl's deplib preloader doesn't
@@ -6500,40 +7946,40 @@ func_mode_link ()
 
 	# We need an absolute path.
 	case $ladir in
-	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
 	*)
 	  abs_ladir=`cd "$ladir" && pwd`
 	  if test -z "$abs_ladir"; then
-	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "cannot determine absolute directory name of '$ladir'"
 	    func_warning "passing it literally to the linker, although it might fail"
-	    abs_ladir="$ladir"
+	    abs_ladir=$ladir
 	  fi
 	  ;;
 	esac
 	func_basename "$lib"
-	laname="$func_basename_result"
+	laname=$func_basename_result
 
 	# Find the relevant object directory and library name.
-	if test "X$installed" = Xyes; then
+	if test yes = "$installed"; then
 	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    func_warning "library \`$lib' was moved."
-	    dir="$ladir"
-	    absdir="$abs_ladir"
-	    libdir="$abs_ladir"
+	    func_warning "library '$lib' was moved."
+	    dir=$ladir
+	    absdir=$abs_ladir
+	    libdir=$abs_ladir
 	  else
-	    dir="$lt_sysroot$libdir"
-	    absdir="$lt_sysroot$libdir"
+	    dir=$lt_sysroot$libdir
+	    absdir=$lt_sysroot$libdir
 	  fi
-	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	  test yes = "$hardcode_automatic" && avoidtemprpath=yes
 	else
 	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
-	    dir="$ladir"
-	    absdir="$abs_ladir"
+	    dir=$ladir
+	    absdir=$abs_ladir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  else
-	    dir="$ladir/$objdir"
-	    absdir="$abs_ladir/$objdir"
+	    dir=$ladir/$objdir
+	    absdir=$abs_ladir/$objdir
 	    # Remove this search path later
 	    func_append notinst_path " $abs_ladir"
 	  fi
@@ -6542,11 +7988,11 @@ func_mode_link ()
 	name=$func_stripname_result
 
 	# This library was specified with -dlpreopen.
-	if test "$pass" = dlpreopen; then
-	  if test -z "$libdir" && test "$linkmode" = prog; then
-	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	if test dlpreopen = "$pass"; then
+	  if test -z "$libdir" && test prog = "$linkmode"; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
 	  fi
-	  case "$host" in
+	  case $host in
 	    # special handling for platforms with PE-DLLs.
 	    *cygwin* | *mingw* | *cegcc* )
 	      # Linker will automatically link against shared library if both
@@ -6590,9 +8036,9 @@ func_mode_link ()
 
 	if test -z "$libdir"; then
 	  # Link the convenience library
-	  if test "$linkmode" = lib; then
+	  if test lib = "$linkmode"; then
 	    deplibs="$dir/$old_library $deplibs"
-	  elif test "$linkmode,$pass" = "prog,link"; then
+	  elif test prog,link = "$linkmode,$pass"; then
 	    compile_deplibs="$dir/$old_library $compile_deplibs"
 	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
 	  else
@@ -6602,14 +8048,14 @@ func_mode_link ()
 	fi
 
 
-	if test "$linkmode" = prog && test "$pass" != link; then
+	if test prog = "$linkmode" && test link != "$pass"; then
 	  func_append newlib_search_path " $ladir"
 	  deplibs="$lib $deplibs"
 
-	  linkalldeplibs=no
-	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
-	     test "$build_libtool_libs" = no; then
-	    linkalldeplibs=yes
+	  linkalldeplibs=false
+	  if test no != "$link_all_deplibs" || test -z "$library_names" ||
+	     test no = "$build_libtool_libs"; then
+	    linkalldeplibs=:
 	  fi
 
 	  tmp_libs=
@@ -6621,14 +8067,14 @@ func_mode_link ()
 		 ;;
 	    esac
 	    # Need to link against all dependency_libs?
-	    if test "$linkalldeplibs" = yes; then
+	    if $linkalldeplibs; then
 	      deplibs="$deplib $deplibs"
 	    else
 	      # Need to hardcode shared library paths
 	      # or/and link against static libraries
 	      newdependency_libs="$deplib $newdependency_libs"
 	    fi
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
 	      esac
@@ -6638,15 +8084,15 @@ func_mode_link ()
 	  continue
 	fi # $linkmode = prog...
 
-	if test "$linkmode,$pass" = "prog,link"; then
+	if test prog,link = "$linkmode,$pass"; then
 	  if test -n "$library_names" &&
-	     { { test "$prefer_static_libs" = no ||
-	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	     { { test no = "$prefer_static_libs" ||
+	         test built,yes = "$prefer_static_libs,$installed"; } ||
 	       test -z "$old_library"; }; then
 	    # We need to hardcode the library path
-	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
 	      # Make sure the rpath contains only unique directories.
-	      case "$temp_rpath:" in
+	      case $temp_rpath: in
 	      *"$absdir:"*) ;;
 	      *) func_append temp_rpath "$absdir:" ;;
 	      esac
@@ -6675,9 +8121,9 @@ func_mode_link ()
 	    esac
 	  fi # $linkmode,$pass = prog,link...
 
-	  if test "$alldeplibs" = yes &&
-	     { test "$deplibs_check_method" = pass_all ||
-	       { test "$build_libtool_libs" = yes &&
+	  if $alldeplibs &&
+	     { test pass_all = "$deplibs_check_method" ||
+	       { test yes = "$build_libtool_libs" &&
 		 test -n "$library_names"; }; }; then
 	    # We only need to search for static libraries
 	    continue
@@ -6686,19 +8132,19 @@ func_mode_link ()
 
 	link_static=no # Whether the deplib will be linked statically
 	use_static_libs=$prefer_static_libs
-	if test "$use_static_libs" = built && test "$installed" = yes; then
+	if test built = "$use_static_libs" && test yes = "$installed"; then
 	  use_static_libs=no
 	fi
 	if test -n "$library_names" &&
-	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	   { test no = "$use_static_libs" || test -z "$old_library"; }; then
 	  case $host in
-	  *cygwin* | *mingw* | *cegcc*)
+	  *cygwin* | *mingw* | *cegcc* | *os2*)
 	      # No point in relinking DLLs because paths are not encoded
 	      func_append notinst_deplibs " $lib"
 	      need_relink=no
 	    ;;
 	  *)
-	    if test "$installed" = no; then
+	    if test no = "$installed"; then
 	      func_append notinst_deplibs " $lib"
 	      need_relink=yes
 	    fi
@@ -6708,24 +8154,24 @@ func_mode_link ()
 
 	  # Warn about portability, can't link against -module's on some
 	  # systems (darwin).  Don't bleat about dlopened modules though!
-	  dlopenmodule=""
+	  dlopenmodule=
 	  for dlpremoduletest in $dlprefiles; do
 	    if test "X$dlpremoduletest" = "X$lib"; then
-	      dlopenmodule="$dlpremoduletest"
+	      dlopenmodule=$dlpremoduletest
 	      break
 	    fi
 	  done
-	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	  if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
 	    echo
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
 	    else
 	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
 	    fi
 	    $ECHO "*** $linklib is not portable!"
 	  fi
-	  if test "$linkmode" = lib &&
-	     test "$hardcode_into_libs" = yes; then
+	  if test lib = "$linkmode" &&
+	     test yes = "$hardcode_into_libs"; then
 	    # Hardcode the library path.
 	    # Skip directories that are in the system default run-time
 	    # search path.
@@ -6753,43 +8199,43 @@ func_mode_link ()
 	    # figure out the soname
 	    set dummy $library_names
 	    shift
-	    realname="$1"
+	    realname=$1
 	    shift
 	    libname=`eval "\\$ECHO \"$libname_spec\""`
 	    # use dlname if we got it. it's perfectly good, no?
 	    if test -n "$dlname"; then
-	      soname="$dlname"
+	      soname=$dlname
 	    elif test -n "$soname_spec"; then
 	      # bleh windows
 	      case $host in
-	      *cygwin* | mingw* | *cegcc*)
+	      *cygwin* | mingw* | *cegcc* | *os2*)
 	        func_arith $current - $age
 		major=$func_arith_result
-		versuffix="-$major"
+		versuffix=-$major
 		;;
 	      esac
 	      eval soname=\"$soname_spec\"
 	    else
-	      soname="$realname"
+	      soname=$realname
 	    fi
 
 	    # Make a new name for the extract_expsyms_cmds to use
-	    soroot="$soname"
+	    soroot=$soname
 	    func_basename "$soroot"
-	    soname="$func_basename_result"
+	    soname=$func_basename_result
 	    func_stripname 'lib' '.dll' "$soname"
 	    newlib=libimp-$func_stripname_result.a
 
 	    # If the library has no export list, then create one now
 	    if test -f "$output_objdir/$soname-def"; then :
 	    else
-	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_verbose "extracting exported symbol list from '$soname'"
 	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
 	    fi
 
 	    # Create $newlib
 	    if test -f "$output_objdir/$newlib"; then :; else
-	      func_verbose "generating import library for \`$soname'"
+	      func_verbose "generating import library for '$soname'"
 	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
 	    fi
 	    # make sure the library variables are pointing to the new library
@@ -6797,58 +8243,58 @@ func_mode_link ()
 	    linklib=$newlib
 	  fi # test -n "$old_archive_from_expsyms_cmds"
 
-	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	  if test prog = "$linkmode" || test relink != "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    lib_linked=yes
 	    case $hardcode_action in
 	    immediate | unsupported)
-	      if test "$hardcode_direct" = no; then
-		add="$dir/$linklib"
+	      if test no = "$hardcode_direct"; then
+		add=$dir/$linklib
 		case $host in
-		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
-		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+		  *-*-sysv4*uw2*) add_dir=-L$dir ;;
 		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
-		    *-*-unixware7*) add_dir="-L$dir" ;;
+		    *-*-unixware7*) add_dir=-L$dir ;;
 		  *-*-darwin* )
-		    # if the lib is a (non-dlopened) module then we can not
+		    # if the lib is a (non-dlopened) module then we cannot
 		    # link against it, someone is ignoring the earlier warnings
 		    if /usr/bin/file -L $add 2> /dev/null |
-			 $GREP ": [^:]* bundle" >/dev/null ; then
+			 $GREP ": [^:]* bundle" >/dev/null; then
 		      if test "X$dlopenmodule" != "X$lib"; then
 			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
-			if test -z "$old_library" ; then
+			if test -z "$old_library"; then
 			  echo
 			  echo "*** And there doesn't seem to be a static archive available"
 			  echo "*** The link will probably fail, sorry"
 			else
-			  add="$dir/$old_library"
+			  add=$dir/$old_library
 			fi
 		      elif test -n "$old_library"; then
-			add="$dir/$old_library"
+			add=$dir/$old_library
 		      fi
 		    fi
 		esac
-	      elif test "$hardcode_minus_L" = no; then
+	      elif test no = "$hardcode_minus_L"; then
 		case $host in
-		*-*-sunos*) add_shlibpath="$dir" ;;
+		*-*-sunos*) add_shlibpath=$dir ;;
 		esac
-		add_dir="-L$dir"
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = no; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add_dir=-L$dir
+		add=-l$name
+	      elif test no = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
 	      ;;
 	    relink)
-	      if test "$hardcode_direct" = yes &&
-	         test "$hardcode_direct_absolute" = no; then
-		add="$dir/$linklib"
-	      elif test "$hardcode_minus_L" = yes; then
-		add_dir="-L$absdir"
+	      if test yes = "$hardcode_direct" &&
+	         test no = "$hardcode_direct_absolute"; then
+		add=$dir/$linklib
+	      elif test yes = "$hardcode_minus_L"; then
+		add_dir=-L$absdir
 		# Try looking first in the location we're being installed to.
 		if test -n "$inst_prefix_dir"; then
 		  case $libdir in
@@ -6857,10 +8303,10 @@ func_mode_link ()
 		      ;;
 		  esac
 		fi
-		add="-l$name"
-	      elif test "$hardcode_shlibpath_var" = yes; then
-		add_shlibpath="$dir"
-		add="-l$name"
+		add=-l$name
+	      elif test yes = "$hardcode_shlibpath_var"; then
+		add_shlibpath=$dir
+		add=-l$name
 	      else
 		lib_linked=no
 	      fi
@@ -6868,7 +8314,7 @@ func_mode_link ()
 	    *) lib_linked=no ;;
 	    esac
 
-	    if test "$lib_linked" != yes; then
+	    if test yes != "$lib_linked"; then
 	      func_fatal_configuration "unsupported hardcode properties"
 	    fi
 
@@ -6878,15 +8324,15 @@ func_mode_link ()
 	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
 	      esac
 	    fi
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
 	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
 	    else
 	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
 	      test -n "$add" && deplibs="$add $deplibs"
-	      if test "$hardcode_direct" != yes &&
-		 test "$hardcode_minus_L" != yes &&
-		 test "$hardcode_shlibpath_var" = yes; then
+	      if test yes != "$hardcode_direct" &&
+		 test yes != "$hardcode_minus_L" &&
+		 test yes = "$hardcode_shlibpath_var"; then
 		case :$finalize_shlibpath: in
 		*":$libdir:"*) ;;
 		*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6895,33 +8341,33 @@ func_mode_link ()
 	    fi
 	  fi
 
-	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	  if test prog = "$linkmode" || test relink = "$opt_mode"; then
 	    add_shlibpath=
 	    add_dir=
 	    add=
 	    # Finalize command for both is simple: just hardcode it.
-	    if test "$hardcode_direct" = yes &&
-	       test "$hardcode_direct_absolute" = no; then
-	      add="$libdir/$linklib"
-	    elif test "$hardcode_minus_L" = yes; then
-	      add_dir="-L$libdir"
-	      add="-l$name"
-	    elif test "$hardcode_shlibpath_var" = yes; then
+	    if test yes = "$hardcode_direct" &&
+	       test no = "$hardcode_direct_absolute"; then
+	      add=$libdir/$linklib
+	    elif test yes = "$hardcode_minus_L"; then
+	      add_dir=-L$libdir
+	      add=-l$name
+	    elif test yes = "$hardcode_shlibpath_var"; then
 	      case :$finalize_shlibpath: in
 	      *":$libdir:"*) ;;
 	      *) func_append finalize_shlibpath "$libdir:" ;;
 	      esac
-	      add="-l$name"
-	    elif test "$hardcode_automatic" = yes; then
+	      add=-l$name
+	    elif test yes = "$hardcode_automatic"; then
 	      if test -n "$inst_prefix_dir" &&
-		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
-		add="$inst_prefix_dir$libdir/$linklib"
+		 test -f "$inst_prefix_dir$libdir/$linklib"; then
+		add=$inst_prefix_dir$libdir/$linklib
 	      else
-		add="$libdir/$linklib"
+		add=$libdir/$linklib
 	      fi
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
-	      add_dir="-L$libdir"
+	      add_dir=-L$libdir
 	      # Try looking first in the location we're being installed to.
 	      if test -n "$inst_prefix_dir"; then
 		case $libdir in
@@ -6930,10 +8376,10 @@ func_mode_link ()
 		    ;;
 		esac
 	      fi
-	      add="-l$name"
+	      add=-l$name
 	    fi
 
-	    if test "$linkmode" = prog; then
+	    if test prog = "$linkmode"; then
 	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
 	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
 	    else
@@ -6941,43 +8387,43 @@ func_mode_link ()
 	      test -n "$add" && deplibs="$add $deplibs"
 	    fi
 	  fi
-	elif test "$linkmode" = prog; then
+	elif test prog = "$linkmode"; then
 	  # Here we assume that one of hardcode_direct or hardcode_minus_L
 	  # is not unsupported.  This is valid on all known static and
 	  # shared platforms.
-	  if test "$hardcode_direct" != unsupported; then
-	    test -n "$old_library" && linklib="$old_library"
+	  if test unsupported != "$hardcode_direct"; then
+	    test -n "$old_library" && linklib=$old_library
 	    compile_deplibs="$dir/$linklib $compile_deplibs"
 	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
 	  else
 	    compile_deplibs="-l$name -L$dir $compile_deplibs"
 	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
 	  fi
-	elif test "$build_libtool_libs" = yes; then
+	elif test yes = "$build_libtool_libs"; then
 	  # Not a shared library
-	  if test "$deplibs_check_method" != pass_all; then
+	  if test pass_all != "$deplibs_check_method"; then
 	    # We're trying link a shared library against a static one
 	    # but the system doesn't support it.
 
 	    # Just print a warning and add the library to dependency_libs so
 	    # that the program can be linked against the static library.
 	    echo
-	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    $ECHO "*** Warning: This system cannot link to static lib archive $lib."
 	    echo "*** I have the capability to make that library automatically link in when"
 	    echo "*** you link to this library.  But I can only do this if you have a"
 	    echo "*** shared version of the library, which you do not appear to have."
-	    if test "$module" = yes; then
+	    if test yes = "$module"; then
 	      echo "*** But as you try to build a module library, libtool will still create "
 	      echo "*** a static module, that should work as long as the dlopening application"
 	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
 	      if test -z "$global_symbol_pipe"; then
 		echo
 		echo "*** However, this would only work if libtool was able to extract symbol"
-		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 		echo "*** not find such a program.  So, this module is probably useless."
-		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+		echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	      fi
-	      if test "$build_old_libs" = no; then
+	      if test no = "$build_old_libs"; then
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -6990,11 +8436,11 @@ func_mode_link ()
 	  fi
 	fi # link shared/static library?
 
-	if test "$linkmode" = lib; then
+	if test lib = "$linkmode"; then
 	  if test -n "$dependency_libs" &&
-	     { test "$hardcode_into_libs" != yes ||
-	       test "$build_old_libs" = yes ||
-	       test "$link_static" = yes; }; then
+	     { test yes != "$hardcode_into_libs" ||
+	       test yes = "$build_old_libs" ||
+	       test yes = "$link_static"; }; then
 	    # Extract -R from dependency_libs
 	    temp_deplibs=
 	    for libdir in $dependency_libs; do
@@ -7008,12 +8454,12 @@ func_mode_link ()
 	      *) func_append temp_deplibs " $libdir";;
 	      esac
 	    done
-	    dependency_libs="$temp_deplibs"
+	    dependency_libs=$temp_deplibs
 	  fi
 
 	  func_append newlib_search_path " $absdir"
 	  # Link against this library
-	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
 	  # ... and its dependency_libs
 	  tmp_libs=
 	  for deplib in $dependency_libs; do
@@ -7023,7 +8469,7 @@ func_mode_link ()
                    func_resolve_sysroot "$func_stripname_result";;
               *) func_resolve_sysroot "$deplib" ;;
             esac
-	    if $opt_preserve_dup_deps ; then
+	    if $opt_preserve_dup_deps; then
 	      case "$tmp_libs " in
 	      *" $func_resolve_sysroot_result "*)
                 func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7032,12 +8478,12 @@ func_mode_link ()
 	    func_append tmp_libs " $func_resolve_sysroot_result"
 	  done
 
-	  if test "$link_all_deplibs" != no; then
+	  if test no != "$link_all_deplibs"; then
 	    # Add the search paths of all dependency libraries
 	    for deplib in $dependency_libs; do
 	      path=
 	      case $deplib in
-	      -L*) path="$deplib" ;;
+	      -L*) path=$deplib ;;
 	      *.la)
 	        func_resolve_sysroot "$deplib"
 	        deplib=$func_resolve_sysroot_result
@@ -7045,12 +8491,12 @@ func_mode_link ()
 		dir=$func_dirname_result
 		# We need an absolute path.
 		case $dir in
-		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
 		*)
 		  absdir=`cd "$dir" && pwd`
 		  if test -z "$absdir"; then
-		    func_warning "cannot determine absolute directory name of \`$dir'"
-		    absdir="$dir"
+		    func_warning "cannot determine absolute directory name of '$dir'"
+		    absdir=$dir
 		  fi
 		  ;;
 		esac
@@ -7058,35 +8504,35 @@ func_mode_link ()
 		case $host in
 		*-*-darwin*)
 		  depdepl=
-		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
-		  if test -n "$deplibrary_names" ; then
-		    for tmp in $deplibrary_names ; do
+		  eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names"; then
+		    for tmp in $deplibrary_names; do
 		      depdepl=$tmp
 		    done
-		    if test -f "$absdir/$objdir/$depdepl" ; then
-		      depdepl="$absdir/$objdir/$depdepl"
-		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+		    if test -f "$absdir/$objdir/$depdepl"; then
+		      depdepl=$absdir/$objdir/$depdepl
+		      darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
                       if test -z "$darwin_install_name"; then
-                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                          darwin_install_name=`$OTOOL64 -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
                       fi
-		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
-		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+		      func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
 		      path=
 		    fi
 		  fi
 		  ;;
 		*)
-		  path="-L$absdir/$objdir"
+		  path=-L$absdir/$objdir
 		  ;;
 		esac
 		else
-		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 		  test -z "$libdir" && \
-		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		    func_fatal_error "'$deplib' is not a valid libtool archive"
 		  test "$absdir" != "$libdir" && \
-		    func_warning "\`$deplib' seems to be moved"
+		    func_warning "'$deplib' seems to be moved"
 
-		  path="-L$absdir"
+		  path=-L$absdir
 		fi
 		;;
 	      esac
@@ -7098,23 +8544,23 @@ func_mode_link ()
 	  fi # link_all_deplibs != no
 	fi # linkmode = lib
       done # for deplib in $libs
-      if test "$pass" = link; then
-	if test "$linkmode" = "prog"; then
+      if test link = "$pass"; then
+	if test prog = "$linkmode"; then
 	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
 	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
 	else
 	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 	fi
       fi
-      dependency_libs="$newdependency_libs"
-      if test "$pass" = dlpreopen; then
+      dependency_libs=$newdependency_libs
+      if test dlpreopen = "$pass"; then
 	# Link the dlpreopened libraries before other libraries
 	for deplib in $save_deplibs; do
 	  deplibs="$deplib $deplibs"
 	done
       fi
-      if test "$pass" != dlopen; then
-	if test "$pass" != conv; then
+      if test dlopen != "$pass"; then
+	test conv = "$pass" || {
 	  # Make sure lib_search_path contains only unique directories.
 	  lib_search_path=
 	  for dir in $newlib_search_path; do
@@ -7124,12 +8570,12 @@ func_mode_link ()
 	    esac
 	  done
 	  newlib_search_path=
-	fi
+	}
 
-	if test "$linkmode,$pass" != "prog,link"; then
-	  vars="deplibs"
-	else
+	if test prog,link = "$linkmode,$pass"; then
 	  vars="compile_deplibs finalize_deplibs"
+	else
+	  vars=deplibs
 	fi
 	for var in $vars dependency_libs; do
 	  # Add libraries to $var in reverse order
@@ -7187,62 +8633,93 @@ func_mode_link ()
 	  eval $var=\"$tmp_libs\"
 	done # for var
       fi
+
+      # Add Sun CC postdeps if required:
+      test CXX = "$tagname" && {
+        case $host_os in
+        linux*)
+          case `$CC -V 2>&1 | sed 5q` in
+          *Sun\ C*) # Sun C++ 5.9
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+
+        solaris*)
+          func_cc_basename "$CC"
+          case $func_cc_basename_result in
+          CC* | sunCC*)
+            func_suncc_cstd_abi
+
+            if test no != "$suncc_use_cstd_abi"; then
+              func_append postdeps ' -library=Cstd -library=Crun'
+            fi
+            ;;
+          esac
+          ;;
+        esac
+      }
+
       # Last step: remove runtime libs from dependency_libs
       # (they stay in deplibs)
       tmp_libs=
-      for i in $dependency_libs ; do
+      for i in $dependency_libs; do
 	case " $predeps $postdeps $compiler_lib_search_path " in
 	*" $i "*)
-	  i=""
+	  i=
 	  ;;
 	esac
-	if test -n "$i" ; then
+	if test -n "$i"; then
 	  func_append tmp_libs " $i"
 	fi
       done
       dependency_libs=$tmp_libs
     done # for pass
-    if test "$linkmode" = prog; then
-      dlfiles="$newdlfiles"
+    if test prog = "$linkmode"; then
+      dlfiles=$newdlfiles
     fi
-    if test "$linkmode" = prog || test "$linkmode" = lib; then
-      dlprefiles="$newdlprefiles"
+    if test prog = "$linkmode" || test lib = "$linkmode"; then
+      dlprefiles=$newdlprefiles
     fi
 
     case $linkmode in
     oldlib)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for archives"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for archives"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+	func_warning "'-l' and '-L' are ignored for archives" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for archives"
+	func_warning "'-rpath' is ignored for archives"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for archives"
+	func_warning "'-R' is ignored for archives"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info/-version-number' is ignored for archives"
+	func_warning "'-version-info/-version-number' is ignored for archives"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for archives"
+	func_warning "'-release' is ignored for archives"
 
       test -n "$export_symbols$export_symbols_regex" && \
-	func_warning "\`-export-symbols' is ignored for archives"
+	func_warning "'-export-symbols' is ignored for archives"
 
       # Now set the variables for building old libraries.
       build_libtool_libs=no
-      oldlibs="$output"
+      oldlibs=$output
       func_append objs "$old_deplibs"
       ;;
 
     lib)
-      # Make sure we only generate libraries of the form `libNAME.la'.
+      # Make sure we only generate libraries of the form 'libNAME.la'.
       case $outputname in
       lib*)
 	func_stripname 'lib' '.la' "$outputname"
@@ -7251,10 +8728,10 @@ func_mode_link ()
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	test "$module" = no && \
-	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+	test no = "$module" \
+	  && func_fatal_help "libtool library '$output' must begin with 'lib'"
 
-	if test "$need_lib_prefix" != no; then
+	if test no != "$need_lib_prefix"; then
 	  # Add the "lib" prefix for modules if required
 	  func_stripname '' '.la' "$outputname"
 	  name=$func_stripname_result
@@ -7268,8 +8745,8 @@ func_mode_link ()
       esac
 
       if test -n "$objs"; then
-	if test "$deplibs_check_method" != pass_all; then
-	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	if test pass_all != "$deplibs_check_method"; then
+	  func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
 	else
 	  echo
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7278,21 +8755,21 @@ func_mode_link ()
 	fi
       fi
 
-      test "$dlself" != no && \
-	func_warning "\`-dlopen self' is ignored for libtool libraries"
+      test no = "$dlself" \
+	|| func_warning "'-dlopen self' is ignored for libtool libraries"
 
       set dummy $rpath
       shift
-      test "$#" -gt 1 && \
-	func_warning "ignoring multiple \`-rpath's for a libtool library"
+      test 1 -lt "$#" \
+	&& func_warning "ignoring multiple '-rpath's for a libtool library"
 
-      install_libdir="$1"
+      install_libdir=$1
 
       oldlibs=
       if test -z "$rpath"; then
-	if test "$build_libtool_libs" = yes; then
+	if test yes = "$build_libtool_libs"; then
 	  # Building a libtool convenience library.
-	  # Some compilers have problems with a `.al' extension so
+	  # Some compilers have problems with a '.al' extension so
 	  # convenience libraries should have the same extension an
 	  # archive normally would.
 	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7301,20 +8778,20 @@ func_mode_link ()
 	fi
 
 	test -n "$vinfo" && \
-	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+	  func_warning "'-version-info/-version-number' is ignored for convenience libraries"
 
 	test -n "$release" && \
-	  func_warning "\`-release' is ignored for convenience libraries"
+	  func_warning "'-release' is ignored for convenience libraries"
       else
 
 	# Parse the version information argument.
-	save_ifs="$IFS"; IFS=':'
+	save_ifs=$IFS; IFS=:
 	set dummy $vinfo 0 0 0
 	shift
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	test -n "$7" && \
-	  func_fatal_help "too many parameters to \`-version-info'"
+	  func_fatal_help "too many parameters to '-version-info'"
 
 	# convert absolute version numbers to libtool ages
 	# this retains compatibility with .la files and attempts
@@ -7322,45 +8799,45 @@ func_mode_link ()
 
 	case $vinfo_number in
 	yes)
-	  number_major="$1"
-	  number_minor="$2"
-	  number_revision="$3"
+	  number_major=$1
+	  number_minor=$2
+	  number_revision=$3
 	  #
 	  # There are really only two kinds -- those that
 	  # use the current revision as the major version
 	  # and those that subtract age and use age as
 	  # a minor version.  But, then there is irix
-	  # which has an extra 1 added just for fun
+	  # that has an extra 1 added just for fun
 	  #
 	  case $version_type in
 	  # correct linux to gnu/linux during the next big refactor
-	  darwin|linux|osf|windows|none)
+	  darwin|freebsd-elf|linux|osf|windows|none)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_revision"
+	    age=$number_minor
+	    revision=$number_revision
 	    ;;
-	  freebsd-aout|freebsd-elf|qnx|sunos)
-	    current="$number_major"
-	    revision="$number_minor"
-	    age="0"
+	  freebsd-aout|qnx|sunos)
+	    current=$number_major
+	    revision=$number_minor
+	    age=0
 	    ;;
 	  irix|nonstopux)
 	    func_arith $number_major + $number_minor
 	    current=$func_arith_result
-	    age="$number_minor"
-	    revision="$number_minor"
+	    age=$number_minor
+	    revision=$number_minor
 	    lt_irix_increment=no
 	    ;;
 	  *)
-	    func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+	    func_fatal_configuration "$modename: unknown library version type '$version_type'"
 	    ;;
 	  esac
 	  ;;
 	no)
-	  current="$1"
-	  revision="$2"
-	  age="$3"
+	  current=$1
+	  revision=$2
+	  age=$3
 	  ;;
 	esac
 
@@ -7368,30 +8845,30 @@ func_mode_link ()
 	case $current in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "CURRENT \`$current' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "CURRENT '$current' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $revision in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "REVISION \`$revision' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "REVISION '$revision' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	case $age in
 	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
 	*)
-	  func_error "AGE \`$age' must be a nonnegative integer"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' must be a nonnegative integer"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	  ;;
 	esac
 
 	if test "$age" -gt "$current"; then
-	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
-	  func_fatal_error "\`$vinfo' is not valid version information"
+	  func_error "AGE '$age' is greater than the current interface number '$current'"
+	  func_fatal_error "'$vinfo' is not valid version information"
 	fi
 
 	# Calculate the version variables.
@@ -7406,26 +8883,36 @@ func_mode_link ()
 	  # verstring for coding it into the library header
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  # Darwin ld doesn't like 0 for these options...
 	  func_arith $current + 1
 	  minor_current=$func_arith_result
-	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
 	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+          # On Darwin other compilers
+          case $CC in
+              nagfor*)
+                  verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+                  ;;
+              *)
+                  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+                  ;;
+          esac
 	  ;;
 
 	freebsd-aout)
-	  major=".$current"
-	  versuffix=".$current.$revision";
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	freebsd-elf)
-	  major=".$current"
-	  versuffix=".$current"
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	irix | nonstopux)
-	  if test "X$lt_irix_increment" = "Xno"; then
+	  if test no = "$lt_irix_increment"; then
 	    func_arith $current - $age
 	  else
 	    func_arith $current - $age + 1
@@ -7436,69 +8923,74 @@ func_mode_link ()
 	    nonstopux) verstring_prefix=nonstopux ;;
 	    *)         verstring_prefix=sgi ;;
 	  esac
-	  verstring="$verstring_prefix$major.$revision"
+	  verstring=$verstring_prefix$major.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$revision
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $revision - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring_prefix$major.$iface:$verstring"
+	    verstring=$verstring_prefix$major.$iface:$verstring
 	  done
 
-	  # Before this point, $major must not contain `.'.
+	  # Before this point, $major must not contain '.'.
 	  major=.$major
-	  versuffix="$major.$revision"
+	  versuffix=$major.$revision
 	  ;;
 
 	linux) # correct to gnu/linux during the next big refactor
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix="$major.$age.$revision"
+	  versuffix=$major.$age.$revision
 	  ;;
 
 	osf)
 	  func_arith $current - $age
 	  major=.$func_arith_result
-	  versuffix=".$current.$age.$revision"
-	  verstring="$current.$age.$revision"
+	  versuffix=.$current.$age.$revision
+	  verstring=$current.$age.$revision
 
 	  # Add in all the interfaces that we are compatible with.
 	  loop=$age
-	  while test "$loop" -ne 0; do
+	  while test 0 -ne "$loop"; do
 	    func_arith $current - $loop
 	    iface=$func_arith_result
 	    func_arith $loop - 1
 	    loop=$func_arith_result
-	    verstring="$verstring:${iface}.0"
+	    verstring=$verstring:$iface.0
 	  done
 
 	  # Make executables depend on our current version.
-	  func_append verstring ":${current}.0"
+	  func_append verstring ":$current.0"
 	  ;;
 
 	qnx)
-	  major=".$current"
-	  versuffix=".$current"
+	  major=.$current
+	  versuffix=.$current
+	  ;;
+
+	sco)
+	  major=.$current
+	  versuffix=.$current
 	  ;;
 
 	sunos)
-	  major=".$current"
-	  versuffix=".$current.$revision"
+	  major=.$current
+	  versuffix=.$current.$revision
 	  ;;
 
 	windows)
 	  # Use '-' rather than '.', since we only want one
-	  # extension on DOS 8.3 filesystems.
+	  # extension on DOS 8.3 file systems.
 	  func_arith $current - $age
 	  major=$func_arith_result
-	  versuffix="-$major"
+	  versuffix=-$major
 	  ;;
 
 	*)
-	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  func_fatal_configuration "unknown library version type '$version_type'"
 	  ;;
 	esac
 
@@ -7512,42 +9004,45 @@ func_mode_link ()
 	    verstring=
 	    ;;
 	  *)
-	    verstring="0.0"
+	    verstring=0.0
 	    ;;
 	  esac
-	  if test "$need_version" = no; then
+	  if test no = "$need_version"; then
 	    versuffix=
 	  else
-	    versuffix=".0.0"
+	    versuffix=.0.0
 	  fi
 	fi
 
 	# Remove version info from name if versioning should be avoided
-	if test "$avoid_version" = yes && test "$need_version" = no; then
+	if test yes,no = "$avoid_version,$need_version"; then
 	  major=
 	  versuffix=
-	  verstring=""
+	  verstring=
 	fi
 
 	# Check to see if the archive will have undefined symbols.
-	if test "$allow_undefined" = yes; then
-	  if test "$allow_undefined_flag" = unsupported; then
-	    func_warning "undefined symbols not allowed in $host shared libraries"
-	    build_libtool_libs=no
-	    build_old_libs=yes
+	if test yes = "$allow_undefined"; then
+	  if test unsupported = "$allow_undefined_flag"; then
+	    if test yes = "$build_old_libs"; then
+	      func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+	      build_libtool_libs=no
+	    else
+	      func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+	    fi
 	  fi
 	else
 	  # Don't allow undefined symbols.
-	  allow_undefined_flag="$no_undefined_flag"
+	  allow_undefined_flag=$no_undefined_flag
 	fi
 
       fi
 
-      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_generate_dlsyms "$libname" "$libname" :
       func_append libobjs " $symfileobj"
-      test "X$libobjs" = "X " && libobjs=
+      test " " = "$libobjs" && libobjs=
 
-      if test "$opt_mode" != relink; then
+      if test relink != "$opt_mode"; then
 	# Remove our outputs, but don't remove object files since they
 	# may have been created when compiling PIC objects.
 	removelist=
@@ -7556,8 +9051,8 @@ func_mode_link ()
 	  case $p in
 	    *.$objext | *.gcno)
 	       ;;
-	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
-	       if test "X$precious_files_regex" != "X"; then
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+	       if test -n "$precious_files_regex"; then
 		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
 		 then
 		   continue
@@ -7573,11 +9068,11 @@ func_mode_link ()
       fi
 
       # Now set the variables for building old libraries.
-      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+      if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
 	func_append oldlibs " $output_objdir/$libname.$libext"
 
 	# Transform .lo files to .o files.
-	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
       fi
 
       # Eliminate all temporary directories.
@@ -7598,13 +9093,13 @@ func_mode_link ()
 	  *) func_append finalize_rpath " $libdir" ;;
 	  esac
 	done
-	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
 	  dependency_libs="$temp_xrpath $dependency_libs"
 	fi
       fi
 
       # Make sure dlfiles contains only unique files that won't be dlpreopened
-      old_dlfiles="$dlfiles"
+      old_dlfiles=$dlfiles
       dlfiles=
       for lib in $old_dlfiles; do
 	case " $dlprefiles $dlfiles " in
@@ -7614,7 +9109,7 @@ func_mode_link ()
       done
 
       # Make sure dlprefiles contains only unique files
-      old_dlprefiles="$dlprefiles"
+      old_dlprefiles=$dlprefiles
       dlprefiles=
       for lib in $old_dlprefiles; do
 	case "$dlprefiles " in
@@ -7623,7 +9118,7 @@ func_mode_link ()
 	esac
       done
 
-      if test "$build_libtool_libs" = yes; then
+      if test yes = "$build_libtool_libs"; then
 	if test -n "$rpath"; then
 	  case $host in
 	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7647,7 +9142,7 @@ func_mode_link ()
 	    ;;
 	  *)
 	    # Add libc to deplibs on all other systems if necessary.
-	    if test "$build_libtool_need_lc" = "yes"; then
+	    if test yes = "$build_libtool_need_lc"; then
 	      func_append deplibs " -lc"
 	    fi
 	    ;;
@@ -7663,9 +9158,9 @@ func_mode_link ()
 	# I'm not sure if I'm treating the release correctly.  I think
 	# release should show up in the -l (ie -lgmp5) so we don't want to
 	# add it in twice.  Is that correct?
-	release=""
-	versuffix=""
-	major=""
+	release=
+	versuffix=
+	major=
 	newdeplibs=
 	droppeddeps=no
 	case $deplibs_check_method in
@@ -7694,20 +9189,20 @@ EOF
 	      -l*)
 		func_stripname -l '' "$i"
 		name=$func_stripname_result
-		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		  case " $predeps $postdeps " in
 		  *" $i "*)
 		    func_append newdeplibs " $i"
-		    i=""
+		    i=
 		    ;;
 		  esac
 		fi
-		if test -n "$i" ; then
+		if test -n "$i"; then
 		  libname=`eval "\\$ECHO \"$libname_spec\""`
 		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		  set dummy $deplib_matches; shift
 		  deplib_match=$1
-		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		    func_append newdeplibs " $i"
 		  else
 		    droppeddeps=yes
@@ -7737,20 +9232,20 @@ EOF
 		$opt_dry_run || $RM conftest
 		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
 		  ldd_output=`ldd conftest`
-		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		    case " $predeps $postdeps " in
 		    *" $i "*)
 		      func_append newdeplibs " $i"
-		      i=""
+		      i=
 		      ;;
 		    esac
 		  fi
-		  if test -n "$i" ; then
+		  if test -n "$i"; then
 		    libname=`eval "\\$ECHO \"$libname_spec\""`
 		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
 		    set dummy $deplib_matches; shift
 		    deplib_match=$1
-		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
 		      func_append newdeplibs " $i"
 		    else
 		      droppeddeps=yes
@@ -7787,24 +9282,24 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		if test -n "$file_magic_glob"; then
 		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 		else
 		  libnameglob=$libname
 		fi
-		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
-		  if test "$want_nocaseglob" = yes; then
+		  if test yes = "$want_nocaseglob"; then
 		    shopt -s nocaseglob
 		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 		    $nocaseglob
@@ -7822,25 +9317,25 @@ EOF
 		      # We might still enter an endless loop, since a link
 		      # loop can be closed while we follow links,
 		      # but so what?
-		      potlib="$potent_lib"
+		      potlib=$potent_lib
 		      while test -h "$potlib" 2>/dev/null; do
-			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
 			case $potliblink in
-			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
-			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			[\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+			*) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
 			esac
 		      done
 		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
 			 $SED -e 10q |
 			 $EGREP "$file_magic_regex" > /dev/null; then
 			func_append newdeplibs " $a_deplib"
-			a_deplib=""
+			a_deplib=
 			break 2
 		      fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7848,7 +9343,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7871,30 +9366,30 @@ EOF
 	    -l*)
 	      func_stripname -l '' "$a_deplib"
 	      name=$func_stripname_result
-	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      if test yes = "$allow_libtool_libs_with_static_runtimes"; then
 		case " $predeps $postdeps " in
 		*" $a_deplib "*)
 		  func_append newdeplibs " $a_deplib"
-		  a_deplib=""
+		  a_deplib=
 		  ;;
 		esac
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		libname=`eval "\\$ECHO \"$libname_spec\""`
 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 		  for potent_lib in $potential_libs; do
-		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    potlib=$potent_lib # see symlink-check above in file_magic test
 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
 		       $EGREP "$match_pattern_regex" > /dev/null; then
 		      func_append newdeplibs " $a_deplib"
-		      a_deplib=""
+		      a_deplib=
 		      break 2
 		    fi
 		  done
 		done
 	      fi
-	      if test -n "$a_deplib" ; then
+	      if test -n "$a_deplib"; then
 		droppeddeps=yes
 		echo
 		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7902,7 +9397,7 @@ EOF
 		echo "*** you link to this library.  But I can only do this if you have a"
 		echo "*** shared version of the library, which you do not appear to have"
 		echo "*** because I did check the linker path looking for a file starting"
-		if test -z "$potlib" ; then
+		if test -z "$potlib"; then
 		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
 		else
 		  $ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7918,18 +9413,18 @@ EOF
 	  done # Gone through all deplibs.
 	  ;;
 	none | unknown | *)
-	  newdeplibs=""
+	  newdeplibs=
 	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
-	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
-	    for i in $predeps $postdeps ; do
+	  if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+	    for i in $predeps $postdeps; do
 	      # can't use Xsed below, because $i might contain '/'
-	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
 	    done
 	  fi
 	  case $tmp_deplibs in
 	  *[!\	\ ]*)
 	    echo
-	    if test "X$deplibs_check_method" = "Xnone"; then
+	    if test none = "$deplibs_check_method"; then
 	      echo "*** Warning: inter-library dependencies are not supported in this platform."
 	    else
 	      echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7953,8 +9448,8 @@ EOF
 	  ;;
 	esac
 
-	if test "$droppeddeps" = yes; then
-	  if test "$module" = yes; then
+	if test yes = "$droppeddeps"; then
+	  if test yes = "$module"; then
 	    echo
 	    echo "*** Warning: libtool could not satisfy all declared inter-library"
 	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
@@ -7963,12 +9458,12 @@ EOF
 	    if test -z "$global_symbol_pipe"; then
 	      echo
 	      echo "*** However, this would only work if libtool was able to extract symbol"
-	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
 	      echo "*** not find such a program.  So, this module is probably useless."
-	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      echo "*** 'nm' from GNU binutils and a full rebuild may help."
 	    fi
-	    if test "$build_old_libs" = no; then
-	      oldlibs="$output_objdir/$libname.$libext"
+	    if test no = "$build_old_libs"; then
+	      oldlibs=$output_objdir/$libname.$libext
 	      build_libtool_libs=module
 	      build_old_libs=yes
 	    else
@@ -7979,14 +9474,14 @@ EOF
 	    echo "*** automatically added whenever a program is linked with this library"
 	    echo "*** or is declared to -dlopen it."
 
-	    if test "$allow_undefined" = no; then
+	    if test no = "$allow_undefined"; then
 	      echo
 	      echo "*** Since this library must not contain undefined symbols,"
 	      echo "*** because either the platform does not support them or"
 	      echo "*** it was explicitly requested with -no-undefined,"
 	      echo "*** libtool will only create a static version of it."
-	      if test "$build_old_libs" = no; then
-		oldlibs="$output_objdir/$libname.$libext"
+	      if test no = "$build_old_libs"; then
+		oldlibs=$output_objdir/$libname.$libext
 		build_libtool_libs=module
 		build_old_libs=yes
 	      else
@@ -8032,7 +9527,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      deplibs="$new_libs"
+      deplibs=$new_libs
 
       # All the library-specific variables (install_libdir is set above).
       library_names=
@@ -8040,25 +9535,25 @@ EOF
       dlname=
 
       # Test again, we may have decided not to build it any more
-      if test "$build_libtool_libs" = yes; then
-	# Remove ${wl} instances when linking with ld.
+      if test yes = "$build_libtool_libs"; then
+	# Remove $wl instances when linking with ld.
 	# FIXME: should test the right _cmds variable.
 	case $archive_cmds in
 	  *\$LD\ *) wl= ;;
         esac
-	if test "$hardcode_into_libs" = yes; then
+	if test yes = "$hardcode_into_libs"; then
 	  # Hardcode the library paths
 	  hardcode_libdirs=
 	  dep_rpath=
-	  rpath="$finalize_rpath"
-	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  rpath=$finalize_rpath
+	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
 	  for libdir in $rpath; do
 	    if test -n "$hardcode_libdir_flag_spec"; then
 	      if test -n "$hardcode_libdir_separator"; then
 		func_replace_sysroot "$libdir"
 		libdir=$func_replace_sysroot_result
 		if test -z "$hardcode_libdirs"; then
-		  hardcode_libdirs="$libdir"
+		  hardcode_libdirs=$libdir
 		else
 		  # Just accumulate the unique libdirs.
 		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8083,7 +9578,7 @@ EOF
 	  # Substitute the hardcoded libdirs into the rpath.
 	  if test -n "$hardcode_libdir_separator" &&
 	     test -n "$hardcode_libdirs"; then
-	    libdir="$hardcode_libdirs"
+	    libdir=$hardcode_libdirs
 	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
 	  fi
 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8097,8 +9592,8 @@ EOF
 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
 	fi
 
-	shlibpath="$finalize_shlibpath"
-	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	shlibpath=$finalize_shlibpath
+	test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
 	if test -n "$shlibpath"; then
 	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
 	fi
@@ -8108,19 +9603,19 @@ EOF
 	eval library_names=\"$library_names_spec\"
 	set dummy $library_names
 	shift
-	realname="$1"
+	realname=$1
 	shift
 
 	if test -n "$soname_spec"; then
 	  eval soname=\"$soname_spec\"
 	else
-	  soname="$realname"
+	  soname=$realname
 	fi
 	if test -z "$dlname"; then
 	  dlname=$soname
 	fi
 
-	lib="$output_objdir/$realname"
+	lib=$output_objdir/$realname
 	linknames=
 	for link
 	do
@@ -8134,7 +9629,7 @@ EOF
 	delfiles=
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
-	  export_symbols="$output_objdir/$libname.uexp"
+	  export_symbols=$output_objdir/$libname.uexp
 	  func_append delfiles " $export_symbols"
 	fi
 
@@ -8143,31 +9638,31 @@ EOF
 	cygwin* | mingw* | cegcc*)
 	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
 	    # exporting using user supplied symfile
-	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	    func_dll_def_p "$export_symbols" || {
 	      # and it's NOT already a .def file. Must figure out
 	      # which of the given symbols are data symbols and tag
 	      # them as such. So, trigger use of export_symbols_cmds.
 	      # export_symbols gets reassigned inside the "prepare
 	      # the list of exported symbols" if statement, so the
 	      # include_expsyms logic still works.
-	      orig_export_symbols="$export_symbols"
+	      orig_export_symbols=$export_symbols
 	      export_symbols=
 	      always_export_symbols=yes
-	    fi
+	    }
 	  fi
 	  ;;
 	esac
 
 	# Prepare the list of exported symbols
 	if test -z "$export_symbols"; then
-	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
-	    func_verbose "generating symbol list for \`$libname.la'"
-	    export_symbols="$output_objdir/$libname.exp"
+	  if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for '$libname.la'"
+	    export_symbols=$output_objdir/$libname.exp
 	    $opt_dry_run || $RM $export_symbols
 	    cmds=$export_symbols_cmds
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd1 in $cmds; do
-	      IFS="$save_ifs"
+	      IFS=$save_ifs
 	      # Take the normal branch if the nm_file_list_spec branch
 	      # doesn't work or if tool conversion is not needed.
 	      case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8181,7 +9676,7 @@ EOF
 		  try_normal_branch=no
 		  ;;
 	      esac
-	      if test "$try_normal_branch" = yes \
+	      if test yes = "$try_normal_branch" \
 		 && { test "$len" -lt "$max_cmd_len" \
 		      || test "$max_cmd_len" -le -1; }
 	      then
@@ -8192,7 +9687,7 @@ EOF
 		output_la=$func_basename_result
 		save_libobjs=$libobjs
 		save_output=$output
-		output=${output_objdir}/${output_la}.nm
+		output=$output_objdir/$output_la.nm
 		func_to_tool_file "$output"
 		libobjs=$nm_file_list_spec$func_to_tool_file_result
 		func_append delfiles " $output"
@@ -8215,8 +9710,8 @@ EOF
 		break
 	      fi
 	    done
-	    IFS="$save_ifs"
-	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	    IFS=$save_ifs
+	    if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
 	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
 	    fi
@@ -8224,16 +9719,16 @@ EOF
 	fi
 
 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	  tmp_export_symbols="$export_symbols"
-	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  tmp_export_symbols=$export_symbols
+	  test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	fi
 
-	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
 	  # The given exports_symbols file has to be filtered, so filter it.
-	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # 's' commands, which not all seds can handle. GNU sed should be fine
 	  # though. Also, the filter scales superlinearly with the number of
 	  # global variables. join(1) would be nice here, but unfortunately
 	  # isn't a blessed tool.
@@ -8252,11 +9747,11 @@ EOF
 	    ;;
 	  esac
 	done
-	deplibs="$tmp_deplibs"
+	deplibs=$tmp_deplibs
 
 	if test -n "$convenience"; then
 	  if test -n "$whole_archive_flag_spec" &&
-	    test "$compiler_needs_object" = yes &&
+	    test yes = "$compiler_needs_object" &&
 	    test -z "$libobjs"; then
 	    # extract the archives, so we have objects to list.
 	    # TODO: could optimize this to just extract one archive.
@@ -8267,7 +9762,7 @@ EOF
 	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
 	    test "X$libobjs" = "X " && libobjs=
 	  else
-	    gentop="$output_objdir/${outputname}x"
+	    gentop=$output_objdir/${outputname}x
 	    func_append generated " $gentop"
 
 	    func_extract_archives $gentop $convenience
@@ -8276,18 +9771,18 @@ EOF
 	  fi
 	fi
 
-	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
 	  eval flag=\"$thread_safe_flag_spec\"
 	  func_append linker_flags " $flag"
 	fi
 
 	# Make a backup of the uninstalled library when relinking
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
 	fi
 
 	# Do each of the archive commands.
-	if test "$module" = yes && test -n "$module_cmds" ; then
+	if test yes = "$module" && test -n "$module_cmds"; then
 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	    eval test_cmds=\"$module_expsym_cmds\"
 	    cmds=$module_expsym_cmds
@@ -8305,7 +9800,7 @@ EOF
 	  fi
 	fi
 
-	if test "X$skipped_export" != "X:" &&
+	if test : != "$skipped_export" &&
 	   func_len " $test_cmds" &&
 	   len=$func_len_result &&
 	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8338,8 +9833,8 @@ EOF
 	  last_robj=
 	  k=1
 
-	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
-	    output=${output_objdir}/${output_la}.lnkscript
+	  if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+	    output=$output_objdir/$output_la.lnkscript
 	    func_verbose "creating GNU ld script: $output"
 	    echo 'INPUT (' > $output
 	    for obj in $save_libobjs
@@ -8351,14 +9846,14 @@ EOF
 	    func_append delfiles " $output"
 	    func_to_tool_file "$output"
 	    output=$func_to_tool_file_result
-	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
-	    output=${output_objdir}/${output_la}.lnk
+	  elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+	    output=$output_objdir/$output_la.lnk
 	    func_verbose "creating linker input file list: $output"
 	    : > $output
 	    set x $save_libobjs
 	    shift
 	    firstobj=
-	    if test "$compiler_needs_object" = yes; then
+	    if test yes = "$compiler_needs_object"; then
 	      firstobj="$1 "
 	      shift
 	    fi
@@ -8373,7 +9868,7 @@ EOF
 	  else
 	    if test -n "$save_libobjs"; then
 	      func_verbose "creating reloadable object files..."
-	      output=$output_objdir/$output_la-${k}.$objext
+	      output=$output_objdir/$output_la-$k.$objext
 	      eval test_cmds=\"$reload_cmds\"
 	      func_len " $test_cmds"
 	      len0=$func_len_result
@@ -8385,13 +9880,13 @@ EOF
 		func_len " $obj"
 		func_arith $len + $func_len_result
 		len=$func_arith_result
-		if test "X$objlist" = X ||
+		if test -z "$objlist" ||
 		   test "$len" -lt "$max_cmd_len"; then
 		  func_append objlist " $obj"
 		else
 		  # The command $test_cmds is almost too long, add a
 		  # command to the queue.
-		  if test "$k" -eq 1 ; then
+		  if test 1 -eq "$k"; then
 		    # The first file doesn't have a previous command to add.
 		    reload_objs=$objlist
 		    eval concat_cmds=\"$reload_cmds\"
@@ -8401,10 +9896,10 @@ EOF
 		    reload_objs="$objlist $last_robj"
 		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
 		  fi
-		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  last_robj=$output_objdir/$output_la-$k.$objext
 		  func_arith $k + 1
 		  k=$func_arith_result
-		  output=$output_objdir/$output_la-${k}.$objext
+		  output=$output_objdir/$output_la-$k.$objext
 		  objlist=" $obj"
 		  func_len " $last_robj"
 		  func_arith $len0 + $func_len_result
@@ -8416,9 +9911,9 @@ EOF
 	      # files will link in the last one created.
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
 	      reload_objs="$objlist $last_robj"
-	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$reload_cmds\"
 	      if test -n "$last_robj"; then
-	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	        eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
 	      func_append delfiles " $output"
 
@@ -8426,9 +9921,9 @@ EOF
 	      output=
 	    fi
 
-	    if ${skipped_export-false}; then
-	      func_verbose "generating symbol list for \`$libname.la'"
-	      export_symbols="$output_objdir/$libname.exp"
+	    ${skipped_export-false} && {
+	      func_verbose "generating symbol list for '$libname.la'"
+	      export_symbols=$output_objdir/$libname.exp
 	      $opt_dry_run || $RM $export_symbols
 	      libobjs=$output
 	      # Append the command to create the export file.
@@ -8437,16 +9932,16 @@ EOF
 	      if test -n "$last_robj"; then
 		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
 	      fi
-	    fi
+	    }
 
 	    test -n "$save_libobjs" &&
 	      func_verbose "creating a temporary reloadable object file: $output"
 
 	    # Loop through the commands generated above and execute them.
-	    save_ifs="$IFS"; IFS='~'
+	    save_ifs=$IFS; IFS='~'
 	    for cmd in $concat_cmds; do
-	      IFS="$save_ifs"
-	      $opt_silent || {
+	      IFS=$save_ifs
+	      $opt_quiet || {
 		  func_quote_for_expand "$cmd"
 		  eval "func_echo $func_quote_for_expand_result"
 	      }
@@ -8454,7 +9949,7 @@ EOF
 		lt_exit=$?
 
 		# Restore the uninstalled library and exit
-		if test "$opt_mode" = relink; then
+		if test relink = "$opt_mode"; then
 		  ( cd "$output_objdir" && \
 		    $RM "${realname}T" && \
 		    $MV "${realname}U" "$realname" )
@@ -8463,7 +9958,7 @@ EOF
 		exit $lt_exit
 	      }
 	    done
-	    IFS="$save_ifs"
+	    IFS=$save_ifs
 
 	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
 	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8471,18 +9966,18 @@ EOF
 	    fi
 	  fi
 
-          if ${skipped_export-false}; then
+          ${skipped_export-false} && {
 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
-	      tmp_export_symbols="$export_symbols"
-	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      tmp_export_symbols=$export_symbols
+	      test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
 	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
 	    fi
 
 	    if test -n "$orig_export_symbols"; then
 	      # The given exports_symbols file has to be filtered, so filter it.
-	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
 	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
-	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # 's' commands, which not all seds can handle. GNU sed should be fine
 	      # though. Also, the filter scales superlinearly with the number of
 	      # global variables. join(1) would be nice here, but unfortunately
 	      # isn't a blessed tool.
@@ -8491,7 +9986,7 @@ EOF
 	      export_symbols=$output_objdir/$libname.def
 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
 	    fi
-	  fi
+	  }
 
 	  libobjs=$output
 	  # Restore the value of output.
@@ -8505,7 +10000,7 @@ EOF
 	  # value of $libobjs for piecewise linking.
 
 	  # Do each of the archive commands.
-	  if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test yes = "$module" && test -n "$module_cmds"; then
 	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
 	      cmds=$module_expsym_cmds
 	    else
@@ -8527,7 +10022,7 @@ EOF
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -8535,11 +10030,12 @@ EOF
 	  test "X$libobjs" = "X " && libobjs=
 	fi
 
-	save_ifs="$IFS"; IFS='~'
+	save_ifs=$IFS; IFS='~'
 	for cmd in $cmds; do
-	  IFS="$save_ifs"
+	  IFS=$sp$nl
 	  eval cmd=\"$cmd\"
-	  $opt_silent || {
+	  IFS=$save_ifs
+	  $opt_quiet || {
 	    func_quote_for_expand "$cmd"
 	    eval "func_echo $func_quote_for_expand_result"
 	  }
@@ -8547,7 +10043,7 @@ EOF
 	    lt_exit=$?
 
 	    # Restore the uninstalled library and exit
-	    if test "$opt_mode" = relink; then
+	    if test relink = "$opt_mode"; then
 	      ( cd "$output_objdir" && \
 	        $RM "${realname}T" && \
 		$MV "${realname}U" "$realname" )
@@ -8556,10 +10052,10 @@ EOF
 	    exit $lt_exit
 	  }
 	done
-	IFS="$save_ifs"
+	IFS=$save_ifs
 
 	# Restore the uninstalled library and exit
-	if test "$opt_mode" = relink; then
+	if test relink = "$opt_mode"; then
 	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
 
 	  if test -n "$convenience"; then
@@ -8579,39 +10075,39 @@ EOF
 	done
 
 	# If -module or -export-dynamic was specified, set the dlname.
-	if test "$module" = yes || test "$export_dynamic" = yes; then
+	if test yes = "$module" || test yes = "$export_dynamic"; then
 	  # On all known operating systems, these are identical.
-	  dlname="$soname"
+	  dlname=$soname
 	fi
       fi
       ;;
 
     obj)
-      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
-	func_warning "\`-dlopen' is ignored for objects"
+      if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+	func_warning "'-dlopen' is ignored for objects"
       fi
 
       case " $deplibs" in
       *\ -l* | *\ -L*)
-	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+	func_warning "'-l' and '-L' are ignored for objects" ;;
       esac
 
       test -n "$rpath" && \
-	func_warning "\`-rpath' is ignored for objects"
+	func_warning "'-rpath' is ignored for objects"
 
       test -n "$xrpath" && \
-	func_warning "\`-R' is ignored for objects"
+	func_warning "'-R' is ignored for objects"
 
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for objects"
+	func_warning "'-version-info' is ignored for objects"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for objects"
+	func_warning "'-release' is ignored for objects"
 
       case $output in
       *.lo)
 	test -n "$objs$old_deplibs" && \
-	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+	  func_fatal_error "cannot build library object '$output' from non-libtool objects"
 
 	libobj=$output
 	func_lo2o "$libobj"
@@ -8619,7 +10115,7 @@ EOF
 	;;
       *)
 	libobj=
-	obj="$output"
+	obj=$output
 	;;
       esac
 
@@ -8632,17 +10128,19 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD[\ \$]*) wl= ;;
+      esac
       if test -n "$convenience"; then
 	if test -n "$whole_archive_flag_spec"; then
 	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	  reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
 	else
-	  gentop="$output_objdir/${obj}x"
+	  gentop=$output_objdir/${obj}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $convenience
@@ -8651,12 +10149,12 @@ EOF
       fi
 
       # If we're not building shared, we need to use non_pic_objs
-      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+      test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
 
       # Create the old-style object.
-      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+      reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
 
-      output="$obj"
+      output=$obj
       func_execute_cmds "$reload_cmds" 'exit $?'
 
       # Exit if we aren't doing a library object file.
@@ -8668,7 +10166,7 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$build_libtool_libs" != yes; then
+      test yes = "$build_libtool_libs" || {
 	if test -n "$gentop"; then
 	  func_show_eval '${RM}r "$gentop"'
 	fi
@@ -8678,12 +10176,12 @@ EOF
 	# $show "echo timestamp > $libobj"
 	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
 	exit $EXIT_SUCCESS
-      fi
+      }
 
-      if test -n "$pic_flag" || test "$pic_mode" != default; then
+      if test -n "$pic_flag" || test default != "$pic_mode"; then
 	# Only do commands if we really have different PIC objects.
 	reload_objs="$libobjs $reload_conv_objs"
-	output="$libobj"
+	output=$libobj
 	func_execute_cmds "$reload_cmds" 'exit $?'
       fi
 
@@ -8700,16 +10198,14 @@ EOF
 	          output=$func_stripname_result.exe;;
       esac
       test -n "$vinfo" && \
-	func_warning "\`-version-info' is ignored for programs"
+	func_warning "'-version-info' is ignored for programs"
 
       test -n "$release" && \
-	func_warning "\`-release' is ignored for programs"
+	func_warning "'-release' is ignored for programs"
 
-      test "$preload" = yes \
-        && test "$dlopen_support" = unknown \
-	&& test "$dlopen_self" = unknown \
-	&& test "$dlopen_self_static" = unknown && \
-	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+      $preload \
+	&& test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+	&& func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
 
       case $host in
       *-*-rhapsody* | *-*-darwin1.[012])
@@ -8723,11 +10219,11 @@ EOF
       *-*-darwin*)
 	# Don't allow lazy linking, it breaks C++ global constructors
 	# But is supposedly fixed on 10.4 or later (yay!).
-	if test "$tagname" = CXX ; then
+	if test CXX = "$tagname"; then
 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
 	    10.[0123])
-	      func_append compile_command " ${wl}-bind_at_load"
-	      func_append finalize_command " ${wl}-bind_at_load"
+	      func_append compile_command " $wl-bind_at_load"
+	      func_append finalize_command " $wl-bind_at_load"
 	    ;;
 	  esac
 	fi
@@ -8763,7 +10259,7 @@ EOF
 	*) func_append new_libs " $deplib" ;;
 	esac
       done
-      compile_deplibs="$new_libs"
+      compile_deplibs=$new_libs
 
 
       func_append compile_command " $compile_deplibs"
@@ -8787,7 +10283,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8810,7 +10306,7 @@ EOF
 	fi
 	case $host in
 	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
-	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
 	  case :$dllsearchpath: in
 	  *":$libdir:"*) ;;
 	  ::) dllsearchpath=$libdir;;
@@ -8827,10 +10323,10 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      compile_rpath="$rpath"
+      compile_rpath=$rpath
 
       rpath=
       hardcode_libdirs=
@@ -8838,7 +10334,7 @@ EOF
 	if test -n "$hardcode_libdir_flag_spec"; then
 	  if test -n "$hardcode_libdir_separator"; then
 	    if test -z "$hardcode_libdirs"; then
-	      hardcode_libdirs="$libdir"
+	      hardcode_libdirs=$libdir
 	    else
 	      # Just accumulate the unique libdirs.
 	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8863,45 +10359,43 @@ EOF
       # Substitute the hardcoded libdirs into the rpath.
       if test -n "$hardcode_libdir_separator" &&
 	 test -n "$hardcode_libdirs"; then
-	libdir="$hardcode_libdirs"
+	libdir=$hardcode_libdirs
 	eval rpath=\" $hardcode_libdir_flag_spec\"
       fi
-      finalize_rpath="$rpath"
+      finalize_rpath=$rpath
 
-      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+      if test -n "$libobjs" && test yes = "$build_old_libs"; then
 	# Transform all the library objects into standard objects.
 	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
       fi
 
-      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+      func_generate_dlsyms "$outputname" "@PROGRAM@" false
 
       # template prelinking step
       if test -n "$prelink_cmds"; then
 	func_execute_cmds "$prelink_cmds" 'exit $?'
       fi
 
-      wrappers_required=yes
+      wrappers_required=:
       case $host in
       *cegcc* | *mingw32ce*)
         # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
-        wrappers_required=no
+        wrappers_required=false
         ;;
       *cygwin* | *mingw* )
-        if test "$build_libtool_libs" != yes; then
-          wrappers_required=no
-        fi
+        test yes = "$build_libtool_libs" || wrappers_required=false
         ;;
       *)
-        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
-          wrappers_required=no
+        if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+          wrappers_required=false
         fi
         ;;
       esac
-      if test "$wrappers_required" = no; then
+      $wrappers_required || {
 	# Replace the output file specification.
 	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
-	link_command="$compile_command$compile_rpath"
+	link_command=$compile_command$compile_rpath
 
 	# We have no uninstalled library dependencies, so finalize right now.
 	exit_status=0
@@ -8914,12 +10408,12 @@ EOF
 	fi
 
 	# Delete the generated files.
-	if test -f "$output_objdir/${outputname}S.${objext}"; then
-	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	if test -f "$output_objdir/${outputname}S.$objext"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
 	fi
 
 	exit $exit_status
-      fi
+      }
 
       if test -n "$compile_shlibpath$finalize_shlibpath"; then
 	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8949,9 +10443,9 @@ EOF
 	fi
       fi
 
-      if test "$no_install" = yes; then
+      if test yes = "$no_install"; then
 	# We don't need to create a wrapper script.
-	link_command="$compile_var$compile_command$compile_rpath"
+	link_command=$compile_var$compile_command$compile_rpath
 	# Replace the output file specification.
 	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
 	# Delete the old output file.
@@ -8968,27 +10462,28 @@ EOF
 	exit $EXIT_SUCCESS
       fi
 
-      if test "$hardcode_action" = relink; then
-	# Fast installation is not supported
-	link_command="$compile_var$compile_command$compile_rpath"
-	relink_command="$finalize_var$finalize_command$finalize_rpath"
+      case $hardcode_action,$fast_install in
+        relink,*)
+	  # Fast installation is not supported
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
 
-	func_warning "this platform does not like uninstalled shared libraries"
-	func_warning "\`$output' will be relinked during installation"
-      else
-	if test "$fast_install" != no; then
-	  link_command="$finalize_var$compile_command$finalize_rpath"
-	  if test "$fast_install" = yes; then
-	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
-	  else
-	    # fast_install is set to needless
-	    relink_command=
-	  fi
-	else
-	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
-	fi
-      fi
+	  func_warning "this platform does not like uninstalled shared libraries"
+	  func_warning "'$output' will be relinked during installation"
+	  ;;
+        *,yes)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+          ;;
+	*,no)
+	  link_command=$compile_var$compile_command$compile_rpath
+	  relink_command=$finalize_var$finalize_command$finalize_rpath
+          ;;
+	*,needless)
+	  link_command=$finalize_var$compile_command$finalize_rpath
+	  relink_command=
+          ;;
+      esac
 
       # Replace the output file specification.
       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9045,8 +10540,8 @@ EOF
 	    func_dirname_and_basename "$output" "" "."
 	    output_name=$func_basename_result
 	    output_path=$func_dirname_result
-	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
-	    cwrapper="$output_path/$output_name.exe"
+	    cwrappersource=$output_path/$objdir/lt-$output_name.c
+	    cwrapper=$output_path/$output_name.exe
 	    $RM $cwrappersource $cwrapper
 	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
@@ -9067,7 +10562,7 @@ EOF
 	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
 	    $opt_dry_run || {
 	      # note: this script will not be executed, so do not chmod.
-	      if test "x$build" = "x$host" ; then
+	      if test "x$build" = "x$host"; then
 		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
 	      else
 		func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9090,25 +10585,27 @@ EOF
     # See if we need to build an old-fashioned archive.
     for oldlib in $oldlibs; do
 
-      if test "$build_libtool_libs" = convenience; then
-	oldobjs="$libobjs_save $symfileobj"
-	addlibs="$convenience"
-	build_libtool_libs=no
-      else
-	if test "$build_libtool_libs" = module; then
-	  oldobjs="$libobjs_save"
+      case $build_libtool_libs in
+        convenience)
+	  oldobjs="$libobjs_save $symfileobj"
+	  addlibs=$convenience
 	  build_libtool_libs=no
-	else
+	  ;;
+	module)
+	  oldobjs=$libobjs_save
+	  addlibs=$old_convenience
+	  build_libtool_libs=no
+          ;;
+	*)
 	  oldobjs="$old_deplibs $non_pic_objects"
-	  if test "$preload" = yes && test -f "$symfileobj"; then
-	    func_append oldobjs " $symfileobj"
-	  fi
-	fi
-	addlibs="$old_convenience"
-      fi
+	  $preload && test -f "$symfileobj" \
+	    && func_append oldobjs " $symfileobj"
+	  addlibs=$old_convenience
+	  ;;
+      esac
 
       if test -n "$addlibs"; then
-	gentop="$output_objdir/${outputname}x"
+	gentop=$output_objdir/${outputname}x
 	func_append generated " $gentop"
 
 	func_extract_archives $gentop $addlibs
@@ -9116,13 +10613,13 @@ EOF
       fi
 
       # Do each command in the archive commands.
-      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+      if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
 	cmds=$old_archive_from_new_cmds
       else
 
 	# Add any objects from preloaded convenience libraries
 	if test -n "$dlprefiles"; then
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 
 	  func_extract_archives $gentop $dlprefiles
@@ -9143,7 +10640,7 @@ EOF
 	  :
 	else
 	  echo "copying selected object files to avoid basename conflicts..."
-	  gentop="$output_objdir/${outputname}x"
+	  gentop=$output_objdir/${outputname}x
 	  func_append generated " $gentop"
 	  func_mkdir_p "$gentop"
 	  save_oldobjs=$oldobjs
@@ -9152,7 +10649,7 @@ EOF
 	  for obj in $save_oldobjs
 	  do
 	    func_basename "$obj"
-	    objbase="$func_basename_result"
+	    objbase=$func_basename_result
 	    case " $oldobjs " in
 	    " ") oldobjs=$obj ;;
 	    *[\ /]"$objbase "*)
@@ -9221,18 +10718,18 @@ EOF
 	    else
 	      # the above command should be used before it gets too long
 	      oldobjs=$objlist
-	      if test "$obj" = "$last_oldobj" ; then
+	      if test "$obj" = "$last_oldobj"; then
 		RANLIB=$save_RANLIB
 	      fi
 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
-	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
 	      objlist=
 	      len=$len0
 	    fi
 	  done
 	  RANLIB=$save_RANLIB
 	  oldobjs=$objlist
-	  if test "X$oldobjs" = "X" ; then
+	  if test -z "$oldobjs"; then
 	    eval cmds=\"\$concat_cmds\"
 	  else
 	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9249,7 +10746,7 @@ EOF
     case $output in
     *.la)
       old_library=
-      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      test yes = "$build_old_libs" && old_library=$libname.$libext
       func_verbose "creating $output"
 
       # Preserve any variables that may affect compiler behavior
@@ -9264,31 +10761,31 @@ EOF
 	fi
       done
       # Quote the link command for shipping.
-      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
-      if test "$hardcode_automatic" = yes ; then
+      if test yes = "$hardcode_automatic"; then
 	relink_command=
       fi
 
       # Only create the output if not a dry run.
       $opt_dry_run || {
 	for installed in no yes; do
-	  if test "$installed" = yes; then
+	  if test yes = "$installed"; then
 	    if test -z "$install_libdir"; then
 	      break
 	    fi
-	    output="$output_objdir/$outputname"i
+	    output=$output_objdir/${outputname}i
 	    # Replace all uninstalled libtool libraries with the installed ones
 	    newdependency_libs=
 	    for deplib in $dependency_libs; do
 	      case $deplib in
 	      *.la)
 		func_basename "$deplib"
-		name="$func_basename_result"
+		name=$func_basename_result
 		func_resolve_sysroot "$deplib"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  func_fatal_error "'$deplib' is not a valid libtool archive"
 		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      -L*)
@@ -9304,23 +10801,23 @@ EOF
 	      *) func_append newdependency_libs " $deplib" ;;
 	      esac
 	    done
-	    dependency_libs="$newdependency_libs"
+	    dependency_libs=$newdependency_libs
 	    newdlfiles=
 
 	    for lib in $dlfiles; do
 	      case $lib in
 	      *.la)
 	        func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      *) func_append newdlfiles " $lib" ;;
 	      esac
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
@@ -9330,34 +10827,34 @@ EOF
 		# didn't already link the preopened objects directly into
 		# the library:
 		func_basename "$lib"
-		name="$func_basename_result"
-		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		name=$func_basename_result
+		eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
 		test -z "$libdir" && \
-		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		  func_fatal_error "'$lib' is not a valid libtool archive"
 		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
 		;;
 	      esac
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  else
 	    newdlfiles=
 	    for lib in $dlfiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlfiles " $abs"
 	    done
-	    dlfiles="$newdlfiles"
+	    dlfiles=$newdlfiles
 	    newdlprefiles=
 	    for lib in $dlprefiles; do
 	      case $lib in
-		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		[\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
 		*) abs=`pwd`"/$lib" ;;
 	      esac
 	      func_append newdlprefiles " $abs"
 	    done
-	    dlprefiles="$newdlprefiles"
+	    dlprefiles=$newdlprefiles
 	  fi
 	  $RM $output
 	  # place dlname in correct position for cygwin
@@ -9373,10 +10870,9 @@ EOF
 	  case $host,$output,$installed,$module,$dlname in
 	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 	      # If a -bindir argument was supplied, place the dll there.
-	      if test "x$bindir" != x ;
-	      then
+	      if test -n "$bindir"; then
 		func_relative_path "$install_libdir" "$bindir"
-		tdlname=$func_relative_path_result$dlname
+		tdlname=$func_relative_path_result/$dlname
 	      else
 		# Otherwise fall back on heuristic.
 		tdlname=../bin/$dlname
@@ -9385,7 +10881,7 @@ EOF
 	  esac
 	  $ECHO > $output "\
 # $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
 #
 # Please DO NOT delete this file!
 # It is necessary for linking the library.
@@ -9399,7 +10895,7 @@ library_names='$library_names'
 # The name of the static archive.
 old_library='$old_library'
 
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
 inherited_linker_flags='$new_inherited_linker_flags'
 
 # Libraries that this one depends upon.
@@ -9425,7 +10921,7 @@ dlpreopen='$dlprefiles'
 
 # Directory that this library needs to be installed in:
 libdir='$install_libdir'"
-	  if test "$installed" = no && test "$need_relink" = yes; then
+	  if test no,yes = "$installed,$need_relink"; then
 	    $ECHO >> $output "\
 relink_command=\"$relink_command\""
 	  fi
@@ -9440,27 +10936,29 @@ relink_command=\"$relink_command\""
     exit $EXIT_SUCCESS
 }
 
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
-    func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+  func_mode_link ${1+"$@"}
+fi
 
 
 # func_mode_uninstall arg...
 func_mode_uninstall ()
 {
-    $opt_debug
-    RM="$nonopt"
+    $debug_cmd
+
+    RM=$nonopt
     files=
-    rmforce=
+    rmforce=false
     exit_status=0
 
     # This variable tells wrapper scripts just to set variables rather
     # than running their programs.
-    libtool_install_magic="$magic"
+    libtool_install_magic=$magic
 
     for arg
     do
       case $arg in
-      -f) func_append RM " $arg"; rmforce=yes ;;
+      -f) func_append RM " $arg"; rmforce=: ;;
       -*) func_append RM " $arg" ;;
       *) func_append files " $arg" ;;
       esac
@@ -9473,18 +10971,18 @@ func_mode_uninstall ()
 
     for file in $files; do
       func_dirname "$file" "" "."
-      dir="$func_dirname_result"
-      if test "X$dir" = X.; then
-	odir="$objdir"
+      dir=$func_dirname_result
+      if test . = "$dir"; then
+	odir=$objdir
       else
-	odir="$dir/$objdir"
+	odir=$dir/$objdir
       fi
       func_basename "$file"
-      name="$func_basename_result"
-      test "$opt_mode" = uninstall && odir="$dir"
+      name=$func_basename_result
+      test uninstall = "$opt_mode" && odir=$dir
 
       # Remember odir for removal later, being careful to avoid duplicates
-      if test "$opt_mode" = clean; then
+      if test clean = "$opt_mode"; then
 	case " $rmdirs " in
 	  *" $odir "*) ;;
 	  *) func_append rmdirs " $odir" ;;
@@ -9499,11 +10997,11 @@ func_mode_uninstall ()
       elif test -d "$file"; then
 	exit_status=1
 	continue
-      elif test "$rmforce" = yes; then
+      elif $rmforce; then
 	continue
       fi
 
-      rmfiles="$file"
+      rmfiles=$file
 
       case $name in
       *.la)
@@ -9517,7 +11015,7 @@ func_mode_uninstall ()
 	  done
 	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
 
-	  case "$opt_mode" in
+	  case $opt_mode in
 	  clean)
 	    case " $library_names " in
 	    *" $dlname "*) ;;
@@ -9528,12 +11026,12 @@ func_mode_uninstall ()
 	  uninstall)
 	    if test -n "$library_names"; then
 	      # Do each command in the postuninstall commands.
-	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 
 	    if test -n "$old_library"; then
 	      # Do each command in the old_postuninstall commands.
-	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	      func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
 	    fi
 	    # FIXME: should reinstall the best remaining shared library.
 	    ;;
@@ -9549,21 +11047,19 @@ func_mode_uninstall ()
 	  func_source $dir/$name
 
 	  # Add PIC object to the list of files to remove.
-	  if test -n "$pic_object" &&
-	     test "$pic_object" != none; then
+	  if test -n "$pic_object" && test none != "$pic_object"; then
 	    func_append rmfiles " $dir/$pic_object"
 	  fi
 
 	  # Add non-PIC object to the list of files to remove.
-	  if test -n "$non_pic_object" &&
-	     test "$non_pic_object" != none; then
+	  if test -n "$non_pic_object" && test none != "$non_pic_object"; then
 	    func_append rmfiles " $dir/$non_pic_object"
 	  fi
 	fi
 	;;
 
       *)
-	if test "$opt_mode" = clean ; then
+	if test clean = "$opt_mode"; then
 	  noexename=$name
 	  case $file in
 	  *.exe)
@@ -9590,12 +11086,12 @@ func_mode_uninstall ()
 
 	    # note $name still contains .exe if it was in $file originally
 	    # as does the version of $file that was added into $rmfiles
-	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
-	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	    func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+	    if test yes = "$fast_install" && test -n "$relink_command"; then
 	      func_append rmfiles " $odir/lt-$name"
 	    fi
-	    if test "X$noexename" != "X$name" ; then
-	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    if test "X$noexename" != "X$name"; then
+	      func_append rmfiles " $odir/lt-$noexename.c"
 	    fi
 	  fi
 	fi
@@ -9604,7 +11100,7 @@ func_mode_uninstall ()
       func_show_eval "$RM $rmfiles" 'exit_status=1'
     done
 
-    # Try to remove the ${objdir}s in the directories where we deleted files
+    # Try to remove the $objdir's in the directories where we deleted files
     for dir in $rmdirs; do
       if test -d "$dir"; then
 	func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9614,16 +11110,17 @@ func_mode_uninstall ()
     exit $exit_status
 }
 
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
-    func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+  func_mode_uninstall ${1+"$@"}
+fi
 
 test -z "$opt_mode" && {
-  help="$generic_help"
+  help=$generic_help
   func_fatal_help "you must specify a MODE"
 }
 
 test -z "$exec_cmd" && \
-  func_fatal_help "invalid operation mode \`$opt_mode'"
+  func_fatal_help "invalid operation mode '$opt_mode'"
 
 if test -n "$exec_cmd"; then
   eval exec "$exec_cmd"
@@ -9634,7 +11131,7 @@ exit $exit_status
 
 
 # The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries.  Given conflicting
+# where we disable both kinds of libraries.  Given conflicting
 # choices, we go for a static library, that is the most portable,
 # since we can't tell whether shared libraries were disabled because
 # the user asked for that or because the platform doesn't support
@@ -9657,5 +11154,3 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 # mode:shell-script
 # sh-indentation:2
 # End:
-# vi:sw=2
-
diff --git a/auxdir/ltoptions.m4 b/auxdir/ltoptions.m4
index 5d9acd8e2..94b082976 100644
--- a/auxdir/ltoptions.m4
+++ b/auxdir/ltoptions.m4
@@ -1,14 +1,14 @@
 # Helper functions for option handling.                    -*- Autoconf -*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-#   Inc.
+#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
 # unlimited permission to copy and/or distribute it, with or without
 # modifications, as long as this notice is preserved.
 
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
 
 # This is to help aclocal find these macros, as it can't see m4_define.
 AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
 [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
 m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
         _LT_MANGLE_DEFUN([$1], [$2]),
-    [m4_warning([Unknown $1 option `$2'])])[]dnl
+    [m4_warning([Unknown $1 option '$2'])])[]dnl
 ])
 
 
@@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[
   dnl
   dnl If no reference was made to various pairs of opposing options, then
   dnl we run the default mode handler for the pair.  For example, if neither
-  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
   dnl archives by default:
   _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
   _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
   _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
-  		   [_LT_ENABLE_FAST_INSTALL])
+		   [_LT_ENABLE_FAST_INSTALL])
+  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+		   [_LT_WITH_AIX_SONAME([aix])])
   ])
 ])# _LT_SET_OPTIONS
 
@@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
 [_LT_SET_OPTION([LT_INIT], [dlopen])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
 _LT_SET_OPTION([LT_INIT], [win32-dll])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
 
 # _LT_ENABLE_SHARED([DEFAULT])
 # ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_SHARED],
 [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([shared],
@@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared],
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
 
 # _LT_ENABLE_STATIC([DEFAULT])
 # ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_STATIC],
 [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([static],
@@ -226,14 +228,14 @@ AC_ARG_ENABLE([static],
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
 
 # _LT_ENABLE_FAST_INSTALL([DEFAULT])
 # ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
 m4_define([_LT_ENABLE_FAST_INSTALL],
 [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
 AC_ARG_ENABLE([fast-install],
@@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install],
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
     [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
 ])
 
 AU_DEFUN([AC_DISABLE_FAST_INSTALL],
 [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
@@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
 dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
 
 
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+  AC_MSG_CHECKING([which variant of shared library versioning to provide])
+  AC_ARG_WITH([aix-soname],
+    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+    [case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname],
+    [AC_CACHE_VAL([lt_cv_with_aix_soname],
+      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+    with_aix_soname=$lt_cv_with_aix_soname])
+  AC_MSG_RESULT([$with_aix_soname])
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
 # _LT_WITH_PIC([MODE])
 # --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
 # LT_INIT options.
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
 m4_define([_LT_WITH_PIC],
 [AC_ARG_WITH([pic],
     [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC],
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac],
-    [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+    [pic_mode=m4_default([$1], [default])])
 
 _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
 ])# _LT_WITH_PIC
@@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
 [_LT_SET_OPTION([LT_INIT], [pic-only])
 AC_DIAGNOSE([obsolete],
 [$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
 ])
 
 dnl aclocal-1.4 backwards compatibility:
diff --git a/auxdir/ltsugar.m4 b/auxdir/ltsugar.m4
index 9000a057d..48bc9344a 100644
--- a/auxdir/ltsugar.m4
+++ b/auxdir/ltsugar.m4
@@ -1,6 +1,7 @@
 # ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
 #
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
 # Written by Gary V. Vaughan, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -33,7 +34,7 @@ m4_define([_lt_join],
 # ------------
 # Manipulate m4 lists.
 # These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
 m4_define([lt_car], [[$1]])
 m4_define([lt_cdr],
 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -44,7 +45,7 @@ m4_define([lt_unquote], $1)
 
 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
 # ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
 # Note that neither SEPARATOR nor STRING are expanded; they are appended
 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
diff --git a/auxdir/ltversion.m4 b/auxdir/ltversion.m4
index 07a8602d4..fa04b52a3 100644
--- a/auxdir/ltversion.m4
+++ b/auxdir/ltversion.m4
@@ -1,6 +1,6 @@
 # ltversion.m4 -- version numbers			-*- Autoconf -*-
 #
-#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
 #   Written by Scott James Remnant, 2004
 #
 # This file is free software; the Free Software Foundation gives
@@ -9,15 +9,15 @@
 
 # @configure_input@
 
-# serial 3337 ltversion.m4
+# serial 4179 ltversion.m4
 # This file is part of GNU Libtool
 
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
 
 AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
 _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
 _LT_DECL(, macro_revision, 0)
 ])
diff --git a/auxdir/lt~obsolete.m4 b/auxdir/lt~obsolete.m4
index c573da90c..c6b26f88f 100644
--- a/auxdir/lt~obsolete.m4
+++ b/auxdir/lt~obsolete.m4
@@ -1,6 +1,7 @@
 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
 #
-#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+#   Foundation, Inc.
 #   Written by Scott James Remnant, 2004.
 #
 # This file is free software; the Free Software Foundation gives
@@ -11,7 +12,7 @@
 
 # These exist entirely to fool aclocal when bootstrapping libtool.
 #
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
 # which have later been changed to m4_define as they aren't part of the
 # exported API, or moved to Autoconf or Automake where they belong.
 #
@@ -25,7 +26,7 @@
 # included after everything else.  This provides aclocal with the
 # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
 # because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
 #
 # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
 # Yes, that means every name once taken will need to remain here until
diff --git a/auxdir/type_socklen_t.m4 b/auxdir/type_socklen_t.m4
index e975ee945..efefa000a 100644
--- a/auxdir/type_socklen_t.m4
+++ b/auxdir/type_socklen_t.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Lars Brinkhoff <lars@nocrew.org>
 #
diff --git a/auxdir/x_ac__system_configuration.m4 b/auxdir/x_ac__system_configuration.m4
index e1810d1be..dbf251a11 100644
--- a/auxdir/x_ac__system_configuration.m4
+++ b/auxdir/x_ac__system_configuration.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Moe Jette <jette@llnl.gov>
 #
diff --git a/auxdir/x_ac_affinity.m4 b/auxdir/x_ac_affinity.m4
index dab31f9a4..ad96be9cc 100644
--- a/auxdir/x_ac_affinity.m4
+++ b/auxdir/x_ac_affinity.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette1@llnl.gov>
 #
diff --git a/auxdir/x_ac_aix.m4 b/auxdir/x_ac_aix.m4
index b9ff7b100..bc294c13c 100644
--- a/auxdir/x_ac_aix.m4
+++ b/auxdir/x_ac_aix.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette@llnl.gov>
 #
diff --git a/auxdir/x_ac_blcr.m4 b/auxdir/x_ac_blcr.m4
index b442f9e3c..77acce9a7 100644
--- a/auxdir/x_ac_blcr.m4
+++ b/auxdir/x_ac_blcr.m4
@@ -1,10 +1,7 @@
 ##*****************************************************************************
-## $Id: x_ac_blcr.m4 0001 2009-01-10 16:06:05Z hjcao $
-##*****************************************************************************
 #  AUTHOR:
 #    Copied from x_ac_munge.
 #
-#
 #  SYNOPSIS:
 #    X_AC_BLCR()
 #
@@ -24,46 +21,48 @@ AC_DEFUN([X_AC_BLCR], [
   AC_ARG_WITH(
     [blcr],
     AS_HELP_STRING(--with-blcr=PATH,Specify path to BLCR installation),
-    [_x_ac_blcr_dirs="$withval $_x_ac_blcr_dirs"])
-
-  AC_CACHE_CHECK(
-    [for blcr installation],
-    [x_ac_cv_blcr_dir],
-    [
-      for d in $_x_ac_blcr_dirs; do
-	test -d "$d" || continue
-	test -d "$d/include" || continue
-	test -f "$d/include/libcr.h" || continue
-	for bit in $_x_ac_blcr_libs; do
-	  test -d "$d/$bit" || continue
+    [AS_IF([test "x$with_blcr" != xno],[_x_ac_blcr_dirs="$with_blcr $_x_ac_blcr_dirs"])])
 
- 	  _x_ac_blcr_libs_save="$LIBS"
-	  LIBS="-L$d/$bit -lcr $LIBS"
-	  AC_LINK_IFELSE(
-	    [AC_LANG_CALL([], cr_get_restart_info)],
-	    AS_VAR_SET(x_ac_cv_blcr_dir, $d))
-	  LIBS="$_x_ac_blcr_libs_save"
-	  test -n "$x_ac_cv_blcr_dir" && break
-	done
-	test -n "$x_ac_cv_blcr_dir" && break
-      done
-    ])
-
-  if test -z "$x_ac_cv_blcr_dir"; then
-    AC_MSG_WARN([unable to locate blcr installation])
+  if [test "x$with_blcr" = xno]; then
+    AC_MSG_WARN([support for blcr disabled])
   else
-    BLCR_HOME="$x_ac_cv_blcr_dir"
-    BLCR_LIBS="-lcr"
-    BLCR_CPPFLAGS="-I$x_ac_cv_blcr_dir/include"
-    BLCR_LDFLAGS="-L$x_ac_cv_blcr_dir/$bit"
-  fi
+    AC_CACHE_CHECK(
+      [for blcr installation],
+      [x_ac_cv_blcr_dir],
+      [
+        for d in $_x_ac_blcr_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/libcr.h" || continue
+          for bit in $_x_ac_blcr_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_blcr_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lcr $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], cr_get_restart_info)],
+              AS_VAR_SET(x_ac_cv_blcr_dir, $d))
+            LIBS="$_x_ac_blcr_libs_save"
+            test -n "$x_ac_cv_blcr_dir" && break
+          done
+          test -n "$x_ac_cv_blcr_dir" && break
+        done
+      ])
 
-  AC_DEFINE_UNQUOTED(BLCR_HOME, "$x_ac_cv_blcr_dir", [Define BLCR installation home])
-  AC_SUBST(BLCR_HOME)
+    if test -z "$x_ac_cv_blcr_dir"; then
+      AC_MSG_WARN([unable to locate blcr installation])
+    else
+      BLCR_HOME="$x_ac_cv_blcr_dir"
+      BLCR_LIBS="-lcr"
+      BLCR_CPPFLAGS="-I$x_ac_cv_blcr_dir/include"
+      BLCR_LDFLAGS="-L$x_ac_cv_blcr_dir/$bit"
+    fi
 
-  AC_SUBST(BLCR_LIBS)
-  AC_SUBST(BLCR_CPPFLAGS)
-  AC_SUBST(BLCR_LDFLAGS)
+    AC_DEFINE_UNQUOTED(BLCR_HOME, "$x_ac_cv_blcr_dir", [Define BLCR installation home])
+    AC_SUBST(BLCR_HOME)
+    AC_SUBST(BLCR_LIBS)
+    AC_SUBST(BLCR_CPPFLAGS)
+    AC_SUBST(BLCR_LDFLAGS)
+  fi
 
   AM_CONDITIONAL(WITH_BLCR, test -n "$x_ac_cv_blcr_dir")
 ])
diff --git a/auxdir/x_ac_bluegene.m4 b/auxdir/x_ac_bluegene.m4
index eeecb0694..34837a403 100644
--- a/auxdir/x_ac_bluegene.m4
+++ b/auxdir/x_ac_bluegene.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette1@llnl.gov>, Danny Auble <da@llnl.gov>
 #
diff --git a/auxdir/x_ac_cflags.m4 b/auxdir/x_ac_cflags.m4
deleted file mode 100644
index a9a616d67..000000000
--- a/auxdir/x_ac_cflags.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-##*****************************************************************************
-## $Id: x_ac_cflags.m4 5401 2005-09-22 01:56:49Z morrone $
-##*****************************************************************************
-#  AUTHOR:
-#    Danny Auble  <da@llnl.gov>
-#
-#  SYNOPSIS:
-#    X_AC_CFLAGS
-#
-#  DESCRIPTION:
-#    Add extra cflags
-##*****************************************************************************
-
-
-AC_DEFUN([X_AC_CFLAGS],
-[
-	# 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
-	# and then using them.  It is also advised to set the flag if there
-	# are goto statements you may get better performance.
-	if test "$GCC" = yes; then
-		CFLAGS="$CFLAGS -fno-gcse"
-	fi
-])
diff --git a/auxdir/x_ac_cray.m4 b/auxdir/x_ac_cray.m4
index 2e608eed2..6979c13ab 100644
--- a/auxdir/x_ac_cray.m4
+++ b/auxdir/x_ac_cray.m4
@@ -92,6 +92,10 @@ AC_DEFUN([X_AC_CRAY],
     _x_ac_cray_alpscomm_dir="alpscomm/default"
 
     _x_ac_cray_dirs="/opt/cray"
+    AC_ARG_WITH(
+      [cray_dir],
+      AS_HELP_STRING(--with-cray_dir=PATH,Specify path to Cray file installation - /opt/cray by default),
+      [AS_IF([test "x$with_cray_dir" != xno],[_x_ac_cray_dirs="$with_cray_dir $_x_ac_cray_dirs"])])
 
     for d in $_x_ac_cray_dirs; do
       test -d "$d" || continue
diff --git a/auxdir/x_ac_databases.m4 b/auxdir/x_ac_databases.m4
index 8cfa87105..0779dc9c1 100644
--- a/auxdir/x_ac_databases.m4
+++ b/auxdir/x_ac_databases.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id: x_ac_databases.m4 5401 2005-09-22 01:56:49Z da $
-##*****************************************************************************
 #  AUTHOR:
 #    Danny Auble  <da@llnl.gov>
 #
@@ -52,7 +50,6 @@ AC_DEFUN([X_AC_DATABASES],
 			   test $mysql_config_micro_version -ge 4); then
 			    AC_DEFINE(NO_ALTER_IGNORE_MYSQL, 1, [Define to 1 if we can't use the alter ignore when messing with a database table])
 			fi
-
 		# mysql_config puts -I on the front of the dir.  We don't
 		# want that so we remove it.
 			MYSQL_CFLAGS=`$HAVEMYSQLCONFIG --include`
@@ -71,7 +68,7 @@ AC_DEFUN([X_AC_DATABASES],
 			CFLAGS="$save_CFLAGS"
 			LIBS="$save_LIBS"
 			if test "$ac_have_mysql" = yes; then
-				AC_MSG_RESULT([MySQL test program built properly.])
+				AC_MSG_RESULT([MySQL $mysql_config_major_version.$mysql_config_minor_version.$mysql_config_micro_version test program built properly.])
 				AC_SUBST(MYSQL_LIBS)
 				AC_SUBST(MYSQL_CFLAGS)
 				AC_DEFINE(HAVE_MYSQL, 1, [Define to 1 if using MySQL libaries])
diff --git a/auxdir/x_ac_debug.m4 b/auxdir/x_ac_debug.m4
index 50f67289a..e87b7603e 100644
--- a/auxdir/x_ac_debug.m4
+++ b/auxdir/x_ac_debug.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Chris Dunlap <cdunlap@llnl.gov>
 #
diff --git a/auxdir/x_ac_elan.m4 b/auxdir/x_ac_elan.m4
deleted file mode 100644
index 4889a7530..000000000
--- a/auxdir/x_ac_elan.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-##*****************************************************************************
-## $Id$
-##*****************************************************************************
-#  AUTHOR:
-#    Mark A. Grondona <mgrondona@llnl.gov>
-#
-#  SYNOPSIS:
-#    AC_ELAN
-#
-#  DESCRIPTION:
-#    Checks for whether Elan MPI may be supported either via libelan3
-#     or libelanctrl. ELAN_LIBS is set to the libraries needed for
-#     Elan modules.
-#
-#  WARNINGS:
-#    This macro must be placed after AC_PROG_CC or equivalent.
-##*****************************************************************************
-
-
-AC_DEFUN([X_AC_ELAN],
-[
-   AC_CHECK_LIB([rmscall],  
-	        [rms_prgcreate], 
-	        [ac_elan_have_rmscall=yes; ELAN_LIBS="-lrmscall"])
-
-   if test "$ac_elan_have_rmscall" != "yes" ; then
-       AC_MSG_NOTICE([Cannot support QsNet without librmscall])        
-   fi
-
-   AC_CHECK_LIB([elan3], [elan3_create],  
-	        [ac_elan_have_elan3=yes],
-	        [ac_elan_noelan3=1])
-
-   AC_CHECK_LIB([elanctrl], [elanctrl_open], 
-	        [ac_elan_have_elanctrl=yes], 
-	        [ac_elan_noelanctrl=1])
-
-   if test "$ac_elan_have_elan3" = "yes"; then
-      AC_DEFINE(HAVE_LIBELAN3, 1, [define if you have libelan3.])
-      ELAN_LIBS="$ELAN_LIBS -lelan3"
-      test "$ac_elan_have_rmscall" = "yes" && ac_have_elan="yes"
-   elif test "$ac_elan_have_elanctrl" = "yes"; then
-      AC_DEFINE(HAVE_LIBELANCTRL, 1, [define if you have libelanctrl.])
-      ELAN_LIBS="$ELAN_LIBS -lelanctrl"
-      test "$ac_elan_have_rmscall" = "yes" && ac_have_elan="yes"
-   else
-      AC_MSG_NOTICE([Cannot support QsNet without libelan3 or libelanctrl!])
-   fi
-
-   if test "$ac_have_elan" = yes; then
-     AC_CHECK_LIB([elanhosts], [elanhost_config_create],
-                  [ac_elan_have_elanhosts=yes], [])
-
-     if test "$ac_elan_have_elanhosts" = "yes"; then
-        AC_DEFINE(HAVE_LIBELANHOSTS, 1, [define if you have libelanhosts.])
-        ELAN_LIBS="$ELAN_LIBS -lelanhosts"
-     else
-        ac_have_elan="no"
-        AC_MSG_NOTICE([Cannot build QsNet modules without libelanhosts])
-     fi
-   fi
-
-   AC_SUBST(ELAN_LIBS)
-])
diff --git a/auxdir/x_ac_federation.m4 b/auxdir/x_ac_federation.m4
deleted file mode 100644
index 4394c56ab..000000000
--- a/auxdir/x_ac_federation.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-##*****************************************************************************
-## $Id$
-##*****************************************************************************
-#  AUTHOR:
-#    Jason King <jking@llnl.gov>
-#
-#  SYNOPSIS:
-#    AC_FEDERATION
-#
-#  DESCRIPTION:
-#    Checks for availability of the libraries necessary to support
-#     communication via User Space over the Federation switch.
-#
-#  WARNINGS:
-#    This macro must be placed after AC_PROG_CC or equivalent.
-##*****************************************************************************
-
-
-AC_DEFUN([X_AC_FEDERATION],
-[
-   AC_MSG_CHECKING([whether to enable AIX Federation switch support])
-   ntbl_default_dirs="/usr/lib"
-   for ntbl_dir in $ntbl_default_dirs; do
-      # skip dirs that don't exist
-      if test ! -z "$ntbl_dir" -a ! -d "$ntbl_dir" ; then
-         continue;
-      fi
-
-      if test "$OBJECT_MODE" = "64"; then
-	 libntbl="ntbl_64"
-      else
-         libntbl="ntbl"
-      fi
-
-      # search for required NTBL API libraries
-      if test -f "$ntbl_dir/lib${libntbl}.so"; then
-         ac_have_federation="yes"
-         FEDERATION_LDFLAGS="-l$libntbl"
-         break;
-      fi
-
-   done
-
-   if test "x$ac_have_federation" != "xyes" ; then
-      AC_MSG_RESULT([no])
-      AC_MSG_NOTICE([Cannot support Federation without libntbl])
-   else
-      AC_MSG_RESULT([yes])
-      AC_DEFINE(HAVE_LIBNTBL, 1, [define if you have libntbl.])
-   fi
-
-   AC_SUBST(FEDERATION_LDFLAGS)
-])
diff --git a/auxdir/x_ac_freeipmi.m4 b/auxdir/x_ac_freeipmi.m4
index e3f9c916d..2c0fa567b 100644
--- a/auxdir/x_ac_freeipmi.m4
+++ b/auxdir/x_ac_freeipmi.m4
@@ -17,52 +17,56 @@ AC_DEFUN([X_AC_FREEIPMI],
   AC_ARG_WITH(
     [freeipmi],
     AS_HELP_STRING(--with-freeipmi=PATH,Specify path to freeipmi installation),
-    [_x_ac_freeipmi_dirs="$withval $_x_ac_freeipmi_dirs"])
+    [AS_IF([test "x$with_freeipmi" != xno],[_x_ac_freeipmi_dirs="$with_freeipmi $_x_ac_freeipmi_dirs"])])
 
-  AC_CACHE_CHECK(
-    [for freeipmi installation],
-    [x_ac_cv_freeipmi_dir],
-    [
-      for d in $_x_ac_freeipmi_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/ipmi_monitoring.h" || continue
-	for bit in $_x_ac_freeipmi_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_freeipmi_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
- 	  _x_ac_freeipmi_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lipmimonitoring $LIBS"
-          AC_TRY_LINK([#include <ipmi_monitoring.h>
-#include <ipmi_monitoring_bitmasks.h>],
-[int err;]
-[unsigned int flag = 0;]
-[return ipmi_monitoring_init (flag, &err);],
-AS_VAR_SET(x_ac_cv_freeipmi_dir, $d), [])
-          CPPFLAGS="$_x_ac_freeipmi_cppflags_save"
-          LIBS="$_x_ac_freeipmi_libs_save"
+  if [test "x$with_freeipmi" = xno]; then
+    AC_MSG_WARN([support for freeipmi disabled])
+  else
+    AC_CACHE_CHECK(
+      [for freeipmi installation],
+      [x_ac_cv_freeipmi_dir],
+      [
+        for d in $_x_ac_freeipmi_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/ipmi_monitoring.h" || continue
+          for bit in $_x_ac_freeipmi_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_freeipmi_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_freeipmi_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lipmimonitoring $LIBS"
+            AC_TRY_LINK([#include <ipmi_monitoring.h>
+              #include <ipmi_monitoring_bitmasks.h>],
+              [int err;]
+              [unsigned int flag = 0;]
+              [return ipmi_monitoring_init (flag, &err);],
+              AS_VAR_SET(x_ac_cv_freeipmi_dir, $d), [])
+            CPPFLAGS="$_x_ac_freeipmi_cppflags_save"
+            LIBS="$_x_ac_freeipmi_libs_save"
+            test -n "$x_ac_cv_freeipmi_dir" && break
+          done
           test -n "$x_ac_cv_freeipmi_dir" && break
-	done
-        test -n "$x_ac_cv_freeipmi_dir" && break
-      done
-    ])
+        done
+      ])
 
-  if test -z "$x_ac_cv_freeipmi_dir"; then
-    AC_MSG_WARN([unable to locate freeipmi installation])
-  else
-    FREEIPMI_CPPFLAGS="-I$x_ac_cv_freeipmi_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      FREEIPMI_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_freeipmi_dir/$bit -L$x_ac_cv_freeipmi_dir/$bit"
+    if test -z "$x_ac_cv_freeipmi_dir"; then
+      AC_MSG_WARN([unable to locate freeipmi installation])
     else
-      FREEIPMI_LDFLAGS="-L$x_ac_cv_freeipmi_dir/$bit"
+      FREEIPMI_CPPFLAGS="-I$x_ac_cv_freeipmi_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        FREEIPMI_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_freeipmi_dir/$bit -L$x_ac_cv_freeipmi_dir/$bit"
+      else
+        FREEIPMI_LDFLAGS="-L$x_ac_cv_freeipmi_dir/$bit"
+      fi
+      FREEIPMI_LIBS="-lipmimonitoring"
+      AC_DEFINE(HAVE_FREEIPMI, 1, [Define to 1 if freeipmi library found])
     fi
-    FREEIPMI_LIBS="-lipmimonitoring"
-    AC_DEFINE(HAVE_FREEIPMI, 1, [Define to 1 if freeipmi library found])
+
+    AC_SUBST(FREEIPMI_LIBS)
+    AC_SUBST(FREEIPMI_CPPFLAGS)
+    AC_SUBST(FREEIPMI_LDFLAGS)
   fi
 
-  AC_SUBST(FREEIPMI_LIBS)
-  AC_SUBST(FREEIPMI_CPPFLAGS)
-  AC_SUBST(FREEIPMI_LDFLAGS)
   AM_CONDITIONAL(BUILD_IPMI, test -n "$x_ac_cv_freeipmi_dir")
-
 ])
diff --git a/auxdir/x_ac_gpl_licensed.m4 b/auxdir/x_ac_gpl_licensed.m4
index f8e17cfa1..a6420c5f8 100644
--- a/auxdir/x_ac_gpl_licensed.m4
+++ b/auxdir/x_ac_gpl_licensed.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Chris Dunlap <cdunlap@llnl.gov>
 #
diff --git a/auxdir/x_ac_hwloc.m4 b/auxdir/x_ac_hwloc.m4
index 8ebad6f1b..c61a0b127 100644
--- a/auxdir/x_ac_hwloc.m4
+++ b/auxdir/x_ac_hwloc.m4
@@ -18,53 +18,57 @@ AC_DEFUN([X_AC_HWLOC],
   AC_ARG_WITH(
     [hwloc],
     AS_HELP_STRING(--with-hwloc=PATH,Specify path to hwloc installation),
-    [_x_ac_hwloc_dirs="$withval $_x_ac_hwloc_dirs"])
+    [AS_IF([test "x$with_hwloc" != xno],[_x_ac_hwloc_dirs="$with_hwloc $_x_ac_hwloc_dirs"])])
 
-  AC_CACHE_CHECK(
-    [for hwloc installation],
-    [x_ac_cv_hwloc_dir],
-    [
-      for d in $_x_ac_hwloc_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/hwloc.h" || continue
-	for bit in $_x_ac_hwloc_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_hwloc_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
- 	  _x_ac_hwloc_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lhwloc $LIBS"
-          AC_LINK_IFELSE(
-            [AC_LANG_CALL([], hwloc_topology_init)],
-            AS_VAR_SET(x_ac_cv_hwloc_dir, $d))
-          AC_TRY_LINK([#include <hwloc.h>],
-                      [int i = HWLOC_OBJ_PCI_DEVICE;],
-                      [x_ac_cv_hwloc_pci="yes"], [])
-          CPPFLAGS="$_x_ac_hwloc_cppflags_save"
-          LIBS="$_x_ac_hwloc_libs_save"
+  if [test "x$with_hwloc" = xno]; then
+     AC_MSG_WARN([support for hwloc disabled])
+  else
+    AC_CACHE_CHECK(
+      [for hwloc installation],
+      [x_ac_cv_hwloc_dir],
+      [
+        for d in $_x_ac_hwloc_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/hwloc.h" || continue
+          for bit in $_x_ac_hwloc_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_hwloc_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_hwloc_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lhwloc $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], hwloc_topology_init)],
+              AS_VAR_SET(x_ac_cv_hwloc_dir, $d))
+            AC_TRY_LINK([#include <hwloc.h>],
+              [int i = HWLOC_OBJ_PCI_DEVICE;],
+              [x_ac_cv_hwloc_pci="yes"], [])
+            CPPFLAGS="$_x_ac_hwloc_cppflags_save"
+            LIBS="$_x_ac_hwloc_libs_save"
+            test -n "$x_ac_cv_hwloc_dir" && break
+          done
           test -n "$x_ac_cv_hwloc_dir" && break
-	done
-        test -n "$x_ac_cv_hwloc_dir" && break
-      done
-    ])
+        done
+      ])
 
-  if test -z "$x_ac_cv_hwloc_dir"; then
-    AC_MSG_WARN([unable to locate hwloc installation])
-  else
-    HWLOC_CPPFLAGS="-I$x_ac_cv_hwloc_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      HWLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_hwloc_dir/$bit -L$x_ac_cv_hwloc_dir/$bit"
+    if test -z "$x_ac_cv_hwloc_dir"; then
+      AC_MSG_WARN([unable to locate hwloc installation])
     else
-      HWLOC_LDFLAGS="-L$x_ac_cv_hwloc_dir/$bit"
-    fi
-    HWLOC_LIBS="-lhwloc"
-    AC_DEFINE(HAVE_HWLOC, 1, [Define to 1 if hwloc library found])
-    if test "$x_ac_cv_hwloc_pci" = "yes"; then
-      AC_DEFINE(HAVE_HWLOC_PCI, 1, [Define to 1 if hwloc library supports PCI devices])
+      HWLOC_CPPFLAGS="-I$x_ac_cv_hwloc_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        HWLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_hwloc_dir/$bit -L$x_ac_cv_hwloc_dir/$bit"
+      else
+        HWLOC_LDFLAGS="-L$x_ac_cv_hwloc_dir/$bit"
+      fi
+      HWLOC_LIBS="-lhwloc"
+      AC_DEFINE(HAVE_HWLOC, 1, [Define to 1 if hwloc library found])
+      if test "$x_ac_cv_hwloc_pci" = "yes"; then
+        AC_DEFINE(HAVE_HWLOC_PCI, 1, [Define to 1 if hwloc library supports PCI devices])
+      fi
     fi
-  fi
 
-  AC_SUBST(HWLOC_LIBS)
-  AC_SUBST(HWLOC_CPPFLAGS)
-  AC_SUBST(HWLOC_LDFLAGS)
+    AC_SUBST(HWLOC_LIBS)
+    AC_SUBST(HWLOC_CPPFLAGS)
+    AC_SUBST(HWLOC_LDFLAGS)
+  fi
 ])
diff --git a/auxdir/x_ac_json.m4 b/auxdir/x_ac_json.m4
index b429bacda..46a70d52e 100644
--- a/auxdir/x_ac_json.m4
+++ b/auxdir/x_ac_json.m4
@@ -15,51 +15,56 @@
 
 AC_DEFUN([X_AC_JSON], [
 
-  x_ac_json_dirs="/usr /usr/local"
-  x_ac_json_libs="lib64 lib"
+  _x_ac_json_dirs="/usr /usr/local"
+  _x_ac_json_libs="lib64 lib"
 
   AC_ARG_WITH(
     [json],
     AS_HELP_STRING(--with-json=PATH,Specify path to json-c installation),
-    [x_ac_json_dirs="$withval $x_ac_json_dirs"])
+    [AS_IF([test "x$with_json" != xno],[_x_ac_json_dirs="$with_json $_x_ac_json_dirs"])])
 
-  AC_CACHE_CHECK(
-    [for json installation],
-    [x_ac_cv_json_dir],
-    [
-     for d in $x_ac_json_dirs; do
-       test -d "$d" || continue
-       test -d "$d/include" || continue
-       test -f "$d/include/json-c/json_object.h" || test -f "$d/include/json/json_object.h" || continue
-       for bit in $x_ac_json_libs; do
-         test -d "$d/$bit" || continue
-         _x_ac_json_libs_save="$LIBS"
-         LIBS="-L$d/$bit -ljson-c $LIBS"
-         AC_LINK_IFELSE(
-           [AC_LANG_CALL([], json_tokener_parse)],
-           AS_VAR_SET(x_ac_cv_json_dir, $d))
-        LIBS="$_x_ac_json_libs_save"
-        test -n "$x_ac_cv_json_dir" && break
-     done
-     test -n "$x_ac_cv_json_dir" && break
-  done
-  ])
-
-  if test -z "$x_ac_cv_json_dir"; then
-    AC_MSG_WARN([unable to locate json parser library])
-  else
-    if test -f "$d/include/json-c/json_object.h" ; then
-      AC_DEFINE([HAVE_JSON_C_INC], [1], [Define if headers in include/json-c.])
-    fi
-    if test -f "$d/include/json/json_object.h" ; then
-      AC_DEFINE([HAVE_JSON_INC], [1], [Define if headers in include/json.])
+  if [test "x$with_json" = xno]; then
+    AC_MSG_WARN([support for json disabled])
+  else 
+    AC_CACHE_CHECK(
+      [for json installation],
+      [x_ac_cv_json_dir],
+      [
+        for d in $_x_ac_json_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/json-c/json_object.h" || test -f "$d/include/json/json_object.h" || continue
+          for bit in $_x_ac_json_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_json_libs_save="$LIBS"
+            LIBS="-L$d/$bit -ljson-c $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], json_tokener_parse)],
+              AS_VAR_SET(x_ac_cv_json_dir, $d))
+            LIBS="$_x_ac_json_libs_save"
+            test -n "$x_ac_cv_json_dir" && break
+          done
+          test -n "$x_ac_cv_json_dir" && break
+        done
+      ])
+  
+    if test -z "$x_ac_cv_json_dir"; then
+      AC_MSG_WARN([unable to locate json parser library])
+    else
+      if test -f "$d/include/json-c/json_object.h" ; then
+        AC_DEFINE([HAVE_JSON_C_INC], [1], [Define if headers in include/json-c.])
+      fi
+      if test -f "$d/include/json/json_object.h" ; then
+        AC_DEFINE([HAVE_JSON_INC], [1], [Define if headers in include/json.])
+      fi
+      AC_DEFINE([HAVE_JSON], [1], [Define if you are compiling with json.])
+      JSON_CPPFLAGS="-I$x_ac_cv_json_dir/include"
+      JSON_LDFLAGS="-L$x_ac_cv_json_dir/$bit -ljson-c"
     fi
-    AC_DEFINE([HAVE_JSON], [1], [Define if you are compiling with json.])
-    JSON_CPPFLAGS="-I$x_ac_cv_json_dir/include"
-    JSON_LDFLAGS="-L$x_ac_cv_json_dir/$bit -ljson-c"
+  
+    AC_SUBST(JSON_CPPFLAGS)
+    AC_SUBST(JSON_LDFLAGS)
   fi
 
-  AC_SUBST(JSON_CPPFLAGS)
-  AC_SUBST(JSON_LDFLAGS)
   AM_CONDITIONAL(WITH_JSON_PARSER, test -n "$x_ac_cv_json_dir")
 ])
diff --git a/auxdir/x_ac_lua.m4 b/auxdir/x_ac_lua.m4
index 4241fc275..28acc510b 100644
--- a/auxdir/x_ac_lua.m4
+++ b/auxdir/x_ac_lua.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Mark Grondona <mgrondona@llnl.gov>
 #
diff --git a/auxdir/x_ac_lz4.m4 b/auxdir/x_ac_lz4.m4
new file mode 100644
index 000000000..9d649ad40
--- /dev/null
+++ b/auxdir/x_ac_lz4.m4
@@ -0,0 +1,88 @@
+##*****************************************************************************
+#  AUTHOR:
+#    Danny Auble  <da@schedmd.com>
+#
+#  SYNOPSIS:
+#    X_AC_LZ4
+#
+#  DESCRIPTION:
+#    Test if we have liblz4 installed. If found define appropriate ENVs.
+#
+##*****************************************************************************
+
+AC_DEFUN([X_AC_LZ4],
+#
+# Handle user hints
+#
+[AC_MSG_CHECKING(if lz4 is installed)
+lz4_places="/usr/local /usr /opt/local /sw"
+AC_ARG_WITH([lz4],
+[  --with-lz4=DIR     root directory path of lz4 installation @<:@defaults to
+                      /usr/local or /usr if not found in /usr/local@:>@
+   --without-lz4      to disable lz4 usage completely],
+[if test "$withval" != no ; then
+  AC_MSG_RESULT(yes)
+  if test -d "$withval"
+  then
+    lz4_places="$withval $lz4_places"
+  else
+    AC_MSG_WARN([$withval does not exist, checking usual places])
+  fi
+else
+  lz4_places=
+  AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(yes ${lz4_places})])
+
+#
+# Locate lz4, if installed
+#
+if test -n "${lz4_places}"
+then
+  # check the user supplied or any other more or less 'standard' place:
+  #   Most UNIX systems      : /usr/local and /usr
+  #   MacPorts / Fink on OSX : /opt/local respectively /sw
+  for LZ4_HOME in ${lz4_places} ; do
+    if test -f "${LZ4_HOME}/include/lz4.h"; then break; fi
+    LZ4_HOME=""
+  done
+
+  LZ4_OLD_LDFLAGS=$LDFLAGS
+  LZ4_OLD_CPPFLAGS=$CPPFLAGS
+  if test -n "${LZ4_HOME}"; then
+      LZ4_CPPFLAGS="-I${LZ4_HOME}/include"
+      LZ4_LDFLAGS="-L${LZ4_HOME}/lib"
+      LZ4_LIBS="-llz4"
+
+      LDFLAGS="$LDFLAGS -L${LZ4_LDFLAGS}"
+      CPPFLAGS="$CPPFLAGS -I${LZ4_CPPFLAGS}"
+  fi
+  AC_LANG_SAVE
+  AC_LANG_C
+  AC_CHECK_LIB([lz4], [LZ4_compress_destSize], [ac_cv_lz4=yes], [ac_cv_lz4=no])
+  AC_CHECK_HEADER([lz4.h], [ac_cv_lz4_h=yes], [ac_cv_lz4_h=no])
+  AC_LANG_RESTORE
+
+  # Restore variables
+  LDFLAGS="$LZ4_OLD_LDFLAGS"
+  CPPFLAGS="$LZ4_OLD_CPPFLAGS"
+
+  if test "$ac_cv_lz4" = "yes" && test "$ac_cv_lz4_h" = "yes"
+  then
+      #
+      # If both library and header were found, action-if-found
+      #
+      AC_SUBST(LZ4_CPPFLAGS)
+      AC_SUBST(LZ4_LDFLAGS)
+      AC_SUBST(LZ4_LIBS)
+      AC_DEFINE([HAVE_LZ4], [1],
+                [Define to 1 if you have 'lz4' library (-llz4)])
+      AC_MSG_RESULT([LZ4 test program built properly.])
+  else
+      AC_MSG_WARN([LZ4 test program build failed.])
+  fi
+else
+  AC_MSG_WARN([unable to locate LZ4 install.])
+fi
+
+])
diff --git a/auxdir/x_ac_munge.m4 b/auxdir/x_ac_munge.m4
index 7b1f09ed8..8d18e8e1b 100644
--- a/auxdir/x_ac_munge.m4
+++ b/auxdir/x_ac_munge.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Chris Dunlap <cdunlap@llnl.gov> (originally for OpenSSL)
 #    Modified for munge by Christopher Morrone <morrone2@llnl.gov>
@@ -24,48 +22,51 @@ AC_DEFUN([X_AC_MUNGE], [
   AC_ARG_WITH(
     [munge],
     AS_HELP_STRING(--with-munge=PATH,Specify path to munge installation),
-    [_x_ac_munge_dirs="$withval $_x_ac_munge_dirs"])
-
-  AC_CACHE_CHECK(
-    [for munge installation],
-    [x_ac_cv_munge_dir],
-    [
-      for d in $_x_ac_munge_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/munge.h" || continue
-	for bit in $_x_ac_munge_libs; do
-          test -d "$d/$bit" || continue
+    [AS_IF([test "x$with_munge" != xno],[_x_ac_munge_dirs="$with_munge $_x_ac_munge_dirs"])])
 
- 	  _x_ac_munge_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lmunge $LIBS"
-          AC_LINK_IFELSE(
-            [AC_LANG_CALL([], munge_encode)],
-            AS_VAR_SET(x_ac_cv_munge_dir, $d))
-          LIBS="$_x_ac_munge_libs_save"
+  if [test "x$with_munge" = xno]; then
+    AC_MSG_WARN([support for munge disabled])
+  else
+    AC_CACHE_CHECK(
+      [for munge installation],
+      [x_ac_cv_munge_dir],
+      [
+        for d in $_x_ac_munge_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/munge.h" || continue
+          for bit in $_x_ac_munge_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_munge_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lmunge $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], munge_encode)],
+              AS_VAR_SET(x_ac_cv_munge_dir, $d))
+            LIBS="$_x_ac_munge_libs_save"
+            test -n "$x_ac_cv_munge_dir" && break
+          done
           test -n "$x_ac_cv_munge_dir" && break
-	done
-        test -n "$x_ac_cv_munge_dir" && break
-      done
-    ])
+        done
+      ])
 
-  if test -z "$x_ac_cv_munge_dir"; then
-    AC_MSG_WARN([unable to locate munge installation])
-  else
-    MUNGE_LIBS="-lmunge"
-    MUNGE_CPPFLAGS="-I$x_ac_cv_munge_dir/include"
-    MUNGE_DIR="$x_ac_cv_munge_dir"
-    if test "$ac_with_rpath" = "yes"; then
-      MUNGE_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_munge_dir/$bit -L$x_ac_cv_munge_dir/$bit"
+    if test -z "$x_ac_cv_munge_dir"; then
+      AC_MSG_WARN([unable to locate munge installation])
     else
-      MUNGE_LDFLAGS="-L$x_ac_cv_munge_dir/$bit"
+      MUNGE_LIBS="-lmunge"
+      MUNGE_CPPFLAGS="-I$x_ac_cv_munge_dir/include"
+      MUNGE_DIR="$x_ac_cv_munge_dir"
+      if test "$ac_with_rpath" = "yes"; then
+        MUNGE_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_munge_dir/$bit -L$x_ac_cv_munge_dir/$bit"
+      else
+        MUNGE_LDFLAGS="-L$x_ac_cv_munge_dir/$bit"
+      fi
     fi
-  fi
 
-  AC_SUBST(MUNGE_LIBS)
-  AC_SUBST(MUNGE_CPPFLAGS)
-  AC_SUBST(MUNGE_LDFLAGS)
-  AC_SUBST(MUNGE_DIR)
+    AC_SUBST(MUNGE_LIBS)
+    AC_SUBST(MUNGE_CPPFLAGS)
+    AC_SUBST(MUNGE_LDFLAGS)
+    AC_SUBST(MUNGE_DIR)
+  fi
 
   AM_CONDITIONAL(WITH_MUNGE, test -n "$x_ac_cv_munge_dir")
 ])
diff --git a/auxdir/x_ac_ncurses.m4 b/auxdir/x_ac_ncurses.m4
index 936ea6f68..cd71bc4db 100644
--- a/auxdir/x_ac_ncurses.m4
+++ b/auxdir/x_ac_ncurses.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette  <jette1@llnl.gov>
 #
diff --git a/auxdir/x_ac_netloc.m4 b/auxdir/x_ac_netloc.m4
index 93bbfac54..bf9aad2bd 100644
--- a/auxdir/x_ac_netloc.m4
+++ b/auxdir/x_ac_netloc.m4
@@ -18,62 +18,67 @@ AC_DEFUN([X_AC_NETLOC],
   AC_ARG_WITH(
     [netloc],
     AS_HELP_STRING(--with-netloc=PATH,Specify path to netloc installation),
-    [_x_ac_netloc_dirs="$withval $_x_ac_netloc_dirs"])
+    [AS_IF([test "x$with_netloc" != xno],[_x_ac_netloc_dirs="$with_netloc $_x_ac_netloc_dirs"])])
 
-  AC_CACHE_CHECK(
-    [for netloc installation],
-    [x_ac_cv_netloc_dir],
-    [
-      for d in $_x_ac_netloc_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/netloc.h" || continue
-        for bit in $_x_ac_netloc_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_netloc_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
-          _x_ac_netloc_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lnetloc $LIBS"
-          AC_LINK_IFELSE(
-            [AC_LANG_PROGRAM([#include <netloc.h>
-                              #include <netloc/map.h>],
-                             [netloc_map_t map;
-                              netloc_map_create(&map);]) ],
-            AS_VAR_SET(x_ac_cv_netloc_dir, $d))
-          AC_LINK_IFELSE(
-            [AC_LANG_PROGRAM([#include <netloc.h>
-                              #include <netloc_map.h>],
-                             [netloc_map_t map;
-                              netloc_map_create(&map)]) ],
-            AS_VAR_SET(x_ac_cv_netloc_dir, $d)
-            x_ac_cv_netloc_nosub="yes"
-            )
-          CPPFLAGS="$_x_ac_netloc_cppflags_save"
-          LIBS="$_x_ac_netloc_libs_save"
+  if [test "x$with_netloc" = xno]; then
+    AC_MSG_WARN([support for netloc disabled])
+  else
+    AC_CACHE_CHECK(
+      [for netloc installation],
+      [x_ac_cv_netloc_dir],
+      [
+        for d in $_x_ac_netloc_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/netloc.h" || continue
+          for bit in $_x_ac_netloc_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_netloc_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_netloc_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lnetloc $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM([#include <netloc.h>
+                                #include <netloc/map.h>],
+                                [netloc_map_t map;
+                                netloc_map_create(&map);]) ],
+              AS_VAR_SET(x_ac_cv_netloc_dir, $d))
+              AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM([#include <netloc.h>
+                                #include <netloc_map.h>],
+                                [netloc_map_t map;
+                                netloc_map_create(&map)]) ],
+              AS_VAR_SET(x_ac_cv_netloc_dir, $d)
+              x_ac_cv_netloc_nosub="yes"
+              )
+            CPPFLAGS="$_x_ac_netloc_cppflags_save"
+            LIBS="$_x_ac_netloc_libs_save"
+            test -n "$x_ac_cv_netloc_dir" && break
+          done
           test -n "$x_ac_cv_netloc_dir" && break
         done
-        test -n "$x_ac_cv_netloc_dir" && break
-      done
-    ])
+      ])
 
-  if test -z "$x_ac_cv_netloc_dir"; then
-    AC_MSG_WARN([unable to locate netloc installation])
-  else
-    NETLOC_CPPFLAGS="-I$x_ac_cv_netloc_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      NETLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_netloc_dir/$bit -L$x_ac_cv_netloc_dir/$bit"
+    if test -z "$x_ac_cv_netloc_dir"; then
+      AC_MSG_WARN([unable to locate netloc installation])
     else
-      NETLOC_LDFLAGS="-L$x_ac_cv_netloc_dir/$bit"
-    fi
-    NETLOC_LIBS="-lnetloc"
-    AC_DEFINE(HAVE_NETLOC, 1, [Define to 1 if netloc library found])
-    if test "$x_ac_cv_netloc_nosub" = "yes"; then
-      AC_DEFINE(HAVE_NETLOC_NOSUB, 1, [Define to 1 if netloc includes use underscore not subdirectory])
+      NETLOC_CPPFLAGS="-I$x_ac_cv_netloc_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        NETLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_netloc_dir/$bit -L$x_ac_cv_netloc_dir/$bit"
+      else
+        NETLOC_LDFLAGS="-L$x_ac_cv_netloc_dir/$bit"
+      fi
+      NETLOC_LIBS="-lnetloc"
+      AC_DEFINE(HAVE_NETLOC, 1, [Define to 1 if netloc library found])
+      if test "$x_ac_cv_netloc_nosub" = "yes"; then
+        AC_DEFINE(HAVE_NETLOC_NOSUB, 1, [Define to 1 if netloc includes use underscore not subdirectory])
+      fi
     fi
+
+    AC_SUBST(NETLOC_LIBS)
+    AC_SUBST(NETLOC_CPPFLAGS)
+    AC_SUBST(NETLOC_LDFLAGS)
   fi
 
   AM_CONDITIONAL(HAVE_NETLOC, test -n "$x_ac_cv_netloc_dir")
-  AC_SUBST(NETLOC_LIBS)
-  AC_SUBST(NETLOC_CPPFLAGS)
-  AC_SUBST(NETLOC_LDFLAGS)
 ])
diff --git a/auxdir/x_ac_ofed.m4 b/auxdir/x_ac_ofed.m4
index 9d53e66f5..655f049e4 100644
--- a/auxdir/x_ac_ofed.m4
+++ b/auxdir/x_ac_ofed.m4
@@ -9,65 +9,68 @@
 #    Determine if the OFED related libraries exist
 ##*****************************************************************************
 
-AC_DEFUN([X_AC_OFED],
-[
+AC_DEFUN([X_AC_OFED], [
+
   _x_ac_ofed_dirs="/usr /usr/local"
   _x_ac_ofed_libs="lib64 lib"
 
   AC_ARG_WITH(
     [ofed],
     AS_HELP_STRING(--with-ofed=PATH,Specify path to ofed installation),
-    [_x_ac_ofed_dirs="$withval $_x_ac_ofed_dirs"])
+    [AS_IF([test "x$with_ofed" != xno],[_x_ac_ofed_dirs="$with_ofed $_x_ac_ofed_dirs"])])
 
-  AC_CACHE_CHECK(
-    [for ofed installation],
-    [x_ac_cv_ofed_dir],
-    [
-      for d in $_x_ac_ofed_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include/infiniband" || continue
-        test -f "$d/include/infiniband/mad.h" || continue
-        for bit in $_x_ac_ofed_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_ofed_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
-          _x_ac_ofed_libs_save="$LIBS"
-          LIBS="-L$d/$bit -libmad -libumad $LIBS"
-	  AC_LINK_IFELSE(
-		  [AC_LANG_CALL([], mad_rpc_open_port)],
-		  AS_VAR_SET(x_ac_cv_ofed_dir, $d), [])
-	  AC_LINK_IFELSE(
-		  [AC_LANG_CALL([], pma_query_via)],
-		  [have_pma_query_via=yes],
-		  [AC_MSG_RESULT(Using old libmad)])
-          CPPFLAGS="$_x_ac_ofed_cppflags_save"
-          LIBS="$_x_ac_ofed_libs_save"
+  if [test "x$with_ofed" = xno]; then 
+     AC_MSG_WARN([support for ofed disabled])
+  else
+    AC_CACHE_CHECK(
+      [for ofed installation],
+      [x_ac_cv_ofed_dir],
+      [
+        for d in $_x_ac_ofed_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include/infiniband" || continue
+          test -f "$d/include/infiniband/mad.h" || continue
+          for bit in $_x_ac_ofed_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_ofed_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_ofed_libs_save="$LIBS"
+            LIBS="-L$d/$bit -libmad -libumad $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], mad_rpc_open_port)],
+              AS_VAR_SET(x_ac_cv_ofed_dir, $d), [])
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], pma_query_via)],
+              [have_pma_query_via=yes],
+              [AC_MSG_RESULT(Using old libmad)])
+            CPPFLAGS="$_x_ac_ofed_cppflags_save"
+            LIBS="$_x_ac_ofed_libs_save"
+            test -n "$x_ac_cv_ofed_dir" && break
+          done
           test -n "$x_ac_cv_ofed_dir" && break
         done
-        test -n "$x_ac_cv_ofed_dir" && break
-      done
     ])
 
-  if test -z "$x_ac_cv_ofed_dir"; then
-    AC_MSG_WARN([unable to locate ofed installation])
-  else
-    OFED_CPPFLAGS="-I$x_ac_cv_ofed_dir/include/infiniband"
-    if test "$ac_with_rpath" = "yes"; then
-      OFED_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_ofed_dir/$bit -L$x_ac_cv_ofed_dir/$bit"
+    if test -z "$x_ac_cv_ofed_dir"; then
+      AC_MSG_WARN([unable to locate ofed installation])
     else
-      OFED_LDFLAGS="-L$x_ac_cv_ofed_dir/$bit"
-    fi
-    OFED_LIBS="-libmad -libumad"
-    AC_DEFINE(HAVE_OFED, 1, [Define to 1 if ofed library found])
-    if test ! -z "$have_pma_query_via" ; then
-	    AC_DEFINE(HAVE_OFED_PMA_QUERY_VIA, 1, [Define to 1 if using code with pma_query_via])
+      OFED_CPPFLAGS="-I$x_ac_cv_ofed_dir/include/infiniband"
+      if test "$ac_with_rpath" = "yes"; then
+        OFED_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_ofed_dir/$bit -L$x_ac_cv_ofed_dir/$bit"
+      else
+        OFED_LDFLAGS="-L$x_ac_cv_ofed_dir/$bit"
+      fi
+      OFED_LIBS="-libmad -libumad"
+      AC_DEFINE(HAVE_OFED, 1, [Define to 1 if ofed library found])
+      if test ! -z "$have_pma_query_via" ; then
+        AC_DEFINE(HAVE_OFED_PMA_QUERY_VIA, 1, [Define to 1 if using code with pma_query_via])
+      fi
     fi
+    AC_SUBST(OFED_LIBS)
+    AC_SUBST(OFED_CPPFLAGS)
+    AC_SUBST(OFED_LDFLAGS)
   fi
 
-  AC_SUBST(OFED_LIBS)
-  AC_SUBST(OFED_CPPFLAGS)
-  AC_SUBST(OFED_LDFLAGS)
   AM_CONDITIONAL(BUILD_OFED, test -n "$x_ac_cv_ofed_dir")
-
 ])
 
diff --git a/auxdir/x_ac_pam.m4 b/auxdir/x_ac_pam.m4
index 872c99f61..e5012e910 100644
--- a/auxdir/x_ac_pam.m4
+++ b/auxdir/x_ac_pam.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette1@llnl.gov>
 #
diff --git a/auxdir/x_ac_pmix.m4 b/auxdir/x_ac_pmix.m4
new file mode 100644
index 000000000..8fbf873d6
--- /dev/null
+++ b/auxdir/x_ac_pmix.m4
@@ -0,0 +1,89 @@
+##*****************************************************************************
+#  AUTHOR:
+#    Artem Polyakov <artpol84@gmail.com>
+#
+#  SYNOPSIS:
+#    X_AC_PMIX
+#
+#  DESCRIPTION:
+#    Determine if the PMIx libraries exists. Derived from "x_ac_hwloc.m4".
+##*****************************************************************************
+
+AC_DEFUN([X_AC_PMIX],
+[
+  _x_ac_pmix_dirs="/usr /usr/local"
+  _x_ac_pmix_libs="lib64 lib"
+
+  AC_ARG_WITH(
+    [pmix],
+    AS_HELP_STRING(--with-pmix=PATH,Specify path to pmix installation),
+    [AS_IF([test "x$with_pmix" != xno],[_x_ac_pmix_dirs="$with_pmix $_x_ac_pmix_dirs"])])
+
+  if [test "x$with_pmix" = xno]; then
+    AC_MSG_WARN([support for pmix disabled])
+  else
+    AC_CACHE_CHECK(
+      [for pmix installation],
+      [x_ac_cv_pmix_dir],
+      [
+        for d in $_x_ac_pmix_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/pmix/pmix_common.h" || continue
+          test -f "$d/include/pmix_server.h" || continue
+          for d1 in $_x_ac_pmix_libs; do
+            test -d "$d/$d1" || continue
+            _x_ac_pmix_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_pmix_libs_save="$LIBS"
+            LIBS="-L$d/$d1 -lpmix $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], PMIx_Get_version)],
+              AS_VAR_SET(x_ac_cv_pmix_dir, $d))
+            CPPFLAGS="$_x_ac_pmix_cppflags_save"
+            LIBS="$_x_ac_pmix_libs_save"
+            test -n "$x_ac_cv_pmix_dir" && break
+          done
+          test -n "$x_ac_cv_pmix_dir" && break
+        done
+      ])
+
+    if test -z "$x_ac_cv_pmix_dir"; then
+      AC_MSG_WARN([unable to locate pmix installation])
+    else
+      AC_CACHE_CHECK(
+        [for pmix library directory],
+        [x_ac_cv_pmix_libdir],
+        [
+          for d1 in $_x_ac_pmix_libs; do
+            d="$x_ac_cv_pmix_dir/$d1"
+            test -d "$d" || continue
+            _x_ac_pmix_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$x_ac_cv_pmix_dir/include $CPPFLAGS"
+            _x_ac_pmix_libs_save="$LIBS"
+            LIBS="-L$d -lpmix $LIBS"
+            AC_LINK_IFELSE(
+              [AC_LANG_CALL([], PMIx_Get_version)],
+              AS_VAR_SET(x_ac_cv_pmix_libdir, $d))
+            CPPFLAGS="$_x_ac_pmix_cppflags_save"
+            LIBS="$_x_ac_pmix_libs_save"
+            test -n "$x_ac_cv_pmix_libdir" && break
+          done
+        ])
+      PMIX_CPPFLAGS="-I$x_ac_cv_pmix_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        PMIX_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_pmix_libdir -L$x_ac_cv_pmix_libdir"
+      else
+        PMIX_LDFLAGS="-L$x_ac_cv_pmix_libdir"
+      fi
+      PMIX_LIBS="-lpmix"
+      AC_DEFINE(HAVE_PMIX, 1, [Define to 1 if pmix library found])
+    fi
+
+    AC_SUBST(PMIX_LIBS)
+    AC_SUBST(PMIX_CPPFLAGS)
+    AC_SUBST(PMIX_LDFLAGS)
+  fi
+
+  AM_CONDITIONAL(HAVE_PMIX, test -n "$x_ac_cv_pmix_dir")
+])
diff --git a/auxdir/x_ac_ptrace.m4 b/auxdir/x_ac_ptrace.m4
index b2a3b74a9..8588a469f 100644
--- a/auxdir/x_ac_ptrace.m4
+++ b/auxdir/x_ac_ptrace.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette1@llnl.gov>
 #
diff --git a/auxdir/x_ac_readline.m4 b/auxdir/x_ac_readline.m4
index e6ce19f38..4f6bfb9ad 100644
--- a/auxdir/x_ac_readline.m4
+++ b/auxdir/x_ac_readline.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Jim Garlick <garlick@llnl.gov>
 #
diff --git a/auxdir/x_ac_rrdtool.m4 b/auxdir/x_ac_rrdtool.m4
index d88414b80..b889413d4 100644
--- a/auxdir/x_ac_rrdtool.m4
+++ b/auxdir/x_ac_rrdtool.m4
@@ -14,16 +14,15 @@ AC_DEFUN([X_AC_RRDTOOL],
   _x_ac_rrdtool_dirs="/usr /usr/local"
   _x_ac_rrdtool_libs="lib64 lib"
 
-  AC_ARG_WITH([rrdtool],
-    AS_HELP_STRING(--with-rrdtool=PATH,
-      Specify path to rrdtool-devel installation),
-    [_x_ac_rrdtool_dirs="$withval $_x_ac_rrdtool_dirs"],
-    [with_rrdtool=check])
+  AC_ARG_WITH(
+    [rrdtool],
+    AS_HELP_STRING(--with-rrdtool=PATH,Specify path to rrdtool-devel installation),
+    [AS_IF([test "x$with_rrdtool" != xno],[_x_ac_rrdtool_dirs="$with_rrdtool $_x_ac_rrdtool_dirs"])])
 
-#  echo with rrdtool $with_rrdtool
-#  echo without rrdtool $without_rrdtool
-  AS_IF([test "x$with_rrdtool" != "xno"],
-    [AC_CACHE_CHECK(
+  if [test "x$with_rrdtool" = xno]; then
+    AC_MSG_WARN([support for rrdtool disabled])
+  else
+    AC_CACHE_CHECK(
       [for rrdtool installation],
       [x_ac_cv_rrdtool_dir],
       [
@@ -48,23 +47,24 @@ AC_DEFUN([X_AC_RRDTOOL],
           test -n "$x_ac_cv_rrdtool_dir" && break
         done
       ])
-  ])
 
-#  echo x_ac_cv_rrdtool_dir $x_ac_cv_rrdtool_dir
-  if test -z "$x_ac_cv_rrdtool_dir"; then
-    AC_MSG_WARN([unable to locate rrdtool installation])
-  else
-    RRDTOOL_CPPFLAGS="-I$x_ac_cv_rrdtool_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      RRDTOOL_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_rrdtool_dir/$bit -L$x_ac_cv_rrdtool_dir/$bit"
+    # echo x_ac_cv_rrdtool_dir $x_ac_cv_rrdtool_dir
+    if test -z "$x_ac_cv_rrdtool_dir"; then
+      AC_MSG_WARN([unable to locate rrdtool installation])
     else
-      RRDTOOL_LDFLAGS="-L$x_ac_cv_rrdtool_dir/$bit"
+      RRDTOOL_CPPFLAGS="-I$x_ac_cv_rrdtool_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        RRDTOOL_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_rrdtool_dir/$bit -L$x_ac_cv_rrdtool_dir/$bit"
+      else
+        RRDTOOL_LDFLAGS="-L$x_ac_cv_rrdtool_dir/$bit"
+      fi
+      RRDTOOL_LIBS="-lrrd"
     fi
-    RRDTOOL_LIBS="-lrrd"
+
+    AC_SUBST(RRDTOOL_LIBS)
+    AC_SUBST(RRDTOOL_CPPFLAGS)
+    AC_SUBST(RRDTOOL_LDFLAGS)
   fi
 
-  AC_SUBST(RRDTOOL_LIBS)
-  AC_SUBST(RRDTOOL_CPPFLAGS)
-  AC_SUBST(RRDTOOL_LDFLAGS)
   AM_CONDITIONAL(BUILD_RRD, test -n "$x_ac_cv_rrdtool_dir")
 ])
diff --git a/auxdir/x_ac_setpgrp.m4 b/auxdir/x_ac_setpgrp.m4
index bfe6c6441..dff74553c 100644
--- a/auxdir/x_ac_setpgrp.m4
+++ b/auxdir/x_ac_setpgrp.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id: x_ac_setpgrp.m4 8192 2006-05-25 00:15:05Z morrone $
-##*****************************************************************************
 #  AUTHOR:
 #    Morris Jette <jette1@llnl.gov>
 #
diff --git a/auxdir/x_ac_setproctitle.m4 b/auxdir/x_ac_setproctitle.m4
index 7b6f6e620..f4c9e1729 100644
--- a/auxdir/x_ac_setproctitle.m4
+++ b/auxdir/x_ac_setproctitle.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-#  $Id$
-##*****************************************************************************
 #  AUTHOR:
 #    Mark Grondona <mgrondona@llnl.gov>
 #
diff --git a/auxdir/x_ac_sgi_job.m4 b/auxdir/x_ac_sgi_job.m4
index 6eb29bb20..5b40886dd 100644
--- a/auxdir/x_ac_sgi_job.m4
+++ b/auxdir/x_ac_sgi_job.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id: x_ac_aix.m4 8192 2006-05-25 00:15:05Z morrone $
-##*****************************************************************************
 #  AUTHOR:
 #    Mark Grondona <mgrondona@llnl.gov>
 #
diff --git a/auxdir/x_ac_slurm_ssl.m4 b/auxdir/x_ac_slurm_ssl.m4
index cadc35d01..f39db124b 100644
--- a/auxdir/x_ac_slurm_ssl.m4
+++ b/auxdir/x_ac_slurm_ssl.m4
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id$
-##*****************************************************************************
 #  AUTHOR:
 #     Mark Grondona <mgrondona@llnl.gov>
 #     (Mostly taken from OpenSSH configure.ac)
diff --git a/auxdir/x_ac_sun_const.m4 b/auxdir/x_ac_sun_const.m4
deleted file mode 100644
index 747fca173..000000000
--- a/auxdir/x_ac_sun_const.m4
+++ /dev/null
@@ -1,36 +0,0 @@
-##*****************************************************************************
-#  AUTHOR:
-#    Morris Jette <jette1@llnl.gov>
-#
-#  SYNOPSIS:
-#    X_AC_SUN_CONST
-#
-#  DESCRIPTION:
-#    Test for Sun Constellation system with 3-D interconnect
-##*****************************************************************************
-
-AC_DEFUN([X_AC_SUN_CONST], [
-  AC_MSG_CHECKING([for Sun Constellation system])
-  AC_ARG_ENABLE(
-    [sun-const],
-    AS_HELP_STRING(--enable-sun-const,enable Sun Constellation system support),
-    [ case "$enableval" in
-        yes) x_ac_sun_const=yes ;;
-         no) x_ac_sun_const=no ;;
-          *) AC_MSG_RESULT([doh!])
-             AC_MSG_ERROR([bad value "$enableval" for --enable-sun-const]) ;;
-      esac
-    ],
-    [x_ac_sun_const=no]
-  )
-
-  if test "$x_ac_sun_const" = yes; then
-    AC_MSG_RESULT([yes])
-    AC_DEFINE(SYSTEM_DIMENSIONS, 4, 
-	      [4-dimensional architecture counting the nodes under a switch as additional dimension])
-    AC_DEFINE(HAVE_SUN_CONST,1,[define if Sun Constellation system])
-  else
-    AC_MSG_RESULT([no])
-  fi
-])
-
diff --git a/config.h.in b/config.h.in
index ff54412d0..edabe6eba 100644
--- a/config.h.in
+++ b/config.h.in
@@ -181,6 +181,9 @@
 /* Define to 1 if you have a functional curl library. */
 #undef HAVE_LIBCURL
 
+/* Define to 1 if you have `z' library (-lz) */
+#undef HAVE_LIBZ
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
@@ -193,6 +196,9 @@
 /* Compile with Lua 5.2 */
 #undef HAVE_LUA_5_2
 
+/* Define to 1 if you have 'lz4' library (-llz4) */
+#undef HAVE_LZ4
+
 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
    to 0 otherwise. */
 #undef HAVE_MALLOC
@@ -209,10 +215,6 @@
 /* Define to 1 if using MySQL libaries */
 #undef HAVE_MYSQL
 
-/* Define to 1 if we can't use the alter ignore when messing with a database
- * table */
-#undef NO_ALTER_IGNORE_MYSQL
-
 /* Define to 1 for running on a Cray in native mode without ALPS */
 #undef HAVE_NATIVE_CRAY
 
@@ -258,6 +260,9 @@
 /* define if you have permapi_h */
 #undef HAVE_PERMAPI_H
 
+/* Define to 1 if pmix library found */
+#undef HAVE_PMIX
+
 /* Define if you have Posix semaphores. */
 #undef HAVE_POSIX_SEMS
 
@@ -339,9 +344,6 @@
 /* Define to 1 if you have the `strsignal' function. */
 #undef HAVE_STRSIGNAL
 
-/* define if Sun Constellation system */
-#undef HAVE_SUN_CONST
-
 /* Define to 1 if you have the `sysctlbyname' function. */
 #undef HAVE_SYSCTLBYNAME
 
@@ -487,8 +489,7 @@
 /* Define to 1 for --get-user-env to load user environment without .login */
 #undef LOAD_ENV_NO_LOGIN
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
 #undef LT_OBJDIR
 
 /* Define to 1 for memory leak debugging. */
@@ -503,6 +504,10 @@
 /* Define to 1 if you are building a production release. */
 #undef NDEBUG
 
+/* Define to 1 if we can't use the alter ignore when messing with a database
+   table */
+#undef NO_ALTER_IGNORE_MYSQL
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
diff --git a/config.xml.in b/config.xml.in
deleted file mode 100644
index 71a4d27fc..000000000
--- a/config.xml.in
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE package SYSTEM "../package.dtd">
-<!--
-SLURM configuration file for use with OSCAR distribution
-http://oscar.openclusergroup.org/
-
-Copyright (C) 2005 The Regents of the University of California.
-Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
-$Id$
--->
-<oscar>
-  <name>SLURM: Simple Linux Utility for  Resource Management</name>
-
-  <version>
-    <major>@SLURM_MAJOR@</major>
-    <minor>@SLURM_MINOR@</minor>
-    <subversion>@SLURM_MICRO@</subversion>
-    <release>@RELEASE@</release>
-    <epoch>1</epoch>
-  </version>
-
-  <class>included</class>
-
-  <summary>SLURM: Simple Linux Utility for  Resource Management</summary>
-  <license>GNU General Public License</license>
-  <group>Applications/batch</group>
-  <packager>
-    <name>Morris Jette</name>
-    <email>jette@schedmd.com</email>
-  </packager>
-
-  <description>The Simple Linux Utility for Resource Management (SLURM) is an 
-  open source, fault-tolerant, and highly scalable cluster management and job 
-  scheduling system for large and small Linux clusters. SLURM requires no 
-  kernel modifications for its operation and is relatively self-contained. 
-  As a cluster resource manager, SLURM has three key functions. First, it 
-  allocates exclusive and/or non-exclusive access to resources (compute nodes) 
-  to users for some duration of time so they can perform work. Second, it 
-  provides a framework for starting, executing, and monitoring work (normally 
-  a parallel job) on the set of allocated nodes. Finally, it arbitrates 
-  conflicting requests for resources by managing a queue of pending work.
-  </description>
-
-  <url>http://slurm.schedmd.com</url>
-  <rpmlist>
-      <rpm>slurm</rpm>
-      <rpm>slurm-devel</rpm>
-      <rpm>slurm-auth-authd</rpm>
-      <rpm>slurm-auth-none</rpm>
-      <rpm>slurm-auth-munge</rpm>
-      <rpm>slurm-sched-wiki</rpm>
-      <rpm>slurm-switch-elan</rpm>
-  </rpmlist>
-
-<conflicts>
-  <name>torque</name>
-  <name>pbs</name>
-  <type>package</type>
-</conflicts>
-</oscar>
diff --git a/configure b/configure
index 337535066..b26eb0238 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for slurm 15.08.
+# Generated by GNU Autoconf 2.69 for slurm 16.05.
 #
 # Report bugs to <slurm-dev@schedmd.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='slurm'
 PACKAGE_TARNAME='slurm'
-PACKAGE_VERSION='15.08'
-PACKAGE_STRING='slurm 15.08'
+PACKAGE_VERSION='16.05'
+PACKAGE_STRING='slurm 16.05'
 PACKAGE_BUGREPORT='slurm-dev@schedmd.com'
 PACKAGE_URL='http://slurm.schedmd.com'
 
@@ -649,10 +649,6 @@ BLCR_CPPFLAGS
 BLCR_LIBS
 BLCR_HOME
 UTIL_LIBS
-WITH_AUTHD_FALSE
-WITH_AUTHD_TRUE
-AUTHD_CFLAGS
-AUTHD_LIBS
 WITH_MUNGE_FALSE
 WITH_MUNGE_TRUE
 MUNGE_DIR
@@ -674,11 +670,11 @@ HAVE_LUA_FALSE
 HAVE_LUA_TRUE
 lua_LIBS
 lua_CFLAGS
+HAVE_NETLOC_FALSE
+HAVE_NETLOC_TRUE
 NETLOC_LDFLAGS
 NETLOC_CPPFLAGS
 NETLOC_LIBS
-HAVE_NETLOC_FALSE
-HAVE_NETLOC_TRUE
 HAVE_SGI_JOB_FALSE
 HAVE_SGI_JOB_TRUE
 HAVE_NRT
@@ -749,9 +745,20 @@ BUILD_IPMI_TRUE
 FREEIPMI_LDFLAGS
 FREEIPMI_CPPFLAGS
 FREEIPMI_LIBS
+HAVE_PMIX_FALSE
+HAVE_PMIX_TRUE
+PMIX_LDFLAGS
+PMIX_CPPFLAGS
+PMIX_LIBS
 HWLOC_LDFLAGS
 HWLOC_CPPFLAGS
 HWLOC_LIBS
+LZ4_LIBS
+LZ4_LDFLAGS
+LZ4_CPPFLAGS
+ZLIB_LDFLAGS
+ZLIB_CPPFLAGS
+ZLIB_LIBS
 BUILD_HDF5_FALSE
 BUILD_HDF5_TRUE
 HDF5_FLIBS
@@ -801,6 +808,7 @@ PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
 CXXCPP
+LT_SYS_LIBRARY_PATH
 OTOOL64
 OTOOL
 LIPO
@@ -953,6 +961,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -991,6 +1000,7 @@ enable_shared
 enable_static
 with_pic
 enable_fast_install
+with_aix_soname
 with_gnu_ld
 with_sysroot
 enable_libtool_lock
@@ -1000,11 +1010,13 @@ with_pam_dir
 enable_iso8601
 enable_load_env_no_login
 with_json
-enable_sun_const
 with_dimensions
 with_ofed
 with_hdf5
+with_zlib
+with_lz4
 with_hwloc
+with_pmix
 with_freeipmi
 with_rrdtool
 enable_glibtest
@@ -1015,6 +1027,7 @@ enable_cray_emulation
 enable_native_cray
 enable_cray_network
 enable_really_no_cray
+with_cray_dir
 with_datawarp
 enable_developer
 enable_debug
@@ -1050,6 +1063,7 @@ CXX
 CXXFLAGS
 CCC
 CPP
+LT_SYS_LIBRARY_PATH
 CXXCPP
 PKG_CONFIG
 PKG_CONFIG_PATH
@@ -1096,6 +1110,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1348,6 +1363,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1485,7 +1509,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1598,7 +1622,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures slurm 15.08 to adapt to many kinds of systems.
+\`configure' configures slurm 16.05 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1638,6 +1662,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1669,7 +1694,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of slurm 15.08:";;
+     short | recursive ) echo "Configuration of slurm 16.05:";;
    esac
   cat <<\_ACEOF
 
@@ -1703,7 +1728,6 @@ Optional Features:
   --enable-load-env-no-login
                           enable --get-user-env option to load user
                           environment without .login
-  --enable-sun-const      enable Sun Constellation system support
   --disable-glibtest      do not try to compile and run a test GLIB program
   --disable-gtktest       do not try to compile and run a test GTK+ program
   --enable-alps-cray-emulation
@@ -1739,9 +1763,12 @@ Optional Packages:
   --with-proctrack=PATH   Specify path to proctrack sources
   --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                           both]
+  --with-aix-soname=aix|svr4|both
+                          shared library versioning (aka "SONAME") variant to
+                          provide on AIX, [default=aix].
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-sysroot=DIR Search for dependent libraries within DIR
-                        (or the compiler's sysroot if not specified).
+  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
+                          compiler's sysroot if not specified).
   --with-cpusetdir=PATH   specify path to cpuset directory default is
                           /dev/cpuset
   --with-pam_dir=PATH     Specify path to PAM module installation
@@ -1750,13 +1777,22 @@ Optional Packages:
                           system
   --with-ofed=PATH        Specify path to ofed installation
   --with-hdf5=yes/no/PATH location of h5cc or h5pcc for HDF5 configuration
+  --with-zlib=DIR         root directory path of zlib installation [defaults to
+                          /usr/local or /usr if not found in /usr/local]
+  --without-zlib          to disable zlib usage completely
+  --with-lz4=DIR     root directory path of lz4 installation [defaults to
+                      /usr/local or /usr if not found in /usr/local]
+   --without-lz4      to disable lz4 usage completely
   --with-hwloc=PATH       Specify path to hwloc installation
+  --with-pmix=PATH        Specify path to pmix installation
   --with-freeipmi=PATH    Specify path to freeipmi installation
   --with-rrdtool=PATH     Specify path to rrdtool-devel installation
   --with-mysql_config=PATH
                           Specify path to mysql_config binary
   --with-alps-emulation   Run SLURM against an emulated ALPS system - requires
                           option cray.conf [default=no]
+  --with-cray_dir=PATH    Specify path to Cray file installation - /opt/cray
+                          by default
   --with-datawarp=PATH    Specify path to DataWarp installation
   --with-slurmctld-port=N set slurmctld default port [6817]
   --with-slurmd-port=N    set slurmd default port [6818]
@@ -1784,6 +1820,8 @@ Some influential environment variables:
   CXX         C++ compiler command
   CXXFLAGS    C++ compiler flags
   CPP         C preprocessor
+  LT_SYS_LIBRARY_PATH
+              User-defined run-time library search path.
   CXXCPP      C++ preprocessor
   PKG_CONFIG  path to pkg-config utility
   PKG_CONFIG_PATH
@@ -1863,7 +1901,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-slurm configure 15.08
+slurm configure 16.05
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2399,7 +2437,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by slurm $as_me 15.08, which was
+It was created by slurm $as_me 16.05, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3525,7 +3563,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='slurm'
- VERSION='15.08'
+ VERSION='16.05'
 
 
 # Some tools Automake needs.
@@ -7582,8 +7620,8 @@ esac
 
 
 
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.6'
+macro_revision='2.4.6'
 
 
 
@@ -7597,7 +7635,7 @@ macro_revision='1.3337'
 
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 # Backslashify metacharacters that are still active within
 # double-quoted strings.
@@ -7646,7 +7684,7 @@ func_echo_all ()
     $ECHO ""
 }
 
-case "$ECHO" in
+case $ECHO in
   printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
 $as_echo "printf" >&6; } ;;
   print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -7839,19 +7877,19 @@ test -z "$GREP" && GREP=grep
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -7865,7 +7903,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -7876,7 +7914,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -7887,32 +7925,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -7955,33 +7993,38 @@ if ${lt_cv_path_NM+:} false; then :
 else
   if test -n "$NM"; then
   # Let the user override the test.
-  lt_cv_path_NM="$NM"
+  lt_cv_path_NM=$NM
 else
-  lt_nm_to_check="${ac_tool_prefix}nm"
+  lt_nm_to_check=${ac_tool_prefix}nm
   if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
     lt_nm_to_check="$lt_nm_to_check nm"
   fi
   for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
     for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      tmp_nm=$ac_dir/$lt_tmp_nm
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
 	# Check to see if the nm accepts a BSD-compat flag.
-	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
 	#   nm: unknown option "B" ignored
 	# Tru64's nm complains that /dev/null is an invalid object file
-	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-	*/dev/null* | *'Invalid file or object type'*)
+	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+	case $build_os in
+	mingw*) lt_bad_file=conftest.nm/nofile ;;
+	*) lt_bad_file=/dev/null ;;
+	esac
+	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+	*$lt_bad_file* | *'Invalid file or object type'*)
 	  lt_cv_path_NM="$tmp_nm -B"
-	  break
+	  break 2
 	  ;;
 	*)
 	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
 	  */dev/null*)
 	    lt_cv_path_NM="$tmp_nm -p"
-	    break
+	    break 2
 	    ;;
 	  *)
 	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -7992,15 +8035,15 @@ else
 	esac
       fi
     done
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
   done
   : ${lt_cv_path_NM=no}
 fi
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
 $as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+  NM=$lt_cv_path_NM
 else
   # Didn't find any BSD compatible name lister, look for dumpbin.
   if test -n "$DUMPBIN"; then :
@@ -8106,9 +8149,9 @@ esac
   fi
 fi
 
-    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
     *COFF*)
-      DUMPBIN="$DUMPBIN -symbols"
+      DUMPBIN="$DUMPBIN -symbols -headers"
       ;;
     *)
       DUMPBIN=:
@@ -8116,8 +8159,8 @@ fi
     esac
   fi
 
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
+  if test : != "$DUMPBIN"; then
+    NM=$DUMPBIN
   fi
 fi
 test -z "$NM" && NM=nm
@@ -8168,7 +8211,7 @@ if ${lt_cv_sys_max_cmd_len+:} false; then :
   $as_echo_n "(cached) " >&6
 else
     i=0
-  teststring="ABCD"
+  teststring=ABCD
 
   case $build_os in
   msdosdjgpp*)
@@ -8208,7 +8251,7 @@ else
     lt_cv_sys_max_cmd_len=8192;
     ;;
 
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
     # This has been around since 386BSD, at least.  Likely further.
     if test -x /sbin/sysctl; then
       lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -8259,22 +8302,22 @@ else
   *)
     lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
     if test -n "$lt_cv_sys_max_cmd_len" && \
-	test undefined != "$lt_cv_sys_max_cmd_len"; then
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
       lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
       # Make teststring a little bigger before we do anything with it.
       # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
+      for i in 1 2 3 4 5 6 7 8; do
         teststring=$teststring$teststring
       done
       SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
       # If test is not a shell built-in, we'll probably end up computing a
       # maximum length that is only half of the actual maximum length, but
       # we can't tell.
-      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
 	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
-	      test $i != 17 # 1/2 MB should be enough
+	      test 17 != "$i" # 1/2 MB should be enough
       do
         i=`expr $i + 1`
         teststring=$teststring$teststring
@@ -8292,7 +8335,7 @@ else
 
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
 $as_echo "$lt_cv_sys_max_cmd_len" >&6; }
 else
@@ -8310,30 +8353,6 @@ max_cmd_len=$lt_cv_sys_max_cmd_len
 : ${MV="mv -f"}
 : ${RM="rm -f"}
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,b/c, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
   lt_unset=unset
 else
@@ -8456,13 +8475,13 @@ esac
 reload_cmds='$LD$reload_flag -o $output$reload_objs'
 case $host_os in
   cygwin* | mingw* | pw32* | cegcc*)
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       reload_cmds=false
     fi
     ;;
   darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    if test yes = "$GCC"; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
     else
       reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
@@ -8590,13 +8609,13 @@ lt_cv_deplibs_check_method='unknown'
 # Need to set the preceding variable on all platforms that support
 # interlibrary dependencies.
 # 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
 # 'pass_all' -- all dependencies passed with no checks.
 # 'test_compile' -- check by making test program.
 # 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
 
 case $host_os in
 aix[4-9]*)
@@ -8623,8 +8642,7 @@ mingw* | pw32*)
   # Base MSYS/MinGW do not provide the 'file' command needed by
   # func_win32_libid shell function, so use a weaker test based on 'objdump',
   # unless we find 'file', for example because we are cross-compiling.
-  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
-  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+  if ( file / ) >/dev/null 2>&1; then
     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
     lt_cv_file_magic_cmd='func_win32_libid'
   else
@@ -8720,8 +8738,8 @@ newos6*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-openbsd*)
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
   else
     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -8774,6 +8792,9 @@ sysv4 | sysv4.3*)
 tpf*)
   lt_cv_deplibs_check_method=pass_all
   ;;
+os2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 esac
 
 fi
@@ -8931,8 +8952,8 @@ else
 
 case $host_os in
 cygwin* | mingw* | pw32* | cegcc*)
-  # two different shell functions defined in ltmain.sh
-  # decide which to use based on capabilities of $DLLTOOL
+  # two different shell functions defined in ltmain.sh;
+  # decide which one to use based on capabilities of $DLLTOOL
   case `$DLLTOOL --help 2>&1` in
   *--identify-strict*)
     lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -8944,7 +8965,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   ;;
 *)
   # fallback: assume linklib IS sharedlib
-  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  lt_cv_sharedlib_from_linklib_cmd=$ECHO
   ;;
 esac
 
@@ -9098,7 +9119,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
+      if test 0 -eq "$ac_status"; then
 	# Ensure the archiver fails upon bogus file names.
 	rm -f conftest.$ac_objext libconftest.a
 	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -9106,7 +9127,7 @@ if ac_fn_c_try_compile "$LINENO"; then :
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
-	if test "$ac_status" -ne 0; then
+	if test 0 -ne "$ac_status"; then
           lt_cv_ar_at_file=@
         fi
       fi
@@ -9119,7 +9140,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
 $as_echo "$lt_cv_ar_at_file" >&6; }
 
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
   archiver_list_spec=
 else
   archiver_list_spec=$lt_cv_ar_at_file
@@ -9336,7 +9357,7 @@ old_postuninstall_cmds=
 
 if test -n "$RANLIB"; then
   case $host_os in
-  openbsd*)
+  bitrig* | openbsd*)
     old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
     ;;
   *)
@@ -9426,7 +9447,7 @@ cygwin* | mingw* | pw32* | cegcc*)
   symcode='[ABCDGISTW]'
   ;;
 hpux*)
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     symcode='[ABCDEGRST]'
   fi
   ;;
@@ -9459,14 +9480,44 @@ case `$NM -V 2>&1` in
   symcode='[ABCDGIRSTW]' ;;
 esac
 
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  # Gets list of data symbols to import.
+  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+  # Adjust the below global symbol transforms to fixup imported variables.
+  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
+  lt_c_name_lib_hook="\
+  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
+  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
+else
+  # Disable hooks by default.
+  lt_cv_sys_global_symbol_to_import=
+  lt_cdecl_hook=
+  lt_c_name_hook=
+  lt_c_name_lib_hook=
+fi
+
 # Transform an extracted symbol line into a proper C declaration.
 # Some systems (esp. on ia64) link data and code symbols differently,
 # so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
 
 # Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
+
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
 
 # Handle CRLF in mingw tool chain
 opt_cr=
@@ -9484,21 +9535,24 @@ for ac_symprfx in "" "_"; do
 
   # Write the raw and C identifiers.
   if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
+    # Fake it for dumpbin and say T for any non-static function,
+    # D for any global variable and I for any imported variable.
     # Also find C++ and __fastcall symbols from MSVC++,
     # which start with @ or ?.
     lt_cv_sys_global_symbol_pipe="$AWK '"\
 "     {last_section=section; section=\$ 3};"\
 "     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
 "     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
 "     \$ 0!~/External *\|/{next};"\
 "     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
 "     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
 "     ' prfx=^$ac_symprfx"
   else
     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -9546,11 +9600,11 @@ _LT_EOF
 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
 	  cat <<_LT_EOF > conftest.$ac_ext
 /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
    relocations are performed -- see ld's documentation on pseudo-relocs.  */
 # define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
 /* This system does not cope well with relocations in const data.  */
 # define LT_DLSYM_CONST
 #else
@@ -9576,7 +9630,7 @@ lt__PROGRAM__LTX_preloaded_symbols[] =
 {
   { "@PROGRAM@", (void *) 0 },
 _LT_EOF
-	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
 	  cat <<\_LT_EOF >> conftest.$ac_ext
   {0, (void *) 0}
 };
@@ -9596,13 +9650,13 @@ _LT_EOF
 	  mv conftest.$ac_objext conftstm.$ac_objext
 	  lt_globsym_save_LIBS=$LIBS
 	  lt_globsym_save_CFLAGS=$CFLAGS
-	  LIBS="conftstm.$ac_objext"
+	  LIBS=conftstm.$ac_objext
 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
 	    pipe_works=yes
 	  fi
 	  LIBS=$lt_globsym_save_LIBS
@@ -9623,7 +9677,7 @@ _LT_EOF
   rm -rf conftest* conftst*
 
   # Do not use the global_symbol_pipe unless it works.
-  if test "$pipe_works" = yes; then
+  if test yes = "$pipe_works"; then
     break
   else
     lt_cv_sys_global_symbol_pipe=
@@ -9665,6 +9719,16 @@ fi
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -9688,9 +9752,9 @@ fi
 
 
 lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
  yes)
-   if test "$GCC" = yes; then
+   if test yes = "$GCC"; then
      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
    fi
    ;; #(
@@ -9700,8 +9764,8 @@ case ${with_sysroot} in #(
  no|'')
    ;; #(
  *)
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
    as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
    ;;
 esac
@@ -9713,18 +9777,99 @@ $as_echo "${lt_sysroot:-no}" >&6; }
 
 
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+  ac_path_lt_DD_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in dd; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+      $ac_path_lt_DD_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_lt_DD"; then
+    :
+  fi
+else
+  ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+  cmp -s conftest.i conftest.out \
+  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
 # Check whether --enable-libtool-lock was given.
 if test "${enable_libtool_lock+set}" = set; then :
   enableval=$enable_libtool_lock;
 fi
 
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
 
 # Some flags need to be propagated to the compiler or linker for good
 # libtool support.
 case $host in
 ia64-*-hpux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set mode
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -9733,24 +9878,25 @@ ia64-*-hpux*)
   test $ac_status = 0; }; then
     case `/usr/bin/file conftest.$ac_objext` in
       *ELF-32*)
-	HPUX_IA64_MODE="32"
+	HPUX_IA64_MODE=32
 	;;
       *ELF-64*)
-	HPUX_IA64_MODE="64"
+	HPUX_IA64_MODE=64
 	;;
     esac
   fi
   rm -rf conftest*
   ;;
 *-*-irix6*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo '#line '$LINENO' "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-    if test "$lt_cv_prog_gnu_ld" = yes; then
+    if test yes = "$lt_cv_prog_gnu_ld"; then
       case `/usr/bin/file conftest.$ac_objext` in
 	*32-bit*)
 	  LD="${LD-ld} -melf32bsmip"
@@ -9779,9 +9925,50 @@ ia64-*-hpux*)
   rm -rf conftest*
   ;;
 
+mips64*-*linux*)
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    emul=elf
+    case `/usr/bin/file conftest.$ac_objext` in
+      *32-bit*)
+	emul="${emul}32"
+	;;
+      *64-bit*)
+	emul="${emul}64"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *MSB*)
+	emul="${emul}btsmip"
+	;;
+      *LSB*)
+	emul="${emul}ltsmip"
+	;;
+    esac
+    case `/usr/bin/file conftest.$ac_objext` in
+      *N32*)
+	emul="${emul}n32"
+	;;
+    esac
+    LD="${LD-ld} -m $emul"
+  fi
+  rm -rf conftest*
+  ;;
+
 x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
 s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.  Note that the listed cases only cover the
+  # situations where additional linker options are needed (such as when
+  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+  # vice versa); the common cases where no linker options are needed do
+  # not appear in the list.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -9804,10 +9991,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 		;;
 	    esac
 	    ;;
-	  powerpc64le-*)
+	  powerpc64le-*linux*)
 	    LD="${LD-ld} -m elf32lppclinux"
 	    ;;
-	  powerpc64-*)
+	  powerpc64-*linux*)
 	    LD="${LD-ld} -m elf32ppclinux"
 	    ;;
 	  s390x-*linux*)
@@ -9826,10 +10013,10 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 	  x86_64-*linux*)
 	    LD="${LD-ld} -m elf_x86_64"
 	    ;;
-	  powerpcle-*)
+	  powerpcle-*linux*)
 	    LD="${LD-ld} -m elf64lppc"
 	    ;;
-	  powerpc-*)
+	  powerpc-*linux*)
 	    LD="${LD-ld} -m elf64ppc"
 	    ;;
 	  s390*-*linux*|s390*-*tpf*)
@@ -9847,7 +10034,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
 
 *-*-sco3.2v5*)
   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
+  SAVE_CFLAGS=$CFLAGS
   CFLAGS="$CFLAGS -belf"
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
 $as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -9887,13 +10074,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
 $as_echo "$lt_cv_cc_needs_belf" >&6; }
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+  if test yes != "$lt_cv_cc_needs_belf"; then
     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
+    CFLAGS=$SAVE_CFLAGS
   fi
   ;;
 *-*solaris*)
-  # Find out which ABI we are using.
+  # Find out what ABI is being produced by ac_compile, and set linker
+  # options accordingly.
   echo 'int i;' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -9905,7 +10093,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
       case $lt_cv_prog_gnu_ld in
       yes*)
         case $host in
-        i?86-*-solaris*)
+        i?86-*-solaris*|x86_64-*-solaris*)
           LD="${LD-ld} -m elf_x86_64"
           ;;
         sparc*-*-solaris*)
@@ -9914,7 +10102,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
         esac
         # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
         if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
-          LD="${LD-ld}_sol2"
+          LD=${LD-ld}_sol2
         fi
         ;;
       *)
@@ -9930,7 +10118,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
   ;;
 esac
 
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
 
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -10041,7 +10229,7 @@ else
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
 $as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
   MANIFEST_TOOL=:
 fi
 
@@ -10544,7 +10732,7 @@ if ${lt_cv_apple_cc_single_mod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_apple_cc_single_mod=no
-      if test -z "${LT_MULTI_MODULE}"; then
+      if test -z "$LT_MULTI_MODULE"; then
 	# By default we will add the -single_module flag. You can override
 	# by either setting the environment variable LT_MULTI_MODULE
 	# non-empty at configure time, or by adding -multi_module to the
@@ -10562,7 +10750,7 @@ else
 	  cat conftest.err >&5
 	# Otherwise, if the output was created with a 0 exit code from
 	# the compiler, it worked.
-	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
 	  lt_cv_apple_cc_single_mod=yes
 	else
 	  cat conftest.err >&5
@@ -10601,7 +10789,7 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	LDFLAGS="$save_LDFLAGS"
+	LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -10630,7 +10818,7 @@ _LT_EOF
       _lt_result=$?
       if test -s conftest.err && $GREP force_load conftest.err; then
 	cat conftest.err >&5
-      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
 	lt_cv_ld_force_load=yes
       else
 	cat conftest.err >&5
@@ -10643,32 +10831,32 @@ fi
 $as_echo "$lt_cv_ld_force_load" >&6; }
     case $host_os in
     rhapsody* | darwin1.[012])
-      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
     darwin1.*)
-      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
     darwin*) # darwin 5.x on
       # if running on 10.5 or later, the deployment target defaults
       # to the OS version, if on x86, and 10.4, the deployment
       # target defaults to 10.4. Don't you love it?
       case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
 	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
-	10.[012]*)
-	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+	10.[012][,.]*)
+	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
 	10.*)
-	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
       esac
     ;;
   esac
-    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+    if test yes = "$lt_cv_apple_cc_single_mod"; then
       _lt_dar_single_mod='$single_module'
     fi
-    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
-      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    if test yes = "$lt_cv_ld_exported_symbols_list"; then
+      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
     else
-      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
     fi
-    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
       _lt_dsymutil='~$DSYMUTIL $lib || :'
     else
       _lt_dsymutil=
@@ -10676,6 +10864,41 @@ $as_echo "$lt_cv_ld_force_load" >&6; }
     ;;
   esac
 
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
 for ac_header in dlfcn.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
@@ -10693,9 +10916,9 @@ done
 
 func_stripname_cnf ()
 {
-  case ${2} in
-  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
-  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  case $2 in
+  .*) func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%\\\\$2\$%%"`;;
+  *)  func_stripname_result=`$ECHO "$3" | $SED "s%^$1%%; s%$2\$%%"`;;
   esac
 } # func_stripname_cnf
 
@@ -10722,14 +10945,14 @@ if test "${enable_shared+set}" = set; then :
     *)
       enable_shared=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_shared=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10753,14 +10976,14 @@ if test "${enable_static+set}" = set; then :
     *)
      enable_static=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_static=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10784,14 +11007,14 @@ if test "${with_pic+set}" = set; then :
     *)
       pic_mode=default
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for lt_pkg in $withval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$lt_pkg" = "X$lt_p"; then
 	  pic_mode=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10799,8 +11022,6 @@ else
 fi
 
 
-test -z "$pic_mode" && pic_mode=default
-
 
 
 
@@ -10816,14 +11037,14 @@ if test "${enable_fast_install+set}" = set; then :
     *)
       enable_fast_install=no
       # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
       for pkg in $enableval; do
-	IFS="$lt_save_ifs"
+	IFS=$lt_save_ifs
 	if test "X$pkg" = "X$p"; then
 	  enable_fast_install=yes
 	fi
       done
-      IFS="$lt_save_ifs"
+      IFS=$lt_save_ifs
       ;;
     esac
 else
@@ -10837,11 +11058,63 @@ fi
 
 
 
+  shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+  withval=$with_aix_soname; case $withval in
+    aix|svr4|both)
+      ;;
+    *)
+      as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+      ;;
+    esac
+    lt_cv_with_aix_soname=$with_aix_soname
+else
+  if ${lt_cv_with_aix_soname+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_with_aix_soname=aix
+fi
+
+    with_aix_soname=$lt_cv_with_aix_soname
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+  if test aix != "$with_aix_soname"; then
+    # For the AIX way of multilib, we name the shared archive member
+    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+    # the AIX toolchain works better with OBJECT_MODE set (default 32).
+    if test 64 = "${OBJECT_MODE-32}"; then
+      shared_archive_member_spec=shr_64
+    else
+      shared_archive_member_spec=shr
+    fi
+  fi
+  ;;
+*)
+  with_aix_soname=aix
+  ;;
+esac
+
+
+
+
+
+
+
 
 
 
 # This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
 
 # Always use our own libtool.
 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -10890,7 +11163,7 @@ test -z "$LN_S" && LN_S="ln -s"
 
 
 
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
@@ -10929,7 +11202,7 @@ aix3*)
   # AIX sometimes has problems with the GCC collect2 program.  For some
   # reason, if we set the COLLECT_NAMES environment variable, the problems
   # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
+  if test set != "${COLLECT_NAMES+set}"; then
     COLLECT_NAMES=
     export COLLECT_NAMES
   fi
@@ -10940,14 +11213,14 @@ esac
 ofile=libtool
 can_build_shared=yes
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
 # which needs '.lib').
 libext=a
 
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
 
 # Set sane defaults for various variables
 test -z "$CC" && CC=cc
@@ -10956,15 +11229,8 @@ test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
 test -z "$LD" && LD=ld
 test -z "$ac_objext" && ac_objext=o
 
-for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
 # Only perform the check for file, if the check method requires it
@@ -10979,22 +11245,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/${ac_tool_prefix}file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+    if test -f "$ac_dir/${ac_tool_prefix}file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -11017,13 +11283,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -11045,22 +11311,22 @@ if ${lt_cv_path_MAGIC_CMD+:} false; then :
 else
   case $MAGIC_CMD in
 [\\/*] |  ?:[\\/]*)
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
   ;;
 *)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_MAGIC_CMD=$MAGIC_CMD
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
   for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/file; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+    if test -f "$ac_dir/file"; then
+      lt_cv_path_MAGIC_CMD=$ac_dir/"file"
       if test -n "$file_magic_test_file"; then
 	case $deplibs_check_method in
 	"file_magic "*)
 	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
 	    $EGREP "$file_magic_regex" > /dev/null; then
 	    :
@@ -11083,13 +11349,13 @@ _LT_EOF
       break
     fi
   done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  IFS=$lt_save_ifs
+  MAGIC_CMD=$lt_save_MAGIC_CMD
   ;;
 esac
 fi
 
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
 if test -n "$MAGIC_CMD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
 $as_echo "$MAGIC_CMD" >&6; }
@@ -11110,7 +11376,7 @@ esac
 
 # Use C for the default configuration in the libtool script
 
-lt_save_CC="$CC"
+lt_save_CC=$CC
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -11172,7 +11438,7 @@ if test -n "$compiler"; then
 
 lt_prog_compiler_no_builtin_flag=
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $cc_basename in
   nvcc*)
     lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -11188,7 +11454,7 @@ else
   lt_cv_prog_compiler_rtti_exceptions=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   lt_compiler_flag="-fno-rtti -fno-exceptions"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -11218,7 +11484,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
 
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
     lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
 else
     :
@@ -11236,17 +11502,18 @@ lt_prog_compiler_pic=
 lt_prog_compiler_static=
 
 
-  if test "$GCC" = yes; then
+  if test yes = "$GCC"; then
     lt_prog_compiler_wl='-Wl,'
     lt_prog_compiler_static='-static'
 
     case $host_os in
       aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       fi
+      lt_prog_compiler_pic='-fPIC'
       ;;
 
     amigaos*)
@@ -11257,8 +11524,8 @@ lt_prog_compiler_static=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -11274,6 +11541,11 @@ lt_prog_compiler_static=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     darwin* | rhapsody*)
@@ -11344,7 +11616,7 @@ lt_prog_compiler_static=
     case $host_os in
     aix*)
       lt_prog_compiler_wl='-Wl,'
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static='-Bstatic'
       else
@@ -11352,10 +11624,29 @@ lt_prog_compiler_static=
       fi
       ;;
 
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      case $cc_basename in
+      nagfor*)
+        # NAG Fortran compiler
+        lt_prog_compiler_wl='-Wl,-Wl,,'
+        lt_prog_compiler_pic='-PIC'
+        lt_prog_compiler_static='-Bstatic'
+        ;;
+      esac
+      ;;
+
     mingw* | cygwin* | pw32* | os2* | cegcc*)
       # This hack is so that the source file can tell whether it is being
       # built for inclusion in a dll (and should export symbols for example).
       lt_prog_compiler_pic='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static='$wl-static'
+	;;
+      esac
       ;;
 
     hpux9* | hpux10* | hpux11*)
@@ -11371,7 +11662,7 @@ lt_prog_compiler_static=
 	;;
       esac
       # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      lt_prog_compiler_static='$wl-a ${wl}archive'
       ;;
 
     irix5* | irix6* | nonstopux*)
@@ -11382,7 +11673,7 @@ lt_prog_compiler_static=
 
     linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
       case $cc_basename in
-      # old Intel for x86_64 which still supported -KPIC.
+      # old Intel for x86_64, which still supported -KPIC.
       ecc*)
 	lt_prog_compiler_wl='-Wl,'
 	lt_prog_compiler_pic='-KPIC'
@@ -11407,6 +11698,12 @@ lt_prog_compiler_static=
 	lt_prog_compiler_pic='-PIC'
 	lt_prog_compiler_static='-Bstatic'
 	;;
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+	;;
       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
         # Portland Group compilers (*not* the Pentium gcc compiler,
 	# which looks to be a dead project)
@@ -11504,7 +11801,7 @@ lt_prog_compiler_static=
       ;;
 
     sysv4*MP*)
-      if test -d /usr/nec ;then
+      if test -d /usr/nec; then
 	lt_prog_compiler_pic='-Kconform_pic'
 	lt_prog_compiler_static='-Bstatic'
       fi
@@ -11533,7 +11830,7 @@ lt_prog_compiler_static=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic=
     ;;
@@ -11565,7 +11862,7 @@ else
   lt_cv_prog_compiler_pic_works=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -11595,7 +11892,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
     case $lt_prog_compiler_pic in
      "" | " "*) ;;
      *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -11627,7 +11924,7 @@ if ${lt_cv_prog_compiler_static_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -11646,13 +11943,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
 $as_echo "$lt_cv_prog_compiler_static_works" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
     :
 else
     lt_prog_compiler_static=
@@ -11772,8 +12069,8 @@ $as_echo "$lt_cv_prog_compiler_c_o" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -11785,9 +12082,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -11830,9 +12127,9 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # included in the symbol list
   include_expsyms=
   # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
+  # it will be wrapped by ' (' and ')$', so one must not match beginning or
+  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+  # as well as any symbol that contains 'd'.
   exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
   # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
   # platforms (ab)use it in PIC code, but their linkers get confused if
@@ -11847,7 +12144,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # FIXME: the MSVC++ port hasn't been tested in a loooong time
     # When not using gcc, we currently assume that we are using
     # Microsoft Visual C++.
-    if test "$GCC" != yes; then
+    if test yes != "$GCC"; then
       with_gnu_ld=no
     fi
     ;;
@@ -11855,7 +12152,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     # we just hope/assume this is gcc and not c89 (= MSVC++)
     with_gnu_ld=yes
     ;;
-  openbsd*)
+  openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
   linux* | k*bsd*-gnu | gnu*)
@@ -11868,7 +12165,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   # On some targets, GNU ld is compatible enough with the native linker
   # that we're better off using the native interface for both.
   lt_use_gnu_ld_interface=no
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     case $host_os in
       aix*)
 	# The AIX port of GNU ld has always aspired to compatibility
@@ -11890,24 +12187,24 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     esac
   fi
 
-  if test "$lt_use_gnu_ld_interface" = yes; then
+  if test yes = "$lt_use_gnu_ld_interface"; then
     # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+    wlarc='$wl'
 
     # Set some defaults for GNU ld with shared library support. These
     # are reset later if shared libraries are not supported. Putting them
     # here allows them to be overridden if necessary.
     runpath_var=LD_RUN_PATH
-    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-    export_dynamic_flag_spec='${wl}--export-dynamic'
+    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+    export_dynamic_flag_spec='$wl--export-dynamic'
     # ancient GNU ld didn't support --whole-archive et. al.
     if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
-      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
     else
       whole_archive_flag_spec=
     fi
     supports_anon_versioning=no
-    case `$LD -v 2>&1` in
+    case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
       *GNU\ gold*) supports_anon_versioning=yes ;;
       *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
       *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -11920,7 +12217,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
     case $host_os in
     aix[3-9]*)
       # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
+      if test ia64 != "$host_cpu"; then
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
@@ -11939,7 +12236,7 @@ _LT_EOF
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -11955,7 +12252,7 @@ _LT_EOF
 	allow_undefined_flag=unsupported
 	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	# support --undefined.  This deserves some investigation.  FIXME
-	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -11965,7 +12262,7 @@ _LT_EOF
       # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
       # as there is no search path for DLLs.
       hardcode_libdir_flag_spec='-L$libdir'
-      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      export_dynamic_flag_spec='$wl--export-all-symbols'
       allow_undefined_flag=unsupported
       always_export_symbols=no
       enable_shared_with_static_runtimes=yes
@@ -11973,61 +12270,89 @@ _LT_EOF
       exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
 
       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	# If the export-symbols file already is a .def file (1st line
-	# is EXPORTS), use it as is; otherwise, prepend...
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	  cp $export_symbols $output_objdir/$soname.def;
-	else
-	  echo EXPORTS > $output_objdir/$soname.def;
-	  cat $export_symbols >> $output_objdir/$soname.def;
-	fi~
-	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file, use it as
+	# is; otherwise, prepend EXPORTS...
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+          cp $export_symbols $output_objdir/$soname.def;
+        else
+          echo EXPORTS > $output_objdir/$soname.def;
+          cat $export_symbols >> $output_objdir/$soname.def;
+        fi~
+        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
       else
 	ld_shlibs=no
       fi
       ;;
 
     haiku*)
-      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
       link_all_deplibs=yes
       ;;
 
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
     interix[3-9]*)
       hardcode_direct=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-      export_dynamic_flag_spec='${wl}-E'
+      hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+      export_dynamic_flag_spec='$wl-E'
       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
       # Instead, shared libraries are loaded at an image base (0x10000000 by
       # default) and relocated if they conflict, which is a slow very memory
       # consuming and fragmenting process.  To avoid this, we pick a random,
       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
       ;;
 
     gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
       tmp_diet=no
-      if test "$host_os" = linux-dietlibc; then
+      if test linux-dietlibc = "$host_os"; then
 	case $cc_basename in
 	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
 	esac
       fi
       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
-	 && test "$tmp_diet" = no
+	 && test no = "$tmp_diet"
       then
 	tmp_addflag=' $pic_flag'
 	tmp_sharedflag='-shared'
 	case $cc_basename,$host_cpu in
         pgcc*)				# Portland Group C compiler
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag'
 	  ;;
 	pgf77* | pgf90* | pgf95* | pgfortran*)
 					# Portland Group f77 and f90 compilers
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  tmp_addflag=' $pic_flag -Mnomain' ;;
 	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
 	  tmp_addflag=' -i_dynamic' ;;
@@ -12038,42 +12363,47 @@ _LT_EOF
 	lf95*)				# Lahey Fortran 8.1
 	  whole_archive_flag_spec=
 	  tmp_sharedflag='--shared' ;;
+        nagfor*)                        # NAGFOR 5.3
+          tmp_sharedflag='-Wl,-shared' ;;
 	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
 	  tmp_sharedflag='-qmkshrobj'
 	  tmp_addflag= ;;
 	nvcc*)	# Cuda Compiler Driver 2.2
-	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  ;;
 	esac
 	case `$CC -V 2>&1 | sed 5q` in
 	*Sun\ C*)			# Sun C 5.9
-	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	  compiler_needs_object=yes
 	  tmp_sharedflag='-G' ;;
 	*Sun\ F*)			# Sun Fortran 8.3
 	  tmp_sharedflag='-G' ;;
 	esac
-	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 
-        if test "x$supports_anon_versioning" = xyes; then
+        if test yes = "$supports_anon_versioning"; then
           archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	    echo "local: *; };" >> $output_objdir/$libname.ver~
-	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+            echo "local: *; };" >> $output_objdir/$libname.ver~
+            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
         fi
 
 	case $cc_basename in
+	tcc*)
+	  export_dynamic_flag_spec='-rdynamic'
+	  ;;
 	xlf* | bgf* | bgxlf* | mpixlf*)
 	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
-	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	  hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
 	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
-	  if test "x$supports_anon_versioning" = xyes; then
+	  if test yes = "$supports_anon_versioning"; then
 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
-	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-	      echo "local: *; };" >> $output_objdir/$libname.ver~
-	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+              echo "local: *; };" >> $output_objdir/$libname.ver~
+              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
 	  fi
 	  ;;
 	esac
@@ -12087,8 +12417,8 @@ _LT_EOF
 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
 	wlarc=
       else
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       fi
       ;;
 
@@ -12106,8 +12436,8 @@ _LT_EOF
 
 _LT_EOF
       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
@@ -12119,7 +12449,7 @@ _LT_EOF
 	ld_shlibs=no
 	cat <<_LT_EOF 1>&2
 
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
 *** reliably create shared libraries on SCO systems.  Therefore, libtool
 *** is disabling shared libraries support.  We urge you to upgrade GNU
 *** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
@@ -12134,9 +12464,9 @@ _LT_EOF
 	  # DT_RUNPATH tag from executables and libraries.  But doing so
 	  # requires that you compile everything twice, which is a pain.
 	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
-	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	    hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	  else
 	    ld_shlibs=no
 	  fi
@@ -12153,15 +12483,15 @@ _LT_EOF
 
     *)
       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
       else
 	ld_shlibs=no
       fi
       ;;
     esac
 
-    if test "$ld_shlibs" = no; then
+    if test no = "$ld_shlibs"; then
       runpath_var=
       hardcode_libdir_flag_spec=
       export_dynamic_flag_spec=
@@ -12177,7 +12507,7 @@ _LT_EOF
       # Note: this linker hardcodes the directories in LIBPATH if there
       # are no directories specified by -L.
       hardcode_minus_L=yes
-      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
 	# Neither direct hardcoding nor static linking is supported with a
 	# broken collect2.
 	hardcode_direct=unsupported
@@ -12185,34 +12515,57 @@ _LT_EOF
       ;;
 
     aix[4-9]*)
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# On IA64, the linker does run time linking by default, so we don't
 	# have to do anything special.
 	aix_use_runtimelinking=no
 	exp_sym_flag='-Bexport'
-	no_entry_flag=""
+	no_entry_flag=
       else
 	# If we're using GNU nm, then we don't want the "-C" option.
-	# -C means demangle to AIX nm, but means don't demangle with GNU nm
-	# Also, AIX nm treats weak defined symbols like other global
-	# defined symbols, whereas GNU nm marks them as "W".
+	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
+	# Without the "-l" option, or with the "-B" option, AIX nm treats
+	# weak defined symbols like other global defined symbols, whereas
+	# GNU nm marks them as "W".
+	# While the 'weak' keyword is ignored in the Export File, we need
+	# it in the Import File for the 'aix-soname' feature, so we have
+	# to replace the "-B" option with "-P" for AIX nm.
 	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
 	else
-	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	  export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
 	fi
 	aix_use_runtimelinking=no
 
 	# Test if we are trying to use run time linking or normal
 	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
-	# need to do runtime linking.
+	# have runtime linking enabled, and use it for executables.
+	# For shared libraries, we enable/disable runtime linking
+	# depending on the kind of the shared library created -
+	# when "with_aix_soname,aix_use_runtimelinking" is:
+	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "aix,yes"  lib.so          shared, rtl:yes, for executables
+	#            lib.a           static archive
+	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
+	#            lib.a(lib.so.V) shared, rtl:no,  for executables
+	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a(lib.so.V) shared, rtl:no
+	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+	#            lib.a           static archive
 	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	  for ld_flag in $LDFLAGS; do
-	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
 	    aix_use_runtimelinking=yes
 	    break
 	  fi
 	  done
+	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	    # so we don't have lib.a shared libs to link our executables.
+	    # We have to force runtime linking in this case.
+	    aix_use_runtimelinking=yes
+	    LDFLAGS="$LDFLAGS -Wl,-brtl"
+	  fi
 	  ;;
 	esac
 
@@ -12231,13 +12584,21 @@ _LT_EOF
       hardcode_direct_absolute=yes
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      file_list_spec='${wl}-f,'
+      file_list_spec='$wl-f,'
+      case $with_aix_soname,$aix_use_runtimelinking in
+      aix,*) ;; # traditional, no import file
+      svr4,* | *,yes) # use import file
+	# The Import File defines what to hardcode.
+	hardcode_direct=no
+	hardcode_direct_absolute=no
+	;;
+      esac
 
-      if test "$GCC" = yes; then
+      if test yes = "$GCC"; then
 	case $host_os in aix4.[012]|aix4.[012].*)
 	# We only want to do this on AIX 4.2 and lower, the check
 	# below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -12256,36 +12617,42 @@ _LT_EOF
 	  ;;
 	esac
 	shared_flag='-shared'
-	if test "$aix_use_runtimelinking" = yes; then
-	  shared_flag="$shared_flag "'${wl}-G'
+	if test yes = "$aix_use_runtimelinking"; then
+	  shared_flag="$shared_flag "'$wl-G'
 	fi
-	link_all_deplibs=no
+	# Need to ensure runtime linking is disabled for the traditional
+	# shared library, or the linker may eventually find shared libraries
+	# /with/ Import File - we do not want to mix them.
+	shared_flag_aix='-shared'
+	shared_flag_svr4='-shared $wl-G'
       else
 	# not using gcc
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	# chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
 	else
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag='${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag='$wl-G'
 	  else
-	    shared_flag='${wl}-bM:SRE'
+	    shared_flag='$wl-bM:SRE'
 	  fi
+	  shared_flag_aix='$wl-bM:SRE'
+	  shared_flag_svr4='$wl-G'
 	fi
       fi
 
-      export_dynamic_flag_spec='${wl}-bexpall'
+      export_dynamic_flag_spec='$wl-bexpall'
       # It seems that -bexpall does not export symbols beginning with
       # underscore (_), so it is better to generate a list of symbols to export.
       always_export_symbols=yes
-      if test "$aix_use_runtimelinking" = yes; then
+      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
 	# Warning - without using the other runtime loading flags (-brtl),
 	# -berok will link without error, but may produce a broken library.
 	allow_undefined_flag='-berok'
         # Determine the default libpath from the value encoded in an
         # empty executable.
-        if test "${lt_cv_aix_libpath+set}" = set; then
+        if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -12320,7 +12687,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -12328,17 +12695,17 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
-        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
       else
-	if test "$host_cpu" = ia64; then
-	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	if test ia64 = "$host_cpu"; then
+	  hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
 	  allow_undefined_flag="-z nodefs"
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
 	else
 	 # Determine the default libpath from the value encoded in an
 	 # empty executable.
-	 if test "${lt_cv_aix_libpath+set}" = set; then
+	 if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath_+:} false; then :
@@ -12373,7 +12740,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath_"; then
-    lt_cv_aix_libpath_="/usr/lib:/lib"
+    lt_cv_aix_libpath_=/usr/lib:/lib
   fi
 
 fi
@@ -12381,21 +12748,33 @@ fi
   aix_libpath=$lt_cv_aix_libpath_
 fi
 
-	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	 hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
 	  # Warning - without using the other run time loading flags,
 	  # -berok will link without error, but may produce a broken library.
-	  no_undefined_flag=' ${wl}-bernotok'
-	  allow_undefined_flag=' ${wl}-berok'
-	  if test "$with_gnu_ld" = yes; then
+	  no_undefined_flag=' $wl-bernotok'
+	  allow_undefined_flag=' $wl-berok'
+	  if test yes = "$with_gnu_ld"; then
 	    # We only use this code for GNU lds that support --whole-archive.
-	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
 	  else
 	    # Exported symbols can be pulled into shared objects from archives
 	    whole_archive_flag_spec='$convenience'
 	  fi
 	  archive_cmds_need_lc=yes
-	  # This is similar to how AIX traditionally builds its shared libraries.
-	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	  archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	  # -brtl affects multiple linker settings, -berok does not and is overridden later
+	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	  if test svr4 != "$with_aix_soname"; then
+	    # This is similar to how AIX traditionally builds its shared libraries.
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	  fi
+	  if test aix != "$with_aix_soname"; then
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+	  else
+	    # used by -dlpreopen to get the symbols
+	    archive_expsym_cmds="$archive_expsym_cmds"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	  fi
+	  archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
 	fi
       fi
       ;;
@@ -12404,7 +12783,7 @@ fi
       case $host_cpu in
       powerpc)
             # see comment about AmigaOS4 .so support
-            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
             archive_expsym_cmds=''
         ;;
       m68k)
@@ -12434,16 +12813,17 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
-	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	  else
-	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	  fi~
-	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	  linknames='
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	archive_expsym_cmds='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+            cp "$export_symbols" "$output_objdir/$soname.def";
+            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+          else
+            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+          fi~
+          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+          linknames='
 	# The linker will not automatically build a static lib if we build a DLL.
 	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
 	enable_shared_with_static_runtimes=yes
@@ -12452,18 +12832,18 @@ fi
 	# Don't use ranlib
 	old_postinstall_cmds='chmod 644 $oldlib'
 	postlink_cmds='lt_outputfile="@OUTPUT@"~
-	  lt_tool_outputfile="@TOOL_OUTPUT@"~
-	  case $lt_outputfile in
-	    *.exe|*.EXE) ;;
-	    *)
-	      lt_outputfile="$lt_outputfile.exe"
-	      lt_tool_outputfile="$lt_tool_outputfile.exe"
-	      ;;
-	  esac~
-	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	    $RM "$lt_outputfile.manifest";
-	  fi'
+          lt_tool_outputfile="@TOOL_OUTPUT@"~
+          case $lt_outputfile in
+            *.exe|*.EXE) ;;
+            *)
+              lt_outputfile=$lt_outputfile.exe
+              lt_tool_outputfile=$lt_tool_outputfile.exe
+              ;;
+          esac~
+          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+            $RM "$lt_outputfile.manifest";
+          fi'
 	;;
       *)
 	# Assume MSVC wrapper
@@ -12472,7 +12852,7 @@ fi
 	# Tell ltmain to make .lib files, not .a files.
 	libext=lib
 	# Tell ltmain to make .dll files, not .so files.
-	shrext_cmds=".dll"
+	shrext_cmds=.dll
 	# FIXME: Setting linknames here is a bad hack.
 	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
 	# The linker will automatically build a .lib file if we build a DLL.
@@ -12491,24 +12871,24 @@ fi
   hardcode_direct=no
   hardcode_automatic=yes
   hardcode_shlibpath_var=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec=''
   fi
   link_all_deplibs=yes
-  allow_undefined_flag="$_lt_dar_allow_undefined"
+  allow_undefined_flag=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
 
   else
   ld_shlibs=no
@@ -12550,33 +12930,33 @@ fi
       ;;
 
     hpux9*)
-      if test "$GCC" = yes; then
-	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       else
-	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
       fi
-      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl+b $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_direct=yes
 
       # hardcode_minus_L: Not really in the search PATH,
       # but as the default location of the library.
       hardcode_minus_L=yes
-      export_dynamic_flag_spec='${wl}-E'
+      export_dynamic_flag_spec='$wl-E'
       ;;
 
     hpux10*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
-	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes,no = "$GCC,$with_gnu_ld"; then
+	archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 	hardcode_direct=yes
 	hardcode_direct_absolute=yes
-	export_dynamic_flag_spec='${wl}-E'
+	export_dynamic_flag_spec='$wl-E'
 	# hardcode_minus_L: Not really in the search PATH,
 	# but as the default location of the library.
 	hardcode_minus_L=yes
@@ -12584,25 +12964,25 @@ fi
       ;;
 
     hpux11*)
-      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+      if test yes,no = "$GCC,$with_gnu_ld"; then
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	esac
       else
 	case $host_cpu in
 	hppa*64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	ia64*)
-	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
 
@@ -12614,7 +12994,7 @@ if ${lt_cv_prog_compiler__b+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler__b=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS -b"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -12633,14 +13013,14 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
-if test x"$lt_cv_prog_compiler__b" = xyes; then
-    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
 else
     archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
 fi
@@ -12648,8 +13028,8 @@ fi
 	  ;;
 	esac
       fi
-      if test "$with_gnu_ld" = no; then
-	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      if test no = "$with_gnu_ld"; then
+	hardcode_libdir_flag_spec='$wl+b $wl$libdir'
 	hardcode_libdir_separator=:
 
 	case $host_cpu in
@@ -12660,7 +13040,7 @@ fi
 	*)
 	  hardcode_direct=yes
 	  hardcode_direct_absolute=yes
-	  export_dynamic_flag_spec='${wl}-E'
+	  export_dynamic_flag_spec='$wl-E'
 
 	  # hardcode_minus_L: Not really in the search PATH,
 	  # but as the default location of the library.
@@ -12671,8 +13051,8 @@ fi
       ;;
 
     irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	# Try to use the -exported_symbol ld option, if it does not
 	# work, assume that -exports_file does not work either and
 	# implicitly export all symbols.
@@ -12682,8 +13062,8 @@ $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >
 if ${lt_cv_irix_exported_symbol+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  save_LDFLAGS="$LDFLAGS"
-	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+  save_LDFLAGS=$LDFLAGS
+	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
 	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int foo (void) { return 0; }
@@ -12695,24 +13075,35 @@ else
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-           LDFLAGS="$save_LDFLAGS"
+           LDFLAGS=$save_LDFLAGS
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
 $as_echo "$lt_cv_irix_exported_symbol" >&6; }
-	if test "$lt_cv_irix_exported_symbol" = yes; then
-          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	if test yes = "$lt_cv_irix_exported_symbol"; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
 	fi
+	link_all_deplibs=no
       else
-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       inherit_rpath=yes
       link_all_deplibs=yes
       ;;
 
+    linux*)
+      case $cc_basename in
+      tcc*)
+	# Fabrice Bellard et al's Tiny C Compiler
+	ld_shlibs=yes
+	archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	;;
+      esac
+      ;;
+
     netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
 	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
@@ -12727,7 +13118,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     newsos6)
       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
       hardcode_direct=yes
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       hardcode_shlibpath_var=no
       ;;
@@ -12735,27 +13126,19 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
     *nto* | *qnx*)
       ;;
 
-    openbsd*)
+    openbsd* | bitrig*)
       if test -f /usr/libexec/ld.so; then
 	hardcode_direct=yes
 	hardcode_shlibpath_var=no
 	hardcode_direct_absolute=yes
-	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
 	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	  export_dynamic_flag_spec='${wl}-E'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+	  export_dynamic_flag_spec='$wl-E'
 	else
-	  case $host_os in
-	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
-	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-	     hardcode_libdir_flag_spec='-R$libdir'
-	     ;;
-	   *)
-	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
-	     ;;
-	  esac
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  hardcode_libdir_flag_spec='$wl-rpath,$libdir'
 	fi
       else
 	ld_shlibs=no
@@ -12766,33 +13149,53 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       hardcode_libdir_flag_spec='-L$libdir'
       hardcode_minus_L=yes
       allow_undefined_flag=unsupported
-      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      shrext_cmds=.dll
+      archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	$ECHO EXPORTS >> $output_objdir/$libname.def~
+	prefix_cmds="$SED"~
+	if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	  prefix_cmds="$prefix_cmds -e 1d";
+	fi~
+	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	emximp -o $lib $output_objdir/$libname.def'
+      old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+      enable_shared_with_static_runtimes=yes
       ;;
 
     osf3*)
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
       fi
       archive_cmds_need_lc='no'
-      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       hardcode_libdir_separator=:
       ;;
 
     osf4* | osf5*)	# as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      if test yes = "$GCC"; then
+	allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+	archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+	hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
       else
 	allow_undefined_flag=' -expect_unresolved \*'
-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
-	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+          $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
 
 	# Both c and cxx compiler support -rpath directly
 	hardcode_libdir_flag_spec='-rpath $libdir'
@@ -12803,24 +13206,24 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
     solaris*)
       no_undefined_flag=' -z defs'
-      if test "$GCC" = yes; then
-	wlarc='${wl}'
-	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	wlarc='$wl'
+	archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+          $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
       else
 	case `$CC -V 2>&1` in
 	*"Compilers 5.0"*)
 	  wlarc=''
-	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
 	  ;;
 	*)
-	  wlarc='${wl}'
-	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  wlarc='$wl'
+	  archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
 	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 	  ;;
 	esac
       fi
@@ -12830,11 +13233,11 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       solaris2.[0-5] | solaris2.[0-5].*) ;;
       *)
 	# The compiler driver will combine and reorder linker options,
-	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but understands '-z linker_flag'.  GCC discards it without '$wl',
 	# but is careful enough not to reorder.
 	# Supported since Solaris 2.6 (maybe 2.5.1?)
-	if test "$GCC" = yes; then
-	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	if test yes = "$GCC"; then
+	  whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 	else
 	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
 	fi
@@ -12844,10 +13247,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sunos4*)
-      if test "x$host_vendor" = xsequent; then
+      if test sequent = "$host_vendor"; then
 	# Use $CC to link under sequent, because it throws in some extra .o
 	# files that make .init and .fini sections work.
-	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
       else
 	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
       fi
@@ -12896,43 +13299,43 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag='${wl}-z,text'
+      no_undefined_flag='$wl-z,text'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
     sysv5* | sco3.2v5* | sco5v6*)
-      # Note: We can NOT use -z defs as we might desire, because we do not
+      # Note: We CANNOT use -z defs as we might desire, because we do not
       # link with -lc, and that would cause any symbols used from libc to
       # always be unresolved, which means just about no library would
       # ever link correctly.  If we're not using GNU ld we use -z text
       # though, which does catch some bad symbols but isn't as heavy-handed
       # as -z defs.
-      no_undefined_flag='${wl}-z,text'
-      allow_undefined_flag='${wl}-z,nodefs'
+      no_undefined_flag='$wl-z,text'
+      allow_undefined_flag='$wl-z,nodefs'
       archive_cmds_need_lc=no
       hardcode_shlibpath_var=no
-      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_flag_spec='$wl-R,$libdir'
       hardcode_libdir_separator=':'
       link_all_deplibs=yes
-      export_dynamic_flag_spec='${wl}-Bexport'
+      export_dynamic_flag_spec='$wl-Bexport'
       runpath_var='LD_RUN_PATH'
 
-      if test "$GCC" = yes; then
-	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      if test yes = "$GCC"; then
+	archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       else
-	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
       fi
       ;;
 
@@ -12947,10 +13350,10 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
       ;;
     esac
 
-    if test x$host_vendor = xsni; then
+    if test sni = "$host_vendor"; then
       case $host in
       sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	export_dynamic_flag_spec='$wl-Blargedynsym'
 	;;
       esac
     fi
@@ -12958,7 +13361,7 @@ $as_echo "$lt_cv_irix_exported_symbol" >&6; }
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
 $as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
 
 with_gnu_ld=$with_gnu_ld
 
@@ -12984,7 +13387,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -13199,14 +13602,14 @@ esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
 $as_echo_n "checking dynamic linker characteristics... " >&6; }
 
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   case $host_os in
-    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
-    *) lt_awk_arg="/^libraries:/" ;;
+    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+    *) lt_awk_arg='/^libraries:/' ;;
   esac
   case $host_os in
-    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
-    *) lt_sed_strip_eq="s,=/,/,g" ;;
+    mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+    *) lt_sed_strip_eq='s|=/|/|g' ;;
   esac
   lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
   case $lt_search_path_spec in
@@ -13222,28 +13625,35 @@ if test "$GCC" = yes; then
     ;;
   esac
   # Ok, now we have the path, separated by spaces, we can step through it
-  # and add multilib dir if necessary.
+  # and add multilib dir if necessary...
   lt_tmp_lt_search_path_spec=
-  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  # ...but if some path component already ends with the multilib dir we assume
+  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+  case "$lt_multi_os_dir; $lt_search_path_spec " in
+  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+    lt_multi_os_dir=
+    ;;
+  esac
   for lt_sys_path in $lt_search_path_spec; do
-    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
-      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
-    else
+    if test -d "$lt_sys_path$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+    elif test -n "$lt_multi_os_dir"; then
       test -d "$lt_sys_path" && \
 	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
     fi
   done
   lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
-  lt_foo="";
-  lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+  lt_foo = "";
+  lt_count = 0;
   for (lt_i = NF; lt_i > 0; lt_i--) {
     if ($lt_i != "" && $lt_i != ".") {
       if ($lt_i == "..") {
         lt_count++;
       } else {
         if (lt_count == 0) {
-          lt_foo="/" $lt_i lt_foo;
+          lt_foo = "/" $lt_i lt_foo;
         } else {
           lt_count--;
         }
@@ -13257,7 +13667,7 @@ BEGIN {RS=" "; FS="/|\n";} {
   # for these hosts.
   case $host_os in
     mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
-      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+      $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
   esac
   sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
 else
@@ -13266,7 +13676,7 @@ fi
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -13283,14 +13693,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -13298,41 +13710,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -13342,18 +13804,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -13361,8 +13823,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -13374,7 +13836,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -13383,8 +13845,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -13400,17 +13862,17 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -13419,8 +13881,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -13447,7 +13909,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -13460,8 +13922,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -13474,7 +13936,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -13487,8 +13949,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -13501,8 +13963,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -13520,12 +13982,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -13555,10 +14018,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -13576,14 +14039,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -13591,8 +14055,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -13601,8 +14065,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -13615,8 +14079,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -13627,7 +14091,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -13635,8 +14099,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -13655,8 +14119,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -13665,13 +14129,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -13715,7 +14199,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -13747,12 +14236,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -13762,7 +14251,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -13771,58 +14260,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -13833,8 +14332,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -13844,11 +14343,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -13856,8 +14355,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -13878,24 +14377,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -13913,7 +14412,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -13921,8 +14420,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -13932,22 +14431,29 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
 
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
 
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
 
 
 
@@ -14037,20 +14543,28 @@ fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
    test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
+   test yes = "$hardcode_automatic"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
+  if test no != "$hardcode_direct" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
   else
@@ -14065,12 +14579,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
 $as_echo "$hardcode_action" >&6; }
 
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+   test yes = "$inherit_rpath"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -14080,7 +14594,7 @@ fi
 
 
 
-  if test "x$enable_dlopen" != xyes; then
+  if test yes != "$enable_dlopen"; then
   enable_dlopen=unknown
   enable_dlopen_self=unknown
   enable_dlopen_self_static=unknown
@@ -14090,23 +14604,23 @@ else
 
   case $host_os in
   beos*)
-    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen=load_add_on
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
     ;;
 
   mingw* | pw32* | cegcc*)
-    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen=LoadLibrary
     lt_cv_dlopen_libs=
     ;;
 
   cygwin*)
-    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen=dlopen
     lt_cv_dlopen_libs=
     ;;
 
   darwin*)
-  # if libdl is installed we need to link against it
+    # if libdl is installed we need to link against it
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
 if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -14144,10 +14658,10 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
 
-    lt_cv_dlopen="dyld"
+    lt_cv_dlopen=dyld
     lt_cv_dlopen_libs=
     lt_cv_dlopen_self=yes
 
@@ -14155,10 +14669,18 @@ fi
 
     ;;
 
+  tpf*)
+    # Don't try to run any link tests for TPF.  We know it's impossible
+    # because TPF is a cross-compiler, and we know how we open DSOs.
+    lt_cv_dlopen=dlopen
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=no
+    ;;
+
   *)
     ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
 if test "x$ac_cv_func_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load"
+  lt_cv_dlopen=shl_load
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
 $as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -14197,11 +14719,11 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
 $as_echo "$ac_cv_lib_dld_shl_load" >&6; }
 if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
 else
   ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
 if test "x$ac_cv_func_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen"
+  lt_cv_dlopen=dlopen
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
 $as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -14240,7 +14762,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
 $as_echo "$ac_cv_lib_dl_dlopen" >&6; }
 if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
 $as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -14279,7 +14801,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
 $as_echo "$ac_cv_lib_svld_dlopen" >&6; }
 if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+  lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
 $as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -14318,7 +14840,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
 $as_echo "$ac_cv_lib_dld_dld_link" >&6; }
 if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+  lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
 fi
 
 
@@ -14339,21 +14861,21 @@ fi
     ;;
   esac
 
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
+  if test no = "$lt_cv_dlopen"; then
     enable_dlopen=no
+  else
+    enable_dlopen=yes
   fi
 
   case $lt_cv_dlopen in
   dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+    save_CPPFLAGS=$CPPFLAGS
+    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-    save_LDFLAGS="$LDFLAGS"
+    save_LDFLAGS=$LDFLAGS
     wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-    save_LIBS="$LIBS"
+    save_LIBS=$LIBS
     LIBS="$lt_cv_dlopen_libs $LIBS"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -14361,7 +14883,7 @@ $as_echo_n "checking whether a program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -14408,9 +14930,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -14440,7 +14962,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -14460,14 +14982,14 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
 $as_echo "$lt_cv_dlopen_self" >&6; }
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
+    if test yes = "$lt_cv_dlopen_self"; then
       wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
 if ${lt_cv_dlopen_self_static+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  	  if test "$cross_compiling" = yes; then :
+  	  if test yes = "$cross_compiling"; then :
   lt_cv_dlopen_self_static=cross
 else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -14514,9 +15036,9 @@ else
 #  endif
 #endif
 
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
    correspondingly for the symbols needed.  */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
 int fnord () __attribute__((visibility("default")));
 #endif
 
@@ -14546,7 +15068,7 @@ _LT_EOF
   (eval $ac_link) 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+  test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
     (./conftest; exit; ) >&5 2>/dev/null
     lt_status=$?
     case x$lt_status in
@@ -14567,9 +15089,9 @@ fi
 $as_echo "$lt_cv_dlopen_self_static" >&6; }
     fi
 
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
+    CPPFLAGS=$save_CPPFLAGS
+    LDFLAGS=$save_LDFLAGS
+    LIBS=$save_LIBS
     ;;
   esac
 
@@ -14613,7 +15135,7 @@ else
 # FIXME - insert some real tests, host_os isn't really good enough
   case $host_os in
   darwin*)
-    if test -n "$STRIP" ; then
+    if test -n "$STRIP"; then
       striplib="$STRIP -x"
       old_striplib="$STRIP -S"
       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -14641,7 +15163,7 @@ fi
 
 
 
-  # Report which library types will actually be built
+  # Report what library types will actually be built
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
 $as_echo_n "checking if libtool supports shared libraries... " >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -14649,13 +15171,13 @@ $as_echo "$can_build_shared" >&6; }
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
 $as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
+  test no = "$can_build_shared" && enable_shared=no
 
   # On AIX, shared libraries and static libraries use the same namespace, and
   # are all built from PIC.
   case $host_os in
   aix3*)
-    test "$enable_shared" = yes && enable_static=no
+    test yes = "$enable_shared" && enable_static=no
     if test -n "$RANLIB"; then
       archive_cmds="$archive_cmds~\$RANLIB \$lib"
       postinstall_cmds='$RANLIB $lib'
@@ -14663,8 +15185,12 @@ $as_echo_n "checking whether to build shared libraries... " >&6; }
     ;;
 
   aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
+    if test ia64 != "$host_cpu"; then
+      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+      yes,aix,yes) ;;			# shared object as lib.so file only
+      yes,svr4,*) ;;			# shared object as lib.so archive member only
+      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
+      esac
     fi
     ;;
   esac
@@ -14674,7 +15200,7 @@ $as_echo "$enable_shared" >&6; }
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
 $as_echo_n "checking whether to build static libraries... " >&6; }
   # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
+  test yes = "$enable_shared" || enable_static=yes
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
 $as_echo "$enable_static" >&6; }
 
@@ -14688,11 +15214,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-CC="$lt_save_CC"
+CC=$lt_save_CC
 
-      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
+      if test -n "$CXX" && ( test no != "$CXX" &&
+    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+    (test g++ != "$CXX"))); then
   ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -14871,7 +15397,7 @@ objext_CXX=$objext
 # the CXX compiler isn't working.  Some variables (like enable_shared)
 # are currently assumed to apply to all compilers on this platform,
 # and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
   # Code to be used in simple compile tests
   lt_simple_compile_test_code="int some_variable = 0;"
 
@@ -14932,46 +15458,39 @@ $RM -r conftest*
   CFLAGS=$CXXFLAGS
   compiler=$CC
   compiler_CXX=$CC
-  for cc_temp in $compiler""; do
-  case $cc_temp in
-    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
-    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+  func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
 
 
   if test -n "$compiler"; then
     # We don't want -fno-exception when compiling C++ code, so set the
     # no_builtin_flag separately
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
     else
       lt_prog_compiler_no_builtin_flag_CXX=
     fi
 
-    if test "$GXX" = yes; then
+    if test yes = "$GXX"; then
       # Set up default GNU C++ configuration
 
 
 
 # Check whether --with-gnu-ld was given.
 if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+  withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
 else
   with_gnu_ld=no
 fi
 
 ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   # Check if gcc -print-prog-name=ld gives a path.
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
 $as_echo_n "checking for ld used by $CC... " >&6; }
   case $host in
   *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
+    # gcc leaves a trailing carriage return, which upsets mingw
     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
   *)
     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -14985,7 +15504,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
       while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
 	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
       done
-      test -z "$LD" && LD="$ac_prog"
+      test -z "$LD" && LD=$ac_prog
       ;;
   "")
     # If it fails, then pretend we aren't using GCC.
@@ -14996,7 +15515,7 @@ $as_echo_n "checking for ld used by $CC... " >&6; }
     with_gnu_ld=unknown
     ;;
   esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
 $as_echo_n "checking for GNU ld... " >&6; }
 else
@@ -15007,32 +15526,32 @@ if ${lt_cv_path_LD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
   for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
+    IFS=$lt_save_ifs
     test -z "$ac_dir" && ac_dir=.
     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
+      lt_cv_path_LD=$ac_dir/$ac_prog
       # Check to see if the program is GNU ld.  I'd rather use --version,
       # but apparently some variants of GNU ld only accept -v.
       # Break only if it was the GNU/non-GNU ld that we prefer.
       case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
       *GNU* | *'with BFD'*)
-	test "$with_gnu_ld" != no && break
+	test no != "$with_gnu_ld" && break
 	;;
       *)
-	test "$with_gnu_ld" != yes && break
+	test yes != "$with_gnu_ld" && break
 	;;
       esac
     fi
   done
-  IFS="$lt_save_ifs"
+  IFS=$lt_save_ifs
 else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+  lt_cv_path_LD=$LD # Let the user override the test with a path.
 fi
 fi
 
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
 if test -n "$LD"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
 $as_echo "$LD" >&6; }
@@ -15068,22 +15587,22 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
 
       # Check if GNU C++ uses GNU ld as the underlying linker, since the
       # archiving commands below assume that GNU ld is being used.
-      if test "$with_gnu_ld" = yes; then
-        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      if test yes = "$with_gnu_ld"; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+        export_dynamic_flag_spec_CXX='$wl--export-dynamic'
 
         # If archive_cmds runs LD, not CC, wlarc should be empty
         # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
         #     investigate it a little bit more. (MM)
-        wlarc='${wl}'
+        wlarc='$wl'
 
         # ancient GNU ld didn't support --whole-archive et. al.
         if eval "`$CC -print-prog-name=ld` --help 2>&1" |
 	  $GREP 'no-whole-archive' > /dev/null; then
-          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+          whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
         else
           whole_archive_flag_spec_CXX=
         fi
@@ -15120,18 +15639,30 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
         ld_shlibs_CXX=no
         ;;
       aix[4-9]*)
-        if test "$host_cpu" = ia64; then
+        if test ia64 = "$host_cpu"; then
           # On IA64, the linker does run time linking by default, so we don't
           # have to do anything special.
           aix_use_runtimelinking=no
           exp_sym_flag='-Bexport'
-          no_entry_flag=""
+          no_entry_flag=
         else
           aix_use_runtimelinking=no
 
           # Test if we are trying to use run time linking or normal
           # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-          # need to do runtime linking.
+          # have runtime linking enabled, and use it for executables.
+          # For shared libraries, we enable/disable runtime linking
+          # depending on the kind of the shared library created -
+          # when "with_aix_soname,aix_use_runtimelinking" is:
+          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "aix,yes"  lib.so          shared, rtl:yes, for executables
+          #            lib.a           static archive
+          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
+          #            lib.a(lib.so.V) shared, rtl:no,  for executables
+          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a(lib.so.V) shared, rtl:no
+          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
+          #            lib.a           static archive
           case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
 	    for ld_flag in $LDFLAGS; do
 	      case $ld_flag in
@@ -15141,6 +15672,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	        ;;
 	      esac
 	    done
+	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
+	      # so we don't have lib.a shared libs to link our executables.
+	      # We have to force runtime linking in this case.
+	      aix_use_runtimelinking=yes
+	      LDFLAGS="$LDFLAGS -Wl,-brtl"
+	    fi
 	    ;;
           esac
 
@@ -15159,13 +15697,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
         hardcode_direct_absolute_CXX=yes
         hardcode_libdir_separator_CXX=':'
         link_all_deplibs_CXX=yes
-        file_list_spec_CXX='${wl}-f,'
+        file_list_spec_CXX='$wl-f,'
+        case $with_aix_soname,$aix_use_runtimelinking in
+        aix,*) ;;	# no import file
+        svr4,* | *,yes) # use import file
+          # The Import File defines what to hardcode.
+          hardcode_direct_CXX=no
+          hardcode_direct_absolute_CXX=no
+          ;;
+        esac
 
-        if test "$GXX" = yes; then
+        if test yes = "$GXX"; then
           case $host_os in aix4.[012]|aix4.[012].*)
           # We only want to do this on AIX 4.2 and lower, the check
           # below for broken collect2 doesn't work under 4.3+
-	  collect2name=`${CC} -print-prog-name=collect2`
+	  collect2name=`$CC -print-prog-name=collect2`
 	  if test -f "$collect2name" &&
 	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
 	  then
@@ -15183,36 +15729,44 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 	  fi
           esac
           shared_flag='-shared'
-	  if test "$aix_use_runtimelinking" = yes; then
-	    shared_flag="$shared_flag "'${wl}-G'
+	  if test yes = "$aix_use_runtimelinking"; then
+	    shared_flag=$shared_flag' $wl-G'
 	  fi
+	  # Need to ensure runtime linking is disabled for the traditional
+	  # shared library, or the linker may eventually find shared libraries
+	  # /with/ Import File - we do not want to mix them.
+	  shared_flag_aix='-shared'
+	  shared_flag_svr4='-shared $wl-G'
         else
           # not using gcc
-          if test "$host_cpu" = ia64; then
+          if test ia64 = "$host_cpu"; then
 	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
 	  # chokes on -Wl,-G. The following line is correct:
 	  shared_flag='-G'
           else
-	    if test "$aix_use_runtimelinking" = yes; then
-	      shared_flag='${wl}-G'
+	    if test yes = "$aix_use_runtimelinking"; then
+	      shared_flag='$wl-G'
 	    else
-	      shared_flag='${wl}-bM:SRE'
+	      shared_flag='$wl-bM:SRE'
 	    fi
+	    shared_flag_aix='$wl-bM:SRE'
+	    shared_flag_svr4='$wl-G'
           fi
         fi
 
-        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        export_dynamic_flag_spec_CXX='$wl-bexpall'
         # It seems that -bexpall does not export symbols beginning with
         # underscore (_), so it is better to generate a list of symbols to
 	# export.
         always_export_symbols_CXX=yes
-        if test "$aix_use_runtimelinking" = yes; then
+	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
           # Warning - without using the other runtime loading flags (-brtl),
           # -berok will link without error, but may produce a broken library.
-          allow_undefined_flag_CXX='-berok'
+          # The "-G" linker flag allows undefined symbols.
+          no_undefined_flag_CXX='-bernotok'
           # Determine the default libpath from the value encoded in an empty
           # executable.
-          if test "${lt_cv_aix_libpath+set}" = set; then
+          if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath__CXX+:} false; then :
@@ -15247,7 +15801,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
   fi
 
 fi
@@ -15255,18 +15809,18 @@ fi
   aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
-          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+          hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
 
-          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
         else
-          if test "$host_cpu" = ia64; then
-	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+          if test ia64 = "$host_cpu"; then
+	    hardcode_libdir_flag_spec_CXX='$wl-R $libdir:/usr/lib:/lib'
 	    allow_undefined_flag_CXX="-z nodefs"
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
           else
 	    # Determine the default libpath from the value encoded in an
 	    # empty executable.
-	    if test "${lt_cv_aix_libpath+set}" = set; then
+	    if test set = "${lt_cv_aix_libpath+set}"; then
   aix_libpath=$lt_cv_aix_libpath
 else
   if ${lt_cv_aix_libpath__CXX+:} false; then :
@@ -15301,7 +15855,7 @@ fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
   if test -z "$lt_cv_aix_libpath__CXX"; then
-    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+    lt_cv_aix_libpath__CXX=/usr/lib:/lib
   fi
 
 fi
@@ -15309,22 +15863,34 @@ fi
   aix_libpath=$lt_cv_aix_libpath__CXX
 fi
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    hardcode_libdir_flag_spec_CXX='$wl-blibpath:$libdir:'"$aix_libpath"
 	    # Warning - without using the other run time loading flags,
 	    # -berok will link without error, but may produce a broken library.
-	    no_undefined_flag_CXX=' ${wl}-bernotok'
-	    allow_undefined_flag_CXX=' ${wl}-berok'
-	    if test "$with_gnu_ld" = yes; then
+	    no_undefined_flag_CXX=' $wl-bernotok'
+	    allow_undefined_flag_CXX=' $wl-berok'
+	    if test yes = "$with_gnu_ld"; then
 	      # We only use this code for GNU lds that support --whole-archive.
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    else
 	      # Exported symbols can be pulled into shared objects from archives
 	      whole_archive_flag_spec_CXX='$convenience'
 	    fi
 	    archive_cmds_need_lc_CXX=yes
-	    # This is similar to how AIX traditionally builds its shared
-	    # libraries.
-	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	    archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+	    # -brtl affects multiple linker settings, -berok does not and is overridden later
+	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+	    if test svr4 != "$with_aix_soname"; then
+	      # This is similar to how AIX traditionally builds its shared
+	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+	    fi
+	    if test aix != "$with_aix_soname"; then
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+	    else
+	      # used by -dlpreopen to get the symbols
+	      archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
+	    fi
+	    archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d'
           fi
         fi
         ;;
@@ -15334,7 +15900,7 @@ fi
 	  allow_undefined_flag_CXX=unsupported
 	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
 	  # support --undefined.  This deserves some investigation.  FIXME
-	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
 	else
 	  ld_shlibs_CXX=no
 	fi
@@ -15362,57 +15928,58 @@ fi
 	  # Tell ltmain to make .lib files, not .a files.
 	  libext=lib
 	  # Tell ltmain to make .dll files, not .so files.
-	  shrext_cmds=".dll"
+	  shrext_cmds=.dll
 	  # FIXME: Setting linknames here is a bad hack.
-	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
-	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
-	    else
-	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
-	    fi~
-	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
-	    linknames='
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+	  archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp "$export_symbols" "$output_objdir/$soname.def";
+              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+            else
+              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+            fi~
+            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+            linknames='
 	  # The linker will not automatically build a static lib if we build a DLL.
 	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
 	  enable_shared_with_static_runtimes_CXX=yes
 	  # Don't use ranlib
 	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
 	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
-	    lt_tool_outputfile="@TOOL_OUTPUT@"~
-	    case $lt_outputfile in
-	      *.exe|*.EXE) ;;
-	      *)
-		lt_outputfile="$lt_outputfile.exe"
-		lt_tool_outputfile="$lt_tool_outputfile.exe"
-		;;
-	    esac~
-	    func_to_tool_file "$lt_outputfile"~
-	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
-	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
-	      $RM "$lt_outputfile.manifest";
-	    fi'
+            lt_tool_outputfile="@TOOL_OUTPUT@"~
+            case $lt_outputfile in
+              *.exe|*.EXE) ;;
+              *)
+                lt_outputfile=$lt_outputfile.exe
+                lt_tool_outputfile=$lt_tool_outputfile.exe
+                ;;
+            esac~
+            func_to_tool_file "$lt_outputfile"~
+            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+              $RM "$lt_outputfile.manifest";
+            fi'
 	  ;;
 	*)
 	  # g++
 	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
 	  # as there is no search path for DLLs.
 	  hardcode_libdir_flag_spec_CXX='-L$libdir'
-	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  export_dynamic_flag_spec_CXX='$wl--export-all-symbols'
 	  allow_undefined_flag_CXX=unsupported
 	  always_export_symbols_CXX=no
 	  enable_shared_with_static_runtimes_CXX=yes
 
 	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
-	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
-	    # If the export-symbols file already is a .def file (1st line
-	    # is EXPORTS), use it as is; otherwise, prepend...
-	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-	      cp $export_symbols $output_objdir/$soname.def;
-	    else
-	      echo EXPORTS > $output_objdir/$soname.def;
-	      cat $export_symbols >> $output_objdir/$soname.def;
-	    fi~
-	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file, use it as
+	    # is; otherwise, prepend EXPORTS...
+	    archive_expsym_cmds_CXX='if   test DEF = "`$SED -n     -e '\''s/^[	 ]*//'\''     -e '\''/^\(;.*\)*$/d'\''     -e '\''s/^\(EXPORTS\|LIBRARY\)\([	 ].*\)*$/DEF/p'\''     -e q     $export_symbols`" ; then
+              cp $export_symbols $output_objdir/$soname.def;
+            else
+              echo EXPORTS > $output_objdir/$soname.def;
+              cat $export_symbols >> $output_objdir/$soname.def;
+            fi~
+            $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
 	  else
 	    ld_shlibs_CXX=no
 	  fi
@@ -15426,27 +15993,27 @@ fi
   hardcode_direct_CXX=no
   hardcode_automatic_CXX=yes
   hardcode_shlibpath_var_CXX=unsupported
-  if test "$lt_cv_ld_force_load" = "yes"; then
-    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  if test yes = "$lt_cv_ld_force_load"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
 
   else
     whole_archive_flag_spec_CXX=''
   fi
   link_all_deplibs_CXX=yes
-  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  allow_undefined_flag_CXX=$_lt_dar_allow_undefined
   case $cc_basename in
-     ifort*) _lt_dar_can_shared=yes ;;
+     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
      *) _lt_dar_can_shared=$GCC ;;
   esac
-  if test "$_lt_dar_can_shared" = "yes"; then
+  if test yes = "$_lt_dar_can_shared"; then
     output_verbose_link_cmd=func_echo_all
-    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
-    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
-    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
-    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
-       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
-      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
-      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+    archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+    module_expsym_cmds_CXX="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
+       if test yes != "$lt_cv_apple_cc_single_mod"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+      archive_expsym_cmds_CXX="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
     fi
 
   else
@@ -15455,6 +16022,34 @@ fi
 
 	;;
 
+      os2*)
+	hardcode_libdir_flag_spec_CXX='-L$libdir'
+	hardcode_minus_L_CXX=yes
+	allow_undefined_flag_CXX=unsupported
+	shrext_cmds=.dll
+	archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+	  $ECHO EXPORTS >> $output_objdir/$libname.def~
+	  prefix_cmds="$SED"~
+	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
+	    prefix_cmds="$prefix_cmds -e 1d";
+	  fi~
+	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+	  emximp -o $lib $output_objdir/$libname.def'
+	old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+	enable_shared_with_static_runtimes_CXX=yes
+	;;
+
       dgux*)
         case $cc_basename in
           ec++*)
@@ -15490,14 +16085,14 @@ fi
         ;;
 
       haiku*)
-        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
         link_all_deplibs_CXX=yes
         ;;
 
       hpux9*)
-        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
         hardcode_libdir_separator_CXX=:
-        export_dynamic_flag_spec_CXX='${wl}-E'
+        export_dynamic_flag_spec_CXX='$wl-E'
         hardcode_direct_CXX=yes
         hardcode_minus_L_CXX=yes # Not in the search PATH,
 				             # but as the default
@@ -15509,7 +16104,7 @@ fi
             ld_shlibs_CXX=no
             ;;
           aCC*)
-            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             # Commands to make compiler produce verbose output that lists
             # what "hidden" libraries, object files and flags are used when
             # linking a shared library.
@@ -15518,11 +16113,11 @@ fi
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
             ;;
           *)
-            if test "$GXX" = yes; then
-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            if test yes = "$GXX"; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
             else
               # FIXME: insert proper C++ library support
               ld_shlibs_CXX=no
@@ -15532,15 +16127,15 @@ fi
         ;;
 
       hpux10*|hpux11*)
-        if test $with_gnu_ld = no; then
-	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        if test no = "$with_gnu_ld"; then
+	  hardcode_libdir_flag_spec_CXX='$wl+b $wl$libdir'
 	  hardcode_libdir_separator_CXX=:
 
           case $host_cpu in
             hppa*64*|ia64*)
               ;;
             *)
-	      export_dynamic_flag_spec_CXX='${wl}-E'
+	      export_dynamic_flag_spec_CXX='$wl-E'
               ;;
           esac
         fi
@@ -15566,13 +16161,13 @@ fi
           aCC*)
 	    case $host_cpu in
 	      hppa*64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      ia64*)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	      *)
-	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        archive_cmds_CXX='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	        ;;
 	    esac
 	    # Commands to make compiler produce verbose output that lists
@@ -15583,20 +16178,20 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test $with_gnu_ld = no; then
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
 	        case $host_cpu in
 	          hppa*64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          ia64*)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	          *)
-	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	            ;;
 	        esac
 	      fi
@@ -15611,22 +16206,22 @@ fi
       interix[3-9]*)
 	hardcode_direct_CXX=no
 	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	export_dynamic_flag_spec_CXX='${wl}-E'
+	hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='$wl-E'
 	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
 	# Instead, shared libraries are loaded at an image base (0x10000000 by
 	# default) and relocated if they conflict, which is a slow very memory
 	# consuming and fragmenting process.  To avoid this, we pick a random,
 	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
 	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
-	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
-	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
 	;;
       irix5* | irix6*)
         case $cc_basename in
           CC*)
 	    # SGI C++
-	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
@@ -15635,17 +16230,17 @@ fi
 	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
 	    ;;
           *)
-	    if test "$GXX" = yes; then
-	      if test "$with_gnu_ld" = no; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	    if test yes = "$GXX"; then
+	      if test no = "$with_gnu_ld"; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 	      else
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
 	      fi
 	    fi
 	    link_all_deplibs_CXX=yes
 	    ;;
         esac
-        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
         hardcode_libdir_separator_CXX=:
         inherit_rpath_CXX=yes
         ;;
@@ -15658,8 +16253,8 @@ fi
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
 	    # Commands to make compiler produce verbose output that lists
 	    # what "hidden" libraries, object files and flags are used when
 	    # linking a shared library.
@@ -15668,10 +16263,10 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
 
 	    # Archives containing C++ object files must be created using
 	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -15685,59 +16280,59 @@ fi
 	    # earlier do not add the objects themselves.
 	    case `$CC -V 2>&1` in
 	      *"Version 7."*)
-	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	      *)  # Version 8.0 or newer
 	        tmp_idyn=
 	        case $host_cpu in
 		  ia64*) tmp_idyn=' -i_dynamic';;
 		esac
-	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 		;;
 	    esac
 	    archive_cmds_need_lc_CXX=no
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive$convenience $wl--no-whole-archive'
 	    ;;
           pgCC* | pgcpp*)
             # Portland Group C++ compiler
 	    case `$CC -V` in
 	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
 	      prelink_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
-		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
 	      old_archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
-		$RANLIB $oldlib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+                $RANLIB $oldlib'
 	      archive_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
-		rm -rf $tpldir~
-		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+                rm -rf $tpldir~
+                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    *) # Version 6 and above use weak symbols
-	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
 	      ;;
 	    esac
 
-	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	    hardcode_libdir_flag_spec_CXX='$wl--rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    whole_archive_flag_spec_CXX='$wl--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
             ;;
 	  cxx*)
 	    # Compaq C++
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname  -o $lib $wl-retain-symbols-file $wl$export_symbols'
 
 	    runpath_var=LD_RUN_PATH
 	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
@@ -15751,18 +16346,18 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
 	    ;;
 	  xl* | mpixl* | bgxl*)
 	    # IBM XL 8.0 on PPC, with GNU ld
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
-	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
-	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-	    if test "x$supports_anon_versioning" = xyes; then
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
+	    export_dynamic_flag_spec_CXX='$wl--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+	    if test yes = "$supports_anon_versioning"; then
 	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
-		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-		echo "local: *; };" >> $output_objdir/$libname.ver~
-		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+                echo "local: *; };" >> $output_objdir/$libname.ver~
+                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
 	    fi
 	    ;;
 	  *)
@@ -15770,10 +16365,10 @@ fi
 	    *Sun\ C*)
 	      # Sun C++ 5.9
 	      no_undefined_flag_CXX=' -zdefs'
-	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
 	      hardcode_libdir_flag_spec_CXX='-R$libdir'
-	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      whole_archive_flag_spec_CXX='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
 	      compiler_needs_object_CXX=yes
 
 	      # Not sure whether something based on
@@ -15831,22 +16426,17 @@ fi
         ld_shlibs_CXX=yes
 	;;
 
-      openbsd2*)
-        # C++ shared libraries are fairly broken
-	ld_shlibs_CXX=no
-	;;
-
-      openbsd*)
+      openbsd* | bitrig*)
 	if test -f /usr/libexec/ld.so; then
 	  hardcode_direct_CXX=yes
 	  hardcode_shlibpath_var_CXX=no
 	  hardcode_direct_absolute_CXX=yes
 	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
-	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-	    export_dynamic_flag_spec_CXX='${wl}-E'
-	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='$wl-E'
+	    whole_archive_flag_spec_CXX=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
 	  fi
 	  output_verbose_link_cmd=func_echo_all
 	else
@@ -15862,9 +16452,9 @@ fi
 	    # KCC will only create a shared library if the output file
 	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
 	    # to its proper name (with version) after linking.
-	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_flag_spec_CXX='$wl-rpath,$libdir'
 	    hardcode_libdir_separator_CXX=:
 
 	    # Archives containing C++ object files must be created using
@@ -15882,17 +16472,17 @@ fi
           cxx*)
 	    case $host in
 	      osf3*)
-	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
-	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	        allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
 		;;
 	      *)
 	        allow_undefined_flag_CXX=' -expect_unresolved \*'
-	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_cmds_CXX='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
 	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-	          echo "-hidden">> $lib.exp~
-	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
-	          $RM $lib.exp'
+                  echo "-hidden">> $lib.exp~
+                  $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+                  $RM $lib.exp'
 	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
 		;;
 	    esac
@@ -15907,21 +16497,21 @@ fi
 	    # explicitly linking system object files so we need to strip them
 	    # from the output so that they don't get included in the library
 	    # dependencies.
-	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
 	    ;;
 	  *)
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      allow_undefined_flag_CXX=' $wl-expect_unresolved $wl\*'
 	      case $host in
 	        osf3*)
-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	        *)
-	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
 		  ;;
 	      esac
 
-	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_flag_spec_CXX='$wl-rpath $wl$libdir'
 	      hardcode_libdir_separator_CXX=:
 
 	      # Commands to make compiler produce verbose output that lists
@@ -15967,9 +16557,9 @@ fi
 	    # Sun C++ 4.2, 5.x and Centerline C++
             archive_cmds_need_lc_CXX=yes
 	    no_undefined_flag_CXX=' -zdefs'
-	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_cmds_CXX='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
 	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+              $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	    hardcode_libdir_flag_spec_CXX='-R$libdir'
 	    hardcode_shlibpath_var_CXX=no
@@ -15977,7 +16567,7 @@ fi
 	      solaris2.[0-5] | solaris2.[0-5].*) ;;
 	      *)
 		# The compiler driver will combine and reorder linker options,
-		# but understands `-z linker_flag'.
+		# but understands '-z linker_flag'.
 	        # Supported since Solaris 2.6 (maybe 2.5.1?)
 		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
 	        ;;
@@ -15994,30 +16584,30 @@ fi
 	    ;;
           gcx*)
 	    # Green Hills C++ Compiler
-	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 
 	    # The C++ compiler must be used to create the archive.
 	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
 	    ;;
           *)
 	    # GNU C++ compiler with Solaris linker
-	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	    if test yes,no = "$GXX,$with_gnu_ld"; then
+	      no_undefined_flag_CXX=' $wl-z ${wl}defs'
 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
-	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
 	        # linking a shared library.
 	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      else
-	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
 	        # platform.
-	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_cmds_CXX='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
-		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
 
 	        # Commands to make compiler produce verbose output that lists
 	        # what "hidden" libraries, object files and flags are used when
@@ -16025,11 +16615,11 @@ fi
 	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 	      fi
 
-	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      hardcode_libdir_flag_spec_CXX='$wl-R $wl$libdir'
 	      case $host_os in
 		solaris2.[0-5] | solaris2.[0-5].*) ;;
 		*)
-		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  whole_archive_flag_spec_CXX='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
 		  ;;
 	      esac
 	    fi
@@ -16038,52 +16628,52 @@ fi
         ;;
 
     sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
-      no_undefined_flag_CXX='${wl}-z,text'
+      no_undefined_flag_CXX='$wl-z,text'
       archive_cmds_need_lc_CXX=no
       hardcode_shlibpath_var_CXX=no
       runpath_var='LD_RUN_PATH'
 
       case $cc_basename in
         CC*)
-	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
 	*)
-	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	  ;;
       esac
       ;;
 
       sysv5* | sco3.2v5* | sco5v6*)
-	# Note: We can NOT use -z defs as we might desire, because we do not
+	# Note: We CANNOT use -z defs as we might desire, because we do not
 	# link with -lc, and that would cause any symbols used from libc to
 	# always be unresolved, which means just about no library would
 	# ever link correctly.  If we're not using GNU ld we use -z text
 	# though, which does catch some bad symbols but isn't as heavy-handed
 	# as -z defs.
-	no_undefined_flag_CXX='${wl}-z,text'
-	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	no_undefined_flag_CXX='$wl-z,text'
+	allow_undefined_flag_CXX='$wl-z,nodefs'
 	archive_cmds_need_lc_CXX=no
 	hardcode_shlibpath_var_CXX=no
-	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_flag_spec_CXX='$wl-R,$libdir'
 	hardcode_libdir_separator_CXX=':'
 	link_all_deplibs_CXX=yes
-	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	export_dynamic_flag_spec_CXX='$wl-Bexport'
 	runpath_var='LD_RUN_PATH'
 
 	case $cc_basename in
           CC*)
-	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_cmds_CXX='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
-	      '"$old_archive_cmds_CXX"
+              '"$old_archive_cmds_CXX"
 	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
-	      '"$reload_cmds_CXX"
+              '"$reload_cmds_CXX"
 	    ;;
 	  *)
-	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
-	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_cmds_CXX='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
 	    ;;
 	esac
       ;;
@@ -16115,10 +16705,10 @@ fi
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
-    test "$ld_shlibs_CXX" = no && can_build_shared=no
+    test no = "$ld_shlibs_CXX" && can_build_shared=no
 
-    GCC_CXX="$GXX"
-    LD_CXX="$LD"
+    GCC_CXX=$GXX
+    LD_CXX=$LD
 
     ## CAVEAT EMPTOR:
     ## There is no encapsulation within the following macros, do not change
@@ -16162,13 +16752,13 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   pre_test_object_deps_done=no
 
   for p in `eval "$output_verbose_link_cmd"`; do
-    case ${prev}${p} in
+    case $prev$p in
 
     -L* | -R* | -l*)
        # Some compilers place space between "-{L,R}" and the path.
        # Remove the space.
-       if test $p = "-L" ||
-          test $p = "-R"; then
+       if test x-L = "$p" ||
+          test x-R = "$p"; then
 	 prev=$p
 	 continue
        fi
@@ -16184,16 +16774,16 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
        case $p in
        =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
        esac
-       if test "$pre_test_object_deps_done" = no; then
-	 case ${prev} in
+       if test no = "$pre_test_object_deps_done"; then
+	 case $prev in
 	 -L | -R)
 	   # Internal compiler library paths should come after those
 	   # provided the user.  The postdeps already come after the
 	   # user supplied libs so there is no need to process them.
 	   if test -z "$compiler_lib_search_path_CXX"; then
-	     compiler_lib_search_path_CXX="${prev}${p}"
+	     compiler_lib_search_path_CXX=$prev$p
 	   else
-	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} $prev$p"
 	   fi
 	   ;;
 	 # The "-l" case would never come before the object being
@@ -16201,9 +16791,9 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
 	 esac
        else
 	 if test -z "$postdeps_CXX"; then
-	   postdeps_CXX="${prev}${p}"
+	   postdeps_CXX=$prev$p
 	 else
-	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	   postdeps_CXX="${postdeps_CXX} $prev$p"
 	 fi
        fi
        prev=
@@ -16218,15 +16808,15 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
 	 continue
        fi
 
-       if test "$pre_test_object_deps_done" = no; then
+       if test no = "$pre_test_object_deps_done"; then
 	 if test -z "$predep_objects_CXX"; then
-	   predep_objects_CXX="$p"
+	   predep_objects_CXX=$p
 	 else
 	   predep_objects_CXX="$predep_objects_CXX $p"
 	 fi
        else
 	 if test -z "$postdep_objects_CXX"; then
-	   postdep_objects_CXX="$p"
+	   postdep_objects_CXX=$p
 	 else
 	   postdep_objects_CXX="$postdep_objects_CXX $p"
 	 fi
@@ -16256,51 +16846,6 @@ interix[3-9]*)
   postdep_objects_CXX=
   postdeps_CXX=
   ;;
-
-linux*)
-  case `$CC -V 2>&1 | sed 5q` in
-  *Sun\ C*)
-    # Sun C++ 5.9
-
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
-
-solaris*)
-  case $cc_basename in
-  CC* | sunCC*)
-    # The more standards-conforming stlport4 library is
-    # incompatible with the Cstd library. Avoid specifying
-    # it if it's in CXXFLAGS. Ignore libCrun as
-    # -library=stlport4 depends on it.
-    case " $CXX $CXXFLAGS " in
-    *" -library=stlport4 "*)
-      solaris_use_stlport4=yes
-      ;;
-    esac
-
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    if test "$solaris_use_stlport4" != yes; then
-      postdeps_CXX='-library=Cstd -library=Crun'
-    fi
-    ;;
-  esac
-  ;;
 esac
 
 
@@ -16309,7 +16854,7 @@ case " $postdeps_CXX " in
 esac
  compiler_lib_search_dirs_CXX=
 if test -n "${compiler_lib_search_path_CXX}"; then
- compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | $SED -e 's! -L! !g' -e 's!^ !!'`
 fi
 
 
@@ -16348,17 +16893,18 @@ lt_prog_compiler_static_CXX=
 
 
   # C++ specific cases for pic, static, wl, etc.
-  if test "$GXX" = yes; then
+  if test yes = "$GXX"; then
     lt_prog_compiler_wl_CXX='-Wl,'
     lt_prog_compiler_static_CXX='-static'
 
     case $host_os in
     aix*)
       # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
+      if test ia64 = "$host_cpu"; then
 	# AIX 5 now supports IA64 processor
 	lt_prog_compiler_static_CXX='-Bstatic'
       fi
+      lt_prog_compiler_pic_CXX='-fPIC'
       ;;
 
     amigaos*)
@@ -16369,8 +16915,8 @@ lt_prog_compiler_static_CXX=
         ;;
       m68k)
             # FIXME: we need at least 68020 code to build shared libraries, but
-            # adding the `-m68020' flag to GCC prevents building anything better,
-            # like `-m68040'.
+            # adding the '-m68020' flag to GCC prevents building anything better,
+            # like '-m68040'.
             lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
         ;;
       esac
@@ -16385,6 +16931,11 @@ lt_prog_compiler_static_CXX=
       # Although the cygwin gcc ignores -fPIC, still need this for old-style
       # (--disable-auto-import) libraries
       lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      case $host_os in
+      os2*)
+	lt_prog_compiler_static_CXX='$wl-static'
+	;;
+      esac
       ;;
     darwin* | rhapsody*)
       # PIC is the default on this platform
@@ -16434,7 +16985,7 @@ lt_prog_compiler_static_CXX=
     case $host_os in
       aix[4-9]*)
 	# All AIX code is PIC.
-	if test "$host_cpu" = ia64; then
+	if test ia64 = "$host_cpu"; then
 	  # AIX 5 now supports IA64 processor
 	  lt_prog_compiler_static_CXX='-Bstatic'
 	else
@@ -16474,14 +17025,14 @@ lt_prog_compiler_static_CXX=
 	case $cc_basename in
 	  CC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
-	    if test "$host_cpu" != ia64; then
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
+	    if test ia64 != "$host_cpu"; then
 	      lt_prog_compiler_pic_CXX='+Z'
 	    fi
 	    ;;
 	  aCC*)
 	    lt_prog_compiler_wl_CXX='-Wl,'
-	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    lt_prog_compiler_static_CXX='$wl-a ${wl}archive'
 	    case $host_cpu in
 	    hppa*64*|ia64*)
 	      # +Z the default
@@ -16518,7 +17069,7 @@ lt_prog_compiler_static_CXX=
 	    lt_prog_compiler_pic_CXX='-fPIC'
 	    ;;
 	  ecpc* )
-	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    # old Intel C++ for x86_64, which still supported -KPIC.
 	    lt_prog_compiler_wl_CXX='-Wl,'
 	    lt_prog_compiler_pic_CXX='-KPIC'
 	    lt_prog_compiler_static_CXX='-static'
@@ -16663,7 +17214,7 @@ lt_prog_compiler_static_CXX=
   fi
 
 case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
+  # For platforms that do not support PIC, -DPIC is meaningless:
   *djgpp*)
     lt_prog_compiler_pic_CXX=
     ;;
@@ -16695,7 +17246,7 @@ else
   lt_cv_prog_compiler_pic_works_CXX=no
    ac_outfile=conftest.$ac_objext
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"  ## exclude from sc_useless_quotes_in_assignment
    # Insert the option either (1) after the last *FLAGS variable, or
    # (2) before a word containing "conftest.", or (3) at the end.
    # Note that $ac_compile itself does not contain backslashes and begins
@@ -16725,7 +17276,7 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
 
-if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works_CXX"; then
     case $lt_prog_compiler_pic_CXX in
      "" | " "*) ;;
      *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
@@ -16751,7 +17302,7 @@ if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   lt_cv_prog_compiler_static_works_CXX=no
-   save_LDFLAGS="$LDFLAGS"
+   save_LDFLAGS=$LDFLAGS
    LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
    echo "$lt_simple_link_test_code" > conftest.$ac_ext
    if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -16770,13 +17321,13 @@ else
      fi
    fi
    $RM -r conftest*
-   LDFLAGS="$save_LDFLAGS"
+   LDFLAGS=$save_LDFLAGS
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
 
-if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works_CXX"; then
     :
 else
     lt_prog_compiler_static_CXX=
@@ -16890,8 +17441,8 @@ $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
 
 
 
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; then
   # do not overwrite the value of need_locks provided by the user
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
 $as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -16903,9 +17454,9 @@ $as_echo_n "checking if we can lock with hard links... " >&6; }
   ln conftest.a conftest.b 2>/dev/null && hard_links=no
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
 $as_echo "$hard_links" >&6; }
-  if test "$hard_links" = no; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+  if test no = "$hard_links"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
     need_locks=warn
   fi
 else
@@ -16922,17 +17473,21 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   case $host_os in
   aix[4-9]*)
     # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    # Also, AIX nm treats weak defined symbols like other global defined
-    # symbols, whereas GNU nm marks them as "W".
+    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+    # Without the "-l" option, or with the "-B" option, AIX nm treats
+    # weak defined symbols like other global defined symbols, whereas
+    # GNU nm marks them as "W".
+    # While the 'weak' keyword is ignored in the Export File, we need
+    # it in the Import File for the 'aix-soname' feature, so we have
+    # to replace the "-B" option with "-P" for AIX nm.
     if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
-      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
     else
-      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+      export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
     fi
     ;;
   pw32*)
-    export_symbols_cmds_CXX="$ltdll_cmds"
+    export_symbols_cmds_CXX=$ltdll_cmds
     ;;
   cygwin* | mingw* | cegcc*)
     case $cc_basename in
@@ -16955,7 +17510,7 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
 $as_echo "$ld_shlibs_CXX" >&6; }
-test "$ld_shlibs_CXX" = no && can_build_shared=no
+test no = "$ld_shlibs_CXX" && can_build_shared=no
 
 with_gnu_ld_CXX=$with_gnu_ld
 
@@ -16972,7 +17527,7 @@ x|xyes)
   # Assume -lc should be added
   archive_cmds_need_lc_CXX=yes
 
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
+  if test yes,yes = "$GCC,$enable_shared"; then
     case $archive_cmds_CXX in
     *'~'*)
       # FIXME: we may have to deal with multi-command sequences.
@@ -17100,7 +17655,7 @@ $as_echo_n "checking dynamic linker characteristics... " >&6; }
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
 postinstall_cmds=
 postuninstall_cmds=
 finish_cmds=
@@ -17117,14 +17672,16 @@ hardcode_into_libs=no
 # flags to be left without arguments
 need_version=unknown
 
+
+
 case $host_os in
 aix3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
   shlibpath_var=LIBPATH
 
   # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
+  soname_spec='$libname$release$shared_ext$major'
   ;;
 
 aix[4-9]*)
@@ -17132,41 +17689,91 @@ aix[4-9]*)
   need_lib_prefix=no
   need_version=no
   hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
+  if test ia64 = "$host_cpu"; then
     # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
     shlibpath_var=LD_LIBRARY_PATH
   else
     # With GCC up to 2.95.x, collect2 would create an import file
     # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
+    # the line '#! .'.  This would cause the generated library to
+    # depend on '.', always an invalid library.  This was fixed in
     # development snapshots of GCC prior to 3.0.
     case $host_os in
       aix4 | aix4.[01] | aix4.[01].*)
       if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
 	   echo ' yes '
-	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
 	:
       else
 	can_build_shared=no
       fi
       ;;
     esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # Using Import Files as archive members, it is possible to support
+    # filename-based versioning of shared library archives on AIX. While
+    # this would work for both with and without runtime linking, it will
+    # prevent static linking of such archives. So we do filename-based
+    # shared library versioning with .so extension only, which is used
+    # when both runtime linking and shared linking is enabled.
+    # Unfortunately, runtime linking may impact performance, so we do
+    # not want this to be the default eventually. Also, we use the
+    # versioned .so libs for executables only if there is the -brtl
+    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+    # To allow for filename-based versioning support, we need to create
+    # libNAME.so.V as an archive file, containing:
+    # *) an Import File, referring to the versioned filename of the
+    #    archive as well as the shared archive member, telling the
+    #    bitwidth (32 or 64) of that shared object, and providing the
+    #    list of exported symbols of that shared object, eventually
+    #    decorated with the 'weak' keyword
+    # *) the shared object with the F_LOADONLY flag set, to really avoid
+    #    it being seen by the linker.
+    # At run time we better use the real file rather than another symlink,
+    # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+    case $with_aix_soname,$aix_use_runtimelinking in
+    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
     # soname into executable. Probably we can add versioning support to
     # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
+    aix,yes) # traditional libtool
+      dynamic_linker='AIX unversionable lib.so'
       # If using run time linking (on AIX 4.2 or later) use lib<name>.so
       # instead of lib<name>.a to let people know that these are not
       # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      ;;
+    aix,no) # traditional AIX only
+      dynamic_linker='AIX lib.a(lib.so.V)'
       # We preserve .a as extension for shared libraries through AIX4.2
       # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      ;;
+    svr4,*) # full svr4 only
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,yes) # both, prefer svr4
+      dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+      # unpreferred sharedlib libNAME.a needs extra handling
+      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+      # We do not specify a path in Import Files, so LIBPATH fires.
+      shlibpath_overrides_runpath=yes
+      ;;
+    *,no) # both, prefer aix
+      dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+      library_names_spec='$libname$release.a $libname.a'
+      soname_spec='$libname$release$shared_ext$major'
+      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+      ;;
+    esac
     shlibpath_var=LIBPATH
   fi
   ;;
@@ -17176,18 +17783,18 @@ amigaos*)
   powerpc)
     # Since July 2007 AmigaOS4 officially supports .so libraries.
     # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
     ;;
   m68k)
     library_names_spec='$libname.ixlibrary $libname.a'
     # Create ${libname}_ixlibrary.a entries in /sys/libs.
-    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
     ;;
   esac
   ;;
 
 beos*)
-  library_names_spec='${libname}${shared_ext}'
+  library_names_spec='$libname$shared_ext'
   dynamic_linker="$host_os ld.so"
   shlibpath_var=LIBRARY_PATH
   ;;
@@ -17195,8 +17802,8 @@ beos*)
 bsdi[45]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -17208,7 +17815,7 @@ bsdi[45]*)
 
 cygwin* | mingw* | pw32* | cegcc*)
   version_type=windows
-  shrext_cmds=".dll"
+  shrext_cmds=.dll
   need_version=no
   need_lib_prefix=no
 
@@ -17217,8 +17824,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     # gcc
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname~
@@ -17234,16 +17841,16 @@ cygwin* | mingw* | pw32* | cegcc*)
     case $host_os in
     cygwin*)
       # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
 
       ;;
     mingw* | cegcc*)
       # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     pw32*)
       # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
       ;;
     esac
     dynamic_linker='Win32 ld.exe'
@@ -17252,8 +17859,8 @@ cygwin* | mingw* | pw32* | cegcc*)
   *,cl*)
     # Native MSVC
     libname_spec='$name'
-    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
-    library_names_spec='${libname}.dll.lib'
+    soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+    library_names_spec='$libname.dll.lib'
 
     case $build_os in
     mingw*)
@@ -17280,7 +17887,7 @@ cygwin* | mingw* | pw32* | cegcc*)
       sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
       ;;
     *)
-      sys_lib_search_path_spec="$LIB"
+      sys_lib_search_path_spec=$LIB
       if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
         # It is most probably a Windows format PATH.
         sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -17293,8 +17900,8 @@ cygwin* | mingw* | pw32* | cegcc*)
     esac
 
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+    postinstall_cmds='base_file=`basename \$file`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
       dldir=$destdir/`dirname \$dlpath`~
       test -d \$dldir || mkdir -p \$dldir~
       $install_prog $dir/$dlname \$dldir/$dlname'
@@ -17307,7 +17914,7 @@ cygwin* | mingw* | pw32* | cegcc*)
 
   *)
     # Assume MSVC wrapper
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
     dynamic_linker='Win32 ld.exe'
     ;;
   esac
@@ -17320,8 +17927,8 @@ darwin* | rhapsody*)
   version_type=darwin
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
+  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$major$shared_ext'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -17333,8 +17940,8 @@ dgux*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -17352,12 +17959,13 @@ freebsd* | dragonfly*)
   version_type=freebsd-$objformat
   case $version_type in
     freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+      soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
     freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
   esac
@@ -17387,10 +17995,10 @@ haiku*)
   need_lib_prefix=no
   need_version=no
   dynamic_linker="$host_os runtime_loader"
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+  shlibpath_overrides_runpath=no
   sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
   hardcode_into_libs=yes
   ;;
@@ -17408,14 +18016,15 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.so"
     shlibpath_var=LD_LIBRARY_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
+    if test 32 = "$HPUX_IA64_MODE"; then
       sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
     else
       sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
     fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
   hppa*64*)
     shrext_cmds='.sl'
@@ -17423,8 +18032,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
@@ -17433,8 +18042,8 @@ hpux9* | hpux10* | hpux11*)
     dynamic_linker="$host_os dld.sl"
     shlibpath_var=SHLIB_PATH
     shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     ;;
   esac
   # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -17447,8 +18056,8 @@ interix[3-9]*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -17459,7 +18068,7 @@ irix5* | irix6* | nonstopux*)
   case $host_os in
     nonstopux*) version_type=nonstopux ;;
     *)
-	if test "$lt_cv_prog_gnu_ld" = yes; then
+	if test yes = "$lt_cv_prog_gnu_ld"; then
 		version_type=linux # correct to gnu/linux during the next big refactor
 	else
 		version_type=irix
@@ -17467,8 +18076,8 @@ irix5* | irix6* | nonstopux*)
   esac
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
   case $host_os in
   irix5* | nonstopux*)
     libsuff= shlibsuff=
@@ -17487,8 +18096,8 @@ irix5* | irix6* | nonstopux*)
   esac
   shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
   shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
   hardcode_into_libs=yes
   ;;
 
@@ -17497,13 +18106,33 @@ linux*oldld* | linux*aout* | linux*coff*)
   dynamic_linker=no
   ;;
 
+linux*android*)
+  version_type=none # Android doesn't support versioned libraries.
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='$libname$release$shared_ext'
+  soname_spec='$libname$release$shared_ext'
+  finish_cmds=
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  dynamic_linker='Android linker'
+  # Don't embed -rpath directories since the linker doesn't support them.
+  hardcode_libdir_flag_spec_CXX='-L$libdir'
+  ;;
+
 # This must be glibc/ELF.
 linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
@@ -17547,7 +18176,12 @@ fi
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
+  # Ideally, we could use ldconfig to report *all* directores which are
+  # searched for libraries, however this is still not possible.  Aside from not
+  # being certain /sbin/ldconfig is available, command
+  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+  # even though it is searched at run-time.  Try to do the best guess by
+  # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
     sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -17579,12 +18213,12 @@ netbsd*)
   need_lib_prefix=no
   need_version=no
   if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
     finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
     dynamic_linker='NetBSD (a.out) ld.so'
   else
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
+    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+    soname_spec='$libname$release$shared_ext$major'
     dynamic_linker='NetBSD ld.elf_so'
   fi
   shlibpath_var=LD_LIBRARY_PATH
@@ -17594,7 +18228,7 @@ netbsd*)
 
 newsos6)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   ;;
@@ -17603,58 +18237,68 @@ newsos6)
   version_type=qnx
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
   dynamic_linker='ldqnx.so'
   ;;
 
-openbsd*)
+openbsd* | bitrig*)
   version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
+  sys_lib_dlsearch_path_spec=/usr/lib
   need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
-    *)				need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-	shlibpath_overrides_runpath=no
-	;;
-      *)
-	shlibpath_overrides_runpath=yes
-	;;
-      esac
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+    need_version=no
   else
-    shlibpath_overrides_runpath=yes
+    need_version=yes
   fi
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
   ;;
 
 os2*)
   libname_spec='$name'
-  shrext_cmds=".dll"
+  version_type=windows
+  shrext_cmds=.dll
+  need_version=no
   need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
+  # OS/2 can only load a DLL with a base name of 8 characters or less.
+  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+    v=$($ECHO $release$versuffix | tr -d .-);
+    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+    $ECHO $n$v`$shared_ext'
+  library_names_spec='${libname}_dll.$libext'
   dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
+  shlibpath_var=BEGINLIBPATH
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+  postinstall_cmds='base_file=`basename \$file`~
+    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    $install_prog $dir/$dlname \$dldir/$dlname~
+    chmod a+x \$dldir/$dlname~
+    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+    fi'
+  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+    $RM \$dlpath'
   ;;
 
 osf3* | osf4* | osf5*)
   version_type=osf
   need_lib_prefix=no
   need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='$libname$release$shared_ext$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
   ;;
 
 rdos*)
@@ -17665,8 +18309,8 @@ solaris*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
@@ -17676,11 +18320,11 @@ solaris*)
 
 sunos4*)
   version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
   finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     need_lib_prefix=no
   fi
   need_version=yes
@@ -17688,8 +18332,8 @@ sunos4*)
 
 sysv4 | sysv4.3*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   case $host_vendor in
     sni)
@@ -17710,24 +18354,24 @@ sysv4 | sysv4.3*)
   ;;
 
 sysv4*MP*)
-  if test -d /usr/nec ;then
+  if test -d /usr/nec; then
     version_type=linux # correct to gnu/linux during the next big refactor
-    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
-    soname_spec='$libname${shared_ext}.$major'
+    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+    soname_spec='$libname$shared_ext.$major'
     shlibpath_var=LD_LIBRARY_PATH
   fi
   ;;
 
 sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
+  version_type=sco
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=yes
   hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
+  if test yes = "$with_gnu_ld"; then
     sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
   else
     sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -17745,7 +18389,7 @@ tpf*)
   version_type=linux # correct to gnu/linux during the next big refactor
   need_lib_prefix=no
   need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
   shlibpath_var=LD_LIBRARY_PATH
   shlibpath_overrides_runpath=no
   hardcode_into_libs=yes
@@ -17753,8 +18397,8 @@ tpf*)
 
 uts4*)
   version_type=linux # correct to gnu/linux during the next big refactor
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+  soname_spec='$libname$release$shared_ext$major'
   shlibpath_var=LD_LIBRARY_PATH
   ;;
 
@@ -17764,20 +18408,32 @@ uts4*)
 esac
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
 $as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
 
 variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
   variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
 fi
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
 fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
 fi
 
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
+
+
 
 
 
@@ -17820,15 +18476,15 @@ $as_echo_n "checking how to hardcode library paths into programs... " >&6; }
 hardcode_action_CXX=
 if test -n "$hardcode_libdir_flag_spec_CXX" ||
    test -n "$runpath_var_CXX" ||
-   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+   test yes = "$hardcode_automatic_CXX"; then
 
   # We can hardcode non-existent directories.
-  if test "$hardcode_direct_CXX" != no &&
+  if test no != "$hardcode_direct_CXX" &&
      # If the only mechanism to avoid hardcoding is shlibpath_var, we
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
-     test "$hardcode_minus_L_CXX" != no; then
+     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" &&
+     test no != "$hardcode_minus_L_CXX"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action_CXX=relink
   else
@@ -17843,12 +18499,12 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
 $as_echo "$hardcode_action_CXX" >&6; }
 
-if test "$hardcode_action_CXX" = relink ||
-   test "$inherit_rpath_CXX" = yes; then
+if test relink = "$hardcode_action_CXX" ||
+   test yes = "$inherit_rpath_CXX"; then
   # Fast installation is not supported
   enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+     test no = "$enable_shared"; then
   # Fast installation is not necessary
   enable_fast_install=needless
 fi
@@ -17871,7 +18527,7 @@ fi
   lt_cv_path_LD=$lt_save_path_LD
   lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
   lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
@@ -19411,31 +20067,37 @@ $as_echo "#define SLURM_BIGENDIAN 1" >>confdefs.h
 
 
 
-  x_ac_json_dirs="/usr /usr/local"
-  x_ac_json_libs="lib64 lib"
+  _x_ac_json_dirs="/usr /usr/local"
+  _x_ac_json_libs="lib64 lib"
 
 
 # Check whether --with-json was given.
 if test "${with_json+set}" = set; then :
-  withval=$with_json; x_ac_json_dirs="$withval $x_ac_json_dirs"
+  withval=$with_json; if test "x$with_json" != xno; then :
+  _x_ac_json_dirs="$with_json $_x_ac_json_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for json installation" >&5
+  if test "x$with_json" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for json disabled" >&5
+$as_echo "$as_me: WARNING: support for json disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for json installation" >&5
 $as_echo_n "checking for json installation... " >&6; }
 if ${x_ac_cv_json_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-     for d in $x_ac_json_dirs; do
-       test -d "$d" || continue
-       test -d "$d/include" || continue
-       test -f "$d/include/json-c/json_object.h" || test -f "$d/include/json/json_object.h" || continue
-       for bit in $x_ac_json_libs; do
-         test -d "$d/$bit" || continue
-         _x_ac_json_libs_save="$LIBS"
-         LIBS="-L$d/$bit -ljson-c $LIBS"
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_json_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/json-c/json_object.h" || test -f "$d/include/json/json_object.h" || continue
+          for bit in $_x_ac_json_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_json_libs_save="$LIBS"
+            LIBS="-L$d/$bit -ljson-c $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -19458,39 +20120,41 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-        LIBS="$_x_ac_json_libs_save"
-        test -n "$x_ac_cv_json_dir" && break
-     done
-     test -n "$x_ac_cv_json_dir" && break
-  done
+            LIBS="$_x_ac_json_libs_save"
+            test -n "$x_ac_cv_json_dir" && break
+          done
+          test -n "$x_ac_cv_json_dir" && break
+        done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_json_dir" >&5
 $as_echo "$x_ac_cv_json_dir" >&6; }
 
-  if test -z "$x_ac_cv_json_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate json parser library" >&5
+    if test -z "$x_ac_cv_json_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate json parser library" >&5
 $as_echo "$as_me: WARNING: unable to locate json parser library" >&2;}
-  else
-    if test -f "$d/include/json-c/json_object.h" ; then
+    else
+      if test -f "$d/include/json-c/json_object.h" ; then
 
 $as_echo "#define HAVE_JSON_C_INC 1" >>confdefs.h
 
-    fi
-    if test -f "$d/include/json/json_object.h" ; then
+      fi
+      if test -f "$d/include/json/json_object.h" ; then
 
 $as_echo "#define HAVE_JSON_INC 1" >>confdefs.h
 
-    fi
+      fi
 
 $as_echo "#define HAVE_JSON 1" >>confdefs.h
 
-    JSON_CPPFLAGS="-I$x_ac_cv_json_dir/include"
-    JSON_LDFLAGS="-L$x_ac_cv_json_dir/$bit -ljson-c"
-  fi
+      JSON_CPPFLAGS="-I$x_ac_cv_json_dir/include"
+      JSON_LDFLAGS="-L$x_ac_cv_json_dir/$bit -ljson-c"
+    fi
 
 
 
+  fi
+
    if test -n "$x_ac_cv_json_dir"; then
   WITH_JSON_PARSER_TRUE=
   WITH_JSON_PARSER_FALSE='#'
@@ -20210,39 +20874,6 @@ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 LIBS="$PTHREAD_LIBS $LIBS"
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Sun Constellation system" >&5
-$as_echo_n "checking for Sun Constellation system... " >&6; }
-  # Check whether --enable-sun-const was given.
-if test "${enable_sun_const+set}" = set; then :
-  enableval=$enable_sun_const;  case "$enableval" in
-        yes) x_ac_sun_const=yes ;;
-         no) x_ac_sun_const=no ;;
-          *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: doh!" >&5
-$as_echo "doh!" >&6; }
-             as_fn_error $? "bad value \"$enableval\" for --enable-sun-const" "$LINENO" 5 ;;
-      esac
-
-else
-  x_ac_sun_const=no
-
-fi
-
-
-  if test "$x_ac_sun_const" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define SYSTEM_DIMENSIONS 4" >>confdefs.h
-
-
-$as_echo "#define HAVE_SUN_CONST 1" >>confdefs.h
-
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  fi
-
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking System dimensions" >&5
 $as_echo_n "checking System dimensions... " >&6; }
 
@@ -20276,14 +20907,6 @@ $as_echo "not set" >&6; };
 
 
 
-	# 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
-	# and then using them.  It is also advised to set the flag if there
-	# are goto statements you may get better performance.
-	if test "$GCC" = yes; then
-		CFLAGS="$CFLAGS -fno-gcse"
-	fi
-
 
   _x_ac_ofed_dirs="/usr /usr/local"
   _x_ac_ofed_libs="lib64 lib"
@@ -20291,27 +20914,33 @@ $as_echo "not set" >&6; };
 
 # Check whether --with-ofed was given.
 if test "${with_ofed+set}" = set; then :
-  withval=$with_ofed; _x_ac_ofed_dirs="$withval $_x_ac_ofed_dirs"
+  withval=$with_ofed; if test "x$with_ofed" != xno; then :
+  _x_ac_ofed_dirs="$with_ofed $_x_ac_ofed_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ofed installation" >&5
+  if test "x$with_ofed" = xno; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for ofed disabled" >&5
+$as_echo "$as_me: WARNING: support for ofed disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ofed installation" >&5
 $as_echo_n "checking for ofed installation... " >&6; }
 if ${x_ac_cv_ofed_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_ofed_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include/infiniband" || continue
-        test -f "$d/include/infiniband/mad.h" || continue
-        for bit in $_x_ac_ofed_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_ofed_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
-          _x_ac_ofed_libs_save="$LIBS"
-          LIBS="-L$d/$bit -libmad -libumad $LIBS"
-	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_ofed_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include/infiniband" || continue
+          test -f "$d/include/infiniband/mad.h" || continue
+          for bit in $_x_ac_ofed_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_ofed_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_ofed_libs_save="$LIBS"
+            LIBS="-L$d/$bit -libmad -libumad $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -20334,7 +20963,7 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -20360,40 +20989,41 @@ $as_echo "Using old libmad" >&6; }
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          CPPFLAGS="$_x_ac_ofed_cppflags_save"
-          LIBS="$_x_ac_ofed_libs_save"
+            CPPFLAGS="$_x_ac_ofed_cppflags_save"
+            LIBS="$_x_ac_ofed_libs_save"
+            test -n "$x_ac_cv_ofed_dir" && break
+          done
           test -n "$x_ac_cv_ofed_dir" && break
         done
-        test -n "$x_ac_cv_ofed_dir" && break
-      done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_ofed_dir" >&5
 $as_echo "$x_ac_cv_ofed_dir" >&6; }
 
-  if test -z "$x_ac_cv_ofed_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate ofed installation" >&5
+    if test -z "$x_ac_cv_ofed_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate ofed installation" >&5
 $as_echo "$as_me: WARNING: unable to locate ofed installation" >&2;}
-  else
-    OFED_CPPFLAGS="-I$x_ac_cv_ofed_dir/include/infiniband"
-    if test "$ac_with_rpath" = "yes"; then
-      OFED_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_ofed_dir/$bit -L$x_ac_cv_ofed_dir/$bit"
     else
-      OFED_LDFLAGS="-L$x_ac_cv_ofed_dir/$bit"
-    fi
-    OFED_LIBS="-libmad -libumad"
+      OFED_CPPFLAGS="-I$x_ac_cv_ofed_dir/include/infiniband"
+      if test "$ac_with_rpath" = "yes"; then
+        OFED_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_ofed_dir/$bit -L$x_ac_cv_ofed_dir/$bit"
+      else
+        OFED_LDFLAGS="-L$x_ac_cv_ofed_dir/$bit"
+      fi
+      OFED_LIBS="-libmad -libumad"
 
 $as_echo "#define HAVE_OFED 1" >>confdefs.h
 
-    if test ! -z "$have_pma_query_via" ; then
+      if test ! -z "$have_pma_query_via" ; then
 
 $as_echo "#define HAVE_OFED_PMA_QUERY_VIA 1" >>confdefs.h
 
+      fi
     fi
-  fi
 
 
 
+  fi
 
    if test -n "$x_ac_cv_ofed_dir"; then
   BUILD_OFED_TRUE=
@@ -20411,7 +21041,6 @@ fi
 
 
 
-
 if   test "" = ""        ; then
     : # Recognized value
 elif test "" = "serial"  ; then
@@ -20732,6 +21361,287 @@ fi
 $as_echo "#define H5_NO_DEPRECATED_SYMBOLS 1" >>confdefs.h
 
 
+#
+# Handle user hints
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if zlib is wanted" >&5
+$as_echo_n "checking if zlib is wanted... " >&6; }
+zlib_places="/usr/local /usr /opt/local /sw"
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib; if test "$withval" != no ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  if test -d "$withval"
+  then
+    zlib_places="$withval $zlib_places"
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Sorry, $withval does not exist, checking usual places" >&5
+$as_echo "$as_me: WARNING: Sorry, $withval does not exist, checking usual places" >&2;}
+  fi
+else
+  zlib_places=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+
+
+#
+# Locate zlib, if wanted
+#
+if test -n "${zlib_places}"
+then
+  # check the user supplied or any other more or less 'standard' place:
+  #   Most UNIX systems      : /usr/local and /usr
+  #   MacPorts / Fink on OSX : /opt/local respectively /sw
+  for ZLIB_HOME in ${zlib_places} ; do
+    if test -f "${ZLIB_HOME}/include/zlib.h"; then break; fi
+    ZLIB_HOME=""
+  done
+
+  ZLIB_OLD_LDFLAGS=$LDFLAGS
+  ZLIB_OLD_CPPFLAGS=$CPPFLAGS
+  if test -n "${ZLIB_HOME}"; then
+        LDFLAGS="$LDFLAGS -L${ZLIB_HOME}/lib"
+        CPPFLAGS="$CPPFLAGS -I${ZLIB_HOME}/include"
+  fi
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflateEnd in -lz" >&5
+$as_echo_n "checking for inflateEnd in -lz... " >&6; }
+if ${ac_cv_lib_z_inflateEnd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char inflateEnd ();
+int
+main ()
+{
+return inflateEnd ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_inflateEnd=yes
+else
+  ac_cv_lib_z_inflateEnd=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflateEnd" >&5
+$as_echo "$ac_cv_lib_z_inflateEnd" >&6; }
+if test "x$ac_cv_lib_z_inflateEnd" = xyes; then :
+  zlib_cv_libz=yes
+else
+  zlib_cv_libz=no
+fi
+
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  zlib_cv_zlib_h=yes
+else
+  zlib_cv_zlib_h=no
+fi
+
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+  # Restore variables
+  LDFLAGS="$ZLIB_OLD_LDFLAGS"
+  CPPFLAGS="$ZLIB_OLD_CPPFLAGS"
+
+  if test "$zlib_cv_libz" = "yes" && test "$zlib_cv_zlib_h" = "yes"
+  then
+    #
+    # If both library and header were found, action-if-found
+    #
+
+		ZLIB_CPPFLAGS="-I${ZLIB_HOME}/include"
+                ZLIB_LDFLAGS="-L${ZLIB_HOME}/lib"
+		ZLIB_LIBS="-lz"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+
+  fi
+fi
+
+
+
+
+
+#
+# Handle user hints
+#
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if lz4 is installed" >&5
+$as_echo_n "checking if lz4 is installed... " >&6; }
+lz4_places="/usr/local /usr /opt/local /sw"
+
+# Check whether --with-lz4 was given.
+if test "${with_lz4+set}" = set; then :
+  withval=$with_lz4; if test "$withval" != no ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  if test -d "$withval"
+  then
+    lz4_places="$withval $lz4_places"
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $withval does not exist, checking usual places" >&5
+$as_echo "$as_me: WARNING: $withval does not exist, checking usual places" >&2;}
+  fi
+else
+  lz4_places=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ${lz4_places}" >&5
+$as_echo "yes ${lz4_places}" >&6; }
+fi
+
+
+#
+# Locate lz4, if installed
+#
+if test -n "${lz4_places}"
+then
+  # check the user supplied or any other more or less 'standard' place:
+  #   Most UNIX systems      : /usr/local and /usr
+  #   MacPorts / Fink on OSX : /opt/local respectively /sw
+  for LZ4_HOME in ${lz4_places} ; do
+    if test -f "${LZ4_HOME}/include/lz4.h"; then break; fi
+    LZ4_HOME=""
+  done
+
+  LZ4_OLD_LDFLAGS=$LDFLAGS
+  LZ4_OLD_CPPFLAGS=$CPPFLAGS
+  if test -n "${LZ4_HOME}"; then
+      LZ4_CPPFLAGS="-I${LZ4_HOME}/include"
+      LZ4_LDFLAGS="-L${LZ4_HOME}/lib"
+      LZ4_LIBS="-llz4"
+
+      LDFLAGS="$LDFLAGS -L${LZ4_LDFLAGS}"
+      CPPFLAGS="$CPPFLAGS -I${LZ4_CPPFLAGS}"
+  fi
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LZ4_compress_destSize in -llz4" >&5
+$as_echo_n "checking for LZ4_compress_destSize in -llz4... " >&6; }
+if ${ac_cv_lib_lz4_LZ4_compress_destSize+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llz4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char LZ4_compress_destSize ();
+int
+main ()
+{
+return LZ4_compress_destSize ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lz4_LZ4_compress_destSize=yes
+else
+  ac_cv_lib_lz4_LZ4_compress_destSize=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lz4_LZ4_compress_destSize" >&5
+$as_echo "$ac_cv_lib_lz4_LZ4_compress_destSize" >&6; }
+if test "x$ac_cv_lib_lz4_LZ4_compress_destSize" = xyes; then :
+  ac_cv_lz4=yes
+else
+  ac_cv_lz4=no
+fi
+
+  ac_fn_c_check_header_mongrel "$LINENO" "lz4.h" "ac_cv_header_lz4_h" "$ac_includes_default"
+if test "x$ac_cv_header_lz4_h" = xyes; then :
+  ac_cv_lz4_h=yes
+else
+  ac_cv_lz4_h=no
+fi
+
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+  # Restore variables
+  LDFLAGS="$LZ4_OLD_LDFLAGS"
+  CPPFLAGS="$LZ4_OLD_CPPFLAGS"
+
+  if test "$ac_cv_lz4" = "yes" && test "$ac_cv_lz4_h" = "yes"
+  then
+      #
+      # If both library and header were found, action-if-found
+      #
+
+
+
+
+$as_echo "#define HAVE_LZ4 1" >>confdefs.h
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: LZ4 test program built properly." >&5
+$as_echo "LZ4 test program built properly." >&6; }
+  else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: LZ4 test program build failed." >&5
+$as_echo "$as_me: WARNING: LZ4 test program build failed." >&2;}
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate LZ4 install." >&5
+$as_echo "$as_me: WARNING: unable to locate LZ4 install." >&2;}
+fi
+
+
 
   _x_ac_hwloc_dirs="/usr /usr/local"
   _x_ac_hwloc_libs="lib64 lib"
@@ -20740,27 +21650,33 @@ $as_echo "#define H5_NO_DEPRECATED_SYMBOLS 1" >>confdefs.h
 
 # Check whether --with-hwloc was given.
 if test "${with_hwloc+set}" = set; then :
-  withval=$with_hwloc; _x_ac_hwloc_dirs="$withval $_x_ac_hwloc_dirs"
+  withval=$with_hwloc; if test "x$with_hwloc" != xno; then :
+  _x_ac_hwloc_dirs="$with_hwloc $_x_ac_hwloc_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hwloc installation" >&5
+  if test "x$with_hwloc" = xno; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for hwloc disabled" >&5
+$as_echo "$as_me: WARNING: support for hwloc disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hwloc installation" >&5
 $as_echo_n "checking for hwloc installation... " >&6; }
 if ${x_ac_cv_hwloc_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_hwloc_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/hwloc.h" || continue
-	for bit in $_x_ac_hwloc_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_hwloc_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
- 	  _x_ac_hwloc_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lhwloc $LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_hwloc_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/hwloc.h" || continue
+          for bit in $_x_ac_hwloc_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_hwloc_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_hwloc_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lhwloc $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -20783,7 +21699,7 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <hwloc.h>
 int
@@ -20799,41 +21715,184 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          CPPFLAGS="$_x_ac_hwloc_cppflags_save"
-          LIBS="$_x_ac_hwloc_libs_save"
+            CPPFLAGS="$_x_ac_hwloc_cppflags_save"
+            LIBS="$_x_ac_hwloc_libs_save"
+            test -n "$x_ac_cv_hwloc_dir" && break
+          done
           test -n "$x_ac_cv_hwloc_dir" && break
-	done
-        test -n "$x_ac_cv_hwloc_dir" && break
-      done
+        done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_hwloc_dir" >&5
 $as_echo "$x_ac_cv_hwloc_dir" >&6; }
 
-  if test -z "$x_ac_cv_hwloc_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate hwloc installation" >&5
+    if test -z "$x_ac_cv_hwloc_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate hwloc installation" >&5
 $as_echo "$as_me: WARNING: unable to locate hwloc installation" >&2;}
-  else
-    HWLOC_CPPFLAGS="-I$x_ac_cv_hwloc_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      HWLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_hwloc_dir/$bit -L$x_ac_cv_hwloc_dir/$bit"
     else
-      HWLOC_LDFLAGS="-L$x_ac_cv_hwloc_dir/$bit"
-    fi
-    HWLOC_LIBS="-lhwloc"
+      HWLOC_CPPFLAGS="-I$x_ac_cv_hwloc_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        HWLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_hwloc_dir/$bit -L$x_ac_cv_hwloc_dir/$bit"
+      else
+        HWLOC_LDFLAGS="-L$x_ac_cv_hwloc_dir/$bit"
+      fi
+      HWLOC_LIBS="-lhwloc"
 
 $as_echo "#define HAVE_HWLOC 1" >>confdefs.h
 
-    if test "$x_ac_cv_hwloc_pci" = "yes"; then
+      if test "$x_ac_cv_hwloc_pci" = "yes"; then
 
 $as_echo "#define HAVE_HWLOC_PCI 1" >>confdefs.h
 
+      fi
     fi
+
+
+
+
   fi
 
 
+  _x_ac_pmix_dirs="/usr /usr/local"
+  _x_ac_pmix_libs="lib64 lib"
 
 
+# Check whether --with-pmix was given.
+if test "${with_pmix+set}" = set; then :
+  withval=$with_pmix; if test "x$with_pmix" != xno; then :
+  _x_ac_pmix_dirs="$with_pmix $_x_ac_pmix_dirs"
+fi
+fi
+
+
+  if test "x$with_pmix" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for pmix disabled" >&5
+$as_echo "$as_me: WARNING: support for pmix disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pmix installation" >&5
+$as_echo_n "checking for pmix installation... " >&6; }
+if ${x_ac_cv_pmix_dir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+        for d in $_x_ac_pmix_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/pmix/pmix_common.h" || continue
+          test -f "$d/include/pmix_server.h" || continue
+          for d1 in $_x_ac_pmix_libs; do
+            test -d "$d/$d1" || continue
+            _x_ac_pmix_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_pmix_libs_save="$LIBS"
+            LIBS="-L$d/$d1 -lpmix $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PMIx_Get_version ();
+int
+main ()
+{
+return PMIx_Get_version ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  x_ac_cv_pmix_dir=$d
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+            CPPFLAGS="$_x_ac_pmix_cppflags_save"
+            LIBS="$_x_ac_pmix_libs_save"
+            test -n "$x_ac_cv_pmix_dir" && break
+          done
+          test -n "$x_ac_cv_pmix_dir" && break
+        done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_pmix_dir" >&5
+$as_echo "$x_ac_cv_pmix_dir" >&6; }
+
+    if test -z "$x_ac_cv_pmix_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate pmix installation" >&5
+$as_echo "$as_me: WARNING: unable to locate pmix installation" >&2;}
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pmix library directory" >&5
+$as_echo_n "checking for pmix library directory... " >&6; }
+if ${x_ac_cv_pmix_libdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+          for d1 in $_x_ac_pmix_libs; do
+            d="$x_ac_cv_pmix_dir/$d1"
+            test -d "$d" || continue
+            _x_ac_pmix_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$x_ac_cv_pmix_dir/include $CPPFLAGS"
+            _x_ac_pmix_libs_save="$LIBS"
+            LIBS="-L$d -lpmix $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PMIx_Get_version ();
+int
+main ()
+{
+return PMIx_Get_version ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  x_ac_cv_pmix_libdir=$d
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+            CPPFLAGS="$_x_ac_pmix_cppflags_save"
+            LIBS="$_x_ac_pmix_libs_save"
+            test -n "$x_ac_cv_pmix_libdir" && break
+          done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_pmix_libdir" >&5
+$as_echo "$x_ac_cv_pmix_libdir" >&6; }
+      PMIX_CPPFLAGS="-I$x_ac_cv_pmix_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        PMIX_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_pmix_libdir -L$x_ac_cv_pmix_libdir"
+      else
+        PMIX_LDFLAGS="-L$x_ac_cv_pmix_libdir"
+      fi
+      PMIX_LIBS="-lpmix"
+
+$as_echo "#define HAVE_PMIX 1" >>confdefs.h
+
+    fi
+
+
+
+
+  fi
+
+   if test -n "$x_ac_cv_pmix_dir"; then
+  HAVE_PMIX_TRUE=
+  HAVE_PMIX_FALSE='#'
+else
+  HAVE_PMIX_TRUE='#'
+  HAVE_PMIX_FALSE=
+fi
+
 
 
   _x_ac_freeipmi_dirs="/usr /usr/local"
@@ -20842,36 +21901,42 @@ $as_echo "#define HAVE_HWLOC_PCI 1" >>confdefs.h
 
 # Check whether --with-freeipmi was given.
 if test "${with_freeipmi+set}" = set; then :
-  withval=$with_freeipmi; _x_ac_freeipmi_dirs="$withval $_x_ac_freeipmi_dirs"
+  withval=$with_freeipmi; if test "x$with_freeipmi" != xno; then :
+  _x_ac_freeipmi_dirs="$with_freeipmi $_x_ac_freeipmi_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freeipmi installation" >&5
+  if test "x$with_freeipmi" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for freeipmi disabled" >&5
+$as_echo "$as_me: WARNING: support for freeipmi disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freeipmi installation" >&5
 $as_echo_n "checking for freeipmi installation... " >&6; }
 if ${x_ac_cv_freeipmi_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_freeipmi_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/ipmi_monitoring.h" || continue
-	for bit in $_x_ac_freeipmi_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_freeipmi_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
- 	  _x_ac_freeipmi_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lipmimonitoring $LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_freeipmi_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/ipmi_monitoring.h" || continue
+          for bit in $_x_ac_freeipmi_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_freeipmi_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_freeipmi_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lipmimonitoring $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ipmi_monitoring.h>
-#include <ipmi_monitoring_bitmasks.h>
+              #include <ipmi_monitoring_bitmasks.h>
 int
 main ()
 {
 int err;
-unsigned int flag = 0;
-return ipmi_monitoring_init (flag, &err);
+              unsigned int flag = 0;
+              return ipmi_monitoring_init (flag, &err);
   ;
   return 0;
 }
@@ -20881,35 +21946,37 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          CPPFLAGS="$_x_ac_freeipmi_cppflags_save"
-          LIBS="$_x_ac_freeipmi_libs_save"
+            CPPFLAGS="$_x_ac_freeipmi_cppflags_save"
+            LIBS="$_x_ac_freeipmi_libs_save"
+            test -n "$x_ac_cv_freeipmi_dir" && break
+          done
           test -n "$x_ac_cv_freeipmi_dir" && break
-	done
-        test -n "$x_ac_cv_freeipmi_dir" && break
-      done
+        done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_freeipmi_dir" >&5
 $as_echo "$x_ac_cv_freeipmi_dir" >&6; }
 
-  if test -z "$x_ac_cv_freeipmi_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate freeipmi installation" >&5
+    if test -z "$x_ac_cv_freeipmi_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate freeipmi installation" >&5
 $as_echo "$as_me: WARNING: unable to locate freeipmi installation" >&2;}
-  else
-    FREEIPMI_CPPFLAGS="-I$x_ac_cv_freeipmi_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      FREEIPMI_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_freeipmi_dir/$bit -L$x_ac_cv_freeipmi_dir/$bit"
     else
-      FREEIPMI_LDFLAGS="-L$x_ac_cv_freeipmi_dir/$bit"
-    fi
-    FREEIPMI_LIBS="-lipmimonitoring"
+      FREEIPMI_CPPFLAGS="-I$x_ac_cv_freeipmi_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        FREEIPMI_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_freeipmi_dir/$bit -L$x_ac_cv_freeipmi_dir/$bit"
+      else
+        FREEIPMI_LDFLAGS="-L$x_ac_cv_freeipmi_dir/$bit"
+      fi
+      FREEIPMI_LIBS="-lipmimonitoring"
 
 $as_echo "#define HAVE_FREEIPMI 1" >>confdefs.h
 
-  fi
+    fi
+
 
 
 
+  fi
 
    if test -n "$x_ac_cv_freeipmi_dir"; then
   BUILD_IPMI_TRUE=
@@ -20921,7 +21988,6 @@ fi
 
 
 
-
   SEMAPHORE_SOURCES=""
   SEMAPHORE_LIBS=""
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sem_open in -lposix4" >&5
@@ -20980,16 +22046,17 @@ fi
 
 # Check whether --with-rrdtool was given.
 if test "${with_rrdtool+set}" = set; then :
-  withval=$with_rrdtool; _x_ac_rrdtool_dirs="$withval $_x_ac_rrdtool_dirs"
-else
-  with_rrdtool=check
+  withval=$with_rrdtool; if test "x$with_rrdtool" != xno; then :
+  _x_ac_rrdtool_dirs="$with_rrdtool $_x_ac_rrdtool_dirs"
+fi
 fi
 
 
-#  echo with rrdtool $with_rrdtool
-#  echo without rrdtool $without_rrdtool
-  if test "x$with_rrdtool" != "xno"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrdtool installation" >&5
+  if test "x$with_rrdtool" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for rrdtool disabled" >&5
+$as_echo "$as_me: WARNING: support for rrdtool disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rrdtool installation" >&5
 $as_echo_n "checking for rrdtool installation... " >&6; }
 if ${x_ac_cv_rrdtool_dir+:} false; then :
   $as_echo_n "(cached) " >&6
@@ -21032,25 +22099,25 @@ fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_rrdtool_dir" >&5
 $as_echo "$x_ac_cv_rrdtool_dir" >&6; }
 
-fi
-
-#  echo x_ac_cv_rrdtool_dir $x_ac_cv_rrdtool_dir
-  if test -z "$x_ac_cv_rrdtool_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate rrdtool installation" >&5
+    # echo x_ac_cv_rrdtool_dir $x_ac_cv_rrdtool_dir
+    if test -z "$x_ac_cv_rrdtool_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate rrdtool installation" >&5
 $as_echo "$as_me: WARNING: unable to locate rrdtool installation" >&2;}
-  else
-    RRDTOOL_CPPFLAGS="-I$x_ac_cv_rrdtool_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      RRDTOOL_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_rrdtool_dir/$bit -L$x_ac_cv_rrdtool_dir/$bit"
     else
-      RRDTOOL_LDFLAGS="-L$x_ac_cv_rrdtool_dir/$bit"
+      RRDTOOL_CPPFLAGS="-I$x_ac_cv_rrdtool_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        RRDTOOL_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_rrdtool_dir/$bit -L$x_ac_cv_rrdtool_dir/$bit"
+      else
+        RRDTOOL_LDFLAGS="-L$x_ac_cv_rrdtool_dir/$bit"
+      fi
+      RRDTOOL_LIBS="-lrrd"
     fi
-    RRDTOOL_LIBS="-lrrd"
-  fi
 
 
 
 
+  fi
+
    if test -n "$x_ac_cv_rrdtool_dir"; then
   BUILD_RRD_TRUE=
   BUILD_RRD_FALSE='#'
@@ -21719,8 +22786,18 @@ fi
 
   no_gtk=""
 
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
+
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+	if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
 if ${ac_cv_path_PKG_CONFIG+:} false; then :
@@ -21746,7 +22823,6 @@ done
   done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
   ;;
 esac
 fi
@@ -21760,18 +22836,77 @@ $as_echo "no" >&6; }
 fi
 
 
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-  if test x$PKG_CONFIG != xno ; then
-    if pkg-config --atleast-pkgconfig-version 0.7 ; then
-      :
-    else
-      echo "*** pkg-config too old; version 0.7 or better required."
-      no_gtk=yes
-      PKG_CONFIG=no
-    fi
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
   else
-    no_gtk=yes
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
   fi
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+	_pkg_min_version=0.7
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+	else
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+		PKG_CONFIG=""
+	fi
+fi
 
   min_gtk_version=2.7.1
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK+ - version >= $min_gtk_version" >&5
@@ -22148,8 +23283,8 @@ rm -f core conftest.err conftest.$ac_objext \
 			CFLAGS="$save_CFLAGS"
 			LIBS="$save_LIBS"
 			if test "$ac_have_mysql" = yes; then
-				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: MySQL test program built properly." >&5
-$as_echo "MySQL test program built properly." >&6; }
+				{ $as_echo "$as_me:${as_lineno-$LINENO}: result: MySQL $mysql_config_major_version.$mysql_config_minor_version.$mysql_config_micro_version test program built properly." >&5
+$as_echo "MySQL $mysql_config_major_version.$mysql_config_minor_version.$mysql_config_micro_version test program built properly." >&6; }
 
 
 
@@ -22300,6 +23435,14 @@ $as_echo "#define HAVE_ALPS_CRAY_EMULATION 1" >>confdefs.h
 
     _x_ac_cray_dirs="/opt/cray"
 
+# Check whether --with-cray_dir was given.
+if test "${with_cray_dir+set}" = set; then :
+  withval=$with_cray_dir; if test "x$with_cray_dir" != xno; then :
+  _x_ac_cray_dirs="$with_cray_dir $_x_ac_cray_dirs"
+fi
+fi
+
+
     for d in $_x_ac_cray_dirs; do
       test -d "$d" || continue
 
@@ -23288,35 +24431,41 @@ fi
 
 # Check whether --with-netloc was given.
 if test "${with_netloc+set}" = set; then :
-  withval=$with_netloc; _x_ac_netloc_dirs="$withval $_x_ac_netloc_dirs"
+  withval=$with_netloc; if test "x$with_netloc" != xno; then :
+  _x_ac_netloc_dirs="$with_netloc $_x_ac_netloc_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netloc installation" >&5
+  if test "x$with_netloc" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for netloc disabled" >&5
+$as_echo "$as_me: WARNING: support for netloc disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netloc installation" >&5
 $as_echo_n "checking for netloc installation... " >&6; }
 if ${x_ac_cv_netloc_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_netloc_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/netloc.h" || continue
-        for bit in $_x_ac_netloc_libs; do
-          test -d "$d/$bit" || continue
-          _x_ac_netloc_cppflags_save="$CPPFLAGS"
-          CPPFLAGS="-I$d/include $CPPFLAGS"
-          _x_ac_netloc_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lnetloc $LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_netloc_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/netloc.h" || continue
+          for bit in $_x_ac_netloc_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_netloc_cppflags_save="$CPPFLAGS"
+            CPPFLAGS="-I$d/include $CPPFLAGS"
+            _x_ac_netloc_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lnetloc $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netloc.h>
-                              #include <netloc/map.h>
+                                #include <netloc/map.h>
 int
 main ()
 {
 netloc_map_t map;
-                              netloc_map_create(&map);
+                                netloc_map_create(&map);
   ;
   return 0;
 }
@@ -23326,56 +24475,61 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <netloc.h>
-                              #include <netloc_map.h>
+                                #include <netloc_map.h>
 int
 main ()
 {
 netloc_map_t map;
-                              netloc_map_create(&map)
+                                netloc_map_create(&map)
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   x_ac_cv_netloc_dir=$d
-            x_ac_cv_netloc_nosub="yes"
+              x_ac_cv_netloc_nosub="yes"
 
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          CPPFLAGS="$_x_ac_netloc_cppflags_save"
-          LIBS="$_x_ac_netloc_libs_save"
+            CPPFLAGS="$_x_ac_netloc_cppflags_save"
+            LIBS="$_x_ac_netloc_libs_save"
+            test -n "$x_ac_cv_netloc_dir" && break
+          done
           test -n "$x_ac_cv_netloc_dir" && break
         done
-        test -n "$x_ac_cv_netloc_dir" && break
-      done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_netloc_dir" >&5
 $as_echo "$x_ac_cv_netloc_dir" >&6; }
 
-  if test -z "$x_ac_cv_netloc_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate netloc installation" >&5
+    if test -z "$x_ac_cv_netloc_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate netloc installation" >&5
 $as_echo "$as_me: WARNING: unable to locate netloc installation" >&2;}
-  else
-    NETLOC_CPPFLAGS="-I$x_ac_cv_netloc_dir/include"
-    if test "$ac_with_rpath" = "yes"; then
-      NETLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_netloc_dir/$bit -L$x_ac_cv_netloc_dir/$bit"
     else
-      NETLOC_LDFLAGS="-L$x_ac_cv_netloc_dir/$bit"
-    fi
-    NETLOC_LIBS="-lnetloc"
+      NETLOC_CPPFLAGS="-I$x_ac_cv_netloc_dir/include"
+      if test "$ac_with_rpath" = "yes"; then
+        NETLOC_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_netloc_dir/$bit -L$x_ac_cv_netloc_dir/$bit"
+      else
+        NETLOC_LDFLAGS="-L$x_ac_cv_netloc_dir/$bit"
+      fi
+      NETLOC_LIBS="-lnetloc"
 
 $as_echo "#define HAVE_NETLOC 1" >>confdefs.h
 
-    if test "$x_ac_cv_netloc_nosub" = "yes"; then
+      if test "$x_ac_cv_netloc_nosub" = "yes"; then
 
 $as_echo "#define HAVE_NETLOC_NOSUB 1" >>confdefs.h
 
+      fi
     fi
+
+
+
+
   fi
 
    if test -n "$x_ac_cv_netloc_dir"; then
@@ -23389,9 +24543,6 @@ fi
 
 
 
-
-
-
 	x_ac_lua_pkg_name="lua"
 	#check for 5.2 if that fails check for 5.1
 	if test -n "$PKG_CONFIG" && \
@@ -23926,26 +25077,31 @@ fi
 
 # Check whether --with-munge was given.
 if test "${with_munge+set}" = set; then :
-  withval=$with_munge; _x_ac_munge_dirs="$withval $_x_ac_munge_dirs"
+  withval=$with_munge; if test "x$with_munge" != xno; then :
+  _x_ac_munge_dirs="$with_munge $_x_ac_munge_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for munge installation" >&5
+  if test "x$with_munge" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for munge disabled" >&5
+$as_echo "$as_me: WARNING: support for munge disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for munge installation" >&5
 $as_echo_n "checking for munge installation... " >&6; }
 if ${x_ac_cv_munge_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_munge_dirs; do
-        test -d "$d" || continue
-        test -d "$d/include" || continue
-        test -f "$d/include/munge.h" || continue
-	for bit in $_x_ac_munge_libs; do
-          test -d "$d/$bit" || continue
-
- 	  _x_ac_munge_libs_save="$LIBS"
-          LIBS="-L$d/$bit -lmunge $LIBS"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_munge_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/munge.h" || continue
+          for bit in $_x_ac_munge_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_munge_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lmunge $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -23968,34 +25124,35 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-          LIBS="$_x_ac_munge_libs_save"
+            LIBS="$_x_ac_munge_libs_save"
+            test -n "$x_ac_cv_munge_dir" && break
+          done
           test -n "$x_ac_cv_munge_dir" && break
-	done
-        test -n "$x_ac_cv_munge_dir" && break
-      done
+        done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_munge_dir" >&5
 $as_echo "$x_ac_cv_munge_dir" >&6; }
 
-  if test -z "$x_ac_cv_munge_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate munge installation" >&5
+    if test -z "$x_ac_cv_munge_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate munge installation" >&5
 $as_echo "$as_me: WARNING: unable to locate munge installation" >&2;}
-  else
-    MUNGE_LIBS="-lmunge"
-    MUNGE_CPPFLAGS="-I$x_ac_cv_munge_dir/include"
-    MUNGE_DIR="$x_ac_cv_munge_dir"
-    if test "$ac_with_rpath" = "yes"; then
-      MUNGE_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_munge_dir/$bit -L$x_ac_cv_munge_dir/$bit"
     else
-      MUNGE_LDFLAGS="-L$x_ac_cv_munge_dir/$bit"
+      MUNGE_LIBS="-lmunge"
+      MUNGE_CPPFLAGS="-I$x_ac_cv_munge_dir/include"
+      MUNGE_DIR="$x_ac_cv_munge_dir"
+      if test "$ac_with_rpath" = "yes"; then
+        MUNGE_LDFLAGS="-Wl,-rpath -Wl,$x_ac_cv_munge_dir/$bit -L$x_ac_cv_munge_dir/$bit"
+      else
+        MUNGE_LDFLAGS="-L$x_ac_cv_munge_dir/$bit"
+      fi
     fi
-  fi
 
 
 
 
 
+  fi
 
    if test -n "$x_ac_cv_munge_dir"; then
   WITH_MUNGE_TRUE=
@@ -24031,63 +25188,10 @@ $as_echo "no" >&6; }
 fi
 
 
-AUTHD_LIBS="-lauth -le"
 savedLIBS="$LIBS"
 savedCFLAGS="$CFLAGS"
-LIBS="$SSL_LIBS $AUTHD_LIBS $LIBS"
+LIBS="$SSL_LIBS $LIBS"
 CFLAGS="$SSL_CPPFLAGS $CFLAGS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for auth_init_credentials in -lauth" >&5
-$as_echo_n "checking for auth_init_credentials in -lauth... " >&6; }
-if ${ac_cv_lib_auth_auth_init_credentials+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lauth  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char auth_init_credentials ();
-int
-main ()
-{
-return auth_init_credentials ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_auth_auth_init_credentials=yes
-else
-  ac_cv_lib_auth_auth_init_credentials=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_auth_auth_init_credentials" >&5
-$as_echo "$ac_cv_lib_auth_auth_init_credentials" >&6; }
-if test "x$ac_cv_lib_auth_auth_init_credentials" = xyes; then :
-  have_authd=yes
-else
-  have_authd=no
-fi
-
-
-
- if test "x$have_authd" = "xyes"; then
-  WITH_AUTHD_TRUE=
-  WITH_AUTHD_FALSE='#'
-else
-  WITH_AUTHD_TRUE='#'
-  WITH_AUTHD_FALSE=
-fi
-
 LIBS="$savedLIBS"
 CFLAGS="$savedCFLAGS"
 
@@ -24144,26 +25248,31 @@ LIBS="$savedLIBS"
 
 # Check whether --with-blcr was given.
 if test "${with_blcr+set}" = set; then :
-  withval=$with_blcr; _x_ac_blcr_dirs="$withval $_x_ac_blcr_dirs"
+  withval=$with_blcr; if test "x$with_blcr" != xno; then :
+  _x_ac_blcr_dirs="$with_blcr $_x_ac_blcr_dirs"
+fi
 fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blcr installation" >&5
+  if test "x$with_blcr" = xno; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: support for blcr disabled" >&5
+$as_echo "$as_me: WARNING: support for blcr disabled" >&2;}
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blcr installation" >&5
 $as_echo_n "checking for blcr installation... " >&6; }
 if ${x_ac_cv_blcr_dir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
 
-      for d in $_x_ac_blcr_dirs; do
-	test -d "$d" || continue
-	test -d "$d/include" || continue
-	test -f "$d/include/libcr.h" || continue
-	for bit in $_x_ac_blcr_libs; do
-	  test -d "$d/$bit" || continue
-
- 	  _x_ac_blcr_libs_save="$LIBS"
-	  LIBS="-L$d/$bit -lcr $LIBS"
-	  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        for d in $_x_ac_blcr_dirs; do
+          test -d "$d" || continue
+          test -d "$d/include" || continue
+          test -f "$d/include/libcr.h" || continue
+          for bit in $_x_ac_blcr_libs; do
+            test -d "$d/$bit" || continue
+            _x_ac_blcr_libs_save="$LIBS"
+            LIBS="-L$d/$bit -lcr $LIBS"
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 /* Override any GCC internal prototype to avoid an error.
@@ -24186,25 +25295,25 @@ if ac_fn_c_try_link "$LINENO"; then :
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-	  LIBS="$_x_ac_blcr_libs_save"
-	  test -n "$x_ac_cv_blcr_dir" && break
-	done
-	test -n "$x_ac_cv_blcr_dir" && break
-      done
+            LIBS="$_x_ac_blcr_libs_save"
+            test -n "$x_ac_cv_blcr_dir" && break
+          done
+          test -n "$x_ac_cv_blcr_dir" && break
+        done
 
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $x_ac_cv_blcr_dir" >&5
 $as_echo "$x_ac_cv_blcr_dir" >&6; }
 
-  if test -z "$x_ac_cv_blcr_dir"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate blcr installation" >&5
+    if test -z "$x_ac_cv_blcr_dir"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate blcr installation" >&5
 $as_echo "$as_me: WARNING: unable to locate blcr installation" >&2;}
-  else
-    BLCR_HOME="$x_ac_cv_blcr_dir"
-    BLCR_LIBS="-lcr"
-    BLCR_CPPFLAGS="-I$x_ac_cv_blcr_dir/include"
-    BLCR_LDFLAGS="-L$x_ac_cv_blcr_dir/$bit"
-  fi
+    else
+      BLCR_HOME="$x_ac_cv_blcr_dir"
+      BLCR_LIBS="-lcr"
+      BLCR_CPPFLAGS="-I$x_ac_cv_blcr_dir/include"
+      BLCR_LDFLAGS="-L$x_ac_cv_blcr_dir/$bit"
+    fi
 
 
 cat >>confdefs.h <<_ACEOF
@@ -24215,7 +25324,7 @@ _ACEOF
 
 
 
-
+  fi
 
    if test -n "$x_ac_cv_blcr_dir"; then
   WITH_BLCR_TRUE=
@@ -24635,7 +25744,7 @@ fi
 
 
 
-ac_config_files="$ac_config_files Makefile config.xml auxdir/Makefile contribs/Makefile contribs/cray/Makefile contribs/cray/csm/Makefile contribs/lua/Makefile contribs/mic/Makefile contribs/pam/Makefile contribs/pam_slurm_adopt/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm/Makefile contribs/perlapi/libslurm/perl/Makefile.PL contribs/perlapi/libslurmdb/Makefile contribs/perlapi/libslurmdb/perl/Makefile.PL contribs/torque/Makefile contribs/phpext/Makefile contribs/phpext/slurm_php/config.m4 contribs/sgather/Makefile contribs/sgi/Makefile contribs/sjobexit/Makefile contribs/slurmdb-direct/Makefile contribs/pmi2/Makefile doc/Makefile doc/man/Makefile doc/man/man1/Makefile doc/man/man3/Makefile doc/man/man5/Makefile doc/man/man8/Makefile doc/html/Makefile doc/html/configurator.html doc/html/configurator.easy.html etc/cgroup.release_common.example etc/init.d.slurm etc/init.d.slurmdbd etc/slurmctld.service etc/slurmd.service etc/slurmdbd.service src/Makefile src/api/Makefile src/common/Makefile src/db_api/Makefile src/layouts/Makefile src/layouts/power/Makefile src/layouts/unit/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/salloc/Makefile src/sbatch/Makefile src/sbcast/Makefile src/sattach/Makefile src/scancel/Makefile src/scontrol/Makefile src/sdiag/Makefile src/sinfo/Makefile src/slurmctld/Makefile src/slurmd/Makefile src/slurmd/common/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmdbd/Makefile src/smap/Makefile src/smd/Makefile src/sprio/Makefile src/squeue/Makefile src/srun/Makefile src/srun/libsrun/Makefile src/srun_cr/Makefile src/sshare/Makefile src/sstat/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/accounting_storage/Makefile src/plugins/accounting_storage/common/Makefile src/plugins/accounting_storage/filetxt/Makefile src/plugins/accounting_storage/mysql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/acct_gather_energy/Makefile src/plugins/acct_gather_energy/cray/Makefile src/plugins/acct_gather_energy/rapl/Makefile src/plugins/acct_gather_energy/ibmaem/Makefile src/plugins/acct_gather_energy/ipmi/Makefile src/plugins/acct_gather_energy/none/Makefile src/plugins/acct_gather_infiniband/Makefile src/plugins/acct_gather_infiniband/ofed/Makefile src/plugins/acct_gather_infiniband/none/Makefile src/plugins/acct_gather_filesystem/Makefile src/plugins/acct_gather_filesystem/lustre/Makefile src/plugins/acct_gather_filesystem/none/Makefile src/plugins/acct_gather_profile/Makefile src/plugins/acct_gather_profile/hdf5/Makefile src/plugins/acct_gather_profile/hdf5/sh5util/Makefile src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile src/plugins/acct_gather_profile/none/Makefile src/plugins/auth/Makefile src/plugins/auth/authd/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/burst_buffer/Makefile src/plugins/burst_buffer/common/Makefile src/plugins/burst_buffer/cray/Makefile src/plugins/burst_buffer/generic/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/poe/Makefile src/plugins/core_spec/Makefile src/plugins/core_spec/cray/Makefile src/plugins/core_spec/none/Makefile src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/ext_sensors/Makefile src/plugins/ext_sensors/rrd/Makefile src/plugins/ext_sensors/none/Makefile src/plugins/gres/Makefile src/plugins/gres/gpu/Makefile src/plugins/gres/nic/Makefile src/plugins/gres/mic/Makefile src/plugins/jobacct_gather/Makefile src/plugins/jobacct_gather/common/Makefile src/plugins/jobacct_gather/linux/Makefile src/plugins/jobacct_gather/aix/Makefile src/plugins/jobacct_gather/cgroup/Makefile src/plugins/jobacct_gather/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/elasticsearch/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/job_container/Makefile src/plugins/job_container/cncu/Makefile src/plugins/job_container/none/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/all_partitions/Makefile src/plugins/job_submit/cnode/Makefile src/plugins/job_submit/cray/Makefile src/plugins/job_submit/defaults/Makefile src/plugins/job_submit/logging/Makefile src/plugins/job_submit/lua/Makefile src/plugins/job_submit/partition/Makefile src/plugins/job_submit/pbs/Makefile src/plugins/job_submit/require_timelimit/Makefile src/plugins/job_submit/throttle/Makefile src/plugins/launch/Makefile src/plugins/launch/aprun/Makefile src/plugins/launch/poe/Makefile src/plugins/launch/runjob/Makefile src/plugins/launch/slurm/Makefile src/plugins/power/Makefile src/plugins/power/common/Makefile src/plugins/power/cray/Makefile src/plugins/power/none/Makefile src/plugins/preempt/Makefile src/plugins/preempt/job_prio/Makefile src/plugins/preempt/none/Makefile src/plugins/preempt/partition_prio/Makefile src/plugins/preempt/qos/Makefile src/plugins/priority/Makefile src/plugins/priority/basic/Makefile src/plugins/priority/multifactor/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/cray/Makefile src/plugins/proctrack/cgroup/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/lua/Makefile src/plugins/route/Makefile src/plugins/route/default/Makefile src/plugins/route/topology/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/alps/Makefile src/plugins/select/alps/libalps/Makefile src/plugins/select/alps/libemulate/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/ba/Makefile src/plugins/select/bluegene/ba_bgq/Makefile src/plugins/select/bluegene/bl/Makefile src/plugins/select/bluegene/bl_bgq/Makefile src/plugins/select/bluegene/sfree/Makefile src/plugins/select/cons_res/Makefile src/plugins/select/cray/Makefile src/plugins/select/linear/Makefile src/plugins/select/other/Makefile src/plugins/select/serial/Makefile src/plugins/slurmctld/Makefile src/plugins/slurmctld/nonstop/Makefile src/plugins/slurmd/Makefile src/plugins/switch/Makefile src/plugins/switch/cray/Makefile src/plugins/switch/generic/Makefile src/plugins/switch/none/Makefile src/plugins/switch/nrt/Makefile src/plugins/switch/nrt/libpermapi/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/mpi/pmi2/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/cgroup/Makefile src/plugins/task/cray/Makefile src/plugins/task/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/hypercube/Makefile src/plugins/topology/node_rank/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/Makefile testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile testsuite/slurm_unit/common/Makefile"
+ac_config_files="$ac_config_files Makefile auxdir/Makefile contribs/Makefile contribs/cray/Makefile contribs/cray/csm/Makefile contribs/lua/Makefile contribs/mic/Makefile contribs/pam/Makefile contribs/pam_slurm_adopt/Makefile contribs/perlapi/Makefile contribs/perlapi/libslurm/Makefile contribs/perlapi/libslurm/perl/Makefile.PL contribs/perlapi/libslurmdb/Makefile contribs/perlapi/libslurmdb/perl/Makefile.PL contribs/seff/Makefile contribs/torque/Makefile contribs/openlava/Makefile contribs/phpext/Makefile contribs/phpext/slurm_php/config.m4 contribs/sgather/Makefile contribs/sgi/Makefile contribs/sjobexit/Makefile contribs/slurmdb-direct/Makefile contribs/pmi2/Makefile doc/Makefile doc/man/Makefile doc/man/man1/Makefile doc/man/man3/Makefile doc/man/man5/Makefile doc/man/man8/Makefile doc/html/Makefile doc/html/configurator.html doc/html/configurator.easy.html etc/Makefile src/Makefile src/api/Makefile src/bcast/Makefile src/common/Makefile src/db_api/Makefile src/layouts/Makefile src/layouts/power/Makefile src/layouts/unit/Makefile src/database/Makefile src/sacct/Makefile src/sacctmgr/Makefile src/sreport/Makefile src/salloc/Makefile src/sbatch/Makefile src/sbcast/Makefile src/sattach/Makefile src/scancel/Makefile src/scontrol/Makefile src/sdiag/Makefile src/sinfo/Makefile src/slurmctld/Makefile src/slurmd/Makefile src/slurmd/common/Makefile src/slurmd/slurmd/Makefile src/slurmd/slurmstepd/Makefile src/slurmdbd/Makefile src/smap/Makefile src/smd/Makefile src/sprio/Makefile src/squeue/Makefile src/srun/Makefile src/srun/libsrun/Makefile src/srun_cr/Makefile src/sshare/Makefile src/sstat/Makefile src/strigger/Makefile src/sview/Makefile src/plugins/Makefile src/plugins/accounting_storage/Makefile src/plugins/accounting_storage/common/Makefile src/plugins/accounting_storage/filetxt/Makefile src/plugins/accounting_storage/mysql/Makefile src/plugins/accounting_storage/none/Makefile src/plugins/accounting_storage/slurmdbd/Makefile src/plugins/acct_gather_energy/Makefile src/plugins/acct_gather_energy/cray/Makefile src/plugins/acct_gather_energy/rapl/Makefile src/plugins/acct_gather_energy/ibmaem/Makefile src/plugins/acct_gather_energy/ipmi/Makefile src/plugins/acct_gather_energy/none/Makefile src/plugins/acct_gather_infiniband/Makefile src/plugins/acct_gather_infiniband/ofed/Makefile src/plugins/acct_gather_infiniband/none/Makefile src/plugins/acct_gather_filesystem/Makefile src/plugins/acct_gather_filesystem/lustre/Makefile src/plugins/acct_gather_filesystem/none/Makefile src/plugins/acct_gather_profile/Makefile src/plugins/acct_gather_profile/hdf5/Makefile src/plugins/acct_gather_profile/hdf5/sh5util/Makefile src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile src/plugins/acct_gather_profile/none/Makefile src/plugins/auth/Makefile src/plugins/auth/munge/Makefile src/plugins/auth/none/Makefile src/plugins/burst_buffer/Makefile src/plugins/burst_buffer/common/Makefile src/plugins/burst_buffer/cray/Makefile src/plugins/burst_buffer/generic/Makefile src/plugins/checkpoint/Makefile src/plugins/checkpoint/aix/Makefile src/plugins/checkpoint/blcr/Makefile src/plugins/checkpoint/blcr/cr_checkpoint.sh src/plugins/checkpoint/blcr/cr_restart.sh src/plugins/checkpoint/none/Makefile src/plugins/checkpoint/ompi/Makefile src/plugins/checkpoint/poe/Makefile src/plugins/core_spec/Makefile src/plugins/core_spec/cray/Makefile src/plugins/core_spec/none/Makefile src/plugins/crypto/Makefile src/plugins/crypto/munge/Makefile src/plugins/crypto/openssl/Makefile src/plugins/ext_sensors/Makefile src/plugins/ext_sensors/rrd/Makefile src/plugins/ext_sensors/none/Makefile src/plugins/gres/Makefile src/plugins/gres/gpu/Makefile src/plugins/gres/nic/Makefile src/plugins/gres/mic/Makefile src/plugins/jobacct_gather/Makefile src/plugins/jobacct_gather/common/Makefile src/plugins/jobacct_gather/linux/Makefile src/plugins/jobacct_gather/aix/Makefile src/plugins/jobacct_gather/cgroup/Makefile src/plugins/jobacct_gather/none/Makefile src/plugins/jobcomp/Makefile src/plugins/jobcomp/elasticsearch/Makefile src/plugins/jobcomp/filetxt/Makefile src/plugins/jobcomp/none/Makefile src/plugins/jobcomp/script/Makefile src/plugins/jobcomp/mysql/Makefile src/plugins/job_container/Makefile src/plugins/job_container/cncu/Makefile src/plugins/job_container/none/Makefile src/plugins/job_submit/Makefile src/plugins/job_submit/all_partitions/Makefile src/plugins/job_submit/cray/Makefile src/plugins/job_submit/defaults/Makefile src/plugins/job_submit/logging/Makefile src/plugins/job_submit/lua/Makefile src/plugins/job_submit/partition/Makefile src/plugins/job_submit/pbs/Makefile src/plugins/job_submit/require_timelimit/Makefile src/plugins/job_submit/throttle/Makefile src/plugins/launch/Makefile src/plugins/launch/aprun/Makefile src/plugins/launch/poe/Makefile src/plugins/launch/runjob/Makefile src/plugins/launch/slurm/Makefile src/plugins/mcs/Makefile src/plugins/mcs/none/Makefile src/plugins/mcs/group/Makefile src/plugins/mcs/user/Makefile src/plugins/node_features/Makefile src/plugins/node_features/knl_cray/Makefile src/plugins/power/Makefile src/plugins/power/common/Makefile src/plugins/power/cray/Makefile src/plugins/power/none/Makefile src/plugins/preempt/Makefile src/plugins/preempt/job_prio/Makefile src/plugins/preempt/none/Makefile src/plugins/preempt/partition_prio/Makefile src/plugins/preempt/qos/Makefile src/plugins/priority/Makefile src/plugins/priority/basic/Makefile src/plugins/priority/multifactor/Makefile src/plugins/proctrack/Makefile src/plugins/proctrack/aix/Makefile src/plugins/proctrack/cray/Makefile src/plugins/proctrack/cgroup/Makefile src/plugins/proctrack/pgid/Makefile src/plugins/proctrack/linuxproc/Makefile src/plugins/proctrack/sgi_job/Makefile src/plugins/proctrack/lua/Makefile src/plugins/route/Makefile src/plugins/route/default/Makefile src/plugins/route/topology/Makefile src/plugins/sched/Makefile src/plugins/sched/backfill/Makefile src/plugins/sched/builtin/Makefile src/plugins/sched/hold/Makefile src/plugins/sched/wiki/Makefile src/plugins/sched/wiki2/Makefile src/plugins/select/Makefile src/plugins/select/alps/Makefile src/plugins/select/alps/libalps/Makefile src/plugins/select/alps/libemulate/Makefile src/plugins/select/bluegene/Makefile src/plugins/select/bluegene/ba/Makefile src/plugins/select/bluegene/ba_bgq/Makefile src/plugins/select/bluegene/bl/Makefile src/plugins/select/bluegene/bl_bgq/Makefile src/plugins/select/bluegene/sfree/Makefile src/plugins/select/cons_res/Makefile src/plugins/select/cray/Makefile src/plugins/select/linear/Makefile src/plugins/select/other/Makefile src/plugins/select/serial/Makefile src/plugins/slurmctld/Makefile src/plugins/slurmctld/nonstop/Makefile src/plugins/slurmd/Makefile src/plugins/switch/Makefile src/plugins/switch/cray/Makefile src/plugins/switch/generic/Makefile src/plugins/switch/none/Makefile src/plugins/switch/nrt/Makefile src/plugins/switch/nrt/libpermapi/Makefile src/plugins/mpi/Makefile src/plugins/mpi/mpich1_p4/Makefile src/plugins/mpi/mpich1_shmem/Makefile src/plugins/mpi/mpichgm/Makefile src/plugins/mpi/mpichmx/Makefile src/plugins/mpi/mvapich/Makefile src/plugins/mpi/lam/Makefile src/plugins/mpi/none/Makefile src/plugins/mpi/openmpi/Makefile src/plugins/mpi/pmi2/Makefile src/plugins/mpi/pmix/Makefile src/plugins/task/Makefile src/plugins/task/affinity/Makefile src/plugins/task/cgroup/Makefile src/plugins/task/cray/Makefile src/plugins/task/none/Makefile src/plugins/topology/Makefile src/plugins/topology/3d_torus/Makefile src/plugins/topology/hypercube/Makefile src/plugins/topology/node_rank/Makefile src/plugins/topology/none/Makefile src/plugins/topology/tree/Makefile testsuite/Makefile testsuite/expect/Makefile testsuite/slurm_unit/Makefile testsuite/slurm_unit/api/Makefile testsuite/slurm_unit/api/manual/Makefile testsuite/slurm_unit/common/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -24864,6 +25973,10 @@ if test -z "${BUILD_HDF5_TRUE}" && test -z "${BUILD_HDF5_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_HDF5\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_PMIX_TRUE}" && test -z "${HAVE_PMIX_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_PMIX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${BUILD_IPMI_TRUE}" && test -z "${BUILD_IPMI_FALSE}"; then
   as_fn_error $? "conditional \"BUILD_IPMI\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -24948,10 +26061,6 @@ if test -z "${WITH_MUNGE_TRUE}" && test -z "${WITH_MUNGE_FALSE}"; then
   as_fn_error $? "conditional \"WITH_MUNGE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${WITH_AUTHD_TRUE}" && test -z "${WITH_AUTHD_FALSE}"; then
-  as_fn_error $? "conditional \"WITH_AUTHD\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 if test -z "${WITH_BLCR_TRUE}" && test -z "${WITH_BLCR_FALSE}"; then
   as_fn_error $? "conditional \"WITH_BLCR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -25361,7 +26470,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by slurm $as_me 15.08, which was
+This file was extended by slurm $as_me 16.05, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -25428,7 +26537,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-slurm config.status 15.08
+slurm config.status 16.05
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -25563,6 +26672,7 @@ enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
 enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
 pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
 enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
 SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
 ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
 PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -25612,10 +26722,13 @@ compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
 GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
 nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
 lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
 objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
 MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
 lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -25680,7 +26793,8 @@ finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
 finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
 hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
 sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
 hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
 enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
 enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -25785,9 +26899,12 @@ CFLAGS \
 compiler \
 lt_cv_sys_global_symbol_pipe \
 lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
 lt_cv_sys_global_symbol_to_c_name_address \
 lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
 nm_file_list_spec \
+lt_cv_truncate_bin \
 lt_prog_compiler_no_builtin_flag \
 lt_prog_compiler_pic \
 lt_prog_compiler_wl \
@@ -25853,7 +26970,7 @@ postdeps_CXX \
 compiler_lib_search_path_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -25880,7 +26997,8 @@ postinstall_cmds \
 postuninstall_cmds \
 finish_cmds \
 sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec \
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path \
 reload_cmds_CXX \
 old_archive_cmds_CXX \
 old_archive_from_new_cmds_CXX \
@@ -25894,7 +27012,7 @@ prelink_cmds_CXX \
 postlink_cmds_CXX; do
     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
     *[\\\\\\\`\\"\\\$]*)
-      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
       ;;
     *)
       eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -25903,19 +27021,16 @@ postlink_cmds_CXX; do
 done
 
 ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
 
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
 # commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
    setopt NO_GLOB_SUBST
 fi
 
 
     PACKAGE='$PACKAGE'
     VERSION='$VERSION'
-    TIMESTAMP='$TIMESTAMP'
     RM='$RM'
     ofile='$ofile'
 
@@ -25937,7 +27052,6 @@ do
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-    "config.xml") CONFIG_FILES="$CONFIG_FILES config.xml" ;;
     "auxdir/Makefile") CONFIG_FILES="$CONFIG_FILES auxdir/Makefile" ;;
     "contribs/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/Makefile" ;;
     "contribs/cray/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/cray/Makefile" ;;
@@ -25951,7 +27065,9 @@ do
     "contribs/perlapi/libslurm/perl/Makefile.PL") CONFIG_FILES="$CONFIG_FILES contribs/perlapi/libslurm/perl/Makefile.PL" ;;
     "contribs/perlapi/libslurmdb/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/perlapi/libslurmdb/Makefile" ;;
     "contribs/perlapi/libslurmdb/perl/Makefile.PL") CONFIG_FILES="$CONFIG_FILES contribs/perlapi/libslurmdb/perl/Makefile.PL" ;;
+    "contribs/seff/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/seff/Makefile" ;;
     "contribs/torque/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/torque/Makefile" ;;
+    "contribs/openlava/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/openlava/Makefile" ;;
     "contribs/phpext/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/phpext/Makefile" ;;
     "contribs/phpext/slurm_php/config.m4") CONFIG_FILES="$CONFIG_FILES contribs/phpext/slurm_php/config.m4" ;;
     "contribs/sgather/Makefile") CONFIG_FILES="$CONFIG_FILES contribs/sgather/Makefile" ;;
@@ -25968,14 +27084,10 @@ do
     "doc/html/Makefile") CONFIG_FILES="$CONFIG_FILES doc/html/Makefile" ;;
     "doc/html/configurator.html") CONFIG_FILES="$CONFIG_FILES doc/html/configurator.html" ;;
     "doc/html/configurator.easy.html") CONFIG_FILES="$CONFIG_FILES doc/html/configurator.easy.html" ;;
-    "etc/cgroup.release_common.example") CONFIG_FILES="$CONFIG_FILES etc/cgroup.release_common.example" ;;
-    "etc/init.d.slurm") CONFIG_FILES="$CONFIG_FILES etc/init.d.slurm" ;;
-    "etc/init.d.slurmdbd") CONFIG_FILES="$CONFIG_FILES etc/init.d.slurmdbd" ;;
-    "etc/slurmctld.service") CONFIG_FILES="$CONFIG_FILES etc/slurmctld.service" ;;
-    "etc/slurmd.service") CONFIG_FILES="$CONFIG_FILES etc/slurmd.service" ;;
-    "etc/slurmdbd.service") CONFIG_FILES="$CONFIG_FILES etc/slurmdbd.service" ;;
+    "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "src/api/Makefile") CONFIG_FILES="$CONFIG_FILES src/api/Makefile" ;;
+    "src/bcast/Makefile") CONFIG_FILES="$CONFIG_FILES src/bcast/Makefile" ;;
     "src/common/Makefile") CONFIG_FILES="$CONFIG_FILES src/common/Makefile" ;;
     "src/db_api/Makefile") CONFIG_FILES="$CONFIG_FILES src/db_api/Makefile" ;;
     "src/layouts/Makefile") CONFIG_FILES="$CONFIG_FILES src/layouts/Makefile" ;;
@@ -26035,7 +27147,6 @@ do
     "src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile" ;;
     "src/plugins/acct_gather_profile/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/acct_gather_profile/none/Makefile" ;;
     "src/plugins/auth/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/auth/Makefile" ;;
-    "src/plugins/auth/authd/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/auth/authd/Makefile" ;;
     "src/plugins/auth/munge/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/auth/munge/Makefile" ;;
     "src/plugins/auth/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/auth/none/Makefile" ;;
     "src/plugins/burst_buffer/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/burst_buffer/Makefile" ;;
@@ -26080,7 +27191,6 @@ do
     "src/plugins/job_container/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_container/none/Makefile" ;;
     "src/plugins/job_submit/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/Makefile" ;;
     "src/plugins/job_submit/all_partitions/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/all_partitions/Makefile" ;;
-    "src/plugins/job_submit/cnode/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/cnode/Makefile" ;;
     "src/plugins/job_submit/cray/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/cray/Makefile" ;;
     "src/plugins/job_submit/defaults/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/defaults/Makefile" ;;
     "src/plugins/job_submit/logging/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/job_submit/logging/Makefile" ;;
@@ -26094,6 +27204,12 @@ do
     "src/plugins/launch/poe/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/launch/poe/Makefile" ;;
     "src/plugins/launch/runjob/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/launch/runjob/Makefile" ;;
     "src/plugins/launch/slurm/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/launch/slurm/Makefile" ;;
+    "src/plugins/mcs/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mcs/Makefile" ;;
+    "src/plugins/mcs/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mcs/none/Makefile" ;;
+    "src/plugins/mcs/group/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mcs/group/Makefile" ;;
+    "src/plugins/mcs/user/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mcs/user/Makefile" ;;
+    "src/plugins/node_features/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/node_features/Makefile" ;;
+    "src/plugins/node_features/knl_cray/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/node_features/knl_cray/Makefile" ;;
     "src/plugins/power/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/power/Makefile" ;;
     "src/plugins/power/common/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/power/common/Makefile" ;;
     "src/plugins/power/cray/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/power/cray/Makefile" ;;
@@ -26157,6 +27273,7 @@ do
     "src/plugins/mpi/none/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/none/Makefile" ;;
     "src/plugins/mpi/openmpi/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/openmpi/Makefile" ;;
     "src/plugins/mpi/pmi2/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/pmi2/Makefile" ;;
+    "src/plugins/mpi/pmix/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/mpi/pmix/Makefile" ;;
     "src/plugins/task/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/task/Makefile" ;;
     "src/plugins/task/affinity/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/task/affinity/Makefile" ;;
     "src/plugins/task/cgroup/Makefile") CONFIG_FILES="$CONFIG_FILES src/plugins/task/cgroup/Makefile" ;;
@@ -26864,55 +27981,53 @@ $as_echo X"$file" |
  ;;
     "libtool":C)
 
-    # See if we are running on zsh, and set the options which allow our
+    # See if we are running on zsh, and set the options that allow our
     # commands through without removal of \ escapes.
-    if test -n "${ZSH_VERSION+set}" ; then
+    if test -n "${ZSH_VERSION+set}"; then
       setopt NO_GLOB_SUBST
     fi
 
-    cfgfile="${ofile}T"
+    cfgfile=${ofile}T
     trap "$RM \"$cfgfile\"; exit 1" 1 2 15
     $RM "$cfgfile"
 
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Generated automatically by $as_me ($PACKAGE) $VERSION
 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
 #
-#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-#                 Foundation, Inc.
-#   Written by Gordon Matzigkeit, 1996
-#
-#   This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the  same
+# distribution terms that you use for the rest of that program.
 #
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING.  If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 # The names of the tagged configurations supported by this script.
-available_tags="CXX "
+available_tags='CXX '
+
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
 
 # ### BEGIN LIBTOOL CONFIG
 
@@ -26932,6 +28047,9 @@ pic_mode=$pic_mode
 # Whether or not to optimize for fast installation.
 fast_install=$enable_fast_install
 
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
 # Shell to use when invoking shell scripts.
 SHELL=$lt_SHELL
 
@@ -27049,18 +28167,27 @@ global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
 # Transform the output of nm in a proper C declaration.
 global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
 
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
 # Transform the output of nm in a C name address pair.
 global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
 
 # Transform the output of nm in a C name address pair when lib prefix is needed.
 global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
 
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
 # Specify filename containing input files for \$NM.
 nm_file_list_spec=$lt_nm_file_list_spec
 
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
 lt_sysroot=$lt_sysroot
 
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
 # The name of the directory that contains temporary libtool files.
 objdir=$objdir
 
@@ -27151,8 +28278,11 @@ hardcode_into_libs=$hardcode_into_libs
 # Compile-time system search path for libraries.
 sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
 
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
 
 # Whether dlopen is supported.
 dlopen_support=$enable_dlopen
@@ -27245,13 +28375,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute
 
@@ -27315,6 +28445,65 @@ compiler_lib_search_path=$lt_compiler_lib_search_path
 
 # ### END LIBTOOL CONFIG
 
+_LT_EOF
+
+    cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+#       string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+#       string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+#       "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+#       VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+    case x$2 in
+    x)
+        ;;
+    *:)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+        ;;
+    x:*)
+        eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    *::*)
+        eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+        eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+        ;;
+    *)
+        eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+        ;;
+    esac
+}
+
+
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+    for cc_temp in $*""; do
+      case $cc_temp in
+        compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+        distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+        \-*) ;;
+        *) break;;
+      esac
+    done
+    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
 _LT_EOF
 
   case $host_os in
@@ -27323,7 +28512,7 @@ _LT_EOF
 # AIX sometimes has problems with the GCC collect2 program.  For some
 # reason, if we set the COLLECT_NAMES environment variable, the problems
 # vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
   COLLECT_NAMES=
   export COLLECT_NAMES
 fi
@@ -27332,7 +28521,7 @@ _LT_EOF
   esac
 
 
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
 
 
   # We use sed instead of cat because bash on DJGPP gets confused if
@@ -27342,165 +28531,6 @@ ltmain="$ac_aux_dir/ltmain.sh"
   sed '$q' "$ltmain" >> "$cfgfile" \
      || (rm -f "$cfgfile"; exit 1)
 
-  if test x"$xsi_shell" = xyes; then
-  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\    case ${1} in\
-\      */*) func_dirname_result="${1%/*}${2}" ;;\
-\      *  ) func_dirname_result="${3}" ;;\
-\    esac\
-\    func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\    # positional parameters, so assign one to ordinary parameter first.\
-\    func_stripname_result=${3}\
-\    func_stripname_result=${func_stripname_result#"${1}"}\
-\    func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\    func_split_long_opt_name=${1%%=*}\
-\    func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\    func_split_short_opt_arg=${1#??}\
-\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\    case ${1} in\
-\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\      *)    func_lo2o_result=${1} ;;\
-\    esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
-    func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
-    func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
-    func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
-  sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
-    eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\    func_quote_for_eval "${2}"\
-\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
-  && mv -f "$cfgfile.tmp" "$cfgfile" \
-    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
-  # Save a `func_append' function call where possible by direct use of '+='
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-else
-  # Save a `func_append' function call even when '+=' is not available
-  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
-    && mv -f "$cfgfile.tmp" "$cfgfile" \
-      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-  test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
    mv -f "$cfgfile" "$ofile" ||
     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
   chmod +x "$ofile"
@@ -27587,13 +28617,13 @@ hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
 # Whether we need a single "-rpath" flag with a separated argument.
 hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary.
 hardcode_direct=$hardcode_direct_CXX
 
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
 # DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
 # library is relocated.
 hardcode_direct_absolute=$hardcode_direct_absolute_CXX
 
diff --git a/configure.ac b/configure.ac
index fb34d1666..1f2f901b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,3 @@
-# $Id$
 # This file is to be processed with autoconf to generate a configure script
 
 dnl Prologue
@@ -228,10 +227,8 @@ LDFLAGS="$LDFLAGS "
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
 LIBS="$PTHREAD_LIBS $LIBS"
 
-X_AC_SUN_CONST
 X_AC_DIMENSIONS
 
-X_AC_CFLAGS
 X_AC_OFED
 
 AX_LIB_HDF5()
@@ -242,7 +239,10 @@ AM_CONDITIONAL(BUILD_HDF5, test "$with_hdf5" = "yes")
 # the 1.8 API.
 AC_DEFINE([H5_NO_DEPRECATED_SYMBOLS], [1], [Make sure we get the 1.8 HDF5 API])
 
+AX_CHECK_ZLIB([], [])
+X_AC_LZ4
 X_AC_HWLOC
+X_AC_PMIX
 X_AC_FREEIPMI
 X_AC_SLURM_SEMAPHORE
 X_AC_RRDTOOL
@@ -396,15 +396,10 @@ else
 fi
 
 
-AUTHD_LIBS="-lauth -le"
 savedLIBS="$LIBS"
 savedCFLAGS="$CFLAGS"
-LIBS="$SSL_LIBS $AUTHD_LIBS $LIBS"
+LIBS="$SSL_LIBS $LIBS"
 CFLAGS="$SSL_CPPFLAGS $CFLAGS"
-AC_CHECK_LIB(auth, auth_init_credentials, [have_authd=yes], [have_authd=no])
-AC_SUBST(AUTHD_LIBS)
-AC_SUBST(AUTHD_CFLAGS)
-AM_CONDITIONAL(WITH_AUTHD, test "x$have_authd" = "xyes")
 LIBS="$savedLIBS"
 CFLAGS="$savedCFLAGS"
 
@@ -436,7 +431,6 @@ AM_CONDITIONAL(BUILD_SMAP, test "x$ac_build_smap" = "xyes")
 dnl All slurm Makefiles:
 
 AC_CONFIG_FILES([Makefile
-		 config.xml
 		 auxdir/Makefile
 		 contribs/Makefile
 		 contribs/cray/Makefile
@@ -450,7 +444,9 @@ AC_CONFIG_FILES([Makefile
 		 contribs/perlapi/libslurm/perl/Makefile.PL
 		 contribs/perlapi/libslurmdb/Makefile
 		 contribs/perlapi/libslurmdb/perl/Makefile.PL
+		 contribs/seff/Makefile
 		 contribs/torque/Makefile
+		 contribs/openlava/Makefile
 		 contribs/phpext/Makefile
 		 contribs/phpext/slurm_php/config.m4
 		 contribs/sgather/Makefile
@@ -467,14 +463,10 @@ AC_CONFIG_FILES([Makefile
 		 doc/html/Makefile
 		 doc/html/configurator.html
 		 doc/html/configurator.easy.html
-		 etc/cgroup.release_common.example
-		 etc/init.d.slurm
-		 etc/init.d.slurmdbd
-		 etc/slurmctld.service
-		 etc/slurmd.service
-		 etc/slurmdbd.service
+		 etc/Makefile
 		 src/Makefile
 		 src/api/Makefile
+		 src/bcast/Makefile
 		 src/common/Makefile
 		 src/db_api/Makefile
 		 src/layouts/Makefile
@@ -534,7 +526,6 @@ AC_CONFIG_FILES([Makefile
 		 src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile
 		 src/plugins/acct_gather_profile/none/Makefile
 		 src/plugins/auth/Makefile
-		 src/plugins/auth/authd/Makefile
 		 src/plugins/auth/munge/Makefile
 		 src/plugins/auth/none/Makefile
 		 src/plugins/burst_buffer/Makefile
@@ -579,7 +570,6 @@ AC_CONFIG_FILES([Makefile
 		 src/plugins/job_container/none/Makefile
 		 src/plugins/job_submit/Makefile
 		 src/plugins/job_submit/all_partitions/Makefile
-		 src/plugins/job_submit/cnode/Makefile
 		 src/plugins/job_submit/cray/Makefile
 		 src/plugins/job_submit/defaults/Makefile
 		 src/plugins/job_submit/logging/Makefile
@@ -593,6 +583,12 @@ AC_CONFIG_FILES([Makefile
 		 src/plugins/launch/poe/Makefile
 		 src/plugins/launch/runjob/Makefile
 		 src/plugins/launch/slurm/Makefile
+		 src/plugins/mcs/Makefile
+		 src/plugins/mcs/none/Makefile
+		 src/plugins/mcs/group/Makefile
+		 src/plugins/mcs/user/Makefile
+		 src/plugins/node_features/Makefile
+		 src/plugins/node_features/knl_cray/Makefile
 		 src/plugins/power/Makefile
 		 src/plugins/power/common/Makefile
 		 src/plugins/power/cray/Makefile
@@ -656,6 +652,7 @@ AC_CONFIG_FILES([Makefile
 		 src/plugins/mpi/none/Makefile
 		 src/plugins/mpi/openmpi/Makefile
 		 src/plugins/mpi/pmi2/Makefile
+		 src/plugins/mpi/pmix/Makefile
 		 src/plugins/task/Makefile
 		 src/plugins/task/affinity/Makefile
 		 src/plugins/task/cgroup/Makefile
diff --git a/contribs/Makefile.am b/contribs/Makefile.am
index 6eb15a8c7..ed4b46d0c 100644
--- a/contribs/Makefile.am
+++ b/contribs/Makefile.am
@@ -1,11 +1,10 @@
-SUBDIRS = cray lua pam pam_slurm_adopt perlapi torque sgather sgi sjobexit slurmdb-direct pmi2 mic
+SUBDIRS = cray lua mic openlava pam pam_slurm_adopt perlapi pmi2 seff sgather sgi sjobexit slurmdb-direct torque
 
 EXTRA_DIST = \
 	env_cache_builder.c	\
 	make-3.81.slurm.patch	\
 	make-4.0.slurm.patch	\
 	mpich1.slurm.patch	\
-	ptrace.patch		\
 	sgather			\
 	skilling.c		\
 	sjstat			\
diff --git a/contribs/Makefile.in b/contribs/Makefile.in
index b019423a6..8fa25aa58 100644
--- a/contribs/Makefile.in
+++ b/contribs/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -470,13 +480,12 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = cray lua pam pam_slurm_adopt perlapi torque sgather sgi sjobexit slurmdb-direct pmi2 mic
+SUBDIRS = cray lua mic openlava pam pam_slurm_adopt perlapi pmi2 seff sgather sgi sjobexit slurmdb-direct torque
 EXTRA_DIST = \
 	env_cache_builder.c	\
 	make-3.81.slurm.patch	\
 	make-4.0.slurm.patch	\
 	mpich1.slurm.patch	\
-	ptrace.patch		\
 	sgather			\
 	skilling.c		\
 	sjstat			\
diff --git a/contribs/README b/contribs/README
index b854cc84a..848fe2201 100644
--- a/contribs/README
+++ b/contribs/README
@@ -88,14 +88,6 @@ of the Slurm contribs distribution follows:
      User applications can link with this library to use Slurm's mpi/pmi2
      plugin.
 
-  ptrace.patch       [ Linux Kernel patch required to for TotalView use ]
-     0. This has been fixed on most recent Linux kernels. Older versions of
-     Linux may need this patch support TotalView.
-     1. gdb and other tools cannot attach to a stopped process. The wait that
-     follows the PTRACE_ATTACH will block indefinitely.
-     2. It is not possible to use PTRACE_DETACH to leave a process stopped,
-     because ptrace ignores SIGSTOPs sent by the tracing process.
-
   sgather            [ shell script ]
      Gather remote files from a job into a central location. Reverse of of
      sbcast command.
diff --git a/contribs/cray/Makefile.am b/contribs/cray/Makefile.am
index fa90b5225..a145a6fd4 100644
--- a/contribs/cray/Makefile.am
+++ b/contribs/cray/Makefile.am
@@ -1,12 +1,36 @@
 #
-# Makefile for cray scripts
+# Makefile for cray tools
 #
 
 SUBDIRS = csm
 
 AUTOMAKE_OPTIONS = foreign
 
+if HAVE_NATIVE_CRAY
+sbin_SCRIPTS = slurmconfgen.py
+endif
+
+if HAVE_REAL_CRAY
+noinst_DATA = opt_modulefiles_slurm
+endif
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(JSON_CPPFLAGS)
+
+if WITH_JSON_PARSER
+convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS)
+sbin_PROGRAMS = capmc_suspend capmc_resume
+capmc_suspend_SOURCES  = capmc_suspend.c
+capmc_suspend_LDADD    = $(convenience_libs)
+capmc_suspend_LDFLAGS  = -export-dynamic $(JSON_LDFLAGS)
+capmc_resume_SOURCES   = capmc_resume.c
+capmc_resume_LDADD     = $(convenience_libs)
+capmc_resume_LDFLAGS   = -export-dynamic $(JSON_LDFLAGS)
+else
+NATIVE_EXTRA_DIST = capmc_suspend.c capmc_resume.c
+endif
+
 EXTRA_DIST = \
+	$(NATIVE_EXTRA_DIST)		\
 	etc_sysconfig_slurm		\
 	libalps_test_programs.tar.gz	\
 	opt_modulefiles_slurm.in	\
@@ -15,14 +39,6 @@ EXTRA_DIST = \
 	slurm.conf.template		\
 	slurmconfgen.py.in
 
-if HAVE_NATIVE_CRAY
-sbin_SCRIPTS = slurmconfgen.py
-endif
-
-if HAVE_REAL_CRAY
-noinst_DATA = opt_modulefiles_slurm
-endif
-
 # Don't rely on autoconf to replace variables outside of makefiles
 opt_modulefiles_slurm: opt_modulefiles_slurm.in Makefile
 	sed -e 's|@prefix[@]|$(prefix)|g' \
@@ -36,3 +52,7 @@ slurmconfgen.py: slurmconfgen.py.in Makefile
 
 clean-generic:
 	rm -f opt_modulefiles_slurm slurmconfgen.py
+
+force:
+$(convenience_libs) : force
+	@cd `dirname $@` && $(MAKE) `basename $@`
diff --git a/contribs/cray/Makefile.in b/contribs/cray/Makefile.in
index 3fe7c6362..abbdd30be 100644
--- a/contribs/cray/Makefile.in
+++ b/contribs/cray/Makefile.in
@@ -15,10 +15,11 @@
 @SET_MAKE@
 
 #
-# Makefile for cray scripts
+# Makefile for cray tools
 #
 
 
+
 VPATH = @srcdir@
 am__is_gnu_make = { \
   if test -z '$(MAKELEVEL)'; then \
@@ -94,9 +95,12 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+@WITH_JSON_PARSER_TRUE@sbin_PROGRAMS = capmc_suspend$(EXEEXT) \
+@WITH_JSON_PARSER_TRUE@	capmc_resume$(EXEEXT)
 subdir = contribs/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +113,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +133,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +142,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -146,6 +150,34 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am__capmc_resume_SOURCES_DIST = capmc_resume.c
+@WITH_JSON_PARSER_TRUE@am_capmc_resume_OBJECTS =  \
+@WITH_JSON_PARSER_TRUE@	capmc_resume.$(OBJEXT)
+capmc_resume_OBJECTS = $(am_capmc_resume_OBJECTS)
+am__DEPENDENCIES_1 =
+@WITH_JSON_PARSER_TRUE@am__DEPENDENCIES_2 =  \
+@WITH_JSON_PARSER_TRUE@	$(top_builddir)/src/api/libslurm.o \
+@WITH_JSON_PARSER_TRUE@	$(am__DEPENDENCIES_1)
+@WITH_JSON_PARSER_TRUE@capmc_resume_DEPENDENCIES =  \
+@WITH_JSON_PARSER_TRUE@	$(am__DEPENDENCIES_2)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+capmc_resume_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(capmc_resume_LDFLAGS) $(LDFLAGS) -o $@
+am__capmc_suspend_SOURCES_DIST = capmc_suspend.c
+@WITH_JSON_PARSER_TRUE@am_capmc_suspend_OBJECTS =  \
+@WITH_JSON_PARSER_TRUE@	capmc_suspend.$(OBJEXT)
+capmc_suspend_OBJECTS = $(am_capmc_suspend_OBJECTS)
+@WITH_JSON_PARSER_TRUE@capmc_suspend_DEPENDENCIES =  \
+@WITH_JSON_PARSER_TRUE@	$(am__DEPENDENCIES_2)
+capmc_suspend_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(capmc_suspend_LDFLAGS) $(LDFLAGS) -o $@
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
 am__vpath_adj = case $$p in \
     $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -173,7 +205,6 @@ am__uninstall_files_from_dir = { \
     || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
-am__installdirs = "$(DESTDIR)$(sbindir)"
 SCRIPTS = $(sbin_SCRIPTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -187,8 +218,31 @@ AM_V_at = $(am__v_at_@AM_V@)
 am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
 am__v_at_0 = @
 am__v_at_1 = 
-SOURCES =
-DIST_SOURCES =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(capmc_resume_SOURCES) $(capmc_suspend_SOURCES)
+DIST_SOURCES = $(am__capmc_resume_SOURCES_DIST) \
+	$(am__capmc_suspend_SOURCES_DIST)
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
 	ctags-recursive dvi-recursive html-recursive info-recursive \
 	install-data-recursive install-dvi-recursive \
@@ -231,7 +285,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/auxdir/depcomp
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -262,8 +316,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -363,6 +415,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -401,6 +457,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -444,6 +503,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -494,6 +556,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -508,7 +571,19 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = csm
 AUTOMAKE_OPTIONS = foreign
+@HAVE_NATIVE_CRAY_TRUE@sbin_SCRIPTS = slurmconfgen.py
+@HAVE_REAL_CRAY_TRUE@noinst_DATA = opt_modulefiles_slurm
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(JSON_CPPFLAGS)
+@WITH_JSON_PARSER_TRUE@convenience_libs = $(top_builddir)/src/api/libslurm.o $(DL_LIBS)
+@WITH_JSON_PARSER_TRUE@capmc_suspend_SOURCES = capmc_suspend.c
+@WITH_JSON_PARSER_TRUE@capmc_suspend_LDADD = $(convenience_libs)
+@WITH_JSON_PARSER_TRUE@capmc_suspend_LDFLAGS = -export-dynamic $(JSON_LDFLAGS)
+@WITH_JSON_PARSER_TRUE@capmc_resume_SOURCES = capmc_resume.c
+@WITH_JSON_PARSER_TRUE@capmc_resume_LDADD = $(convenience_libs)
+@WITH_JSON_PARSER_TRUE@capmc_resume_LDFLAGS = -export-dynamic $(JSON_LDFLAGS)
+@WITH_JSON_PARSER_FALSE@NATIVE_EXTRA_DIST = capmc_suspend.c capmc_resume.c
 EXTRA_DIST = \
+	$(NATIVE_EXTRA_DIST)		\
 	etc_sysconfig_slurm		\
 	libalps_test_programs.tar.gz	\
 	opt_modulefiles_slurm.in	\
@@ -517,11 +592,10 @@ EXTRA_DIST = \
 	slurm.conf.template		\
 	slurmconfgen.py.in
 
-@HAVE_NATIVE_CRAY_TRUE@sbin_SCRIPTS = slurmconfgen.py
-@HAVE_REAL_CRAY_TRUE@noinst_DATA = opt_modulefiles_slurm
 all: all-recursive
 
 .SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -551,6 +625,63 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
 $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p \
+	 || test -f $$p1 \
+	  ; then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' \
+	    -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' \
+	`; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+	@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+capmc_resume$(EXEEXT): $(capmc_resume_OBJECTS) $(capmc_resume_DEPENDENCIES) $(EXTRA_capmc_resume_DEPENDENCIES) 
+	@rm -f capmc_resume$(EXEEXT)
+	$(AM_V_CCLD)$(capmc_resume_LINK) $(capmc_resume_OBJECTS) $(capmc_resume_LDADD) $(LIBS)
+
+capmc_suspend$(EXEEXT): $(capmc_suspend_OBJECTS) $(capmc_suspend_DEPENDENCIES) $(EXTRA_capmc_suspend_DEPENDENCIES) 
+	@rm -f capmc_suspend$(EXEEXT)
+	$(AM_V_CCLD)$(capmc_suspend_LINK) $(capmc_suspend_OBJECTS) $(capmc_suspend_LDADD) $(LIBS)
 install-sbinSCRIPTS: $(sbin_SCRIPTS)
 	@$(NORMAL_INSTALL)
 	@list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
@@ -587,6 +718,36 @@ uninstall-sbinSCRIPTS:
 	       sed -e 's,.*/,,;$(transform)'`; \
 	dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir)
 
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capmc_resume.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/capmc_suspend.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
 mostlyclean-libtool:
 	-rm -f *.lo
 
@@ -749,10 +910,10 @@ distdir: $(DISTFILES)
 	done
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(SCRIPTS) $(DATA)
+all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
-	for dir in "$(DESTDIR)$(sbindir)"; do \
+	for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-recursive
@@ -785,11 +946,14 @@ maintainer-clean-generic:
 	@echo "it deletes files that may require special tools to rebuild."
 clean: clean-recursive
 
-clean-am: clean-generic clean-libtool mostlyclean-am
+clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
+	mostlyclean-am
 
 distclean: distclean-recursive
+	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
-distclean-am: clean-am distclean-generic distclean-tags
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
 
 dvi: dvi-recursive
 
@@ -809,7 +973,7 @@ install-dvi: install-dvi-recursive
 
 install-dvi-am:
 
-install-exec-am: install-sbinSCRIPTS
+install-exec-am: install-sbinPROGRAMS install-sbinSCRIPTS
 
 install-html: install-html-recursive
 
@@ -832,12 +996,14 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
+	-rm -rf ./$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
 mostlyclean: mostlyclean-recursive
 
-mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
 
 pdf: pdf-recursive
 
@@ -847,23 +1013,25 @@ ps: ps-recursive
 
 ps-am:
 
-uninstall-am: uninstall-sbinSCRIPTS
+uninstall-am: uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
 
 .MAKE: $(am__recursive_targets) install-am install-strip
 
 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-	check-am clean clean-generic clean-libtool cscopelist-am ctags \
-	ctags-am distclean distclean-generic distclean-libtool \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-dvi \
-	install-dvi-am install-exec install-exec-am install-html \
-	install-html-am install-info install-info-am install-man \
-	install-pdf install-pdf-am install-ps install-ps-am \
+	check-am clean clean-generic clean-libtool clean-sbinPROGRAMS \
+	cscopelist-am ctags ctags-am distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-sbinPROGRAMS \
 	install-sbinSCRIPTS install-strip installcheck installcheck-am \
 	installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
-	uninstall-am uninstall-sbinSCRIPTS
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS \
+	uninstall-sbinSCRIPTS
 
 .PRECIOUS: Makefile
 
@@ -882,6 +1050,10 @@ slurmconfgen.py: slurmconfgen.py.in Makefile
 clean-generic:
 	rm -f opt_modulefiles_slurm slurmconfgen.py
 
+force:
+$(convenience_libs) : force
+	@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/contribs/cray/capmc_resume.c b/contribs/cray/capmc_resume.c
new file mode 100644
index 000000000..1e10bb3f3
--- /dev/null
+++ b/contribs/cray/capmc_resume.c
@@ -0,0 +1,717 @@
+/*****************************************************************************\
+ *  capmc_resume.c - Power up identified nodes with (optional) features.
+ *  Once complete, modify the node's active features as needed.
+ *
+ *  Usage: "capmc_resume <hostlist> [features]"
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#define _GNU_SOURCE	/* For POLLRDHUP */
+
+#if HAVE_JSON_C_INC
+#  include <json-c/json.h>
+#elif HAVE_JSON_INC
+#  include <json/json.h>
+#endif
+
+#include <poll.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "slurm/slurm.h"
+#include "slurm/slurm_errno.h"
+#include "src/common/hostlist.h"
+#include "src/common/log.h"
+#include "src/common/macros.h"
+#include "src/common/parse_config.h"
+#include "src/common/read_config.h"
+#include "src/common/slurm_protocol_api.h"
+#include "src/common/xassert.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
+
+#define MAX_THREADS 256
+
+/* Maximum poll wait time for child processes, in milliseconds */
+#define MAX_POLL_WAIT 500
+
+#define DEFAULT_CAPMC_TIMEOUT 10000	/* 10 seconds */
+#define MIN_CAPMC_TIMEOUT 1000		/* 1 second */
+
+/* Number of times to try performing "node_reinit" operation */
+#define NODE_REINIT_RETRIES 10
+
+/* Number of times to try performing node state change operation */
+#define NODE_STATE_RETRIES 10
+
+/* Static variables */
+static char *capmc_path = NULL;
+static uint32_t capmc_poll_freq = 45;
+static uint32_t capmc_timeout = DEFAULT_CAPMC_TIMEOUT;
+static char *log_file = NULL;
+static bitstr_t *node_bitmap = NULL;
+static char *prog_name = NULL;
+static char *mcdram_mode = NULL, *numa_mode = NULL;
+static char *syscfg_path = NULL;
+
+static pthread_mutex_t thread_cnt_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t  thread_cnt_cond  = PTHREAD_COND_INITIALIZER;
+static int thread_cnt = 0;
+
+/* NOTE: Keep this table synchronized with the table in
+ * src/plugins/node_features/knl_cray/node_features_knl_cray.c */
+static s_p_options_t knl_conf_file_options[] = {
+	{"AllowMCDRAM", S_P_STRING},
+	{"AllowNUMA", S_P_STRING},
+	{"AllowUserBoot", S_P_STRING},
+	{"CapmcPath", S_P_STRING},
+	{"CapmcPollFreq", S_P_UINT32},
+	{"CapmcTimeout", S_P_UINT32},
+	{"DefaultMCDRAM", S_P_STRING},
+	{"DefaultNUMA", S_P_STRING},
+	{"LogFile", S_P_STRING},
+	{"SyscfgPath", S_P_STRING},
+	{NULL}
+};
+
+/* Static functions */
+static s_p_hashtbl_t *_config_make_tbl(char *filename);
+static uint32_t *_json_parse_nids(json_object *jobj, char *key, int *num);
+static void *_node_update(void *args);
+static void _read_config(void);
+static char *_run_script(char **script_argv, int *status);
+static int _tot_wait(struct timeval *start_time);
+
+static s_p_hashtbl_t *_config_make_tbl(char *filename)
+{
+	s_p_hashtbl_t *tbl = NULL;
+
+	xassert(filename);
+
+	if (!(tbl = s_p_hashtbl_create(knl_conf_file_options))) {
+		error("%s: s_p_hashtbl_create error: %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		return tbl;
+	}
+
+	if (s_p_parse_file(tbl, NULL, filename, false) == SLURM_ERROR) {
+		error("%s: s_p_parse_file error: %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		s_p_hashtbl_destroy(tbl);
+		tbl = NULL;
+	}
+
+	return tbl;
+}
+
+static void _read_config(void)
+{
+	char *knl_conf_file;
+	s_p_hashtbl_t *tbl;
+
+	capmc_timeout = DEFAULT_CAPMC_TIMEOUT;
+	knl_conf_file = get_extra_conf_path("knl_cray.conf");
+	if ((tbl = _config_make_tbl(knl_conf_file))) {
+		(void) s_p_get_string(&capmc_path, "CapmcPath", tbl);
+		(void) s_p_get_uint32(&capmc_poll_freq, "CapmcPollFreq", tbl);
+		(void) s_p_get_uint32(&capmc_timeout, "CapmcTimeout", tbl);
+		(void) s_p_get_string(&log_file, "LogFile", tbl);
+		(void) s_p_get_string(&syscfg_path, "SyscfgPath", tbl);
+	}
+	xfree(knl_conf_file);
+	s_p_hashtbl_destroy(tbl);
+	if (!capmc_path)
+		capmc_path = xstrdup("/opt/cray/capmc/default/bin/capmc");
+	capmc_timeout = MAX(capmc_timeout, MIN_CAPMC_TIMEOUT);
+	if (!log_file)
+		log_file = slurm_get_job_slurmctld_logfile();
+}
+
+/*
+ * Return time in msec since "start time"
+ */
+static int _tot_wait(struct timeval *start_time)
+{
+	struct timeval end_time;
+	int msec_delay;
+
+	gettimeofday(&end_time, NULL);
+	msec_delay =   (end_time.tv_sec  - start_time->tv_sec ) * 1000;
+	msec_delay += ((end_time.tv_usec - start_time->tv_usec + 500) / 1000);
+	return msec_delay;
+}
+
+/* Run a script and return its stdout plus exit status */
+static char *_run_script(char **script_argv, int *status)
+{
+	int cc, i, new_wait, resp_size = 0, resp_offset = 0;
+	pid_t cpid;
+	char *resp = NULL;
+	int pfd[2] = { -1, -1 };
+
+	if (access(capmc_path, R_OK | X_OK) < 0) {
+		error("%s: Can not execute: %s", prog_name, capmc_path);
+		*status = 127;
+		resp = xstrdup("Slurm node_features/knl_cray configuration error");
+		return resp;
+	}
+	if (pipe(pfd) != 0) {
+		error("%s: pipe(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		*status = 127;
+		resp = xstrdup("System error");
+		return resp;
+	}
+
+	if ((cpid = fork()) == 0) {
+		cc = sysconf(_SC_OPEN_MAX);
+		dup2(pfd[1], STDERR_FILENO);
+		dup2(pfd[1], STDOUT_FILENO);
+		for (i = 0; i < cc; i++) {
+			if ((i != STDERR_FILENO) && (i != STDOUT_FILENO))
+				close(i);
+		}
+#ifdef SETPGRP_TWO_ARGS
+		setpgrp(0, 0);
+#else
+		setpgrp();
+#endif
+		execv(capmc_path, script_argv);
+		error("%s: execv(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		exit(127);
+	} else if (cpid < 0) {
+		close(pfd[0]);
+		close(pfd[1]);
+		error("%s: fork(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		*status = 127;
+		resp = xstrdup("System error");
+		return resp;
+	} else {
+		struct pollfd fds;
+		struct timeval tstart;
+		resp_size = 1024;
+		resp = xmalloc(resp_size);
+		close(pfd[1]);
+		gettimeofday(&tstart, NULL);
+		while (1) {
+			fds.fd = pfd[0];
+			fds.events = POLLIN | POLLHUP | POLLRDHUP;
+			fds.revents = 0;
+			new_wait = capmc_timeout - _tot_wait(&tstart);
+			if (new_wait <= 0) {
+				error("%s: poll() timeout @ %d msec", prog_name,
+				      capmc_timeout);
+				break;
+			}
+			new_wait = MIN(new_wait, MAX_POLL_WAIT);
+			i = poll(&fds, 1, new_wait);
+			if (i == 0) {
+				continue;
+			} else if (i < 0) {
+				error("%s: poll(): %s", prog_name,
+				      slurm_strerror(slurm_get_errno()));
+				break;
+			}
+			if ((fds.revents & POLLIN) == 0)
+				break;
+			i = read(pfd[0], resp + resp_offset,
+				 resp_size - resp_offset);
+			if (i == 0) {
+				break;
+			} else if (i < 0) {
+				if (errno == EAGAIN)
+					continue;
+				error("%s: read(): %s", prog_name,
+				      slurm_strerror(slurm_get_errno()));
+				break;
+			} else {
+				resp_offset += i;
+				if (resp_offset + 1024 >= resp_size) {
+					resp_size *= 2;
+					resp = xrealloc(resp, resp_size);
+				}
+			}
+		}
+		killpg(cpid, SIGTERM);
+		usleep(10000);
+		killpg(cpid, SIGKILL);
+		waitpid(cpid, status, 0);
+		close(pfd[0]);
+	}
+	return resp;
+}
+
+/* Convert node name string to equivalent nid string */
+static char *_node_names_2_nid_list(char *node_names)
+{
+	char *nid_list = NULL;
+	int i, last_nid_index = -1;
+	bool is_dash = false;
+
+	for (i = 0; node_names[i]; i++) {
+		int nid_index = 0;
+		/* skip "nid[" */
+		if ((node_names[i] < '0') || (node_names[i] > '9'))
+			continue;
+		/* skip leading zeros */
+		while (node_names[i] == '0')
+			i++;
+		if (node_names[i] == '[')
+			i++;
+		while ((node_names[i] >= '0') && (node_names[i] <= '9')) {
+			nid_index *= 10;
+			nid_index += (node_names[i++] - '0');
+		}
+		if (is_dash && (nid_index >= last_nid_index)) {
+			bit_nset(node_bitmap, last_nid_index, nid_index);
+		} else {
+			bit_set(node_bitmap, nid_index);
+		}
+		if ((is_dash = (node_names[i] == '-')))
+			last_nid_index = nid_index;
+		else if (node_names[i] == '\0')
+			break;
+	}
+
+	i = strlen(node_names) + 1;
+	nid_list = xmalloc(i);
+	bit_fmt(nid_list, i, node_bitmap);
+
+	return nid_list;
+}
+
+/* Attempt to shutdown all nodes in a single capmc call.
+ * RET 0 on success, -1 on failure */
+static int _update_all_nodes(char *host_list)
+{
+	char *argv[10], *nid_list, *resp_msg;
+	int rc = 0, status = 0;
+
+	nid_list = _node_names_2_nid_list(host_list);
+
+	if (mcdram_mode) {
+		/* Update MCDRAM mode.
+		* Example: "capmc set_mcdram_cfg –n 43 –m cache" */
+		argv[0] = "capmc";
+		argv[1] = "set_mcdram_cfg";
+		argv[2] = "-m";
+		argv[3] = mcdram_mode;
+		argv[4] = "-n";
+		argv[5] = nid_list;
+		argv[6] = NULL;
+		resp_msg = _run_script(argv, &status);
+		if ((status == 0) ||
+		    (resp_msg && strcasestr(resp_msg, "Success"))) {
+			debug("%s: set_mcdram_cfg sent to %s",
+			      prog_name, argv[5]);
+		} else {
+			error("%s: capmc(%s,%s,%s,%s,%s): %d %s",
+			      prog_name, argv[1], argv[2], argv[3],
+			      argv[4], argv[5], status, resp_msg);
+			rc = -1;
+		}
+		xfree(resp_msg);
+	}
+
+	if (numa_mode && (rc == 0)) {
+		/* Update NUMA mode.
+		 * Example: "capmc set_numa_cfg –m a2a –n 43" */
+		argv[0] = "capmc";
+		argv[1] = "set_numa_cfg";
+		argv[2] = "-m";
+		argv[3] = numa_mode;
+		argv[4] = "-n";
+		argv[5] = nid_list;
+		argv[6] = NULL;
+		resp_msg = _run_script(argv, &status);
+		if ((status == 0) ||
+		    (resp_msg && strcasestr(resp_msg, "Success"))) {
+			debug("%s: set_numa_cfg sent to %s",
+			      prog_name, argv[5]);
+		} else {
+			error("%s: capmc(%s,%s,%s,%s,%s): %d %s",
+			      prog_name, argv[1], argv[2], argv[3],
+			      argv[4], argv[5], status, resp_msg);
+			rc = -1;
+		}
+		xfree(resp_msg);
+	}
+
+	/* Request node restart.
+	 * Example: "capmc node_reinit –n 43" */
+	if (rc == 0) {
+		argv[0] = "capmc";
+		argv[1] = "node_reinit";
+		argv[2] = "-n";
+		argv[3] = nid_list;
+		argv[4] = NULL;
+//		argv[4] = "-r";	/* Future option: Reason */
+//		argv[5] = "Change KNL mode";
+		resp_msg = _run_script(argv, &status);
+		if ((status == 0) ||
+		    (resp_msg && strcasestr(resp_msg, "Success"))) {
+			debug("%s: node_reinit sent to %s",
+			      prog_name, argv[3]);
+		} else {
+			error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+			      argv[1], argv[2], argv[3], status, resp_msg);
+			rc = -1;
+		}
+		xfree(resp_msg);
+	}
+
+	xfree(nid_list);
+
+	return rc;
+}
+
+static void *_node_update(void *args)
+{
+	char *node_name = (char *) args;
+	char *argv[10], nid_str[32], *resp_msg;
+	int i, nid = -1, status = 0;
+	bool node_reinit_sent = false, node_state_sent;
+
+	for (i = 0; node_name[i]; i++) {
+		if ((node_name[i] >= '0') && (node_name[i] <= '9')) {
+			nid = strtol(node_name + i, NULL, 10);
+			break;
+		}
+	}
+	if (nid < 0) {
+		error("%s: No valid NID: %s", prog_name, node_name);
+		goto fini;
+	}
+	bit_set(node_bitmap, nid);
+	snprintf(nid_str, sizeof(nid_str), "%d", nid);
+
+	if (mcdram_mode) {
+		/* Update MCDRAM mode.
+		* Example: "capmc set_mcdram_cfg –n 43 –m cache" */
+		argv[0] = "capmc";
+		argv[1] = "set_mcdram_cfg";
+		argv[2] = "-m";
+		argv[3] = mcdram_mode;
+		argv[4] = "-n";
+		argv[5] = nid_str;
+		argv[6] = NULL;
+		node_state_sent = false;
+		for (i = 0; ((i < NODE_STATE_RETRIES) && !node_state_sent);
+		     i++) {
+			resp_msg = _run_script(argv, &status);
+			if ((status == 0) ||
+			    (resp_msg &&
+			     strcasestr(resp_msg, "Success"))) {
+				debug("%s: set_mcdram_cfg sent to %s",
+				      prog_name, nid_str);
+				node_state_sent = true;
+			} else {
+				error("%s: capmc(%s,%s,%s,%s,%s): %d %s",
+				      prog_name, argv[1], argv[2], argv[3],
+				      argv[4], argv[5], status, resp_msg);
+				sleep(1);
+			}
+			xfree(resp_msg);
+		}
+	}
+
+	if (numa_mode) {
+		/* Update NUMA mode.
+		 * Example: "capmc set_numa_cfg –m a2a –n 43" */
+		argv[0] = "capmc";
+		argv[1] = "set_numa_cfg";
+		argv[2] = "-m";
+		argv[3] = numa_mode;
+		argv[4] = "-n";
+		argv[5] = nid_str;
+		argv[6] = NULL;
+		node_state_sent = false;
+		for (i = 0; ((i < NODE_STATE_RETRIES) && !node_state_sent);
+		     i++) {
+			resp_msg = _run_script(argv, &status);
+			if ((status == 0) ||
+			    (resp_msg &&
+			     strcasestr(resp_msg, "Success"))) {
+				debug("%s: set_numa_cfg sent to %s",
+				      prog_name, nid_str);
+				node_state_sent = true;
+			} else {
+				error("%s: capmc(%s,%s,%s,%s,%s): %d %s",
+				      prog_name, argv[1], argv[2], argv[3],
+				      argv[4], argv[5], status, resp_msg);
+				sleep(1);
+			}
+			xfree(resp_msg);
+		}
+	}
+
+	/* Request node restart.
+	 * Example: "capmc node_reinit –n 43" */
+	argv[0] = "capmc";
+	argv[1] = "node_reinit";
+	argv[2] = "-n";
+	argv[3] = nid_str;
+	argv[4] = NULL;
+//	argv[4] = "-r";	/* Future option: Reason */
+//	argv[5] = "Change KNL mode";
+	for (i = 0; ((i < NODE_REINIT_RETRIES) && !node_reinit_sent); i++) {
+		resp_msg = _run_script(argv, &status);
+		if ((status == 0) ||
+		    (resp_msg && strcasestr(resp_msg, "Success"))) {
+			debug("%s: node_reinit sent to %s", prog_name, nid_str);
+			node_reinit_sent = true;
+		} else {
+			error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+			      argv[1], argv[2], argv[3], status, resp_msg);
+			sleep(1);
+		}
+		xfree(resp_msg);
+	}
+
+	if (!node_reinit_sent) {
+		char *scontrol_input = NULL;
+		xstrfmtcat(scontrol_input,
+			   "%s/bin/scontrol update nodename=%s state=DOWN Reason=reboot_failure",
+			   SLURM_PREFIX, node_name);
+		(void) system(scontrol_input);
+		xfree(scontrol_input);
+	}
+
+fini:	slurm_mutex_lock(&thread_cnt_mutex);
+	thread_cnt--;
+	pthread_cond_signal(&thread_cnt_cond);
+	slurm_mutex_unlock(&thread_cnt_mutex);
+	return NULL;
+}
+
+static uint32_t *_json_parse_nids(json_object *jobj, char *key, int *num)
+{
+	json_object *j_array = NULL;
+	json_object *j_value = NULL;
+	enum json_type j_type;
+	uint32_t *ents;
+	int i, cnt;
+
+	*num = 0;
+        json_object_object_get_ex(jobj, key, &j_array);
+	if (!j_array) {
+		debug("%s: key=%s not found in nid specification",
+		      prog_name, key);
+		return NULL;
+	}
+
+	cnt = json_object_array_length(j_array);
+	ents = xmalloc(sizeof(uint32_t) * cnt);
+	for (i = 0; i < cnt; i++) {
+		j_value = json_object_array_get_idx(j_array, i);
+		j_type = json_object_get_type(j_value);
+		if (j_type != json_type_int) {
+			error("%s: Unable to parse nid specification",
+			      prog_name);
+			break;
+		} else {
+			ents[i] = (uint32_t) json_object_get_int64(j_value);
+			*num = i + 1;
+		}
+	}
+	return ents;
+}
+
+/* Wait for all identified computed nodes to enter "on" state */
+static void _wait_all_nodes_on(void)
+{
+	char *argv[10], *resp_msg;
+	int i, nid_cnt = 0, status = 0;
+	json_object *j;
+	uint32_t *nid_array;
+	time_t start_time = time(NULL);
+
+	while ((difftime(time(NULL), start_time) < (30 * 60)) &&
+	       (bit_set_count(node_bitmap) > 0)) {
+		sleep(capmc_poll_freq);
+		argv[0] = "capmc";
+		argv[1] = "node_status";
+		argv[2] = NULL;
+		resp_msg = _run_script(argv, &status);
+		if (status != 0) {
+			error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+				argv[1], argv[2], argv[3], status, resp_msg);
+			break;
+		}
+		j = json_tokener_parse(resp_msg);
+		if (j == NULL) {
+			error("%s: json parser failed on %s",
+			      prog_name, resp_msg);
+			xfree(resp_msg);
+			break;
+		}
+		xfree(resp_msg);
+		nid_cnt = 0;
+		nid_array = _json_parse_nids(j, "on", &nid_cnt);
+		json_object_put(j);	/* Frees json memory */
+		for (i = 0; i < nid_cnt; i++) {
+			bit_clear(node_bitmap, nid_array[i]);
+		}
+		xfree(nid_array);
+	}
+}
+
+int main(int argc, char *argv[])
+{
+	log_options_t log_opts = LOG_OPTS_INITIALIZER;
+	char *features, *save_ptr = NULL, *tok;
+	update_node_msg_t node_msg;
+	int rc =  SLURM_SUCCESS;
+	hostlist_t hl = NULL;
+	char *node_name;
+	pthread_attr_t attr_work;
+	pthread_t thread_work = 0;
+
+	xstrfmtcat(prog_name, "%s[%u]", argv[0], (uint32_t) getpid());
+	_read_config();
+	log_opts.stderr_level = LOG_LEVEL_QUIET;
+	log_opts.syslog_level = LOG_LEVEL_QUIET;
+	if (slurm_get_debug_flags() && DEBUG_FLAG_NODE_FEATURES)
+		log_opts.logfile_level += 3;
+	(void) log_init(argv[0], log_opts, LOG_DAEMON, log_file);
+
+	if ((argc < 2) || (argc > 3)) {
+		fprintf(stderr, "Usage: hostlist [mode]\n");
+		error("Usage: hostlist [mode]");
+		exit(2);
+	}
+
+	/* Parse the MCDRAM and NUMA boot options */
+	if (argc == 3) {
+		features = xstrdup(argv[2]);
+		tok = strtok_r(features, ",", &save_ptr);
+		while (tok) {
+			printf("%s\n", tok);
+			if (!strcasecmp(tok, "a2a")  ||
+			    !strcasecmp(tok, "hemi") ||
+			    !strcasecmp(tok, "quad") ||
+			    !strcasecmp(tok, "snc2") ||
+			    !strcasecmp(tok, "snc4")) {
+				xfree(numa_mode);
+				numa_mode = xstrdup(tok);
+			} else if (!strcasecmp(tok, "cache")  ||
+				   !strcasecmp(tok, "split") ||
+				   !strcasecmp(tok, "equal") ||
+				   !strcasecmp(tok, "flat")) {
+				xfree(mcdram_mode);
+				mcdram_mode = xstrdup(tok);
+			}
+			tok = strtok_r(NULL, ",", &save_ptr);
+		}
+		xfree(features);
+	}
+
+	/* Attempt to update and restart all nodes in a single capmc call,
+	 * attempt to update and restart individual nodes only if that fails. */
+	node_bitmap = bit_alloc(100000);
+	if (_update_all_nodes(argv[1]) != 0) {
+		/* Spawn threads to change MCDRAM and NUMA states and start node
+		 * reboot process */
+		if ((hl = hostlist_create(argv[1])) == NULL) {
+			error("%s: Invalid hostlist (%s)", prog_name, argv[1]);
+			exit(2);
+		}
+		while ((node_name = hostlist_pop(hl))) {
+			slurm_mutex_lock(&thread_cnt_mutex);
+			while (1) {
+				if (thread_cnt <= MAX_THREADS) {
+					thread_cnt++;
+					break;
+				} else {   /* wait for state change and retry */
+					pthread_cond_wait(&thread_cnt_cond,
+							  &thread_cnt_mutex);
+				}
+			}
+			slurm_mutex_unlock(&thread_cnt_mutex);
+
+			slurm_attr_init(&attr_work);
+			(void) pthread_attr_setdetachstate
+				(&attr_work, PTHREAD_CREATE_DETACHED);
+			if (pthread_create(&thread_work, &attr_work,
+					   _node_update, (void *) node_name)) {
+				_node_update((void *) node_name);
+			}
+			slurm_attr_destroy(&attr_work);
+		}
+		hostlist_destroy(hl);
+
+		/* Wait for work threads to complete */
+		slurm_mutex_lock(&thread_cnt_mutex);
+		while (1) {
+			if (thread_cnt == 0)
+				break;
+			else	/* wait for state change and retry */
+				pthread_cond_wait(&thread_cnt_cond,
+						  &thread_cnt_mutex);
+		}
+		slurm_mutex_unlock(&thread_cnt_mutex);
+	}
+	xfree(mcdram_mode);
+	xfree(numa_mode);
+
+	/* Wait for all nodes to change state to "on" */
+	_wait_all_nodes_on();
+
+	if ((argc == 3) && !syscfg_path) {
+		slurm_init_update_node_msg(&node_msg);
+		node_msg.node_names = argv[1];
+		node_msg.features_act = argv[2];
+		rc = slurm_update_node(&node_msg);
+	}
+
+	if (rc == SLURM_SUCCESS) {
+		exit(0);
+	} else {
+		error("%s: slurm_update_node(\'%s\', \'%s\'): %s\n",
+		      prog_name, argv[1], argv[2],
+		      slurm_strerror(slurm_get_errno()));
+		exit(1);
+	}
+
+	bit_free(node_bitmap);
+	xfree(prog_name);
+	exit(0);
+}
diff --git a/contribs/cray/capmc_suspend.c b/contribs/cray/capmc_suspend.c
new file mode 100644
index 000000000..3161cebaf
--- /dev/null
+++ b/contribs/cray/capmc_suspend.c
@@ -0,0 +1,543 @@
+/*****************************************************************************\
+ *  capmc_suspend.c - Power down identified nodes
+ *
+ *  Usage: "capmc_suspend <hostlist>"
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#define _GNU_SOURCE	/* For POLLRDHUP */
+
+#if HAVE_JSON_C_INC
+#  include <json-c/json.h>
+#elif HAVE_JSON_INC
+#  include <json/json.h>
+#endif
+
+#include <poll.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "slurm/slurm.h"
+#include "slurm/slurm_errno.h"
+#include "src/common/hostlist.h"
+#include "src/common/log.h"
+#include "src/common/macros.h"
+#include "src/common/parse_config.h"
+#include "src/common/read_config.h"
+#include "src/common/slurm_protocol_api.h"
+#include "src/common/xassert.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
+
+#define MAX_THREADS 256
+
+/* Maximum poll wait time for child processes, in milliseconds */
+#define MAX_POLL_WAIT 500
+
+#define DEFAULT_CAPMC_TIMEOUT 10000	/* 10 seconds */
+#define MIN_CAPMC_TIMEOUT 1000		/* 1 second */
+
+/* Number of times to try performing "node_off" operation */
+#define NODE_OFF_RETRIES 10
+
+/* How long to wait for a node to enter "off" state, in seconds */
+#define NODE_OFF_STATE_WAIT (30 * 60)
+
+/* Static variables */
+static char *capmc_path = NULL;
+static uint32_t capmc_poll_freq = 45;   /* capmc state polling frequency */
+static uint32_t capmc_timeout = DEFAULT_CAPMC_TIMEOUT;
+static char *log_file = NULL;
+static char *prog_name = NULL;
+
+static pthread_mutex_t thread_cnt_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t  thread_cnt_cond  = PTHREAD_COND_INITIALIZER;
+static int thread_cnt = 0;
+
+/* NOTE: Keep this table synchronized with the table in
+ * src/plugins/node_features/knl_cray/node_features_knl_cray.c */
+static s_p_options_t knl_conf_file_options[] = {
+	{"AllowMCDRAM", S_P_STRING},
+	{"AllowNUMA", S_P_STRING},
+	{"AllowUserBoot", S_P_STRING},
+	{"CapmcPath", S_P_STRING},
+	{"CapmcPollFreq", S_P_UINT32},
+	{"CapmcTimeout", S_P_UINT32},
+	{"DefaultMCDRAM", S_P_STRING},
+	{"DefaultNUMA", S_P_STRING},
+	{"LogFile", S_P_STRING},
+	{"SyscfgPath", S_P_STRING},
+	{NULL}
+};
+
+static bool _check_node_state(int nid, char *nid_str, char *state);
+static s_p_hashtbl_t *_config_make_tbl(char *filename);
+static uint32_t *_json_parse_nids(json_object *jobj, char *key, int *num);
+static void *_node_update(void *args);
+static void _read_config(void);
+static char *_run_script(char **script_argv, int *status);
+static int _tot_wait(struct timeval *start_time);
+static int _update_all_nodes(char *node_names);
+
+static s_p_hashtbl_t *_config_make_tbl(char *filename)
+{
+	s_p_hashtbl_t *tbl = NULL;
+
+	xassert(filename);
+
+	if (!(tbl = s_p_hashtbl_create(knl_conf_file_options))) {
+		error("%s: s_p_hashtbl_create error: %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		return tbl;
+	}
+
+	if (s_p_parse_file(tbl, NULL, filename, false) == SLURM_ERROR) {
+		error("%s: s_p_parse_file error: %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		s_p_hashtbl_destroy(tbl);
+		tbl = NULL;
+	}
+
+	return tbl;
+}
+
+static void _read_config(void)
+{
+	char *knl_conf_file;
+	s_p_hashtbl_t *tbl;
+
+	capmc_timeout = DEFAULT_CAPMC_TIMEOUT;
+	knl_conf_file = get_extra_conf_path("knl_cray.conf");
+	if ((tbl = _config_make_tbl(knl_conf_file))) {
+		(void) s_p_get_string(&capmc_path, "CapmcPath", tbl);
+		(void) s_p_get_uint32(&capmc_poll_freq, "CapmcPollFreq", tbl);
+		(void) s_p_get_uint32(&capmc_timeout, "CapmcTimeout", tbl);
+		(void) s_p_get_string(&log_file, "LogFile", tbl);
+	}
+	xfree(knl_conf_file);
+	s_p_hashtbl_destroy(tbl);
+	if (!capmc_path)
+		capmc_path = xstrdup("/opt/cray/capmc/default/bin/capmc");
+	capmc_timeout = MAX(capmc_timeout, MIN_CAPMC_TIMEOUT);
+	if (!log_file)
+		log_file = slurm_get_job_slurmctld_logfile();
+}
+
+/*
+ * Return time in msec since "start time"
+ */
+static int _tot_wait(struct timeval *start_time)
+{
+	struct timeval end_time;
+	int msec_delay;
+
+	gettimeofday(&end_time, NULL);
+	msec_delay =   (end_time.tv_sec  - start_time->tv_sec ) * 1000;
+	msec_delay += ((end_time.tv_usec - start_time->tv_usec + 500) / 1000);
+	return msec_delay;
+}
+
+/* Run a script and return its stdout plus exit status */
+static char *_run_script(char **script_argv, int *status)
+{
+	int cc, i, new_wait, resp_size = 0, resp_offset = 0;
+	pid_t cpid;
+	char *resp = NULL;
+	int pfd[2] = { -1, -1 };
+
+	if (access(capmc_path, R_OK | X_OK) < 0) {
+		error("%s: Can not execute: %s", prog_name, capmc_path);
+		*status = 127;
+		resp = xstrdup("Slurm node_features/knl_cray configuration error");
+		return resp;
+	}
+	if (pipe(pfd) != 0) {
+		error("%s: pipe(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		*status = 127;
+		resp = xstrdup("System error");
+		return resp;
+	}
+
+	if ((cpid = fork()) == 0) {
+		cc = sysconf(_SC_OPEN_MAX);
+		dup2(pfd[1], STDERR_FILENO);
+		dup2(pfd[1], STDOUT_FILENO);
+		for (i = 0; i < cc; i++) {
+			if ((i != STDERR_FILENO) && (i != STDOUT_FILENO))
+				close(i);
+		}
+#ifdef SETPGRP_TWO_ARGS
+		setpgrp(0, 0);
+#else
+		setpgrp();
+#endif
+		execv(capmc_path, script_argv);
+		error("%s: execv(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		exit(127);
+	} else if (cpid < 0) {
+		close(pfd[0]);
+		close(pfd[1]);
+		error("%s: fork(): %s", prog_name,
+		      slurm_strerror(slurm_get_errno()));
+		*status = 127;
+		resp = xstrdup("System error");
+		return resp;
+	} else {
+		struct pollfd fds;
+		struct timeval tstart;
+		resp_size = 1024;
+		resp = xmalloc(resp_size);
+		close(pfd[1]);
+		gettimeofday(&tstart, NULL);
+		while (1) {
+			fds.fd = pfd[0];
+			fds.events = POLLIN | POLLHUP | POLLRDHUP;
+			fds.revents = 0;
+			new_wait = capmc_timeout - _tot_wait(&tstart);
+			if (new_wait <= 0) {
+				error("%s: poll() timeout @ %d msec", prog_name,
+				      capmc_timeout);
+				break;
+			}
+			new_wait = MIN(new_wait, MAX_POLL_WAIT);
+			i = poll(&fds, 1, new_wait);
+			if (i == 0) {
+				continue;
+			} else if (i < 0) {
+				error("%s: poll(): %s", prog_name,
+				      slurm_strerror(slurm_get_errno()));
+				break;
+			}
+			if ((fds.revents & POLLIN) == 0)
+				break;
+			i = read(pfd[0], resp + resp_offset,
+				 resp_size - resp_offset);
+			if (i == 0) {
+				break;
+			} else if (i < 0) {
+				if (errno == EAGAIN)
+					continue;
+				error("%s: read(): %s", prog_name,
+				      slurm_strerror(slurm_get_errno()));
+				break;
+			} else {
+				resp_offset += i;
+				if (resp_offset + 1024 >= resp_size) {
+					resp_size *= 2;
+					resp = xrealloc(resp, resp_size);
+				}
+			}
+		}
+		killpg(cpid, SIGTERM);
+		usleep(10000);
+		killpg(cpid, SIGKILL);
+		waitpid(cpid, status, 0);
+		close(pfd[0]);
+	}
+	return resp;
+}
+
+static uint32_t *_json_parse_nids(json_object *jobj, char *key, int *num)
+{
+	json_object *j_array = NULL;
+	json_object *j_value = NULL;
+	enum json_type j_type;
+	uint32_t *ents;
+	int i, cnt;
+
+	*num = 0;
+        json_object_object_get_ex(jobj, key, &j_array);
+	if (!j_array) {
+		debug("%s: key=%s not found in nid specification",
+		      prog_name, key);
+		return NULL;
+	}
+
+	cnt = json_object_array_length(j_array);
+	ents = xmalloc(sizeof(uint32_t) * cnt);
+	for (i = 0; i < cnt; i++) {
+		j_value = json_object_array_get_idx(j_array, i);
+		j_type = json_object_get_type(j_value);
+		if (j_type != json_type_int) {
+			error("%s: Unable to parse nid specification",
+			      prog_name);
+			break;
+		} else {
+			ents[i] = (uint32_t) json_object_get_int64(j_value);
+			*num = i + 1;
+		}
+	}
+	return ents;
+}
+
+static bool _check_node_state(int nid, char *nid_str, char *state)
+{
+	bool node_state_ok = false;
+	char *argv[10], *resp_msg;
+	int i, nid_cnt, status = 0;
+	uint32_t *nid_array;
+	json_object *j;
+
+	argv[0] = "capmc";
+	argv[1] = "node_status";
+	argv[2] = "-n";
+	argv[3] = nid_str;
+	argv[4] = NULL;
+	resp_msg = _run_script(argv, &status);
+	if (status != 0) {
+		error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+			argv[1], argv[2], argv[3], status, resp_msg);
+		xfree(resp_msg);
+		return node_state_ok;
+	}
+	j = json_tokener_parse(resp_msg);
+	if (j == NULL) {
+		error("%s: json parser failed on %s", prog_name, resp_msg);
+		xfree(resp_msg);
+		return node_state_ok;
+	}
+	xfree(resp_msg);
+
+	nid_cnt = 0;
+	nid_array = _json_parse_nids(j, "off", &nid_cnt);
+	json_object_put(j);	/* Frees json memory */
+	for (i = 0; i < nid_cnt; i++) {
+		if (nid_array[i] == nid) {
+			node_state_ok = true;
+			break;
+		}
+	}
+	xfree(nid_array);
+
+	return node_state_ok;
+}
+
+static void *_node_update(void *args)
+{
+	char *node_name = (char *) args;
+	char *argv[10], nid_str[32], *resp_msg;
+	int i, nid = -1, status = 0;
+	bool node_state_ok, node_off_sent = false;
+	time_t poll_start;
+
+	for (i = 0; node_name[i]; i++) {
+		if ((node_name[i] >= '0') && (node_name[i] <= '9')) {
+			nid = strtol(node_name + i, NULL, 10);
+			break;
+		}
+	}
+	if (nid < 0) {
+		error("%s: No valid NID: %s", prog_name, node_name);
+		return NULL;
+	}
+	snprintf(nid_str, sizeof(nid_str), "%d", nid);
+
+	/* Request node power down.
+	 * Example: "capmc node_off –n 43" */
+	argv[0] = "capmc";
+	argv[1] = "node_off";
+	argv[2] = "-n";
+	argv[3] = nid_str;
+	argv[4] = NULL;
+	for (i = 0; ((i < NODE_OFF_RETRIES) && !node_off_sent); i++) {
+		resp_msg = _run_script(argv, &status);
+		if ((status == 0) ||
+		    (resp_msg && strcasestr(resp_msg, "Success"))) {
+			debug("%s: node_off sent to %s", prog_name, argv[3]);
+			node_off_sent = true;
+		} else {
+			error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+			      argv[1], argv[2], argv[3], status, resp_msg);
+			sleep(1);
+		}
+		xfree(resp_msg);
+	}
+
+	/* Wait for node in "off" state */
+	poll_start = time(NULL);
+	while (!node_state_ok &&
+	      (difftime(time(NULL), poll_start) < NODE_OFF_STATE_WAIT)) {
+		sleep(capmc_poll_freq);
+		node_state_ok = _check_node_state(nid, nid_str, "off");
+	}
+
+	slurm_mutex_lock(&thread_cnt_mutex);
+	thread_cnt--;
+	pthread_cond_signal(&thread_cnt_cond);
+	slurm_mutex_unlock(&thread_cnt_mutex);
+	return NULL;
+}
+
+/* Convert node name string to equivalent nid string */
+static char *_node_names_2_nid_list(char *node_names)
+{
+	char *nid_list = NULL;
+	int i, last_nid_index = -1;
+	bool is_dash = false;
+	bitstr_t *node_bitmap;
+
+	node_bitmap = bit_alloc(100000);
+	for (i = 0; node_names[i]; i++) {
+		int nid_index = 0;
+		/* skip "nid[" */
+		if ((node_names[i] < '0') || (node_names[i] > '9'))
+			continue;
+		/* skip leading zeros */
+		while (node_names[i] == '0')
+			i++;
+		if (node_names[i] == '[')
+			i++;
+		while ((node_names[i] >= '0') && (node_names[i] <= '9')) {
+			nid_index *= 10;
+			nid_index += (node_names[i++] - '0');
+		}
+		if (is_dash && (nid_index >= last_nid_index)) {
+			bit_nset(node_bitmap, last_nid_index, nid_index);
+		} else {
+			bit_set(node_bitmap, nid_index);
+		}
+		if ((is_dash = (node_names[i] == '-')))
+			last_nid_index = nid_index;
+		else if (node_names[i] == '\0')
+			break;
+	}
+
+	i = strlen(node_names) + 1;
+	nid_list = xmalloc(i);
+	bit_fmt(nid_list, i, node_bitmap);
+	bit_free(node_bitmap);
+
+	return nid_list;
+}
+
+/* Attempt to shutdown all nodes in a single capmc call.
+ * RET 0 on success, -1 on failure */
+static int _update_all_nodes(char *node_names)
+{
+	char *argv[10], *nid_list, *resp_msg;
+	int rc = -1, status = 0;
+
+	nid_list = _node_names_2_nid_list(node_names);
+	if (nid_list == NULL)
+		return -1;
+
+	/* Request node power down.
+	 * Example: "capmc node_off –n 43" */
+	argv[0] = "capmc";
+	argv[1] = "node_off";
+	argv[2] = "-n";
+	argv[3] = nid_list;
+	argv[4] = NULL;
+	resp_msg = _run_script(argv, &status);
+	if ((status == 0) ||
+	    (resp_msg && strcasestr(resp_msg, "Success"))) {
+		debug("%s: node_off sent to %s", prog_name, argv[3]);
+		rc = 0;
+	} else {
+		error("%s: capmc(%s,%s,%s): %d %s", prog_name,
+		      argv[1], argv[2], argv[3], status, resp_msg);
+	}
+	xfree(resp_msg);
+	xfree(nid_list);
+	return rc;
+}
+
+int main(int argc, char *argv[])
+{
+	log_options_t log_opts = LOG_OPTS_INITIALIZER;
+	hostlist_t hl = NULL;
+	char *node_name;
+	pthread_attr_t attr_work;
+	pthread_t thread_work = 0;
+
+	xstrfmtcat(prog_name, "%s[%u]", argv[0], (uint32_t) getpid());
+	_read_config();
+	log_opts.stderr_level = LOG_LEVEL_QUIET;
+	log_opts.syslog_level = LOG_LEVEL_QUIET;
+	if (slurm_get_debug_flags() && DEBUG_FLAG_NODE_FEATURES)
+		log_opts.logfile_level += 3;
+	(void) log_init(argv[0], log_opts, LOG_DAEMON, log_file);
+
+	/* Attempt to shutdown all nodes in a single capmc call,
+	 * attempt to shutdown individual nodes only if that fails. */
+	if (_update_all_nodes(argv[1]) != 0) {
+		if ((hl = hostlist_create(argv[1])) == NULL) {
+			error("%s: Invalid hostlist (%s)", prog_name, argv[1]);
+			exit(2);
+		}
+		while ((node_name = hostlist_pop(hl))) {
+			slurm_mutex_lock(&thread_cnt_mutex);
+			while (1) {
+				if (thread_cnt <= MAX_THREADS) {
+					thread_cnt++;
+					break;
+				} else {   /* wait for state change and retry */
+					pthread_cond_wait(&thread_cnt_cond,
+							  &thread_cnt_mutex);
+				}
+			}
+			slurm_mutex_unlock(&thread_cnt_mutex);
+
+			slurm_attr_init(&attr_work);
+			(void) pthread_attr_setdetachstate
+				(&attr_work, PTHREAD_CREATE_DETACHED);
+			if (pthread_create(&thread_work, &attr_work,
+					    _node_update, (void *) node_name)) {
+				_node_update((void *) node_name);
+			}
+			slurm_attr_destroy(&attr_work);
+		}
+		hostlist_destroy(hl);
+	}
+
+	/* Wait for work threads to complete */
+	slurm_mutex_lock(&thread_cnt_mutex);
+	while (1) {
+		if (thread_cnt == 0)
+			break;
+		else	/* wait for state change and retry */
+			pthread_cond_wait(&thread_cnt_cond, &thread_cnt_mutex);
+	}
+	slurm_mutex_unlock(&thread_cnt_mutex);
+
+	xfree(prog_name);
+	exit(0);
+}
diff --git a/contribs/cray/csm/Makefile.in b/contribs/cray/csm/Makefile.in
index 14608a002..dc3ee5254 100644
--- a/contribs/cray/csm/Makefile.in
+++ b/contribs/cray/csm/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/cray/csm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -170,8 +171,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -271,6 +270,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -309,6 +312,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -352,6 +358,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -402,6 +411,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/cray/slurm.conf.template b/contribs/cray/slurm.conf.template
index fad2379c8..52e3f66f0 100644
--- a/contribs/cray/slurm.conf.template
+++ b/contribs/cray/slurm.conf.template
@@ -13,7 +13,6 @@ ControlMachine=sdb
 #BackupAddr=
 #
 AuthType=auth/munge
-CacheGroups=0
 #CheckpointType=checkpoint/none
 CoreSpecPlugin=cray
 CryptoType=crypto/munge
diff --git a/contribs/lua/Makefile.in b/contribs/lua/Makefile.in
index e1f3d68c9..4c47da5e7 100644
--- a/contribs/lua/Makefile.in
+++ b/contribs/lua/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/lua
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/mic/Makefile.in b/contribs/mic/Makefile.in
index 91f3a1959..11072af5d 100644
--- a/contribs/mic/Makefile.in
+++ b/contribs/mic/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/mic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/openlava/Makefile.am b/contribs/openlava/Makefile.am
new file mode 100644
index 000000000..7c183baf1
--- /dev/null
+++ b/contribs/openlava/Makefile.am
@@ -0,0 +1,31 @@
+#
+# Makefile for openlava scripts
+
+AUTOMAKE_OPTIONS = foreign
+
+bin_SCRIPTS = bjobs bkill bsub lsid
+
+bjobs:
+bkill:
+bsub:
+lsid:
+
+_perldir=$(exec_prefix)`perl -e 'use Config; $$T=$$Config{installsitearch}; $$P=$$Config{installprefix}; $$P1="$$P/local"; $$T =~ s/$$P1//; $$T =~ s/$$P//; print $$T;'`
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(DESTDIR)$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	   echo "sed 's%use lib .*%use lib qw(${_perldir});%' $(top_srcdir)/contribs/openlava/$$p.pl > $(DESTDIR)$(bindir)/$$p"; \
+	   sed "s%use lib .*%use lib qw(${_perldir});%" $(top_srcdir)/contribs/openlava/$$p.pl >$(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$p"; \
+	done
+
+clean:
diff --git a/contribs/openlava/Makefile.in b/contribs/openlava/Makefile.in
new file mode 100644
index 000000000..ddf8cb41d
--- /dev/null
+++ b/contribs/openlava/Makefile.in
@@ -0,0 +1,678 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#
+# Makefile for openlava scripts
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contribs/openlava
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(bindir)"
+SCRIPTS = $(bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+bin_SCRIPTS = bjobs bkill bsub lsid
+_perldir = $(exec_prefix)`perl -e 'use Config; $$T=$$Config{installsitearch}; $$P=$$Config{installprefix}; $$P1="$$P/local"; $$T =~ s/$$P1//; $$T =~ s/$$P//; print $$T;'`
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contribs/openlava/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign contribs/openlava/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-binSCRIPTS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-binSCRIPTS
+
+.PRECIOUS: Makefile
+
+
+bjobs:
+bkill:
+bsub:
+lsid:
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(DESTDIR)$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	   echo "sed 's%use lib .*%use lib qw(${_perldir});%' $(top_srcdir)/contribs/openlava/$$p.pl > $(DESTDIR)$(bindir)/$$p"; \
+	   sed "s%use lib .*%use lib qw(${_perldir});%" $(top_srcdir)/contribs/openlava/$$p.pl >$(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$p"; \
+	done
+
+clean:
+
+# 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/contribs/openlava/bjobs.pl b/contribs/openlava/bjobs.pl
new file mode 100644
index 000000000..498fab7db
--- /dev/null
+++ b/contribs/openlava/bjobs.pl
@@ -0,0 +1,210 @@
+#! /usr/bin/perl -w
+###############################################################################
+#
+# bjobs - displays and filters information about jobs in familar
+#         openlava format.
+#
+#
+###############################################################################
+#  Copyright (C) 2015 SchedMD LLC.
+#  Written by Danny Auble <da@schedmd.com>.
+#
+#  This file is part of SLURM, a resource management program.
+#  For details, see <http://slurm.schedmd.com/>.
+#  Please also read the included file: DISCLAIMER.
+#
+#  SLURM is free software; you can redistribute it and/or modify it under
+#  the terms of the GNU General Public License as published by the Free
+#  Software Foundation; either version 2 of the License, or (at your option)
+#  any later version.
+#
+#  In addition, as a special exception, the copyright holders give permission
+#  to link the code of portions of this program with the OpenSSL library under
+#  certain conditions as described in each individual source file, and
+#  distribute linked combinations including the two. You must obey the GNU
+#  General Public License in all respects for all of the code used other than
+#  OpenSSL. If you modify file(s) with this exception, you may extend this
+#  exception to your version of the file(s), but you are not obligated to do
+#  so. If you do not wish to do so, delete this exception statement from your
+#  version.  If you delete this exception statement from all source files in
+#  the program, then also delete it here.
+#
+#  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+#  details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with SLURM; if not, write to the Free Software Foundation, Inc.,
+#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+#
+###############################################################################
+
+#use strict;
+use FindBin;
+use Getopt::Long 2.24 qw(:config no_ignore_case);
+use lib "${FindBin::Bin}/../lib/perl";
+use autouse 'Pod::Usage' => qw(pod2usage);
+use Slurm ':all';
+use Slurmdb ':all'; # needed for getting the correct cluster dims
+use Switch;
+
+################################################################################
+# $humanReadableTime = _hr_time($epochTime)
+# Converts an epoch time into a human readable time
+################################################################################
+sub _hr_time
+{
+	my ($epoch_time) = @_;
+
+	if ($epoch_time == INFINITE) {
+		return "Infinite";
+	}
+
+	my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
+	my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) =
+		localtime $epoch_time;
+
+	return sprintf("%s %d %02d:%02d", $abbr[$mon], $mday, $hour, $min);
+}
+
+sub _shrink_char
+{
+	my ($str, $max_len) = @_;
+
+	if (!defined($$str)) {
+		$$str = "";
+	} elsif (length($$str) > $max_len) {
+		$$str = '*' . substr($$str, -($max_len - 1));
+	}
+}
+
+sub _print_job_brief
+{
+	my ($job, $line_num) = @_;
+
+	if (!$line_num) {
+		printf("%-7s %-7s %-5s %-10s %-11s %-11s %-10s %s\n",
+		       "JOBID", "USER", "STAT", "QUEUE",  "FROM_HOST",
+		       "EXEC_HOST", "JOB_NAME", "SUBMIT_TIME");
+	}
+
+	_shrink_char(\$job->{'user_name'}, 7);
+	_shrink_char(\$job->{'partition'}, 10);
+	_shrink_char(\$job->{'alloc_node'}, 11);
+	_shrink_char(\$job->{'nodes'}, 11);
+	_shrink_char(\$job->{'name'}, 10);
+
+	printf("%-7.7s %-7.7s %-5.5s %-10.10s %-11.11s %-11.11s %-10s %-12.12s\n",
+	       $job->{'job_id'}, $job->{'user_name'},
+	       $job->{'job_state_str'},
+	       $job->{'partition'}, $job->{'alloc_node'}, $job->{'nodes'},
+	       $job->{'name'}, _hr_time($job->{'submit_time'}));
+}
+
+# Parse Command Line Arguments
+my ($help,
+    $man);
+
+GetOptions(
+        'h' => \$help,
+        'man'    => \$man,
+	) or pod2usage(2);
+
+
+# Display usage if necessary
+pod2usage(0) if $help;
+if ($man)
+{
+        if ($< == 0)    # Cannot invoke perldoc as root
+        {
+		my $id = eval { getpwnam("nobody") };
+		$id = eval { getpwnam("nouser") } unless defined $id;
+		$id = -2                          unless defined $id;
+		$<  = $id;
+        }
+        $> = $<;                         # Disengage setuid
+        $ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
+        delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+        if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
+        else { die "Illegal characters were found in \$0 ($0)\n"; }
+        pod2usage(-exitstatus => 0, -verbose => 2);
+}
+
+# Use sole remaining argument as job_ids
+my @job_ids;
+if (@ARGV) {
+        @job_ids = @ARGV;
+}
+
+my $job_flags = SHOW_ALL | SHOW_DETAIL;
+my $resp = Slurm->load_jobs(0, $job_flags);
+if(!$resp) {
+	die "Problem loading jobs.\n";
+}
+
+my $line = 0;
+foreach my $job (@{$resp->{job_array}}) {
+	my $state = $job->{'job_state'};
+
+	switch($state) {
+		case [JOB_RUNNING]   { $job->{job_state_str} = 'RUN' }
+		case [JOB_PENDING]   { $job->{job_state_str} = 'PEND' }
+		case [JOB_SUSPENDED] { $job->{job_state_str} = 'SUSP' }
+	}
+
+	next unless $job->{job_state_str};
+
+	$job->{'name'} = "Allocation" if !$job->{'name'};
+	$job->{'user_name'} = getpwuid($job->{'user_id'});
+
+	# Filter jobs according to options and arguments
+	if (@job_ids) {
+		next unless grep /^$job->{'job_id'}/, @job_ids;
+	}
+
+	_print_job_brief($job, $line++);
+}
+
+if (!$line) {
+	print "No unfinished job found\n";
+}
+
+exit 0;
+
+##############################################################################
+
+__END__
+
+=head1 NAME
+
+B<bjobs> - displays and filters information about jobs in familar openlava format.
+
+=head1 SYNOPSIS
+
+B<bjobs> I<job_id>...
+
+=head1 DESCRIPTION
+
+The B<bjobs> displays and filters information about jobs in familar openlava format.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h | --help>
+
+brief help message
+
+=item B<--man>
+
+full documentation
+
+=back
+
+=head1 EXIT STATUS
+
+On success, B<bjobs> will exit with a value of zero. On failure, B<bkill> will exit with a value greater than zero.
+
+=cut
+
diff --git a/contribs/openlava/bkill.pl b/contribs/openlava/bkill.pl
new file mode 100644
index 000000000..ee10dbefd
--- /dev/null
+++ b/contribs/openlava/bkill.pl
@@ -0,0 +1,154 @@
+#! /usr/bin/perl -w
+###############################################################################
+#
+# bkill - deletes slurm jobs in familar openlava format.
+#
+#
+###############################################################################
+#  Copyright (C) 2015 SchedMD LLC.
+#  Written by Danny Auble <da@schedmd.com>.
+#
+#  This file is part of SLURM, a resource management program.
+#  For details, see <http://slurm.schedmd.com/>.
+#  Please also read the included file: DISCLAIMER.
+#
+#  SLURM is free software; you can redistribute it and/or modify it under
+#  the terms of the GNU General Public License as published by the Free
+#  Software Foundation; either version 2 of the License, or (at your option)
+#  any later version.
+#
+#  In addition, as a special exception, the copyright holders give permission
+#  to link the code of portions of this program with the OpenSSL library under
+#  certain conditions as described in each individual source file, and
+#  distribute linked combinations including the two. You must obey the GNU
+#  General Public License in all respects for all of the code used other than
+#  OpenSSL. If you modify file(s) with this exception, you may extend this
+#  exception to your version of the file(s), but you are not obligated to do
+#  so. If you do not wish to do so, delete this exception statement from your
+#  version.  If you delete this exception statement from all source files in
+#  the program, then also delete it here.
+#
+#  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+#  details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with SLURM; if not, write to the Free Software Foundation, Inc.,
+#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+#
+###############################################################################
+
+#use strict;
+use FindBin;
+use Getopt::Long 2.24 qw(:config no_ignore_case);
+use lib "${FindBin::Bin}/../lib/perl";
+use autouse 'Pod::Usage' => qw(pod2usage);
+use Slurm ':all';
+use POSIX qw(:signal_h);
+
+# Parse Command Line Arguments
+my ($help,
+    $man);
+
+GetOptions(
+        'h' => \$help,
+        'man'    => \$man,
+	)
+	or pod2usage(2);
+
+# Display usage if necessary
+pod2usage(0) if $help;
+if ($man)
+{
+        if ($< == 0)    # Cannot invoke perldoc as root
+        {
+		my $id = eval { getpwnam("nobody") };
+		$id = eval { getpwnam("nouser") } unless defined $id;
+		$id = -2                          unless defined $id;
+		$<  = $id;
+        }
+        $> = $<;                         # Disengage setuid
+        $ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
+        delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+        if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
+        else { die "Illegal characters were found in \$0 ($0)\n"; }
+        pod2usage(-exitstatus => 0, -verbose => 2);
+}
+
+# Use sole remaining argument as job_ids
+my @job_ids;
+if (@ARGV) {
+        @job_ids = @ARGV;
+} else {
+        pod2usage(2);
+}
+
+# OpenLava goes through the list beforehand verifying before it processes
+# and exits on first error.
+foreach my $jobid (@job_ids) {
+	if ($jobid !~ /^\d+$/) {
+		printf("%s: Illegal job ID.\n", $jobid);
+		exit 1;
+	}
+}
+
+my $rc = 0;
+foreach my $jobid (@job_ids) {
+	my $err = 0;
+	my $resp = 0;
+
+	for (my $i=0; $i<3; $i++) {
+		$resp = Slurm->kill_job($jobid, SIGKILL);
+		$err = Slurm->get_errno();
+		if($resp == SLURM_SUCCESS
+		   || ($err ne ESLURM_TRANSITION_STATE_NO_UPDATE
+		       && $err ne ESLURM_JOB_PENDING)) {
+			last;
+		}
+	}
+	if ($resp == SLURM_ERROR) {
+		$rc++;
+		printf("Job <%s>: %s\n", $jobid, Slurm->strerror($err));
+	} else {
+		printf("Job <%s> is being terminated\n", $jobid);
+	}
+}
+exit $rc;
+
+##############################################################################
+
+__END__
+
+=head1 NAME
+
+B<bkill> - deletes jobs in a familiar openlava format
+
+=head1 SYNOPSIS
+
+B<bkill> I<job_id>...
+
+=head1 DESCRIPTION
+
+The B<bkill> command cancels the specified jobs.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h | --help>
+
+brief help message
+
+=item B<--man>
+
+full documentation
+
+=back
+
+=head1 EXIT STATUS
+
+On success, B<bkill> will exit with a value of zero. On failure, B<bkill> will exit with a value greater than zero.
+
+=cut
+
diff --git a/contribs/openlava/bsub.pl b/contribs/openlava/bsub.pl
new file mode 100644
index 000000000..6de3e3913
--- /dev/null
+++ b/contribs/openlava/bsub.pl
@@ -0,0 +1,399 @@
+#! /usr/bin/perl -w
+###############################################################################
+#
+# bsub - submit jobs in familar openlava format.
+#
+#
+###############################################################################
+#  Copyright (C) 2015 SchedMD LLC.
+#  Written by Danny Auble <da@schedmd.com>.
+#
+#  This file is part of SLURM, a resource management program.
+#  For details, see <http://slurm.schedmd.com/>.
+#  Please also read the included file: DISCLAIMER.
+#
+#  SLURM is free software; you can redistribute it and/or modify it under
+#  the terms of the GNU General Public License as published by the Free
+#  Software Foundation; either version 2 of the License, or (at your option)
+#  any later version.
+#
+#  In addition, as a special exception, the copyright holders give permission
+#  to link the code of portions of this program with the OpenSSL library under
+#  certain conditions as described in each individual source file, and
+#  distribute linked combinations including the two. You must obey the GNU
+#  General Public License in all respects for all of the code used other than
+#  OpenSSL. If you modify file(s) with this exception, you may extend this
+#  exception to your version of the file(s), but you are not obligated to do
+#  so. If you do not wish to do so, delete this exception statement from your
+#  version.  If you delete this exception statement from all source files in
+#  the program, then also delete it here.
+#
+#  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+#  details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with SLURM; if not, write to the Free Software Foundation, Inc.,
+#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+#
+###############################################################################
+
+use strict;
+use FindBin;
+use Getopt::Long 2.24 qw(:config no_ignore_case require_order);
+use lib "${FindBin::Bin}/../lib/perl";
+use autouse 'Pod::Usage' => qw(pod2usage);
+use Slurm ':all';
+use Slurmdb ':all'; # needed for getting the correct cluster dims
+use Switch;
+
+my (#$start_time,
+    #$account,
+    #$array,
+    $workdir,
+    $err_path,
+    #$export_env,
+    $exclusive,
+    $interactive,
+    #$hold,
+    #$resource_list,
+    #$mail_options,
+    #$mail_user_list,
+    $job_name,
+    $node_list,
+    $mem_limit,
+    $min_proc,
+    $out_path,
+    #$priority,
+    $partition,
+    $time,
+    #$variable_list,
+    #@additional_attributes,
+    $help,
+    $man);
+
+my $sbatch = "${FindBin::Bin}/sbatch";
+my $salloc = "${FindBin::Bin}/salloc";
+my $srun = "${FindBin::Bin}/srun";
+
+GetOptions(#'a=s'      => \$start_time,
+	   #'A=s'      => \$account,
+	   'cwd=s'    => \$workdir,
+	   'e=s'      => \$err_path,
+	   #'h'        => \$hold,
+	   'I'        => \$interactive,
+	   #'j:s'      => sub { warn "option -j is the default, " .
+	   'J=s'      => \$job_name,
+	   #"stdout/stderr go into the same file\n" },
+	   #'J=s'      => \$array,
+	   #'l=s'      => \$resource_list,
+	   'm=s'      => \$node_list,
+	   'M=s'      => \$mem_limit,
+	   'n=s'      => \$min_proc,
+	   'o=s'      => \$out_path,
+	   #'p=i'      => \$priority,
+	   'q=s'      => \$partition,
+	   #'S=s'      => sub { warn "option -S is ignored, " .
+	   # "specify shell via #!<shell> in the job script\n" },
+	   #'t=s'      => \$array,
+	   #'v=s'      => \$variable_list,
+	   #'V'        => \$export_env,
+	   #'W=s'      => \@additional_attributes,
+	   'W=s'      => \$time,
+	   'x'        => \$exclusive,
+	   'help|?'   => \$help,
+	   'man'      => \$man,
+	   )
+	or pod2usage(2);
+
+# Display usage if necessary
+pod2usage(0) if $help;
+if ($man) {
+	#print "i man if";
+        if ($< == 0) {   # Cannot invoke perldoc as root
+		my $id = eval { getpwnam("nobody") };
+		$id = eval { getpwnam("nouser") } unless defined $id;
+		$id = -2                          unless defined $id;
+		$<  = $id;
+        }
+        $> = $<;                         # Disengage setuid
+        $ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
+        delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+        if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
+        else { die "Illegal characters were found in \$0 ($0)\n"; }
+        pod2usage(-exitstatus => 0, -verbose => 2);
+}
+
+# Use sole remaining argument as the exe or script
+my $script;
+if ($ARGV[0]) {
+	foreach (@ARGV) {
+	        $script .= "$_ ";
+	}
+} else {
+	$interactive = 1;
+	foreach (<STDIN>) {
+		chomp($_);
+		$script .= "$_\n";
+	}
+}
+#print "script = $script";
+
+my $command = $sbatch;
+
+if (!$script) {
+	if ($interactive) {
+		print "Full interactive mode is not currently possible.  Please give me a command to run.\n";
+		exit 1;
+	} else {
+		pod2usage(2);
+	}
+}
+
+$command .= " -e $err_path" if $err_path;
+$command .= " -o $out_path" if $out_path;
+
+$command .= " -D $workdir" if $workdir;
+
+#print " command = $command\n";
+
+
+#$command .= " -n$node_opts{task_cnt}" if $ntask_cnt;
+
+if ($node_list) {
+	my $node_list_tmp = _parse_node_list($node_list);
+	$command .= " -w $node_list_tmp";
+}
+
+$command .= " --mem=$mem_limit"   if $mem_limit;
+$command .= " -J $job_name" if $job_name;
+
+if ($min_proc) {
+	my $min_proc_tmp = _parse_procs($min_proc);
+	$command .= " -n $min_proc_tmp";
+}
+$command .= " -t $time" if $time;
+$command .= " -p $partition" if $partition;
+$command .= " --exclusive" if $exclusive;
+
+# Here we are checking to see if the file is a known bsub script.
+# If it isn't wrap it.  We have seen with certain scripts they need $0
+# to point to the original script's name.  Since Slurm will rename the
+# batch script when it gets ran on a compute node it breaks the $0
+# functionality.  If we wrap it the problem is solved.
+if ($interactive || !_check_bsub_script($ARGV[0])) {
+	$command .=" --wrap=\"$script\"";
+} else {
+	$command .= " $script";
+}
+#print " command = $command\n";
+#exit;
+
+# Execute the command and capture its stdout, stderr, and exit status. Note
+# that if interactive mode was requested, the standard output and standard
+# error are _not_ captured.
+
+# Execute the command and capture the combined stdout and stderr.
+my @command_output = `$command 2>&1`;
+
+#Save the command exit status.
+my $command_exit_status = $?;
+
+# If available, extract the job ID from the command output and print
+# it to stdout, as done in the OpenLava version of bsub.
+if ($command_exit_status == 0) {
+	my @spcommand_output=split(" ",
+				   $command_output[$#command_output]);
+	my $job_id = $spcommand_output[$#spcommand_output];
+	_print_job_submitted($job_id);
+} else {
+	print("There was an error running the Slurm sbatch command.\n" .
+	      "The command was:\n" .
+	      "'$command'\n" .
+	      "and the output was:\n" .
+	      "'@command_output'\n");
+}
+# Exit with the command return code.
+exit($command_exit_status >> 8);
+
+sub _get_default_partition_name {
+
+	my $resp = Slurm->load_partitions(0, SHOW_ALL);
+	if(!$resp) {
+		die "Problem loading partitions.\n";
+	}
+
+	foreach my $part (@{$resp->{partition_array}}) {
+
+		if ($part->{flags} & PART_FLAG_DEFAULT) { # Default
+			return $part->{name};
+		}
+	}
+	return "Unknown";
+}
+
+sub _print_job_submitted {
+	my ($job_id) = @_;
+
+	print "Job <$job_id> is submitted to ";
+	if (!$partition) {
+		print "default queue <" . _get_default_partition_name() . ">\n";
+	} else {
+		print "queue <$partition>\n";
+	}
+}
+
+# Get the process count
+sub _parse_procs {
+	my ($procs_range) = @_;
+
+	# Get the max process count if it exists
+	if ($procs_range =~ /,/) {
+		my @sub_parts = split(/,/, $procs_range);
+			return $sub_parts[1];
+	} else {
+		return $procs_range;
+	}
+}
+
+sub _check_bsub_script {
+	my ($script) = @_;
+
+	my $rc = 0;
+
+	if (open (my $file, "<$script")) {
+		my $line = <$file>;
+
+		# check to make sure this is a script to begin with
+		if ($line =~ /\#!/) {
+			# Now check the first lines and make sure the first line
+			# that isn't a comment is a #BSUB line.  If it isn't
+			# we will presume this file needs to be wrapped.
+			while ($line = <$file>) {
+				next if ($line =~ /^$/);
+
+				if ($line =~ /^\#BSUB/) {
+					$rc = 1;
+				} elsif ($line =~ /^\#/) {
+					next;
+				}
+
+				last;
+			}
+		}
+
+		close $file;
+	}
+
+	return $rc;
+}
+
+sub _parse_node_list {
+	my ($node_string) = @_;
+	my $hostlist = "";
+
+	# Create the hostlist for formating
+	my $hl = Slurm::Hostlist::create("");
+
+	my @sub_parts = split(/ /, $node_string);
+	foreach my $sub_part (@sub_parts) {
+		if(!Slurm::Hostlist::push($hl, $sub_part)) {
+			print "problem pushing host $sub_part onto hostlist\n";
+		}
+	}
+
+        $hostlist = Slurm::Hostlist::ranged_string($hl);;
+	my $hl_cnt = Slurm::Hostlist::count($hl);
+
+	return $hostlist;
+}
+
+##############################################################################
+
+__END__
+
+=head1 NAME
+
+B<bsub> - submit a batch job in a familiar OpenLava format
+
+=head1 SYNOPSIS
+
+bsub
+      [-cwd Working Directory Path]
+      [-e Error Path]
+      [-I Interactive Mode]
+      [-m Node List]
+      [-M Memory Limit]
+      [-n Min Process]
+      [-o Output Path]
+      [-q Queue Name]
+      [-W Time]
+      [-x Exclusive]
+      [-h]
+      [script]
+
+=head1 DESCRIPTION
+
+The B<bsub> submits batch jobs. It is aimed to be feature-compatible with OpenLavas' bsub.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-cwd Working Directory Path>
+
+Specify the working directory path for the job.
+
+=item B<-e Error Path>
+
+Specify a new path to receive the standard error output for the job.
+
+=item B<-I>
+
+Interactive execution.
+
+=item B<-J Job Name>
+
+Name if the job to be submitted.
+
+=item B<-m Host List>
+
+Space seperated list of hosts that this job will run on.
+
+=item B<-M Memory Limit>
+
+Memory limit of the job.
+
+=item B<-n Min Processes>
+
+Minimum number of processes for the job.
+
+=item B<-o out_path>
+
+Specify the path to a file to hold the standard output from the job.
+
+=item B<-q Queue>
+
+The partition that this job will run on.
+
+=item B<-W Time>
+
+Run time of the job.
+
+=item B<-x Exclusive>
+
+Run this job in exclusive mode. Job will not share nodes with other jobs.
+
+=item B<-?> | B<--help>
+
+brief help message
+
+=item B<--man>
+
+full documentation
+
+=back
+
+=cut
+
diff --git a/contribs/openlava/lsid.pl b/contribs/openlava/lsid.pl
new file mode 100644
index 000000000..e1b5bcfb3
--- /dev/null
+++ b/contribs/openlava/lsid.pl
@@ -0,0 +1,140 @@
+#! /usr/bin/perl -w
+###############################################################################
+#
+# lsid - Displays the current Slurm version number, the cluster name,
+#        and the master host name.
+#
+#
+###############################################################################
+#  Copyright (C) 2015 SchedMD LLC.
+#  Written by Danny Auble <da@schedmd.com>.
+#
+#  This file is part of SLURM, a resource management program.
+#  For details, see <http://slurm.schedmd.com/>.
+#  Please also read the included file: DISCLAIMER.
+#
+#  SLURM is free software; you can redistribute it and/or modify it under
+#  the terms of the GNU General Public License as published by the Free
+#  Software Foundation; either version 2 of the License, or (at your option)
+#  any later version.
+#
+#  In addition, as a special exception, the copyright holders give permission
+#  to link the code of portions of this program with the OpenSSL library under
+#  certain conditions as described in each individual source file, and
+#  distribute linked combinations including the two. You must obey the GNU
+#  General Public License in all respects for all of the code used other than
+#  OpenSSL. If you modify file(s) with this exception, you may extend this
+#  exception to your version of the file(s), but you are not obligated to do
+#  so. If you do not wish to do so, delete this exception statement from your
+#  version.  If you delete this exception statement from all source files in
+#  the program, then also delete it here.
+#
+#  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+#  details.
+#
+#  You should have received a copy of the GNU General Public License along
+#  with SLURM; if not, write to the Free Software Foundation, Inc.,
+#  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+#
+###############################################################################
+
+#use strict;
+use FindBin;
+use Getopt::Long 2.24 qw(:config no_ignore_case);
+use lib "${FindBin::Bin}/../lib/perl";
+use autouse 'Pod::Usage' => qw(pod2usage);
+use Slurm ':all';
+use POSIX qw(:signal_h);
+
+sub _convert_version_date
+{
+	my ($ver) = @_;
+	my @api = split(/\./, $ver);
+	my @month_name = qw(Jan Feb Mar Apr May Jun Jul Aug Sept Oct Nov Dec);
+
+	return "$month_name[$api[1]-1] 1 20$api[0]";
+}
+
+# Parse Command Line Arguments
+my ($help,
+    $man);
+
+GetOptions(
+        'help|h' => \$help,
+        'man'    => \$man,
+	)
+	or pod2usage(2);
+
+# Display usage if necessary
+pod2usage(0) if $help;
+if ($man)
+{
+        if ($< == 0)    # Cannot invoke perldoc as root
+        {
+		my $id = eval { getpwnam("nobody") };
+		$id = eval { getpwnam("nouser") } unless defined $id;
+		$id = -2                          unless defined $id;
+		$<  = $id;
+        }
+        $> = $<;                         # Disengage setuid
+        $ENV{PATH} = "/bin:/usr/bin";    # Untaint PATH
+        delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV'};
+        if ($0 =~ /^([-\/\w\.]+)$/) { $0 = $1; }    # Untaint $0
+        else { die "Illegal characters were found in \$0 ($0)\n"; }
+        pod2usage(-exitstatus => 0, -verbose => 2);
+}
+
+my $rc = 0;
+
+my $resp = Slurm->load_ctl_conf();
+
+if ($resp) {
+	printf("Slurm %s, %s\n", $resp->{version},
+	       _convert_version_date($resp->{version}));
+	printf("Copyright SchedMD LLC, 2010-2015.\n\n");
+	printf("My cluster name is %s\n", $resp->{cluster_name});
+	printf("My master name is %s\n", $resp->{control_machine});
+} else {
+	$rc = 1;
+}
+
+exit $rc;
+
+##############################################################################
+
+__END__
+
+=head1 NAME
+
+B<lsid> - displays the current Slurm version number, the cluster name, and the master host name
+
+=head1 SYNOPSIS
+
+B<lsid>
+
+=head1 DESCRIPTION
+
+The B<lsid> command displays the current Slurm version number, the cluster name, and the master host name.
+
+=head1 OPTIONS
+
+=over 4
+
+=item B<-h | --help>
+
+brief help message
+
+=item B<--man>
+
+full documentation
+
+=back
+
+=head1 EXIT STATUS
+
+On success, B<lsid> will exit with a value of zero. On failure, B<lsid> will exit with a value greater than zero.
+
+=cut
+
diff --git a/contribs/pam/Makefile.in b/contribs/pam/Makefile.in
index 75a8704fa..5a16b539f 100644
--- a/contribs/pam/Makefile.in
+++ b/contribs/pam/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/pam
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -256,8 +257,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -357,6 +356,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -395,6 +398,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -438,6 +444,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -488,6 +497,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/pam/pam_slurm.c b/contribs/pam/pam_slurm.c
index f75eb55d7..0968a9c13 100644
--- a/contribs/pam/pam_slurm.c
+++ b/contribs/pam/pam_slurm.c
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  $Id$
+ *  pam_slurm.c
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/contribs/pam_slurm_adopt/Makefile.in b/contribs/pam_slurm_adopt/Makefile.in
index 1acd68896..92d7c76df 100644
--- a/contribs/pam_slurm_adopt/Makefile.in
+++ b/contribs/pam_slurm_adopt/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/pam_slurm_adopt
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -260,8 +261,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -361,6 +360,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -399,6 +402,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -442,6 +448,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -492,6 +501,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/pam_slurm_adopt/helper.c b/contribs/pam_slurm_adopt/helper.c
index 04bddf42c..1ace1447a 100644
--- a/contribs/pam_slurm_adopt/helper.c
+++ b/contribs/pam_slurm_adopt/helper.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
- *  $Id$
+ *  pam_slurm_adopt/helper.c
  *****************************************************************************
- *
  *  Useful portions extracted from pam_slurm.c by Ryan Cox <ryan_cox@byu.edu>
  *
  *  Copyright (C) 2002-2007 The Regents of the University of California.
diff --git a/contribs/perlapi/Makefile.in b/contribs/perlapi/Makefile.in
index 1b3377f91..6c5ab00aa 100644
--- a/contribs/perlapi/Makefile.in
+++ b/contribs/perlapi/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/perlapi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/perlapi/libslurm/Makefile.in b/contribs/perlapi/libslurm/Makefile.in
index b023335ca..6c31c5303 100644
--- a/contribs/perlapi/libslurm/Makefile.in
+++ b/contribs/perlapi/libslurm/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/perlapi/libslurm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/perlapi/libslurm/perl/Slurm.xs b/contribs/perlapi/libslurm/perl/Slurm.xs
index 0463d2a10..7bda2050d 100644
--- a/contribs/perlapi/libslurm/perl/Slurm.xs
+++ b/contribs/perlapi/libslurm/perl/Slurm.xs
@@ -1534,7 +1534,7 @@ slurm_job_step_layout_get(slurm_t self, uint32_t job_id, uint32_t step_id)
 		RETVAL
 
 HV *
-slurm_job_step_stat(slurm_t self, uint32_t job_id, uint32_t step_id, char *nodelist=NULL)
+slurm_job_step_stat(slurm_t self, uint32_t job_id, uint32_t step_id, char *nodelist=NULL, uint16_t protocol_version)
 	PREINIT:
 		int rc;
 		job_step_stat_response_msg_t *resp_msg;
@@ -1544,7 +1544,8 @@ slurm_job_step_stat(slurm_t self, uint32_t job_id, uint32_t step_id, char *nodel
 			      out of the mix Slurm-> doesn't work,
 			      only Slurm::
 			    */
-		rc = slurm_job_step_stat(job_id, step_id, nodelist, &resp_msg);
+                rc = slurm_job_step_stat(job_id, step_id, nodelist,
+					 protocol_version, &resp_msg);
 		if (rc == SLURM_SUCCESS) {
 			RETVAL = newHV();
 			sv_2mortal((SV*)RETVAL);
diff --git a/contribs/perlapi/libslurm/perl/job.c b/contribs/perlapi/libslurm/perl/job.c
index 5247d5cda..ce6de5940 100644
--- a/contribs/perlapi/libslurm/perl/job.c
+++ b/contribs/perlapi/libslurm/perl/job.c
@@ -38,7 +38,6 @@ static uint32_t _threads_per_core(char *host)
 	if (!job_node_ptr || !host)
 		return threads;
 
-	slurm_mutex_lock(&job_node_info_lock);
 	for (i = 0; i < job_node_ptr->record_count; i++) {
 		if (job_node_ptr->node_array[i].name &&
 		    !strcmp(host, job_node_ptr->node_array[i].name)) {
@@ -46,7 +45,7 @@ static uint32_t _threads_per_core(char *host)
 			break;
 		}
 	}
-	slurm_mutex_unlock(&job_node_info_lock);
+
 	return threads;
 }
 
diff --git a/contribs/perlapi/libslurm/perl/node.c b/contribs/perlapi/libslurm/perl/node.c
index e001da59d..34c34b009 100644
--- a/contribs/perlapi/libslurm/perl/node.c
+++ b/contribs/perlapi/libslurm/perl/node.c
@@ -39,9 +39,11 @@ node_info_to_hv(node_info_t *node_info, uint16_t node_scaling, HV *hv)
 	STORE_FIELD(hv, node_info, cores, uint16_t);
 	STORE_FIELD(hv, node_info, cpu_load, uint32_t);
 	STORE_FIELD(hv, node_info, cpus, uint16_t);
-	if(node_info->features)
+	if (node_info->features)
 		STORE_FIELD(hv, node_info, features, charp);
-	if(node_info->gres)
+	if (node_info->features_act)
+		STORE_FIELD(hv, node_info, features_act, charp);
+	if (node_info->gres)
 		STORE_FIELD(hv, node_info, gres, charp);
 	if (node_info->name)
 		STORE_FIELD(hv, node_info, name, charp);
@@ -106,6 +108,7 @@ hv_to_node_info(HV *hv, node_info_t *node_info)
 	FETCH_FIELD(hv, node_info, cpu_load, uint32_t, TRUE);
 	FETCH_FIELD(hv, node_info, cpus, uint16_t, TRUE);
 	FETCH_FIELD(hv, node_info, features, charp, FALSE);
+	FETCH_FIELD(hv, node_info, features_act, charp, FALSE);
 	FETCH_FIELD(hv, node_info, gres, charp, FALSE);
 	FETCH_FIELD(hv, node_info, name, charp, TRUE);
 	FETCH_FIELD(hv, node_info, node_state, uint32_t, TRUE);
@@ -209,6 +212,7 @@ hv_to_update_node_msg(HV *hv, update_node_msg_t *update_msg)
 	FETCH_FIELD(hv, update_msg, node_state, uint32_t, FALSE);
 	FETCH_FIELD(hv, update_msg, reason, charp, FALSE);
 	FETCH_FIELD(hv, update_msg, features, charp, FALSE);
+	FETCH_FIELD(hv, update_msg, features_act, charp, FALSE);
 	FETCH_FIELD(hv, update_msg, weight, uint32_t, FALSE);
 	return 0;
 }
diff --git a/contribs/perlapi/libslurm/perl/partition.c b/contribs/perlapi/libslurm/perl/partition.c
index d454d9db6..11d900eb7 100644
--- a/contribs/perlapi/libslurm/perl/partition.c
+++ b/contribs/perlapi/libslurm/perl/partition.c
@@ -64,7 +64,8 @@ partition_info_to_hv(partition_info_t *part_info, HV *hv)
 	if (part_info->nodes)
 		STORE_FIELD(hv, part_info, nodes, charp);
 	STORE_FIELD(hv, part_info, preempt_mode, uint16_t);
-	STORE_FIELD(hv, part_info, priority, uint16_t);
+	STORE_FIELD(hv, part_info, priority_job_factor, uint16_t);
+	STORE_FIELD(hv, part_info, priority_tier, uint16_t);
 	if (part_info->qos_char)
 		STORE_FIELD(hv, part_info, qos_char, charp);
 	STORE_FIELD(hv, part_info, state_up, uint16_t);
@@ -120,7 +121,8 @@ hv_to_partition_info(HV *hv, partition_info_t *part_info)
 	}
 	FETCH_FIELD(hv, part_info, nodes, charp, FALSE);
 	FETCH_FIELD(hv, part_info, preempt_mode, uint16_t, TRUE);
-	FETCH_FIELD(hv, part_info, priority, uint16_t, TRUE);
+	FETCH_FIELD(hv, part_info, priority_job_factor, uint16_t, TRUE);
+	FETCH_FIELD(hv, part_info, priority_tier, uint16_t, TRUE);
 	FETCH_FIELD(hv, part_info, qos_char, charp, TRUE);
 	FETCH_FIELD(hv, part_info, state_up, uint16_t, TRUE);
 	FETCH_FIELD(hv, part_info, total_cpus, uint32_t, TRUE);
@@ -212,7 +214,8 @@ hv_to_update_part_msg(HV *hv, update_part_msg_t *part_msg)
 	FETCH_FIELD(hv, part_msg, name, charp, TRUE);
 	/*not used node_inx */
 	FETCH_FIELD(hv, part_msg, nodes, charp, FALSE);
-	FETCH_FIELD(hv, part_msg, priority, uint16_t, FALSE);
+	FETCH_FIELD(hv, part_msg, priority_job_factor, uint16_t, FALSE);
+	FETCH_FIELD(hv, part_msg, priority_tier, uint16_t, FALSE);
 	FETCH_FIELD(hv, part_msg, state_up, uint16_t, FALSE);
 	FETCH_FIELD(hv, part_msg, total_cpus, uint32_t, FALSE);
 	FETCH_FIELD(hv, part_msg, total_nodes, uint32_t, FALSE);
diff --git a/contribs/perlapi/libslurm/perl/slurm-perl.h b/contribs/perlapi/libslurm/perl/slurm-perl.h
index 05adb5f4b..951cad88d 100644
--- a/contribs/perlapi/libslurm/perl/slurm-perl.h
+++ b/contribs/perlapi/libslurm/perl/slurm-perl.h
@@ -11,9 +11,9 @@
 /* these declaration are not in slurm.h */
 #ifndef xfree
 #define xfree(__p) \
-	slurm_xfree((void **)&(__p), __FILE__, __LINE__, __FUNCTION__)
+	slurm_xfree((void **)&(__p), __FILE__, __LINE__, __func__)
 #define xmalloc(__sz) \
-	slurm_xmalloc (__sz, true, __FILE__, __LINE__, __FUNCTION__)
+	slurm_xmalloc (__sz, true, __FILE__, __LINE__, __func__)
 #endif
 
 extern void slurm_xfree(void **, const char *, int, const char *);
diff --git a/contribs/perlapi/libslurmdb/Makefile.in b/contribs/perlapi/libslurmdb/Makefile.in
index faa62da24..a325e1f7e 100644
--- a/contribs/perlapi/libslurmdb/Makefile.in
+++ b/contribs/perlapi/libslurmdb/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/perlapi/libslurmdb
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/phpext/Makefile.in b/contribs/phpext/Makefile.in
index f9cd48687..ffd1fd762 100644
--- a/contribs/phpext/Makefile.in
+++ b/contribs/phpext/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/phpext
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/phpext/slurm_php/config.m4.in b/contribs/phpext/slurm_php/config.m4.in
index 166637760..66dad3094 100644
--- a/contribs/phpext/slurm_php/config.m4.in
+++ b/contribs/phpext/slurm_php/config.m4.in
@@ -1,6 +1,4 @@
 ##*****************************************************************************
-## $Id: config.m4 8863 2006-08-10 18:47:55Z da $
-##*****************************************************************************
 #  AUTHOR:
 #    Danny Auble <da@llnl.gov>
 #
diff --git a/contribs/pmi2/Makefile.in b/contribs/pmi2/Makefile.in
index fe48bedf7..da1edb64c 100644
--- a/contribs/pmi2/Makefile.in
+++ b/contribs/pmi2/Makefile.in
@@ -95,7 +95,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/pmi2
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -253,8 +254,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -354,6 +353,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -392,6 +395,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -435,6 +441,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -485,6 +494,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/pmi2/pmi2_util.h b/contribs/pmi2/pmi2_util.h
index 5b53dc816..9e7d8a83b 100644
--- a/contribs/pmi2/pmi2_util.h
+++ b/contribs/pmi2/pmi2_util.h
@@ -17,22 +17,12 @@
 #define TRUE  1
 #define FALSE 0
 
-#ifdef HAVE__FUNCTION__
-#define PMI2U_FUNC __FUNCTION__
-#elif defined(HAVE_CAP__FUNC__)
-#define PMI2U_FUNC __FUNC__
-#elif defined(HAVE__FUNC__)
-#define PMI2U_FUNC __func__
-#else
-#define PMI2U_FUNC __FILE__
-#endif
-
 #ifdef DEBUG
     #define PMI2U_printf(x...) do {				\
 	char logstr[1024];					\
 	snprintf(logstr, 1024, x);      			\
 	fprintf(stderr, "[%s (%d): %s] %s\n",			\
-		__FILE__, __LINE__, __FUNCTION__, logstr);	\
+		__FILE__, __LINE__, __func__, logstr);		\
     } while (0)
 #else
     #define PMI2U_printf(x...)
diff --git a/contribs/pmi2/testpmi2.c b/contribs/pmi2/testpmi2.c
index 29748e90a..f8b756151 100644
--- a/contribs/pmi2/testpmi2.c
+++ b/contribs/pmi2/testpmi2.c
@@ -1,6 +1,6 @@
 
 /*****************************************************************************\
- *  testpmi2.c
+ *  testpmi2.c - reservation creation function for scontrol.
  *****************************************************************************
  *  Copyright (C) 2014 SchedMD LLC
  *  Written by David Bigagli <david@schedmd.com>
diff --git a/contribs/ptrace.patch b/contribs/ptrace.patch
deleted file mode 100644
index f947336bc..000000000
--- a/contribs/ptrace.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-<http://linux.llnl.gov/software/kernel/ptrace.html>
-
-The Linux kernels must implement ptrace semantics required by the TotalView
-debugger. In order to initiate a parallel job under debugger control, a
-resource manager or job launch utility must be able to start all tasks
-in a stopped state, notify TotalView, and then allow TotalView debugger
-servers to attach to all tasks. This functionality requires the ability to:
-
-    * Detach from a traced process and leave the process stopped
-    * Attach to a stopped process
-
-Most newer versions of the Linux kernel support this functionality. For
-some older Linux kernels, both of the above are impossible without the
-following patch by Vic Zandy:
-
-    * initial posting <http://seclists.org/linux-kernel/2001/Dec/5146.html>
-    * follow up <http://seclists.org/lists/linux-kernel/2002/Mar/4490.html>
-
-Further discussion of Vic's patch can be found in this thread
-<http://seclists.org/lists/linux-kernel/2003/Mar/4457.html>. The main
-objections to the patch seemed to be
-
-    * It causes a behavior change for ptrace()
-    * No apparent agreement on the "right" thing to do when attaching to
-      a stopped process.
-
-[Any Etnus or Quadrics references to patches available?]
-
-On a vanilla 2.6.4 kernel, the ptrace() test is able to accomplish part
-1 of the test (detaching from a process and leaving the process
-stopped), but part 2 (attaching to a stopped process) appears to still
-be failing.
-
-It is possible to workaround a failure of step 2. Technically, it is not
-the attach that hangs when doing a ptrace() of a stopped process, but
-the subsequent call to waitpid(). Since the process was already stopped,
-the waitpid() never returns. Perhaps Etnus has implemented a workaround
-for this behavior.
-
-Testing:
-
-The followinbg piece of test code can be used to verify that the proper
-functionality exists in the current kernel:
-
-testptrace.c  <http://linux.llnl.gov/software/kernel/testptrace.c>
-
-This test should succeed when run without any arguments.
-
-------------------------------------------------------------------------
-
-<http://www.seclists.org/lists/linux-kernel/202/Mar/4490.html>
-
-Linux Kernel: Re: [PATCH] ptrace on stopped processes (2.4)
-From: Vic Zandy@cs.wisc.edu
-Date: Mar 18 2002
-
-
-This is a repost of the ptrace patch to 2.4 kernels
-we've discussed in recent months.
-
-Since the last post, I have updated it to linux 2.4.18
-(no changes) and tested it with subterfuge and uml.
-
-Subterfuge seems to be unaffected.
-
-UML needs minor modifications; I've discussed them with
-Jeff Dike and (I believe) he is happy.
-
-I believe I have addressed everyone's concerns.
-
-The patch fixes these two bugs:
-
-    1. gdb and other tools cannot attach to a stopped
-    process. The wait that follows the PTRACE_ATTACH
-    will block indefinitely.
-
-    2. It is not possible to use PTRACE_DETACH to leave
-    a process stopped, because ptrace ignores SIGSTOPs
-    sent by the tracing process.
-
-Vic
-
---- /home/vic/p/linux-2.4.18.orig/kernel/ptrace.c Wed Mar 13 13:14:54 2002
-+++ /home/vic/p/linux-2.4.18/kernel/ptrace.c Mon Mar 18 21:58:11 2002
-@@ -54,6 +54,7 @@
- 
- int ptrace_attach(struct task_struct *task)
- {
-+ int stopped;
-         task_lock(task);
-         if (task->pid <= 1)
-                 goto bad;
-@@ -90,7 +91,13 @@
-         }
-         write_unlock_irq(&tasklist_lock);
- 
-+ stopped = (task->state == TASK_STOPPED);
-         send_sig(SIGSTOP, task, 1);
-+ /* If it was stopped when we got here,
-+ clear the pending SIGSTOP. */
-+ if (stopped)
-+ wake_up_process(task);
-+
-         return 0;
- 
- bad:
---- /home/vic/p/linux-2.4.18.orig/arch/i386/kernel/signal.c Wed Mar 13
-13:16:44 2002
-+++ /home/vic/p/linux-2.4.18/arch/i386/kernel/signal.c Wed Mar 13
-16:31:38 2002
-@@ -620,9 +620,9 @@
-                                 continue;
-                         current->exit_code = 0;
- 
-- /* The debugger continued. Ignore SIGSTOP. */
-- if (signr == SIGSTOP)
-- continue;
-+ /* The debugger continued. */
-+ if (signr == SIGSTOP && current->ptrace & PT_PTRACED)
-+ continue; /* ignore SIGSTOP */
- 
-                         /* Update the siginfo structure. Is this good? */
-                         if (signr != info.si_signo) {
--
-
-------------------------------------------------------------------------
diff --git a/contribs/seff/Makefile.am b/contribs/seff/Makefile.am
new file mode 100644
index 000000000..30af2e8bb
--- /dev/null
+++ b/contribs/seff/Makefile.am
@@ -0,0 +1,27 @@
+# Makefile for seff and smail
+
+AUTOMAKE_OPTIONS = foreign
+
+bin_SCRIPTS = seff smail
+
+# Don't rely on autoconf to replace variables outside of makefiles
+smail: smail.in
+	sed -e 's|@bindir[@]|$(bindir)|g' \
+	    ${abs_srcdir}/smail.in >${abs_srcdir}/smail
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(DESTDIR)$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	   cp $(top_srcdir)/contribs/seff/$$p $(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$p"; \
+	done
+
+clean:
diff --git a/contribs/seff/Makefile.in b/contribs/seff/Makefile.in
new file mode 100644
index 000000000..6b01c3959
--- /dev/null
+++ b/contribs/seff/Makefile.in
@@ -0,0 +1,675 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for seff and smail
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contribs/seff
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(bindir)"
+SCRIPTS = $(bin_SCRIPTS)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+bin_SCRIPTS = seff smail
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contribs/seff/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign contribs/seff/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binSCRIPTS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binSCRIPTS
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-binSCRIPTS install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-binSCRIPTS
+
+.PRECIOUS: Makefile
+
+
+# Don't rely on autoconf to replace variables outside of makefiles
+smail: smail.in
+	sed -e 's|@bindir[@]|$(bindir)|g' \
+	    ${abs_srcdir}/smail.in >${abs_srcdir}/smail
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+	@$(NORMAL_INSTALL)
+	test -z "$(DESTDIR)$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	   cp $(top_srcdir)/contribs/seff/$$p $(DESTDIR)$(bindir)/$$p; \
+	   chmod 755 $(DESTDIR)$(bindir)/$$p;\
+	done
+
+uninstall-binSCRIPTS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_SCRIPTS)'; for p in $$list; do \
+	  echo " rm -f '$(DESTDIR)$(bindir)/$$p'"; \
+	  rm -f "$(DESTDIR)$(bindir)/$$p"; \
+	done
+
+clean:
+
+# 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/contribs/seff/seff b/contribs/seff/seff
new file mode 100755
index 000000000..a2ecff4b8
--- /dev/null
+++ b/contribs/seff/seff
@@ -0,0 +1,222 @@
+#!/usr/bin/perl
+
+# Copyright 2015 Princeton University Research Computing
+
+use warnings;
+use strict qw/vars/;
+
+use Getopt::Std;
+use POSIX qw/pow/;
+use Sys::Hostname;
+use Slurmdb ':all';
+use Slurm ':all';
+use Data::Dumper;
+
+my $VERSION = "2.1";
+
+# This script is roughtly equivalent to:
+# sacct -P -n -a --format JobID,User,Group,State,Cluster,AllocCPUS,REQMEM,TotalCPU,Elapsed,MaxRSS,ExitCode,NNodes,NTasks -j <job_id>
+
+my %opts;
+getopts('hvdf:',\%opts);
+
+if (exists $opts{v}) {
+    print "seff Version $VERSION\n";
+    exit 1;
+}
+if (exists $opts{h} || scalar @ARGV != 1) {
+    print "Usage: seff [Options] <Jobid>\n";
+    print "       Options:\n";
+    print "       -h    Help menu\n";
+    print "       -v    Version\n";
+    print "       -d    Debug mode: display raw Slurm data\n";
+    exit 1;
+}
+my $mydebug = 0;
+if (exists $opts{d}) {
+    $mydebug = 1;
+}
+my $jobid_arg = $ARGV[0];
+
+my $db_conn = Slurmdb::connection_get();
+my $slurm = Slurm::new();
+
+# Get cluster name from SLurm config file.
+my $conf = $slurm->load_ctl_conf();
+my $clustername = $conf->{'cluster_name'};
+
+my %job_cond = ();
+$job_cond{without_usage_truncation} = 1;
+$job_cond{cluster_list} = [$clustername];
+$job_cond{step_list} = $jobid_arg;
+$job_cond{usage_start} = 0;
+$job_cond{usage_end} = 0;
+
+# Get and test for a single job.
+my $jobs = Slurmdb::jobs_get($db_conn, \%job_cond);
+if (scalar @$jobs < 1) {
+    print STDERR "Job not found.\n";
+    exit 2;
+}
+my $job = @$jobs[0];
+#print Dumper($job);
+
+my $jobid = $job->{'jobid'};
+my $user = $job->{'user'};
+my $group = getgrgid($job->{'gid'});
+my $state = $slurm->job_state_string($job->{'state'});
+$clustername = $job->{'cluster'};
+
+my $ncpus = 1;
+if (exists $job->{'alloc_cpus'}) {
+    $ncpus = $job->{'alloc_cpus'};
+} else {
+    if (exists $job->{'tres_alloc_str'}) {
+	$ncpus = Slurmdb::find_tres_count_in_string($job->{'tres_alloc_str'}, TRES_CPU);
+    }
+}
+# Check for missing number of cpus
+if (($ncpus == INFINITE64) || ($ncpus == 0)) {
+	$ncpus = 1;
+}
+
+my $nnodes = 1;
+if (exists $job->{'alloc_nodes'}) {
+    $nnodes = $job->{'alloc_nodes'};
+} else {
+    if (exists $job->{'tres_alloc_str'}) {
+        $nnodes = Slurmdb::find_tres_count_in_string($job->{'tres_alloc_str'}, TRES_NODE);
+    }
+}
+# Check for missing number of nodes.
+if (($nnodes == INFINITE64) || ($nnodes == 0)) {
+	$nnodes = 1;
+}
+
+my $reqmem = $job->{'req_mem'};
+my $pernode;
+if ($reqmem & MEM_PER_CPU) {
+    $reqmem = ($reqmem & ~MEM_PER_CPU) * 1024 * $ncpus;
+    $pernode = 0;
+} else {
+    $reqmem = $reqmem * 1024 * $nnodes;
+    $pernode = 1;
+}
+my $walltime = $job->{'elapsed'};
+# Only use hi-order byte for error code.
+my $exit_status = $job->{'exitcode'} >> 8;
+
+my $array_job_id = $job->{'array_job_id'};
+my $array_jobid = "";
+if ($array_job_id != 0) {
+    # Convert array_task_id to a signed long integer.
+    my $array_task_id = unpack('l', pack('l', $job->{'array_task_id'}));
+    if ($array_task_id == -2) {
+        print STDERR "Badly formatted array jobid $array_job_id with task_id = -2\n";
+        exit 3;
+    }
+    $array_jobid = "${array_job_id}_${array_task_id}";
+}
+my $tot_cpu_sec = 0;
+my $tot_cpu_usec = 0;
+my $mem = 0;
+my $ntasks = 0;
+for my $step (@{$job->{'steps'}}) {
+    $tot_cpu_sec += $step->{'tot_cpu_sec'};
+    $tot_cpu_usec += $step->{'tot_cpu_usec'};
+
+    my $lmem = $step->{'stats'}{'rss_max'};
+    if ($mem < $lmem) {
+        $mem = $lmem;
+        $ntasks = $step->{'ntasks'};
+    }
+}
+my $cput = $tot_cpu_sec + int(($tot_cpu_usec / 1000000) + 0.5);
+$mem = $mem * $ntasks;
+
+if ($mydebug) {
+    print "Slurm data: JobID ArrayJobID User Group State Clustername Ncpus Nnodes Ntasks Reqmem PerNode Cput Walltime Mem ExitStatus\n";
+    print "Slurm data: $jobid $array_jobid $user $group $state $clustername $ncpus $nnodes $ntasks $reqmem $pernode $cput $walltime $mem $exit_status\n\n";
+}
+print "Job ID: $jobid\n";
+if (length $array_jobid) {
+    print "Array Job ID: $array_jobid\n";
+}
+print "Cluster: $clustername\n";
+print "User/Group: $user/$group\n";
+if ($state eq "PENDING" || $state eq "RUNNING") {
+    print "State: $state\n";
+} else {
+    print "State: $state (exit code $exit_status)\n";
+}
+if ($ncpus == 1) {
+    print "Cores: $ncpus\n";
+} else {
+    print "Nodes: $nnodes\n";
+    printf "Cores per node: %d\n", $ncpus/$nnodes;
+}
+if ($state ne "PENDING") {
+    my $corewalltime = $walltime * $ncpus;
+    my $cpu_eff;
+    if ($corewalltime != 0) {
+        $cpu_eff = $cput / $corewalltime * 100;
+    } else {
+        $cpu_eff = 0.0;
+    }
+    printf("CPU Utilized: %s\n", time2str($cput));
+    printf("CPU Efficiency: %.2f%% of %s core-walltime\n", $cpu_eff, time2str($corewalltime));
+    if ($ntasks == 1) {
+        printf("Memory Utilized: %s\n", kbytes2str($mem));
+    } else {
+        printf("Memory Utilized: %s (estimated maximum)\n", kbytes2str($mem));
+    }
+    my $mem_eff;
+    if ($reqmem != 0) {
+        $mem_eff = $mem / $reqmem * 100;
+    } else {
+        $mem_eff = 0.0;
+    }
+    if ($ntasks == 1) {
+        printf("Memory Efficiency: %.2f%% of %s\n", $mem_eff, kbytes2str($reqmem));
+    } else {
+        if ($pernode) {
+            printf("Memory Efficiency: %.2f%% of %s (%s\/node)\n", $mem_eff, kbytes2str($reqmem), kbytes2str($reqmem / $nnodes));
+        } else {
+            printf("Memory Efficiency: %.2f%% of %s (%s\/core)\n", $mem_eff, kbytes2str($reqmem), kbytes2str($reqmem / $ncpus));
+        }
+    }
+    if ($state eq "RUNNING") {
+        print "WARNING: Efficiency statistics may be misleading for $state jobs.\n";
+    }
+} else {
+    print "Efficiency not available for jobs in the PENDING state.\n";
+}
+
+# Convert elapsed time to string.
+sub time2str {
+    my $time = shift;
+    my $days = int($time / 86400);
+    $time -= ($days * 86400);
+    my $hours = int($time / 3600);
+    $time -= ($hours * 3600);
+    my $minutes = int($time / 60);
+    my $seconds = $time % 60;
+
+    $days = $days < 1 ? '' : "$days-";
+    $time = $days . sprintf("%02s:%02s:%02s", $hours, $minutes, $seconds);
+    return $time;
+}
+
+# Convert memory to human-readable string.
+sub kbytes2str {
+    my $kbytes = shift;
+    if ($kbytes == 0) {
+        return sprintf("%.2f %sB", 0.0, 'M');
+    }
+    my $mul = 1024;
+
+    my $exp = int(log($kbytes) / log($mul));
+    my @pre = qw/ M G T P E /;
+    my $pre = $pre[$exp-1];
+    return sprintf("%.2f %sB", ($kbytes / pow($mul, $exp)), $pre);
+}
diff --git a/contribs/seff/smail.in b/contribs/seff/smail.in
new file mode 100755
index 000000000..8a44f828f
--- /dev/null
+++ b/contribs/seff/smail.in
@@ -0,0 +1,48 @@
+#! /bin/bash
+
+# Copyright 2015 Princeton University Research Computing
+
+# Input should look like this for an end record:
+# $1: '-s' (the subject argument keyword)
+# $2: The subject itself
+# $3: The To: email address.
+#
+# The subject should look like this for an start record:
+# SLURM Job_id=323 Name=ddt_clone Began, Queued time 00:00:01
+#
+# The subject should look like this for an end record:
+# SLURM Job_id=327 Name=ddt_clone Ended, Run time 00:05:01, COMPLETED, ExitCode 0
+# SLURM Job_id=328 Name=ddt_clone Failed, Run time 00:05:01, FAILED, ExitCode 127
+# SLURM Job_id=342 Name=ddt_clone Ended, Run time 00:00:33, CANCELLED, ExitCode 0
+# Not sure what to do about PENDING state resulting from a requeue request.
+# Doing a seff on it for now:
+# SLURM Job_id=326 Name=ddt_clone Failed, Run time 00:00:41, PENDING, ExitCode 0
+#
+# These end records are the only types of messages to process. They have 4 (rather
+# than 2) comma-delimited arguments, of which ending status is the 3rd.
+# Just pass through notifications without an ending status.
+
+SEFF=@bindir@/seff
+MAIL=/bin/mail
+
+IFS=","
+array=($2)
+IFS=" "
+# If we decide later to seff based on specific status codes, 
+# we can test against $status.
+status=`echo "${array[2]}" | tr -d ' '`
+if [ -n "$status" ]; then
+    sarray=(${array[0]})
+    IFS="="
+    sarray=(${sarray[1]})
+    IFS=" "
+    jobid=${sarray[1]}
+    # Fork a child so sleep is asynchronous.
+    {
+        sleep 60
+        $SEFF $jobid | $MAIL "$1" "${array[0]},${array[1]}" "$3"
+    } &
+else
+    $MAIL "$@"
+fi
+
diff --git a/contribs/sgather/Makefile.in b/contribs/sgather/Makefile.in
index cf06ba8de..0f72b56de 100644
--- a/contribs/sgather/Makefile.in
+++ b/contribs/sgather/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/sgather
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -199,8 +200,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -300,6 +299,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -338,6 +341,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -381,6 +387,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -431,6 +440,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/sgi/Makefile.in b/contribs/sgi/Makefile.in
index 9662de146..8570b200c 100644
--- a/contribs/sgi/Makefile.in
+++ b/contribs/sgi/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 @HAVE_NETLOC_TRUE@bin_PROGRAMS = netloc_to_topology$(EXEEXT)
 subdir = contribs/sgi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/sjobexit/Makefile.in b/contribs/sjobexit/Makefile.in
index 6d5cc8866..b3daa617d 100644
--- a/contribs/sjobexit/Makefile.in
+++ b/contribs/sjobexit/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/sjobexit
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -199,8 +200,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -300,6 +299,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -338,6 +341,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -381,6 +387,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -431,6 +440,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/slurmdb-direct/Makefile.in b/contribs/slurmdb-direct/Makefile.in
index 4b4f04733..e2a03f035 100644
--- a/contribs/slurmdb-direct/Makefile.in
+++ b/contribs/slurmdb-direct/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/slurmdb-direct
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -199,8 +200,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -300,6 +299,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -338,6 +341,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -381,6 +387,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -431,6 +440,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/torque/Makefile.in b/contribs/torque/Makefile.in
index 55937e661..9ce4cef3b 100644
--- a/contribs/torque/Makefile.in
+++ b/contribs/torque/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = contribs/torque
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -199,8 +200,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -300,6 +299,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -338,6 +341,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -381,6 +387,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -431,6 +440,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/contribs/torque/qsub.pl b/contribs/torque/qsub.pl
index d2da69a66..294dbb385 100755
--- a/contribs/torque/qsub.pl
+++ b/contribs/torque/qsub.pl
@@ -1,13 +1,14 @@
 #! /usr/bin/perl -w
 ###############################################################################
 #
-# qsub - submit a batch job in familar pbs format.
+# qsub - submit a batch job in familar pbs/Grid Engine format.
 #
 #
 ###############################################################################
+#  Copyright (C) 2015-2016 SchedMD LLC
 #  Copyright (C) 2007 The Regents of the University of California.
 #  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
-#  Written by Danny Auble <auble1@llnl.gov>.
+#  Written by Danny Auble <da@schedmd.com>.
 #  CODE-OCEC-09-009. All rights reserved.
 #
 #  This file is part of SLURM, a resource management program.
@@ -57,15 +58,22 @@ my ($start_time,
     $export_env,
     $interactive,
     $hold,
+    $join_output,
     $resource_list,
     $mail_options,
     $mail_user_list,
     $job_name,
     $out_path,
+    @pe_ev_opts,
     $priority,
+    $requeue,
     $destination,
+    $sbatchline,
     $variable_list,
     @additional_attributes,
+    $wckey,
+    $workdir,
+    $wrap,
     $help,
     $resp,
     $man);
@@ -76,11 +84,12 @@ my $srun = "${FindBin::Bin}/srun";
 
 GetOptions('a=s'      => \$start_time,
 	   'A=s'      => \$account,
+	   'b=s'      => \$wrap,
+	   'cwd'      => sub { }, # this is the default
 	   'e=s'      => \$err_path,
 	   'h'        => \$hold,
 	   'I'        => \$interactive,
-	   'j:s'      => sub { warn "option -j is the default, " .
-				    "stdout/stderr go into the same file\n" },
+	   'j:s'      => \$join_output,
 	   'J=s'      => \$array,
 	   'l=s'      => \$resource_list,
 	   'm=s'      => \$mail_options,
@@ -88,15 +97,20 @@ GetOptions('a=s'      => \$start_time,
 	   'N=s'      => \$job_name,
 	   'o=s'      => \$out_path,
 	   'p=i'      => \$priority,
+	   'pe=s{2}'  => \@pe_ev_opts,
+	   'P=s'      => \$wckey,
 	   'q=s'      => \$destination,
+	   'r=s'      => \$requeue,
 	   'S=s'      => sub { warn "option -S is ignored, " .
 				    "specify shell via #!<shell> in the job script\n" },
 	   't=s'      => \$array,
 	   'v=s'      => \$variable_list,
 	   'V'        => \$export_env,
+	   'wd=s'     => \$workdir,
 	   'W=s'      => \@additional_attributes,
 	   'help|?'   => \$help,
 	   'man'      => \$man,
+	   'sbatchline' => \$sbatchline,
 	   )
 	or pod2usage(2);
 
@@ -119,10 +133,14 @@ if ($man) {
 
 # Use sole remaining argument as jobIds
 my $script;
+my $use_job_name = "sbatch";
+
 if ($ARGV[0]) {
+	$use_job_name = $ARGV[0];
 	foreach (@ARGV) {
 	        $script .= "$_ ";
 	}
+	chop($script);
 }
 my $block="false";
 my $depend;
@@ -182,18 +200,38 @@ if ($resource_list) {
 	}
 }
 
+if (@pe_ev_opts) {
+	my %pe_opts = %{parse_pe_opts(@pe_ev_opts)};
+
+	# while((my $key, my $val) = each(%pe_opts)) {
+	# 	print "$key = ";
+	# 	if($val) {
+	# 		print "$val\n";
+	# 	} else {
+	# 		print "\n";
+	# 	}
+	# }
+
+	# From Stanford: This parallel environment is designed to support
+	# applications that use pthreads to manage multiple threads with
+	# access to a single pool of shared memory.  The SGE PE restricts
+	# the slots used to a threads on a single host, so in this, I think
+	# it is equivalent to the --cpus-per-task option of sbatch.
+	$res_opts{mppdepth} = $pe_opts{shm} if $pe_opts{shm};
+}
+
 my $command;
 
 if($interactive) {
 	$command = "$salloc";
 
-#	Always want at least one node in the allocation
+	#	Always want at least one node in the allocation
 	if (!$node_opts{node_cnt}) {
 		$node_opts{node_cnt} = 1;
 	}
 
-#	Calculate the task count based of the node cnt and the amount
-#	of ppn's in the request
+	#	Calculate the task count based of the node cnt and the amount
+	#	of ppn's in the request
 	if ($node_opts{task_cnt}) {
 		$node_opts{task_cnt} *= $node_opts{node_cnt};
 	}
@@ -208,8 +246,23 @@ if($interactive) {
 
 	$command = "$sbatch";
 
-	$command .= " -e $err_path" if $err_path;
-	$command .= " -o $out_path" if $out_path;
+	if (!$join_output) {
+		if ($err_path) {
+			$command .= " -e $err_path";
+		} elsif ($job_name) {
+			$command .= " -e $job_name.e%j";
+		} else {
+			$command .= " -e $use_job_name.e%j";
+		}
+	}
+
+	if ($out_path) {
+		$command .= " -o $out_path";
+	} elsif ($job_name) {
+		$command .= " -o $job_name.o%j";
+	} else {
+		$command .= " -o $use_job_name.o%j";
+	}
 
 #	The job size specification may be within the batch script,
 #	Reset task count if node count also specified
@@ -222,6 +275,8 @@ $command .= " -N$node_opts{node_cnt}" if $node_opts{node_cnt};
 $command .= " -n$node_opts{task_cnt}" if $node_opts{task_cnt};
 $command .= " -w$node_opts{hostlist}" if $node_opts{hostlist};
 
+$command .= " -D$workdir" if $workdir;
+
 $command .= " --mincpus=$res_opts{ncpus}"            if $res_opts{ncpus};
 $command .= " --ntasks-per-node=$res_opts{mppnppn}"  if $res_opts{mppnppn};
 
@@ -291,14 +346,34 @@ if($mail_options) {
 	$command .= " --mail-type=FAIL" if $mail_options =~ /a/;
 	$command .= " --mail-type=BEGIN" if $mail_options =~ /b/;
 	$command .= " --mail-type=END" if $mail_options =~ /e/;
+	$command .= " --mail-type=NONE" if $mail_options =~ /n/;
 }
 $command .= " --mail-user=$mail_user_list" if $mail_user_list;
 $command .= " -J $job_name" if $job_name;
 $command .= " --nice=$priority" if $priority;
 $command .= " -p $destination" if $destination;
-$command .= " $script" if $script;
+$command .= " --wckey=$wckey" if $wckey;
 
-# print "$command\n";
+if ($requeue) {
+	if ($requeue =~ 'y') {
+		$command .= " --requeue";
+	} elsif ($requeue =~ 'n') {
+		$command .= " --no-requeue"
+	}
+}
+
+if ($script) {
+	if ($wrap && $wrap =~ 'y') {
+		$command .=" --wrap=\"$script\"";
+	} else {
+		$command .= " $script";
+	}
+}
+
+if ($sbatchline) {
+	print "$command\n";
+	exit;
+}
 
 # Execute the command and capture its stdout, stderr, and exit status. Note
 # that if interactive mode was requested, the standard output and standard
@@ -356,6 +431,8 @@ sub parse_resource_list {
 		   'cput' => "",
 		   'file' => "",
 		   'host' => "",
+		   'h_rt' => "",
+		   'h_vmem' => "",
 		   'mem' => "",
 		   'mpiprocs' => "",
 		   'ncpus' => "",
@@ -386,15 +463,17 @@ sub parse_resource_list {
 
 #	Protect the colons used to separate elements in walltime=hh:mm:ss.
 #	Convert to NNhNNmNNs format.
-	$rl =~ s/walltime=(\d{1,2}):(\d{2}):(\d{2})/walltime=$1h$2m$3s/;
+	$rl =~ s/(walltime|h_rt)=(\d{1,2}):(\d{2}):(\d{2})/$1=$2h$3m$4s/;
 
 	$rl =~ s/:/,/g;
+
 	foreach my $key (@keys) {
 		#print "$rl\n";
 		($opt{$key}) = $rl =~ m/$key=([\w:\+=+]+)/;
-
 	}
 
+	$opt{walltime} = $opt{h_rt} if ($opt{h_rt} && !$opt{walltime});
+
 #	If needed, un-protect the walltime string.
 	if ($opt{walltime}) {
 		$opt{walltime} =~ s/(\d{1,2})h(\d{2})m(\d{2})s/$1:$2:$3/;
@@ -414,7 +493,10 @@ sub parse_resource_list {
 		$opt{mppnppn} = $opt{mpiprocs};
 	}
 
-	if($opt{mppmem}) {
+	if ($opt{h_vmem}) {
+		# Transfer over the GridEngine value (no conversion)
+		$opt{mem} = $opt{h_vmem};
+	} elsif($opt{mppmem}) {
 		$opt{mem} = convert_mb_format($opt{mppmem});
 	} elsif($opt{mem}) {
 		$opt{mem} = convert_mb_format($opt{mem});
@@ -463,6 +545,19 @@ sub parse_node_opts {
 	return \%opt;
 }
 
+sub parse_pe_opts {
+	my (@pe_array) = @_;
+	my %opt = ('shm' => 0,
+		   );
+	my @keys = keys(%opt);
+
+	foreach my $key (@keys) {
+		$opt{$key} = $pe_array[1] if ($key eq $pe_array[0]);
+	}
+
+	return \%opt;
+}
+
 sub get_minutes {
     my ($duration) = @_;
     $duration = 0 unless $duration;
@@ -522,6 +617,7 @@ B<qsub> - submit a batch job in a familiar PBS format
 
 qsub  [-a start_time]
       [-A account]
+      [-b y|n]
       [-e err_path]
       [-I]
       [-l resource_list]
@@ -529,9 +625,13 @@ qsub  [-a start_time]
       [-N job_name]
       [-o out_path]
       [-p priority]
+      [-pe shm task_cnt]
+      [-P wckey]
       [-q destination]
+      [-r y|n]
       [-v variable_list]
       [-V]
+      [-wd workdir]
       [-W additional_attributes]
       [-h]
       [script]
@@ -552,6 +652,10 @@ Earliest start time of job. Format: [HH:MM][MM/DD/YY]
 
 Specify the account to which the job should be charged.
 
+=item B<-b y|n>
+
+Whether to wrap the command line or not
+
 =item B<-e err_path>
 
 Specify a new path to receive the standard error output for the job.
@@ -588,9 +692,17 @@ Specify the path to a file to hold the standard output from the job.
 
 Specify the priority under which the job should run.
 
-=item B<-p priority>
+=item B<-pe shm cpus-per-task>
 
-Specify the priority under which the job should run.
+Specify the number of cpus per task.
+
+=item B<-P wckey>
+
+Specify the wckey or project of a job.
+
+=item B<-r y|n>
+
+Whether to allow the job to requeue or not.
 
 =item B<-t job_array>
 
@@ -609,6 +721,10 @@ format.
 The -V option to exports the current environment, which is the default mode of
 options unless the -v option is used.
 
+=item B<-wd workdir>
+
+Specify the workdir of a job.  The default is the current work dir.
+
 =item B<-?> | B<--help>
 
 brief help message
diff --git a/doc/Makefile.in b/doc/Makefile.in
index eef905a04..5a6ee80f3 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = doc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/doc/html/Makefile.am b/doc/html/Makefile.am
index 90cc9f757..a930d5f16 100644
--- a/doc/html/Makefile.am
+++ b/doc/html/Makefile.am
@@ -40,6 +40,7 @@ generated_html = \
 	high_throughput.html \
 	ibm.html \
 	ibm-pe.html \
+	intel_knl.html \
 	jobacct_gatherplugins.html \
 	job_array.html \
 	job_container_plugins.html \
@@ -54,12 +55,15 @@ generated_html = \
 	man_index.html \
 	maui.html \
 	mc_support.html \
+	mcs.html \
+	mcs_plugins.html \
 	meetings.html \
 	moab.html \
 	mpi_guide.html \
 	mpiplugins.html \
 	multi_cluster.html \
 	news.html \
+	node_features_plugins.html \
 	overview.html \
 	platforms.html \
 	plugins.html \
@@ -91,7 +95,6 @@ generated_html = \
 	slurmctld_plugstack.html \
 	slurm_ug_agenda.html \
 	slurm_ug_cfp.html \
-	sun_const.html \
 	switchplugins.html \
 	taskplugins.html \
 	team.html \
diff --git a/doc/html/Makefile.in b/doc/html/Makefile.in
index 8b9068b71..78085bd0b 100644
--- a/doc/html/Makefile.in
+++ b/doc/html/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = doc/html
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -198,8 +199,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -299,6 +298,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -337,6 +340,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -380,6 +386,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -430,6 +439,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -481,6 +491,7 @@ generated_html = \
 	high_throughput.html \
 	ibm.html \
 	ibm-pe.html \
+	intel_knl.html \
 	jobacct_gatherplugins.html \
 	job_array.html \
 	job_container_plugins.html \
@@ -495,12 +506,15 @@ generated_html = \
 	man_index.html \
 	maui.html \
 	mc_support.html \
+	mcs.html \
+	mcs_plugins.html \
 	meetings.html \
 	moab.html \
 	mpi_guide.html \
 	mpiplugins.html \
 	multi_cluster.html \
 	news.html \
+	node_features_plugins.html \
 	overview.html \
 	platforms.html \
 	plugins.html \
@@ -532,7 +546,6 @@ generated_html = \
 	slurmctld_plugstack.html \
 	slurm_ug_agenda.html \
 	slurm_ug_cfp.html \
-	sun_const.html \
 	switchplugins.html \
 	taskplugins.html \
 	team.html \
diff --git a/doc/html/authplugins.shtml b/doc/html/authplugins.shtml
index 02918ce55..3453b913a 100644
--- a/doc/html/authplugins.shtml
+++ b/doc/html/authplugins.shtml
@@ -16,7 +16,6 @@ abbreviation for the type of authentication. We recommend, for example:</p>
 <li><b>none</b>&#151;A plugin that implements the API without providing any actual
 authentication service. This may be used for testing purposes, but is not suitable for
 production use due to lack of effective security.</li>
-<li><b>authd</b>&#151;Brett Chun's Linux authd.</li>
 <li><b>munge</b>&#151;LLNL's Munge protocol (recommended plugin for production use).</li>
 </ul>
 
@@ -105,7 +104,7 @@ disposal. Slurm will not pass
 credentials to the API which have not been allocated by this function.</p>
 <p style="margin-left:.2in"><b>Arguments</b>:<br>
 <span class="commandline">argv</span> &nbsp;&nbsp;(input) plugin specific
-information, timeouts for authd<br>
+information.
 <span class="commandline">auth_info</span> &nbsp;&nbsp;(input) plugin specific
 identification of the server.</p>
 <p style="margin-left:.2in"><b>Returns</b>: A pointer to a newly allocated credential
diff --git a/doc/html/bluegene.shtml b/doc/html/bluegene.shtml
index 6d7b54a45..a1330daf4 100644
--- a/doc/html/bluegene.shtml
+++ b/doc/html/bluegene.shtml
@@ -734,10 +734,10 @@ Using this mechanism, up to 32 independent jobs each consisting of
 simultaneously on a one-rack BlueGene system.
 If defining blocks of <i>Type=SMALL</i>, the Slurm partition
 containing them as defined in <i>slurm.conf</i> must have the
-parameter <i>Shared=force</i> to enable scheduling of multiple
-jobs on wha. Slurm considers a single node.
+parameter <i>OverSubscribe=force</i> to enable scheduling of multiple
+jobs on what Slurm considers a single node.
 Slurm partitions that do not contain blocks of <i>Type=SMALL</i>
-may have the parameter <i>Shared=no</i> for a slight improvement in
+may have the parameter <i>OverSubscribe=no</i> for a slight improvement in
 scheduler performance.
 As in all Slurm configuration files, parameters and values
 are case insensitive.</p>
@@ -855,6 +855,6 @@ scheduling logic, etc. </p>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 15 April 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/burst_buffer.shtml b/doc/html/burst_buffer.shtml
index 3f4dbb91a..b82469982 100644
--- a/doc/html/burst_buffer.shtml
+++ b/doc/html/burst_buffer.shtml
@@ -160,13 +160,20 @@ SLURM Job_id=12 Name=my_app Staged Out, StageOut time 00:05:07
 <u>burst_buffer/generic</u> plugins to create and delete persistent burst
 buffers, which have a lifetime independent of the job.</p>
 <ul>
-<li>#BB create_persistent name=&lt;name&gt; capacity=&lt;number&gt; [access=&lt;access&gt;] [type=&lt;type&gt;]</li>
+<li>#BB create_persistent name=&lt;name&gt; capacity=&lt;number&gt;
+[access=&lt;access&gt;] [pool=&lt;pool&gt; [type=&lt;type&gt;]</li>
 <li>#BB destroy_persistent name=&lt;name&gt; [hurry]</li>
 </ul>
 <p>The persistent burst buffer name may not start with a numeric value (numeric
 names are reserved for job-specific burst buffers).
-The size specification can include a suffix of M, G, T, P, etc. for megabytes,
-gigabytes, terabytes, petabytes, etc.
+The <b>capacity</b> (size) specification can include a suffix of M, G, T, P, etc.
+for megabytes, gigabytes, terabytes, petabytes, etc.
+The <b>access</b> parameter identifies the buffer access mode. Supported access
+modes for the burst_buffer/cray plugin include: striped, private, and ldbalance.
+The <b>pool</b> parameter identifies the resource pool from in the burst buffer
+should be created. The default and available pools are configuration dependent.
+The <b>type</b> parameter identifies the buffer type. Supported type
+modes for the burst_buffer/cray plugin include: cache and scratch.
 Multiple persistent burst buffers may be created or deleted within a single
 job.
 A sample batch script follows:</p>
@@ -205,6 +212,7 @@ Multiple directives should be space separated.</p>
 <li>capacity=&lt;number&gt;</li>
 <li>swap=&lt;number&gt;</li>
 <li>type=&lt;type&gt;</li>
+<li>pool=&lt;name&gt;</li>
 </ul>
 <p>If a swap option is specified, the job must also specify the required
 node count.
@@ -240,9 +248,9 @@ Name=generic DefaultPool=ssd Granularity=100G TotalSpace=50T UsedSpace=42T
   StopStageIn=/usr/local/slurm/15.08/sbin/PSI
   StopStageIn=/usr/local/slurm/15.08/sbin/PSO
   Allocated Buffers:
-    JobID=18 CreateTime=2015-08-19T16:46:05 Size=10T State=allocated UserID=alan(1000)
-    JobID=20 CreateTime=2015-08-19T16:46:45 Size=10T State=allocated UserID=alan(1000)
-    Name=DB1 CreateTime=2015-08-19T16:46:45 Size=22T State=allocated UserID=brenda(1001)
+    JobID=18 CreateTime=2015-08-19T16:46:05 Pool=dwcache Size=10T State=allocated UserID=alan(1000)
+    JobID=20 CreateTime=2015-08-19T16:46:45 Pool=dwcache Size=10T State=allocated UserID=alan(1000)
+    Name=DB1 CreateTime=2015-08-19T16:46:45 Pool=dwcache Size=22T State=allocated UserID=brenda(1001)
   Per User Buffer Use:
     UserID=alan(1000) Used=20T
     UserID=brenda(1001) Used=22T
@@ -253,11 +261,11 @@ Name=generic DefaultPool=ssd Granularity=100G TotalSpace=50T UsedSpace=42T
 <p>Burst buffer resources can be placed in an advanced reservation using the
 <i>BurstBuffer</i> option.
 The argument consists of four elements:<br>
-[plugin:][type:]#[units]<br><br>
+[plugin:][pool:]#[units]<br><br>
 <i>plugin</i> is the burst buffer plugin name, currently either "cray" or "generic".
 If no plugin is specified, the reservation applies to all configured burst
 buffer plugins.<br><br>
-<i>type</i> specifies a Cray generic burst buffer resource, for example "nodes".
+<i>pool</i> specifies a Cray generic burst buffer resource pool.
 if "type" is not specified, the number is a measure of storage space.<br><br>
 <i>units</i> may be "N" (nodes), "M" (megabytes), "G" (gigabytes),
 "T" (terabytes), "P" (petabytes), etc. with the default units being bytes for
@@ -275,8 +283,12 @@ $ scontrol create reservation starttime=now duration=60 \
 $ scontrol create reservation StartTime=noon duration=60 \
   users=brenda NodeCnt=8 \
   BurstBuffer=cray:20G
+
+$ scontrol create reservation StartTime=16:00 duration=60 \
+  users=joseph flags=any_nodes \
+  BurstBuffer=cray:pool_test:4G
 </pre>
 
-<p style="text-align:center;">Last modified 28 November 2015</p>
+<p style="text-align:center;">Last modified 21 December 2015</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/cgroups.shtml b/doc/html/cgroups.shtml
index 74f1080a5..612d5ea24 100644
--- a/doc/html/cgroups.shtml
+++ b/doc/html/cgroups.shtml
@@ -136,8 +136,9 @@ special node configuration parameters in
 <a href="slurm.conf.html">slurm.conf</a>.</p>
 <h2>Organization of Slurm Cgroups</h2>
 <p>Slurm cgroups are organized as follows.  A base directory (mount point) is
-created at /cgroup, or as configured by the <i>CgroupMountpoint</I> option in
-<a href="cgroup.conf.html">cgroup.conf</a>. All cgroup
+created at /sys/fs/cgroup, or as configured by the <i>CgroupMountpoint</I> option in
+<a href="cgroup.conf.html">cgroup.conf</a>. (Note: Prior to 16.05 the default
+path was /cgroup rather than /sys/fs/cgroup/.) All cgroup
 hierarchies are created below this base directory. A separate hierarchy is
 created for each cgroup subsystem in use. The name of the root cgroup in each
 hierarchy is the subsystem name. A cgroup named <i>slurm</i> is created below
@@ -146,13 +147,13 @@ Slurm users, jobs, steps and tasks are created dynamically as needed. The names
 of these cgroups consist of a prefix identifying the Slurm entity (user, job,
 step or task), followed by the relevant numeric id. The following example shows
 the path of the task cgroup in the cpuset hierarchy for taskid#2 of stepid#0 of
-jobid#123 for userid#100, using the default base directory (/cgroup):
+jobid#123 for userid#100, using the default base directory (/sys/fs/cgroup):
 <p><pre>/cgroup/cpuset/slurm/uid_100/job_123/step_0/task_2</pre></p>
 <p>If resource specialization is configured, a special <i>system</i> cgroup 
 is created below the <i>slurm</i> cgroup in the cpuset and memory 
 hierarchies:</p>
-<pre>/cgroup/cpuset/slurm/system
-/cgroup/memory/slurm/system</pre>
+<pre>/sys/fs/cgroup/cpuset/slurm/system
+/sys/fs/cgroup/memory/slurm/system</pre>
 <p>Note that all these structures apply to a specific compute node. Jobs that 
 use more than one node will have a cgroup structure on each node.</p>
 
diff --git a/doc/html/configurator.easy.html.in b/doc/html/configurator.easy.html.in
index 6ee31ff22..5dce02bb5 100644
--- a/doc/html/configurator.easy.html.in
+++ b/doc/html/configurator.easy.html.in
@@ -369,6 +369,8 @@ Select one value for <B>MpiDefault</B>:<BR>
 This also works for MVAPICH-SHMEM.<BR>
 <input type="radio" name="mpi_default" value="pmi2"> <B>MPI-PMI2</B>
 (For MPI2 and MVAPICH2)<BR>
+<input type="radio" name="mpi_default" value="pmix"> <B>MPI-PMIx</B>
+(Exascale PMI implementation)<BR>
 <input type="radio" name="mpi_default" value="mvapich"> <B>MVAPICH</B><BR>
 <input type="radio" name="mpi_default" value="none" checked> <B>None</B>:
 +This works for most other MPI types including MPICH2, LAM MPI and Open MPI.<BR>
diff --git a/doc/html/configurator.html.in b/doc/html/configurator.html.in
index 50e21cef8..0e9c1fc26 100644
--- a/doc/html/configurator.html.in
+++ b/doc/html/configurator.html.in
@@ -109,7 +109,6 @@ function displayfile()
    get_field("BackupAddr",document.config.backup_addr) + "<br>" +
    "# <br>" +
    "AuthType=auth/" + get_radio_value(document.config.auth_type) + "<br>" +
-   "CacheGroups=" + get_radio_value(document.config.cache_groups) + "<br>" +
    "#CheckpointType=checkpoint/none <br>" +
    "CryptoType=crypto/" + get_radio_value(document.config.crypto_type) + "<br>" +
    "#DisableRootJobs=NO <br>" +
@@ -419,25 +418,6 @@ purposes any user name can be used.
 <input type="text" name="slurm_user" value="slurm"> <B>SlurmUser</B>
 <P>
 
-<H2>Group ID Caching</H2>
-
-If you have a slow NIS environment, big parallel jobs take a long time
-to start up (and may eventually time-out) because the NIS server(s)
-may not be able to quickly respond to simultaneous requests from
-multiple slurmd's.  You can instruct slurmd to cache /etc/groups
-entries to prevent this from happening by setting
-<B>CacheGroups</B>=1.  Reconfiguring ("scontrol reconfig") with
-<B>CacheGroups</B>=0 will cause slurmd to purge the cache.  Select one
-value for <B>CacheGroups</B>:<BR>
-<input type="radio" name="cache_groups" value="0" checked>
-<B>0</B>: for normal environment.<BR>
-<input type="radio" name="cache_groups" value="1">
-<B>1</B>: for slow NIS environment.
-<P>
-WARNING: The group ID cache does not try to keep itself in sync with
-the system.  You MUST run "scontrol reconfig" to update the cache
-after making any changes to system password or group databases.
-<P>
 
 <H2>Slurm Port Numbers</H2>
 The Slurm controller (slurmctld) requires a unique port for communications
@@ -455,8 +435,6 @@ Define the method used for authenticating communicating between Slurm components
 Select one value for <B>AuthType</B>:<BR>
 <input type="radio" name="auth_type" value="none"> <B>None</B>: No authentication.
 Not recommended for production use.<br>
-<input type="radio" name="auth_type" value="authd"> <B>Authd</B>: Brent Chun's
-<A href="http://www.theether.org/authd/">authd</A><BR>
 <input type="radio" name="auth_type" value="munge" checked> <B>Munge</B>: LLNL's
 <A href="http://home.gna.org/munge/">Munge</A><BR>
 <P>
@@ -552,6 +530,8 @@ Select one value for <B>MpiDefault</B>:<BR>
 This also works for MVAPICH-SHMEM.<BR>
 <input type="radio" name="mpi_default" value="pmi2"> <B>MPI-PMI2</B>
 (For MPI2 and MVAPICH2)<BR>
+<input type="radio" name="mpi_default" value="pmix"> <B>MPI-PMIx</B>
+(Exascale PMI implementation)<BR>
 <input type="radio" name="mpi_default" value="mvapich"> <B>MVAPICH</B><BR>
 <input type="radio" name="mpi_default" value="none" checked> <B>None</B>:
 +This works for most other MPI types including MPICH2, LAM MPI and Open MPI.<BR>
diff --git a/doc/html/cons_res.shtml b/doc/html/cons_res.shtml
index 1002291c2..984c07f27 100644
--- a/doc/html/cons_res.shtml
+++ b/doc/html/cons_res.shtml
@@ -30,7 +30,7 @@ as well as any combination of the logical processors with Memory:</li>
   <li><b>Socket</b> (<i>CR_Socket</i>): Socket as a consumable resource.</li>
   <li/><b>Core</b> (<i>CR_Core</i>): Core as a consumable resource.</li>
   <li><b>Memory</b> (<i>CR_Memory</i>) Memory <u>only</u> as a
-  consumable resource. Note! CR_Memory assumes Shared=Yes</li>
+  consumable resource. Note! CR_Memory assumes OverSubscribe=Yes</li>
   <li><b>Socket and Memory</b> (<i>CR_Socket_Memory</i>): Socket
   and Memory as consumable resources.</li>
   <li><b>Core and Memory</b> (<i>CR_Core_Memory</i>): Core and
@@ -57,8 +57,8 @@ resource. It is important to specify enough memory since Slurm will not allow
 the application to use more than the requested amount of real memory. The
 default value for --mem is 1 MB. see srun man page for more details.</li>
 
-<li><b>All CR_s assume Shared=No</b> or Shared=Force EXCEPT for
-<b>CR_MEMORY</b> which <b>assumes Shared=Yes</b></li>
+<li><b>All CR_s assume OverSubscribe=No</b> or OverSubscribe=Force EXCEPT for
+<b>CR_MEMORY</b> which <b>assumes OverSubscribe=Yes</b></li>
 
 <li>The consumable resource plugin is enabled via SelectType and
 SelectTypeParameter in the slurm.conf.</li>
diff --git a/doc/html/cons_res_share.shtml b/doc/html/cons_res_share.shtml
index d91bfc984..232d86358 100644
--- a/doc/html/cons_res_share.shtml
+++ b/doc/html/cons_res_share.shtml
@@ -9,15 +9,15 @@ does not include memory. The management of memory as a consumable resource is
 discussed in it's own section below.)
 </P>
 <P>
-The per-partition <CODE>Shared</CODE> setting applies to the <U>entity
+The per-partition <CODE>OverSubscribe</CODE> setting applies to the <U>entity
 being selected for scheduling</U>:
 <UL><LI><P>
 When the default <CODE>select/linear</CODE> plugin is enabled, the
-per-partition <CODE>Shared</CODE> setting controls whether or not the
+per-partition <CODE>OverSubscribe</CODE> setting controls whether or not the
 <B>nodes</B> are shared among jobs.
 </P></LI><LI><P>
 When the <CODE>select/cons_res</CODE> plugin is enabled, the per-partition
-<CODE>Shared</CODE> setting controls whether or not the <B>configured consumable
+<CODE>OverSubscribe</CODE> setting controls whether or not the <B>configured consumable
 resources</B> are shared among jobs. When a consumable resource such as a core,
 socket, or CPU is shared, it means that more than one job can be assigned to it.
 </P></LI></UL>
@@ -27,20 +27,20 @@ The following table describes this new functionality in more detail:
 </P>
 <TABLE CELLPADDING=3 CELLSPACING=1 BORDER=1>
 <TR><TH>Selection Setting</TH>
-<TH>Per-partition <CODE>Shared</CODE> Setting</TH>
+<TH>Per-partition <CODE>OverSubscribe</CODE> Setting</TH>
 <TH>Resulting Behavior</TH>
 </TR><TR>
 <TD ROWSPAN=3>SelectType=<B>select/linear</B></TD>
-<TD>Shared=NO</TD>
+<TD>OverSubscribe=NO</TD>
 <TD>Whole nodes are allocated to jobs. No node will run more than one job
 per partition/queue.</TD>
 </TR><TR>
-<TD>Shared=YES</TD>
-<TD>By default same as Shared=NO. Nodes allocated to a job may be shared with
+<TD>OverSubscribe=YES</TD>
+<TD>By default same as OverSubscribe=NO. Nodes allocated to a job may be shared with
 other jobs if each job allows sharing via the <CODE>srun --shared</CODE>
 option.</TD>
 </TR><TR>
-<TD>Shared=FORCE</TD>
+<TD>OverSubscribe=FORCE</TD>
 <TD>Each whole node can be allocated to multiple jobs up to the count specified
 per partition/queue (default 4 jobs per node)</TD>
 </TR><TR>
@@ -48,16 +48,16 @@ per partition/queue (default 4 jobs per node)</TD>
 Plus one of the following:<BR>
 SelectTypeParameters=<B>CR_Core</B><BR>
 SelectTypeParameters=<B>CR_Core_Memory</B></TD>
-<TD>Shared=NO</TD>
+<TD>OverSubscribe=NO</TD>
 <TD>Cores are allocated to jobs. No core will run more than one job
 per partition/queue.</TD>
 </TR><TR>
-<TD>Shared=YES</TD>
-<TD>By default same as Shared=NO. Cores allocated to a job may be shared with
+<TD>OverSubscribe=YES</TD>
+<TD>By default same as OverSubscribe=NO. Cores allocated to a job may be shared with
 other jobs if each job allows sharing via the <CODE>srun --shared</CODE>
 option.</TD>
 </TR><TR>
-<TD>Shared=FORCE</TD>
+<TD>OverSubscribe=FORCE</TD>
 <TD>Each core can be allocated to multple jobs up to the count specified
 per partition/queue (default 4 jobs per core).</TD>
 </TR><TR>
@@ -65,16 +65,16 @@ per partition/queue (default 4 jobs per core).</TD>
 Plus one of the following:<BR>
 SelectTypeParameters=<B>CR_CPU</B><BR>
 SelectTypeParameters=<B>CR_CPU_Memory</B></TD>
-<TD>Shared=NO</TD>
+<TD>OverSubscribe=NO</TD>
 <TD>CPUs are allocated to jobs. No CPU will run more than one job
 per partition/queue.</TD>
 </TR><TR>
-<TD>Shared=YES</TD>
-<TD>By default same as Shared=NO. CPUs allocated to a job may be shared with
+<TD>OverSubscribe=YES</TD>
+<TD>By default same as OverSubscribe=NO. CPUs allocated to a job may be shared with
 other jobs if each job allows sharing via the <CODE>srun --shared</CODE>
 option.</TD>
 </TR><TR>
-<TD>Shared=FORCE</TD>
+<TD>OverSubscribe=FORCE</TD>
 <TD>Each CPU can be allocated to multple jobs up to the count specified
 per partition/queue (default 4 jobs per CPU).</TD>
 </TR><TR>
@@ -82,21 +82,21 @@ per partition/queue (default 4 jobs per CPU).</TD>
 Plus one of the following:<BR>
 SelectTypeParameters=<B>CR_Socket</B><BR>
 SelectTypeParameters=<B>CR_Socket_Memory</B></TD>
-<TD>Shared=NO</TD>
+<TD>OverSubscribe=NO</TD>
 <TD>Sockets are allocated to jobs. No Socket will run more than one job
 per partition/queue.</TD>
 </TR><TR>
-<TD>Shared=YES</TD>
-<TD>By default same as Shared=NO. Sockets allocated to a job may be shared with
+<TD>OverSubscribe=YES</TD>
+<TD>By default same as OverSubscribe=NO. Sockets allocated to a job may be shared with
 other jobs if each job allows sharing via the <CODE>srun --shared</CODE>
 option.</TD>
 </TR><TR>
-<TD>Shared=FORCE</TD>
+<TD>OverSubscribe=FORCE</TD>
 <TD>Each socket can be allocated to multple jobs up to the count specified
 per partition/queue (default 4 jobs per socket).</TD>
 </TR>
 </TABLE>
-<P>When <CODE>Shared=FORCE</CODE> is configured, the consumable resources are
+<P>When <CODE>OverSubscribe=FORCE</CODE> is configured, the consumable resources are
 scheduled for jobs using a <B>least-loaded</B> algorithm. Thus, idle
 CPUs|cores|sockets will be allocated to a job before busy ones, and
 CPUs|cores|sockets running one job will be allocated to a job before ones
@@ -106,7 +106,7 @@ running two or more jobs. This is the same approach that the
 <P>
 Note that the <B>granularity</B> of the "least-loaded" algorithm is what
 distinguishes the two selection plugins (<CODE>cons_res</CODE> and
-<CODE>linear</CODE>) when <CODE>Shared=FORCE</CODE> is configured. With the
+<CODE>linear</CODE>) when <CODE>OverSubscribe=FORCE</CODE> is configured. With the
 <CODE>select/cons_res</CODE> plugin enabled, the CPUs of a node are not
 overcommitted until <B>all</B> of the rest of the CPUs are overcommitted on the
 other nodes. Thus if one job allocates half of the CPUs on a node and then a
@@ -117,7 +117,7 @@ busy nodes that have more than half of the CPUs available for use. The
 track the CPU usage on each node.
 </P><P>
 This new sharing functionality in the select/cons_res plugin also supports the
-new <CODE>Shared=FORCE:&lt;num&gt;</CODE> syntax. If <CODE>Shared=FORCE:3</CODE>
+new <CODE>OverSubscribe=FORCE:&lt;num&gt;</CODE> syntax. If <CODE>OverSubscribe=FORCE:3</CODE>
 is configured with <CODE>select/cons_res</CODE> and <CODE>CR_Core</CODE> or
 <CODE>CR_Core_Memory</CODE>, then the <CODE>select/cons_res</CODE> plugin will
 run up to 3 jobs on each <U>core</U> of each node in the partition. If
@@ -129,12 +129,12 @@ of each node in the partition.
 <P>
 Slurm has supported configuring nodes in more than one partition since version
 0.7.0. The following table describes how nodes configured in two partitions with
-different <CODE>Shared</CODE> settings will be allocated to jobs. Note that
+different <CODE>OverSubscribe</CODE> settings will be allocated to jobs. Note that
 "shared" jobs are jobs that are submitted to partitions configured with
-<CODE>Shared=FORCE</CODE> or with <CODE>Shared=YES</CODE> and the job requested
+<CODE>OverSubscribe=FORCE</CODE> or with <CODE>OverSubscribe=YES</CODE> and the job requested
 sharing with the <CODE>srun --shared</CODE> option. Conversely, "non-shared"
 jobs are jobs that are submitted to partitions configured with
-<CODE>Shared=NO</CODE> or <CODE>Shared=YES</CODE> and the job did <U>not</U>
+<CODE>OverSubscribe=NO</CODE> or <CODE>OverSubscribe=YES</CODE> and the job did <U>not</U>
 request sharable resources.
 </P>
 <TABLE CELLPADDING=3 CELLSPACING=1 BORDER=1>
@@ -149,32 +149,32 @@ share resources</TD><TD>Jobs do not run on the same nodes</TD></TR>
 The next table contains several
 scenarios with the <CODE>select/cons_res</CODE> plugin enabled to further
 clarify how a node is used when it is configured in more than one partition and
-the partitions have different "Shared" policies:
+the partitions have different "OverSubscribe" policies:
 </P>
 <TABLE CELLPADDING=3 CELLSPACING=1 BORDER=1>
 <TR><TH>Slurm configuration</TH>
 <TH>Resulting Behavior</TH>
 </TR><TR>
-<TD>Two <CODE>Shared=NO</CODE> partitions assigned the same set of nodes</TD>
+<TD>Two <CODE>OverSubscribe=NO</CODE> partitions assigned the same set of nodes</TD>
 <TD>Jobs from either partition will be assigned to all available consumable
 resources. No consumable resource will be shared. One node could have 2 jobs
 running on it, and each job could be from a different partition.</TD>
 </TR><TR>
 <TD>Two partitions assigned the same set of nodes: one partition is
-<CODE>Shared=FORCE</CODE>, and the other is <CODE>Shared=NO</CODE></TD>
+<CODE>OverSubscribe=FORCE</CODE>, and the other is <CODE>OverSubscribe=NO</CODE></TD>
 <TD>A node will only run jobs from one partition at a time. If a node is
-running jobs from the <CODE>Shared=NO</CODE> partition, then none of it's
+running jobs from the <CODE>OverSubscribe=NO</CODE> partition, then none of it's
 consumable resources will be shared. If a node is running jobs from the
-<CODE>Shared=FORCE</CODE> partition, then it's consumable resources can be
+<CODE>OverSubscribe=FORCE</CODE> partition, then it's consumable resources can be
 shared.</TD>
 </TR><TR>
-<TD>Two <CODE>Shared=FORCE</CODE> partitions assigned the same set of nodes</TD>
+<TD>Two <CODE>OverSubscribe=FORCE</CODE> partitions assigned the same set of nodes</TD>
 <TD>Jobs from either partition will be assigned consumable resources. All
 consumable resources can be shared. One node could have 2 jobs running on it,
 and each job could be from a different partition.</TD>
 </TR><TR>
 <TD>Two partitions assigned the same set of nodes: one partition is
-<CODE>Shared=FORCE:3</CODE>, and the other is <CODE>Shared=FORCE:5</CODE></TD>
+<CODE>OverSubscribe=FORCE:3</CODE>, and the other is <CODE>OverSubscribe=FORCE:5</CODE></TD>
 <TD>Generally the same behavior as above. However no consumable resource will
 ever run more than 3 jobs from the first partition, and no consumable resource
 will ever run more than 5 jobs from the second partition. A consumable resource
@@ -184,11 +184,11 @@ could have up to 8 jobs running on it at one time.</TD>
 <P>
 Note that the "mixed shared setting" configuration (row #2 above) introduces the
 possibility of <B>starvation</B> between jobs in each partition. If a set of
-nodes are running jobs from the <CODE>Shared=NO</CODE> partition, then these
+nodes are running jobs from the <CODE>OverSubscribe=NO</CODE> partition, then these
 nodes will continue to only be available to jobs from that partition, even if
-jobs submitted to the <CODE>Shared=FORCE</CODE> partition have a higher
+jobs submitted to the <CODE>OverSubscribe=FORCE</CODE> partition have a higher
 priority. This works in reverse also, and in fact it's easier for jobs from the
-<CODE>Shared=FORCE</CODE> partition to hold onto the nodes longer because the
+<CODE>OverSubscribe=FORCE</CODE> partition to hold onto the nodes longer because the
 consumable resource "sharing" provides more resource availability for new jobs
 to begin running "on top of" the existing jobs. This happens with the
 <CODE>select/linear</CODE> plugin also, so it's not specific to the
@@ -262,6 +262,6 @@ values suitable for your system.</P>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 17 September 2012</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/cpu_management.shtml b/doc/html/cpu_management.shtml
index e91105ab8..fe682f9ec 100644
--- a/doc/html/cpu_management.shtml
+++ b/doc/html/cpu_management.shtml
@@ -103,7 +103,7 @@ Step 1 is performed by slurmctld and the select plugin.
 				<p align="LEFT"><font style="font-size: 8pt" size="1">Defines
 				a partition. Several parameters of the partition definition
 				affect the selection of nodes (e.g., Nodes,
-				Shared, MaxNodes)</font></p>
+				OverSubscribe, MaxNodes)</font></p>
 			</td>
 		</tr>
 		<tr>
@@ -391,7 +391,7 @@ CR_Core_Memory | CR_Socket | CR_Socket_Memory</font><br><br>Plus additional opti
 		<tr>
 			<td height="18" width="20%">
 				<p align="LEFT"><font face="Courier New, monospace"><font style="font-size: 8pt" size="1">
-				<a href="srun.html#OPT_share">-s, --share</a></font></font></p>
+				<a href="srun.html#OPT_share">-s, --oversubscribe</a></font></font></p>
 			</td>
 			<td width="20%">
 				<p align="LEFT"><font style="font-size: 8pt" size="1">N/A</font></p>
@@ -540,7 +540,7 @@ Step 2 is performed by slurmctld and the select plugin.
 				<p align="LEFT"><font style="font-size: 8pt" size="1">Defines
 				a partition. Several parameters of the partition definition
 				affect the allocation of CPU resources to jobs (e.g., Nodes,
-				Shared, MaxNodes)</font></p>
+				OverSubscribe, MaxNodes)</font></p>
 			</td>
 		</tr>
 		<tr>
@@ -842,7 +842,7 @@ CR_Core_Memory | CR_Socket | CR_Socket_Memory</font><br><br>Plus additional opti
 		<tr>
 			<td height="18" width="20%">
 				<p align="LEFT"><font face="Courier New, monospace"><font style="font-size: 8pt" size="1">
-				<a href="srun.html#OPT_share">-s, --share</a></font></font></p>
+				<a href="srun.html#OPT_share">-s, --oversubscribe</a></font></font></p>
 			</td>
 			<td width="20%">
 				<p align="LEFT"><font style="font-size: 8pt" size="1">N/A</font></p>
@@ -1559,7 +1559,7 @@ multi-thread job</a>
 Nodename=n1 NodeAddr=node1 Sockets=2 CoresPerSocket=4 ThreadsPerCore=1 Procs=8 State=IDLE
 Nodename=n2 NodeAddr=node2 Sockets=2 CoresPerSocket=4 ThreadsPerCore=1 Procs=8 State=IDLE
 Nodename=n3 NodeAddr=node3 Sockets=2 CoresPerSocket=4 ThreadsPerCore=2 Procs=16 State=IDLE
-PartitionName=regnodes Nodes=n0,n1,n2 Shared=YES Default=YES State=UP
+PartitionName=regnodes Nodes=n0,n1,n2 OverSubscribe=YES Default=YES State=UP
 PartitionName=hypernode Nodes=n3 State=UP
 </pre>
 <br>
@@ -2110,15 +2110,15 @@ Run both jobs simultaneously in a single node.
 SelectTypeParameters=CR_Core
 </pre>
 <p>Command line:</p>
-<pre>srun --nodes=1-1 --nodelist=n0 --ntasks=6 --share ...
-srun --nodes=1-1 --nodelist=n0 --ntasks=6 --share ...
+<pre>srun --nodes=1-1 --nodelist=n0 --ntasks=6 --oversubscribe ...
+srun --nodes=1-1 --nodelist=n0 --ntasks=6 --oversubscribe ...
 </pre>
 <p>Comments:</p>
 <p>The <font face="Courier New, monospace">--nodes=1-1</font> and <font face="Courier New, monospace">--nodelist=n0</font>
 srun options together restrict both jobs to node n0. The
-<font face="Courier New, monospace">Shared=YES</font> option in the partition definition plus
-the <font face="Courier New, monospace">--share</font> srun option allows the two
-jobs to share CPUs on the node.
+<font face="Courier New, monospace">OverSubscribe=YES</font> option in the partition definition plus
+the <font face="Courier New, monospace">--oversubscribe</font> srun option allows the two
+jobs to oversubscribe CPUs on the node.
 </p><br>
 <a name="Example9"></a>
 <h3>Example 9: Consumable resources on multithreaded node, allocating only one thread per core</h3>
@@ -3536,6 +3536,6 @@ and binding for this job. For example, task id 2 is bound to CPU id 2.
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 15 April 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/cray_alps.shtml b/doc/html/cray_alps.shtml
index d9aec92cf..6931ad055 100644
--- a/doc/html/cray_alps.shtml
+++ b/doc/html/cray_alps.shtml
@@ -195,7 +195,7 @@ will not be propagated to <i>aprun</i>.</p>
 <div id="slurmtable">
 <div id="row"><div id="slurmtd"><b>srun option</b></div><div id="slurmtd"><b>aprun option</b></div></div>
 <div id="row"><div id="slurmtd">-c, --cpus-per-task</div><div id="slurmtd">-d</div></div>
-<div id="row"><div id="slurmtd">-s, --share</div><div id="slurmtd">-F share</div></div>
+<div id="row"><div id="slurmtd">-s, --oversubscribe</div><div id="slurmtd">-F share</div></div>
 <div id="row"><div id="slurmtd">--exclusive</div><div id="slurmtd">-F exclusive</div></div>
 <div id="row"><div id="slurmtd">-w, --nodelist</div><div id="slurmtd">-L</div></div>
 <div id="row"><div id="slurmtd">--mem-per-cpu</div><div id="slurmtd">-m</div></div>
@@ -560,13 +560,13 @@ MaxMemPerNode=32000
 # defaults common to all partitions
 PartitionName=DEFAULT Nodes=nid00[002-013,018-159,162-173,178-189]
 PartitionName=DEFAULT MaxNodes=178
-PartitionName=DEFAULT Shared=EXCLUSIVE State=UP DefaultTime=60
+PartitionName=DEFAULT OverSubscribe=EXCLUSIVE State=UP DefaultTime=60
 
 # "User Support" partition with a higher priority
-PartitionName=usup Hidden=YES Priority=10 MaxTime=720 AllowGroups=staff
+PartitionName=usup Hidden=YES PriorityTier=10 MaxTime=720 AllowGroups=staff
 
 # normal partition available to all users
-PartitionName=day Default=YES Priority=1 MaxTime=01:00:00
+PartitionName=day Default=YES PriorityTier=1 MaxTime=01:00:00
 </pre>
 
 <p>Slurm supports an optional <i>cray.conf</i> file containing Cray-specific
@@ -708,6 +708,6 @@ Stop the <i>slurmctld</i> daemon, delete the files, and restart the daemon.</p>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 15 April 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/documentation.shtml b/doc/html/documentation.shtml
index b6c7fe44f..b113d2b40 100644
--- a/doc/html/documentation.shtml
+++ b/doc/html/documentation.shtml
@@ -30,6 +30,7 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 <li><a href="cray_alps.html">Cray User and Administrator Guide with ALPS</a></li>
 <li><a href="ibm.html">IBM AIX User and Administrator Guide</a></li>
 <li><a href="ibm-pe.html">IBM Parallel Environment User and Administrator Guide</a></li>
+<li><a href="intel_knl.html">Intel Knights Landing (KNL) User and Administrator Guide</a></li>
 </ul>
 </ul>
 
@@ -46,6 +47,7 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 <li><a href="nonstop.html">Failure Management Support</a></li>
 <li><a href="big_sys.html">Large Cluster Administration Guide</a></li>
 <li><a href="licenses.html">License Management</a></li>
+<li><a href="mcs.html">Multi-Category Security (MCS) Guide</a></li>
 <li><a href="power_mgmt.html">Power Management Guide (power capping)</a></li>
 <li><a href="power_save.html">Power Saving Guide (power down idle nodes)</a></li>
 <li><a href="prolog_epilog.html">Prolog and Epilog Guide</a></li>
@@ -88,7 +90,6 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 <li><a href="cray_alps.html">Cray User and Administrator Guide with ALPS</a></li>
 <li><a href="ibm.html">IBM AIX User and Administrator Guide</a></li>
 <li><a href="ibm-pe.html">IBM Parallel Environment User and Administrator Guide</a></li>
-<li><a href="sun_const.html">Sun Constellation Administrator Guide</a></li>
 </ul>
 </ul>
 
@@ -108,28 +109,30 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 <li><a href="plugins.html">Plugin Programmer Guide</a></li>
 <li>Plugin Interface Details</li>
 <ul>
+<li><a href="accounting_storageplugins.html">Accounting Storage Plugin Programmer Guide</a></li>
 <li><a href="authplugins.html">Authentication Plugin Programmer Guide</a></li>
 <li><a href="bb_plugins.html">Burst Buffer Plugin Programmer Guide</a></li>
 <li><a href="core_spec_plugins.html">Core Specialization Plugin Programmer Guide</a></li>
 <li><a href="crypto_plugins.html">Cryptographic Plugin Programmer Guide</a></li>
+<li><a href="acct_gather_energy_plugins.html">Energy Accounting Plugin Programmer Guide</a></li>
 <li><a href="ext_sensorsplugins.html">External Sensors Plugin Programmer Guide</a></li>
-<li><a href="jobacct_gatherplugins.html">Job Accounting Gather Plugin Programmer Guide</a></li>
-<li><a href="accounting_storageplugins.html">Accounting Storage Plugin Programmer Guide</a></li>
 <li><a href="gres_plugins.html">Generic Resources (GRES) Plugin Programmer Guide</a></li>
+<li><a href="jobacct_gatherplugins.html">Job Accounting Gather Plugin Programmer Guide</a></li>
 <li><a href="checkpoint_plugins.html">Job Checkpoint Plugin Programmer Guide</a></li>
 <li><a href="jobcompplugins.html">Job Completion Logging Plugin Programmer Guide</a></li>
-<li><a href="job_container_plugins.html">Slurm Job Container Plugin API</a></li>
+<li><a href="job_container_plugins.html">Job Container Plugin API</a></li>
 <li><a href="job_submit_plugins.html">Job Submission Plugin Programmer Guide</a></li>
 <li><a href="launch_plugins.html">Launch Plugin Programmer Guide</a></li>
 <li><a href="mpiplugins.html">MPI Plugin Programmer Guide</a></li>
-<li><a href="acct_gather_energy_plugins.html">Energy Accounting Plugin Programmer Guide</a></li>
+<li><a href="mcs_plugins.html">Multi-Category Security (MCS) Plugin Programmer Guide</a></li>
+<li><a href="node_features_plugins.html">Node Features Plugin Programmer Guide</a></li>
 <li><a href="power_plugins.html">Power Management Plugin Programmer Guide</a></li>
 <li><a href="preemption_plugins.html">Preemption Plugin Programmer Guide</a></li>
 <li><a href="priority_plugins.html">Priority Plugin Programmer Guide</a></li>
 <li><a href="proctrack_plugins.html">Process Tracking Plugin Programmer Guide</a></li>
 <li><a href="acct_gather_profile_plugins.html">Profile Accounting Plugin Programmer Guide</a></li>
-<li><a href="schedplugins.html">Scheduler Plugin Programmer Guide</a></li>
 <li><a href="selectplugins.html">Resource Selection Plugin Programmer Guide</a></li>
+<li><a href="schedplugins.html">Scheduler Plugin Programmer Guide</a></li>
 <li><a href="slurmctld_plugstack.html">Slurmctld Generic Plugin Programmer Guide</a></li>
 <li><a href="switchplugins.html">Switch (Interconnect) Plugin Programmer Guide</a></li>
 <li><a href="taskplugins.html">Task Plugin Programmer Guide</a></li>
@@ -137,6 +140,6 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 </li>
 </ul>
 
-<p style="text-align:center;">Last modified 20 October 2015</p>
+<p style="text-align:center;">Last modified 11 February 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/download.shtml b/doc/html/download.shtml
index 42498db16..03a5575cb 100644
--- a/doc/html/download.shtml
+++ b/doc/html/download.shtml
@@ -25,7 +25,6 @@ Trinity College Dublin, Ireland.
 <li><b>Authentication</b> plugins identifies the user originating
 a message.</li>
 <ul>
-<li><a href="http://www.theether.org/authd">authd</a></li>
 <li><b>MUNGE</b> (recommended)<br>
 In order to compile the "auth/munge" authentication plugin for Slurm,
 you will need to build and install MUNGE, available from
@@ -38,7 +37,7 @@ you will need to build and install MUNGE, available from
 <li><b>Authentication</b> tools for users that work with Slurm.</li>
 <ul>
 <li><a href="http://sourceforge.net/projects/auks/">AUKS</a><br>
-AUKS is an utility designed to ease Kerberos V credential support addition 
+AUKS is an utility designed to ease Kerberos V credential support addition
 to non-interactive applications, like batch systems (Slurm, LSF, Torque, etc.).
 It includes a plugin for the Slurm workload manager. AUKS is not used as
 an authentication plugin by the Slurm code itself, but provides a mechanism
@@ -96,7 +95,7 @@ is an implementation of <a href="http://www.gridforum.org/">Open Grid Forum</a>
 <a href="http://www.drmaa.org/">DRMAA 1.0</a> (Distributed Resource Management Application API)
 <a href="http://www.ogf.org/documents/GFD.133.pdf">specification</a> for submission
 and control of jobs to <href="http://slurm.schedmd.com">Slurm</a>.
-Using DRMAA, grid applications builders, portal developers and ISVs can use 
+Using DRMAA, grid applications builders, portal developers and ISVs can use
 the same high-level API to link their software with different cluster/resource
 management systems.<br><br>
 There is a variant of PSNC DRMAA providing support for Slurm's --cluster option
@@ -193,7 +192,7 @@ batch job scripts for Slurm which is available
 
 <li><a href="http://www.gingergeeks.co.uk/pyslurm/">PySlurm</a> is a
 Python/Pyrex module to interface with Slurm.
-There is also a Python module to expand and collect hostlist expressions 
+There is also a Python module to expand and collect hostlist expressions
 available <a href="http://www.nsc.liu.se/~kent/python-hostlist/">
 here</a>.</li>
 
@@ -206,7 +205,7 @@ SQL Alchemy bindings for your slurmdbd database.</li>
 
 <li><a href="http://www.lua.org/">Lua</a> may be used to implement a
 Slurm process tracking plugin.
-The Lua script available in <i>contribs/lua/protrack.lua</i> 
+The Lua script available in <i>contribs/lua/protrack.lua</i>
 implements containers using CPUSETs.
 </ul><br>
 
@@ -246,7 +245,7 @@ Portable Hardware Locality (hwloc)</a></li>
 <li><b>Node Health Check</b><br>
 Probably the most comprehensive and lightweight health check tool out
 there is
-<a href="http://warewulf.lbl.gov/trac/wiki/Node%20Health%20Check">Node Health Check</a>.  
+<a href="http://warewulf.lbl.gov/trac/wiki/Node%20Health%20Check">Node Health Check</a>.
 It has integration with Slurm as well as Torque resource managers.</li><br>
 
 <li><b>Accounting Tools</b><br>
@@ -340,6 +339,14 @@ times spent pending in them, which is often a good bellwether of scheduling
 problems.<br>
 <a href="https://github.com/fasrc/slurmmon">Slurmmon code</a></li><br>
 
+<li><b>Graphical Sdiag</b><br>
+The sdiag utility is a diagnostic tool that maintains statistics on Slurm's
+scheduling performance. You can run sdiag periodically or as you modify
+Slurm's configuration. However if you want a historical view of these
+statistics, you could save them in a time-series database and graph them over
+time as performed with this tool:<br>
+<a href="http://giovannitorres.me/graphing-sdiag-with-graphite.html">Graphing sdiag with Graphite </a></li><br>
+
 <li><b>MSlurm</b><br>
 Such a superstructure for the management of multiple Slurm environments is done
 with MSlurm. Thereby several Slurm clusters - even across multiple Slurm
@@ -399,6 +406,6 @@ Slurm-based HPC supercomputers. The website of Slurm-web, with screenshots:<br>
 
 </ul>
 
-<p style="text-align:center;">Last modified 16 February 2016</p>
+<p style="text-align:center;">Last modified 13 May 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/faq.shtml b/doc/html/faq.shtml
index dee9ebe7a..c53232f08 100644
--- a/doc/html/faq.shtml
+++ b/doc/html/faq.shtml
@@ -76,8 +76,7 @@
   jobs per node?</a></li>
 <li><a href="#inc_plugin">When the Slurm daemon starts, it prints
   &quot;cannot resolve X plugin operations&quot; and exits. What does this mean?</a></li>
-<li><a href="#sigpipe">Why are user tasks intermittently dying at launch with SIGPIPE
-  error messages?</a></li>
+<li><a href="#pam_exclude">How can I exclude some users from pam_slurm?</a></li>
 <li><a href="#maint_time">How can I dry up the workload for a maintenance
   period?</a></li>
 <li><a href="#pam">How can PAM be used to control a user's limits on or
@@ -183,7 +182,7 @@ script for Slurm?</a></li>
     configuration be copied from an existing cluster to the new cluster?</a></li>
 <li><a href="#cray_dvs">How can I update Slurm on a Cray DVS file system without
 rebooting the nodes?</a></li>
-<li><a href="#pam_exclude">How can I exclude some users from pam_slurm?</a></li>
+<li><a href="#dbd_rebuild">How can I rebuild the database hierarchy?</a></li>
 </ol>
 
 <h2>For Management</h2>
@@ -312,10 +311,10 @@ a minimum node count and optionally a maximum node count. A command line of</p>
 <p>would result in the request being rejected. If the <b>--overcommit</b> option
 is added to either command line, then only one node will be allocated for all
 four tasks to use.</p>
-<p>More than one job can execute simultaneously on the same nodes through the use
-of srun's <b>--shared</b> option in conjunction with the <b>Shared</b> parameter
-in Slurm's partition configuration. See the man pages for srun and slurm.conf for
-more information.</p>
+<p>More than one job can execute simultaneously on the same compute resource
+(e.g. CPU) through the use of srun's <b>--oversubscribe</b> option in
+conjunction with the <b>OverSubscribe</b> parameter in Slurm's partition
+configuration. See the man pages for srun and slurm.conf for more information.</p>
 
 <p><a name="purge"><b>5. Why is my job killed prematurely?</b></a><br>
 Slurm has a job purging mechanism to remove inactive jobs (resource allocations)
@@ -376,10 +375,10 @@ management within the job for the job steps.</p>
 <p><a name="orphan"><b>9. Why do I have job steps when my job has
 already COMPLETED?</b></a><br>
 NOTE: This only applies to systems configured with
-<i>SwitchType=switch/elan</i> or <i>SwitchType=switch/federation</i>.
+<i>SwitchType=switch/nrt</i>.
 All other systems will purge all job steps on job completion.</p>
 <p>Slurm maintains switch (network interconnect) information within
-the job step for Quadrics Elan and IBM Federation switches.
+the job step for IBM NRT switches.
 This information must be maintained until we are absolutely certain
 that the processes associated with the switch have been terminated
 to avoid the possibility of re-using switch resources for other
@@ -1003,7 +1002,8 @@ using the command "scontrol show node" and looking at the values of
 "ThreadsPerCore".</p>
 <p>Note that even on systems with hyperthreading enabled, the resources will
 generally be allocated to jobs at the level of a core (see NOTE below).
-Two different jobs will not share a core.
+Two different jobs will not share a core except through the use of a partition
+OverSubscribe configuration parameter.
 For example, a job requesting resources for three tasks on a node with
 ThreadsPerCore=2 will be allocated two full cores.
 Note that Slurm commands contain a multitude of options to control
@@ -1109,7 +1109,7 @@ See <a href="cons_res.html">Consumable Resources in Slurm</a>
 for details about this configuration.
 If you want to allocate whole nodes to jobs, configure
 configure <i>SelectType=select/linear</i>.
-Each partition also has a configuration parameter <i>Shared</i>
+Each partition also has a configuration parameter <i>OverSubscribe</i>
 that enables more than one job to execute on each node.
 See <i>man slurm.conf</i> for more information about these
 configuration parameters.</p>
@@ -1124,14 +1124,49 @@ file is telling the plugin to use an old plugin (say from the
 previous version of Slurm). Restart the daemon in verbose mode
 for more information (e.g. &quot;slurmctld -Dvvvvv&quot;).
 
-<p><a name="sigpipe"><b>7. Why are user tasks intermittently dying
-at launch with SIGPIPE error messages?</b></a><br>
-If you are using LDAP or some other remote name service for
-username and groups lookup, chances are that the underlying
-libc library functions are triggering the SIGPIPE.  You can likely
-work around this problem by setting <i>CacheGroups=1</i> in your slurm.conf
-file.  However, be aware that you will need to run &quot;scontrol
-reconfigure &quot; any time your groups database is updated.
+<p><a name="pam_exclude"><b>7.How can I exclude some users from pam_slurm?</b></a><br>
+<b>CAUTION:</b> Please test this on a test machine/VM before you actually do
+this on your Slurm computers.</p>
+
+<p><b>Step 1.</b> Make sure pam_listfile.so exists on your system.
+The following command is an example on Redhat 6:</p>
+<pre>
+ls -la /lib64/security/pam_listfile.so
+</pre>
+
+<p><b>Step 2.</b> Create user list (e.g. /etc/ssh/allowed_users):</p>
+<pre>
+# /etc/ssh/allowed_users
+root
+myadmin
+</pre>
+<p>And, change file mode to keep it secret from regular users(Optional):</p>
+<pre>
+chmod 600 /etc/ssh/allowed_users
+</pre>
+<p><b>NOTE:</b> root is not necessarily listed on the allowed_users, but I
+feel somewhat safe if it's on the list.</p>
+
+<p><b>Step 3.</b> On /etc/pam.d/sshd, add pam_listfile.so with sufficient flag
+before pam_slurm.so (e.g. my /etc/pam.d/sshd looks like this):</p>
+<pre>
+#%PAM-1.0
+auth       required     pam_sepermit.so
+auth       include      password-auth
+account    sufficient   pam_listfile.so item=user sense=allow file=/etc/ssh/allowed_users onerr=fail
+account    required     pam_slurm.so
+account    required     pam_nologin.so
+account    include      password-auth
+password   include      password-auth
+# pam_selinux.so close should be the first session rule
+session    required     pam_selinux.so close
+session    required     pam_loginuid.so
+# pam_selinux.so open should only be followed by sessions to be executed in the user context
+session    required     pam_selinux.so open env_params
+session    optional     pam_keyinit.so force revoke
+session    include      password-auth
+</pre>
+<p>(Information courtesy of Koji Tanaka, Indiana University)</p>
 
 <p><a name="maint_time"><b>8. How can I dry up the workload for a
 maintenance period?</b></a><br>
@@ -1230,17 +1265,14 @@ Just install the test version in a different location with a different
 The test system's <i>slurm.conf</i> should specify different
 pathnames and port numbers to avoid conflicts.
 The only problem is if more than one version of Slurm is configured
-with <i>switch/elan</i> or <i>switch/federation</i>.
-In that case, there can be conflicting switch window requests from
+with <i>switch/nrt</i> or <i>burst_buffer/*</i> plugins.
+In that case, there can be conflicting API requests from
 the different Slurm systems.
-This can be avoided by configuring the test system with <i>switch/none</i>.
-MPI jobs started on an Elan or Federation switch system without the
+This can be avoided by configuring the test system with <i>switch/none</i>
+and <i>burst_buffer/none</i>.
+MPI jobs started on an NRT switch system without the
 switch windows configured will not execute properly, but other jobs
 will run fine.
-Another option for testing on Elan or Federation systems is to use
-a different set of nodes for the different Slurm systems.
-That will permit both systems to allocate switch windows without
-conflicts.
 
 <p><a name="multi_slurmd"><b>14. Can Slurm emulate a larger cluster?</b></a><br>
 Yes, this can be useful for testing purposes.
@@ -1719,7 +1751,9 @@ fs.suid_dumpable = 2<br>
 or temporarily with:<br>
 sysctl fs.suid_dumpable=2<br>
 On Centos 6, also set "ProcessUnpackaged = yes" in the file
-/etc/abrt/abrt-action-save-package-data.conf.</p>
+/etc/abrt/abrt-action-save-package-data.conf.
+On Red Hat EL6, also set "DAEMON_COREFILE_LIMIT=unlimited" in the file
+rc.d/init.d/functions.</p>
 <p>Once these configuration changes have been made and the slurmstepd aborts,
 you should see message of this type in the file /var/log/messages:</p>
 <pre>Oct 15 11:31:20 knc abrt[21489]: Saved core dump of pid 21477 (/localhome/adam/slurm/16.05/knc/sbin/slurmstepd) to /var/spool/abrt/ccpp-2015-10-15-11:31:20-21477 (6639616 bytes)
@@ -1871,11 +1905,16 @@ The plugin will be installed in<br>
 See the SPANK man page for configuration details.</p>
 
 <p><a name="sssd"><b>52. I am having trouble using SSSD with Slurm.</b></a></br>
-SSSD or System Security Services Deamon does not allow enumeration of group
-members by default.
-SSSD is also case sensitive, which could possible raise other issues.
-Add the following lines to <i>/etc/ssd/ssd.conf</i> on your head node to
-address these issues:</p>
+SSSD or System Security Services Deamon does not allow enumeration of
+group members by default. Note that enabling enumeration in large
+environments might not be feasible. However, as of version 16.05 slurm
+does not need enumeration, except for some specific quirky
+configurations (multiple groups with the same GID), so probably it's
+perfectly safe to leave enumeration disabled.  SSSD is also case
+sensitive by default for some configurations, which could possibly
+raise other issues.  Add the following lines
+to <i>/etc/sssd/sssd.conf</i> on your head node to address these
+issues:</p>
 <pre>
 enumerate = True
 case_sensitive = False
@@ -2114,52 +2153,19 @@ before starting the slurmds again.</p>
 <p>(Information courtesy of Douglas Jacobsen, NERSC,
 Lawrence Berkeley National Laboratory)</p>
 
-<p><a name="pam_exclude"><b>65.How can I exclude some users from pam_slurm?</b></a><br>
-<b>CAUTION:</b> Please test this on a test machine/VM before you actually do
-this on your Slurm computers.</p>
-
-<p><b>Step 1.</b> Make sure pam_listfile.so exists on your system.
-The following command is an example on Redhat 6:</p>
+<p><a name="dbd_rebuild"><b>65. How can I rebuild the database hierarchy?</b></a><br>
+If you see errors of this sort:</p>
 <pre>
-ls -la /lib64/security/pam_listfile.so
+error: Can't find parent id 3358 for assoc 1504, this should never happen.
 </pre>
-
-<p><b>Step 2.</b> Create user list (e.g. /etc/ssh/allowed_users):</p>
-<pre>
-# /etc/ssh/allowed_users
-root
-myadmin
-</pre>
-<p>And, change file mode to keep it secret from regular users(Optional):</p>
-<pre>
-chmod 600 /etc/ssh/allowed_users
-</pre>
-<p><b>NOTE:</b> root is not necessarily listed on the allowed_users, but I
-feel somewhat safe if it's on the list.</p>
-
-<p><b>Step 3.</b> On /etc/pam.d/sshd, add pam_listfile.so with sufficient flag 
-before pam_slurm.so (e.g. my /etc/pam.d/sshd looks like this):</p>
-<pre>
-#%PAM-1.0
-auth       required     pam_sepermit.so
-auth       include      password-auth
-account    sufficient   pam_listfile.so item=user sense=allow file=/etc/ssh/allowed_users onerr=fail
-account    required     pam_slurm.so
-account    required     pam_nologin.so
-account    include      password-auth
-password   include      password-auth
-# pam_selinux.so close should be the first session rule
-session    required     pam_selinux.so close
-session    required     pam_loginuid.so
-# pam_selinux.so open should only be followed by sessions to be executed in the user context
-session    required     pam_selinux.so open env_params
-session    optional     pam_keyinit.so force revoke
-session    include      password-auth
-</pre>
-<p>(Information courtesy of Koji Tanaka, Indiana University)</p>
+<p>in the slurmctld log file, this is indicative that the database hierarchy
+information has been corrupted, typically due to a hardware failure of
+administrator error in directly modifying the database. In order to rebuild
+the database information, start the slurmdbd daemon with the "-R" option
+followed by an optional comma separated list of cluster names to operate on.</p>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 8 December 2015</p>
+<p style="text-align:center;">Last modified 25 April 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/gang_scheduling.shtml b/doc/html/gang_scheduling.shtml
index fb6ef72e5..c845d023b 100644
--- a/doc/html/gang_scheduling.shtml
+++ b/doc/html/gang_scheduling.shtml
@@ -89,13 +89,13 @@ to one minute, set <I>SchedulerTimeSlice=60</I>. Short values can increase
 the overhead of gang scheduling.
 </LI>
 <LI>
-<B>Shared</B>: Configure the partition's <I>Shared</I> setting to
+<B>OverSubscribe</B>: Configure the partition's <I>OverSubscribe</I> setting to
 <I>FORCE</I> for all partitions in which timeslicing is to take place.
 The <I>FORCE</I> option supports an additional parameter that controls
-how many jobs can share a resource (FORCE[:max_share]). By default the
+how many jobs can share a compute resource (FORCE[:max_share]). By default the
 max_share value is 4. To allow up to 6 jobs from this partition to be
-allocated to a common resource, set <I>Shared=FORCE:6</I>. To only let 2 jobs
-timeslice on the same resources, set <I>Shared=FORCE:2</I>.
+allocated to a common resource, set <I>OverSubscribe=FORCE:6</I>. To only let 2 jobs
+timeslice on the same resources, set <I>OverSubscribe=FORCE:2</I>.
 NOTE: Gang scheduling is performed independently for each partition, so
 configuring partitions with overlapping nodes and gang scheduling is generally
 not recommended.
@@ -105,7 +105,7 @@ not recommended.
 In order to enable gang scheduling after making the configuration changes
 described above, restart Slurm if it is already running. Any change to the
 plugin settings in Slurm requires a full restart of the daemons. If you
-just change the partition <I>Shared</I> setting, this can be updated with
+just change the partition <I>OverSubscribe</I> setting, this can be updated with
 <I>scontrol reconfig</I>.
 </P>
 
@@ -152,7 +152,7 @@ equal to <I>SchedulerTimeSlice</I>.
 <H2>A Simple Example</H2>
 
 <P>
-The following example is configured with <I>select/linear</I> and <I>Shared=FORCE</I>.
+The following example is configured with <I>select/linear</I> and <I>OverSubscribe=FORCE</I>.
 This example takes place on a small cluster of 5 nodes:
 </P>
 <PRE>
@@ -314,7 +314,7 @@ wait for job 13 to finish.
 This is called "local" backfilling because the backfilling only occurs with
 jobs close enough in the queue to get allocated by the scheduler as part of
 oversubscribing the resources. Recall that the number of jobs that can
-overcommit a resource is controlled by the <I>Shared=FORCE:max_share</I> value,
+overcommit a resource is controlled by the <I>OverSubscribe=FORCE:max_share</I> value,
 so this value effectively controls the scope of "local backfilling".
 </P>
 <P>
@@ -508,6 +508,6 @@ Use of the scancel command to send SIGSTOP and SIGCONT signals would stop a
 job without releasing its CPUs for allocaiton to other jobs and would be a
 preferable mechanism in many cases.</P>
 
-<p style="text-align:center;">Last modified 20 October 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/ibm-pe.shtml b/doc/html/ibm-pe.shtml
index 0185cb914..2bdc7716d 100644
--- a/doc/html/ibm-pe.shtml
+++ b/doc/html/ibm-pe.shtml
@@ -336,7 +336,7 @@ note the following environment variables:</p>
 <p>Slurm can be configured to gang schedule (time slice) parallel jobs by
 alternately suspending and resuming them. Depending upon the the number of
 jobs configured to time slice and the time slice interval (as specified in
-the <i>slurm.conf</i> file using the <b>Shared</b> and <b>SchedulerTimeSlice</b>
+the <i>slurm.conf</i> file using the <b>OverSubscribe</b> and <b>SchedulerTimeSlice</b>
 options), the job may experience communication timeouts. Set the environment
 variable <b>MP_TIMEOUT</b> to specify an appropriate communication timeout
 value. Note that the default timeout is 150 seconds. See
@@ -455,7 +455,7 @@ Slurm (without jobs). The procedure is as follows:</p>
 <p>Slurm can be configured to gang schedule (time slice) parallel jobs by
 alternately suspending and resuming them. Depending upon the the number of
 jobs configured to time slice and the time slice interval (as specified in
-the <i>slurm.conf</i> file using the <b>Shared</b> and <b>SchedulerTimeSlice</b>
+the <i>slurm.conf</i> file using the <b>OverSubscribe</b> and <b>SchedulerTimeSlice</b>
 options), the job may experience communication timeouts. Set the environment
 variable <b>MP_TIMEOUT</b> to specify an appropriate communication timeout
 value. Note that the default timeout is 150 seconds. See
@@ -567,6 +567,6 @@ startsrc -s pnsd -a -D
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 22 July 2013</p></td>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/intel_knl.shtml b/doc/html/intel_knl.shtml
new file mode 100644
index 000000000..b7c888e02
--- /dev/null
+++ b/doc/html/intel_knl.shtml
@@ -0,0 +1,245 @@
+<!--#include virtual="header.txt"-->
+
+<h1>Intel Knights Landing (KNL) User and Administrator Guide</h1>
+
+<h2>Overview</h2>
+
+<p>This document describes the unique features of Slurm on the computers with
+the Intel Knights Landing processor.
+You should be familiar with the Slurm's mode of operation on Linux clusters
+before studying the relatively few differences in Intel KNL system operation
+described in this document.</p>
+
+<h2>User Tools</h2>
+
+<p>The desired NUMA and MCDRAM modes for a KNL processor should be specified
+using the -C or --constraints option of Slurm's job submission commands: salloc,
+sbatch, and srun. Currently available NUMA and MCDRAM modes are shown in the
+table below. Each node's available and current NUMA and MCDRAM modes are
+visible in the "available features" and "active features" fields respectively,
+which may be seen using the scontrol, sinfo, or sview commands.
+Note that a node may need to be rebooted to get the desired NUMA and MCDRAM
+modes and nodes may only be rebooted when they contain no running jobs
+(i.e. sufficient resources may be available to run a pending job, but until
+the node is idle and can be rebooted, the pending job may not be allocated
+resources). Also note that the job will be charged for resources from the time
+of resource allocation, which may include time to reboot a node into the
+desired NUMA and MCDRAM configuration.</p>
+
+<p>While Slurm generally supports a very rich set of options for the node
+constraint options (exclusive OR, node counts for each constraint, etc.),
+only a simple AND operation is supported for KNL systems (specified using a
+comma or ampersand separator between specified constraints).
+Jobs may specify their desired NUMA and/or MCDRAM configuration. If no
+NUMA and/or MCDRAM configuration is specified, then a node with any possible
+value for that configuration will be used.</p>
+
+<table width="100%" border=1 cellspacing=0 cellpadding=4>
+<tr>
+  <th width="15%">Type</th>
+  <th width="15%">Name</th>
+  <th width="70%">Description</th>
+</tr>
+<tr><td>MCDRAM</td><td>cache</td><td>All of MCDRAM to be used as cache</td></tr>
+<tr><td>MCDRAM</td><td>equal</td><td>MCDRAM to be used partly as cache and partly combined with primary memory</td></tr>
+<tr><td>MCDRAM</td><td>flat</td><td>MCDRAM to be combined with primary memory into a "flat" memory space</td></tr>
+<tr><td>NUMA</td><td>a2a</td><td>All to all</td></tr>
+<tr><td>NUMA</td><td>hemi</td><td>Hemisphere</td></tr>
+<tr><td>NUMA</td><td>snc2</td><td>Sub-NUMA cluster 2</td></tr>
+<tr><td>NUMA</td><td>snc4</td><td>Sub-NUMA cluster 4 (<a href="#note">NOTE</a>)</td></tr>
+<tr><td>NUMA</td><td>quad</td><td>Quadrant (<a href="#note">NOTE</a>)</td></tr>
+</table>
+
+<p>Jobs requiring some or all of the KNL high bandwidth memory (HBM) should
+explicitly request that memory using Slurm's Generic RESource (GRES) options.
+The HBM will always be known by Slurm GRES name of "hbm".
+Examples below demonstrate use of HBM.</p>
+
+<p><a name="note"><b>NOTE</b></a>: Slurm version 16.05 and earlier can only
+support homogeneous nodes (e.g. the same number of cores per NUMA node).
+KNL scn4 and quad modes are not homogeneous, but each each NUMA mode will have
+either 16 or 18 cores. This will result in Slurm using the lower core count,
+finding a total of 256 threads rather than 272 threads and setting the node
+to a DOWN state.</p>
+
+<h3>Accounting</h3>
+
+<p>If a node requires rebooting for a job's required configuration, the job
+will be charged for the resource allocation from the time of allocation through
+the lifetime of the job, including the time consumed for booting the nodes.
+The job's time limit will be calculated from the time that all nodes are ready
+for use.
+For example, a job with a 10 minute time limit may be allocated resources at
+10:00:00.
+If the nodes require rebooting, they might not be available for use until
+10:20:00, 20 minutes after allocation, and the job will begin execution at
+that time.
+The job must complete no later than 10:30:00 in order to satisfy it's time limit
+(10 minutes after execution actually begins).
+However, the job will be charged for 30 minutes of resource use, which includes
+the boot time.</p>
+
+<h3>Sample Use Cases</h3>
+
+<pre>
+$ sbatch -C flat,a2a -N2 -gres=hbm:8g --exclusive my.script
+$ srun --constraint=hemi,cache -n36 a.out
+$ srun --constraint=flat --gres=hbm:2g -n36 a.out
+
+$ sinfo -o "%30N %20b %f"
+NODELIST       ACTIVE_FEATURES  AVAIL_FEATURES
+nid000[10-11]
+nid000[12-35]  flat,a2a         flat,a2a,snc2,hemi
+nid000[36-43]  cache,a2a        flat,equal,cache,a2a,hemi
+</pre>
+
+<h3>Network Topology</h3>
+
+<p>Slurm will optimize performance using those resources available without
+rebooting. If node rebooting is required, then it will optimize layout with
+respect to network bandwidth using both nodes currently in the desired
+configuration and those which can be made available after rebooting.
+This can result in more nodes being rebooted than strictly needed, but will
+improve application performance.</p>
+
+<p>Users can specify they want all resources allocated on a specific count of
+leaf switches (Dragonfly group) using Slurm's <b>--switches</b> option.
+They can also specify how much additional time they are willing to wait for
+such a configuration. If the desired configuration can not be made available
+within the specified time interval, the job will be allocated nodes optimized
+with respect to network bandwidth to the extent possible. On a Dragonfly
+network, this means allocating resources over either single group or
+distributed evenly over as many groups as possible. For example:</p>
+<pre>
+srun --switches=1@10:00 N16 a.out
+</pre>
+<p>Note that system administrators can disable use of the <b>--switches</b>
+option or limit the amount of time the job can be deferred using the
+<b>SchedulerParameters</b> <b>max-switch-wait</b> option.</p>
+
+<h3>Booting Problems</h3>
+
+<p>If node boots fail, those nodes are drained and the job is requeued so that
+it can be allocated a different set of nodes. The nodes originally allocated
+to the job will remain available to the job, so likely a small number of
+additional nodes will be required.</p>
+
+<h2>System Administration</h2>
+
+<p>Three important components are required to use Slurm on an Intel KNL system.</p>
+<ol>
+<li>The node features plugin manages the available and active features
+information available for each KNL node.</li>
+
+<li>A configuration file is used to define various timeouts, default
+configuration, etc. The configuration file name and contents will depend upon
+the node features plugins used. See the <a href="knl.conf.html">knl.conf</a>
+man page for more information.</li>
+
+<li>A mechanism is required to boot nodes in the desired configuration. This
+mechanism must be integrated with existing Slurm infrastructure for
+<a href="sbatch.html">rebooting nodes on user request (--reboot)</a> plus
+<a href="power_save.html">power saving</a> (powering down idle nodes and
+restarting them on demand).</li>
+</ol>
+
+<p>In addition, there is a DebugFlags option of "NodeFeatures" which will
+generate detailed information about KNL operations.</p>
+
+<p>Note that a node's KNL-specific available and active features are not
+included in the "slurm.conf" configuration file, but are set and the managed
+by the NodeFeatures plugin.
+Features which are not KNL-specific (e.g. rack number, "knl", etc.) will be
+copied from the node's "Features" configuration in "slurm.conf" to both the
+available and active feature fields and not modified by the NodeFeatures
+plugin.</p>
+
+<p>Slurm version 16.05 does not support the concept of multiple NUMA nodes
+within a single socket. If a KNL node is booted with multiple NUMA, then each
+NUMA node will appear in Slurm as a separate socket.
+In the slurm.conf configuration file, set "FastSchedule=1" and node socket and
+core counts to values which are appropriate for some NUMA mode to be used on the
+node. When the node boots and the slurmd daemon on the node starts, it will
+report to the slurmctld daemon the node's actual socket (NUMA) and core counts,
+which will update Slurm data structures for the node to the values which are
+currently configured.
+Note that Slurm (version 16.05) current does not support the concept of
+differing numbers of cores in each socket (or NUMA node). We are currently
+working to address these issues.</p>
+
+<h3>Mode of Operation</h3>
+
+<ol>
+<li>The node's configured "Features" are copied to the available and active
+feature fields.</li>
+<li>The node features plugin determines the node's current MCDRAM and NUMA
+values as well as those which are available and adds those values to the node's
+active and available feature fields respectively. Note that these values may
+not be available until the node has booted and the slurmd daemon on the
+compute node sends that information to the slurmctld daemon.</li>
+<li>Jobs will be allocated nodes already in the requested MCDRAM and NUMA mode
+if possible. If insufficient resources are available with the requested
+configuration then other nodes will be selected and booted into the desired
+configuration once no other jobs are active on the node. Until a node is idle,
+its configuration can not be changed. Note that node reboot time is roughly
+on the order of 20 minutes.</li>
+</ol>
+
+<h3>Cray Configuration</h3>
+
+<p>On Cray systems NodeFeaturesPlugins should be set to "knl_cray".</p>
+
+<p>The configuration file will be named "knl_cray.conf".
+The file will include the path to the capmc program (CapmcPath), which is used
+to get a node's available MCDRAM and NUMA modes, change the modes, power the
+node down, reboot it, etc.
+Note the "CapmcTimeout" parameter is the time required for the capmc program
+to respond to a request and NOT the time for a boot operation to complete.</p>
+
+<p>Power saving mode is integrated with rebooting nodes in the desired mode.
+Programs named "capmc_resume" and "capmc_suspend" are provided to boot nodes in
+the desired mode. The programs are included in the main Slurm RPM and
+installed in the "sbin" directory and must be installed on the Cray "sdb" node.
+If powering down of idle nodes is not desired, then configure "ResumeProgram"
+in "slurm.conf" to the path of the "capmc_resume" file and configure
+"SuspendTime" to a huge value (e.g. "SuspendTime=30000000" will only power
+down a node which has been idle for about one year).</p>
+
+<p>The GresTypes configuration parameter should include "hbm" to identify
+High Bandwidth Memory (HBM) as being a consumable resources on compute nodes.
+Additional GresTypes can be specified as needed in a comma separated list.
+The amount of HBM on each node should not be configured in a Slurm configuration
+file, but that information will be loaded by the knl_cray plugin using
+information provided by the capmc program.</p>
+
+<h3>Sample knl_cray.conf File</h3>
+
+<pre>
+# Sample knl_cray.conf
+CapmcPath=/opt/cray/capmc/default/bin/capmc
+CapmcTimeout=2000	# msec
+DefaultNUMA=a2a         # NUMA=all2all
+AllowNUMA=a2a,snc2,hemi
+DefaultMCDRAM=cache     # MCDRAM=cache
+
+<h3>Sample slurm.conf File</h3>
+
+<pre>
+# Sample slurm.conf
+NodeFeaturesPlugins=knl_cray
+DebugFlags=NodeFeatures
+GresTypes=hbm
+#
+ResumeProgram=/opt/slurm/default/sbin/capmc_resume
+SuspendTime=30000000
+ResumeTimeout=1800
+...
+Nodename=default Sockets=1 CoresPerSocket=68 ThreadsPerCore=4 RealMemory=128000 Feature=knl
+NodeName=nid[00000-00127] State=UNKNOWN
+</pre>
+
+<p class="footer"><a href="#top">top</a></p>
+
+<p style="text-align:center;">Last modified 6 May 2016</p>
+
+<!--#include virtual="footer.txt"-->
diff --git a/doc/html/launch_plugins.shtml b/doc/html/launch_plugins.shtml
index 4d95b9c9c..059f57281 100644
--- a/doc/html/launch_plugins.shtml
+++ b/doc/html/launch_plugins.shtml
@@ -13,7 +13,7 @@ plugin_name[]="<i>launch&nbsp;Slurm&nbsp;plugin</i>"</span>
 <p style="margin-left:.2in">
 
 <p><span class="commandline">const char
-plugin_type[]="<i>launch/slurm</i>"</span><br>
+plugin_type[]="<i>launch/[aprun|poe|runjob|slurm</i>"</span><br>
 <p style="margin-left:.2in">
 
 <ul>
@@ -143,6 +143,6 @@ The system <span class="commandline">_init()</span> is called before the Slurm
 
 <p class="footer"><a href="#top">top</a>
 
-<p style="text-align:center;">Last modified 27 March 2015</p>
+<p style="text-align:center;">Last modified 11 February 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/man_index.shtml b/doc/html/man_index.shtml
index bcac4167e..d0ab80ce8 100644
--- a/doc/html/man_index.shtml
+++ b/doc/html/man_index.shtml
@@ -41,6 +41,7 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 <tr><td><a href="cray.conf.html">cray.conf</a></td><td>Slurm configuration file Cray systems.</td></tr>
 <tr><td><a href="ext_sensors.conf.html">ext_sensors.conf</a></td><td>Slurm configuration file for the external sensor support</td></tr>
 <tr><td><a href="gres.conf.html">gres.conf</a></td><td>Slurm configuration file for generic resource management.</td></tr>
+<tr><td><a href="knl.conf.html">knl.conf</a></td><td>Slurm configuration file for Intel Knights Landing management.</td></tr>
 <tr><td><a href="nonstop.conf.html">nonstop.conf</a></td><td>Slurm configuration file for failure management.</td></tr>
 <tr><td><a href="slurm.conf.html">slurm.conf</a></td><td>Slurm configuration file</td></tr>
 <tr><td><a href="slurmdbd.conf.html">slurmdbd.conf</a></td><td>Slurm Database Daemon (SlurmDBD) configuration file</td></tr>
@@ -58,6 +59,6 @@ Documentation for other versions of Slurm is distributed with the code</b></p>
 </table>
 
 
-<p style="text-align:center;">Last modified 26 March 2014</p>
+<p style="text-align:center;">Last modified 8 December 2015</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/mc_support.shtml b/doc/html/mc_support.shtml
index 6549aceb8..f449d3d23 100644
--- a/doc/html/mc_support.shtml
+++ b/doc/html/mc_support.shtml
@@ -858,7 +858,7 @@ JobId=20 UserId=(30352) GroupId=users(1051)
    NodeList=hydra[12-14] NodeListIndices=0,2,-1
    <u>AllocCPUs=1,2,1</u>
    NumCPUs=4 ReqNodes=2 <u>ReqS:C:T=2:1:*</u>
-   Shared=0 Contiguous=0 CPUs/task=0
+   OverSubscribe=0 Contiguous=0 CPUs/task=0
    MinCPUs=0 MinMemory=0 MinTmpDisk=0 Features=(null)
    Dependency=0 Account=(null) Reason=None Network=(null)
    ReqNodeList=(null) ReqNodeListIndices=-1
@@ -922,7 +922,7 @@ NodeName=dualcore[01-16] CPUs=4 CoresPerSocket=2 ThreadsPerCore=1
 <p>For a more complete description of the various node configuration options
 see the slurm.conf man page.</p>
 <!-------------------------------------------------------------------------->
-<p style="text-align:center;">Last modified 1 April 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
 
diff --git a/doc/html/mcs.shtml b/doc/html/mcs.shtml
new file mode 100644
index 000000000..b237fdf50
--- /dev/null
+++ b/doc/html/mcs.shtml
@@ -0,0 +1,126 @@
+<!--#include virtual="header.txt"-->
+
+<h1>Multi-Category Security (MCS) Guide</h1>
+
+<h2>MCS Overview</h2>
+<p>Slurm can be configured to associate a category label to jobs and optionally
+ensure that nodes can only be shared among jobs having the same category label.
+Job and node information can optionally be filtered based on their MCS labels
+in coordination with the PrivateData option:
+only users having access to the associated MCS label will have access
+to the information. The MCS plugin is responsible for these features.</p>
+
+<p>Users may either request a particular category label for a job,
+or use the default value generated by the MCS plugin implementation.
+The MCS plugin is responsible for checking that the user provided label
+is valid for the user.</p>
+
+<p>MCS labels can be either enforced or specified on demand on jobs.
+When set to ondemand, MCS label will only be set when users specify a valid one
+at submission time.
+It is the responsibility of the MCS plugin to validate the correctness
+of the requested labels.
+When enforced, the MCS plugin implementation will always associate
+the default MCS label of users to their jobs unless users specify another
+valid one.</p>
+
+<p>The selection of nodes can be filtered on MCS labels :
+on demand (ondemand) or always (select) or never (noselect).
+User can force the filter with --exclusive=mcs option (except if noselect mode).</p>
+
+<p>The MCS category label (also called MCS label) for a job is shown in
+squeue with the format option mcslabel.
+The node's inherited MCS label is shown with scontrol show nodes.
+The sview command can also be used to see those MCS labels.</p>
+
+<p>The following configuration parameters are available:</p>
+<ul>
+<li><b>MCSPlugin:</b>
+Specifies which plugin should be used.
+</li>
+<li><b>MCSParameters:</b>
+Specifies options to pass to the MCS plugin implementation.
+The string is of the form:<br>
+"[ondemand|enforced][,noselect|,select|,ondemandselect][,privatedata]:[mcs_plugin_parameters]"<br>
+The defaults are "ondemand,ondemandselect" and no privatedata</li>
+<ul>
+<li>[ondemand|enforced]: set MCS label on jobs either on demand (using --mcs-label option) or always</li>
+<li>[,noselect|,select|,ondemandselect]:  select nodes with filter on MCS label : never,
+always or on demand (using --exclusive=mcs option)</li>
+<li>[,privatedata]: accordingly with privatedata option:<br>
+if privatedata and privatedata=jobs: jobs informations are filtered based on their MCS labels<br>
+if privatedata and privatedata=nodes: nodes informations are filtered based on their MCS labels<br>
+Only mcs/group is currently supporting the mcs_plugin_parameters option.
+It can be used to specify the list of user groups (separated by |) that can be mapped
+to MCS labels by the mcs/group plugin.</li>
+</ul>
+</li>
+</ul>
+
+<h2>Some examples</h2>
+
+<p>slurm.conf:
+<pre>
+MCSPlugin=mcs/user
+MCSParameters=enforced,select,privatedata
+</pre>
+
+or
+
+<p>
+<pre>
+MCSPlugin=mcs/group
+MCSParameters=ondemand,noselect:groupA|groupB|groupC
+</pre>
+
+<h2>View MCS parameters</h2>
+
+<p>Configured MCS parameters can be viewed using the <it>scontrol</it> command.
+<pre>
+scontrol show config |grep MCS
+MCSPlugin          = mcs/group
+MCSParameters      = ondemand,noselect:groupA|groupB|groupC
+</pre>
+
+<h2>Put a mcs_label in job using salloc, sbatch or srun command</h2>
+<pre>
+srun -n10 -t 1000 --mcs-label=groupB ./job &
+</pre>
+
+<h2>Put a mcs_label in job with exclusivity</h2>
+<pre>
+srun -n10 -t 1000 --mcs-label=groupB --exclusive=mcs ./job &
+</pre>
+
+
+<h2>View MCS parameters in usage</h2>
+
+<p>The <it>squeue</it> command can also display the MCS with mcslabel
+format option
+<pre>
+squeue -O jobid,username,mcslabel
+JOBID               USER                MCSLABEL
+2                   foo                 groupA
+3	            bar                 groupB
+</pre>
+
+<p>The <it>scontrol</it> command will now display the MCS_label
+<pre>
+scontrol show nodes
+NodeName=node0001 Arch=x86_64 CoresPerSocket=4
+   CPUAlloc=0 CPUErr=0 CPUTot=8 CPULoad=0.01 Features=(null)
+   Gres=(null)
+   NodeAddr=noder0001 NodeHostName=node0001 Version=15.08
+   OS=Linux RealMemory=23780 AllocMem=0 Sockets=2 Boards=1
+   State=IDLE ThreadsPerCore=1 TmpDisk=0 Weight=40 Owner=N/A
+   MCS_label=groupA BootTime=2015-08-05T10:14:41
+   SlurmdStartTime=2015-09-07T13:42:28 CapWatts=n/a
+   CurrentWatts=0 LowestJoules=0 ConsumedJoules=0
+   ExtSensorsJoules=n/s ExtSensorsWatts=0 ExtSensorsTemp=n/s
+</pre>
+
+<p class="footer"><a href="#top">top</a></p>
+
+<p style="text-align:center;">Last modified 20 November 2015</p>
+
+<!--#include virtual="footer.txt"-->
diff --git a/doc/html/mcs_plugins.shtml b/doc/html/mcs_plugins.shtml
new file mode 100644
index 000000000..125694905
--- /dev/null
+++ b/doc/html/mcs_plugins.shtml
@@ -0,0 +1,109 @@
+<!--#include virtual="header.txt"-->
+
+<h1><a name="top">Multi-Category Security (MCS) Plugin Programmer Guide
+</a></h1>
+
+<h2> Overview</h2>
+<p> This document describes Slurm's MCS plugins and the API that
+defines them. It is intended as a resource to programmers wishing to write
+their own Slurm MCS plugins.
+
+<p>Slurm MCS plugins must conform to the
+SLURM Plugin API with the following specifications:
+
+<p><span class="commandline">const char
+plugin_name[]="<i>full&nbsp;text&nbsp;name</i>"</span>
+<p style="margin-left:.2in">
+A free-formatted ASCII text string that identifies the plugin.
+
+<p><span class="commandline">const char
+plugin_type[]="<i>major/minor</i>"</span><br>
+<p style="margin-left:.2in">
+The major type must be &quot;mcs.&quot;
+The minor type can be any suitable name
+for the MCS. We recommend, for example :
+<ul>
+<li><b>none</b>&#151; Default. No category associated to jobs.
+<li><b>user</b>&#151; Use user name as the category to associate jobs to.
+<li><b>group</b>&#151; Use a user group as the category to associate jobs to.
+</ul>
+
+<p><span class="commandline">const uint32_t plugin_version</span><br>
+<p style="margin-left:.2in">
+If specified, identifies the version of Slurm used to build this plugin and
+any attempt to load the plugin from a different version of Slurm will result
+in an error.
+If not specified, then the plugin may be loaded by Slurm commands and
+daemons from any version, however this may result in difficult to diagnose
+failures due to changes in the arguments to plugin functions or changes
+in other Slurm functions used by the plugin.</p>
+
+<p>The programmer is urged to study
+<span class="commandline">src/plugins/mcs/group</span> and
+<span class="commandline">src/common/slurm_mcs.c</span>
+for an example implementation of a Slurm MCS plugin.
+<p class="footer"><a href="#top">top</a>
+
+<h2>API Functions</h2>
+<p>All of the following functions are required. Functions which are not
+implemented must be stubbed.
+
+<p class="commandline"> int init (void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Called when the plugin is loaded, before any other functions are
+  called. Put global initialization here.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p class="commandline"> void fini (void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Called when the plugin is removed. Clear any allocated storage here.
+<p style="margin-left:.2in"><b>Returns</b>: None.</p>
+
+<p><b>Note</b>: These init and fini functions are not the same as those
+described in the <span class="commandline">dlopen (3)</span> system library.
+The C run-time system co-opts those symbols for its own initialization.
+The system <span class="commandline">_init()</span> is called before the SLURM
+<span class="commandline">init()</span>, and the SLURM
+<span class="commandline">fini()</span> is called before the system's
+<span class="commandline">_fini()</span>.</p>
+
+<p class="commandline">int mcs_p_set_mcs_label(struct job_record *job_ptr, char* label)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+Verify and set or calculate MCS_label for a job.<br>
+Called by _job_create to get the mcs_label for a job.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+<span class="commandline"> job_ptr  </span>  (input/output) pointer to the slurmctld job
+structure. This can be used to get user_id and group_id.
+Assign MCS_label if possible.<br>
+<span class="commandline"> label </span>    (input) pointer to requested label or NULL if not specified.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+<span class="commandline">SLURM_SUCCESS </span> on success, or
+<span class="commandline">SLURM_ERROR</span> on failure.
+
+<p class="commandline">int mcs_p_check_mcs_label(uint32_t user_id, char *mcs_label)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+For command squeue/scontrol show nodes in case of option private. Check the compatibility between
+MCS_label of user and MCS_label of jobs/nodes.<br>
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+<span class="commandline">user_id, mcs_label (input).
+</span>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+<span class="commandline">SLURM_SUCCESS</span> on success, or
+<span class="commandline">SLURM_ERROR</span> on failure.
+
+<h2>Parameters</h2>
+<p>These parameters can be used in the slurm.conf to configure the plugin.</p>
+<dl>
+<dt><span class="commandline">MCSPlugin</span>
+<dd>Specifies which plugin should be used.
+<dt><span class="commandline">MCSParameters</span>
+<dd>If MCSPlugin!=mcs/none, specifies options
+
+<p class="footer"><a href="#top">top</a>
+
+<p style="text-align:center;">Last modified 12 October 2015</p>
+
+<!--#include virtual="footer.txt"-->
+
diff --git a/doc/html/moab.shtml b/doc/html/moab.shtml
index cb30e81b5..5091676b9 100644
--- a/doc/html/moab.shtml
+++ b/doc/html/moab.shtml
@@ -41,7 +41,7 @@ Slurm allocate the individual processors, memory, and other
 consumable resources.
 Alternately, <i>SelectType=select/linear</i> or
 <i>SelectType=select/bluegene</i> can be used with the
-<i>Shared=yes</i> or <i>Shared=force</i> parameter in
+<i>OverSubscribe=yes</i> or <i>OverSubscribe=force</i> parameter in
 partition configuration specifications.</p>
 
 <p>The default value of <i>SchedulerPort</i> is 7321.</p>
@@ -281,6 +281,6 @@ Write the output to a file with the same name as the user in the
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 15 April 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/mpi_guide.shtml b/doc/html/mpi_guide.shtml
index e97ba690f..a58696b77 100644
--- a/doc/html/mpi_guide.shtml
+++ b/doc/html/mpi_guide.shtml
@@ -64,6 +64,10 @@ the OMPI jobs can be launched directly using the srun command. This is
 the preferred way. If the pmi2 support is enabled then the command line
 options '--mpi=pmi2' has to be specified on the srun command line.
 
+<p>Starting from Open MPI version 2.0 PMIx is natively supported. To launch
+Open MPI application using PMIx the '--mpi=pmix' option has to be
+specified on the srun command line.
+
 <p>
 For older versions of OMPI not compiled with the pmi support
 the system administrator must specify the range of ports to be reserved
@@ -98,6 +102,12 @@ $ salloc -n4 sh   # allocates 4 processors and spawns shell for job
 &gt; srun --mpi=pmi2 -n 4 a.out
 </pre>
 
+<p>or using the pmix support</p>
+
+<pre>
+&gt; srun --mpi=pmix -n 4 a.out
+</pre>
+
 <p>If the ports reserved for a job step are found by the Open MPI library
 to be in use, a message of this form will be printed and the job step
 will be re-launched:<br>
diff --git a/doc/html/mpiplugins.shtml b/doc/html/mpiplugins.shtml
index 7e1304736..c36004855 100644
--- a/doc/html/mpiplugins.shtml
+++ b/doc/html/mpiplugins.shtml
@@ -24,6 +24,7 @@ abbreviation for the type of node selection algorithm. We recommend, for example
 <li><b>mvapich</b>&#151;For use with MVAPICH.</li>
 <li><b>openmpi</b>&#151;For use with OpenMPI.</li>
 <li><b>pmi2</b>&#151;For use with MPI2 and MVAPICH2.</li>
+<li><b>pmix</b>&#151;Exascale PMI implementation (currently supported by Open MPI starting from version 2.0)</li>
 <li><b>none</b>&#151;For use with most other versions of MPI.</li>
 </ul>
 <p><span class="commandline">const char plugin_name[]</span><br>
diff --git a/doc/html/news.shtml b/doc/html/news.shtml
index 999402d17..744d71196 100644
--- a/doc/html/news.shtml
+++ b/doc/html/news.shtml
@@ -2,88 +2,32 @@
 
 <h1>What's New</h1>
 
-<h2>Index</h2>
+<h2>Major Updates in Slurm Version 16.05</h2>
+<p>Slurm version 16.05 was released in May 2016.
+See the RELEASE_NOTES and NEWS files included with the distribution for a more
+complete description of changes.
+Highlights of that release include:</p>
 <ul>
-<li><a href="#1508">Slurm Version 15.08, August 2015</a></li>
-<li><a href="#1605">Slurm Version 16.05 and beyond</a></li>
+<li>Added --deadline option to salloc, sbatch and srun. Jobs which can not be
+    completed by the user specified deadline will be terminated with a state of
+    "Deadline" or "DL".</li>
+<li>Add an "scontrol top &lt;jobid&gt;" command to re-order the priorities of a user's
+    pending jobs. May be disabled with the "disable_user_top" option in the
+    SchedulerParameters configuration parameter.</li>
+<li>Add Multi-Category Security (MCS) infrastructure to permit nodes to be bound
+    to specific users or groups.</li>
+<li>Add --gres-flags=enforce-binding option to salloc, sbatch and srun commands.
+    If set, the only CPUs available to the job will be those bound to the
+    selected GRES (i.e. the CPUs identifed in the gres.conf file will be
+    strictly enforced rather than advisory).</li>
+<li>Added new job dependency type of "aftercorr" which will start a task of a
+    job array after the corresponding task of another job array completes.</li>
+<li>Implemented and documented PMIX protocol which is used to bootstrap an
+    MPI job. PMIX is an alternative to PMI and PMI2.</li>
+<li>Added wrappers for LSF/OpenLava commands.</li>
+<li>Added Grid Engine options to qsub command wrapper.</li>
 </ul>
 
-<h2><a name="1508">Major Updates Planned for Slurm Version 15.08</a></h2>
-<p>Slurm Version 15.08 was released in August 2015.
-Major enhancement include:
-<ul>
-<li>Added TRES (Trackable resources) to track utilization of memory, GRES,
-    burst buffer, license, and any other configurable resources in the
-    accounting database.</li>
-<li>Add configurable billing weight that takes into consideration any TRES when
-    calculating a job's resource utilization.</li>
-<li>Add configurable prioritization factor that takes into consideration any
-    TRES when calculating a job's resource utilization.</li>
-<li>Add burst buffer support infrastructure. Currently available plugin include
-    burst_buffer/generic (uses administrator supplied programs to manage file
-    staging) and burst_buffer/cray (uses Cray APIs to manage buffers).
-<li>Add power capping support for Cray systems with automatic rebalancing of
-    power allocation between nodes.</li>
-<li>Add support for job dependencies joined with OR operator (e.g.
-    "--depend=afterok:123?afternotok:124").</li>
-<li>Add advance reservation flag of "replace" that causes allocated resources
-    to be replaced with idle resources. This maintains a pool of available
-    resources that maintains a constant size (to the extent possible).</li>
-<li>Permit PreemptType=qos and PreemptMode=suspend,gang to be used together.
-    A high-priority QOS job will now oversubscribe resources and gang schedule,
-    but only if there are insufficient resources for the job to be started
-    without preemption. NOTE: That with PreemptType=qos, the partition's
-    Shared=FORCE:# configuration option will permit one job more per resource
-    to be run than than specified, but only if started by preemption.</li>
-<li>A partition can now have an associated QOS.  This will allow a partition
-    to have all the limits a QOS has.  If a limit is set in both QOS
-    the partition QOS will override the job's QOS unless the job's QOS has the
-    'OverPartQOS' flag set.</li>
-<li>Expanded --cpu-freq parameters to include min-max:governor specifications.
-    --cpu-freq now supported on salloc and sbatch.</li>
-<li>Add support for optimized job allocations with respect to SGI Hypercube
-    topology.</li>
-<li>Optimize resource allocation for systems with dragonfly networks.</li>
-<li>Add the ability for a compute node to be allocated to multiple jobs, but
-    restricted to a single user. Added "--exclusive=user" option to salloc,
-    the scontrol and sview commands. Added new partition configuration parameter
-    "ExclusiveUser=yes|no".</li>
-<li>Added plugin to record job completion information using Elasticsearch.</li>
-<li>Add support for PMI Exascale (PMIx) for improved MPI scalability.</li>
-<li>Add support for communication gateway nodes to improve scalability.</li>
-<li>Add layouts framework, which will be the basis for further developments toward
-    optimizing scheduling with respect to additional parameters such as temperature
-    and power consumption.</li>
-</ul>
-
-<h2><a name="1605">Major Updates in Slurm Version 16.05 and beyond</a></h2>
-<p> Detailed plans for release dates and contents of additional Slurm releases
-have not been finalized. Anyone desiring to perform Slurm development should
-notify <a href="mailto:slurm-dev@schedmd.com">slurm-dev@schedmd.com</a>
-to coordinate activities. Future development plans includes:
-<ul>
-<!-- Bull led -->
-<li>Add support asymmetric resource allocation and MPMD programming. Multiple
-    resource allocation specification (memory, CPUs, GPUs, etc.) will be
-    supported in a single job allocation.</li>
-<!-- Universitat Jaume I & Universitat Politecnica de Valencia -->
-<li>Add support for
-<a href="http://slurm.schedmd.com/SUG14/remote_gpu.pdf">Remote CUDA (rCUDA)</a></li>
-<li>Distributed architecture to support the management of resources with Intel
-    Knight's Landing processors.</li>
-<li>Fault-tolerance and jobs dynamic adaptation through communication protocol
-    between Slurm, MPI libraries and the application.</li>
-<li>Improved support for provisioning and virtualization.</li>
-<!-- <li>IP communications over InfiniBand network for improved performance.</li>
-<li>Integration with
-    <a href="http://en.wikipedia.org/wiki/FlexNet_Publisher">FLEXlm
-    (Flexnet Publisher)</a> license management.</li>
-<li>Improved support for high-throughput computing (e.g. multiple slurmctld
-    daemons on a single cluster).</li>
-<li>Add Kerberos credential support including credential forwarding
-    and refresh.</li>
-<li>Provide a web-based Slurm administration tool.</li> -->
-</ul>
-<p style="text-align:center;">Last modified 22 October 2015</p>
+<p style="text-align:center;">Last modified 28 April 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/node_features_plugins.shtml b/doc/html/node_features_plugins.shtml
new file mode 100644
index 000000000..31db9d4cc
--- /dev/null
+++ b/doc/html/node_features_plugins.shtml
@@ -0,0 +1,174 @@
+<!--#include virtual="header.txt"-->
+
+<h1><a name="top">Node Features Plugin Programmer Guide</a></h1>
+
+<h2> Overview</h2>
+<p>This document describes the node features plugin that is responsible for
+managing a node's active features. This is typically used for changing a node's
+characteristics at boot time. For example, an Intel Knights Landing (KNL)
+processor can be booted in various MCDRAM and NUMA modes.
+This document is intended as a resource to programmers wishing to write their
+own node features plugin.</p>
+
+<p><span class="commandline">const char
+plugin_name[]="<i>launch&nbsp;Slurm&nbsp;plugin</i>"</span>
+<p style="margin-left:.2in">
+
+<p><span class="commandline">const char
+plugin_type[]="<i>node_features/[knl_cray]</i>"</span><br>
+<p style="margin-left:.2in">
+
+<ul>
+<li><b>knl_cray</b>&#151;Use Cray's capmc command to manage an Intel KNL processor.</li>
+</ul>
+
+<p><span class="commandline">const uint32_t plugin_version=SLURM_VERSION_NUMBER</span><br>
+If specified, identifies the version of Slurm used to build this plugin and
+any attempt to load the plugin from a different version of Slurm will result
+in an error.
+If not specified, then the plugin may be loadeed by Slurm commands and
+daemons from any version, however this may result in difficult to diagnose
+failures due to changes in the arguments to plugin functions or changes
+in other Slurm functions used by the plugin.</p>
+
+<p>The programmer is urged to study
+<span class="commandline">src/plugins/node_features/knl_cray/node_features_knl_cray.c</span>
+for a sample implementation of a Slurm node features plugin.
+<p class="footer"><a href="#top">top</a>
+
+<h2>API Functions</h2>
+
+<p class="commandline"> int init (void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Called when the plugin is loaded, before any other functions are
+  called. Put global initialization here.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p class="commandline"> int fini (void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Called when the plugin is removed. Clear any allocated storage here.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p><b>Note</b>: These init and fini functions are not the same as those
+described in the <span class="commandline">dlopen (3)</span> system library.
+The C run-time system co-opts those symbols for its own initialization.
+The system <span class="commandline">_init()</span> is called before the Slurm
+<span class="commandline">init()</span>, and the Slurm
+<span class="commandline">fini()</span> is called before the system's
+<span class="commandline">_fini()</span>.</p>
+
+<p class="commandline"> int node_features_p_reconfig(void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Note that the configuration has changed, read configuration parameters again.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p class="commandline"> int node_features_p_get_node(char *node_list)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Update active and available features on specified nodes.
+  Executed from the slurmctld daemon only and directly updates internal
+  node data structures.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> node_list:</span> Regular expression identifying
+  the nodes to be updated. Update information about all nodes is value is NULL.<br>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p class="commandline"> int node_features_p_job_valid(char *job_features)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Determine of the user's job constraint string is valid.
+  This may be used to limit the type of operators supported (Slurm's active
+  feature logic only supports the AND operator) and prevent illegal
+  combintations of node features (e.g. multiple NUMA modes).
+  Executed from the slurmctld daemon only when either the job submit or
+  modify operation is invoked.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> job_features:</span> Job constraints specified by
+  the user (-c/--constraint options).<br>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  <span class="commandline">SLURM_SUCCESS</span> on success, or<br>
+  <span class="commandline">SLURM_ERROR</span> on failure.</p>
+
+<p class="commandline"> char *node_features_p_job_xlate(char *job_features)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Translate a job's feature request to the node features needed at boot time.
+  Job features not required by this plugin (e.g. rack number) will not be
+  returned. For example, a user requested features may be "cache&quad&knl&rack1".
+  Since the "knl" and "rack1" represent physical characteristics of the node
+  and are not used by the node features plugin to boot the node, this function's
+  return value will be "cache,quad".
+  Executed from the slurmctld daemon only.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> job_features:</span> Job constraints specified by
+  the user (-c/--constraint options).<br>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  Node features used by this plugin when configuring or booting a node.
+  A string with it's memory allocated by xmalloc (i.e. the return value
+  must be released using Slurm's xfree function).</p>
+
+<p class="commandline"> bool node_features_p_node_power(void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Report if the PowerSave mode is required to boot nodes.
+  Executed from the slurmctld daemon only.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  True if the plugin requires PowerSave mode for booting nodes.
+
+<p class="commandline"> bool node_features_p_node_reboot(void)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Report if the RebootProgram is required to boot nodes.
+  Executed from the slurmctld daemon only.
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  True if the plugin requires RebootProgram mode for booting nodes.
+
+<p class="commandline"> void node_features_p_node_state(char **avail_modes, char **current_mode)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Get this node's available and current features (e.g. MCDRAM and NUMA
+  settings from BIOS for a KNL processor, for example
+  avail_modes="cache,flat,equal,a2a,quad,hemi,snc2,snc4" and
+  current_mode="cache,quad").
+  Executed from the slurmd daemon only.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> avail_modes:</span> Nodes state features which are
+  available. Value is allocated or appended to as appropriate with xmalloc functions.<br>
+  <span class="commandline"> current_modes:</span> Nodes state features which
+  are currently in effect. Value is allocated or appended to as appropriate
+  with xmalloc functions.</p>
+
+<p class="commandline"> char *node_features_p_node_xlate(char *new_features, char *orig_features)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Translate a node's new feature specification as needed to preserve any
+  original features (i.e. features outside of the domain of this plugin).
+  For example, a node's new features may be "cache,quad", while it's original
+  features may have been "flat,hemi,knl,rack1".
+  The available features with respect to this plugin are "flat,hemi", while
+  features outside of the domain of this plugin are "knl,rack1".
+  In this case, this function's return value will be "cache,quad,knl,rack1".
+  Executed from the slurmctld daemon only.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> new_features:</span> Node's reported features.<br>
+  <span class="commandline"> orig_features:</span> Node's previous feature state.<br>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  Node's currently features value
+  A string with it's memory allocated by xmalloc (i.e. the return value
+  must be released using Slurm's xfree function).</p>
+
+<p class="commandline"> char *node_features_p_user_update(uid_t uid)
+<p style="margin-left:.2in"><b>Description</b>:<br>
+  Determine if the specified user can modify the currently available node
+  features.
+<p style="margin-left:.2in"><b>Arguments</b>: <br>
+  <span class="commandline"> uid:</span> User ID of user making request.<br>
+<p style="margin-left:.2in"><b>Returns</b>: <br>
+  True if user can change node active features to other available features.</p>
+
+<p class="footer"><a href="#top">top</a>
+
+<p style="text-align:center;">Last modified 1 March 2016</p>
+
+<!--#include virtual="footer.txt"-->
diff --git a/doc/html/preempt.shtml b/doc/html/preempt.shtml
index 5bca8a66c..c81264d97 100644
--- a/doc/html/preempt.shtml
+++ b/doc/html/preempt.shtml
@@ -132,32 +132,30 @@ select/cons_res plugin.</LI>
 </UL>
 </LI>
 <LI>
-<B>Priority</B>: Configure the partition's <I>Priority</I> setting relative to
-other partitions to control the preemptive behavior when
+<B>PriorityTier</B>: Configure the partition's <I>PriorityTier</I> setting
+relative to other partitions to control the preemptive behavior when
 <I>PreemptType=preempt/partition_prio</I>.
 This option is not relevant if <I>PreemptType=preempt/qos</I>.
 If two jobs from two
 different partitions are allocated to the same resources, the job in the
-partition with the greater <I>Priority</I> value will preempt the job in the
-partition with the lesser <I>Priority</I> value. If the <I>Priority</I> values
-of the two partitions are equal then no preemption will occur. The default
-<I>Priority</I> value is 1.
-<BR><B>NOTE:</B> Unless <I>PreemptType=preempt/partition_prio</I> the
-partition <I>Priority</I> is not critical.
+partition with the greater <I>PriorityTier</I> value will preempt the job in the
+partition with the lesser <I>PriorityTier</I> value. If the <I>PriorityTier</I>
+values of the two partitions are equal then no preemption will occur. The
+default <I>PriorityTier</I> value is 1.
 </LI>
 <LI>
-<B>Shared</B>: Configure the partition's <I>Shared</I> setting to
+<B>OverSubscribe</B>: Configure the partition's <I>OverSubscribe</I> setting to
 <I>FORCE</I> for all partitions in which job preemption using a suspend/resume
 mechanism is used or <I>NO</I> otherwise.
 The <I>FORCE</I> option supports an additional parameter that controls
-how many jobs can share a resource (FORCE[:max_share]). By default the
+how many jobs can oversubscribe a compute resource (FORCE[:max_share]). By default the
 max_share value is 4. In order to preempt jobs (and not gang schedule them),
 always set max_share to 1. To allow up to 2 jobs from this partition to be
 allocated to a common resource (and gang scheduled), set
-<I>Shared=FORCE:2</I>.
+<I>OverSubscribe=FORCE:2</I>.
 NOTE: <I>PreemptType=QOS</I> will permit one additional job to be run
 on the partition if started due to job preemption. For example, a configuration
-of <I>Shared=FORCE:1</I> will only permit one job per resources normally,
+of <I>OverSubscribe=FORCE:1</I> will only permit one job per resources normally,
 but a second job can be started if done so through preemption based upon QOS.
 The use of <I>PreemptType=QOS</I> and <I>PreemptType=Suspend</I> only applies
 with <I>SelectType=cons_res</I>.
@@ -167,7 +165,7 @@ with <I>SelectType=cons_res</I>.
 To enable preemption after making the configuration changes described above,
 restart Slurm if it is already running. Any change to the plugin settings in
 Slurm requires a full restart of the daemons. If you just change the partition
-<I>Priority</I> or <I>Shared</I> setting, this can be updated with
+<I>PriorityTier</I> or <I>OverSubscribe</I> setting, this can be updated with
 <I>scontrol reconfig</I>.
 </P>
 
@@ -279,9 +277,9 @@ Here are the Partition settings:
 </P>
 <PRE>
 [user@n16 ~]$ <B>grep PartitionName /shared/slurm/slurm.conf</B>
-PartitionName=DEFAULT Shared=FORCE:1 Nodes=n[12-16]
-PartitionName=active Priority=1 Default=YES
-PartitionName=hipri  Priority=2
+PartitionName=DEFAULT OverSubscribe=FORCE:1 Nodes=n[12-16]
+PartitionName=active PriorityTier=1 Default=YES
+PartitionName=hipri  PriorityTier=2
 </PRE>
 <P>
 The <I>runit.pl</I> script launches a simple load-generating app that runs
@@ -348,9 +346,9 @@ job preemption mechanisms.
 </P>
 <PRE>
 # Excerpt from slurm.conf
-PartitionName=low Nodes=linux Default=YES Shared=NO      Priority=10 PreemptMode=requeue
-PartitionName=med Nodes=linux Default=NO  Shared=FORCE:1 Priority=20 PreemptMode=suspend
-PartitionName=hi  Nodes=linux Default=NO  Shared=FORCE:1 Priority=30 PreemptMode=off
+PartitionName=low Nodes=linux Default=YES OverSubscribe=NO      PriorityTier=10 PreemptMode=requeue
+PartitionName=med Nodes=linux Default=NO  OverSubscribe=FORCE:1 PriorityTier=20 PreemptMode=suspend
+PartitionName=hi  Nodes=linux Default=NO  OverSubscribe=FORCE:1 PriorityTier=30 PreemptMode=off
 </PRE>
 <PRE>
 $ sbatch tmp
@@ -383,7 +381,7 @@ with the other jobs on overlapping resources.
 # Excerpt from slurm.conf
 PreemptMode=Suspend,Gang
 PreemptType=preempt/qos
-PartitionName=normal Nodes=linux Default=NO  Shared=FORCE:1
+PartitionName=normal Nodes=linux Default=NO  OverSubscribe=FORCE:1
 </PRE>
 
 <H2><A NAME="future_work">Future Ideas</A></H2>
@@ -433,6 +431,6 @@ order to support ideal placements such as this, which can quickly complicate
 the design. Any and all help is welcome here!
 </P>
 
-<p style="text-align:center;">Last modified 20 October 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/qos.shtml b/doc/html/qos.shtml
index 6bda13101..74b6d6b22 100644
--- a/doc/html/qos.shtml
+++ b/doc/html/qos.shtml
@@ -96,8 +96,11 @@ characteristics. Valid options are:
 
 <ul>
 <li><b>DenyOnLimit</b> If set, jobs using this QOS will be rejected at
-submission time if they do not conform to the QOS 'Max' limits.  By default
-jobs that go over these limits will pend until they conform.
+submission time if they do not conform to the QOS 'Max' limits.  Group
+limits will also be treated like 'Max' limits as well and will be
+denied if they go over. By default jobs that go over these limits
+will pend until they conform.  This currently only applies to QOS and
+Association limits.
 
 <li><b>EnforceUsageThreshold</b> If set, and the QOS also has a UsageThreshold,
 any jobs submitted with this QOS that fall below the UsageThreshold
diff --git a/doc/html/quickstart.shtml b/doc/html/quickstart.shtml
index 610bea0cb..7a5c02af2 100644
--- a/doc/html/quickstart.shtml
+++ b/doc/html/quickstart.shtml
@@ -105,7 +105,7 @@ and maximum node count, processor count, specific nodes to use or not use, and
 specific node characteristics (so much memory, disk space, certain required
 features, etc.).
 A job can contain multiple job steps executing sequentially or in parallel on
-independent or shared nodes within the job's node allocation.</p>
+independent or shared resources within the job's node allocation.</p>
 
 <p><span class="commandline"><b>strigger</b></span> is used to set, get or
 view event triggers. Event triggers include things such as nodes going down
@@ -183,13 +183,13 @@ below. See the man page for more information.</p>
 <pre>
 adev0: scontrol show partition
 PartitionName=debug TotalNodes=5 TotalCPUs=40 RootOnly=NO
-   Default=YES Shared=FORCE:4 Priority=1 State=UP
+   Default=YES OverSubscribe=FORCE:4 PriorityTier=1 State=UP
    MaxTime=00:30:00 Hidden=NO
    MinNodes=1 MaxNodes=26 DisableRootJobs=NO AllowGroups=ALL
    Nodes=adev[1-5] NodeIndices=0-4
 
 PartitionName=batch TotalNodes=10 TotalCPUs=80 RootOnly=NO
-   Default=NO Shared=FORCE:4 Priority=1 State=UP
+   Default=NO OverSubscribe=FORCE:4 PriorityTier=1 State=UP
    MaxTime=16:00:00 Hidden=NO
    MinNodes=1 MaxNodes=26 DisableRootJobs=NO AllowGroups=ALL
    Nodes=adev[6-15] NodeIndices=5-14
@@ -210,7 +210,7 @@ JobId=65672 UserId=phil(5136) GroupId=phil(5136)
    StartTime=06/02-15:27:11 EndTime=06/02-15:37:11
    JobState=PENDING NodeList=(null) NodeListIndices=
    NumCPUs=24 ReqNodes=1 ReqS:C:T=1-65535:1-65535:1-65535
-   Shared=1 Contiguous=0 CPUs/task=0 Licenses=(null)
+   OverSubscribe=1 Contiguous=0 CPUs/task=0 Licenses=(null)
    MinCPUs=1 MinSockets=1 MinCores=1 MinThreads=1
    MinMemory=0 MinTmpDisk=0 Features=(null)
    Dependency=(null) Account=(null) Requeue=1
@@ -395,6 +395,6 @@ with Slurm are provided below.
 <li><a href="mpi_guide.html#quadrics_mpi">Quadrics MPI</a></li>
 </ul></p>
 
-<p style="text-align:center;">Last modified 13 August 2014</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/quickstart_admin.shtml b/doc/html/quickstart_admin.shtml
index c79de0f9e..0d46328ea 100644
--- a/doc/html/quickstart_admin.shtml
+++ b/doc/html/quickstart_admin.shtml
@@ -93,9 +93,6 @@ build requirements are present. Build dependencies for various plugins
 and commands are denoted below:
 </p>
 <ul>
-<li> <b>Authd</b> The auth/authd plugin will be built and installed if
-		the libauth development library and its dependency libs are
-		installed.</li>
 <li> <b>BLCR</b> The <i>checkpoint/blcr</i> plugin will be built if the
 		<i>blcr</i> development library is present.</li>
 <li> <b>cgroup Task Affinity</b> The <i>task/cgroup</i> plugin will be built
@@ -294,7 +291,6 @@ users and groups must be configured on those hosts.</p>
 authentication infrastructure is provided by a dynamically loaded
 plugin chosen at runtime via the <b>AuthType</b> keyword in the Slurm
 configuration file.  Currently available authentication types include
-<a href="http://www.theether.org/authd/">authd</a>,
 <a href="https://code.google.com/p/munge/">munge</a>, and none.
 The default authentication infrastructure is "munge", but this does
 require the installation of the MUNGE package.
@@ -302,7 +298,7 @@ An authentication type of "none" requires no infrastructure, but permits
 any user to execute any job as another user with limited programming effort.
 This may be fine for testing purposes, but certainly not for production use.
 <b>Configure some AuthType value other than "none" if you want any security.</b>
-We recommend the use of MUNGE unless you are experienced with authd.
+We recommend the use of MUNGE.
 If using MUNGE, all nodes in the cluster must be configured with the
 same <i>munge.key</i> file.
 The MUNGE daemon, <i>munged</i>, must also be started before Slurm daemons.</p>
@@ -518,7 +514,7 @@ SlurmdPort=7003
 SlurmdSpoolDir=/var/tmp/slurmd.spool
 SlurmdTimeout=300
 StateSaveLocation=/tmp/slurm.state
-SwitchType=switch/elan
+SwitchType=switch/none
 TreeWidth=50
 #
 # Node Configurations
@@ -578,13 +574,12 @@ message) between Slurm components can use a different security mechanism
 that is configurable.
 You must specify one &quot;auth&quot; plugin for this purpose using the
 <b>AuthType</b> configuration parameter.
-Currently, only three authentication plugins are supported:
-<b>auth/none</b>, <b>auth/authd</b>, and <b>auth/munge</b>.
-The auth/none plugin is built by default, but either
-Brent Chun's <a href="http://www.theether.org/authd/">authd</a>,
-or LLNL's <a href="https://code.google.com/p/munge/">MUNGE</a>
+Currently, only two authentication plugins are supported:
+<b>auth/none</b> and <b>auth/munge</b>.
+The auth/none plugin is built by default, but
+LLNL's <a href="https://code.google.com/p/munge/">MUNGE</a>
 should be installed in order to get properly authenticated communications.
-Unless you are experienced with authd, we recommend the use of MUNGE.
+We recommend the use of MUNGE.
 The configure script in the top-level directory of this distribution will
 determine which authentication plugins may be built.
 The configuration file specifies which of the available plugins will be utilized. </p>
@@ -636,7 +631,7 @@ JobId=475 UserId=bob(6885) Name=sleep JobState=COMPLETED
    AllocNode:Sid=adevi:21432 TimeLimit=UNLIMITED
    StartTime=03/19-12:53:41 EndTime=03/19-12:53:59
    NodeList=adev8 NodeListIndecies=-1
-   NumCPUs=0 MinNodes=0 Shared=0 Contiguous=0
+   NumCPUs=0 MinNodes=0 OverSubscribe=0 Contiguous=0
    MinCPUs=0 MinMemory=0 Features=(null) MinTmpDisk=0
    ReqNodeList=(null) ReqNodeListIndecies=-1
 
@@ -645,7 +640,7 @@ JobId=476 UserId=bob(6885) Name=sleep JobState=RUNNING
    AllocNode:Sid=adevi:21432 TimeLimit=UNLIMITED
    StartTime=03/19-12:54:01 EndTime=NONE
    NodeList=adev8 NodeListIndecies=8,8,-1
-   NumCPUs=0 MinNodes=0 Shared=0 Contiguous=0
+   NumCPUs=0 MinNodes=0 OverSubscribe=0 Contiguous=0
    MinCPUs=0 MinMemory=0 Features=(null) MinTmpDisk=0
    ReqNodeList=(null) ReqNodeListIndecies=-1
 </pre> <p>Print the detailed state of job 477 and change its priority to
@@ -694,7 +689,6 @@ AuthType          = auth/munge
 BackupAddr        = eadevj
 BackupController  = adevj
 BOOT_TIME         = 01/10-09:19:21
-CacheGroups       = 0
 CheckpointType    = checkpoint/none
 ControlAddr       = eadevi
 ControlMachine    = adevi
@@ -805,7 +799,7 @@ has no guarantee of working.</p>
 <p><b>Be mindful of your configured SlurmdTimeout and SlurmctldTimeout values</b>.
 If the Slurm daemon's are down for longer than the specified timeout during an
 upgrade, nodes may be marked DOWN and their jobs killed.
-You can either increase the timeout values during an upgrade or insure that the 
+You can either increase the timeout values during an upgrade or insure that the
 slurmd daemons on compute nodes are not down for longer than SlurmdTimeout.
 The recommended upgrade order is as follows:</p>
 <ol>
@@ -849,6 +843,6 @@ options such as mysql and gui tools via a configuration menu.</p>
 
 </pre> <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 23 October 2015</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/reservations.shtml b/doc/html/reservations.shtml
index 16a030cb4..0cb0549c7 100644
--- a/doc/html/reservations.shtml
+++ b/doc/html/reservations.shtml
@@ -401,6 +401,13 @@ JOBID PARTITION  NAME  USER ST  TIME  NODES NODELIST(REASON)
    98     debug   tmp   foo  R  0:07      1 tux1
 </pre>
 
+<h2>Reservation Purging After Last Job</h2>
+
+<p>A reservation may be automatically purged after the last associated job
+completes. This is accomplished by using a "purge_comp" flag.
+Once the reservation has been created, it must be populated within 5 minutes
+of its start time or it will be purged before any jobs have been run.</p>
+
 <h2>Reservation Accounting</h2>
 
 <p>Jobs executed within a reservation are accounted for using the appropriate
diff --git a/doc/html/resource_limits.shtml b/doc/html/resource_limits.shtml
index 41f6ba596..d59401556 100644
--- a/doc/html/resource_limits.shtml
+++ b/doc/html/resource_limits.shtml
@@ -126,6 +126,11 @@ policy option is not specified the default will be: the option
 for the cluster/account pair, and if both are not specified
 then the option for the cluster, and if that also is not
 specified then no limit will apply.</p>
+<p><b>NOTE:</b> Unless noted, if a job request breaches a given limit
+the job will pend unless the job's QOS has the DenyOnLimit
+flag set, which will cause the job to be denied at submission.  When
+Grp limits are considerd with respects to this flag the Grp limit
+is treated as a Max limit.</p>
 
 <ul>
 <li><b>GrpTRESMins=</b> The total number of TRES minutes that can
@@ -176,15 +181,11 @@ specified then no limit will apply.</p>
 </li>
 
 <li><b>MaxTRESPerJob=</b> The maximum size in TRES any given job can
-  have from the association/QOS.  If this limit is reached the job will
-  be denied at submission if the QOS running the job has the
-  DenyOnLimit flag set, otherwise the job will pend.
+  have from the association/QOS.
 </li>
 
 <li><b>MaxTRESPerNode=</b> The maximum size in TRES each node in a job
-  allocation can use.  If this limit is reached the job will
-  be denied at submission if the QOS running the job has the
-  DenyOnLimit flag set, otherwise the job will pend.
+  allocation can use.
 </li>
 
 <li><b>MaxJobs=</b> The total number of jobs able to run at any given
@@ -205,7 +206,7 @@ specified then no limit will apply.</p>
 </li>
 
 <!-- For future use
-<li><b>MaxTRESMinsPerJob=</b> A limit of TRES minutes to be used by jobs
+<li><b>MaxTRESRunMinsPerJob=</b> A limit of TRES minutes to be used by jobs
   running from the given association/QOS.  If this limit is
   reached the job will be killed will be allowed to run.
 </li>
@@ -239,15 +240,11 @@ specified then no limit will apply.</p>
 
 <ul>
 <li><b>MaxTRESPerUser=</b> The maximum number of limited TRES a user can
-  request (combo of all jobs running or pending).  If this limit is breached
-  the job will pend unless the QOS running the job has the
-  DenyOnLimit flag set, which will cause the job to be denied at submission.
+  request (combo of all jobs running or pending).
 </li>
 
 <li><b>MinTRESPerJob=</b> The minimum size in TRES any given job can
-  have from when using the requested QOS.  If this limit is breached
-  the job will pend unless the QOS running the job has the
-  DenyOnLimit flag set, which will cause the job to be denied at submission.
+  have from when using the requested QOS.
 </li>
 
 </ul>
diff --git a/doc/html/rpc.shtml b/doc/html/rpc.shtml
index 9b17161b1..e96d0c868 100644
--- a/doc/html/rpc.shtml
+++ b/doc/html/rpc.shtml
@@ -1,102 +1,102 @@
-<!--#include virtual="header.txt"-->
-
-<h1>Remote Procedure Call (RPC) Update Guide</h1>
-
-<h2>Overview</h2>
-
-<p>Slurm uses RPCs (Remote Procedure Calls) to communticate between
-daemons and commands. 
-The format of many RPCs change between major and/or minor Slurm releases
-(the release numbers are major.minor.micro and changes in the micro number
-indicate bug fixes since the previous release, while changes in the
-major or minor numbers indicate fundamental changes in logic).
-The reason for format changes is typically new fields being added for new
-Slurm capabilities.
-Slurm communicatins support the most current release plus the two previous
-release major and/or minor releases.
-For example, Slurm version 15.08.x daemons can communicate with Slurm commands
-from version 14.03.x, 14.11.x and 15.08.x.
-The same is true for state save files.
-Slurm can be upgraded through two major or minor releases without loss of data
-since the older state files are still recognized.
-Slurm commands initiated under one version of Slurm can also continue to
-execute and communicate with the Slurm daemons through two release upgrades
-of the daemons.
-Upgrades beyond two releases will result in unrecognized state information,
-but intermediate upgrades can be performed to reformat the state information
-and prevent its loss.
-As new versions of Slurm are relased, support for the oldest communication
-protocols is removed from the code.</p>
-
-<h2>Code Changes</h2>
-
-<p>The code used for packing and unpacking RPCs can be mostly found in
-<b>src/common</b>, although additional logic can also be found in each of
-of the Slurm daemons (slurmctld, slurmd, and slurmdbd) plus some of the
-plugins.</p>
-
-<p>All RPCs and state save files contain Slurm version information.
-This version information permits the server to recognize its format and
-respond using a message format understood by the client.
-When fields are added to or removed from existing RPCs, it is essential
-that only the format of RPCs for the newest release of Slurm (which is still
-under development) altered to avoid breaking pre-existing communication
-protocols.
-It may be necessary to add a new protocol version number to the code and
-support for releases beyond two previous releases may be removed.
-In the new code, copy the pack and unpack logic from the previous version of
-the code and add new fields as needed.
-Be sure to pack and unpack data in the identical order.
-It is also important to keep in mind that when adding support for new fields
-in an RPC protocol, that logic may need to be added to the older protocols
-setting the new field values to a reasonable default value (e.g. NULL, 0).
-For example, if a job is submitted using an old version of sbatch to a newer
-slurmctld daemon, job specifications that are unknown to the old sbatch
-should be set by the slurmctld daemon to reasonable values.
-An example of the changes required are shown below.
-In this trivial example, we want to add a new "max_nodes" filed to the
-message for Slurm vestion 15.08.x.</p>
-
-<pre>
-/*
- * Original code in Slurm v2.5.x
- */
-if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-	pack32(msg->user_id, buffer);
-	pack32(msg->min_nodes, buffer);
-} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-	pack32(msg->user_id, buffer);
-} else if (protocol_version >= SLURM_13_08_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-} else {
-	error("pack_whatever_msg: protocol_version "
-	      "%hu not supported", protocol_version);
-}
-</pre>
-<pre>
-/*
- * New code in Slurm v15.08.x
- */
-if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-	pack32(msg->user_id, buffer);
-	pack32(msg->min_nodes, buffer);
-	pack32(msg->max_nodes, buffer);
-} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-	pack32(msg->user_id, buffer);
-	pack32(msg->min_nodes, buffer);
-} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-	pack32(msg->job_id, buffer);
-	pack32(msg->user_id, buffer);
-} else {
-	error("pack_whatever_msg: protocol_version "
-	      "%hu not supported", protocol_version);
-}
-</pre>
-
-<p style="text-align:center;">Last modified 15 April 2015</p>
-
-<!--#include virtual="footer.txt"-->
+<!--#include virtual="header.txt"-->
+
+<h1>Remote Procedure Call (RPC) Update Guide</h1>
+
+<h2>Overview</h2>
+
+<p>Slurm uses RPCs (Remote Procedure Calls) to communicate between
+daemons and commands.
+The format of many RPCs change between major and/or minor Slurm releases
+(the release numbers are major.minor.micro and changes in the micro number
+indicate bug fixes since the previous release, while changes in the
+major or minor numbers indicate fundamental changes in logic).
+The reason for format changes is typically new fields being added for new
+Slurm capabilities.
+Slurm communications support the most current release plus the two previous
+release major and/or minor releases.
+For example, Slurm version 15.08.x daemons can communicate with Slurm commands
+from version 14.03.x, 14.11.x and 15.08.x.
+The same is true for state save files.
+Slurm can be upgraded through two major or minor releases without loss of data
+since the older state files are still recognized.
+Slurm commands initiated under one version of Slurm can also continue to
+execute and communicate with the Slurm daemons through two release upgrades
+of the daemons.
+Upgrades beyond two releases will result in unrecognized state information,
+but intermediate upgrades can be performed to reformat the state information
+and prevent its loss.
+As new versions of Slurm are released, support for the oldest communication
+protocols is removed from the code.</p>
+
+<h2>Code Changes</h2>
+
+<p>The code used for packing and unpacking RPCs can be mostly found in
+<b>src/common</b>, although additional logic can also be found in each of
+of the Slurm daemons (slurmctld, slurmd, and slurmdbd) plus some of the
+plugins.</p>
+
+<p>All RPCs and state save files contain Slurm version information.
+This version information permits the server to recognize its format and
+respond using a message format understood by the client.
+When fields are added to or removed from existing RPCs, it is essential
+that only the format of RPCs for the newest release of Slurm (which is still
+under development) altered to avoid breaking pre-existing communication
+protocols.
+It may be necessary to add a new protocol version number to the code and
+support for releases beyond two previous releases may be removed.
+In the new code, copy the pack and unpack logic from the previous version of
+the code and add new fields as needed.
+Be sure to pack and unpack data in the identical order.
+It is also important to keep in mind that when adding support for new fields
+in an RPC protocol, that logic may need to be added to the older protocols
+setting the new field values to a reasonable default value (e.g. NULL, 0).
+For example, if a job is submitted using an old version of sbatch to a newer
+slurmctld daemon, job specifications that are unknown to the old sbatch
+should be set by the slurmctld daemon to reasonable values.
+An example of the changes required are shown below.
+In this trivial example, we want to add a new "max_nodes" field to the
+message for Slurm version 15.08.x.</p>
+
+<pre>
+/*
+ * Original code in Slurm v2.5.x
+ */
+if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+	pack32(msg->user_id, buffer);
+	pack32(msg->min_nodes, buffer);
+} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+	pack32(msg->user_id, buffer);
+} else if (protocol_version >= SLURM_13_08_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+} else {
+	error("pack_whatever_msg: protocol_version "
+	      "%hu not supported", protocol_version);
+}
+</pre>
+<pre>
+/*
+ * New code in Slurm v15.08.x
+ */
+if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+	pack32(msg->user_id, buffer);
+	pack32(msg->min_nodes, buffer);
+	pack32(msg->max_nodes, buffer);
+} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+	pack32(msg->user_id, buffer);
+	pack32(msg->min_nodes, buffer);
+} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	pack32(msg->job_id, buffer);
+	pack32(msg->user_id, buffer);
+} else {
+	error("pack_whatever_msg: protocol_version "
+	      "%hu not supported", protocol_version);
+}
+</pre>
+
+<p style="text-align:center;">Last modified 05 May 2016</p>
+
+<!--#include virtual="footer.txt"-->
diff --git a/doc/html/select_design.shtml b/doc/html/select_design.shtml
index 76178da53..8325a4496 100644
--- a/doc/html/select_design.shtml
+++ b/doc/html/select_design.shtml
@@ -34,8 +34,9 @@ generic resource (GRES) allocations, making use of the GRES plugins.</p>
 GRES (configured and allocated, in a List data structure), plus a flag
 indicating if the node has been allocated using an exclusive option (preventing
 other jobs from being allocated resources on that same node). The other key
-data structure is used to enforce the per-partition <i>Shared</i> configuration
-parameter and tracks how many jobs have been allocated each resource in each
+data structure is used to enforce the per-partition <i>OverSubscribe</i>
+configuration parameter and tracks how many jobs have been allocated each
+compute resource (e.g. CPU) in each
 partition. This data structure is different between the plugins based upon
 the resolution of the resource allocation (e.g. nodes or CPUs).</p>
 
@@ -99,6 +100,6 @@ jobs.</p>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 31 May 2011</p>
+<p style="text-align:center;">Last modified 31 March 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/selectplugins.shtml b/doc/html/selectplugins.shtml
index 5449b19e8..ab5b697c5 100644
--- a/doc/html/selectplugins.shtml
+++ b/doc/html/selectplugins.shtml
@@ -654,11 +654,14 @@ bitmap of the nodes allocated to the job step, otherwise return NULL and the
 logic within the slurmctld daemon will select the nodes to be allocated to
 the job step.</p>
 
-<p class="commandline">int select_p_step_finish(struct step_record *step_ptr)</p>
-<p style="margin-left:.2in"><b>Description</b>: Note that a job step has completed execution</p>
+<p class="commandline">int select_p_step_finish(struct step_record *step_ptr, bool killing_step)</p>
+<p style="margin-left:.2in"><b>Description</b>: Note that a job step is completing execution</p>
 <p style="margin-left:.2in"><b>Arguments</b>:<br>
 <span class="commandline"> step_ptr</span>&nbsp; &nbsp;&nbsp;(input)
-Pointer to the step which has completed execution.</p>
+Pointer to the step which has completed execution.<br>
+<span class="commandline"> killing_step</span>&nbsp; &nbsp;&nbsp;(input)
+True if we are begining the termination of the step (for example, when SIGKILL is being sent);
+False if the termination of the step has completed (all processes have exited).</p>
 <p style="margin-left:.2in"><b>Returns</b>: SLURM_SUCCESS if successful. On failure,
 the plugin should return SLURM_ERROR.</p>
 
@@ -776,6 +779,6 @@ cnodelist (e.g. on a BGQ it would look something like '[00000x11331]').</br>
 
 <p class="footer"><a href="#top">top</a></p>
 
-<p style="text-align:center;">Last modified 27 March 2015</p>
+<p style="text-align:center;">Last modified 10 December 2015</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/sun_const.shtml b/doc/html/sun_const.shtml
deleted file mode 100644
index a1a780708..000000000
--- a/doc/html/sun_const.shtml
+++ /dev/null
@@ -1,160 +0,0 @@
-<!--#include virtual="header.txt"-->
-
-<h1>Sun Constellation Administrator Guide</h1>
-
-<h2>Overview</h2>
-
-<p>This document describes the unique features of Slurm on
-Sun Constellation computers.
-You should be familiar with the Slurm's mode of operation on Linux clusters
-before studying the relatively few differences in Sun Constellation system
-operation described in this document.</p>
-
-<p>Slurm's primary mode of operation is designed for use on clusters with
-nodes configured in a one-dimensional space.
-A topology plugin was developed to optimize resource allocations in
-three dimensions.
-Changes were also made for hostlist parsing to support hostnames
-of an appropriate format.</p>
-
-<h2>Configuration</h2>
-
-<p>Two variables must be defined in the <i>config.h</i> file:
-<i>HAVE_SUN_CONST</i> and <i>SYSTEM_DIMENSIONS=4</i>
-(more on that value later).
-This can be accomplished in several different ways depending upon how
-Slurm is being built.
-<ol>
-<li>Execute the <i>configure</i> command with the option
-<i>--enable-sun-const</i> <b>OR</b></li>
-<li>Execute the <i>rpmbuild</i> command with the option
-<i>--with sun_const</i> <b>OR</b></li>
-<li>Add <i>%with_sun_const 1</i> to your <i>~/.rpmmacros</i> file.</li>
-</ol></p>
-
-<p>Node names must have a four-digit suffix describing identifying their
-location (this is why SYSTEM_DIMENSIONS is configured to be 4).
-The first three digits specify the node's zero-origin position in the
-X-, Y- and Z-dimension respectively.
-This is followed by one digit specifying the node's sequence number
-at that coordinate (e.g. "tux0123" for X=0, Y=1, Z=2, sequence_number=3;
-"tux1234" for X=1, Y=2, Z=3, sequence_number=4).
-The coordinate location should be zero-origin (starting at X=0, Y=0, Z=0).
-The sequence number should also start at zero and can include upper
-case letters for higher values, for up to 36 nodes at a specific coordinate
-(e.g. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, ... Z).
-To avoid confusion, we recommend that the node name prefix consist of
-lower case letters.
-Numerically sequential node names may specified by in Slurm
-commands and configuration files using the system name prefix with the
-end-points enclosed in square brackets and separated by an "-".
-For example "tux[0000-000B]" is used to represent the twelve nodes
-with sequence numbers from 0 to B, all at coordinate X=0, Y=0 and Z=0.
-Alternately, rectangular prisms of node names can be specified using the
-system name prefix with the end-points enclosed in square brackets and
-separated by an "x".
-For example "tux[0000x0111]" is used to represent the eight nodes in a
-block with endpoints at "tux0000" and "tux0111" (tux0000, tux0001, tux0010,
-tux0011, tux0100, tux0101, tux0110 and tux0111).
-Viewed another way, these eight nodes have sequence numbers 0 or 1
-and have four distinct coordinates (000, 001, 010 and 011).
-While node names of this form are required for Slurm's internal use,
-it need not be the name returned by the <i>hostlist -s</i> command.
-See <i>man slurm.conf</i> for details on how to use the <i>NodeName</i>,
-<i>NodeAddr</i> and <i>NodeHostName</i> configuration parameters
-for flexibility in this matter.</p>
-
-<p>Next you need to select from two options for the resource selection
-plugin (the <i>SelectType</i> option in Slurm's <i>slurm.conf</i> configuration
-file):
-<ol>
-<li><b>select/cons_res</b> - Performs a best-fit algorithm based upon a
-one-dimensional space to allocate whole nodes, sockets, or cores to jobs
-based upon other configuration parameters.</li>
-<li><b>select/linear</b> - Performs a best-fit algorithm based upon a
-one-dimensional space to allocate whole nodes to jobs.</li>
-</ol>
-
-<p>In order for <i>select/cons_res</i> or <i>select/linear</i> to
-allocate resources physically nearby in four-dimensional space, the
-nodes be specified in Slurm's <i>slurm.conf</i> configuration file in
-such a fashion that those nearby in <i>slurm.conf</i> (managed
-internal to Slurm as a one-dimensional space) are also nearby in
-the physical four-dimensional space.</p>
-
-<p>Slurm can automatically perform that conversion using a
-<a href="http://en.wikipedia.org/wiki/Hilbert_curve">Hilbert curve</a>.
-Set <i>TopologyPlugin=topology/3d_torus</i> in Slurm's <i>slurm.conf</i>
-configuration file for nodes to be reordered appropriately.
-First a three-dimensional Hilbert curve is constructed through all
-coordinates in the system such that every coordinate in the order list
-physically adjacent.
-The node list are then re-ordered following that Hilbert curve while
-maintaining the node's sequence number (i.e. not building a Hilbert
-curve through that fourth dimension).
-If the number of nodes at each coordinate varies, it may be necessary to
-put a separate node definition line in the <i>slurm.conf</i> file.
-If that is the case, put them in numeric order for the <i>topology/3d_torus</i>
-plugin to function properly.<p>
-
-<p>Alternately configure <i>TopologyPlugin=topology/none</i> and
-construct your own node ordering sequence as desired in <i>slurm.conf</i>.
-Note that each node must be listed exactly once and consecutive
-nodes should be nearby in three-dimensional space.
-The open source code used by Slurm to generate the Hilbert curve is
-included in the distribution at <i>contribs/skilling.c</i> in the event
-that you wish to experiment with it to generate your own node ordering.
-Two examples of Slurm configuration files are shown below:</p>
-
-<pre>
-# slurm.conf for Sun Constellation system of size 4x4x4
-# with eight nodes at each coordinate (512 nodes total)
-
-# Configuration parameters removed here
-
-# Automatic orders nodes following a Hilbert curve
-NodeName=DEFAULT CPUs=8 RealMemory=2048 State=Unknown
-NodeName=tux[0000x3337]
-PartitionName=debug Nodes=tux[0000x3337] Default=Yes State=UP
-</pre>
-
-<pre>
-# slurm.conf for Sun Constellation system of size 1x2x2
-# with a different count of nodes at each coordinate
-
-# Configuration parameters removed here
-
-# Manual ordering of nodes following a space-filling curve
-NodeName=DEFAULT CPUs=8 RealMemory=2048 State=Unknown
-NodeName=tux[0000-0007]  #  8 nodes at 0,0,0
-NodeName=tux[0010-001B]  # 12 nodes at 0,0,1
-NodeName=tux[0100-0107]  #  8 nodes at 0,1,0
-NodeName=tux[0110-0115]  #  6 nodes at 0,1,1
-PartitionName=DEFAULT Default=Yes State=UP
-PartitionName=debug Nodes=tux[0000-0007,0010-001B,0100-0107,0110-0115]
-</pre>
-
-<h2>Tools</h2>
-
-<p>The node names output by the <i>scontrol show nodes</i> command
-will be ordered as defined (sequentially along the Hilbert curve)
-rather than in numeric order (e.g. "tux0010" may follow "tux1010" rather
-than "tux0000").
-The output of the <i>smap</i> and <i>sview</i> commands will also display
-nodes ordered by the Hilbert curve so that nodes appearing adjacent in the
-display will be physically adjacent.
-This permits the locality of a job, partition or reservation to be easily
-determined.
-In order to locate specific nodes with the <i>sview</i> command, select
-<i>Actions</i>, <i>Search</i> and <i>Node(s) Name</i> then enter the desired
-node names.
-The output of other Slurm commands (e.g. <i>sinfo</i> and <i>squeue</i>)
-will use a Slurm hostlist expression with the node names numerically ordered).
-Slurm partitions should contain nodes which are defined sequentially
-by that ordering for optimal performance.</p>
-
-<p class="footer"><a href="#top">top</a></p>
-
-<p style="text-align:center;">Last modified 4 August 2009</p></td>
-
-<!--#include virtual="footer.txt"-->
diff --git a/doc/html/switchplugins.shtml b/doc/html/switchplugins.shtml
index a288403dd..cba1e02d6 100644
--- a/doc/html/switchplugins.shtml
+++ b/doc/html/switchplugins.shtml
@@ -333,7 +333,7 @@ to indicate the reason for failure.</p>
 <p style="margin-left:.2in"><b>Description</b>: Indicate if the switch plugin should
 process partial job step completions (i.e. switch_g_job_step_part_comp). Support
 of partition completions is compute intensive, so it should be avoided unless switch
-resources are in short supply (e.g. switch/federation).</p>
+resources are in short supply (e.g. former switch/nrt).</p>
 <p style="margin-left:.2in"><b>Returns</b>: True if partition step completions are
 to be recorded. False if only full job step completions are to be noted.</p>
 
diff --git a/doc/html/team.shtml b/doc/html/team.shtml
index c160d7ea5..335226d33 100644
--- a/doc/html/team.shtml
+++ b/doc/html/team.shtml
@@ -109,6 +109,7 @@ Lead Slurm developers are:
 <li>Michael Gutteridge (Fred Hutchinson Cancer Research Center)</li>
 <br>
 <li>Anders Halager (Aarhus University, Denmark)</li>
+<li>Thomas Hamel (EDF, France)</li>
 <li>Chris Harwell (D. E. Shaw Research)</li>
 <li>Takao Hatazaki (HP)</li>
 <li>Matthieu Hautreux (CEA, France)</li>
@@ -155,6 +156,7 @@ Lead Slurm developers are:
 <br>
 <li>Komoto Masahiro</li>
 <li>L. Shawn Matott (University at Buffalo)</li>
+<li>Dennis McRitchie (Princeton University)</li>
 <li>Steven McDougall (SiCortex)</li>
 <li>Donna Mecozzi (Lawrence Livermore National Laboratory)</li>
 <li>Sergey Meirovich</li>
@@ -185,7 +187,7 @@ Lead Slurm developers are:
 <li>Ashley Pittman (Quadrics, UK)</li>
 <li>Maksym Planeta</li>
 <li>Josko Plazonic (Princecton University)</li>
-<li>Artem Polyakov (ISP SB RAS, Russia)</li>
+<li>Artem Y. Polyakov (Mellanox Technologies, ISP SB RAS, Russia)</li>
 <li>Ludovic Prevost (NEC, France)</li>
 <br>
 <li>Vijay Ramasubramanian (University of Maryland)</li>
@@ -199,6 +201,7 @@ Lead Slurm developers are:
 <li>Manuel Rodríguez-Pascual (CIEMAT, Spain)</li>
 <li>Andy Roosen (University of Deleware)</li>
 <li>Miguel Ros (Barcelona Supercomputing Center, Spain)</li>
+<li>Aline Roy (CEA, France)</li>
 <li>Beat Rubischon (DALCO AG, Switzerland)</li>
 <li>Simon Ruderich</li>
 <li>Dan Rusak (Bull)</li>
@@ -226,6 +229,7 @@ Lead Slurm developers are:
 <li>Kevin Tew (Lawrence Livermore National Laboratory/Brigham Young University)</li>
 <li>John Thiltges (University of Nebraska-Lincoln)</li>
 <li>Adam Todorski (Rensselaer Polytechnic Institute)</li>
+<li>Giovanni Torres (National Institutes of Health)</li>
 <li>Stephen Trofinoff (Swiss National Supercomputing Centre)</li>
 <br>
 <li>Garrison Vaughan</li>
@@ -247,6 +251,6 @@ Lead Slurm developers are:
 <!-- INDIVIDUALS, PLEASE KEEP IN ALPHABETICAL ORDER -->
 </ul>
 
-<p style="text-align:center;">Last modified 26 October 2015</p>
+<p style="text-align:center;">Last modified 13 May 2016</p>
 
 <!--#include virtual="footer.txt"-->
diff --git a/doc/html/topology.shtml b/doc/html/topology.shtml
index 9cbfbe934..7dd586149 100644
--- a/doc/html/topology.shtml
+++ b/doc/html/topology.shtml
@@ -26,7 +26,7 @@ Slurm has a plugin specifically written for BlueGene to select appropriate
 nodes for jobs, change network switch routing, boot nodes, etc as described
 in the <a href="bluegene.html">BlueGene User and Administrator Guide</a>.</p>
 
-<p>The Sun Constellation and Cray systems also have three-dimensional
+<p>The Cray systems also have three-dimensional
 torus interconnects, but do not require that jobs execute in adjacent nodes.
 On those systems, Slurm only needs to allocate resources to a job which
 are nearby on the network.
@@ -37,7 +37,6 @@ space.
 Slurm's native best-fit algorithm is thus able to achieve a high degree
 of locality for jobs.
 For more information, see Slurm's documentation for
-<a href="sun_const.html">Sun Constellation</a> and
 <a href="cray_alps.html">Cray XT and XE</a> systems.</p>
 
 <h2>Hierarchical Networks</h2>
diff --git a/doc/man/Makefile.in b/doc/man/Makefile.in
index 7f37eaab0..d12436577 100644
--- a/doc/man/Makefile.in
+++ b/doc/man/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = doc/man
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/doc/man/man1/Makefile.in b/doc/man/man1/Makefile.in
index 5a1134857..995217bec 100644
--- a/doc/man/man1/Makefile.in
+++ b/doc/man/man1/Makefile.in
@@ -92,7 +92,8 @@ target_triplet = @target@
 @HAVE_MAN2HTML_TRUE@am__append_1 = $(html_DATA)
 subdir = doc/man/man1
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -200,8 +201,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -301,6 +300,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -339,6 +342,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -382,6 +388,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -432,6 +441,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/doc/man/man1/sacct.1 b/doc/man/man1/sacct.1
index 1886146ec..8fbaaf8ff 100644
--- a/doc/man/man1/sacct.1
+++ b/doc/man/man1/sacct.1
@@ -333,6 +333,9 @@ Job has been allocated resources, but are waiting for them to become ready for u
 \f3CG  COMPLETING\fP
 Job is in the process of completing. Some processes on some nodes may still be active.
 .TP
+\f3DL  DEADLINE\fP
+Job missed its deadline.
+.TP
 \f3F   FAILED\fP
 Job terminated with non\-zero exit code or other failure condition.
 .TP
@@ -397,6 +400,11 @@ would be truncated to \-\-starttime.  The same for end time and \-\-endtime.
 Use this comma separated list of uids or user names to select jobs to
 display.  By default, the running user's uid is used.
 
+.TP
+\f3\-\-units=[KMGTP]\fP
+Display values in specified unit type. Takes precedence over \-\-noconvert
+option.
+
 .TP
 \f3\-\-usage\fP
 Display a command usage summary.
@@ -773,7 +781,7 @@ Initiation time of the job in the same format as \f3End\fP.
 Displays the job status, or state.
 
 Output can be RUNNING, RESIZING, SUSPENDED, COMPLETED, CANCELLED, FAILED,
-TIMEOUT, PREEMPTED, BOOT_FAIL or NODE_FAIL.
+TIMEOUT, PREEMPTED, BOOT_FAIL, DEADLINE or NODE_FAIL.
 If more information is available on the job state
 than will fit into the current field width (for example, the uid that CANCELLED
 a job) the state will be followed by a "+".  You can increase the size of
diff --git a/doc/man/man1/sacctmgr.1 b/doc/man/man1/sacctmgr.1
index a1d2e0adf..7a744304e 100644
--- a/doc/man/man1/sacctmgr.1
+++ b/doc/man/man1/sacctmgr.1
@@ -207,6 +207,10 @@ account and user associations inside their realm.
 \fIevent\fR
 Events like downed or draining nodes on clusters.
 
+.TP
+\fILostJobs\fR
+Jobs that have been orphanded on the local cluster.
+
 .TP
 \fIjob\fR
 Job - but only two specific fields of the job: Derived Exit Code and
@@ -674,8 +678,7 @@ Type of machine, current classifications are capability and capacity.
 .TP
 \fIFlags\fP=<flag list>
 Comma separated list of Attributes for a particular cluster.  Current
-Flags include AIX, BGL, BGP, BGQ, Bluegene, CrayXT, FrontEnd, MultipleSlurmd,
-and SunConstellation
+Flags include AIX, BGL, BGP, BGQ, Bluegene, CrayXT, FrontEnd, and MultipleSlurmd
 
 .TP
 \fIName\fP=<name>
@@ -934,9 +937,12 @@ Valid options are
 .RS
 .TP
 \fIDenyOnLimit\fP
-If set jobs using this QOS will be rejected at
-submission time if they do not conform to the QOS 'Max' limits.  By default
-jobs that go over these limits will pend until they conform.
+If set, jobs using this QOS will be rejected at
+submission time if they do not conform to the QOS 'Max' limits.  Group
+limits will also be treated like 'Max' limits as well and will be
+denied if they go over. By default jobs that go over these limits
+will pend until they conform.  This currently only applies to QOS and
+Association limits.
 .TP
 \fIEnforceUsageThreshold\fP
 If set, and the QOS also has a UsageThreshold,
@@ -1018,6 +1024,10 @@ The id of the QOS.
 \fIMaxTRESMins\fP
 Maximum number of TRES minutes each job is able to use.
 
+.TP
+\fIMaxTRESPerAccount\fP
+Maximum number of TRES each account is able to use.
+
 .TP
 \fIMaxTRESPerJob\fP
 Maximum number of TRES each job is able to use.
@@ -1031,7 +1041,11 @@ Maximum number of TRES each node in a job allocation can use.
 Maximum number of TRES each user is able to use.
 
 .TP
-\fIMaxJobs\fP
+\fIMaxJobsPerAccount\fP
+Maximum number of jobs each account is allowed to run at one time.
+
+.TP
+\fIMaxJobsPerUser\fP
 Maximum number of jobs each user is allowed to run at one time.
 
 .TP
@@ -1040,7 +1054,11 @@ Minimum number of TRES each job running under this QOS must request.
 Otherwise the job will pend until modified.
 
 .TP
-\fIMaxSubmitJobs\fP
+\fIMaxSubmitJobsPerAccount\fP
+Maximum number of jobs pending or running state at any time per account.
+
+.TP
+\fIMaxSubmitJobsPerUser\fP
 Maximum number of jobs pending or running state at any time per user.
 
 .TP
@@ -1155,6 +1173,11 @@ Maximum number of TRES minutes each job is able to use.
 To clear a previously set value use the modify command with a new
 value of \-1.
 
+.TP
+\fIMaxTRESPerAccount\fP
+Maximum number of TRES each account is able to use.
+To clear a previously set value use the modify command with a new value of \-1.
+
 .TP
 \fIMaxTRESPerJob\fP
 Maximum number of TRES each job is able to use.
@@ -1172,12 +1195,22 @@ Maximum number of TRES each user is able to use.
 To clear a previously set value use the modify command with a new value of \-1.
 
 .TP
-\fIMaxJobs\fP
+\fIMaxJobsPerAccount\fP
+Maximum number of jobs each account is allowed to run at one time.
+To clear a previously set value use the modify command with a new value of \-1.
+
+.TP
+\fIMaxJobsPerUser\fP
 Maximum number of jobs each user is allowed to run at one time.
 To clear a previously set value use the modify command with a new value of \-1.
 
 .TP
-\fIMaxSubmitJobs\fP
+\fIMaxSubmitJobsPerAccount\fP
+Maximum number of jobs pending or running state at any time per account.
+To clear a previously set value use the modify command with a new value of \-1.
+
+.TP
+\fIMaxSubmitJobsPerUser\fP
 Maximum number of jobs pending or running state at any time per user.
 To clear a previously set value use the modify command with a new value of \-1.
 
diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1
index 0d0771609..548e63d8d 100644
--- a/doc/man/man1/salloc.1
+++ b/doc/man/man1/salloc.1
@@ -1,4 +1,4 @@
-.TH salloc "1" "Slurm Commands" "April 2015" "Slurm Commands"
+.TH salloc "1" "Slurm Commands" "March 2016" "Slurm Commands"
 
 .SH "NAME"
 salloc \- Obtain a Slurm job allocation (a set of nodes), execute a command,
@@ -189,7 +189,7 @@ using the constraint option.
 Only nodes having features matching the job constraints will be used to
 satisfy the request.
 Multiple constraints may be specified with AND, OR, matching OR,
-resource counts, etc.
+resource counts, etc. (some operators are not supported on all system types).
 Supported \fbconstraint\fR options include:
 .PD 1
 .RS
@@ -335,8 +335,7 @@ TaskPlugin=task/cgroup with the "ConstrainCores" option) is not
 configured, this parameter is ignored.
 
 \fBNOTE\fR: When the step completes, the frequency and governor of each
-selected CPU is reset to the configured \fBCpuFreqDef\fR value with a
-default value of the OnDemand CPU governor.
+selected CPU is reset to the previous values.
 
 \fBNOTE\fR: When submitting jobs with  the \fB\-\-cpu\-freq\fR option
 with linuxproc as the ProctrackType can cause jobs to run too quickly before
@@ -358,6 +357,20 @@ the \-\-cpus\-per\-task=3 options, the controller knows that each task requires
 3 processors on the same node, and the controller will grant an allocation
 of 4 nodes, one for each of the 4 tasks.
 
+.TP
+\fB\-\-deadline\fR=<\fIOPT\fR>
+remove the job if no ending is possible before
+this deadline (start > (deadline \- time[\-min])).
+Default is no deadline.  Valid time formats are:
+.br
+HH:MM[:SS] [AM|PM]
+.br
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+.br
+MM/DD[/YY]\-HH:MM[:SS]
+.br
+YYYY\-MM\-DD[THH:MM[:SS]]]
+
 .TP
 \fB\-d\fR, \fB\-\-dependency\fR=<\fIdependency_list\fR>
 Defer the start of this job until the specified dependencies have been
@@ -383,6 +396,11 @@ execution.
 \fBafterany:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated.
 .TP
+\fBaftercorr:job_id[:jobid...]\fR
+A task of this job array can begin execution after the corresponding task ID
+in the specified job has completed successfully (ran to completion with an
+exit code of zero).
+.TP
 \fBafternotok:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated
 in some failed state (non-zero exit code, node failure, timed out, etc).
@@ -408,11 +426,11 @@ can be specified as full path or relative path to the directory where
 the command is executed.
 
 .TP
-\fB\-\-exclusive[=user]\fR
+\fB\-\-exclusive[=user|mcs]\fR
 The job allocation can not share nodes with other running jobs (or just other
-users with the "=user" option).
+users with the "=user" option or with the "=mcs" option).
 The default shared/exclusive behavior depends on system configuration and the
-partition's \fBShared\fR option takes precedence over the job's option.
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 
 .TP
 \fB\-F\fR, \fB\-\-nodefile\fR=<\fInode file\fR>
@@ -465,6 +483,18 @@ command will exit if the option argument is "help".
 Examples of use include "\-\-gres=gpu:2,mic=1", "\-\-gres=gpu:kepler:2", and
 "\-\-gres=help".
 
+.TP
+\fB\-\-gres\-flags\fR=enforce\-binding
+If set, the only CPUs available to the job will be those bound to the selected
+GRES (i.e. the CPUs identifed in the gres.conf file will be strictly enforced
+rather than advisory). This option may result in delayed initiation of a job.
+For example a job requiring two GPUs and one CPU will be delayed until both
+GPUs on a single socket are available rather than using GPUs bound to separate
+sockets, however the application performance may be improved due to improved
+communication speed.
+Requires the node to be configured with more than one socket and resource
+filtering will be performed on a per\-socket basis.
+
 .TP
 \fB\-H, \-\-hold\fR
 Specify the job is to be submitted in a held state (priority of zero).
@@ -671,6 +701,12 @@ User to receive email notification of state changes as defined by
 \fB\-\-mail\-type\fR.
 The default value is the submitting user.
 
+.TP
+\fB\-\-mcs\-label\fR=<\fImcs\fR>
+Used only when the mcs/group plugin is enabled.
+This parameter is a group among the groups of the user.
+Default value is calculated by the Plugin mcs if it's enabled.
+
 .TP
 \fB\-\-mem\fR=<\fIMB\fR>
 Specify the real memory required per node in MegaBytes.
@@ -1117,15 +1153,19 @@ silently ignored.
 \fB\-\-reservation\fR=<\fIname\fR>
 Allocate resources for the job from the named reservation.
 
+\fB\-\-share\fR
+The \fB\-\-share\fR option has been replaced by the \fB\-\-oversubscribe\fR
+option described below.
+
 .TP
-\fB\-s\fR, \fB\-\-share\fR
-The job allocation can share resources with other running jobs.
-The resources to be shared can be nodes, sockets, cores, or hyperthreads
-depending upon configuration.
-The default shared behavior depends on system configuration and the partition's
-\fBShared\fR option takes precedence over the job's option.
+\fB\-s\fR, \fB\-\-oversubscribe\fR
+The job allocation can over\-subscribe resources with other running jobs.
+The resources to be over\-subscribed can be nodes, sockets, cores, and/or
+hyperthreads depending upon configuration.
+The default over\-subscribe behavior depends on system configuration and the
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 This option may result in the allocation being granted sooner than if the
-\-\-share option was not set and allow higher system utilization, but
+\-\-oversubscribe option was not set and allow higher system utilization, but
 application performance will likely suffer due to competition for resources.
 Also see the \-\-exclusive option.
 
@@ -1140,11 +1180,6 @@ AllowSpecResourcesUsage is enabled, the job will be allowed to override
 CoreSpecCount and use the specialized resources on nodes it is allocated.
 This option can not be used with the \fB\-\-thread\-spec\fR option.
 
-.TP
-\fB\-\-sicp\fR
-Identify a job as one which jobs submitted to other clusters can be dependent
-upon.
-
 .TP
 \fB\-\-signal\fR=<\fIsig_num\fR>[@<\fIsig_time\fR>]
 When a job is within \fIsig_time\fR seconds of its end time,
@@ -1389,6 +1424,9 @@ Same as \fB\-\-exclusive\fR
 \fBSALLOC_GEOMETRY\fR
 Same as \fB\-g, \-\-geometry\fR
 .TP
+\fBSALLOC_GRES_FLAGS\fR
+Same as \-\-gres\-flags\fR
+.TP
 \fBSALLOC_HINT\fR or \fBSLURM_HINT\fR
 Same as \fB\-\-hint\fR
 .TP
@@ -1436,9 +1474,6 @@ for that number of switches. See \fB\-\-switches\fR.
 \fBSALLOC_RESERVATION\fR
 Same as \fB\-\-reservation\fR
 .TP
-\fBSALLOC_SICP\fR
-Same as \fB\-\-sicp\fR
-.TP
 \fBSALLOC_SIGNAL\fR
 Same as \fB\-\-signal\fR
 .TP
diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1
index a6c2e19d8..29591e32e 100644
--- a/doc/man/man1/sbatch.1
+++ b/doc/man/man1/sbatch.1
@@ -1,4 +1,4 @@
-.TH sbatch "1" "Slurm Commands" "April 2015" "Slurm Commands"
+.TH sbatch "1" "Slurm Commands" "March 2016" "Slurm Commands"
 
 .SH "NAME"
 sbatch \- Submit a batch script to Slurm.
@@ -216,7 +216,7 @@ using the constraint option.
 Only nodes having features matching the job constraints will be used to
 satisfy the request.
 Multiple constraints may be specified with AND, OR, matching OR,
-resource counts, etc.
+resource counts, etc. (some operators are not supported on all system types).
 Supported \fbconstraint\fR options include:
 .PD 1
 .RS
@@ -362,8 +362,7 @@ TaskPlugin=task/cgroup with the "ConstrainCores" option) is not
 configured, this parameter is ignored.
 
 \fBNOTE\fR: When the step completes, the frequency and governor of each
-selected CPU is reset to the configured \fBCpuFreqDef\fR value with a
-default value of the OnDemand CPU governor.
+selected CPU is reset to the previous values.
 
 \fBNOTE\fR: When submitting jobs with  the \fB\-\-cpu\-freq\fR option
 with linuxproc as the ProctrackType can cause jobs to run too quickly before
@@ -385,6 +384,20 @@ the \-\-cpus\-per\-task=3 options, the controller knows that each task requires
 3 processors on the same node, and the controller will grant an allocation
 of 4 nodes, one for each of the 4 tasks.
 
+.TP
+\fB\-\-deadline\fR=<\fIOPT\fR>
+remove the job if no ending is possible before
+this deadline (start > (deadline \- time[\-min])).
+Default is no deadline.  Valid time formats are:
+.br
+HH:MM[:SS] [AM|PM]
+.br
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+.br
+MM/DD[/YY]\-HH:MM[:SS]
+.br
+YYYY\-MM\-DD[THH:MM[:SS]]]
+
 .TP
 \fB\-d\fR, \fB\-\-dependency\fR=<\fIdependency_list\fR>
 Defer the start of this job until the specified dependencies have been
@@ -410,6 +423,11 @@ execution.
 \fBafterany:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated.
 .TP
+\fBaftercorr:job_id[:jobid...]\fR
+A task of this job array can begin execution after the corresponding task ID
+in the specified job has completed successfully (ran to completion with an
+exit code of zero).
+.TP
 \fBafternotok:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated
 in some failed state (non-zero exit code, node failure, timed out, etc).
@@ -446,11 +464,11 @@ replaced by the job ID.
 See the \fB\-\-input\fR option for filename specification options.
 
 .TP
-\fB\-\-exclusive[=user]\fR
+\fB\-\-exclusive[=user|mcs]\fR
 The job allocation can not share nodes with other running jobs (or just other
-users with the "=user" option).
+users with the "=user" option or with the "=mcs" option).
 The default shared/exclusive behavior depends on system configuration and the
-partition's \fBShared\fR option takes precedence over the job's option.
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 
 .TP
 \fB\-\-export\fR=<\fIenvironment variables | ALL | NONE\fR>
@@ -527,6 +545,18 @@ command will exit if the option argument is "help".
 Examples of use include "\-\-gres=gpu:2,mic=1", "\-\-gres=gpu:kepler:2", and
 "\-\-gres=help".
 
+.TP
+\fB\-\-gres\-flags\fR=enforce\-binding
+If set, the only CPUs available to the job will be those bound to the selected
+GRES (i.e. the CPUs identifed in the gres.conf file will be strictly enforced
+rather than advisory). This option may result in delayed initiation of a job.
+For example a job requiring two GPUs and one CPU will be delayed until both
+GPUs on a single socket are available rather than using GPUs bound to separate
+sockets, however the application performance may be improved due to improved
+communication speed.
+Requires the node to be configured with more than one socket and resource
+filtering will be performed on a per\-socket basis.
+
 .TP
 \fB\-H, \-\-hold\fR
 Specify the job is to be submitted in a held state (priority of zero).
@@ -588,6 +618,12 @@ Supported replacement symbols are:
 .PD
 .RS
 .TP
+\fB\\\\\fR
+Do not process any of the replacement symbols.
+.TP
+\fB%%\fR
+The character "%".
+.TP
 \fB%A\fR
 Job array's master job allocation number.
 .TP
@@ -760,13 +796,14 @@ fashion across sockets.
 Notify user by email when certain event types occur.
 Valid \fItype\fR values are NONE, BEGIN, END, FAIL, REQUEUE, ALL (equivalent to
 BEGIN, END, FAIL, REQUEUE, and STAGE_OUT), STAGE_OUT (burst buffer stage out
-and teardown completed), TIME_LIMIT, TIME_LIMIT_90 (reached 90 percent of time limit),
-TIME_LIMIT_80 (reached 80 percent of time limit), and TIME_LIMIT_50
-(reached 50 percent of time limit).
-Multiple \fItype\fR values may be specified in a comma separated list.
+and teardown completed), TIME_LIMIT, TIME_LIMIT_90 (reached 90 percent of time
+limit), TIME_LIMIT_80 (reached 80 percent of time limit), TIME_LIMIT_50
+(reached 50 percent of time limit) and ARRAY_TASKS (send emails for each array
+task). Multiple \fItype\fR values may be specified in a comma separated list.
 The user to be notified is indicated with \fB\-\-mail\-user\fR.
-Mail notifications on job BEGIN, END and FAIL apply to a job array as a whole
-rather than generating individual email messages for each task in the job array.
+Unless the ARRAY_TASKS option is specified, mail notifications on job BEGIN, END
+and FAIL apply to a job array as a whole rather than generating individual email
+messages for each task in the job array.
 
 .TP
 \fB\-\-mail\-user\fR=<\fIuser\fR>
@@ -774,6 +811,12 @@ User to receive email notification of state changes as defined by
 \fB\-\-mail\-type\fR.
 The default value is the submitting user.
 
+.TP
+\fB\-\-mcs\-label\fR=<\fImcs\fR>
+Used only when the mcs/group plugin is enabled.
+This parameter is a group among the groups of the user.
+Default value is calculated by the Plugin mcs if it's enabled.
+
 .TP
 \fB\-\-mem\fR=<\fIMB\fR>
 Specify the real memory required per node in MegaBytes.
@@ -1291,15 +1334,19 @@ behavior on the cluster.
 \fB\-\-reservation\fR=<\fIname\fR>
 Allocate resources for the job from the named reservation.
 
+\fB\-\-share\fR
+The \fB\-\-share\fR option has been replaced by the \fB\-\-oversubscribe\fR
+option described below.
+
 .TP
-\fB\-s\fR, \fB\-\-share\fR
-The job allocation can share resources with other running jobs.
-The resources to be shared can be nodes, sockets, cores, or hyperthreads
-depending upon configuration.
-The default shared behavior depends on system configuration and the partition's
-\fBShared\fR option takes precedence over the job's option.
+\fB\-s\fR, \fB\-\-oversubscribe\fR
+The job allocation can over\-subscribe resources with other running jobs.
+The resources to be over\-subscribed can be nodes, sockets, cores, and/or
+hyperthreads depending upon configuration.
+The default over\-subscribe behavior depends on system configuration and the
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 This option may result in the allocation being granted sooner than if the
-\-\-share option was not set and allow higher system utilization, but
+\-\-oversubscribe option was not set and allow higher system utilization, but
 application performance will likely suffer due to competition for resources.
 Also see the \-\-exclusive option.
 
@@ -1314,11 +1361,6 @@ AllowSpecResourcesUsage is enabled, the job will be allowed to override
 CoreSpecCount and use the specialized resources on nodes it is allocated.
 This option can not be used with the \fB\-\-thread\-spec\fR option.
 
-.TP
-\fB\-\-sicp\fR
-Identify a job as one which jobs submitted to other clusters can be dependent
-upon.
-
 .TP
 \fB\-\-signal\fR=[B:]<\fIsig_num\fR>[@<\fIsig_time\fR>]
 When a job is within \fIsig_time\fR seconds of its end time,
@@ -1454,6 +1496,15 @@ Duplicate node names in the list will be ignored.
 The order of the node names in the list is not important; the node names
 will be sorted by Slurm.
 
+.TP
+\fB\-W\fR, \fB\-\-wait\fR
+Do not exit until the submitted job terminates.
+The exit code of the sbatch command will be the same as the exit code
+of the submitted job. If the job terminated due to a signal rather than a
+normal exit, the exit code will be set to 1.
+In the case of a job array, the exit code recorded will be the highest value
+for any task in the job array.
+
 .TP
 \fB\-\-wait\-all\-nodes\fR=<\fIvalue\fR>
 Controls when the execution of the command begins.
@@ -1608,6 +1659,9 @@ Same as \fB\-g, \-\-geometry\fR
 \fBSBATCH_GET_USER_ENV\fR
 Same as \fB\-\-get\-user\-env\fR
 .TP
+\fBSBATCH_GRES_FLAGS\fR
+Same as \-\-gres\-flags\fR
+.TP
 \fBSBATCH_HINT\fR or \fBSLURM_HINT\fR
 Same as \fB\-\-hint\fR
 .TP
@@ -1676,9 +1730,6 @@ for that number of switches. See \fB\-\-switches\fR
 \fBSBATCH_REQUEUE\fR
 Same as \fB\-\-requeue\fR
 .TP
-\fBSBATCH_SICP\fR
-Same as \fB\-\-sicp\fR
-.TP
 \fBSBATCH_SIGNAL\fR
 Same as \fB\-\-signal\fR
 .TP
@@ -1688,6 +1739,9 @@ Same as \fB\-\-thread\-spec\fR
 \fBSBATCH_TIMELIMIT\fR
 Same as \fB\-t, \-\-time\fR
 .TP
+\fBSBATCH_WAIT\fR
+Same as \fB\-W\fR, \fB\-\-wait\fR
+.TP
 \fBSBATCH_WAIT_ALL_NODES\fR
 Same as \fB\-\-wait\-all\-nodes\fR
 .TP
@@ -1833,9 +1887,6 @@ SLURM_NODE_ALIASES=ec0:1.2.3.4:foo,ec1:1.2.3.5:bar
 \fBSLURM_NODEID\fR
 ID of the nodes allocated.
 .TP
-\fBSLURMD_NODENAME\fR
-Names of all the allocated nodes.
-.TP
 \fBSLURM_NTASKS\fR (and \fBSLURM_NPROCS\fR for backwards compatibility)
 Same as \fB\-n, \-\-ntasks\fR
 .TP
@@ -1897,6 +1948,12 @@ configured. The value will be set  component  types  listed   in
 SLURM_TOPOLOGY_ADDR.   Each  component will be identified as
 either "switch" or "node".  A period is  used  to separate each
 hardware component type.
+.TP
+\fBSLURM_UMASK\fR
+The \fIumask\fR in effect when the job was submitted.
+.TP
+\fBSLURMD_NODENAME\fR
+Name of the node running the job script.
 
 .SH "EXAMPLES"
 .LP
diff --git a/doc/man/man1/sbcast.1 b/doc/man/man1/sbcast.1
index b329760ef..d211d3b68 100644
--- a/doc/man/man1/sbcast.1
+++ b/doc/man/man1/sbcast.1
@@ -1,4 +1,4 @@
-.TH sbcast "1" "Slurm Commands" "April 2015" "Slurm Commands"
+.TH sbcast "1" "Slurm Commands" "March 2016" "Slurm Commands"
 
 .SH "NAME"
 sbcast \- transmit a file to the nodes allocated to a Slurm job.
@@ -22,8 +22,11 @@ by file size, degree of parallelism, and network type.
 
 .SH "OPTIONS"
 .TP
-\fB\-C\fR, \fB\-\-compress\fR
+\fB\-C\fR [\fIlibrary\fR], \fB\-\-compress\fR[=\fIlibrary\fR]
 Compress the file being transmitted.
+The optional argument specifies the data compression library to be used.
+Supported values are "lz4" (default) and "zlib".
+Some compression libraries may be unavailable on some systems.
 .TP
 \fB\-f\fR, \fB\-\-force\fR
 If the destination file already exists, replace it.
@@ -45,8 +48,9 @@ Specify the block size used for file broadcast.
 The size can have a suffix of \fIk\fR or \fIm\fR for kilobytes
 or megabytes respectively (defaults to bytes).
 This size subject to rounding and range limits to maintain
-good performance. This value may need to be set on systems
-with very limited memory.
+good performance.
+The default value is the file size or 8MB, whichever is smaller.
+This value may need to be set on systems with very limited memory.
 .TP
 \fB\-t\fB \fIseconds\fR, fB\-\-timeout\fR=\fIseconds\fR
 Specify the message timeout in seconds.
diff --git a/doc/man/man1/scontrol.1 b/doc/man/man1/scontrol.1
index 83efe231d..f1d45df01 100644
--- a/doc/man/man1/scontrol.1
+++ b/doc/man/man1/scontrol.1
@@ -1,4 +1,4 @@
-.TH scontrol "1" "Slurm Commands" "September 2015" "Slurm Commands"
+.TH scontrol "1" "Slurm Commands" "January 2016" "Slurm Commands"
 
 .SH "NAME"
 scontrol \- Used view and modify Slurm configuration and state.
@@ -314,7 +314,7 @@ Resuming a previously suspended job may result in multiple jobs being
 allocated the same CPUs, which could trigger gang scheduling with some
 configurations or severe degradation in performance with other configurations.
 Use of the scancel command to send SIGSTOP and SIGCONT signals would stop a
-job without releasing its CPUs for allocaiton to other jobs and would be a
+job without releasing its CPUs for allocation to other jobs and would be a
 preferable mechanism in many cases.
 Use with caution.
 
@@ -437,6 +437,17 @@ This can be used to minimize disruption if the computer executing the
 primary Slurm controller is scheduled down.
 (Note: Slurm's primary controller will take the control back at startup.)
 
+.TP
+\fBtop\fP \fIjob_id\fP
+Move the specified job ID to the top of the queue of jobs belonging to the
+identical user ID, partition name, account, and QOS.
+Any job not matching \fBall\fP of those fields will not be effected.
+Only jobs submitted to a single partition will be effected.
+This operation changes the order of jobs by adjusting job nice values.
+The net effect on that user's throughput will be negligible to slightly negative.
+This operation may be disabled by the system administrator by including the
+option "disable_user_top" in the SchedulerParameters configuration parameter.
+
 .TP
 \fBuhold\fP \fIjob_list\fP
 Prevent a pending job from being started (sets it's priority to 0).
@@ -516,6 +527,23 @@ Set the job's requirement for contiguous (consecutive) nodes to be allocated.
 Possible values are "YES" and "NO".
 Only the Slurm administrator or root can change this parameter.
 .TP
+\fIDeadline\fP=<time_spec>
+It accepts times of the form \fIHH:MM:SS\fR to specify a deadline to a job at
+a specific time of day (seconds are optional).
+You may also specify \fImidnight\fR, \fInoon\fR, \fIfika\fR (3 PM) or
+\fIteatime\fR (4 PM) and you can have a time\-of\-day suffixed
+with \fIAM\fR or \fIPM\fR for a deadline in the morning or the evening.
+You can specify a deadline for the job with
+a date of the form \fIMMDDYY\fR or \fIMM/DD/YY\fR or \fIMM.DD.YY\fR,
+or a date and time as \fIYYYY\-MM\-DD[THH:MM[:SS]]\fR.  You can also
+give times like \fInow + count time\-units\fR, where the time\-units
+can be \fIminutes\fR, \fIhours\fR, \fIdays\fR, or \fIweeks\fR
+and you can tell Slurm to put a deadline for tomorrow with the keyword
+\fItomorrow\fR.
+The specified deadline must be later than the current time.
+Only pending jobs can have the deadline updated.
+Only the Slurm administrator or root can change this parameter.
+.TP
 \fIDependency\fP=<dependency_list>
 Defer job's initiation until specified job dependency specification
 is satisfied.
@@ -661,6 +689,11 @@ new allocation. Also see the \fINodeList\fP parameter above.
 \fINumTasks\fP=<count>
 Set the job's count of required tasks to the specified value.
 .TP
+\fIOverSubscribe\fP=<yes|no>
+Set the job's ability to share compute resources (i.e. individual CPUs)
+with other jobs. Possible values are "YES" and "NO".
+This option can only be changed for pending jobs.
+.TP
 \fIPartition\fP=<name>
 Set the job's partition to the specified value.
 .TP
@@ -697,9 +730,7 @@ Permit the job's geometry to be rotated.
 Possible values are "YES" and "NO".
 .TP
 \fIShared\fP=<yes|no>
-Set the job's ability to share nodes with other jobs.
-Possible values are "YES" and "NO".
-This option can only be changed for pending jobs.
+See \fIOverSubscribe\fP option above.
 .TP
 \fIStartTime\fP=<time_spec>
 Set the job's earliest initiation time.
@@ -946,15 +977,31 @@ current time limit, the \fIStepId\fP specification must precede the
 \fINodeName\fP=<name>
 Identify the node(s) to be updated. Multiple node names may be specified using
 simple node range expressions (e.g. "lx[10\-20]"). This specification is required.
+
 .TP
-\fIFeatures\fP=<features>
-Identify feature(s) to be associated with the specified node.  Any
-previously defined feature(s) will be overwritten with the new value.
-Features assigned via \fBscontrol\fR will only persist across the restart
-of the slurmctld daemon with the \fI\-R\fR option and state files
+\fIActiveFeatures\fP=<features>
+Identify the feature(s) currently active on the specified node.
+Any previously active feature specification will be overwritten with the new
+value.
+Also see \fIAvailableFeatures\fP.
+Typically \fIActiveFeatures\fP will be identical to \fIAvailableFeatures\fP;
+however \fIActiveFeatures\fP may be configured as a subset of the
+\fIAvailableFeatures\fP. For example, a node may be booted in mulitple
+configurations. In that case, all possible configurations may be identified as
+\fIAvailableFeatures\fP, while \fIActiveFeatures\fP would identify the current
+node configuration.
+
+.TP
+\fIAvailableFeatures\fP=<features>
+Identify the feature(s) available on the specified node.
+Any previously defined available feature specification will be overwritten with
+the new value.
+AvailableFeatures assigned via \fBscontrol\fR will only persist across the
+restart of the slurmctld daemon with the \fI\-R\fR option and state files
 preserved or slurmctld's receipt of a SIGHUP.
 Update slurm.conf with any changes meant to be persistent across normal
 restarts of slurmctld or the execution of \fBscontrol reconfig\fR.
+Also see \fIActiveFeatures\fP.
 
 .TP
 \fIGres\fP=<gres>
@@ -1168,6 +1215,14 @@ Specify a blank data value to remove all nodes from a partition: "Nodes=".
 Changing the \fINodes\fP in a partition has no effect upon jobs that
 have already begun execution.
 
+.TP
+\fIOverSubscribe\fP=<yes|no|exclusive|force>[:<job_count>]
+Specify if compute resources (i.e. individual CPUs) in this partition can be
+shared by multiple jobs.
+Possible values are "YES", "NO", "EXCLUSIVE" and "FORCE".
+An optional job count specifies how many jobs can be allocated to use
+each resource.
+
 .TP
 \fIPartitionName\fP=<name>
 Identify the partition to be updated. This specification is required.
@@ -1208,10 +1263,7 @@ Possible values are "YES" and "NO".
 
 .TP
 \fIShared\fP=<yes|no|exclusive|force>[:<job_count>]
-Specify if nodes in this partition can be shared by multiple jobs.
-Possible values are "YES", "NO", "EXCLUSIVE" and "FORCE".
-An optional job count specifies how many jobs can be allocated to use
-each resource.
+Renamed to \fIOverSubscribe\fP, see option descriptions above.
 
 .TP
 \fIState\fP=<up|down|drain|inactive>
@@ -1429,6 +1481,11 @@ This flag can be used to reserve all nodes within the specified
 partition.  PartitionName and Nodes=ALL must be specified or
 this option is ignored.
 .TP
+\fRPURGE_COMP\fR
+Purge the reservation once the last associated job has completed.
+Once the reservation has been created, it must be populated within 5 minutes
+of its start time or it will be purged before any jobs have been run.
+.TP
 \fRREPLACE\fR
 Resources allocated to jobs as automaticallly replenished using idle resources.
 This option can be used to maintain a constant number of idle resources
@@ -1773,7 +1830,7 @@ PartitionName=debug
 .br
    Nodes=snowflake[0-48]
 .br
-   Priority=1 RootOnly=NO Shared=YES:4
+   Priority=1 RootOnly=NO OverSubscribe=YES:4
 .br
    State=UP TotalCPUs=694 TotalNodes=49
 .br
@@ -1809,7 +1866,7 @@ JobId=71701 Name=hostname
 .br
    Features=(null) Reservation=(null)
 .br
-   Shared=OK Contiguous=0 Licenses=(null) Network=(null)
+   OverSubscribe=OK Contiguous=0 Licenses=(null) Network=(null)
 .br
 scontrol: update JobId=71701 TimeLimit=30:00 Priority=500
 .br
@@ -1838,7 +1895,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 .br
 Copyright (C) 2008\-2010 Lawrence Livermore National Security.
 .br
-Copyright (C) 2010-2015 SchedMD LLC.
+Copyright (C) 2010-2016 SchedMD LLC.
 .LP
 This file is part of Slurm, a resource management program.
 For details, see <http://slurm.schedmd.com/>.
diff --git a/doc/man/man1/sinfo.1 b/doc/man/man1/sinfo.1
index 59cc2adb4..c28c9cd8e 100644
--- a/doc/man/man1/sinfo.1
+++ b/doc/man/man1/sinfo.1
@@ -1,4 +1,4 @@
-.TH sinfo "1" "Slurm Commands" "April 2015" "Slurm Commands"
+.TH sinfo "1" "Slurm Commands" "March 2016" "Slurm Commands"
 
 .SH "NAME"
 sinfo \- view information about Slurm nodes and partitions.
@@ -136,6 +136,9 @@ Number of nodes by state in the format "allocated/idle".
 Do not use this with a node state option ("%t" or "%T") or
 the different node states will be placed on separate lines.
 .TP
+\fB%b\fR
+Features currently active on the nodes, also see \fB%f\fR
+.TP
 \fB%B\fR
 The max number of CPUs per node available to jobs in the partition.
 .TP
@@ -154,11 +157,14 @@ Size of temporary disk space per node in megabytes
 \fB%D\fR
 Number of nodes
 .TP
+\fB%e\fR
+Free memory of a node
+.TP
 \fB%E\fR
 The reason a node is unavailable (down, drained, or draining states).
 .TP
 \fB%f\fR
-Features associated with the nodes
+Features available the nodes, also see \fB%b\fR
 .TP
 \fB%F\fR
 Number of nodes by state in the format
@@ -173,11 +179,15 @@ Groups which may use the nodes
 Generic resources (gres) associated with the nodes
 .TP
 \fB%h\fR
-Jobs may share nodes, "yes", "no", or "force"
+Jobs may oversubscribe compute resources (i.e. CPUs), "yes", "no", "exclusive"
+or "force"
 .TP
 \fB%H\fR
 Print the timestamp of the reason a node is unavailable.
 .TP
+\fB%I\fR
+Partition job priority weighting factor.
+.TP
 \fB%l\fR
 Maximum time for any job in the format "days\-hours:minutes:seconds"
 .TP
@@ -202,11 +212,8 @@ List of node communication addresses
 \fB%O\fR
 CPU load of a node
 .TP
-\fB%e\fR
-Free memory of a node
-.TP
 \fB%p\fR
-Partition scheduling priority
+Partition scheduling tier priority.
 .TP
 \fB%P\fR
 Partition name followed by "*" for the default partition, also see \fB%R\fR
@@ -318,11 +325,15 @@ Number of cores per socket.
 .TP
 \fBdefaulttime\fR
 Default time for any job in the format "days\-hours:minutes:seconds".
+.TP
 \fBdisk\fR
 Size of temporary disk space per node in megabytes.
 .TP
 \fBfeatures\fR
-Features associated with the nodes.
+Features available on the nodes. Also see \fBfeatures_act\fR.
+.TP
+\fBfeatures_act\fR
+Features currently active on the nodes. Also see \fBfeatures\fR.
 .TP
 \fBgroups\fR
 Groups which may use the nodes.
@@ -359,6 +370,10 @@ List of node hostnames.
 \fBnodelist\fR
 List of node names.
 .TP
+\fBoversubscribe\fR
+Jobs may oversubscribe compute resources (i.e. CPUs), "yes", "no", "exclusive"
+or "force".
+.TP
 \fBpartition\fR
 Partition name followed by "*" for the default partition, also see \fB%R\fR.
 .TP
@@ -368,8 +383,11 @@ Partition name, also see \fB%P\fR.
 \fBpreemptmode\fR
 PreemptionMode.
 .TP
-\fBpriority\fR
-Partition scheduling priority.
+\fBpriorityjobfactor\fR
+Partition factor used by priority/multifactor plugin in calculating job priority.
+.TP
+\fBprioritytier\fR or \fBpriority\fR
+Partition scheduling tier priority.
 .TP
 \fBreason\fR
 The reason a node is unavailable (down, drained, or draining states).
@@ -377,9 +395,6 @@ The reason a node is unavailable (down, drained, or draining states).
 \fBroot\fR
 Only user root may initiate jobs, "yes" or "no".
 .TP
-\fBshare\fR
-Jobs may share nodes, "yes", "no", or "force".
-.TP
 \fBsize\fR
 Maximum job size in nodes.
 .TP
@@ -555,15 +570,15 @@ default partition.
 Is the ability to allocate resources in this partition
 restricted to user root, \fByes\fR or \fBno\fR.
 .TP
-\fBSHARE\fR
-Will jobs allocated resources in this partition share those
-resources.
-\fBno\fR indicates resources are never shared.
+\fBOVERSUBSCRIBE\fR
+Will jobs allocated resources in this partition oversubscribe those
+compute resources (i.e. CPUs).
+\fBno\fR indicates resources are never oversubscribed.
 \fBexclusive\fR indicates whole nodes are dedicated to jobs
 (equivalent to srun \-\-exclusive option, may be used even
-with shared/cons_res managing individual processors).
-\fBforce\fR indicates resources are always available to be shared.
-\fByes\fR indicates resource may be shared or not
+with select/cons_res managing individual processors).
+\fBforce\fR indicates resources are always available to be oversubscribed.
+\fByes\fR indicates resource may be oversubscribed or not
 per job's resource allocation.
 .TP
 \fBSTATE\fR
@@ -761,8 +776,8 @@ Report more complete information about the partition debug:
 .nf
 
 > sinfo --long --partition=debug
-PARTITION AVAIL TIMELIMIT JOB_SIZE ROOT SHARE GROUPS NODES STATE NODELIST
-debug*    up        30:00        8 no   no    all        8 idle  dev[0-7]
+PARTITION AVAIL TIMELIMIT JOB_SIZE ROOT OVERSUBS GROUPS NODES STATE NODELIST
+debug*    up        30:00        8 no   no       all        8 idle  dev[0-7]
 .fi
 
 Report only those nodes that are in state DRAINED:
@@ -804,7 +819,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 .br
 Copyright (C) 2008\-2009 Lawrence Livermore National Security.
 .br
-Copyright (C) 2010-2013 SchedMD LLC.
+Copyright (C) 2010-2016 SchedMD LLC.
 .LP
 This file is part of Slurm, a resource management program.
 For details, see <http://slurm.schedmd.com/>.
diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1
index 4c6543b29..2f56b2681 100644
--- a/doc/man/man1/squeue.1
+++ b/doc/man/man1/squeue.1
@@ -1,4 +1,4 @@
-.TH squeue "1" "Slurm Commands" "April 2015" "Slurm Commands"
+.TH squeue "1" "Slurm Commands" "April 2016" "Slurm Commands"
 
 .SH "NAME"
 squeue \- view information about jobs located in the Slurm scheduling queue.
@@ -220,13 +220,16 @@ Group ID of the job.
 (Valid for jobs only)
 .TP
 \fB%h\fR
-Can the resources allocated to the job be shared with other jobs.
-The resources to be shared can be nodes, sockets, cores, or hyperthreads
-depending upon configuration.
-The value will be "yes" if the job was submitted with the shared option or
-the partition is configured with Shared=Force,
-"no" if the job requires exclusive node access, and
-"unknwn" otherwise (typically allocated dedicated CPUs).
+Can the compute resources allocated to the job be over subscribed by other jobs.
+The resources to be over subscribed can be nodes, sockets, cores, or
+hyperthreads depending upon configuration.
+The value will be "YES" if the job was submitted with the oversubscribe option
+or the partition is configured with OverSubscribe=Force,
+"NO" if the job requires exclusive node access,
+"USER" if the allocated compute nodes are dedicated to a single user,
+"MCS" if the allocated compute nodes are dedicated to a single security class
+(See MCSPlugin and MCSParameters configuration parameters for more information),
+"OK" otherwise (typically allocated dedicated CPUs),
 (Valid for jobs only)
 .TP
 \fB%H\fR
@@ -532,6 +535,10 @@ Prints the frequency of the allocated CPUs.
 Prints the number of CPUs per tasks allocated to the job.
 (Valid for jobs only)
 .TP
+\fBdeadline\fR
+Prints the deadline affected to the job
+(Valid for jobs only)
+.TP
 \fBdependency\fR
 Job dependencies remaining. This job will not begin execution until these
 dependent jobs complete. In the case of a job that can not run due to job
@@ -594,6 +601,10 @@ Prints the max number of CPUs allocated to the job.
 Prints the max number of nodes allocated to the job.
 (Valid for jobs only)
 .TP
+\fBmcslabel\fR
+Prints the MCS_label of the job.
+(Valid for jobs only)
+.TP
 \fBminmemory\fR
 Minimum size of memory (in MB) requested by the job.
 (Valid for jobs only)
@@ -670,9 +681,22 @@ current number of nodes allocated.
 (Valid for jobs only)
 .TP
 \fBnumtask\fR
-Number of tasks created by a job step.
-This reports the value of the \fBsrun \-\-ntasks\fR option.
-(Valid for job steps only)
+Number of tasks requested by a job or job step.
+This reports the value of the \fB\-\-ntasks\fR option.
+(Valid for jobs and job steps)
+.TP
+\fBoversubscribe\fR
+Can the compute resources allocated to the job be over subscribed by other jobs.
+The resources to be over subscribed can be nodes, sockets, cores, or
+hyperthreads depending upon configuration.
+The value will be "YES" if the job was submitted with the oversubscribe option
+or the partition is configured with OverSubscribe=Force,
+"NO" if the job requires exclusive node access,
+"USER" if the allocated compute nodes are dedicated to a single user,
+"MCS" if the allocated compute nodes are dedicated to a single security class
+(See MCSPlugin and MCSParameters configuration parameters for more information),
+"OK" otherwise (typically allocated dedicated CPUs),
+(Valid for jobs only)
 .TP
 \fBpartition\fR
 Partition of the job or job step.
@@ -763,15 +787,6 @@ Geometry requirement of resource allocation (X,Y,Z dimensions),
 Connection type (TORUS, MESH, or NAV == torus else mesh),
 Permit rotation of geometry (yes or no),
 Node use (VIRTUAL or COPROCESSOR), etc.
-(Valid for jobs only)
-.TP
-\fBshared\fR
-Can the resources allocated to the job be shared with other jobs.
-Possible values are "no" (job allocated whole node only),
-"yes" (job can share allocated resources with other jobs), and
-"unknwn" (not specified by job or configuration, job will normally be allocated
-dedicated CPUs).
-
 (Valid for jobs only)
 .TP
 \fBsockets\fR
@@ -784,7 +799,7 @@ When \-\-sockets\-per\-node has not been set, "*" is displayed.
 Number of sockets per board allocated to the job.
 (Valid for jobs only)
 .TP
-\fBstartime\fR
+\fBstarttime\fR
 Actual or expected start time of the job or job step.
 (Valid for jobs and job steps)
 .TP
@@ -1292,7 +1307,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 .br
 Copyright (C) 2008\-2010 Lawrence Livermore National Security.
 .br
-Copyright (C) 2010\-2014 SchedMD LLC.
+Copyright (C) 2010\-2016 SchedMD LLC.
 .LP
 This file is part of Slurm, a resource management program.
 For details, see <http://slurm.schedmd.com/>.
diff --git a/doc/man/man1/sreport.1 b/doc/man/man1/sreport.1
index 5cebcdf00..276ed9e1b 100644
--- a/doc/man/man1/sreport.1
+++ b/doc/man/man1/sreport.1
@@ -20,6 +20,9 @@ Use all clusters instead of only the cluster from where the command was run.
 \fB\-h\fR, \fB\-\-help\fR
 Print a help message describing the usage of \fBsreport\fR.
 .TP
+\fB\-M\fR, \fB\-\-cluster\fR
+The cluster(s) to generate reports for. Default is local cluster.
+.TP
 \fB\-n\fR, \fB\-\-noheader\fR
 Don't display header when listing results.
 .TP
diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1
index fdab593d7..baeff438e 100644
--- a/doc/man/man1/srun.1
+++ b/doc/man/man1/srun.1
@@ -1,4 +1,4 @@
-.TH srun "1" "Slurm Commands" "January 2016" "Slurm Commands"
+.TH srun "1" "Slurm Commands" "March 2016" "Slurm Commands"
 
 .SH "NAME"
 srun \- Run parallel jobs
@@ -212,6 +212,14 @@ and "<job_id>.<step_id>.ckpt" for job steps.
 \fB\-\-comment\fR=<\fIstring\fR>
 An arbitrary comment.
 
+.TP
+\fB\-\-compress\fR[=\fItype\fR]
+Compress file before sending it to compute hosts.
+The optional argument specifies the data compression library to be used.
+Supported values are "lz4" (default) and "zlib".
+Some compression libraries may be unavailable on some systems.
+For use with the \fB\-\-bcast\fR option.
+
 .TP
 \fB\-C\fR, \fB\-\-constraint\fR=<\fIlist\fR>
 Nodes can have \fBfeatures\fR assigned to them by the Slurm administrator.
@@ -220,7 +228,7 @@ using the constraint option.
 Only nodes having features matching the job constraints will be used to
 satisfy the request.
 Multiple constraints may be specified with AND, OR, matching OR,
-resource counts, etc.
+resource counts, etc. (some operators are not supported on all system types).
 Supported \fbconstraint\fR options include:
 .PD 1
 .RS
@@ -284,9 +292,6 @@ above when task/affinity plugin is enabled.
 \fB\-\-cpu_bind\fR=[{\fIquiet,verbose\fR},]\fItype\fR
 Bind tasks to CPUs.
 Used only when the task/affinity or task/cgroup plugin is enabled.
-The configuration parameter \fBTaskPluginParam\fR may override these options.
-For example, if \fBTaskPluginParam\fR is configured to bind to cores,
-your job will not be able to bind tasks to sockets.
 NOTE: To have Slurm always report on the selected CPU binding for all
 commands executed in a shell, you can enable verbose mode by setting
 the SLURM_CPU_BIND environment variable value to "verbose".
@@ -520,8 +525,7 @@ TaskPlugin=task/cgroup with the "ConstrainCores" option) is not
 configured, this parameter is ignored.
 
 \fBNOTE\fR: When the step completes, the frequency and governor of each
-selected CPU is reset to the configured \fBCpuFreqDef\fR value with a
-default value of the OnDemand CPU governor.
+selected CPU is reset to the previous values.
 
 \fBNOTE\fR: When submitting jobs with  the \fB\-\-cpu\-freq\fR option
 with linuxproc as the ProctrackType can cause jobs to run too quickly before
@@ -557,6 +561,20 @@ threads per CPU for a total of two tasks.
 there are configurations and options which can result in inconsistent
 allocations when \-c has a value greater than \-c on salloc or sbatch.
 
+.TP
+\fB\-\-deadline\fR=<\fIOPT\fR>
+remove the job if no ending is possible before
+this deadline (start > (deadline \- time[\-min])).
+Default is no deadline.  Valid time formats are:
+.br
+HH:MM[:SS] [AM|PM]
+.br
+MMDD[YY] or MM/DD[/YY] or MM.DD[.YY]
+.br
+MM/DD[/YY]\-HH:MM[:SS]
+.br
+YYYY\-MM\-DD[THH:MM[:SS]]]
+
 .TP
 \fB\-d\fR, \fB\-\-dependency\fR=<\fIdependency_list\fR>
 Defer the start of this job until the specified dependencies have been
@@ -583,6 +601,11 @@ execution.
 \fBafterany:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated.
 .TP
+\fBaftercorr:job_id[:jobid...]\fR
+A task of this job array can begin execution after the corresponding task ID
+in the specified job has completed successfully (ran to completion with an
+exit code of zero).
+.TP
 \fBafternotok:job_id[:jobid...]\fR
 This job can begin execution after the specified jobs have terminated
 in some failed state (non-zero exit code, node failure, timed out, etc).
@@ -635,13 +658,13 @@ the Epilog parameter in slurm.conf.
 
 
 .TP
-\fB\-\-exclusive[=user]\fR
+\fB\-\-exclusive[=user|mcs]\fR
 This option has two slightly different meanings for job and job step
 allocations.
 When used to initiate a job, the job allocation cannot share nodes with
-other running jobs  (or just other users with the "=user" option).
+other running jobs  (or just other users with the "=user" option or "=mcs" option).
 The default shared/exclusive behavior depends on system configuration and the
-partition's \fBShared\fR option takes precedence over the job's option.
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 
 This option can also be used when initiating more than one job step within
 an existing resource allocation, where you want separate processors to
@@ -707,6 +730,19 @@ allocated no generic resources, explicitly set the value of \-\-gres to specify
 zero counts for each generic resource OR set "\-\-gres=none" OR set the
 SLURM_STEP_GRES environment variable to "none".
 
+.TP
+\fB\-\-gres\-flags\fR=enforce\-binding
+If set, the only CPUs available to the job will be those bound to the selected
+GRES (i.e. the CPUs identifed in the gres.conf file will be strictly enforced
+rather than advisory). This option may result in delayed initiation of a job.
+For example a job requiring two GPUs and one CPU will be delayed until both
+GPUs on a single socket are available rather than using GPUs bound to separate
+sockets, however the application performance may be improved due to improved
+communication speed.
+Requires the node to be configured with more than one socket and resource
+filtering will be performed on a per\-socket basis.
+Applies to job allocation only.
+
 .TP
 \fB\-H, \-\-hold\fR
 Specify the job is to be submitted in a held state (priority of zero).
@@ -995,6 +1031,12 @@ User to receive email notification of state changes as defined by
 \fB\-\-mail\-type\fR.
 The default value is the submitting user.
 
+.TP
+\fB\-\-mcs\-label\fR=<\fImcs\fR>
+Used only when the mcs/group plugin is enabled.
+This parameter is a group among the groups of the user.
+Default value is calculated by the Plugin mcs if it's enabled.
+
 .TP
 \fB\-\-mem\fR=<\fIMB\fR>
 Specify the real memory required per node in MegaBytes.
@@ -1149,6 +1191,22 @@ implementation supports it, in other words if the MPI has the PMI2
 interface implemented. The \-\-mpi=pmi2 will load the library
 lib/slurm/mpi_pmi2.so which provides the server side functionality but
 the client side must implement PMI2_Init() and the other interface calls.
+.TP
+.B pmix
+To enable PMIx support (http://pmix.github.io/master). The PMIx support
+in Slurm can be used to launch parallel applications (e.g. MPI) if it
+supports PMIx, PMI2 or PMI1. Slurm must be configured with pmix support
+by passing "--with-pmix=<PMIx installation path>" option to its 
+"./configure" script.
+
+At the time of writing PMIx is supported in Open MPI starting from version 2.0.
+PMIx also supports backward compatibility with PMI1 and PMI2 and can be 
+used if MPI was configured with PMI2/PMI1 support pointing to the PMIx library
+("libpmix").
+If MPI supports PMI1/PMI2 but doesn't provide the way to point to a specific 
+implementation, a hack'ish solution leveraging LD_PRELOAD can be used to 
+force "libpmix" usage.
+
 .TP
 .B none
 No special MPI processing. This is the default and works with
@@ -1611,15 +1669,19 @@ Allocate resources for the job from the named reservation.
 Specifies the directory from which the job or job step's checkpoint should
 be read (used by the checkpoint/blcrm and checkpoint/xlch plugins only).
 
+\fB\-\-share\fR
+The \fB\-\-share\fR option has been replaced by the \fB\-\-oversubscribe\fR
+option described below.
+
 .TP
-\fB\-s\fR, \fB\-\-share\fR
-The job allocation can share resources with other running jobs.
-The resources to be shared can be nodes, sockets, cores, or hyperthreads
-depending upon configuration.
-The default shared behavior depends on system configuration and the partition's
-\fBShared\fR option takes precedence over the job's option.
+\fB\-s\fR, \fB\-\-oversubscribe\fR
+The job allocation can over\-subscribe resources with other running jobs.
+The resources to be over\-subscribed can be nodes, sockets, cores, and/or
+hyperthreads depending upon configuration.
+The default over\-subscribe behavior depends on system configuration and the
+partition's \fBOverSubscribe\fR option takes precedence over the job's option.
 This option may result in the allocation being granted sooner than if the
-\-\-share option was not set and allow higher system utilization, but
+\-\-oversubscribe option was not set and allow higher system utilization, but
 application performance will likely suffer due to competition for resources.
 Also see the \-\-exclusive option.
 
@@ -1634,11 +1696,6 @@ AllowSpecResourcesUsage is enabled, the job will be allowed to override
 CoreSpecCount and use the specialized resources on nodes it is allocated.
 This option can not be used with the \fB\-\-thread\-spec\fR option.
 
-.TP
-\fB\-\-sicp\fR
-Identify a job as one which jobs submitted to other clusters can be dependent
-upon.
-
 .TP
 \fB\-\-signal\fR=<\fIsig_num\fR>[@<\fIsig_time\fR>]
 When a job is within \fIsig_time\fR seconds of its end time,
@@ -2043,33 +2100,39 @@ rather than the node where \fBsrun\fR executes, these format specifiers
 are not supported on a BGQ system.
 .RS 10
 .TP
+\fB\\\\\fR
+Do not process any of the replacement symbols.
+.TP
+\fB%%\fR
+The character "%".
+.TP
 \fB%A\fR
 Job array's master job allocation number.
 .TP
 \fB%a\fR
 Job array ID (index) number.
 .TP
-%J
+\fB%J\fR
 jobid.stepid of the running job. (e.g. "128.0")
 .TP
-%j
+\fB%j\fR
 jobid of the running job.
 .TP
-%s
+\fB%s\fR
 stepid of the running job.
 .TP
-%N
+\fB%N\fR
 short hostname. This will create a separate IO file per node.
 .TP
-%n
+\fB%n\fR
 Node identifier relative to current job (e.g. "0" is the first node of
 the running job) This will create a separate IO file per node.
 .TP
-%t
+\fB%t\fR
 task identifier (rank) relative to current job. This will create a
 separate IO file per task.
 .TP
-%u
+\fB%u\fR
 User name.
 .PP
 A number placed between the percent character and format specifier may be
@@ -2159,6 +2222,9 @@ Same as \fB\-\-checkpoint\-dir\fR
 \fBSLURM_CNLOAD_IMAGE\fR
 Same as \fB\-\-cnload\-image\fR
 .TP
+\fBSLURM_COMPRESS\fR
+Same as \fB\-\-compress\fR
+.TP
 \fBSLURM_CONN_TYPE\fR
 Same as \fB\-\-conn\-type\fR
 .TP
@@ -2215,6 +2281,9 @@ Also see \fBSLURM_EXIT_ERROR\fR.
 \fBSLURM_GEOMETRY\fR
 Same as \fB\-g, \-\-geometry\fR
 .TP
+\fBSLURM_GRES_FLAGS\fR
+Same as \-\-gres\-flags\fR
+.TP
 \fBSLURM_HINT\fR
 Same as \fB\-\-hint\fR
 .TP
@@ -2331,9 +2400,6 @@ Same as \fB\-\-restart\-dir\fR
 \fBSLURM_RESV_PORTS\fR
 Same as \fB\-\-resv\-ports\fR
 .TP
-\fBSLURM_SICP\fR
-Same as \fB\-\-sicp\fR
-.TP
 \fBSLURM_SIGNAL\fR
 Same as \fB\-\-signal\fR
 .TP
@@ -2566,7 +2632,14 @@ This is set only if the system has the topology/tree plugin configured.
 The value will be set component types listed in \fBSLURM_TOPOLOGY_ADDR\fR.
 Each component will be identified as either "switch" or "node".
 A period is used to separate each hardware component type.
-
+.TP
+\fBSLURM_UMASK\fR
+The \fIumask\fR in effect when the job was submitted.
+.TP
+\fBSLURMD_NODENAME\fR
+Name of the node running the task. In the case of a parallel job executing on
+multiple compute nodes, the various tasks will have this environment variable
+set to different values on each compute node.
 .TP
 \fBSRUN_DEBUG\fR
 Set to the logging level of the \fBsrun\fR command.
diff --git a/doc/man/man3/Makefile.in b/doc/man/man3/Makefile.in
index 4267ee932..ef80580e1 100644
--- a/doc/man/man3/Makefile.in
+++ b/doc/man/man3/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = doc/man/man3
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -197,8 +198,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -298,6 +297,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -336,6 +339,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -379,6 +385,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -429,6 +438,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/doc/man/man5/Makefile.am b/doc/man/man5/Makefile.am
index 5a2200b6c..6f29f4804 100644
--- a/doc/man/man5/Makefile.am
+++ b/doc/man/man5/Makefile.am
@@ -8,6 +8,7 @@ man5_MANS = \
 	cray.conf.5 \
 	ext_sensors.conf.5 \
 	gres.conf.5 \
+	knl.conf.5 \
 	nonstop.conf.5 \
 	slurm.conf.5 \
 	slurmdbd.conf.5 \
@@ -26,6 +27,7 @@ html_DATA = \
 	cray.conf.html \
 	ext_sensors.conf.html \
 	gres.conf.html \
+	knl.conf.html \
 	nonstop.conf.html \
 	slurm.conf.html \
 	slurmdbd.conf.html \
diff --git a/doc/man/man5/Makefile.in b/doc/man/man5/Makefile.in
index 400e8e0bf..c79b39e15 100644
--- a/doc/man/man5/Makefile.in
+++ b/doc/man/man5/Makefile.in
@@ -92,7 +92,8 @@ target_triplet = @target@
 @HAVE_MAN2HTML_TRUE@am__append_1 = $(html_DATA)
 subdir = doc/man/man5
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -200,8 +201,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -301,6 +300,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -339,6 +342,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -382,6 +388,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -432,6 +441,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -452,6 +462,7 @@ man5_MANS = \
 	cray.conf.5 \
 	ext_sensors.conf.5 \
 	gres.conf.5 \
+	knl.conf.5 \
 	nonstop.conf.5 \
 	slurm.conf.5 \
 	slurmdbd.conf.5 \
@@ -467,6 +478,7 @@ EXTRA_DIST = $(man5_MANS) $(am__append_1)
 @HAVE_MAN2HTML_TRUE@	cray.conf.html \
 @HAVE_MAN2HTML_TRUE@	ext_sensors.conf.html \
 @HAVE_MAN2HTML_TRUE@	gres.conf.html \
+@HAVE_MAN2HTML_TRUE@	knl.conf.html \
 @HAVE_MAN2HTML_TRUE@	nonstop.conf.html \
 @HAVE_MAN2HTML_TRUE@	slurm.conf.html \
 @HAVE_MAN2HTML_TRUE@	slurmdbd.conf.html \
diff --git a/doc/man/man5/burst_buffer.conf.5 b/doc/man/man5/burst_buffer.conf.5
index 4e028585d..c3d99194c 100644
--- a/doc/man/man5/burst_buffer.conf.5
+++ b/doc/man/man5/burst_buffer.conf.5
@@ -33,6 +33,17 @@ Comma separated list of user names and/or IDs permitted to use burst buffers.
 The options \fBAllowUsers\fR and \fBDenyUsers\fR can not both be specified.
 By default all users are permitted to use burst buffers.
 
+.\ Possible future enhancement for generic plugin
+.\ .TP
+.\ \fBAltPool\fR
+.\ The AltPool value consists of a comma separated list of alternate pools of
+.\ resources, each of which includes a name separated by a colon and a numeric
+.\ value.
+.\ The numeric value can include a suffix of "k", "m", "g", "t" and "p" which
+.\ multiplies the numeric value by 1,024, 1,048,576, 1,073,741,824 etc.
+.\ The numeric value is a 64-bit value.
+.\ for example, "AltPool=test:20g,small:4g
+
 .TP
 \fBCreateBuffer\fR
 Fully qualified path name of a program which will create both persistent
@@ -104,19 +115,6 @@ The numeric value may have a suffix of "m" (megabytes), "g" (gigabytes),
 Bytes is assumed if no suffix is supplied.
 This option is not used by the burst_buffer/cray plugin.
 
-.\ Possible future enhancement
-.\ .TP
-.\ \fBGres\fR
-.\ Generic resources associated with burst buffers.
-.\ This is a completely separate name space from the Gres defined in the slurm.conf
-.\ file.
-.\ The Gres value consists of a comma separated list of generic resources,
-.\ each of which includes a name separated by a colon and a numeric value.
-.\ The numeric value can include a suffix of "k", "m" or "g", which multiplies
-.\ the numeric value by 1,024, 1,048,576, or 1,073,741,824 respectively.
-.\ The numeric value is a 32-bit value.
-.\ See the example below.
-
 .TP
 \fBOtherTimeout\fR
 If a burst buffer operation (other than job validation, stage in, or stage out)
diff --git a/doc/man/man5/cgroup.conf.5 b/doc/man/man5/cgroup.conf.5
index 48d037298..99db76daa 100644
--- a/doc/man/man5/cgroup.conf.5
+++ b/doc/man/man5/cgroup.conf.5
@@ -30,7 +30,7 @@ of Slurm cgroup plugins.
 .TP
 \fBCgroupAutomount\fR=<yes|no>
 Slurm cgroup plugins require valid and functional cgroup subsystem to be mounted
-under /cgroup/<subsystem_name>.
+under /sys/fs/cgroup/<subsystem_name>.
 When launched, plugins check their subsystem availability. If not available,
 the plugin launch fails unless CgroupAutomount is set to yes. In that case, the
 plugin will first try to mount the required subsystems.
@@ -39,7 +39,7 @@ plugin will first try to mount the required subsystems.
 \fBCgroupMountpoint\fR=\fIPATH\fR
 Specify the \fIPATH\fR under which cgroups should be mounted. This
 should be a writable directory which will contain cgroups mounted
-one per subsystem. The default \fIPATH\fR is /cgroup.
+one per subsystem. The default \fIPATH\fR is /sys/fs/cgroup.
 
 .TP
 \fBCgroupReleaseAgentDir\fR=<path_to_release_agent_directory>
diff --git a/doc/man/man5/knl.conf.5 b/doc/man/man5/knl.conf.5
new file mode 100644
index 000000000..858319607
--- /dev/null
+++ b/doc/man/man5/knl.conf.5
@@ -0,0 +1,173 @@
+.TH "knl.conf" "5" "Slurm Configuration File" "May 2016" "Slurm Configuration File"
+
+.SH "NAME"
+knl.conf \- Slurm configuration file for Intel Knights Landing processor.
+
+.SH "DESCRIPTION"
+This ASCII file which describes configuration information for Intel Knights
+Landing processors and it's name may depend upon the NodeFeatures plugin
+configured in Slurm. For example, on Cray systems NodeFeatures should be configured
+to "knl_cray" and its configuration file will be read from "knl_cray.conf".
+The file location can be modified at system build time using the
+DEFAULT_SLURM_CONF parameter or at execution time by setting the SLURM_CONF
+environment variable. The file will always be located in the
+same directory as the \fBslurm.conf\fP file.
+This file is optional.
+.LP
+Parameter names are case insensitive.
+Any text following a "#" in the configuration file is treated
+as a comment through the end of that line.
+Changes to the configuration file take effect upon restart of
+Slurm daemons, daemon receipt of the SIGHUP signal, or execution
+of the command "scontrol reconfigure" unless otherwise noted.
+.LP
+The overall configuration parameters available include:
+
+.TP
+\fBAllowMCDRAM\fR
+Specify the MCDRAM modes which jobs are allowed to use.
+This may be a subset of MCDRAM modes supported by the node.
+If not specified, all MCDRAM modes supported by the node are available for use.
+The comma separated list of allowed MCDRAM modes may include any of the modes
+listed below.
+.RS
+.TP 17
+\fBcache\fR
+All of MCDRAM to be used as cache.
+.TP
+\fBequal\fR
+MCDRAM to be used partly as cache and partly combined with primary memory.
+.TP
+\fBflat\fR
+MCDRAM to be combined with primary memory into a "flat" memory space.
+.RE
+
+.TP
+\fBAllowNUMA\fR
+Specify the NUMA modes which jobs are allowed to use.
+This may be a subset of NUMA modes supported by the node.
+If not specified, all NUMA modes supported by the node are available for use.
+The comma separated list of allowed NUMA modes may include any of the modes
+listed below.
+Note that Slurm version 16.05 and earlier can only support homogeneous nodes
+(e.g. the same number of cores per NUMA node).
+KNL scn4 and quad modes are not homogeneous, but each each NUMA mode will have
+either 16 or 18 cores.
+This will result in Slurm using the lower core count and finding a total of
+256 threads rather than 272 threads and setting the node to a DOWN state.
+Therefore it is recommended that snc4 and quad mode not be allowed at this time.
+.RS
+.TP 17
+\fBa2a\fR
+All to all
+.TP
+\fBsnc2\fR
+Sub\-NUMA cluster 2
+.TP
+\fBsnc4\fR
+Sub\-NUMA cluster 4
+.TP
+\fBhemi\fR
+Hemisphere
+.TP
+\fBquad\fR
+Quadrant
+.RE
+
+.TP
+\fBAllowUserBoot\fR
+A comma delimited list of users allowed to modify a node's MCDRAM or NUMA state.
+If not specified then any user can change a node's state and reboot it.
+
+.TP
+\fBCapmcPath\fR
+Fully qualified path to the \fBcapmc\fR program.
+The default value is "/opt/cray/capmc/default/bin/capmc".
+This parameter is used only by the "knl_cray" plugin.
+
+.TP
+\fBCapmcPollFreq\fR
+Time interval between when the \fBcapmc\fR program should poll for node state
+changes, in seconds.
+The default value is 45 seconds.
+This parameter is used only by the "knl_cray" plugin.
+
+.TP
+\fBCapmcTimeout\fR
+Time limit for the \fBcapmc\fR program to return status information milliseconds.
+The default value is 10000 milliseconds and the minumum value is 1000 milliseconds.
+This parameter is used only by the "knl_cray.conf" plugin.
+
+.TP
+\fBDefaultMCDRAM\fR
+Specify the default MCDRAM modes for job's which do not specify a value.
+This is only used when a node is booted and the job which has been allocated
+the node does not specify a desired MCDRAM mode.
+The value can include one of the possible values identified with the
+\fBAllowMCDRAM\fR configuration parameter above.
+The default value is "cache".
+
+.TP
+\fBDefaultNUMA\fR
+Specify the default NUMA modes for job's which do not specify a value.
+This is only used when a node is booted and the job which has been allocated
+the node does not specify a desired NUMA mode.
+The value can include one of the possible values identified with the
+\fBAllowNUMA\fR configuration parameter above.
+The default value is "a2a".
+
+.TP
+\fBLogFile\fR
+Fully qualified path to a log file.
+The default value is SlurmctldLogFile from the slurm.conf configuration file.
+This is option is used only by the campc_suspend and campc_resume programs
+(which power down and reboot nodes in the appropriate configuration).
+
+.TP
+\fBSyscfgPath\fR
+Fully qualified path to Intel's \fBsyscfg\fR program, which identifies current
+KNL configuration by viewing BIOS settings.
+If not defined, the current BIOS setting will not be available.
+
+.SH "EXAMPLE"
+.LP
+.br
+###################################################################
+.br
+# knl_cray.conf
+.br
+# Slurm configuration file for Intel Knights Landing on Cray system
+.br
+###################################################################
+.br
+CapmcPath=/opt/cray/capmc/default/bin/capmc
+.br
+CapmcTimeout=6000
+.br
+DefaultMCDRAM=flat
+.br
+DefaultNUMA=a2a
+.br
+LogFile=/var/tmp/slurm_node_feature.log
+.br
+SyscfgPath=/usr/sbin/syscfg
+
+.SH "COPYING"
+Copyright (C) 2015-2016 SchedMD LLC.
+.LP
+This file is part of Slurm, a resource management program.
+For details, see <http://slurm.schedmd.com/>.
+.LP
+Slurm is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option)
+any later version.
+.LP
+Slurm is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+details.
+
+.SH "SEE ALSO"
+.LP
+\fBslurm.conf\fR(5)
diff --git a/doc/man/man5/slurm.conf.5 b/doc/man/man5/slurm.conf.5
index 67ff8abb7..3c148b721 100644
--- a/doc/man/man5/slurm.conf.5
+++ b/doc/man/man5/slurm.conf.5
@@ -1,4 +1,4 @@
-.TH "slurm.conf" "5" "Slurm Configuration File" "January 2016" "Slurm Configuration File"
+.TH "slurm.conf" "5" "Slurm Configuration File" "April 2016" "Slurm Configuration File"
 
 .SH "NAME"
 slurm.conf \- Slurm configuration file
@@ -307,15 +307,11 @@ The default value is dependent upon the Munge installation, but is typically
 \fBAuthType\fR
 The authentication method for communications between Slurm
 components.
-Acceptable values at present include "auth/none", "auth/authd",
-and "auth/munge".
+Acceptable values at present include "auth/none" and "auth/munge".
 The default value is "auth/munge".
 "auth/none" includes the UID in each communication, but it is not verified.
 This may be fine for testing purposes, but
 \fBdo not use "auth/none" if you desire any security\fR.
-"auth/authd" indicates that Brett Chun's authd is to be used (see
-"http://www.theether.org/authd/" for more information. Note that
-authd is no longer actively supported).
 "auth/munge" indicates that LLNL's MUNGE is to be used
 (this is the best supported authentication mechanism for Slurm,
 see "http://munge.googlecode.com/" for more information).
@@ -335,14 +331,13 @@ By default the \fBBackupAddr\fR will be identical in value to
 
 .TP
 \fBBackupController\fR
-The name of the machine where Slurm control functions are to be
-executed in the event that \fBControlMachine\fR fails. This node
-may also be used as a compute server if so desired. It will come into service
-as a controller only upon the failure of ControlMachine and will revert
-to a "standby" mode when the ControlMachine becomes available once again.
-This should be a node name without the full domain name.   I.e., the hostname
-returned by the \fIgethostname()\fR function cut at the first dot (e.g. use
-"tux001" rather than "tux001.my.com").
+The short, or long, name of the machine where Slurm control functions are to be
+executed in the event that \fBControlMachine\fR fails (i.e. the name returned by
+the command "hostname \-s"). This node may also be used as a compute server if
+so desired. It will come into service as a controller only upon the failure of
+ControlMachine and will revert to a "standby" mode when the ControlMachine
+becomes available once again.
+
 The backup controller recovers state information from the
 \fBStateSaveLocation\fR directory, which must be readable and writable from both
 the primary and backup controllers.
@@ -373,13 +368,6 @@ The plugin used to manage burst buffers.
 Acceptable values at present include "burst_buffer/none".
 More information later...
 
-.TP
-\fBCacheGroups\fR
-If set to 1, the slurmd daemon will cache /etc/groups entries.
-This can improve performance for highly parallel jobs if NIS servers
-are used and unable to respond very quickly.
-The default value is 0 to disable caching group data.
-
 .TP
 \fBCheckpointType\fR
 The system\-initiated checkpoint method to be used for user jobs.
@@ -460,9 +448,8 @@ By default the \fBControlAddr\fR will be identical in value to
 
 .TP
 \fBControlMachine\fR
-The short hostname of the machine where Slurm control functions are
-executed (i.e. the name returned by the command "hostname \-s", use
-"tux001" rather than "tux001.my.com").
+The short, or long, hostname of the machine where Slurm control functions are
+executed (i.e. the name returned by the command "hostname \-s").
 This value must be specified.
 In order to support some high availability architectures, multiple
 hostnames may be listed with comma separators and one \fBControlAddr\fR
@@ -487,29 +474,16 @@ used for all other system types
 
 .TP
 \fBCpuFreqDef\fR
-Default CPU frequency to be set when no jobs are running.
-The CPU frequency can also be set to this value after a catastrophic failure
-when state information has been lost.
+Default CPU frequency governor to use when running a job step if it
+has not been explicitly set with the \-\-cpu\-freq option.
 Acceptable values at present include:
 .RS
 .TP 14
-\fBLow\fR
-the lowest available frequency
-.TP
-\fBHigh\fR
-the highest available frequency
-.TP
-\fBHighM1\fR
-(high minus one) will select the next highest available frequency
-.TP
-\fBMedium\fR
-attempts to set a frequency in the middle of the available range
-.TP
 \fBConservative\fR
 attempts to use the Conservative CPU governor
 .TP
 \fBOnDemand\fR
-attempts to use the OnDemand CPU governor (the default value)
+attempts to use the OnDemand CPU governor
 .TP
 \fBPerformance\fR
 attempts to use the Performance CPU governor
@@ -517,6 +491,8 @@ attempts to use the Performance CPU governor
 \fBPowerSave\fR
 attempts to use the PowerSave CPU governor
 .RE
+There is no default value. If unset, no attempt to set the governor is
+made if the \-\-cpu\-freq option has not been set.
 
 .TP
 \fBCpuFreqGovernors\fR
@@ -532,7 +508,7 @@ attempts to use the Conservative CPU governor
 attempts to use the OnDemand CPU governor (the default value)
 .TP
 \fBPerformance\fR
-attempts to use the Performance CPU governor
+attempts to use the Performance CPU governor (the default value)
 .TP
 \fBPowerSave\fR
 attempts to use the PowerSave CPU governor
@@ -540,7 +516,7 @@ attempts to use the PowerSave CPU governor
 \fBUserSpace\fR
 attempts to use the UserSpace CPU governor
 .RE
-The default is OnDemand.
+The default is OnDemand, Performance.
 .TP
 \fBCryptoType\fR
 The cryptographic signature tool to be used in the creation of
@@ -646,6 +622,9 @@ Job container plugin details
 \fBLicense\fR
 License management details
 .TP
+\fBNodeFeatures\fR
+Node Features plugin debug info
+.TP
 \fBNO_CONF_HASH\fR
 Do not log when the slurm.conf files differs between Slurm daemons
 .TP
@@ -664,9 +643,6 @@ Advanced reservations
 \fBSelectType\fR
 Resource selection plugin
 .TP
-\fBSICP\fR
-Inter\-cluster job details
-.TP
 \fBSteps\fR
 Slurmctld resource allocation for job steps
 .TP
@@ -704,7 +680,8 @@ Default real memory size available per allocated node in MegaBytes.
 Used to avoid over\-subscribing memory and causing paging.
 \fBDefMemPerNode\fR would generally be used if whole nodes
 are allocated to jobs (\fBSelectType=select/linear\fR) and
-resources are shared (\fBShared=yes\fR or \fBShared=force\fR).
+resources are over\-subscribed (\fBOverSubscribe=yes\fR or
+\fBOverSubscribe=force\fR).
 The default value is 0 (unlimited).
 Also see \fBDefMemPerCPU\fR and \fBMaxMemPerNode\fR.
 \fBDefMemPerCPU\fR and \fBDefMemPerNode\fR are mutually exclusive.
@@ -776,10 +753,13 @@ May not exceed 65533.
 
 .TP
 \fBEnforcePartLimits\fR
-If set to "YES" then jobs which exceed a partition's size and/or time limits
-will be rejected at submission time. If set to "NO" then the job will be
-accepted and remain queued until the partition limits are altered.
-The default value is "NO".
+If set to "ALL" then jobs which exceed a partition's size and/or
+time limits will be rejected at submission time. If job is submitted to
+multiple partitions, the job must satisfy the limits on all the requested
+paritions. If set to "NO" then the job will be accepted and remain queued
+until the partition limits are altered(Time and Node Limits).
+If set to "ANY" or "YES" a job must satisfy any of the requested partitions
+to be submitted. The default value is "NO".
 NOTE: If set, then a job's QOS can not be used to exceed partition limits.
 
 .TP
@@ -923,13 +903,14 @@ of groups allowed to use a partition will be updated periodically, even when
 there have been no changes to the /etc/group file.
 Otherwise group member information will be updated periodically only after the
 /etc/group file is updated
-The default value is 0.
+The default value is 1.
 Also see the \fBGroupUpdateTime\fR parameter.
 
 .TP
 \fBGroupUpdateTime\fR
-Controls how frequently information about which users are members of groups
-allowed to use a partition will be updated.
+Controls how frequently information about which users are members of
+groups allowed to use a partition will be updated, and how long user
+group membership lists will be cached.
 The time interval is given in seconds with a default value of 600 seconds and
 a maximum value of 4095 seconds.
 A value of zero will prevent periodic updating of group membership information.
@@ -1137,12 +1118,15 @@ Also see \fBDefaultStoragePort\fR.
 .TP
 \fBJobCompType\fR
 The job completion logging mechanism type.
-Acceptable values at present include "jobcomp/none", "jobcomp/filetxt",
-"jobcomp/mysql", "jobcomp/elasticsearch" and "jobcomp/script"".
+Acceptable values at present include "jobcomp/none", "jobcomp/elasticsearch",
+"jobcomp/filetxt", "jobcomp/mysql" and "jobcomp/script"".
 The default value is "jobcomp/none", which means that upon job completion
 the record of the job is purged from the system.  If using the accounting
 infrastructure this plugin may not be of interest since the information
 here is redundant.
+The value "jobcomp/elasticsearch" indicates that a record of the job
+should be written to an Elasticsearch server specified by the
+\fBJobCompLoc\fR parameter.
 The value "jobcomp/filetxt" indicates that a record of the job should be
 written to a text file specified by the \fBJobCompLoc\fR parameter.
 The value "jobcomp/mysql" indicates that a record of the job should be
@@ -1151,9 +1135,6 @@ parameter.
 The value "jobcomp/script" indicates that a script specified by the
 \fBJobCompLoc\fR parameter is to be executed with environment variables
 indicating the job information.
-The value "jobcomp/elasticsearch" indicates that a record of the job
-should be written to an Elasticsearch server specified by the
-\fBJobCompLoc\fR parameter.
 .TP
 \fBJobCompUser\fR
 The user account for accessing the job completion database.
@@ -1216,7 +1197,7 @@ A comma delimited list of job submission plugins to be used.
 The specified plugins will be executed in the order listed.
 These are intended to be site\-specific plugins which can be used to set
 default job parameters and/or logging events.
-Sample plugins available in the distribution include "all_partitions", "cnode",
+Sample plugins available in the distribution include "all_partitions",
 "defaults", "logging", "lua", and "partition".
 For examples of use, see the Slurm code in "src/plugins/job_submit" and
 "contribs/lua/job_submit*.lua" then modify the code to satisfy your needs.
@@ -1252,6 +1233,19 @@ it will be forcibly terminated.
 The default value is 30 seconds.
 The value may not exceed 65533.
 
+.TP
+\fBNodeFeaturesPlugins\fR
+Identifies the plugins to be used for support of node features which can
+change through time. For example, a node which might be booted with various
+BIOS setting. This is supported through the use of a node's active_features
+and available_features information.
+Acceptable values at present include:
+.RS
+.TP 20
+\fBnode_features/knl_cray\fR
+used only for Intel Knights Landing processors (KNL) on Cray systems
+.RE
+
 .TP
 \fBLaunchParameters\fR
 Identifies options to the job launch plugin.
@@ -1308,7 +1302,8 @@ shown. The "clock" format shows a timestamp in microseconds retrieved
 with the C standard clock() function. The "short" format is a short
 date and time format. The "thread_id" format shows the timestamp
 in the C standard ctime() function form without the year but
-including the microseconds, the daemon's process ID and the current thread ID.
+including the microseconds, the daemon's process ID and the current thread name
+and ID.
 
 .TP
 \fBMailProg\fR
@@ -1376,7 +1371,8 @@ Maximum real memory size available per allocated node in MegaBytes.
 Used to avoid over\-subscribing memory and causing paging.
 \fBMaxMemPerNode\fR would generally be used if whole nodes
 are allocated to jobs (\fBSelectType=select/linear\fR) and
-resources are shared (\fBShared=yes\fR or \fBShared=force\fR).
+resources are over\-subscribed (\fBOverSubscribe=yes\fR or
+\fBOverSubscribe=force\fR).
 The default value is 0 (unlimited).
 Also see \fBDefMemPerNode\fR and \fBMaxMemPerCPU\fR.
 \fBMaxMemPerCPU\fR and \fBMaxMemPerNode\fR are mutually exclusive.
@@ -1394,9 +1390,37 @@ The default value is 40000 steps.
 .TP
 \fBMaxTasksPerNode\fR
 Maximum number of tasks Slurm will allow a job step to spawn
-on a single node. The default \fBMaxTasksPerNode\fR is 128.
+on a single node. The default \fBMaxTasksPerNode\fR is 512.
 May not exceed 65533.
 
+.TP
+\fBMCSParameters\fR
+MCS = Multi-Category Security
+MCS Plugin Parameters.
+The supported parameters are specific to the \fBMCSPlugin\fR.
+Changes to this value take effect when the Slurm daemons are reconfigured.
+More information about MCS is available here
+<http://slurm.schedmd.com/mcs_Plugins.html>.
+
+.TP
+\fBMCSPlugin\fR
+MCS = Multi-Category Security : associate a security label to jobs and ensure
+that nodes can only be shared among jobs using the same security label.
+Acceptable values include:
+.RS
+.TP 12
+\fBmcs/none\fR
+is the default value.
+No security label associated with jobs,
+no particular security restriction when sharing nodes among jobs.
+.TP
+\fBmcs/group\fR
+only users with the same group can share the nodes.
+.TP
+\fBmcs/user\fR
+a node cannot be shared with other users.
+.RE
+
 .TP
 \fBMemLimitEnforce\fR
 If set to "no" then Slurm will not terminate the job or the job step
@@ -1469,9 +1493,8 @@ aggregation are the node registration, batch script completion,
 step completion, and epilog complete messages.
 .br
 .br
-.RE
 The format for this parameter is as follows:
-.br
+.RE
 .RS
 .TP 12
 \fBMsgAggregationParams=\fR\fI<option>\fR\fB=\fR\fI<value>\fR
@@ -1701,7 +1724,7 @@ Job preemption is disabled.
 This is the default.
 .TP
 \fBpreempt/partition_prio\fR
-Job preemption is based upon partition priority.
+Job preemption is based upon partition priority tier.
 Jobs in higher priority partitions (queues) may preempt jobs from lower
 priority partitions.
 This is not compatible with \fBPreemptMode=OFF\fR.
@@ -1752,6 +1775,7 @@ The keywords below have no associated value
 \fBACCRUE_ALWAYS\fR
 If set, priority age factor will be increased despite job dependencies
 or holds.
+.TP
 \fBCALCULATE_RUNNING\fR
 If set, priorities will be recalculated not only for pending jobs, but also
 running and suspended jobs.
@@ -1837,7 +1861,7 @@ Jobs that can preempt
 .IP \n+[step].
 Jobs with an advanced reservation
 .IP \n+[step].
-Partition Priority
+Partition Priority Tier
 .IP \n+[step].
 Job Priority
 .IP \n+[step].
@@ -1868,8 +1892,7 @@ The default value is 0.
 
 .TP
 \fBPriorityWeightPartition\fR
-An integer value that sets the degree to which the node partition
-component contributes to the job's priority.
+Partition factor used by priority/multifactor plugin in calculating job priority.
 Applicable only if PriorityType=priority/multifactor.
 The default value is 0.
 
@@ -1951,7 +1974,6 @@ can become a child of the init process (when the parent process
 terminates) or change their process group.
 To reliably track all processes, one of the other mechanisms
 utilizing kernel modifications is preferable.
-NOTE: "proctrack/linuxproc" is not compatible with "switch/elan."
 NOTE: The \fBJobContainerType\fR applies to a job allocation, while
 \fBProctrackType\fR applies to job steps.
 Acceptable values at present include:
@@ -2383,11 +2405,11 @@ The interpretation of this parameter varies by \fBSchedulerType\fR.
 Multiple options may be comma separated.
 .RS
 .TP
-\fBassoc_limit_continue\fR
-If set, continue to schedule lower priority jobs in each partition if the
-higher priority jobs cannot start due to association limits. Setting this
-can improve throughput and utlization, but may potentially starve larger
-jobs and prevent them from launching indefinitely.
+\fBassoc_limit_stop\fR
+If set and a job cannot start due to association limits, then do not attempt
+to initiate any lower priority jobs in that partition. Setting this can
+decrease system throughput and utlization, but avoid potentially starving larger
+jobs by preventing them from launching indefinitely.
 .TP
 \fBbatch_sched_delay=#\fR
 How long, in seconds, the scheduling of batch jobs can be delayed.
@@ -2485,6 +2507,18 @@ This can be valuable if jobs lack time limits or all time limits have the same
 value.
 The default value is zero, which will reserve resources for any pending job
 and delay initiation of lower priority jobs.
+Also see bf_min_prio_reserve.
+.TP
+\fBbf_min_prio_reserve=#\fR
+The backfill and main scheduling logic will not reserve resources for pending
+jobs unless they have a priority equal to or higher than the specified value.
+In addition, jobs with a lower priority will not prevent a newly submitted job
+from starting immediately, even if the newly submitted job has a lower priority.
+This can be valuable if one wished to maximum system utilization without regard
+for job priority below a certain threshold.
+The default value is zero, which will reserve resources for any pending job
+and delay initiation of lower priority jobs.
+Also see bf_min_age_reserve.
 .TP
 \fBbf_resolution=#\fR
 The number of seconds in the resolution of data maintained about when jobs
@@ -2546,6 +2580,9 @@ This option may improve system responsiveness when large numbers of jobs
 (many hundreds) are submitted at the same time, but it will delay the
 initiation time of individual jobs. Also see \fBdefault_queue_depth\fR above.
 .TP
+\fBdisable_user_top\fB
+Disable use of the "scontrol top" command by non-privileged users.
+.TP
 \fBIgnore_NUMA\fR
 Some processors (e.g. AMD Opteron 6000 series) contain multiple NUMA nodes per
 socket. This is a configuration which does not map into the hardware entities
@@ -2610,6 +2647,11 @@ won't schedule new jobs. This is useful in Cray environments when the backup
 controller resides on an external Cray node.  A restart is required to alter
 this option. This is explicitly set on a Cray/ALPS system.
 .TP
+\fBno_env_cache\fR
+If used, any job started on node that fails to load the env from a node will
+fail instead of using the cached env.  This will also implicitly imply the
+requeue_setup_env_fail option as well.
+.TP
 \fBpack_serial_at_end\fR
 If used with the select/cons_res plugin then put serial jobs at the end of
 the available nodes rather than using a best fit algorithm.
@@ -2643,6 +2685,11 @@ By default if the Prolog exits with a non-zero value the job is requeued in
 held state. By specifying this parameter the job will be requeued but not
 held so that the scheduler can dispatch it to another host.
 .TP
+\fBrequeue_setup_env_fail\fR
+By default if a job environment setup fails the job keeps running with
+a limited environment. By specifying this parameter the job will be
+requeued in held state and the execution node drained.
+.TP
 \fBsched_interval=#\fR
 How frequently, in seconds, the main scheduling loop will execute and test all
 pending jobs.
@@ -2748,8 +2795,8 @@ The default value is "select/bluegene" for BlueGene systems.
 The resources within a node are individually allocated as
 consumable resources.
 Note that whole nodes can be allocated to jobs for selected
-partitions by using the \fIShared=Exclusive\fR option.
-See the partition \fBShared\fR parameter for more information.
+partitions by using the \fIOverSubscribe=Exclusive\fR option.
+See the partition \fBOverSubscribe\fR parameter for more information.
 .TP
 \fBselect/cray\fR
 for a Cray system.
@@ -2891,7 +2938,8 @@ Setting a value for \fBDefMemPerCPU\fR is strongly recommended.
 .TP
 \fBCR_Memory\fR
 Memory is a consumable resource.
-NOTE: This implies \fIShared=YES\fR or \fIShared=FORCE\fR for all partitions.
+NOTE: This implies \fIOverSubscribe=YES\fR or \fIOverSubscribe=FORCE\fR for
+all partitions.
 Setting a value for \fBDefMemPerCPU\fR is strongly recommended.
 .RE
 .RE
@@ -3318,32 +3366,32 @@ are mutually exclusive (select only one of them).
 .RS
 .TP 10
 \fBBoards\fR
-Always bind to boards.
-Overrides user options or automatic binding.
+Bind tasks to boards by default.
+Overrides automatic binding.
 .TP
 \fBCores\fR
-Always bind to cores.
-Overrides user options or automatic binding.
+Bind tasks to cores by default.
+Overrides automatic binding.
 .TP
 \fBCpusets\fR
 Use cpusets to perform task affinity functions.
 By default, \fBSched\fR task binding is performed.
 .TP
 \fBNone\fR
-Perform no task binding.
-Overrides user options or automatic binding.
+Perform no task binding by default.
+Overrides automatic binding.
 .TP
 \fBSched\fR
 Use \fIsched_setaffinity\fR (if available) to bind tasks to
 processors.
 .TP
 \fBSockets\fR
-Always bind to sockets.
-Overrides user options or automatic binding.
+Bind to sockets by default.
+Overrides automatic binding.
 .TP
 \fBThreads\fR
-Always bind to threads.
-Overrides user options or automatic binding.
+Bind to threads by default.
+Overrides automatic binding.
 .TP
 \fBVerbose\fR
 Verbosely report binding before tasks run.
@@ -3407,6 +3455,10 @@ System\-wide per task program defined in slurm.conf
 Function in TaskPlugin
 .RE
 
+.TP
+\fBTCPTimeout\fR
+Time permitted for TCP connection to be established. Default value is 2 seconds.
+
 .TP
 \fBTmpFS\fR
 Fully qualified pathname of the file system available to user jobs for
@@ -3417,14 +3469,30 @@ The default value is "/tmp".
 .TP
 \fBTopologyParam\fR
 Comma separated options identifing network topology options.
-The value of "dragonfly" is valid when TopologyPlugin=topology/tree.
-The value of "NoInAddrAny" is used to directly bind to the address of what
-the node resolves to instead of binding messages to any address on the node
-which is the default. This option is for all daemons/clients except for the
-slurmctld.
-The value of "NoCtldInAddrAny" is used to directly bind to the address of what
-the node resolves to running the slurmctld instead of binding messages to any
-address on the node, which is the default.
+.RS
+.TP 15
+\fBDragonfly\fR
+Optimize allocation for Dragonfly network.
+Valid when TopologyPlugin=topology/tree.
+.TP
+\fBNoCtldInAddrAny\fR
+Used to directly bind to the address of what the node resolves to running
+the slurmctld instead of binding messages to any address on the node,
+which is the default.
+.TP
+\fBNoInAddrAny\fR
+Used to directly bind to the address of what the node resolves to instead
+of binding messages to any address on the node which is the default.
+This option is for all daemons/clients except for the slurmctld.
+.TP
+\fBTopoOptional\fR
+Only optimize allocation for network topology if the job includes a switch
+option. Since optimizing resource allocation for topology involves much higher
+system overhead, this option can be used to impose the extra overhead only on
+jobs which can take advantage of it. If most job allocations are not optimized
+for network topology, they make fragment resources to the point that topology
+optimization for other jobs will be difficult to achieve.
+.RE
 
 .TP
 \fBTopologyPlugin\fR
@@ -3437,8 +3505,7 @@ Acceptable values include:
 .RS
 .TP 21
 \fBtopology/3d_torus\fR
-default for Sun Constellation
-systems, best\-fit logic over three\-dimensional topology
+best\-fit logic over three\-dimensional topology
 .TP
 \fBtopology/node_rank\fR
 orders nodes based upon information a node_rank field in the node record
@@ -3630,8 +3697,8 @@ through the host database (/etc/hosts) or DNS, depending on the resolver
 settings.  Note that if the short form of the hostname is not used, it
 may prevent use of hostlist expressions (the numeric portion in brackets
 must be at the end of the string).
-Only short hostname forms are compatible with the
-switch/elan, switch/federation and switch/nrt plugins at this time.
+Only short hostname forms are compatible with the switch/nrt plugin at
+this time.
 It may also be an arbitrary string if \fBNodeHostname\fR is specified.
 If the \fBNodeName\fR is "DEFAULT", the values specified
 with that record will apply to subsequent node specifications
@@ -3654,8 +3721,8 @@ through the host database (/etc/hosts) or DNS, depending on the resolver
 settings.  Note that if the short form of the hostname is not used, it
 may prevent use of hostlist expressions (the numeric portion in brackets
 must be at the end of the string).
-Only short hostname forms are compatible with the
-switch/elan, switch/federation and switch/nrt plugins at this time.
+Only short hostname forms are compatible with the switch/nrt plugin at
+this time.
 A node range expression can be used to specify a set of nodes.
 If an expression is used, the number of nodes identified by
 \fBNodeHostname\fR on a line in the configuration file must
@@ -3760,7 +3827,9 @@ Also see \fBFeature\fR.
 Limit on combined real memory allocation for compute node daemons
 (slurmd, slurmstepd), in megabytes. This memory is not available to job
 allocations. The daemons won't be killed when they exhaust the memory allocation
-(ie. the OOM Killer is disabled for the daemon's memory cgroup).
+(ie. the OOM Killer is disabled for the daemon's memory cgroup). This option has
+no effect unless cgroup job confinement is also configured
+(\fBTaskPlugin=task/cgroup\fR with \fBConstrainRAMSpace=yes\fR in cgroup.conf).
 
 .TP
 \fBPort\fR
@@ -4181,7 +4250,8 @@ Default real memory size available per allocated node in MegaBytes.
 Used to avoid over\-subscribing memory and causing paging.
 \fBDefMemPerNode\fR would generally be used if whole nodes
 are allocated to jobs (\fBSelectType=select/linear\fR) and
-resources are shared (\fBShared=yes\fR or \fBShared=force\fR).
+resources are over\-subscribed (\fBOverSubscribe=yes\fR or
+\fBOverSubscribe=force\fR).
 If not set, the \fBDefMemPerNode\fR value for the entire cluster will be used.
 Also see \fBDefMemPerCPU\fR and \fBMaxMemPerNode\fR.
 \fBDefMemPerCPU\fR and \fBDefMemPerNode\fR are mutually exclusive.
@@ -4284,7 +4354,8 @@ Maximum real memory size available per allocated node in MegaBytes.
 Used to avoid over\-subscribing memory and causing paging.
 \fBMaxMemPerNode\fR would generally be used if whole nodes
 are allocated to jobs (\fBSelectType=select/linear\fR) and
-resources are shared (\fBShared=yes\fR or \fBShared=force\fR).
+resources are over\-subscribed (\fBOverSubscribe=yes\fR or
+\fBOverSubscribe=force\fR).
 If not set, the \fBMaxMemPerNode\fR value for the entire cluster will be used.
 Also see \fBDefMemPerNode\fR and \fBMaxMemPerCPU\fR.
 \fBMaxMemPerCPU\fR and \fBMaxMemPerNode\fR are mutually exclusive.
@@ -4328,6 +4399,75 @@ described above. A blank list of nodes
 but have no resources (possibly on a temporary basis).
 A value of "ALL" is mapped to all nodes configured in the cluster.
 
+.TP
+\fBOverSubscribe\fR
+Controls the ability of the partition to execute more than one job at a
+time on each resource (node, socket or core depending upon the value
+of \fBSelectTypeParameters\fR).
+If resources are to be over\-subscribed, avoiding memory over\-subscription
+is very important.
+\fBSelectTypeParameters\fR should be configured to treat
+memory as a consumable resource and the \fB\-\-mem\fR option
+should be used for job allocations.
+Sharing of resources is typically useful only when using gang scheduling
+(\fBPreemptMode=suspend,gang\fR).
+Possible values for \fBOverSubscribe\fR are "EXCLUSIVE", "FORCE", "YES", and "NO".
+Note that a value of "YES" or "FORCE" can negatively impact performance
+for systems with many thousands of running jobs.
+The default value is "NO".
+For more information see the following web pages:
+.br
+.na
+\fIhttp://slurm.schedmd.com/cons_res.html\fR,
+.br
+\fIhttp://slurm.schedmd.com/cons_res_share.html\fR,
+.br
+\fIhttp://slurm.schedmd.com/gang_scheduling.html\fR, and
+.br
+\fIhttp://slurm.schedmd.com/preempt.html\fR.
+.ad
+
+.RS
+.TP 12
+\fBEXCLUSIVE\fR
+Allocates entire nodes to jobs even with select/cons_res configured.
+Jobs that run in partitions with "OverSubscribe=EXCLUSIVE" will have
+exclusive access to all allocated nodes.
+.TP
+\fBFORCE\fR
+Makes all resources in the partition available for sharing
+without any means for users to disable it.
+May be followed with a colon and maximum number of jobs in
+running or suspended state.
+For example "OverSubscribe=FORCE:4" enables each node, socket or
+core to execute up to four jobs at once.
+Recommended only for BlueGene systems configured with
+small blocks or for systems running
+with gang scheduling (\fBPreemptMode=suspend,gang\fR).
+NOTE: \fIPreemptType=QOS\fR will permit one additional job to be run
+on the partition if started due to job preemption. For example, a configuration
+of \fIOverSubscribe=FORCE:1\fR will only permit one job per resources normally,
+but a second job can be started if done so through preemption based upon QOS.
+The use of \fIPreemptType=QOS\fR and \fIPreemptType=Suspend\fR only applies
+with \fISelectType=cons_res\fR.
+.TP
+\fBYES\fR
+Makes all resources in the partition available for sharing upon request by
+the job.
+Resources will only be over\-subscribed when explicitly requested
+by the user using the "\-\-share" option on job submission.
+May be followed with a colon and maximum number of jobs in
+running or suspended state.
+For example "OverSubscribe=YES:4" enables each node, socket or
+core to execute up to four jobs at once.
+Recommended only for systems running with gang scheduling
+(\fBPreemptMode=suspend,gang\fR).
+.TP
+\fBNO\fR
+Selected resources are allocated to a single job. No resource will be
+allocated to more than one job.
+.RE
+
 .TP
 \fBPartitionName\fR
 Name by which the partition may be referenced (e.g. "Interactive").
@@ -4353,13 +4493,20 @@ See the description of the cluster\-level \fBPreemptMode\fR configuration
 parameter above for further information.
 
 .TP
-\fBPriority\fR
-Jobs submitted to a higher priority partition will be dispatched
-before pending jobs in lower priority partitions and if possible
-they will preempt running jobs from lower priority partitions.
-Note that a partition's priority takes precedence over a job's
-priority.
+\fBPriorityJobFactor\fR
+Partition factor used by priority/multifactor plugin in calculating job priority.
 The value may not exceed 65533.
+Also see PriorityTier.
+
+.TP
+\fBPriorityTier\fR
+Jobs submitted to a partition with a higher priority tier value will be
+dispatched before pending jobs in partition with lower priority tier value and,
+if possible, they will preempt running jobs from partitions with lower priority
+tier values.
+Note that a partition's priority tier takes precedence over a job's priority.
+The value may not exceed 65533.
+Also see PriorityJobFactor.
 
 .TP
 \fBQOS\fR
@@ -4394,77 +4541,15 @@ The default value is "NO".
 .TP
 \fBSelectTypeParameters\fR
 Partition\-specific resource allocation type.
-Supported values are \fBCR_Core\fR and \fBCR_Socket\fR.
+This option replaces the global \fBSelectTypeParameters\fR value.
+Supported values are \fBCR_Core\fR, \fBCR_Core_Memory\fR, \fBCR_Socket\fR and
+\fBCR_Socket_Memory\fR.
 Use requires the system\-wide \fBSelectTypeParameters\fR value be set.
 
 .TP
 \fBShared\fR
-Controls the ability of the partition to execute more than one job at a
-time on each resource (node, socket or core depending upon the value
-of \fBSelectTypeParameters\fR).
-If resources are to be shared, avoiding memory over\-subscription
-is very important.
-\fBSelectTypeParameters\fR should be configured to treat
-memory as a consumable resource and the \fB\-\-mem\fR option
-should be used for job allocations.
-Sharing of resources is typically useful only when using gang scheduling
-(\fBPreemptMode=suspend,gang\fR).
-Possible values for \fBShared\fR are "EXCLUSIVE", "FORCE", "YES", and "NO".
-Note that a value of "YES" or "FORCE" can negatively impact performance
-for systems with many thousands of running jobs.
-The default value is "NO".
-For more information see the following web pages:
-.br
-.na
-\fIhttp://slurm.schedmd.com/cons_res.html\fR,
-.br
-\fIhttp://slurm.schedmd.com/cons_res_share.html\fR,
-.br
-\fIhttp://slurm.schedmd.com/gang_scheduling.html\fR, and
-.br
-\fIhttp://slurm.schedmd.com/preempt.html\fR.
-.ad
-
-.RS
-.TP 12
-\fBEXCLUSIVE\fR
-Allocates entire nodes to jobs even with select/cons_res configured.
-Jobs that run in partitions with "Shared=EXCLUSIVE" will have
-exclusive access to all allocated nodes.
-.TP
-\fBFORCE\fR
-Makes all resources in the partition available for sharing
-without any means for users to disable it.
-May be followed with a colon and maximum number of jobs in
-running or suspended state.
-For example "Shared=FORCE:4" enables each node, socket or
-core to execute up to four jobs at once.
-Recommended only for BlueGene systems configured with
-small blocks or for systems running
-with gang scheduling (\fBPreemptMode=suspend,gang\fR).
-NOTE: \fIPreemptType=QOS\fR will permit one additional job to be run
-on the partition if started due to job preemption. For example, a configuration
-of \fIShared=FORCE:1\fR will only permit one job per resources normally,
-but a second job can be started if done so through preemption based upon QOS.
-The use of \fIPreemptType=QOS\fR and \fIPreemptType=Suspend\fR only applies
-with \fISelectType=cons_res\fR.
-.TP
-\fBYES\fR
-Makes all resources in the partition available for sharing upon request by
-the job.
-Resources will only be over\-subscribed when explicitly requested
-by the user using the "\-\-share" option on job submission.
-May be followed with a colon and maximum number of jobs in
-running or suspended state.
-For example "Shared=YES:4" enables each node, socket or
-core to execute up to four jobs at once.
-Recommended only for systems running with gang scheduling
-(\fBPreemptMode=suspend,gang\fR).
-.TP
-\fBNO\fR
-Selected resources are allocated to a single job. No resource will be
-allocated to more than one job.
-.RE
+The \fBShared\fR configuration parameter has been replaced by the
+\fBOverSubscribe\fR parameter described above.
 
 .TP
 \fBState\fR
@@ -4683,7 +4768,7 @@ User name of the job's owner.
 .SH "NETWORK TOPOLOGY"
 Slurm is able to optimize job allocations to minimize network contention.
 Special Slurm logic is used to optimize allocations on systems with a
-three\-dimensional interconnect (BlueGene, Sun Constellation, etc.)
+three\-dimensional interconnect (BlueGene, etc.)
 and information about configuring those systems are available on
 web pages available here: <http://slurm.schedmd.com/>.
 For a hierarchical network, Slurm needs to have detailed information
@@ -4697,7 +4782,7 @@ so as to minimize the use of higher\-level switches.
 The \fBTopologyPlugin\fR parameter controls which plugin is used to
 collect network topology information.
 The only values presently supported are
-"topology/3d_torus" (default for IBM BlueGene, Sun Constellation and
+"topology/3d_torus" (default for IBM BlueGene and
 Cray XT/XE systems, performs best\-fit logic over three\-dimensional topology),
 "topology/none" (default for other systems,
 best\-fit logic over one\-dimensional topology),
@@ -4798,7 +4883,7 @@ SlurmdSpoolDir=/usr/local/slurm/slurmd.spool
 .br
 StateSaveLocation=/usr/local/slurm/slurm.state
 .br
-SwitchType=switch/elan
+SwitchType=switch/none
 .br
 TmpFS=/tmp
 .br
@@ -5055,7 +5140,7 @@ Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
 .br
 Copyright (C) 2008\-2010 Lawrence Livermore National Security.
 .br
-Copyright (C) 2010-2015 SchedMD LLC.
+Copyright (C) 2010-2016 SchedMD LLC.
 .LP
 This file is part of Slurm, a resource management program.
 For details, see <http://slurm.schedmd.com/>.
diff --git a/doc/man/man5/slurmdbd.conf.5 b/doc/man/man5/slurmdbd.conf.5
index ed2ee4fbd..be0ba4992 100644
--- a/doc/man/man5/slurmdbd.conf.5
+++ b/doc/man/man5/slurmdbd.conf.5
@@ -112,14 +112,12 @@ mechanism being used.
 \fBAuthType\fR
 Define the authentication method for communications between Slurm
 components.
-Acceptable values at present include "auth/none", "auth/authd",
+Acceptable values at present include "auth/none"
 and "auth/munge".
 The default value is "auth/none", which means the UID included in
 communication messages is not verified.
 This may be fine for testing purposes, but
 \fBdo not use "auth/none" if you desire any security\fR.
-"auth/authd" indicates that Brett Chun's authd is to be used (see
-"http://www.theether.org/authd/" for more information).
 "auth/munge" indicates that LLNL's Munge system is to be used
 (this is the best supported authentication mechanism for Slurm,
 see "https://code.google.com/p/munge/" for more information).
@@ -141,12 +139,10 @@ present.
 
 .TP
 \fBDbdBackupHost\fR
-The name of the machine where the backup Slurm Database Daemon is executed.
+The short, or long, name of the machine where the backup Slurm Database Daemon
+is executed (i.e. the name returned by the command "hostname \-s").
 This host must have access to the same underlying database specified by
 the 'Storage' options mentioned below.
-This should be a node name without the full domain name.  I.e., the hostname
-returned by the \fIgethostname()\fR function cut at the first dot (e.g. use
-"tux001" rather than "tux001.my.com").
 
 .TP
 \fBDbdAddr\fR
@@ -158,10 +154,9 @@ value to \fBDbdHost\fR.
 
 .TP
 \fBDbdHost\fR
-The name of the machine where the Slurm Database Daemon is executed.
-This should be a node name without the full domain name.  I.e., the hostname
-returned by the \fIgethostname()\fR function cut at the first dot (e.g. use
-"tux001" rather than "tux001.my.com").  This value must be specified.
+The short, or long, name of the machine where the Slurm Database Daemon is
+executed (i.e. the name returned by the command "hostname \-s").
+This value must be specified.
 
 .TP
 \fBDbdPort\fR
@@ -452,6 +447,10 @@ This value must be specified.
 Define the name of the user we are going to connect to the database
 with to store the job accounting data.
 
+.TP
+\fBTCPTimeout\fR
+Time permitted for TCP connection to be established. Default value is 2 seconds.
+
 .TP
 \fBTrackWCKey\fR
 Boolean yes or no.  Used to set display and track of the Workload
diff --git a/doc/man/man8/Makefile.in b/doc/man/man8/Makefile.in
index c50c47bcd..a74f9f6f4 100644
--- a/doc/man/man8/Makefile.in
+++ b/doc/man/man8/Makefile.in
@@ -92,7 +92,8 @@ target_triplet = @target@
 @HAVE_MAN2HTML_TRUE@am__append_1 = $(html_DATA)
 subdir = doc/man/man8
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -200,8 +201,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -301,6 +300,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -339,6 +342,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -382,6 +388,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -432,6 +441,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/doc/man/man8/slurmd.8 b/doc/man/man8/slurmd.8
index 2b6df127c..f875f6ebf 100644
--- a/doc/man/man8/slurmd.8
+++ b/doc/man/man8/slurmd.8
@@ -1,4 +1,4 @@
-.TH slurmd "8" "Slurm Daemon" "April 2015" "Slurm Daemon"
+.TH slurmd "8" "Slurm Daemon" "January 2016" "Slurm Daemon"
 
 .SH "NAME"
 slurmd \- The compute node daemon for Slurm.
@@ -12,6 +12,10 @@ running on the compute node , accepts work (tasks), launches tasks, and kills
 running tasks upon request.
 .TP
 OPTIONS
+.TP
+\fB\-B\fR
+Report node rebooted when daemon restarted. Used for testing purposes.
+
 .TP
 \fB\-c\fR
 Clear system locks as needed. This may be required if \fBslurmd\fR terminated
@@ -95,8 +99,8 @@ configuration file, \fBslurm.conf\fR.
 .SH "COPYING"
 Copyright (C) 2002\-2007 The Regents of the University of California.
 Copyright (C) 2008\-2010 Lawrence Livermore National Security.
+Copyright (C) 2010\-2016 SchedMD LLC.
 Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
-CODE\-OCEC\-09\-009. All rights reserved.
 .LP
 This file is part of Slurm, a resource management program.
 For details, see <http://slurm.schedmd.com/>.
diff --git a/doc/man/man8/slurmdbd.8 b/doc/man/man8/slurmdbd.8
index 7242f500d..d2c7e36b8 100644
--- a/doc/man/man8/slurmdbd.8
+++ b/doc/man/man8/slurmdbd.8
@@ -21,6 +21,11 @@ Help; print a brief summary of command options.
 \fB\-n <value>\fR
 Set the daemon's nice value to the specified value, typically a negative number.
 .TP
+\fB\-R[comma separated cluster name list]\fR
+Reset the lft and rgt values of the associations in the given cluster list.
+Lft and rgt values are used to distinguish hierarchical groups in the slurm
+accounting database.  This option should be very rarely used.
+.TP
 \fB\-v\fR
 Verbose operation. Multiple \fB\-v\fR's increase verbosity.
 .TP
diff --git a/etc/Makefile.am b/etc/Makefile.am
new file mode 100644
index 000000000..aa5e898fc
--- /dev/null
+++ b/etc/Makefile.am
@@ -0,0 +1,31 @@
+ETC_FILES = cgroup.release_common.example init.d.slurmdbd init.d.slurm \
+	    slurmctld.service slurmdbd.service slurmd.service
+
+CLEANFILES = $(ETC_FILES)
+
+edit = sed \
+        -e 's|@bindir[@]|$(bindir)|g' \
+        -e 's|@libdir[@]|$(libdir)|g' \
+        -e 's|@sbindir[@]|$(sbindir)|g' \
+        -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+	-e 's|@BLUEGENE_LOADED_FALSE[@]|$(BLUEGENE_LOADED_FALSE)|g'
+
+noinst_DATA = $(ETC_FILES)
+
+cgroup.release_common.example: Makefile $(srcdir)/cgroup.release_common.example.in
+	$(edit) $(srcdir)/cgroup.release_common.example.in > cgroup.release_common.example
+
+init.d.slurmdbd: Makefile $(srcdir)/init.d.slurmdbd.in
+	$(edit) $(srcdir)/init.d.slurmdbd.in > init.d.slurmdbd
+
+init.d.slurm: Makefile $(srcdir)/init.d.slurm.in
+	$(edit) $(srcdir)/init.d.slurm.in > init.d.slurm
+
+slurmctld.service: Makefile $(srcdir)/slurmctld.service.in
+	$(edit) $(srcdir)/slurmctld.service.in > slurmctld.service
+
+slurmdbd.service: Makefile $(srcdir)/slurmdbd.service.in
+	$(edit) $(srcdir)/slurmdbd.service.in > slurmdbd.service
+
+slurmd.service: Makefile $(srcdir)/slurmd.service.in
+	$(edit) $(srcdir)/slurmd.service.in > slurmd.service
diff --git a/etc/Makefile.in b/etc/Makefile.in
new file mode 100644
index 000000000..6532345c3
--- /dev/null
+++ b/etc/Makefile.in
@@ -0,0 +1,650 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = etc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DATA = $(noinst_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ETC_FILES = cgroup.release_common.example init.d.slurmdbd init.d.slurm \
+	    slurmctld.service slurmdbd.service slurmd.service
+
+CLEANFILES = $(ETC_FILES)
+edit = sed \
+        -e 's|@bindir[@]|$(bindir)|g' \
+        -e 's|@libdir[@]|$(libdir)|g' \
+        -e 's|@sbindir[@]|$(sbindir)|g' \
+        -e 's|@sysconfdir[@]|$(sysconfdir)|g' \
+	-e 's|@BLUEGENE_LOADED_FALSE[@]|$(BLUEGENE_LOADED_FALSE)|g'
+
+noinst_DATA = $(ETC_FILES)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu etc/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+	cscopelist-am ctags-am distclean distclean-generic \
+	distclean-libtool distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+cgroup.release_common.example: Makefile $(srcdir)/cgroup.release_common.example.in
+	$(edit) $(srcdir)/cgroup.release_common.example.in > cgroup.release_common.example
+
+init.d.slurmdbd: Makefile $(srcdir)/init.d.slurmdbd.in
+	$(edit) $(srcdir)/init.d.slurmdbd.in > init.d.slurmdbd
+
+init.d.slurm: Makefile $(srcdir)/init.d.slurm.in
+	$(edit) $(srcdir)/init.d.slurm.in > init.d.slurm
+
+slurmctld.service: Makefile $(srcdir)/slurmctld.service.in
+	$(edit) $(srcdir)/slurmctld.service.in > slurmctld.service
+
+slurmdbd.service: Makefile $(srcdir)/slurmdbd.service.in
+	$(edit) $(srcdir)/slurmdbd.service.in > slurmdbd.service
+
+slurmd.service: Makefile $(srcdir)/slurmd.service.in
+	$(edit) $(srcdir)/slurmd.service.in > slurmd.service
+
+# 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/etc/cgroup.release_common.example.in b/etc/cgroup.release_common.example.in
index f642cc329..0e107ab07 100644
--- a/etc/cgroup.release_common.example.in
+++ b/etc/cgroup.release_common.example.in
@@ -24,7 +24,7 @@ get_mount_dir()
     elif X=$(grep -si -m1 "^CgroupMountpoint=" @sysconfdir@/cgroup.conf); then
         echo $X | sed "s/.*=\(.*\)/\1\/${subsystem}/"
     else
-        echo "/cgroup/$subsystem"
+        echo "/sys/fs/cgroup/$subsystem"
     fi
 }
 
diff --git a/etc/layouts.d.unit.conf.example b/etc/layouts.d.unit.conf.example
new file mode 100644
index 000000000..d941d6e83
--- /dev/null
+++ b/etc/layouts.d.unit.conf.example
@@ -0,0 +1,30 @@
+# example unit layout configuration file
+# unit layout only aims at validating layouts framework internals
+Priority=10
+
+Root=GlobalPass
+Entity=GlobalPass Type=UnitTestPass Enclosed=pass[1-4] children_count=0
+
+# parents aggregation unit tests
+Entity=pass1 Type=UnitTestPass Enclosed=pass1_test[1-9] long=9 uint16=18 uint32=27 float=36.0 double=45.0 ldouble=54.0
+Entity=pass1_test[1-9] Type=UnitTest  \
+		       parents_sum_long=0 parents_fshare_long=0 \
+		       parents_sum_uint16=0 parents_fshare_uint16=0 \
+		       parents_sum_uint32=0 parents_fshare_uint32=0 \
+		       parents_sum_float=0.0 parents_fshare_float=0.0 \
+		       parents_sum_double=0.0 parents_fshare_double=0.0 \
+		       parents_sum_ldouble=0.0 parents_fshare_ldouble=0.0
+
+# children aggregation unit tests
+Entity=pass2 Type=UnitTestPass Enclosed=pass2_test[1-9] children_count=0 \
+	     children_sum_long=0 children_avg_long=0 children_min_long=INFINITE children_max_long=0 \
+	     children_sum_uint16=0 children_avg_uint16=0 children_min_uint16=INFINITE children_max_uint16=0 \
+	     children_sum_uint32=0 children_avg_uint32=0 children_min_uint32=INFINITE children_max_uint32=0 \
+	     children_sum_float=0.0 children_avg_float=0.0 children_min_float=INFINITE children_max_float=0.0 \
+	     children_sum_double=0.0 children_avg_double=0.0 children_min_double=INFINITE children_max_double=0.0 \
+	     children_sum_ldouble=0.0 children_avg_ldouble=0.0 children_min_ldouble=INFINITE children_max_ldouble=0.0
+Entity=pass2_test[1-9] Type=UnitTest string=test[11-19] long=1 uint16=16 uint32=32 float=[1-9].[0] double=1[1-9].[0] ldouble=111[1-9].[0]
+
+# high density configurations unit tests
+Entity=pass[3-4] Type=UnitTestPass Enclosed=pass[3-4]_test[1-9]
+Entity=pass[3-4]_test[1-9] Type=UnitTest string=dense[11-19] long=-1 uint16=16 uint32=32 float=[1-9].[0] double=2[1-9].[0] ldouble=222[1-9].[0]
diff --git a/etc/slurm.conf.example b/etc/slurm.conf.example
index ffbce5a55..937cf6518 100644
--- a/etc/slurm.conf.example
+++ b/etc/slurm.conf.example
@@ -29,7 +29,6 @@ SlurmctldPidFile=/var/run/slurmctld.pid
 SlurmdPidFile=/var/run/slurmd.pid
 ProctrackType=proctrack/pgid
 #PluginDir=
-CacheGroups=0
 #FirstJobId=
 ReturnToService=0
 #MaxJobCount=
diff --git a/slurm.spec b/slurm.spec
index 59c3ecc46..39113070e 100644
--- a/slurm.spec
+++ b/slurm.spec
@@ -1,32 +1,32 @@
-# $Id$
-#
 # Note that this package is not relocatable
 
 #
 # build options      .rpmmacros options      change to default action
 # ===============    ====================    ========================
-# --enable-multiple-slurmd %_with_multiple_slurmd 1 build with the multiple slurmd option.  Typically used to simulate a larger system than one has access to.
-# --enable-salloc-background %_with_salloc_background 1 on a cray system alloc salloc to execute as a background process.
-# --prefix           %_prefix        path    install path for commands, libraries, etc.
-# --with aix         %_with_aix         1    build aix RPM
-# --with authd       %_with_authd       1    build auth-authd RPM
-# --with auth_none   %_with_auth_none   1    build auth-none RPM
-# --with blcr        %_with_blcr        1    require blcr support
-# --with bluegene    %_with_bluegene    1    build bluegene RPM
-# --with cray        %_with_cray        1    build for a Cray system without ALPS
-# --with cray_alps   %_with_cray_alps   1    build for a Cray system with ALPS
-# --with cray_network %_with_cray_network 1  build for a non-Cray system with a Cray network
-# --without debug    %_without_debug    1    don't compile with debugging symbols
-# --with lua         %_with_lua         1    build Slurm lua bindings (proctrack only for now)
-# --without munge    %_without_munge    1    don't build auth-munge RPM
-# --with mysql       %_with_mysql       1    require mysql/mariadb support
-# --without netloc   %_without_netloc  path  require netloc support
-# --with openssl     %_with_openssl     1    require openssl RPM to be installed
-# --without pam      %_without_pam      1    don't require pam-devel RPM to be installed
-# --with percs       %_with_percs       1    build percs RPM
-# --without readline %_without_readline 1    don't require readline-devel RPM to be installed
-# --with sgijob      %_with_sgijob      1    build proctrack-sgi-job RPM
-# --with sun_const   %_with_sun_const   1    build for Sun Constellation system
+# --enable-multiple-slurmd %_with_multiple_slurmd 1  build with the multiple slurmd
+#                                               option.  Typically used to simulate a
+#                                               larger system than one has access to.
+# --enable-salloc-background %_with_salloc_background 1  on a cray system alloc salloc
+#                                               to execute as a background process.
+# --prefix           %_prefix             path  install path for commands, libraries, etc.
+# --with aix         %_with_aix           1     build aix RPM
+# --with auth_none   %_with_auth_none     1     build auth-none RPM
+# --with blcr        %_with_blcr          1     require blcr support
+# --with bluegene    %_with_bluegene      1     build bluegene RPM
+# --with cray        %_with_cray          1     build for a Cray system without ALPS
+# --with cray_alps   %_with_cray_alps     1     build for a Cray system with ALPS
+# --with cray_network %_with_cray_network 1     build for a non-Cray system with a Cray network
+# --without debug    %_without_debug      1     don't compile with debugging symbols
+# --with pmix        %_with_pmix          1     build pmix support
+# --with lua         %_with_lua           1     build Slurm lua bindings (proctrack only for now)
+# --without munge    %_without_munge      path  don't build auth-munge RPM
+# --with mysql       %_with_mysql         1     require mysql/mariadb support
+# --without netloc   %_without_netloc     path  require netloc support
+# --with openssl     %_with_openssl       1     require openssl RPM to be installed
+# --without pam      %_without_pam        1     don't require pam-devel RPM to be installed
+# --with percs       %_with_percs         1     build percs RPM
+# --without readline %_without_readline   1     don't require readline-devel RPM to be installed
+# --with sgijob      %_with_sgijob        1     build proctrack-sgi-job RPM
 #
 #  Allow defining --with and --without build options or %_with and %without in .rpmmacros
 #    slurm_with    builds option by default unless --without is specified
@@ -41,14 +41,13 @@
 
 #  Options that are off by default (enable with --with <opt>)
 %slurm_without_opt auth_none
-%slurm_without_opt authd
 %slurm_without_opt bluegene
 %slurm_without_opt cray
 %slurm_without_opt cray_alps
 %slurm_without_opt cray_network
-%slurm_without_opt sun_const
 %slurm_without_opt salloc_background
 %slurm_without_opt multiple_slurmd
+%slurm_without_opt pmix
 
 # These options are only here to force there to be these on the build.
 # If they are not set they will still be compiled if the packages exist.
@@ -267,16 +266,6 @@ Requires: slurm
 Slurm NULL authentication module
 %endif
 
-%if %{slurm_with authd}
-%package auth-authd
-Summary: Slurm auth implementation using Brent Chun's authd
-Group: System Environment/Base
-Requires: slurm authd
-%description auth-authd
-Slurm authentication module for Brent Chun's authd. Used to
-authenticate user originating an RPC
-%endif
-
 # This is named munge instead of auth-munge since there are 2 plugins in the
 # package.  auth-munge and crypto-munge
 %if %{slurm_with munge}
@@ -330,6 +319,13 @@ Requires: slurm-perlapi
 %description torque
 Torque wrapper scripts used for helping migrate from Torque/PBS to Slurm
 
+%package openlava
+Summary: openlava/LSF wrappers for transitition from OpenLava/LSF to Slurm
+Group: Development/System
+Requires: slurm-perlapi
+%description openlava
+OpenLava wrapper scripts used for helping migrate from OpenLava/LSF to Slurm
+
 %package sjobexit
 Summary: Slurm job exit code management tools
 Group: Development/System
@@ -389,6 +385,15 @@ Slurm lua bindings
 Includes the Slurm proctrack/lua and job_submit/lua plugin
 %endif
 
+%package seff
+Summary: Mail tool that includes job statistics in user notification email
+Group: Development/System
+Requires: slurm-perlapi
+%description seff
+Mail program used directly by the Slurm daemons. On completion of a job,
+wait for it's accounting information to be available and include that
+information in the email body.
+
 %package sjstat
 Summary: Perl tool to print Slurm job state information
 Group: Development/System
@@ -432,7 +437,6 @@ Gives the ability for Slurm to use Berkeley Lab Checkpoint/Restart
 %configure \
 	%{!?slurm_with_debug:--disable-debug} \
 	%{?slurm_with_partial_attach:--enable-partial-attach} \
-	%{?slurm_with_sun_const:--enable-sun-const} \
 	%{?with_db2_dir:--with-db2-dir=%{?with_db2_dir}} \
 	%{?with_pam_dir:--with-pam_dir=%{?with_pam_dir}} \
 	%{?with_proctrack:--with-proctrack=%{?with_proctrack}}\
@@ -449,12 +453,25 @@ Gives the ability for Slurm to use Berkeley Lab Checkpoint/Restart
 	%{?slurm_with_salloc_background:--enable-salloc-background} \
 	%{!?slurm_with_readline:--without-readline} \
 	%{?slurm_with_multiple_slurmd:--enable-multiple-slurmd} \
+	%{?slurm_with_pmix:--with-pmix=%{?with_pmix_dir}} \
 	%{?with_freeipmi:--with-freeipmi=%{?with_freeipmi}}\
 	%{?with_cflags}
 
 %__make %{?_smp_mflags}
 
 %install
+
+
+# Strip out some dependencies
+
+cat > find-requires.sh <<'EOF'
+exec %{__find_requires} "$@" | egrep -v '^libpmix.so|libevent'
+EOF
+chmod +x find-requires.sh
+%global _use_internal_dependency_generator 0
+%global __find_requires %{_builddir}/%{buildsubdir}/find-requires.sh
+
+
 rm -rf "$RPM_BUILD_ROOT"
 DESTDIR="$RPM_BUILD_ROOT" %__make install
 DESTDIR="$RPM_BUILD_ROOT" %__make install-contrib
@@ -490,6 +507,8 @@ DESTDIR="$RPM_BUILD_ROOT" %__make install-contrib
    rm -f contribs/cray/opt_modulefiles_slurm
    rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/plugstack.conf.template
    rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/slurm.conf.template
+   rm -f $RPM_BUILD_ROOT/%{_sbindir}/capmc_suspend
+   rm -f $RPM_BUILD_ROOT/%{_sbindir}/capmc_resume
    rm -f $RPM_BUILD_ROOT/%{_sbindir}/slurmconfgen.py
 %endif
 
@@ -499,22 +518,14 @@ install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdi
 install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup/release_freezer
 install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup/release_cpuset
 install -D -m755 etc/cgroup.release_common.example ${RPM_BUILD_ROOT}%{_sysconfdir}/cgroup/release_memory
-install -D -m644 etc/layouts.d.power.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/layouts.d.power.conf.example
-install -D -m644 etc/layouts.d.power_cpufreq.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/layouts.d.power_cpufreq.conf.example
+install -D -m644 etc/layouts.d.power.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/layouts.d/power.conf.example
+install -D -m644 etc/layouts.d.power_cpufreq.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/layouts.d/power_cpufreq.conf.example
+install -D -m644 etc/layouts.d.unit.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/layouts.d/unit.conf.example
 install -D -m644 etc/slurm.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.conf.example
 install -D -m755 etc/slurm.epilog.clean ${RPM_BUILD_ROOT}%{_sysconfdir}/slurm.epilog.clean
 install -D -m644 etc/slurmdbd.conf.example ${RPM_BUILD_ROOT}%{_sysconfdir}/slurmdbd.conf.example
-install -D -m755 contribs/sgather/sgather ${RPM_BUILD_ROOT}%{_bindir}/sgather
 install -D -m755 contribs/sjstat ${RPM_BUILD_ROOT}%{_bindir}/sjstat
 
-# Correct some file permissions
-test -f $RPM_BUILD_ROOT/%{_libdir}/libpmi.la	&&
-	chmod 644 $RPM_BUILD_ROOT/%{_libdir}/libpmi.la
-test -f $RPM_BUILD_ROOT/%{_libdir}/libslurm.la	&&
-	chmod 644 $RPM_BUILD_ROOT/%{_libdir}/libslurm.la
-test -f $RPM_BUILD_ROOT/%{_libdir}/libslurmdb.la &&
-	chmod 644 $RPM_BUILD_ROOT/%{_libdir}/libslurmdb.la
-
 # Delete unpackaged files:
 test -s $RPM_BUILD_ROOT/%{_perldir}/auto/Slurm/Slurm.bs         ||
 rm   -f $RPM_BUILD_ROOT/%{_perldir}/auto/Slurm/Slurm.bs
@@ -522,10 +533,8 @@ rm   -f $RPM_BUILD_ROOT/%{_perldir}/auto/Slurm/Slurm.bs
 test -s $RPM_BUILD_ROOT/%{_perldir}/auto/Slurmdb/Slurmdb.bs     ||
 rm   -f $RPM_BUILD_ROOT/%{_perldir}/auto/Slurmdb/Slurmdb.bs
 
-rm -f $RPM_BUILD_ROOT/%{_libdir}/libpmi.a
-rm -f $RPM_BUILD_ROOT/%{_libdir}/libpmi2.a
-rm -f $RPM_BUILD_ROOT/%{_libdir}/libslurm.a
-rm -f $RPM_BUILD_ROOT/%{_libdir}/libslurmdb.a
+rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
+rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la
 rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.a
 rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/*.la
 rm -f $RPM_BUILD_ROOT/%{_libdir}/slurm/job_submit_defaults.so
@@ -607,6 +616,10 @@ LIST=./slurm.files
 touch $LIST
 test -f $RPM_BUILD_ROOT/etc/init.d/slurm			&&
   echo /etc/init.d/slurm				>> $LIST
+test -f $RPM_BUILD_ROOT/%{_sbindir}/capmc_suspend		&&
+  echo %{_sbindir}/capmc_suspend			>> $LIST
+test -f $RPM_BUILD_ROOT/%{_sbindir}/capmc_resume		&&
+  echo %{_sbindir}/capmc_resume				>> $LIST
 test -f $RPM_BUILD_ROOT/usr/sbin/rcslurm			&&
   echo /usr/sbin/rcslurm				>> $LIST
 test -f $RPM_BUILD_ROOT/usr/lib/systemd/system/slurmctld.service	&&
@@ -661,13 +674,6 @@ touch $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/proctrack_aix.so      &&
   echo %{_libdir}/slurm/proctrack_aix.so               >> $LIST
 
-LIST=./devel.files
-touch $LIST
-test -f $RPM_BUILD_ROOT/%{_libdir}/libpmi.la			&&
-  echo %{_libdir}/libpmi.la				>> $LIST
-test -f $RPM_BUILD_ROOT/%{_libdir}/libpmi2.la			&&
-  echo %{_libdir}/libpmi2.la				>> $LIST
-
 LIST=./percs.files
 touch $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/checkpoint_poe.so	&&
@@ -724,6 +730,8 @@ test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/launch_aprun.so             &&
    echo %{_libdir}/slurm/launch_aprun.so             >> $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/mpi_mvapich.so              &&
    echo %{_libdir}/slurm/mpi_mvapich.so              >> $LIST
+test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/node_features_knl_cray.so   &&
+   echo %{_libdir}/slurm/node_features_knl_cray.so   >> $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/power_cray.so               &&
    echo %{_libdir}/slurm/power_cray.so               >> $LIST
 test -f $RPM_BUILD_ROOT/%{_libdir}/slurm/select_bluegene.so          &&
@@ -776,8 +784,10 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root,0755)
 %{_datadir}/doc
 %{_bindir}/s*
+%exclude %{_bindir}/seff
 %exclude %{_bindir}/sjobexitmod
 %exclude %{_bindir}/sjstat
+%exclude %{_bindir}/smail
 %{_sbindir}/slurmctld
 %{_sbindir}/slurmd
 %{_sbindir}/slurmstepd
@@ -789,10 +799,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*
 %{_mandir}/man5/acct_gather.*
 %{_mandir}/man5/burst_buffer.*
-%{_mandir}/man5/ext_sensors.*
 %{_mandir}/man5/cgroup.*
 %{_mandir}/man5/cray.*
+%{_mandir}/man5/ext_sensors.*
 %{_mandir}/man5/gres.*
+%{_mandir}/man5/knl.*
 %{_mandir}/man5/nonstop.*
 %{_mandir}/man5/slurm.*
 %{_mandir}/man5/topology.*
@@ -819,8 +830,9 @@ rm -rf $RPM_BUILD_ROOT
 %config %{_sysconfdir}/cgroup/release_freezer
 %config %{_sysconfdir}/cgroup/release_cpuset
 %config %{_sysconfdir}/cgroup/release_memory
-%config %{_sysconfdir}/layouts.d.power.conf.example
-%config %{_sysconfdir}/layouts.d.power_cpufreq.conf.example
+%config %{_sysconfdir}/layouts.d/power.conf.example
+%config %{_sysconfdir}/layouts.d/power_cpufreq.conf.example
+%config %{_sysconfdir}/layouts.d/unit.conf.example
 %config %{_sysconfdir}/slurm.conf.example
 %config %{_sysconfdir}/slurm.epilog.clean
 %exclude %{_mandir}/man1/sjobexit*
@@ -831,13 +843,11 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 #############################################################################
 
-%files -f devel.files devel
+%files devel
 %defattr(-,root,root)
 %dir %attr(0755,root,root)
 %dir %{_prefix}/include/slurm
 %{_prefix}/include/slurm/*
-%{_libdir}/libslurm.la
-%{_libdir}/libslurmdb.la
 %{_mandir}/man3/slurm_*
 %dir %{_libdir}/pkgconfig
 %{_libdir}/pkgconfig/slurm.pc
@@ -859,13 +869,6 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 #############################################################################
 
-%if %{slurm_with authd}
-%defattr(-,root,root)
-%files auth-authd
-%{_libdir}/slurm/auth_authd.so
-%endif
-#############################################################################
-
 %if %{slurm_with bluegene}
 %files -f bluegene.files bluegene
 %defattr(-,root,root)
@@ -940,6 +943,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/slurm/layouts_power_cpufreq.so
 %{_libdir}/slurm/layouts_power_default.so
 %{_libdir}/slurm/layouts_unit_default.so
+%{_libdir}/slurm/mcs_group.so
+%{_libdir}/slurm/mcs_none.so
+%{_libdir}/slurm/mcs_user.so
 %if ! %{slurm_with bluegene}
 %{_libdir}/slurm/mpi_lam.so
 %{_libdir}/slurm/mpi_mpich1_p4.so
@@ -950,6 +956,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/slurm/mpi_pmi2.so
 %endif
 %{_libdir}/slurm/mpi_none.so
+%if %{slurm_with pmix}
+%{_libdir}/slurm/mpi_pmix.so
+%endif
 %{_libdir}/slurm/power_none.so
 %{_libdir}/slurm/preempt_job_prio.so
 %{_libdir}/slurm/preempt_none.so
@@ -998,6 +1007,15 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/slurm/spank_pbs.so
 #############################################################################
 
+%files openlava
+%defattr(-,root,root)
+%{_bindir}/bjobs
+%{_bindir}/bkill
+%{_bindir}/bsub
+%{_bindir}/lsid
+
+#############################################################################
+
 %files sjobexit
 %defattr(-,root,root)
 %{_bindir}/sjobexitmod
@@ -1039,6 +1057,12 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 #############################################################################
 
+%files seff
+%defattr(-,root,root)
+%{_bindir}/seff
+%{_bindir}/smail
+#############################################################################
+
 %files sjstat
 %defattr(-,root,root)
 %{_bindir}/sjstat
diff --git a/slurm/slurm.h.in b/slurm/slurm.h.in
index 77b978164..f5ef5ee1c 100644
--- a/slurm/slurm.h.in
+++ b/slurm/slurm.h.in
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2015 SchedMD LLC <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD LLC <http://www.schedmd.com>.
  *  Portions Copyright (C) 2012-2013 Los Alamos National Security, LLC.
  *  Portions Copyright 2013 Cray Inc. All Rights Reserved.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -43,31 +43,6 @@
 #ifndef _SLURM_H
 #define _SLURM_H
 
-/* BEGIN_C_DECLS should be used at the beginning of your declarations,
-   so that C++ compilers don't mangle their names.  Use END_C_DECLS at
-   the end of C declarations. */
-#undef BEGIN_C_DECLS
-#undef END_C_DECLS
-#ifdef __cplusplus
-# define BEGIN_C_DECLS	extern "C" {
-# define END_C_DECLS	}
-#else
-# define BEGIN_C_DECLS	/* empty */
-# define END_C_DECLS	/* empty */
-#endif
-
-/* PARAMS is a macro used to wrap function prototypes, so that compilers
-   that don't understand ANSI C prototypes still work, and ANSI C
-   compilers can issue warnings about type mismatches.  */
-#undef PARAMS
-#if defined (__STDC__) || defined (_AIX)			\
-	|| (defined (__mips) && defined (_SYSTYPE_SVR4))	\
-	|| defined(WIN32) || defined(__cplusplus)
-# define PARAMS(protos)	protos
-#else
-# define PARAMS(protos)	()
-#endif
-
 /* Define to 1 if you have Blue Gene system support. */
 #undef HAVE_BG
 
@@ -87,9 +62,6 @@
 #define SYSTEM_DIMENSIONS 1
 #define HIGHEST_DIMENSIONS 5
 
-/* Define to 1 if you have the `elan3' library (-lelan3). */
-#undef HAVE_ELAN
-
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
@@ -98,7 +70,9 @@
 #define DEFAULT_WAIT_ALL_NODES 0	/* don't wait */
 #endif
 
-BEGIN_C_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include <slurm/slurm_errno.h>
 
@@ -114,29 +88,6 @@ BEGIN_C_DECLS
 #include <time.h>		/* for time_t definitions */
 #include <unistd.h>
 
-#ifdef CRAPPY_COMPILER
-/*
- * 'bool' can be implemented in a variety of ways.
- * C++ may define it one way.
- * <stdbool.h> may declare 'bool' to be a different type, such as
- * an enum which is not necessarily compatible with C++.
- *
- * If your compiler can't resolve 'bool', just define
- * CRAPPY_COMPILER at build time in order for SLURM to
- * define it's own version of bool.
- */
-
-#undef  TRUE
-#define TRUE   1
-
-#undef  FALSE
-#define FALSE  0
-
-typedef unsigned char SLURM_BOOL;
-#undef  bool
-#define bool SLURM_BOOL
-#endif
-
 /* Define slurm_addr_t below to avoid including extraneous slurm headers */
 #ifdef	HAVE_SYS_SOCKET_H
 #  ifndef __slurm_addr_t_defined
@@ -224,7 +175,7 @@ typedef struct sbcast_cred sbcast_cred_t;		/* opaque data type */
 #define	INFINITE64 (0xffffffffffffffff)
 #define NO_VAL	   (0xfffffffe)
 #define NO_VAL64   (0xfffffffffffffffe)
-#define MAX_TASKS_PER_NODE 128
+#define MAX_TASKS_PER_NODE 512
 
 /* Job step ID of batch scripts */
 #define SLURM_BATCH_SCRIPT (0xfffffffe)
@@ -274,6 +225,7 @@ enum job_states {
 	JOB_NODE_FAIL,		/* terminated on node failure */
 	JOB_PREEMPTED,		/* terminated due to preemption */
 	JOB_BOOT_FAIL,		/* terminated due to node boot failure */
+	JOB_DEADLINE,		/* terminated on deadline */
 	JOB_END			/* not a real state, last entry in table */
 };
 #define	JOB_STATE_BASE	  0x000000ff	/* Used for job_states above */
@@ -307,8 +259,9 @@ enum job_states {
 #define MAIL_JOB_TIME50    0x0080	/* Notify on reaching 50% of time limit */
 #define MAIL_JOB_STAGE_OUT 0x0100	/* Notify on completion of burst buffer
 					 * stage out */
+#define MAIL_ARRAY_TASKS   0x0200	/* Send emails for each array task */
 
-#define NICE_OFFSET 10000	/* offset for job's nice value */
+#define NICE_OFFSET 0x80000000		/* offset for job's nice value */
 
 /* Reason for job to be pending rather than executing or reason for job
  * failure. If multiple reasons exists, only one is given for the sake of
@@ -534,8 +487,21 @@ enum job_state_reason {
 				    * (burst buffer) */
 	WAIT_QOS_MAX_BB_MINS_PER_JOB,/* QOS MaxTRESMinsPerJob exceeded
 				      * (burst buffer) */
-	WAIT_QOS_MIN_BB            /* QOS MinTRESPerJob not reached
+	WAIT_QOS_MIN_BB,           /* QOS MinTRESPerJob not reached
 				    * (burst buffer) */
+	FAIL_DEADLINE,              /* reached deadline */
+	/* QOS MaxTRESPerAccount */
+	WAIT_QOS_MAX_BB_PER_ACCT,     /* exceeded burst buffer */
+	WAIT_QOS_MAX_CPU_PER_ACCT,    /* exceeded CPUs */
+	WAIT_QOS_MAX_ENERGY_PER_ACCT, /* exceeded Energy */
+	WAIT_QOS_MAX_GRES_PER_ACCT,   /* exceeded GRES */
+	WAIT_QOS_MAX_NODE_PER_ACCT,   /* exceeded Nodes */
+	WAIT_QOS_MAX_LIC_PER_ACCT,    /* exceeded Licenses */
+	WAIT_QOS_MAX_MEM_PER_ACCT,    /* exceeded Memory */
+	WAIT_QOS_MAX_UNK_PER_ACCT,    /* exceeded Unknown */
+	/********************/
+	WAIT_QOS_MAX_JOB_PER_ACCT,    /* QOS MaxJobPerAccount exceeded */
+	WAIT_QOS_MAX_SUB_JOB_PER_ACCT,/* QOS MaxJobSubmitSPerAccount exceeded */
 };
 
 enum job_acct_types {
@@ -555,6 +521,12 @@ enum job_acct_types {
 #define PARTITION_DRAIN		(PARTITION_SCHED)
 #define PARTITION_INACTIVE	0x00
 
+/* Partition enforce flags for jobs */
+#define PARTITION_ENFORCE_NONE 0
+#define PARTITION_ENFORCE_ALL  1 /* job limit must be valid for ALL
+				  * partitions */
+#define PARTITION_ENFORCE_ANY  2 /* job limit must be valid for ANY
+				  * partition */
 enum connection_type {
 	SELECT_MESH, 		/* nodes wired in mesh */
 	SELECT_TORUS, 		/* nodes wired in torus */
@@ -572,6 +544,19 @@ enum node_use_type {
 	SELECT_NAV_MODE		/* either mode is acceptable */
 };
 
+/* Select plugin (id) in use by cluster */
+enum select_plugin_type {
+	SELECT_PLUGIN_BLUEGENE      = 100, /* Bluegene all variants */
+	SELECT_PLUGIN_CONS_RES      = 101, /* Cons Res on a normal system */
+	SELECT_PLUGIN_LINEAR        = 102, /* Linear on a normal system */
+	/* 103 unused */
+	SELECT_PLUGIN_ALPS          = 104, /* Alps using Linear (only option) */
+	/* 105 unused (originally was for ALPS cons_res which won't happen) */
+	SELECT_PLUGIN_SERIAL        = 106, /* Serial */
+	SELECT_PLUGIN_CRAY_LINEAR   = 107, /* Linear on a Native Cray */
+	SELECT_PLUGIN_CRAY_CONS_RES = 108  /* Cons Res on a Native Cray */
+};
+
 enum select_jobdata_type {
 	SELECT_JOBDATA_GEOMETRY,/* data-> uint16_t geometry[SYSTEM_DIMENSIONS] */
 	SELECT_JOBDATA_ROTATE,	/* data-> uint16_t rotate */
@@ -1003,14 +988,14 @@ enum ctx_keys {
 						 * pending jobs. */
 #define PRIORITY_FLAGS_FAIR_TREE	0x0020	/* Prioritize by level in
 						 * account hierarchy. */
-/* These bits are set in the bit_flags field of job_desc_msg_t and are used
- * by the slurmctld. The first two bits indicate if job should be canceled
- * if it has invalid dependency or should stay pending indefinitely.
- */
-#define KILL_INV_DEP       0x00000001
-#define NO_KILL_INV_DEP    0x00000002
-#define HAS_STATE_DIR      0x00000004
+
+/* These bits are set in the flags field of job_desc_msg_t */
+#define KILL_INV_DEP       0x00000001	/* Kill job on invalid dependency */
+#define NO_KILL_INV_DEP    0x00000002	/* Don't kill job on invalid dependency */
+#define HAS_STATE_DIR      0x00000004	/* Used by slurmctld to track state dir */
 #define BACKFILL_TEST      0x00000008	/* Backfill test in progress */
+#define GRES_ENFORCE_BIND  0x00000010	/* Enforce CPU/GRES binding */
+#define TEST_NOW_ONLY      0x00000020	/* Test for immediately start only */
 
 /*****************************************************************************\
  *      SLURM HOSTLIST FUNCTIONS
@@ -1058,20 +1043,20 @@ typedef struct hostlist * hostlist_t;
  * The returned hostlist must be freed with hostlist_destroy()
  *
  */
-extern hostlist_t slurm_hostlist_create PARAMS((const char *hostlist));
+extern hostlist_t slurm_hostlist_create(const char *hostlist);
 
 /* slurm_hostlist_count():
  *
  * Return the number of hosts in hostlist hl.
  */
-extern int slurm_hostlist_count PARAMS((hostlist_t hl));
+extern int slurm_hostlist_count(hostlist_t hl);
 
 /*
  * slurm_hostlist_destroy():
  *
  * Destroy a hostlist object. Frees all memory allocated to the hostlist.
  */
-extern void slurm_hostlist_destroy PARAMS((hostlist_t hl));
+extern void slurm_hostlist_destroy(hostlist_t hl);
 
 /* slurm_hostlist_find():
  *
@@ -1079,9 +1064,8 @@ extern void slurm_hostlist_destroy PARAMS((hostlist_t hl));
  * and returns position in list if found.
  *
  * Returns -1 if host is not found.
- *
  */
-extern int slurm_hostlist_find PARAMS((hostlist_t hl, const char *hostname));
+extern int slurm_hostlist_find(hostlist_t hl, const char *hostname);
 
 /* slurm_hostlist_push():
  *
@@ -1092,7 +1076,7 @@ extern int slurm_hostlist_find PARAMS((hostlist_t hl, const char *hostname));
  * Returns the number of hostnames inserted into the list,
  * or 0 on failure.
  */
-extern int slurm_hostlist_push PARAMS((hostlist_t hl, const char *hosts));
+extern int slurm_hostlist_push(hostlist_t hl, const char *hosts);
 
 /* slurm_hostlist_push_host():
  *
@@ -1102,7 +1086,7 @@ extern int slurm_hostlist_push PARAMS((hostlist_t hl, const char *hosts));
  *
  * return value is 1 for success, 0 for failure.
  */
-extern int slurm_hostlist_push_host PARAMS((hostlist_t hl, const char *host));
+extern int slurm_hostlist_push_host(hostlist_t hl, const char *host);
 
 /* slurm_hostlist_ranged_string():
  *
@@ -1115,8 +1099,7 @@ extern int slurm_hostlist_push_host PARAMS((hostlist_t hl, const char *host));
  * slurm_hostlist_ranged_string() will write a bracketed hostlist representation
  * where possible.
  */
-extern ssize_t slurm_hostlist_ranged_string PARAMS((hostlist_t hl,
-						    size_t n, char *buf));
+extern ssize_t slurm_hostlist_ranged_string(hostlist_t hl, size_t n, char *buf);
 
 /* slurm_hostlist_ranged_string_malloc():
  *
@@ -1124,7 +1107,7 @@ extern ssize_t slurm_hostlist_ranged_string PARAMS((hostlist_t hl,
  *
  * The result must be released using free();
  */
-extern char *slurm_hostlist_ranged_string_malloc PARAMS((hostlist_t hl));
+extern char *slurm_hostlist_ranged_string_malloc(hostlist_t hl);
 
 /* hostlist_ranged_string_xmalloc():
  *
@@ -1134,7 +1117,7 @@ extern char *slurm_hostlist_ranged_string_malloc PARAMS((hostlist_t hl));
  *
  * Caller should free the result string using xfree().
  */
-extern char *slurm_hostlist_ranged_string_xmalloc PARAMS((hostlist_t hl));
+extern char *slurm_hostlist_ranged_string_xmalloc(hostlist_t hl);
 
 /*
  * slurm_hostlist_shift():
@@ -1145,14 +1128,14 @@ extern char *slurm_hostlist_ranged_string_xmalloc PARAMS((hostlist_t hl));
  *
  * Note: Caller is responsible for freeing the returned memory.
  */
-extern char * slurm_hostlist_shift PARAMS((hostlist_t hl));
+extern char *slurm_hostlist_shift(hostlist_t hl);
 
 /* slurm_hostlist_uniq():
  *
  * Sort the hostlist hl and remove duplicate entries.
  *
  */
-extern void slurm_hostlist_uniq PARAMS((hostlist_t hl));
+extern void slurm_hostlist_uniq(hostlist_t hl);
 
 /*****************************************************************************\
  *      SLURM LIST FUNCTIONS
@@ -1202,13 +1185,13 @@ typedef int (*ListForF) (void *x, void *arg);
  *  Inserts data [x] at the end of list [l].
  *  Returns the data's ptr, or lsd_nomem_error() if insertion failed.
  */
-extern void * slurm_list_append PARAMS((List l, void *x));
+extern void *slurm_list_append(List l, void *x);
 
 /* slurm_list_count():
  *
  *  Returns the number of items in list [l].
  */
-extern int slurm_list_count PARAMS((List l));
+extern int slurm_list_count(List l);
 
 /* slurm_list_create():
  *
@@ -1219,7 +1202,7 @@ extern int slurm_list_count PARAMS((List l));
  *  Note: Abandoning a list without calling slurm_list_destroy() will result
  *    in a memory leak.
  */
-extern List slurm_list_create PARAMS((ListDelF f));
+extern List slurm_list_create(ListDelF f);
 
 /* slurm_list_destroy():
  *
@@ -1227,7 +1210,7 @@ extern List slurm_list_create PARAMS((ListDelF f));
  *    list itself; if a deletion function was specified when the list
  *    was created, it will be called for each item in the list.
  */
-extern void slurm_list_destroy PARAMS((List l));
+extern void slurm_list_destroy(List l);
 
 /* slurm_list_find():
  *
@@ -1238,33 +1221,33 @@ extern void slurm_list_destroy PARAMS((List l));
  *  Example: i=slurm_list_iterator_reset(i);
  *	     while ((x=slurm_list_find(i,f,k))) {...}
  */
-extern void * slurm_list_find PARAMS((ListIterator i, ListFindF f, void *key));
+extern void *slurm_list_find(ListIterator i, ListFindF f, void *key);
 
 /* slurm_list_is_empty():
  *
  *  Returns non-zero if list [l] is empty; o/w returns zero.
  */
-extern int slurm_list_is_empty PARAMS((List l));
+extern int slurm_list_is_empty(List l);
 
 /*
  *  Creates and returns a list iterator for non-destructively traversing
  *    list [l], or lsd_nomem_error() on failure.
  */
-extern ListIterator slurm_list_iterator_create PARAMS((List l));
+extern ListIterator slurm_list_iterator_create(List l);
 
 /* slurm_list_iterator_reset():
  *
  *  Resets the list iterator [i] to start traversal at the beginning
  *    of the list.
  */
-extern void slurm_list_iterator_reset PARAMS((ListIterator i));
+extern void slurm_list_iterator_reset(ListIterator i);
 
 /*
  *  Destroys the list iterator [i]; list iterators not explicitly destroyed
  *    in this manner will be destroyed when the list is deallocated via
  *    list_destroy().
  */
-extern void slurm_list_iterator_destroy PARAMS((ListIterator i));
+extern void slurm_list_iterator_destroy(ListIterator i);
 
 /* slurm_list_next():
  *
@@ -1273,7 +1256,7 @@ extern void slurm_list_iterator_destroy PARAMS((ListIterator i));
  *  Example: i=slurm_list_iterator_create(i);
  *	     while ((x=slurm_list_next(i))) {...}
  */
-extern void * slurm_list_next PARAMS((ListIterator i));
+extern void *slurm_list_next(ListIterator i);
 
 /* slurm_list_sort():
  *
@@ -1281,14 +1264,14 @@ extern void * slurm_list_next PARAMS((ListIterator i));
  *  Note: Sorting a list resets all iterators associated with the list.
  *  Note: The sort algorithm is stable.
  */
-extern void slurm_list_sort PARAMS((List l, ListCmpF f));
+extern void slurm_list_sort(List l, ListCmpF f);
 
 /* slurm_list_pop():
  *
  *  Pops the data item at the top of the stack [l].
  *  Returns the data's ptr, or NULL if the stack is empty.
  */
-extern void * slurm_list_pop PARAMS((List l));
+extern void *slurm_list_pop(List l);
 
 /*****************************************************************************\
  *      SLURM BITSTR FUNCTIONS
@@ -1312,6 +1295,11 @@ typedef bitstr_t bitoff_t;
 #define ALLOC_SID_ADMIN_HOLD	0x00000001	/* admin job hold */
 #define ALLOC_SID_USER_HOLD	0x00000002	/* user job hold */
 
+#define JOB_SHARED_NONE         0x0000
+#define JOB_SHARED_OK           0x0001
+#define JOB_SHARED_USER         0x0002
+#define JOB_SHARED_MCS          0x0003
+
 #define SLURM_POWER_FLAGS_LEVEL 0x0001		/* Equal power cap on all nodes */
 
 /*****************************************************************************\
@@ -1391,6 +1379,7 @@ typedef struct job_descriptor {	/* For submit, allocate, and update requests */
 	uint32_t cpu_freq_min;  /* Minimum cpu frequency  */
 	uint32_t cpu_freq_max;  /* Maximum cpu frequency  */
 	uint32_t cpu_freq_gov;  /* cpu frequency governor */
+	time_t deadline;	/* deadline */
 	char *dependency;	/* synchronize job execution with other jobs */
 	time_t end_time;	/* time by which job must complete, used for
 				 * job update only now, possible deadline
@@ -1400,7 +1389,7 @@ typedef struct job_descriptor {	/* For submit, allocate, and update requests */
 	uint32_t env_size;	/* element count in environment */
 	char *exc_nodes;	/* comma separated list of nodes excluded
 				 * from job's allocation, default NONE */
-	char *features;		/* comma separated list of required features,
+	char *features;		/* required feature specification,
 				 * default NONE */
 	char *gres;		/* comma separated list of required generic
 				 * resources, default NONE */
@@ -1414,11 +1403,12 @@ typedef struct job_descriptor {	/* For submit, allocate, and update requests */
 	char *licenses;		/* licenses required by the job */
 	uint16_t mail_type;	/* see MAIL_JOB_ definitions above */
 	char *mail_user;	/* user to receive notification */
+	char *mcs_label;	/* mcs_label if mcs plugin in use */
 	char *mem_bind;		/* binding map for map/mask_cpu */
 	uint16_t mem_bind_type;	/* see mem_bind_type_t */
 	char *name;		/* name of the job, default "" */
 	char *network;		/* network use spec */
-	uint16_t nice;		/* requested priority change,
+	uint32_t nice;		/* requested priority change,
 				 * NICE_OFFSET == no change */
 	uint32_t num_tasks;	/* number of tasks to be started,
 				 * for batch only */
@@ -1450,7 +1440,6 @@ typedef struct job_descriptor {	/* For submit, allocate, and update requests */
 				 * 0 if job needs exclusive access to the node,
 				 * or NO_VAL to accept the system default.
 				 * SHARED_FORCE to eliminate user control. */
-	uint8_t sicp_mode;	/* set for inter-cluster jobs */
 	char **spank_job_env;	/* environment variables for job prolog/epilog
 				 * scripts as set by SPANK plugins */
 	uint32_t spank_job_env_size; /* element count in spank_env */
@@ -1554,6 +1543,7 @@ typedef struct job_info {
 	uint32_t cpu_freq_min;  /* Minimum cpu frequency  */
 	uint32_t cpu_freq_max;  /* Maximum cpu frequency  */
 	uint32_t cpu_freq_gov;  /* cpu frequency governor */
+	time_t deadline;	/* deadline */
 	char *dependency;	/* synchronize job execution with other jobs */
 	uint32_t derived_ec;	/* highest exit code of all job steps */
 	time_t eligible_time;	/* time job is eligible for running */
@@ -1572,10 +1562,11 @@ typedef struct job_info {
 	char *licenses;		/* licenses required by the job */
 	uint32_t max_cpus;	/* maximum number of cpus usable by job */
 	uint32_t max_nodes;	/* maximum number of nodes usable by job */
+	char *mcs_label;	/* mcs_label if mcs plugin in use */
 	char *name;		/* name of the job */
 	char *network;		/* network specification */
 	char *nodes;		/* list of nodes allocated to job */
-	uint16_t nice;	  	/* requested priority change */
+	uint32_t nice;	  	/* requested priority change */
 	int32_t *node_inx;	/* list index pairs into node_table for *nodes:
 				 * start_range_1, end_range_1,
 				 * start_range_2, .., -1  */
@@ -1583,9 +1574,9 @@ typedef struct job_info {
 	uint16_t ntasks_per_node;/* number of tasks to invoke on each node */
 	uint16_t ntasks_per_socket;/* number of tasks to invoke on each socket*/
 	uint16_t ntasks_per_board; /* number of tasks to invoke on each board */
-
-	uint32_t num_nodes;	/* minimum number of nodes required by job */
 	uint32_t num_cpus;	/* minimum number of cpus required by job */
+	uint32_t num_nodes;	/* minimum number of nodes required by job */
+	uint32_t num_tasks;	/* requested task count */
 	char *partition;	/* name of assigned partition */
 	uint32_t pn_min_memory; /* minimum real memory per node, default=0 */
 	uint16_t pn_min_cpus;   /* minimum # CPUs per node, default=0 */
@@ -1615,10 +1606,12 @@ typedef struct job_info {
 						*/
 	uint16_t shared;	/* 1 if job can share nodes with other jobs */
 	uint16_t show_flags;	/* conveys level of details requested */
-	uint8_t sicp_mode;	/* set for inter-cluster jobs */
 	uint16_t sockets_per_board;/* sockets per board required by job */
 	uint16_t sockets_per_node; /* sockets per node required by job  */
 	time_t start_time;	/* time execution begins, actual or expected */
+	uint16_t start_protocol_ver; /* Slurm version step was started with
+				      *	either srun or the lowest slurmd version
+				      *	it is talking to */
 	char *state_desc;	/* optional details for state_reason */
 	uint16_t state_reason;	/* reason job still pending or failed, see
 				 * slurm.h:enum job_state_reason */
@@ -1656,16 +1649,6 @@ typedef struct job_info_msg {
 	slurm_job_info_t *job_array;	/* the job records */
 } job_info_msg_t;
 
-typedef struct sicp_info {
-	uint32_t job_id;
-	uint32_t job_state;
-} sicp_info_t;
-
-typedef struct sicp_info_msg {
-	uint32_t record_count;		/* number of records */
-	sicp_info_t *sicp_array;	/* inter-cluster job records */
-} sicp_info_msg_t;
-
 typedef struct step_update_request_msg {
 	time_t end_time;	/* step end time */
 	uint32_t exit_code;	/* exit code for job (status from wait call) */
@@ -1685,6 +1668,9 @@ typedef struct slurm_step_layout {
 	char *node_list;        /* list of nodes in step */
 	uint16_t plane_size;	/* plane size when task_dist =
 				 * SLURM_DIST_PLANE */
+	uint16_t start_protocol_ver; /* Slurm version step was started with
+				      *	either srun or the lowest slurmd version
+				      *	it is talking to */
 	/* Array of length "node_cnt". Each element of the array
 	 * is the number of tasks assigned to the corresponding node */
 	uint16_t *tasks;
@@ -1770,6 +1756,13 @@ typedef struct suspend_msg {
 	char *   job_id_str;	/* slurm job ID (string) */
 } suspend_msg_t;
 
+/* NOTE: Set either job_id_str (NULL by default) or job_id */
+typedef struct top_job_msg {
+	uint16_t op;		/* suspend operation, see enum suspend_opts */
+	uint32_t job_id;	/* slurm job ID (number) */
+	char *   job_id_str;	/* slurm job ID (string) */
+} top_job_msg_t;
+
 typedef struct {
 	uint16_t ckpt_interval;	/* checkpoint interval in minutes */
 	uint32_t cpu_count;	/* number of required processors */
@@ -1821,6 +1814,10 @@ typedef struct {
 	char *cwd;
 	bool user_managed_io;
 	uint32_t msg_timeout; /* timeout set for sending message */
+	uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
+	uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
+	uint16_t ntasks_per_socket;/* number of tasks to invoke on
+				    * each socket */
 
 	/* START - only used if user_managed_io is false */
 	bool buffered_stdio;
@@ -1917,6 +1914,9 @@ typedef struct {
 						* slurm_get_select_jobinfo()
 						*/
 	time_t start_time;	/* step start time */
+	uint16_t start_protocol_ver; /* Slurm version step was started with
+				      *	either srun or the lowest slurmd version
+				      *	it is talking to */
 	uint32_t state;		/* state of the step, see enum job_states */
 	uint32_t step_id;	/* step ID */
 	uint32_t task_dist;	/* see enum task_dist_state */
@@ -1970,10 +1970,13 @@ typedef struct node_info {
 	acct_gather_energy_t *energy;	 /* energy data */
 	ext_sensors_data_t *ext_sensors; /* external sensor data */
 	power_mgmt_data_t *power;        /* power management data */
-	char *features;		/* list of a node's features */
+	char *features;		/* list of a node's available features */
+	char *features_act;	/* list of a node's current acitve features,
+				 * Same as "features" if NULL */
 	char *gres;		/* list of a node's generic resources */
 	char *gres_drain;	/* list of drained GRES */
 	char *gres_used;	/* list of GRES in current use */
+	char *mcs_label;	/* mcs label if mcs plugin in use */
 	uint32_t mem_spec_limit; /* MB memory limit for specialization */
 	char *name;		/* node name to slurm */
 	char *node_addr;	/* communication name (optional) */
@@ -2146,7 +2149,8 @@ typedef struct partition_info {
 				 * start_range_2, .., -1  */
 	char *nodes;		/* list names of nodes in partition */
 	uint16_t preempt_mode;	/* See PREEMPT_MODE_* in slurm/slurm.h */
-	uint16_t priority;	/* scheduling priority for jobs */
+	uint16_t priority_job_factor;	/* job priority weight factor */
+	uint16_t priority_tier;	/* tier for scheduling and preemption */
 	char *qos_char;	        /* The partition QOS name */
 	uint16_t state_up;	/* see PARTITION_ states above */
 	uint32_t total_cpus;	/* total number of cpus in the partition */
@@ -2173,6 +2177,10 @@ typedef struct resource_allocation_response_msg {
 	uint32_t error_code;	/* error code for warning message */
 	uint32_t node_cnt;	/* count of nodes */
 	char *node_list;	/* assigned list of nodes */
+	uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
+	uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
+	uint16_t ntasks_per_socket;/* number of tasks to invoke on
+				    * each socket */
 	uint32_t num_cpu_groups;/* elements in below cpu arrays */
 	char *partition;	/* name of partition used to run job */
 	uint32_t pn_min_memory;  /* minimum real memory per node OR
@@ -2270,8 +2278,9 @@ typedef block_info_t update_block_msg_t;
  * IN info_ptr - block information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_block_info_msg PARAMS(
-	(FILE *out, block_info_msg_t *info_ptr, int one_liner));
+extern void slurm_print_block_info_msg(FILE *out,
+				       block_info_msg_t *info_ptr,
+				       int one_liner);
 
 /*
  * slurm_print_block_info - output information about a specific Bluegene
@@ -2280,8 +2289,9 @@ extern void slurm_print_block_info_msg PARAMS(
  * IN bg_info_ptr - an individual block information record pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_block_info PARAMS(
-	(FILE *out, block_info_t *bg_info_ptr, int one_liner));
+extern void slurm_print_block_info(FILE *out,
+				   block_info_t *bg_info_ptr,
+				   int one_liner);
 
 /*
  * slurm_sprint_block_info - output information about a specific Bluegene
@@ -2291,8 +2301,7 @@ extern void slurm_print_block_info PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_block_info PARAMS(
-	(block_info_t * bg_info_ptr, int one_liner));
+extern char *slurm_sprint_block_info(block_info_t *bg_info_ptr, int one_liner);
 
 /*
  * slurm_load_block_info - issue RPC to get slurm all node select plugin
@@ -2304,9 +2313,9 @@ extern char *slurm_sprint_block_info PARAMS(
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_block_info_msg
  */
-extern int slurm_load_block_info PARAMS(
-	(time_t update_time, block_info_msg_t **block_info_msg_pptr,
-	 uint16_t show_flags));
+extern int slurm_load_block_info(time_t update_time,
+				 block_info_msg_t **block_info_msg_pptr,
+				 uint16_t show_flags);
 
 /*
  * slurm_free_block_info_msg - free buffer returned by
@@ -2314,13 +2323,12 @@ extern int slurm_load_block_info PARAMS(
  * IN block_info_msg_ptr - pointer to block_info_msg_t
  * RET 0 or a slurm error code
  */
-extern void slurm_free_block_info_msg PARAMS(
-	(block_info_msg_t *block_info_msg));
+extern void slurm_free_block_info_msg(block_info_msg_t *block_info_msg);
 
 /* update state or remove block */
-extern int slurm_update_block PARAMS((update_block_msg_t *block_msg));
+extern int slurm_update_block(update_block_msg_t *block_msg);
 
-void slurm_init_update_block_msg PARAMS((update_block_msg_t *update_block_msg));
+void slurm_init_update_block_msg(update_block_msg_t *update_block_msg);
 
 /*********************************/
 
@@ -2360,6 +2368,8 @@ void slurm_init_update_block_msg PARAMS((update_block_msg_t *update_block_msg));
 							 * as assigned to jobs */
 #define RESERVE_FLAG_ALL_NODES		0x00080000	/* Use all compute
 							 * nodes */
+#define RESERVE_FLAG_PURGE_COMP		0x00100000	/* Purge reservation
+							 * after last job done */
 
 typedef struct reserve_info {
 	char *accounts;		/* names of accounts permitted to use */
@@ -2479,16 +2489,16 @@ typedef struct reservation_name_msg {
 #define DEBUG_FLAG_BURST_BUF    0x0000010000000000 /* Burst buffer plugin */
 #define DEBUG_FLAG_CPU_FREQ     0x0000020000000000 /* --cpu_freq debug */
 #define DEBUG_FLAG_POWER        0x0000040000000000 /* Power plugin debug */
-#define DEBUG_FLAG_SICP		0x0000080000000000 /* Slurm Inter-Cluster */
+#define DEBUG_FLAG_TIME_CRAY    0x0000080000000000 /* Time Cray components */
 #define DEBUG_FLAG_DB_ARCHIVE	0x0000100000000000 /* DBD Archiving/Purging */
 #define DEBUG_FLAG_DB_TRES      0x0000200000000000 /* Database TRES debug */
 #define DEBUG_FLAG_ESEARCH      0x0000400000000000 /* Elasticsearch debug */
+#define DEBUG_FLAG_NODE_FEATURES 0x0000800000000000 /* Node Features debug */
 
 #define GROUP_FORCE		0x8000	/* if set, update group membership
 					 * info even if no updates to
 					 * /etc/group file */
-#define GROUP_CACHE		0x4000	/* if set, cache /etc/groups to avoid
-					 * initgroups(2) */
+#define GROUP_CACHE		0x4000	/* UNUSED, kept for backwards compatibility. */
 #define GROUP_TIME_MASK		0x0fff	/* group membership update interval
 					 * in seconds */
 
@@ -2628,6 +2638,8 @@ typedef struct slurm_ctl_conf {
 	uint32_t max_mem_per_cpu; /* maximum MB memory per allocated CPU */
 	uint32_t max_step_cnt;	/* maximum number of steps per job */
 	uint16_t max_tasks_per_node; /* maximum tasks per node */
+	char *mcs_plugin; /* mcs plugin type */
+	char *mcs_plugin_params; /* mcs plugin parameters */
 	uint16_t mem_limit_enforce; /* Enforce mem limit at runtime y|n */
 	uint32_t min_job_age;	/* COMPLETED jobs over this age (secs)
 				 * purged from in memory records */
@@ -2635,7 +2647,9 @@ typedef struct slurm_ctl_conf {
 	char *mpi_params;	/* MPI parameters */
 	char *msg_aggr_params;  /* Message aggregation parameters */
 	uint16_t msg_timeout;	/* message timeout */
+	uint16_t tcp_timeout;	/* tcp timeout */
 	uint32_t next_job_id;	/* next slurm generated job_id to assign */
+	char *node_features_plugins; /* List of node_features plugins to use */
 	char *node_prefix;      /* prefix of nodes in partition, only set in
 				   bluegene clusters NULL otherwise */
 	uint16_t over_time_limit; /* job's time limit can be exceeded by this
@@ -2793,7 +2807,8 @@ typedef struct submit_response_msg {
 /* NOTE: If setting node_addr and/or node_hostname then comma separate names
  * and include an equal number of node_names */
 typedef struct slurm_update_node_msg {
-	char *features;		/* new feature for node */
+	char *features;		/* new available feature for node */
+	char *features_act;	/* new active feature for node */
 	char *gres;		/* new generic resources for node */
 	char *node_addr;	/* communication name (optional) */
 	char *node_hostname;	/* node's hostname (optional) */
@@ -2988,7 +3003,7 @@ typedef struct network_callerid_msg {
  *	default values
  * OUT job_desc_msg - user defined job descriptor
  */
-extern void slurm_init_job_desc_msg PARAMS((job_desc_msg_t * job_desc_msg));
+extern void slurm_init_job_desc_msg(job_desc_msg_t *job_desc_msg);
 
 /*
  * slurm_allocate_resources - allocate resources for a job request
@@ -3001,9 +3016,8 @@ extern void slurm_init_job_desc_msg PARAMS((job_desc_msg_t * job_desc_msg));
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  */
-extern int slurm_allocate_resources PARAMS(
-	(job_desc_msg_t * job_desc_msg ,
-	 resource_allocation_response_msg_t ** job_alloc_resp_msg));
+extern int slurm_allocate_resources(job_desc_msg_t *job_desc_msg,
+				    resource_allocation_response_msg_t **job_alloc_resp_msg);
 
 /*
  * slurm_allocate_resources_blocking
@@ -3023,10 +3037,10 @@ extern int slurm_allocate_resources PARAMS(
  *      with no allocation granted)
  * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  */
-extern resource_allocation_response_msg_t *
-slurm_allocate_resources_blocking PARAMS(
-	(const job_desc_msg_t *user_req, time_t timeout,
-	 void (*pending_callback)(uint32_t job_id)));
+extern resource_allocation_response_msg_t *slurm_allocate_resources_blocking(
+	const job_desc_msg_t *user_req,
+	time_t timeout,
+	void (*pending_callback)(uint32_t job_id));
 
 /*
  * slurm_free_resource_allocation_response_msg - free slurm resource
@@ -3034,8 +3048,7 @@ slurm_allocate_resources_blocking PARAMS(
  * IN msg - pointer to allocation response message
  * NOTE: buffer is loaded by slurm_allocate_resources
  */
-extern void slurm_free_resource_allocation_response_msg PARAMS(
-	(resource_allocation_response_msg_t * msg));
+extern void slurm_free_resource_allocation_response_msg(resource_allocation_response_msg_t *msg);
 
 /*
  * slurm_free_job_alloc_info_response_msg - free slurm resource
@@ -3043,8 +3056,7 @@ extern void slurm_free_resource_allocation_response_msg PARAMS(
  * IN msg - pointer to job allocation info response message
  * NOTE: buffer is loaded by slurm_allocation_lookup
  */
-extern void slurm_free_job_alloc_info_response_msg PARAMS(
-	(job_alloc_info_response_msg_t * msg));
+extern void slurm_free_job_alloc_info_response_msg(job_alloc_info_response_msg_t *msg);
 
 /*
  * slurm_allocation_lookup - retrieve info for an existing resource allocation
@@ -3053,8 +3065,8 @@ extern void slurm_free_job_alloc_info_response_msg PARAMS(
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free "info" using slurm_free_job_alloc_info_response_msg
  */
-extern int slurm_allocation_lookup PARAMS(
-	(uint32_t job_id, job_alloc_info_response_msg_t **info));
+extern int slurm_allocation_lookup(uint32_t job_id,
+				   job_alloc_info_response_msg_t **info);
 
 /*
  * slurm_allocation_lookup_lite - retrieve minor info for an existing
@@ -3064,8 +3076,8 @@ extern int slurm_allocation_lookup PARAMS(
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free the response using slurm_free_resource_allocation_response_msg()
  */
-extern int slurm_allocation_lookup_lite PARAMS(
-	(uint32_t job_id, resource_allocation_response_msg_t **info));
+extern int slurm_allocation_lookup_lite(uint32_t job_id,
+					resource_allocation_response_msg_t **info);
 
 /*
  * slurm_read_hostfile - Read a SLURM hostfile specified by "filename".
@@ -3082,7 +3094,7 @@ extern int slurm_allocation_lookup_lite PARAMS(
  *
  * NOTE: Returned string must be freed with free().
  */
-extern char *slurm_read_hostfile PARAMS((char *filename, int n));
+extern char *slurm_read_hostfile(char *filename, int n);
 
 /*
  * slurm_allocation_msg_thr_create - startup a message handler talking
@@ -3092,8 +3104,8 @@ extern char *slurm_read_hostfile PARAMS((char *filename, int n));
  * IN callbacks - callbacks for different types of messages
  * RET allocation_msg_thread_t * or NULL on failure
  */
-extern allocation_msg_thread_t *slurm_allocation_msg_thr_create PARAMS(
-	(uint16_t *port, const slurm_allocation_callbacks_t *callbacks));
+extern allocation_msg_thread_t *slurm_allocation_msg_thr_create(uint16_t *port,
+								const slurm_allocation_callbacks_t *callbacks);
 
 /*
  * slurm_allocation_msg_thr_destroy - shutdown the message handler talking
@@ -3102,8 +3114,8 @@ extern allocation_msg_thread_t *slurm_allocation_msg_thr_create PARAMS(
  * IN msg_thr - allocation_msg_thread_t pointer allocated with
  *              slurm_allocation_msg_thr_create
  */
-extern void slurm_allocation_msg_thr_destroy PARAMS(
-	(allocation_msg_thread_t * msg_thr));
+extern void slurm_allocation_msg_thr_destroy(allocation_msg_thread_t *msg_thr);
+
 /*
  * slurm_submit_batch_job - issue RPC to submit a job for later execution
  * NOTE: free the response using slurm_free_submit_response_response_msg
@@ -3111,9 +3123,8 @@ extern void slurm_allocation_msg_thr_destroy PARAMS(
  * OUT slurm_alloc_msg - response to request
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_submit_batch_job PARAMS(
-	(job_desc_msg_t * job_desc_msg,
-	 submit_response_msg_t ** slurm_alloc_msg));
+extern int slurm_submit_batch_job(job_desc_msg_t *job_desc_msg,
+				  submit_response_msg_t **slurm_alloc_msg);
 
 /*
  * slurm_free_submit_response_response_msg - free slurm
@@ -3121,8 +3132,7 @@ extern int slurm_submit_batch_job PARAMS(
  * IN msg - pointer to job submit response message
  * NOTE: buffer is loaded by slurm_submit_batch_job
  */
-extern void slurm_free_submit_response_response_msg PARAMS(
-	(submit_response_msg_t *msg));
+extern void slurm_free_submit_response_response_msg(submit_response_msg_t *msg);
 
 /*
  * slurm_job_will_run - determine if a job would execute immediately if
@@ -3130,7 +3140,7 @@ extern void slurm_free_submit_response_response_msg PARAMS(
  * IN job_desc_msg - description of resource allocation request
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_job_will_run PARAMS((job_desc_msg_t * job_desc_msg));
+extern int slurm_job_will_run(job_desc_msg_t *job_desc_msg);
 
 /*
  * slurm_job_will_run2 - determine if a job would execute immediately if
@@ -3140,8 +3150,8 @@ extern int slurm_job_will_run PARAMS((job_desc_msg_t * job_desc_msg));
  *      free using slurm_free_will_run_response_msg()
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_job_will_run2 PARAMS((job_desc_msg_t *req,
-				will_run_response_msg_t **will_run_resp));
+extern int slurm_job_will_run2(job_desc_msg_t *req,
+			       will_run_response_msg_t **will_run_resp);
 
 /*
  * slurm_sbcast_lookup - retrieve info for an existing resource allocation
@@ -3152,10 +3162,11 @@ extern int slurm_job_will_run2 PARAMS((job_desc_msg_t *req,
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free the "resp" using slurm_free_sbcast_cred_msg
  */
-extern int slurm_sbcast_lookup PARAMS((uint32_t job_id, uint32_t step_id,
-				       job_sbcast_cred_msg_t **info));
+extern int slurm_sbcast_lookup(uint32_t job_id,
+			       uint32_t step_id,
+			       job_sbcast_cred_msg_t **info);
 
-extern void slurm_free_sbcast_cred_msg PARAMS((job_sbcast_cred_msg_t * msg));
+extern void slurm_free_sbcast_cred_msg(job_sbcast_cred_msg_t *msg);
 
 /* slurm_load_licenses()
  *
@@ -3164,9 +3175,8 @@ extern void slurm_free_sbcast_cred_msg PARAMS((job_sbcast_cred_msg_t * msg));
  * OUT
  *
  */
-extern int slurm_load_licenses PARAMS((time_t, license_info_msg_t **,
-				       uint16_t));
-extern void slurm_free_license_info_msg PARAMS((license_info_msg_t *));
+extern int slurm_load_licenses(time_t, license_info_msg_t **, uint16_t);
+extern void slurm_free_license_info_msg(license_info_msg_t *);
 
 /* get the running assoc_mgr info
  * IN assoc_mgr_info_request_msg_t: request filtering data returned
@@ -3174,13 +3184,11 @@ extern void slurm_free_license_info_msg PARAMS((license_info_msg_t *));
  * assoc_mgr lists, must be freed by slurm_free_assoc_mgr_info_msg
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_load_assoc_mgr_info PARAMS((assoc_mgr_info_request_msg_t *,
-					     assoc_mgr_info_msg_t **));
-extern void slurm_free_assoc_mgr_info_msg PARAMS ((assoc_mgr_info_msg_t *));
-extern void slurm_free_assoc_mgr_info_request_members PARAMS (
-	(assoc_mgr_info_request_msg_t *));
-extern void slurm_free_assoc_mgr_info_request_msg PARAMS (
-	(assoc_mgr_info_request_msg_t *));
+extern int slurm_load_assoc_mgr_info(assoc_mgr_info_request_msg_t *,
+				     assoc_mgr_info_msg_t **);
+extern void slurm_free_assoc_mgr_info_msg(assoc_mgr_info_msg_t *);
+extern void slurm_free_assoc_mgr_info_request_members(assoc_mgr_info_request_msg_t *);
+extern void slurm_free_assoc_mgr_info_request_msg(assoc_mgr_info_request_msg_t *);
 
 
 /*****************************************************************************\
@@ -3203,8 +3211,7 @@ extern void slurm_free_assoc_mgr_info_request_msg PARAMS (
  * IN flags      - see KILL_JOB_* flags above
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_kill_job PARAMS((uint32_t job_id, uint16_t signal,
-				  uint16_t flags));
+extern int slurm_kill_job(uint32_t job_id, uint16_t signal, uint16_t flags);
 
 /*
  * slurm_kill_job_step - send the specified signal to an existing job step
@@ -3213,13 +3220,13 @@ extern int slurm_kill_job PARAMS((uint32_t job_id, uint16_t signal,
  * IN signal  - signal number
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_kill_job_step PARAMS((uint32_t job_id, uint32_t step_id,
-				       uint16_t signal));
+extern int slurm_kill_job_step(uint32_t job_id,
+			       uint32_t step_id,
+			       uint16_t signal);
 /*
  * slurm_kill_job2()
  */
-extern int slurm_kill_job2 PARAMS((const char *job_id, uint16_t signal,
-				   uint16_t flags));
+extern int slurm_kill_job2(const char *job_id, uint16_t signal, uint16_t flags);
 
 /*
  * slurm_signal_job - send the specified signal to all steps of an existing job
@@ -3227,7 +3234,7 @@ extern int slurm_kill_job2 PARAMS((const char *job_id, uint16_t signal,
  * IN signal     - signal number
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_signal_job PARAMS((uint32_t job_id, uint16_t signal));
+extern int slurm_signal_job(uint32_t job_id, uint16_t signal);
 
 /*
  * slurm_signal_job_step - send the specified signal to an existing job step
@@ -3237,8 +3244,9 @@ extern int slurm_signal_job PARAMS((uint32_t job_id, uint16_t signal));
  * IN signal  - signal number
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_signal_job_step PARAMS((uint32_t job_id, uint32_t step_id,
-					 uint32_t signal));
+extern int slurm_signal_job_step(uint32_t job_id,
+				 uint32_t step_id,
+				 uint32_t signal);
 
 
 /*****************************************************************************\
@@ -3251,8 +3259,7 @@ extern int slurm_signal_job_step PARAMS((uint32_t job_id, uint32_t step_id,
  * IN job_return_code - the highest exit code of any task of the job
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_complete_job PARAMS((uint32_t job_id,
-				      uint32_t job_return_code));
+extern int slurm_complete_job(uint32_t job_id, uint32_t job_return_code);
 
 /*
  * slurm_terminate_job_step - terminates a job step by sending a
@@ -3265,7 +3272,7 @@ extern int slurm_complete_job PARAMS((uint32_t job_id,
  *              to terminate a job's batch script
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_terminate_job_step PARAMS((uint32_t job_id, uint32_t step_id));
+extern int slurm_terminate_job_step(uint32_t job_id, uint32_t step_id);
 
 /*****************************************************************************\
  *	SLURM TASK SPAWNING FUNCTIONS
@@ -3278,7 +3285,7 @@ extern int slurm_terminate_job_step PARAMS((uint32_t job_id, uint32_t step_id));
  * IN ptr - pointer to a structure allocated by the user.  The structure will
  *      be initialized.
  */
-extern void slurm_step_ctx_params_t_init PARAMS((slurm_step_ctx_params_t *ptr));
+extern void slurm_step_ctx_params_t_init(slurm_step_ctx_params_t *ptr);
 
 /*
  * slurm_step_ctx_create - Create a job step and its context.
@@ -3286,8 +3293,7 @@ extern void slurm_step_ctx_params_t_init PARAMS((slurm_step_ctx_params_t *ptr));
  * RET the step context or NULL on failure with slurm errno set
  * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  */
-extern slurm_step_ctx_t *slurm_step_ctx_create PARAMS(
-	(const slurm_step_ctx_params_t *step_params));
+extern slurm_step_ctx_t *slurm_step_ctx_create(const slurm_step_ctx_params_t *step_params);
 
 /*
  * slurm_step_ctx_create_timeout - Create a job step and its context.
@@ -3296,9 +3302,8 @@ extern slurm_step_ctx_t *slurm_step_ctx_create PARAMS(
  * RET the step context or NULL on failure with slurm errno set
  * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  */
-extern slurm_step_ctx_t *
-slurm_step_ctx_create_timeout PARAMS(
-	(const slurm_step_ctx_params_t *step_params, int timeout));
+extern slurm_step_ctx_t *slurm_step_ctx_create_timeout(const slurm_step_ctx_params_t *step_params,
+						       int timeout);
 
 /*
  * slurm_step_ctx_create_no_alloc - Create a job step and its context without
@@ -3308,17 +3313,15 @@ slurm_step_ctx_create_timeout PARAMS(
  * RET the step context or NULL on failure with slurm errno set
  * NOTE: Free allocated memory using slurm_step_ctx_destroy.
  */
-extern slurm_step_ctx_t *
-slurm_step_ctx_create_no_alloc PARAMS(
-	(const slurm_step_ctx_params_t *step_params, uint32_t step_id));
+extern slurm_step_ctx_t *slurm_step_ctx_create_no_alloc(const slurm_step_ctx_params_t *step_params,
+							uint32_t step_id);
 
 /*
  * slurm_step_ctx_get - get parameters from a job step context.
  * IN ctx - job step context generated by slurm_step_ctx_create
  * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  */
-extern int slurm_step_ctx_get PARAMS((slurm_step_ctx_t *ctx,
-				      int ctx_key, ...));
+extern int slurm_step_ctx_get(slurm_step_ctx_t *ctx, int ctx_key, ...);
 
 /*
  * slurm_jobinfo_ctx_get - get parameters from jobinfo context.
@@ -3327,8 +3330,9 @@ extern int slurm_step_ctx_get PARAMS((slurm_step_ctx_t *ctx,
  * OUT data - the requested data type
  * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  */
-extern int slurm_jobinfo_ctx_get PARAMS((switch_jobinfo_t *jobinfo,
-					 int data_type, void *data));
+extern int slurm_jobinfo_ctx_get(switch_jobinfo_t *jobinfo,
+				 int data_type,
+				 void *data);
 
 /*
  * slurm_step_ctx_daemon_per_node_hack - Hack the step context
@@ -3345,16 +3349,17 @@ extern int slurm_jobinfo_ctx_get PARAMS((switch_jobinfo_t *jobinfo,
  * IN/OUT curr_task_num - task_id of newest task, initialze to zero
  * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  */
-extern int slurm_step_ctx_daemon_per_node_hack PARAMS(
-	(slurm_step_ctx_t *ctx, char *node_list, uint32_t node_cnt,
-	 uint32_t *curr_task_num));
+extern int slurm_step_ctx_daemon_per_node_hack(slurm_step_ctx_t *ctx,
+					       char *node_list,
+					       uint32_t node_cnt,
+					       uint32_t *curr_task_num);
 
 /*
  * slurm_step_ctx_destroy - free allocated memory for a job step context.
  * IN ctx - job step context generated by slurm_step_ctx_create
  * RET SLURM_SUCCESS or SLURM_ERROR (with slurm_errno set)
  */
-extern int slurm_step_ctx_destroy PARAMS((slurm_step_ctx_t *ctx));
+extern int slurm_step_ctx_destroy(slurm_step_ctx_t *ctx);
 
 /*
  * slurm_step_launch_params_t_init - initialize a user-allocated
@@ -3363,8 +3368,7 @@ extern int slurm_step_ctx_destroy PARAMS((slurm_step_ctx_t *ctx));
  * IN ptr - pointer to a structure allocated by the use.  The structure will
  *      be initialized.
  */
-extern void slurm_step_launch_params_t_init
-PARAMS((slurm_step_launch_params_t *ptr));
+extern void slurm_step_launch_params_t_init(slurm_step_launch_params_t *ptr);
 
 /*
  * slurm_step_launch - launch a parallel job step
@@ -3373,10 +3377,9 @@ PARAMS((slurm_step_launch_params_t *ptr));
  * IN callbacks - Identify functions to be called when various events occur
  * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  */
-extern int slurm_step_launch PARAMS(
-	(slurm_step_ctx_t *ctx,
-	 const slurm_step_launch_params_t *params,
-	 const slurm_step_launch_callbacks_t *callbacks));
+extern int slurm_step_launch(slurm_step_ctx_t *ctx,
+			     const slurm_step_launch_params_t *params,
+			     const slurm_step_launch_callbacks_t *callbacks);
 
 /*
  * slurm_step_launch_add - Add tasks to a step that was already started
@@ -3387,38 +3390,37 @@ extern int slurm_step_launch PARAMS(
  *                   node in node_list.
  * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  */
-extern int slurm_step_launch_add PARAMS(
-	(slurm_step_ctx_t *ctx,
-	 const slurm_step_launch_params_t *params,
-	 char *node_list, int start_nodeid));
+extern int slurm_step_launch_add(slurm_step_ctx_t *ctx,
+				 const slurm_step_launch_params_t *params,
+				 char *node_list,
+				 int start_nodeid);
 
 /*
  * Block until all tasks have started.
  */
-extern int slurm_step_launch_wait_start PARAMS((slurm_step_ctx_t *ctx));
+extern int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx);
 
 /*
  * Block until all tasks have finished (or failed to start altogether).
  */
-extern void slurm_step_launch_wait_finish PARAMS((slurm_step_ctx_t *ctx));
+extern void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx);
 
 /*
  * Abort an in-progress launch, or terminate the fully launched job step.
  *
  * Can be called from a signal handler.
  */
-extern void slurm_step_launch_abort PARAMS((slurm_step_ctx_t *ctx));
+extern void slurm_step_launch_abort(slurm_step_ctx_t *ctx);
 
 /*
  * Forward a signal to all those nodes with running tasks
  */
-extern void slurm_step_launch_fwd_signal PARAMS((slurm_step_ctx_t *ctx,
-						 int signo));
+extern void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo);
 
 /*
  * Wake tasks stopped for debugging on nodes with running tasks
  */
-extern void slurm_step_launch_fwd_wake PARAMS((slurm_step_ctx_t *ctx));
+extern void slurm_step_launch_fwd_wake(slurm_step_ctx_t *ctx);
 
 /*
  * Specify the plugin name to be used. This may be needed to specify the
@@ -3426,7 +3428,7 @@ extern void slurm_step_launch_fwd_wake PARAMS((slurm_step_ctx_t *ctx));
  * IN plugin name - "none", "pmi2", etc.
  * RET SLURM_SUCCESS or SLURM_ERROR (with errno set)
  */
-extern int slurm_mpi_plugin_init PARAMS((char *plugin_name));
+extern int slurm_mpi_plugin_init(char *plugin_name);
 
 /*****************************************************************************\
  *	SLURM CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
@@ -3438,7 +3440,7 @@ extern int slurm_mpi_plugin_init PARAMS((char *plugin_name));
  *	SLURM_VERSION_MINOR, and SLURM_VERSION_MICRO to work with this value
  * RET API's version number
  */
-extern long slurm_api_version PARAMS((void));
+extern long slurm_api_version(void);
 
 /*
  * slurm_load_ctl_conf - issue RPC to get slurm control configuration
@@ -3449,16 +3451,15 @@ extern long slurm_api_version PARAMS((void));
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free the response using slurm_free_ctl_conf
  */
-extern int slurm_load_ctl_conf PARAMS(
-	(time_t update_time,
-	 slurm_ctl_conf_t  **slurm_ctl_conf_ptr));
+extern int slurm_load_ctl_conf(time_t update_time,
+			       slurm_ctl_conf_t **slurm_ctl_conf_ptr);
 
 /*
  * slurm_free_ctl_conf - free slurm control information response message
  * IN msg - pointer to slurm control information response message
  * NOTE: buffer is loaded by slurm_load_ctl_conf
  */
-extern void slurm_free_ctl_conf PARAMS((slurm_ctl_conf_t* slurm_ctl_conf_ptr));
+extern void slurm_free_ctl_conf(slurm_ctl_conf_t *slurm_ctl_conf_ptr);
 
 /*
  * slurm_print_ctl_conf - output the contents of slurm control configuration
@@ -3466,8 +3467,8 @@ extern void slurm_free_ctl_conf PARAMS((slurm_ctl_conf_t* slurm_ctl_conf_ptr));
  * IN out - file to write to
  * IN slurm_ctl_conf_ptr - slurm control configuration pointer
  */
-extern void slurm_print_ctl_conf PARAMS(
-	(FILE * out, slurm_ctl_conf_t* slurm_ctl_conf_ptr));
+extern void slurm_print_ctl_conf(FILE *out,
+				 slurm_ctl_conf_t *slurm_ctl_conf_ptr);
 
 /*
  * slurm_write_ctl_conf - write the contents of slurm control configuration
@@ -3477,10 +3478,9 @@ extern void slurm_print_ctl_conf PARAMS(
  * IN node_info_ptr - pointer to node table of information
  * IN part_info_ptr - pointer to partition information
  */
-extern void slurm_write_ctl_conf PARAMS(
-	(slurm_ctl_conf_t* slurm_ctl_conf_ptr,
-	 node_info_msg_t* node_info_ptr,
-	 partition_info_msg_t* part_info_ptr));
+extern void slurm_write_ctl_conf(slurm_ctl_conf_t *slurm_ctl_conf_ptr,
+				 node_info_msg_t *node_info_ptr,
+				 partition_info_msg_t *part_info_ptr);
 
 /*
  * slurm_ctl_conf_2_key_pairs - put the slurm_ctl_conf_t variables into
@@ -3488,8 +3488,7 @@ extern void slurm_write_ctl_conf PARAMS(
  * IN slurm_ctl_conf_ptr - slurm control configuration pointer
  * RET List of opaque data type config_key_pair_t
  */
-extern void *slurm_ctl_conf_2_key_pairs PARAMS(
-	(slurm_ctl_conf_t* slurm_ctl_conf_ptr));
+extern void *slurm_ctl_conf_2_key_pairs(slurm_ctl_conf_t *slurm_ctl_conf_ptr);
 
 /*
  * slurm_print_key_pairs - output the contents of key_pairs
@@ -3498,8 +3497,7 @@ extern void *slurm_ctl_conf_2_key_pairs PARAMS(
  * IN key_pairs - List containing key pairs to be printed
  * IN title - title of key pair list
  */
-extern void slurm_print_key_pairs PARAMS((FILE* out, void *key_pairs,
-					  char *title));
+extern void slurm_print_key_pairs(FILE *out, void *key_pairs, char *title);
 
 /*
  * slurm_load_slurmd_status - issue RPC to get the status of slurmd
@@ -3508,16 +3506,14 @@ extern void slurm_print_key_pairs PARAMS((FILE* out, void *key_pairs,
  * RET 0 or -1 on error
  * NOTE: free the response using slurm_free_slurmd_status()
  */
-extern int slurm_load_slurmd_status PARAMS(
-	(slurmd_status_t **slurmd_status_ptr));
+extern int slurm_load_slurmd_status(slurmd_status_t **slurmd_status_ptr);
 
 /*
  * slurm_free_slurmd_status - free slurmd state information
  * IN msg - pointer to slurmd state information
  * NOTE: buffer is loaded by slurm_load_slurmd_status
  */
-extern void slurm_free_slurmd_status PARAMS(
-	(slurmd_status_t* slurmd_status_ptr));
+extern void slurm_free_slurmd_status(slurmd_status_t* slurmd_status_ptr);
 
 /*
  * slurm_print_slurmd_status - output the contents of slurmd status
@@ -3525,23 +3521,21 @@ extern void slurm_free_slurmd_status PARAMS(
  * IN out - file to write to
  * IN slurmd_status_ptr - slurmd status pointer
  */
-void slurm_print_slurmd_status PARAMS(
-	(FILE* out, slurmd_status_t * slurmd_status_ptr));
+void slurm_print_slurmd_status(FILE *out, slurmd_status_t *slurmd_status_ptr);
 
 /*
  * slurm_init_update_step_msg - initialize step update message with default
  *	values before calling slurm_update_step()
  * OUT step_msg - step update messasge descriptor
  */
-extern void slurm_init_update_step_msg PARAMS(
-	(step_update_request_msg_t * step_msg));
+extern void slurm_init_update_step_msg(step_update_request_msg_t *step_msg);
 
 /* Get scheduling statistics */
-extern int  slurm_get_statistics PARAMS((stats_info_response_msg_t **buf,
-					 stats_info_request_msg_t *req));
+extern int slurm_get_statistics(stats_info_response_msg_t **buf,
+				stats_info_request_msg_t *req);
 
 /* Reset scheduling statistics */
-extern int  slurm_reset_statistics PARAMS((stats_info_request_msg_t *req));
+extern int slurm_reset_statistics(stats_info_request_msg_t *req);
 
 /*****************************************************************************\
  *	SLURM JOB RESOURCES READ/PRINT FUNCTIONS
@@ -3555,8 +3549,8 @@ extern int  slurm_reset_statistics PARAMS((stats_info_request_msg_t *req));
  * IN node_id		- zero-origin node id in allocation
  * RET number of CPUs allocated to job on this node or -1 on error
  */
-extern int slurm_job_cpus_allocated_on_node_id PARAMS(
-	(job_resources_t *job_resrcs_ptr, int node_id));
+extern int slurm_job_cpus_allocated_on_node_id(job_resources_t *job_resrcs_ptr,
+					       int node_id);
 
 /*
  * slurm_job_cpus_allocated_on_node -
@@ -3566,8 +3560,8 @@ extern int slurm_job_cpus_allocated_on_node_id PARAMS(
  * IN node_name		- name of node
  * RET number of CPUs allocated to job on this node or -1 on error
  */
-extern int slurm_job_cpus_allocated_on_node PARAMS(
-	(job_resources_t *job_resrcs_ptr, const char *node_name));
+extern int slurm_job_cpus_allocated_on_node(job_resources_t *job_resrcs_ptr,
+					    const char *node_name);
 
 /*
  * slurm_job_cpus_allocated_str_on_node_id -
@@ -3579,9 +3573,10 @@ extern int slurm_job_cpus_allocated_on_node PARAMS(
  * IN node_id		- zero-origin node id in allocation
  * RET 0 on success or -1 on error
  */
-extern int slurm_job_cpus_allocated_str_on_node_id PARAMS(
-	(char *cpus, size_t cpus_len,
-	 job_resources_t *job_resrcs_ptr, int node_id));
+extern int slurm_job_cpus_allocated_str_on_node_id(char *cpus,
+						   size_t cpus_len,
+						   job_resources_t *job_resrcs_ptr,
+						   int node_id);
 
 /*
  * slurm_job_cpus_allocated_str_on_node -
@@ -3593,9 +3588,10 @@ extern int slurm_job_cpus_allocated_str_on_node_id PARAMS(
  * IN node_name		- name of node
  * RET 0 on success or -1 on error
  */
-extern int slurm_job_cpus_allocated_str_on_node PARAMS(
-	(char *cpus, size_t cpus_len,
-	 job_resources_t *job_resrcs_ptr, const char *node_name));
+extern int slurm_job_cpus_allocated_str_on_node(char *cpus,
+						size_t cpus_len,
+						job_resources_t *job_resrcs_ptr,
+						const char *node_name);
 
 /*****************************************************************************\
  *	SLURM JOB CONTROL CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
@@ -3606,7 +3602,7 @@ extern int slurm_job_cpus_allocated_str_on_node PARAMS(
  * IN msg - pointer to job information response message
  * NOTE: buffer is loaded by slurm_load_jobs.
  */
-extern void slurm_free_job_info_msg PARAMS((job_info_msg_t * job_buffer_ptr));
+extern void slurm_free_job_info_msg(job_info_msg_t *job_buffer_ptr);
 
 /*
  * slurm_get_end_time - get the expected end time for a given slurm job
@@ -3614,23 +3610,23 @@ extern void slurm_free_job_info_msg PARAMS((job_info_msg_t * job_buffer_ptr));
  * end_time_ptr - location in which to store scheduled end time for job
  * RET 0 or -1 on error
  */
-extern int slurm_get_end_time PARAMS((uint32_t jobid, time_t *end_time_ptr));
+extern int slurm_get_end_time(uint32_t jobid, time_t *end_time_ptr);
 
 /* Given a job record pointer, return its stderr path */
-extern void slurm_get_job_stderr(char *buf, int buf_size, job_info_t * job_ptr);
+extern void slurm_get_job_stderr(char *buf, int buf_size, job_info_t *job_ptr);
 
 /* Given a job record pointer, return its stdin path */
-extern void slurm_get_job_stdin(char *buf, int buf_size, job_info_t * job_ptr);
+extern void slurm_get_job_stdin(char *buf, int buf_size, job_info_t *job_ptr);
 
 /* Given a job record pointer, return its stdout path */
-extern void slurm_get_job_stdout(char *buf, int buf_size, job_info_t * job_ptr);
+extern void slurm_get_job_stdout(char *buf, int buf_size, job_info_t *job_ptr);
 
 /*
  * slurm_get_rem_time - get the expected time remaining for a given job
  * IN jobid     - slurm job id
  * RET remaining time in seconds or -1 on error
  */
-extern long slurm_get_rem_time PARAMS((uint32_t jobid));
+extern long slurm_get_rem_time(uint32_t jobid);
 
 /*
  * slurm_job_node_ready - report if nodes are ready for job to execute now
@@ -3647,8 +3643,9 @@ extern int slurm_job_node_ready(uint32_t job_id);
  * RET 0 or -1 on error
  * NOTE: free the response using slurm_free_job_info_msg
  */
-extern int slurm_load_job PARAMS((job_info_msg_t **resp, uint32_t job_id,
-				  uint16_t show_flags));
+extern int slurm_load_job(job_info_msg_t **resp,
+			  uint32_t job_id,
+			  uint16_t show_flags);
 
 /*
  * slurm_load_job_user - issue RPC to get slurm information about all jobs
@@ -3659,9 +3656,9 @@ extern int slurm_load_job PARAMS((job_info_msg_t **resp, uint32_t job_id,
  * RET 0 or -1 on error
  * NOTE: free the response using slurm_free_job_info_msg
  */
-extern int slurm_load_job_user PARAMS((job_info_msg_t **job_info_msg_pptr,
-				       uint32_t user_id,
-				       uint16_t show_flags));
+extern int slurm_load_job_user(job_info_msg_t **job_info_msg_pptr,
+			       uint32_t user_id,
+			       uint16_t show_flags);
 
 /*
  * slurm_load_jobs - issue RPC to get slurm all job configuration
@@ -3672,9 +3669,9 @@ extern int slurm_load_job_user PARAMS((job_info_msg_t **job_info_msg_pptr,
  * RET 0 or -1 on error
  * NOTE: free the response using slurm_free_job_info_msg
  */
-extern int slurm_load_jobs PARAMS(
-	(time_t update_time, job_info_msg_t **job_info_msg_pptr,
-	 uint16_t show_flags));
+extern int slurm_load_jobs(time_t update_time,
+			   job_info_msg_t **job_info_msg_pptr,
+			   uint16_t show_flags);
 
 /*
  * slurm_notify_job - send message to the job's stdout,
@@ -3683,7 +3680,7 @@ extern int slurm_load_jobs PARAMS(
  * IN message - arbitrary message
  * RET 0 or -1 on error
  */
-extern int slurm_notify_job PARAMS((uint32_t job_id, char *message));
+extern int slurm_notify_job(uint32_t job_id, char *message);
 
 /*
  * slurm_pid2jobid - issue RPC to get the slurm job_id given a process_id
@@ -3692,7 +3689,7 @@ extern int slurm_notify_job PARAMS((uint32_t job_id, char *message));
  * OUT job_id_ptr - place to store a slurm job_id
  * RET 0 or -1 on error
  */
-extern int slurm_pid2jobid PARAMS((pid_t job_pid, uint32_t * job_id_ptr));
+extern int slurm_pid2jobid(pid_t job_pid, uint32_t *job_id_ptr);
 
 /*
  * slurm_print_job_info - output information about a specific Slurm
@@ -3701,8 +3698,9 @@ extern int slurm_pid2jobid PARAMS((pid_t job_pid, uint32_t * job_id_ptr));
  * IN job_ptr - an individual job information record pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_job_info PARAMS((FILE*, slurm_job_info_t * job_ptr,
-					 int one_liner));
+extern void slurm_print_job_info(FILE *out,
+				 slurm_job_info_t *job_ptr,
+				 int one_liner);
 
 /*
  * slurm_print_job_info_msg - output information about all Slurm
@@ -3711,8 +3709,9 @@ extern void slurm_print_job_info PARAMS((FILE*, slurm_job_info_t * job_ptr,
  * IN job_info_msg_ptr - job information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_job_info_msg PARAMS(
-	(FILE * out, job_info_msg_t * job_info_msg_ptr, int one_liner));
+extern void slurm_print_job_info_msg(FILE *out,
+				     job_info_msg_t *job_info_msg_ptr,
+				     int one_liner);
 
 /*
  * slurm_sprint_job_info - output information about a specific Slurm
@@ -3722,8 +3721,8 @@ extern void slurm_print_job_info_msg PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_job_info PARAMS((slurm_job_info_t * job_ptr,
-					   int one_liner));
+extern char *slurm_sprint_job_info(slurm_job_info_t *job_ptr,
+				   int one_liner);
 
 /*
  * slurm_update_job - issue RPC to a job's configuration per request,
@@ -3731,7 +3730,7 @@ extern char *slurm_sprint_job_info PARAMS((slurm_job_info_t * job_ptr,
  * IN job_msg - description of job updates
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_job PARAMS((job_desc_msg_t * job_msg));
+extern int slurm_update_job(job_desc_msg_t *job_msg);
 
 /*
  * slurm_update_job2 - issue RPC to a job's configuration per request,
@@ -3741,8 +3740,8 @@ extern int slurm_update_job PARAMS((job_desc_msg_t * job_msg));
  *	      free using slurm_free_job_array_resp()
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_job2 PARAMS((job_desc_msg_t * job_msg,
-				     job_array_resp_msg_t **resp));
+extern int slurm_update_job2(job_desc_msg_t *job_msg,
+			     job_array_resp_msg_t **resp);
 
 /*
  * slurm_xlate_job_id - Translate a Slurm job ID string into a slurm job ID
@@ -3752,7 +3751,9 @@ extern int slurm_update_job2 PARAMS((job_desc_msg_t * job_msg,
  * IN job_id_str - String containing a single job ID number
  * RET - equivalent job ID number or 0 on error
  */
-extern uint32_t slurm_xlate_job_id PARAMS((char *job_id_str));
+extern uint32_t slurm_xlate_job_id(char *job_id_str);
+
+
 /*****************************************************************************\
  *	SLURM JOB STEP CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
 \*****************************************************************************/
@@ -3771,10 +3772,11 @@ extern uint32_t slurm_xlate_job_id PARAMS((char *job_id_str));
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  * NOTE: free the response using slurm_free_job_step_info_response_msg
  */
-extern int slurm_get_job_steps PARAMS(
-	(time_t update_time, uint32_t job_id, uint32_t step_id,
-	 job_step_info_response_msg_t **step_response_pptr,
-	 uint16_t show_flags));
+extern int slurm_get_job_steps(time_t update_time,
+			       uint32_t job_id,
+			       uint32_t step_id,
+			       job_step_info_response_msg_t **step_response_pptr,
+			       uint16_t show_flags);
 
 /*
  * slurm_free_job_step_info_response_msg - free the job step
@@ -3782,8 +3784,7 @@ extern int slurm_get_job_steps PARAMS(
  * IN msg - pointer to job step information response message
  * NOTE: buffer is loaded by slurm_get_job_steps.
  */
-extern void slurm_free_job_step_info_response_msg PARAMS(
-	(job_step_info_response_msg_t * msg));
+extern void slurm_free_job_step_info_response_msg(job_step_info_response_msg_t *msg);
 
 /*
  * slurm_print_job_step_info_msg - output information about all Slurm
@@ -3792,9 +3793,9 @@ extern void slurm_free_job_step_info_response_msg PARAMS(
  * IN job_step_info_msg_ptr - job step information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_job_step_info_msg PARAMS(
-	(FILE * out, job_step_info_response_msg_t * job_step_info_msg_ptr,
-	 int one_liner));
+extern void slurm_print_job_step_info_msg(FILE *out,
+					  job_step_info_response_msg_t *job_step_info_msg_ptr,
+					  int one_liner);
 
 /*
  * slurm_print_job_step_info - output information about a specific Slurm
@@ -3803,8 +3804,9 @@ extern void slurm_print_job_step_info_msg PARAMS(
  * IN job_ptr - an individual job step information record pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_job_step_info PARAMS(
-	(FILE * out, job_step_info_t * step_ptr, int one_liner));
+extern void slurm_print_job_step_info(FILE *out,
+				      job_step_info_t *step_ptr,
+				      int one_liner);
 
 /*
  * slurm_job_step_layout_get - get the slurm_step_layout_t structure for
@@ -3815,8 +3817,8 @@ extern void slurm_print_job_step_info PARAMS(
  * RET pointer to a slurm_step_layout_t (free with
  *   slurm_free_step_layout) on success, and NULL on error.
  */
-extern slurm_step_layout_t *slurm_job_step_layout_get PARAMS(
-	(uint32_t job_id, uint32_t step_id));
+extern slurm_step_layout_t *slurm_job_step_layout_get(uint32_t job_id,
+						      uint32_t step_id);
 
 /*
  * slurm_sprint_job_step_info - output information about a specific Slurm
@@ -3826,8 +3828,8 @@ extern slurm_step_layout_t *slurm_job_step_layout_get PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_job_step_info PARAMS((job_step_info_t * step_ptr,
-						int one_liner));
+extern char *slurm_sprint_job_step_info(job_step_info_t *step_ptr,
+					int one_liner);
 
 /*
  * slurm_job_step_stat - status a current step
@@ -3838,9 +3840,11 @@ extern char *slurm_sprint_job_step_info PARAMS((job_step_info_t * step_ptr,
  * OUT resp
  * RET SLURM_SUCCESS on success SLURM_ERROR else
  */
-extern int slurm_job_step_stat PARAMS((uint32_t job_id, uint32_t step_id,
-				       char *node_list,
-				       job_step_stat_response_msg_t **resp));
+extern int slurm_job_step_stat(uint32_t job_id,
+			       uint32_t step_id,
+			       char *node_list,
+			       uint16_t use_protocol_ver,
+			       job_step_stat_response_msg_t **resp);
 
 /*
  * slurm_job_step_get_pids - get the complete list of pids for a given
@@ -3851,21 +3855,21 @@ extern int slurm_job_step_stat PARAMS((uint32_t job_id, uint32_t step_id,
  * OUT resp
  * RET SLURM_SUCCESS on success SLURM_ERROR else
  */
-extern int slurm_job_step_get_pids PARAMS(
-	(uint32_t job_id, uint32_t step_id,
-	 char *node_list,
-	 job_step_pids_response_msg_t **resp));
+extern int slurm_job_step_get_pids(uint32_t job_id,
+				   uint32_t step_id,
+				   char *node_list,
+				   job_step_pids_response_msg_t **resp);
 
-extern void slurm_job_step_layout_free PARAMS((slurm_step_layout_t *layout));
-extern void slurm_job_step_pids_free PARAMS((job_step_pids_t *object));
-extern void slurm_job_step_pids_response_msg_free PARAMS((void *object));
+extern void slurm_job_step_layout_free(slurm_step_layout_t *layout);
+extern void slurm_job_step_pids_free(job_step_pids_t *object);
+extern void slurm_job_step_pids_response_msg_free(void *object);
 extern void slurm_job_step_stat_free(job_step_stat_t *object);
 extern void slurm_job_step_stat_response_msg_free(void *object);
 
 /* Update the time limit of a job step,
  * IN step_msg - step update messasge descriptor
  * RET 0 or -1 on error */
-extern int slurm_update_step PARAMS((step_update_request_msg_t * step_msg));
+extern int slurm_update_step(step_update_request_msg_t *step_msg);
 
 /*****************************************************************************\
  *	SLURM NODE CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
@@ -3880,8 +3884,9 @@ extern int slurm_update_step PARAMS((step_update_request_msg_t * step_msg));
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_node_info_msg
  */
-extern int slurm_load_node PARAMS((time_t update_time, node_info_msg_t **resp,
-				  uint16_t show_flags));
+extern int slurm_load_node(time_t update_time,
+			   node_info_msg_t **resp,
+			   uint16_t show_flags);
 
 /*
  * slurm_load_node_single - issue RPC to get slurm configuration information
@@ -3892,8 +3897,9 @@ extern int slurm_load_node PARAMS((time_t update_time, node_info_msg_t **resp,
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_node_info_msg
  */
-extern int slurm_load_node_single PARAMS((node_info_msg_t **resp,
-					 char *node_name, uint16_t show_flags));
+extern int slurm_load_node_single(node_info_msg_t **resp,
+				  char *node_name,
+				  uint16_t show_flags);
 
 /*
  * slurm_get_node_energy_n - issue RPC to get the energy data of all
@@ -3906,18 +3912,17 @@ extern int slurm_load_node_single PARAMS((node_info_msg_t **resp,
  * RET 0 on success or a slurm error code
  * NOTE: free the response using xfree
  */
-extern int slurm_get_node_energy PARAMS(
-	(char *host, uint16_t delta,
-	 uint16_t *sensors_cnt,
-	 acct_gather_energy_t **energy));
+extern int slurm_get_node_energy(char *host,
+				 uint16_t delta,
+				 uint16_t *sensors_cnt,
+				 acct_gather_energy_t **energy);
 
 /*
  * slurm_free_node_info_msg - free the node information response message
  * IN msg - pointer to node information response message
  * NOTE: buffer is loaded by slurm_load_node.
  */
-extern void slurm_free_node_info_msg PARAMS(
-	(node_info_msg_t * node_buffer_ptr));
+extern void slurm_free_node_info_msg(node_info_msg_t *node_buffer_ptr);
 
 /*
  * slurm_print_node_info_msg - output information about all Slurm nodes
@@ -3926,8 +3931,9 @@ extern void slurm_free_node_info_msg PARAMS(
  * IN node_info_msg_ptr - node information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_node_info_msg PARAMS(
-	(FILE * out, node_info_msg_t * node_info_msg_ptr, int one_liner));
+extern void slurm_print_node_info_msg(FILE *out,
+				      node_info_msg_t *node_info_msg_ptr,
+				      int one_liner);
 
 /*
  * slurm_print_node_table - output information about a specific Slurm nodes
@@ -3937,9 +3943,10 @@ extern void slurm_print_node_info_msg PARAMS(
  * IN node_scaling - number of nodes each node represents
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_node_table PARAMS(
-	(FILE * out, node_info_t * node_ptr,
-	 int node_scaling, int one_liner));
+extern void slurm_print_node_table(FILE *out,
+				   node_info_t *node_ptr,
+				   int node_scaling,
+				   int one_liner);
 
 /*
  * slurm_sprint_node_table - output information about a specific Slurm nodes
@@ -3950,15 +3957,15 @@ extern void slurm_print_node_table PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_node_table PARAMS((node_info_t * node_ptr,
-					     int node_scaling,
-					     int one_liner));
+extern char *slurm_sprint_node_table(node_info_t *node_ptr,
+				     int node_scaling,
+				     int one_liner);
 
 /*
  * slurm_init_update_node_msg - initialize node update message
  * OUT update_node_msg - user defined node descriptor
  */
-void slurm_init_update_node_msg PARAMS((update_node_msg_t * update_node_msg));
+void slurm_init_update_node_msg(update_node_msg_t *update_node_msg);
 
 /*
  * slurm_update_node - issue RPC to a node's configuration per request,
@@ -3966,7 +3973,7 @@ void slurm_init_update_node_msg PARAMS((update_node_msg_t * update_node_msg));
  * IN node_msg - description of node updates
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_node PARAMS((update_node_msg_t * node_msg));
+extern int slurm_update_node(update_node_msg_t *node_msg);
 
 
 /*****************************************************************************\
@@ -3981,8 +3988,8 @@ extern int slurm_update_node PARAMS((update_node_msg_t * node_msg));
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_front_end_info_msg
  */
-extern int slurm_load_front_end PARAMS(
-	(time_t update_time, front_end_info_msg_t **resp));
+extern int slurm_load_front_end(time_t update_time,
+				front_end_info_msg_t **resp);
 
 /*
  * slurm_free_front_end_info_msg - free the front_end information response
@@ -3990,8 +3997,7 @@ extern int slurm_load_front_end PARAMS(
  * IN msg - pointer to front_end information response message
  * NOTE: buffer is loaded by slurm_load_front_end.
  */
-extern void slurm_free_front_end_info_msg PARAMS(
-	(front_end_info_msg_t * front_end_buffer_ptr));
+extern void slurm_free_front_end_info_msg(front_end_info_msg_t *front_end_buffer_ptr);
 
 /*
  * slurm_print_front_end_info_msg - output information about all Slurm
@@ -4000,9 +4006,9 @@ extern void slurm_free_front_end_info_msg PARAMS(
  * IN front_end_info_msg_ptr - front_end information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_front_end_info_msg PARAMS(
-	(FILE * out, front_end_info_msg_t * front_end_info_msg_ptr,
-	 int one_liner));
+extern void slurm_print_front_end_info_msg(FILE *out,
+					   front_end_info_msg_t *front_end_info_msg_ptr,
+					   int one_liner);
 /*
  * slurm_print_front_end_table - output information about a specific Slurm
  *	front_ends based upon message as loaded using slurm_load_front_end
@@ -4010,8 +4016,9 @@ extern void slurm_print_front_end_info_msg PARAMS(
  * IN front_end_ptr - an individual front_end information record pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_front_end_table PARAMS(
-	(FILE * out, front_end_info_t * front_end_ptr, int one_liner));
+extern void slurm_print_front_end_table(FILE *out,
+					front_end_info_t *front_end_ptr,
+					int one_liner);
 
 /*
  * slurm_sprint_front_end_table - output information about a specific Slurm
@@ -4021,15 +4028,14 @@ extern void slurm_print_front_end_table PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_front_end_table PARAMS(
-	(front_end_info_t * front_end_ptr, int one_liner));
+extern char *slurm_sprint_front_end_table(front_end_info_t *front_end_ptr,
+					  int one_liner);
 
 /*
  * slurm_init_update_front_end_msg - initialize front_end node update message
  * OUT update_front_end_msg - user defined node descriptor
  */
-void slurm_init_update_front_end_msg PARAMS(
-	(update_front_end_msg_t * update_front_end_msg));
+void slurm_init_update_front_end_msg(update_front_end_msg_t *update_front_end_msg);
 
 /*
  * slurm_update_front_end - issue RPC to a front_end node's configuration per
@@ -4037,8 +4043,8 @@ void slurm_init_update_front_end_msg PARAMS(
  * IN front_end_msg - description of front_end node updates
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_front_end PARAMS(
-	(update_front_end_msg_t * front_end_msg));
+extern int slurm_update_front_end(update_front_end_msg_t *front_end_msg);
+
 
 /*****************************************************************************\
  *	SLURM SWITCH TOPOLOGY CONFIGURATION READ/PRINT FUNCTIONS
@@ -4051,8 +4057,7 @@ extern int slurm_update_front_end PARAMS(
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_topo_info_msg
  */
-extern int slurm_load_topo PARAMS(
-	(topo_info_response_msg_t **topo_info_msg_pptr));
+extern int slurm_load_topo(topo_info_response_msg_t **topo_info_msg_pptr);
 
 /*
  * slurm_free_topo_info_msg - free the switch topology configuration
@@ -4060,7 +4065,7 @@ extern int slurm_load_topo PARAMS(
  * IN msg - pointer to switch topology configuration response message
  * NOTE: buffer is loaded by slurm_load_topo.
  */
-extern void slurm_free_topo_info_msg PARAMS((topo_info_response_msg_t *msg));
+extern void slurm_free_topo_info_msg(topo_info_response_msg_t *msg);
 
 /*
  * slurm_print_topo_info_msg - output information about all switch topology
@@ -4070,9 +4075,9 @@ extern void slurm_free_topo_info_msg PARAMS((topo_info_response_msg_t *msg));
  * IN topo_info_msg_ptr - switch topology information message pointer
  * IN one_liner - print as a single line if not zero
  */
-extern void slurm_print_topo_info_msg PARAMS(
-	(FILE * out, topo_info_response_msg_t *topo_info_msg_ptr,
-	 int one_liner));
+extern void slurm_print_topo_info_msg(FILE *out,
+				      topo_info_response_msg_t *topo_info_msg_ptr,
+				      int one_liner);
 
 /*
  * slurm_print_topo_record - output information about a specific Slurm topology
@@ -4083,8 +4088,9 @@ extern void slurm_print_topo_info_msg PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *	   NULL is returned on failure.
  */
-extern void slurm_print_topo_record PARAMS((FILE * out, topo_info_t *topo_ptr,
-					    int one_liner));
+extern void slurm_print_topo_record(FILE *out,
+				    topo_info_t *topo_ptr,
+				    int one_liner);
 
 /*****************************************************************************\
  *	SLURM POWERCAPPING READ/PRINT/UPDATE FUNCTIONS
@@ -4096,8 +4102,7 @@ extern void slurm_print_topo_record PARAMS((FILE * out, topo_info_t *topo_ptr,
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_powercap_info_msg
  */
-extern int slurm_load_powercap PARAMS(
-	(powercap_info_msg_t **powercap_info_msg_pptr));
+extern int slurm_load_powercap(powercap_info_msg_t **powercap_info_msg_pptr);
 
 /*
  * slurm_free_powercap_info_msg - free the powercapping information
@@ -4105,7 +4110,7 @@ extern int slurm_load_powercap PARAMS(
  * IN msg - pointer to powercapping information response message
  * NOTE: buffer is loaded by slurm_load_powercap.
  */
-extern void slurm_free_powercap_info_msg PARAMS((powercap_info_msg_t *msg));
+extern void slurm_free_powercap_info_msg(powercap_info_msg_t *msg);
 
 /*
  * slurm_print_powercap_info_msg - output information about powercapping
@@ -4114,16 +4119,16 @@ extern void slurm_free_powercap_info_msg PARAMS((powercap_info_msg_t *msg));
  * IN powercap_info_msg_ptr - powercapping information message pointer
  * IN one_liner - print as a single line if not zero
  */
-extern void slurm_print_powercap_info_msg PARAMS(
-	(FILE * out, powercap_info_msg_t *powercap_info_msg_ptr,
-	 int one_liner));
+extern void slurm_print_powercap_info_msg(FILE *out,
+					  powercap_info_msg_t *powercap_info_msg_ptr,
+					  int one_liner);
 
 /*
  * slurm_update_powercap - issue RPC to update powercapping cap 
  * IN powercap_msg - description of powercapping updates
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_powercap PARAMS((update_powercap_msg_t * powercap_msg));
+extern int slurm_update_powercap(update_powercap_msg_t *powercap_msg);
 
 /*****************************************************************************\
  *	SLURM SELECT READ/PRINT/UPDATE FUNCTIONS
@@ -4136,9 +4141,9 @@ extern int slurm_update_powercap PARAMS((update_powercap_msg_t * powercap_msg));
  * IN/OUT data - the data to enter into job credential
  * RET 0 or -1 on error
  */
-extern int slurm_get_select_jobinfo PARAMS(
-	(dynamic_plugin_data_t *jobinfo, enum select_jobdata_type data_type,
-	 void *data));
+extern int slurm_get_select_jobinfo(dynamic_plugin_data_t *jobinfo,
+				    enum select_jobdata_type data_type,
+				    void *data);
 
 /*
  * slurm_get_select_nodeinfo - get data from a select node credential
@@ -4148,9 +4153,10 @@ extern int slurm_get_select_jobinfo PARAMS(
  * IN/OUT data  - the data to enter into node credential
  * RET 0 or -1 on error
  */
-extern int slurm_get_select_nodeinfo PARAMS(
-	(dynamic_plugin_data_t *nodeinfo, enum select_nodedata_type data_type,
-	 enum node_states state, void *data));
+extern int slurm_get_select_nodeinfo(dynamic_plugin_data_t *nodeinfo,
+				     enum select_nodedata_type data_type,
+				     enum node_states state,
+				     void *data);
 
 /*****************************************************************************\
  *	SLURM PARTITION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
@@ -4161,8 +4167,7 @@ extern int slurm_get_select_nodeinfo PARAMS(
  *	default values
  * IN/OUT update_part_msg - user defined partition descriptor
  */
-extern void slurm_init_part_desc_msg PARAMS(
-	(update_part_msg_t * update_part_msg));
+extern void slurm_init_part_desc_msg(update_part_msg_t *update_part_msg);
 
 /*
  * slurm_load_partitions - issue RPC to get slurm all partition configuration
@@ -4174,9 +4179,9 @@ extern void slurm_init_part_desc_msg PARAMS(
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_partition_info_msg
  */
-extern int slurm_load_partitions PARAMS(
-	(time_t update_time, partition_info_msg_t **part_buffer_ptr,
-	 uint16_t show_flags));
+extern int slurm_load_partitions(time_t update_time,
+				 partition_info_msg_t **part_buffer_ptr,
+				 uint16_t show_flags);
 
 /*
  * slurm_free_partition_info_msg - free the partition information
@@ -4184,8 +4189,7 @@ extern int slurm_load_partitions PARAMS(
  * IN msg - pointer to partition information response message
  * NOTE: buffer is loaded by slurm_load_partitions
  */
-extern void slurm_free_partition_info_msg PARAMS(
-	(partition_info_msg_t * part_info_ptr));
+extern void slurm_free_partition_info_msg(partition_info_msg_t *part_info_ptr);
 
 /*
  * slurm_print_partition_info_msg - output information about all Slurm
@@ -4194,8 +4198,7 @@ extern void slurm_free_partition_info_msg PARAMS(
  * IN part_info_ptr - partitions information message pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_partition_info_msg PARAMS(
-	(FILE * out, partition_info_msg_t * part_info_ptr, int one_liner));
+extern void slurm_print_partition_info_msg(FILE *out, partition_info_msg_t *part_info_ptr, int one_liner);
 
 /*
  * slurm_print_partition_info - output information about a specific Slurm
@@ -4204,8 +4207,9 @@ extern void slurm_print_partition_info_msg PARAMS(
  * IN part_ptr - an individual partition information record pointer
  * IN one_liner - print as a single line if true
  */
-extern void slurm_print_partition_info PARAMS(
-	(FILE *out , partition_info_t * part_ptr, int one_liner));
+extern void slurm_print_partition_info(FILE *out,
+				       partition_info_t *part_ptr,
+				       int one_liner);
 
 /*
  * slurm_sprint_partition_info - output information about a specific Slurm
@@ -4215,15 +4219,15 @@ extern void slurm_print_partition_info PARAMS(
  * RET out - char * with formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-extern char *slurm_sprint_partition_info PARAMS(
-	(partition_info_t * part_ptr, int one_liner));
+extern char *slurm_sprint_partition_info(partition_info_t *part_ptr,
+					 int one_liner);
 
 /*
  * slurm_create_partition - create a new partition, only usable by user root
  * IN part_msg - description of partition configuration
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_create_partition PARAMS((update_part_msg_t * part_msg));
+extern int slurm_create_partition(update_part_msg_t *part_msg);
 
 /*
  * slurm_update_partition - issue RPC to update a partition's configuration
@@ -4231,7 +4235,7 @@ extern int slurm_create_partition PARAMS((update_part_msg_t * part_msg));
  * IN part_msg - description of partition updates
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_partition PARAMS((update_part_msg_t * part_msg));
+extern int slurm_update_partition(update_part_msg_t *part_msg);
 
 /*
  * slurm_delete_partition - issue RPC to delete a partition, only usable
@@ -4239,22 +4243,24 @@ extern int slurm_update_partition PARAMS((update_part_msg_t * part_msg));
  * IN part_msg - description of partition to delete
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_delete_partition PARAMS((delete_part_msg_t * part_msg));
+extern int slurm_delete_partition(delete_part_msg_t *part_msg);
 
 /*****************************************************************************\
  *      SLURM LAYOUT PRINT/UPDATE FUNCTIONS
 \*****************************************************************************/
-extern void slurm_print_layout_info PARAMS(
-	(FILE* out, layout_info_msg_t *layout_info_ptr, int one_liner ));
+extern void slurm_print_layout_info(FILE* out,
+				    layout_info_msg_t *layout_info_ptr,
+				    int one_liner );
 
-extern int slurm_load_layout PARAMS(
-	(char *layout_type, char *entities, char *type,
-	 uint32_t no_relation, layout_info_msg_t **resp));
+extern int slurm_load_layout(char *layout_type,
+			     char *entities,
+			     char *type,
+			     uint32_t no_relation,
+			     layout_info_msg_t **resp);
 
-extern int slurm_update_layout PARAMS((update_layout_msg_t * layout_info_msg));
+extern int slurm_update_layout(update_layout_msg_t *layout_info_msg);
 
-extern void slurm_free_layout_info_msg PARAMS(
-	(layout_info_msg_t * layout_info_msg));
+extern void slurm_free_layout_info_msg(layout_info_msg_t *layout_info_msg);
 
 /*****************************************************************************\
  *	SLURM RESERVATION CONFIGURATION READ/PRINT/UPDATE FUNCTIONS
@@ -4265,16 +4271,14 @@ extern void slurm_free_layout_info_msg PARAMS(
  *	default values
  * OUT job_desc_msg - user defined partition descriptor
  */
-extern void slurm_init_resv_desc_msg PARAMS(
-	(resv_desc_msg_t * update_resv_msg));
+extern void slurm_init_resv_desc_msg(resv_desc_msg_t *update_resv_msg);
 /*
  * slurm_create_reservation - create a new reservation, only usable by user root
  * IN resv_msg - description of reservation
  * RET name of reservation on success (caller must free the memory),
  *	otherwise return NULL and set errno to indicate the error
  */
-extern char * slurm_create_reservation PARAMS(
-	(resv_desc_msg_t * resv_msg));
+extern char *slurm_create_reservation(resv_desc_msg_t *resv_msg);
 
 /*
  * slurm_update_reservation - modify an existing reservation, only usable by
@@ -4282,7 +4286,7 @@ extern char * slurm_create_reservation PARAMS(
  * IN resv_msg - description of reservation
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_update_reservation PARAMS((resv_desc_msg_t * resv_msg));
+extern int slurm_update_reservation(resv_desc_msg_t *resv_msg);
 
 /*
  * slurm_delete_reservation - issue RPC to delete a reservation, only usable
@@ -4290,8 +4294,7 @@ extern int slurm_update_reservation PARAMS((resv_desc_msg_t * resv_msg));
  * IN resv_msg - description of reservation to delete
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_delete_reservation PARAMS(
-	(reservation_name_msg_t * resv_msg));
+extern int slurm_delete_reservation(reservation_name_msg_t *resv_msg);
 
 /*
  * slurm_load_reservations - issue RPC to get all slurm reservation
@@ -4302,8 +4305,8 @@ extern int slurm_delete_reservation PARAMS(
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_reservation_info_msg
  */
-extern int slurm_load_reservations PARAMS((time_t update_time,
-					   reserve_info_msg_t **resp));
+extern int slurm_load_reservations(time_t update_time,
+				   reserve_info_msg_t **resp);
 
 /*
  * slurm_print_reservation_info_msg - output information about all Slurm
@@ -4312,9 +4315,9 @@ extern int slurm_load_reservations PARAMS((time_t update_time,
  * IN resv_info_ptr - reservation information message pointer
  * IN one_liner - print as a single line if true
  */
-void slurm_print_reservation_info_msg PARAMS((FILE* out,
-					      reserve_info_msg_t *resv_info_ptr,
-					      int one_liner));
+void slurm_print_reservation_info_msg(FILE* out,
+				      reserve_info_msg_t *resv_info_ptr,
+				      int one_liner);
 
 /*
  * slurm_print_reservation_info - output information about a specific Slurm
@@ -4323,9 +4326,9 @@ void slurm_print_reservation_info_msg PARAMS((FILE* out,
  * IN resv_ptr - an individual reservation information record pointer
  * IN one_liner - print as a single line if true
  */
-void slurm_print_reservation_info PARAMS((FILE* out,
-					  reserve_info_t * resv_ptr,
-					  int one_liner));
+void slurm_print_reservation_info(FILE* out,
+				  reserve_info_t *resv_ptr,
+				  int one_liner);
 
 /*
  * slurm_sprint_reservation_info - output information about a specific Slurm
@@ -4335,8 +4338,7 @@ void slurm_print_reservation_info PARAMS((FILE* out,
  * RET out - char * containing formatted output (must be freed after call)
  *           NULL is returned on failure.
  */
-char *slurm_sprint_reservation_info PARAMS((reserve_info_t * resv_ptr,
-					    int one_liner));
+char *slurm_sprint_reservation_info(reserve_info_t *resv_ptr, int one_liner);
 
 /*
  * slurm_free_reservation_info_msg - free the reservation information
@@ -4344,8 +4346,7 @@ char *slurm_sprint_reservation_info PARAMS((reserve_info_t * resv_ptr,
  * IN msg - pointer to reservation information response message
  * NOTE: buffer is loaded by slurm_load_reservation
  */
-extern void slurm_free_reservation_info_msg PARAMS(
-	(reserve_info_msg_t * resv_info_ptr));
+extern void slurm_free_reservation_info_msg(reserve_info_msg_t *resv_info_ptr);
 
 /*****************************************************************************\
  *	SLURM PING/RECONFIGURE/SHUTDOWN FUNCTIONS
@@ -4356,14 +4357,14 @@ extern void slurm_free_reservation_info_msg PARAMS(
  * IN controller - 1==primary controller, 2==secondary controller
  * RET 0 or a slurm error code
  */
-extern int slurm_ping PARAMS((int primary));
+extern int slurm_ping(int primary);
 
 /*
  * slurm_reconfigure - issue RPC to have Slurm controller (slurmctld)
  *	reload its configuration file
  * RET 0 or a slurm error code
  */
-extern int slurm_reconfigure PARAMS((void));
+extern int slurm_reconfigure(void);
 
 /*
  * slurm_shutdown - issue RPC to have Slurm controller (slurmctld)
@@ -4374,7 +4375,7 @@ extern int slurm_reconfigure PARAMS((void));
  *              2: only the slurmctld is shutdown (no core file)
  * RET 0 or a slurm error code
  */
-extern int slurm_shutdown PARAMS((uint16_t options));
+extern int slurm_shutdown(uint16_t options);
 
 /*
  * slurm_takeover - issue RPC to have Slurm backup controller (slurmctld)
@@ -4382,7 +4383,7 @@ extern int slurm_shutdown PARAMS((uint16_t options));
  *
  * RET 0 or a slurm error code
  */
-extern int slurm_takeover PARAMS((void));
+extern int slurm_takeover(void);
 
 /*
  * slurm_set_debugflags - issue RPC to set slurm controller debug flags
@@ -4390,22 +4391,22 @@ extern int slurm_takeover PARAMS((void));
  * IN debug_flags_minus - debug flags to be removed
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_set_debugflags PARAMS((uint64_t debug_flags_plus,
-					uint64_t debug_flags_minus));
+extern int slurm_set_debugflags(uint64_t debug_flags_plus,
+				uint64_t debug_flags_minus);
 
 /*
  * slurm_set_debug_level - issue RPC to set slurm controller debug level
  * IN debug_level - requested debug level
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_set_debug_level PARAMS((uint32_t debug_level));
+extern int slurm_set_debug_level(uint32_t debug_level);
 
 /*
  * slurm_set_schedlog_level - issue RPC to set slurm scheduler log level
  * IN schedlog_level - requested scheduler log level
  * RET 0 on success, otherwise return -1 and set errno to indicate the error
  */
-extern int slurm_set_schedlog_level PARAMS((uint32_t schedlog_level));
+extern int slurm_set_schedlog_level(uint32_t schedlog_level);
 
 /*****************************************************************************\
  *      SLURM JOB SUSPEND FUNCTIONS
@@ -4416,7 +4417,7 @@ extern int slurm_set_schedlog_level PARAMS((uint32_t schedlog_level));
  * IN job_id  - job on which to perform operation
  * RET 0 or a slurm error code
  */
-extern int slurm_suspend PARAMS((uint32_t job_id));
+extern int slurm_suspend(uint32_t job_id);
 
 /*
  * slurm_suspend2 - suspend execution of a job.
@@ -4426,14 +4427,14 @@ extern int slurm_suspend PARAMS((uint32_t job_id));
  *	      free using slurm_free_job_array_resp()
  * RET 0 or a slurm error code
  */
-extern int slurm_suspend2 PARAMS((char *job_id, job_array_resp_msg_t **resp));
+extern int slurm_suspend2(char *job_id, job_array_resp_msg_t **resp);
 
 /*
  * slurm_resume - resume execution of a previously suspended job.
  * IN job_id  - job on which to perform operation
  * RET 0 or a slurm error code
  */
-extern int slurm_resume PARAMS((uint32_t job_id));
+extern int slurm_resume(uint32_t job_id);
 
 /*
  * slurm_resume2 - resume execution of a previously suspended job.
@@ -4443,10 +4444,10 @@ extern int slurm_resume PARAMS((uint32_t job_id));
  *	      free using slurm_free_job_array_resp()
  * RET 0 or a slurm error code
  */
-extern int slurm_resume2 PARAMS((char *job_id, job_array_resp_msg_t **resp));
+extern int slurm_resume2(char *job_id, job_array_resp_msg_t **resp);
 
 /* Free job array oriented response with individual return codes by task ID */
-extern void slurm_free_job_array_resp PARAMS((job_array_resp_msg_t *resp));
+extern void slurm_free_job_array_resp(job_array_resp_msg_t *resp);
 
 /*
  * slurm_requeue - re-queue a batch job, if already running
@@ -4461,7 +4462,7 @@ extern void slurm_free_job_array_resp PARAMS((job_array_resp_msg_t *resp));
  *            JOB_PENDING and held state.
  * RET 0 or a slurm error code
  */
-extern int slurm_requeue PARAMS((uint32_t job_id, uint32_t state));
+extern int slurm_requeue(uint32_t job_id, uint32_t state);
 
 /*
  * slurm_requeue2 - re-queue a batch job, if already running
@@ -4479,8 +4480,9 @@ extern int slurm_requeue PARAMS((uint32_t job_id, uint32_t state));
  *	      free using slurm_free_job_array_resp()
  * RET 0 or a slurm error code
  */
-extern int slurm_requeue2 PARAMS((char *job_id, uint32_t state,
-				  job_array_resp_msg_t **resp));
+extern int slurm_requeue2(char *job_id,
+			  uint32_t state,
+			  job_array_resp_msg_t **resp);
 
 /*****************************************************************************\
  *      SLURM JOB CHECKPOINT FUNCTIONS
@@ -4494,8 +4496,9 @@ extern int slurm_requeue2 PARAMS((char *job_id, uint32_t state,
  * OUT start_time - time at which checkpoint request was issued
  * RET 0 (can be checkpoined) or a slurm error code
  */
-extern int slurm_checkpoint_able PARAMS((uint32_t job_id, uint32_t step_id,
-					 time_t *start_time));
+extern int slurm_checkpoint_able(uint32_t job_id,
+				 uint32_t step_id,
+				 time_t *start_time);
 
 /*
  * slurm_checkpoint_disable - disable checkpoint requests for some job step
@@ -4503,8 +4506,7 @@ extern int slurm_checkpoint_able PARAMS((uint32_t job_id, uint32_t step_id,
  * IN step_id - job step on which to perform operation
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_disable PARAMS((uint32_t job_id,
-					    uint32_t step_id));
+extern int slurm_checkpoint_disable(uint32_t job_id, uint32_t step_id);
 
 
 /*
@@ -4513,8 +4515,7 @@ extern int slurm_checkpoint_disable PARAMS((uint32_t job_id,
  * IN step_id - job step on which to perform operation
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_enable PARAMS((uint32_t job_id,
-					   uint32_t step_id));
+extern int slurm_checkpoint_enable(uint32_t job_id, uint32_t step_id);
 
 /*
  * slurm_checkpoint_create - initiate a checkpoint requests for some job step.
@@ -4525,10 +4526,10 @@ extern int slurm_checkpoint_enable PARAMS((uint32_t job_id,
  * IN image_dir - directory to store image files
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_create PARAMS((uint32_t job_id,
-					   uint32_t step_id,
-					   uint16_t max_wait,
-					   char *image_dir));
+extern int slurm_checkpoint_create(uint32_t job_id,
+				   uint32_t step_id,
+				   uint16_t max_wait,
+				   char *image_dir);
 
 /*
  * slurm_checkpoint_requeue - initiate a checkpoint requests for some job.
@@ -4538,8 +4539,9 @@ extern int slurm_checkpoint_create PARAMS((uint32_t job_id,
  * IN image_dir - directory used to get/put checkpoint images
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_requeue PARAMS((uint32_t job_id, uint16_t max_wait,
-					    char *image_dir));
+extern int slurm_checkpoint_requeue(uint32_t job_id,
+				    uint16_t max_wait,
+				    char *image_dir);
 
 /*
  * slurm_checkpoint_vacate - initiate a checkpoint requests for some job step.
@@ -4550,10 +4552,10 @@ extern int slurm_checkpoint_requeue PARAMS((uint32_t job_id, uint16_t max_wait,
  * IN image_dir - directory to store image files
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_vacate PARAMS((uint32_t job_id,
-					   uint32_t step_id,
-					   uint16_t max_wait,
-					   char *image_dir));
+extern int slurm_checkpoint_vacate(uint32_t job_id,
+				   uint32_t step_id,
+				   uint16_t max_wait,
+				   char *image_dir);
 
 /*
  * slurm_checkpoint_restart - restart execution of a checkpointed job step.
@@ -4563,10 +4565,10 @@ extern int slurm_checkpoint_vacate PARAMS((uint32_t job_id,
  * IN image_dir - directory to find checkpoint image files
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_restart PARAMS((uint32_t job_id,
-					    uint32_t step_id,
-					    uint16_t stick,
-					    char *image_dir));
+extern int slurm_checkpoint_restart(uint32_t job_id,
+				    uint32_t step_id,
+				    uint16_t stick,
+				    char *image_dir);
 
 /*
  * slurm_checkpoint_complete - note the completion of a job step's checkpoint
@@ -4578,11 +4580,11 @@ extern int slurm_checkpoint_restart PARAMS((uint32_t job_id,
  * IN error_msg - error message, preserved for highest error_code
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_complete PARAMS((uint32_t job_id,
-					     uint32_t step_id,
-					     time_t begin_time,
-					     uint32_t error_code,
-					     char *error_msg));
+extern int slurm_checkpoint_complete(uint32_t job_id,
+				     uint32_t step_id,
+				     time_t begin_time,
+				     uint32_t error_code,
+				     char *error_msg);
 
 /*
  * slurm_checkpoint_task_complete - note the completion of a task's checkpoint
@@ -4595,12 +4597,12 @@ extern int slurm_checkpoint_complete PARAMS((uint32_t job_id,
  * IN error_msg - error message, preserved for highest error_code
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_task_complete PARAMS((uint32_t job_id,
-						  uint32_t step_id,
-						  uint32_t task_id,
-						  time_t begin_time,
-						  uint32_t error_code,
-						  char *error_msg));
+extern int slurm_checkpoint_task_complete(uint32_t job_id,
+					  uint32_t step_id,
+					  uint32_t task_id,
+					  time_t begin_time,
+					  uint32_t error_code,
+					  char *error_msg);
 
 /*
  * slurm_checkpoint_error - gather error information for the last checkpoint
@@ -4615,9 +4617,10 @@ extern int slurm_checkpoint_task_complete PARAMS((uint32_t job_id,
  *	must be freed by the caller to prevent memory leak
  * RET 0 or a slurm error code
  */
-extern int slurm_checkpoint_error PARAMS((uint32_t job_id, uint32_t step_id,
-					  uint32_t *error_code,
-					  char **error_msg));
+extern int slurm_checkpoint_error(uint32_t job_id,
+				  uint32_t step_id,
+				  uint32_t *error_code,
+				  char **error_msg);
 
 /*
  * slurm_checkpoint_tasks - send checkpoint request to tasks of
@@ -4629,9 +4632,12 @@ extern int slurm_checkpoint_error PARAMS((uint32_t job_id, uint32_t step_id,
  * IN nodelist: nodes to send the request
  * RET: 0 on success, non-zero on failure with errno set
  */
-extern int slurm_checkpoint_tasks PARAMS((uint32_t job_id, uint16_t step_id,
-					  time_t begin_time, char *image_dir,
-					  uint16_t max_wait, char *nodelist));
+extern int slurm_checkpoint_tasks(uint32_t job_id,
+				  uint16_t step_id,
+				  time_t begin_time,
+				  char *image_dir,
+				  uint16_t max_wait,
+				  char *nodelist);
 
 /*****************************************************************************\
  *      SLURM TRIGGER FUNCTIONS
@@ -4641,38 +4647,38 @@ extern int slurm_checkpoint_tasks PARAMS((uint32_t job_id, uint16_t step_id,
  * slurm_set_trigger - Set an event trigger
  * RET 0 or a slurm error code
  */
-extern int slurm_set_trigger PARAMS((trigger_info_t * trigger_set));
+extern int slurm_set_trigger(trigger_info_t *trigger_set);
 
 /*
  * slurm_clear_trigger - Clear (remove) an existing event trigger
  * RET 0 or a slurm error code
  */
-extern int slurm_clear_trigger PARAMS((trigger_info_t * trigger_clear));
+extern int slurm_clear_trigger(trigger_info_t *trigger_clear);
 
 /*
  * slurm_get_triggers - Get all event trigger information
  * Use slurm_free_trigger_msg() to free the memory allocated by this function
  * RET 0 or a slurm error code
  */
-extern int slurm_get_triggers PARAMS((trigger_info_msg_t ** trigger_get));
+extern int slurm_get_triggers(trigger_info_msg_t **trigger_get);
 
 /*
  * slurm_pull_trigger - Pull an event trigger
  * RET 0 or a slurm error code
  */
-extern int slurm_pull_trigger PARAMS((trigger_info_t * trigger_pull));
+extern int slurm_pull_trigger(trigger_info_t *trigger_pull);
 
 /*
  * slurm_free_trigger_msg - Free data structure returned by
  * slurm_get_triggers()
  */
-extern void slurm_free_trigger_msg PARAMS((trigger_info_msg_t * trigger_free));
+extern void slurm_free_trigger_msg(trigger_info_msg_t *trigger_free);
 
 /*
  * slurm_init_trigger_msg - initialize trigger clear/update message
  * OUT trigger_info_msg - user defined trigger descriptor
  */
-void slurm_init_trigger_msg PARAMS((trigger_info_t *trigger_info_msg));
+void slurm_init_trigger_msg(trigger_info_t *trigger_info_msg);
 
 /*****************************************************************************\
  *      SLURM BURST BUFFER FUNCTIONS
@@ -4703,24 +4709,24 @@ void slurm_init_trigger_msg PARAMS((trigger_info_t *trigger_info_msg));
 #define BB_STATE_TEARDOWN	0x0041		/* Cray: bbs_teardown started */
 #define BB_STATE_COMPLETE	0x0042		/* Cray: bbs_teardown complete */
 
+/* Information about alternate pools or other burst buffer resources */
 typedef struct {
-	uint64_t avail_cnt;	/* Total count of available resources, unused
+	uint64_t total_space;	/* Total size of available resources, unused
 				 * by burst_buffer_resv_t */
 	uint64_t granularity;	/* Granularity of resource allocation size */
-	char *name;		/* Generic burst buffer resource, e.g. "nodes" */
-	uint64_t used_cnt;	/* Count of used resources */
-} burst_buffer_gres_t;
+	char *name;		/* Resource (pool) name */
+	uint64_t used_space;	/* Size of used resources */
+} burst_buffer_pool_t;
 
 typedef struct {
 	char *account;		/* Associated account (for limits) */
 	uint32_t array_job_id;
 	uint32_t array_task_id;
 	time_t create_time;	/* Time of creation */
-	uint32_t gres_cnt;	/* Count of records in gres_ptr */
-	burst_buffer_gres_t *gres_ptr;
 	uint32_t job_id;
 	char *name;		/* Name of persistent burst buffer */
 	char *partition;	/* Associated partition (for limits) */
+	char *pool;		/* Resource (pool) name */
 	char *qos;		/* Associated QOS (for limits) */
 	uint64_t size;		/* In bytes by default */
 	uint16_t state;		/* See BB_STATE_* */
@@ -4741,9 +4747,10 @@ typedef struct {
 	uint32_t flags;			/* See BB_FLAG_* above */
 	char *get_sys_state;
 	uint64_t granularity;		/* Granularity of resource allocation */
-	uint32_t gres_cnt;		/* Count of records in gres_ptr */
-	burst_buffer_gres_t *gres_ptr;
+	uint32_t pool_cnt;		/* Count of records in pool_ptr */
+	burst_buffer_pool_t *pool_ptr;
 	char *name;			/* Plugin name */
+	uint32_t other_timeout;		/* Seconds or zero */
 	uint32_t stage_in_timeout;	/* Seconds or zero */
 	uint32_t stage_out_timeout;	/* Seconds or zero */
 	char *start_stage_in;
@@ -4752,6 +4759,7 @@ typedef struct {
 	char *stop_stage_out;
 	uint64_t total_space;		/* In bytes */
 	uint64_t used_space;		/* In bytes */
+	uint32_t validate_timeout;	/* Seconds or zero */
 
 	uint32_t  buffer_count;
 	burst_buffer_resv_t *burst_buffer_resv_ptr;
@@ -4779,8 +4787,7 @@ extern char *slurm_burst_buffer_state_string(uint16_t state);
  * RET 0 or a slurm error code
  * NOTE: free the response using slurm_free_burst_buffer_info_msg
  */
-extern int slurm_load_burst_buffer_info PARAMS(
-		(burst_buffer_info_msg_t **burst_buffer_info_msg_pptr));
+extern int slurm_load_burst_buffer_info(burst_buffer_info_msg_t **burst_buffer_info_msg_pptr);
 
 /*
  * slurm_free_burst_buffer_info_msg - free buffer returned by
@@ -4788,8 +4795,7 @@ extern int slurm_load_burst_buffer_info PARAMS(
  * IN burst_buffer_info_msg_ptr - pointer to burst_buffer_info_msg_t
  * RET 0 or a slurm error code
  */
-extern void slurm_free_burst_buffer_info_msg PARAMS(
-		(burst_buffer_info_msg_t *burst_buffer_info_msg));
+extern void slurm_free_burst_buffer_info_msg(burst_buffer_info_msg_t *burst_buffer_info_msg);
 
 /*
  * slurm_print_burst_buffer_info_msg - output information about burst buffers
@@ -4799,9 +4805,10 @@ extern void slurm_free_burst_buffer_info_msg PARAMS(
  * IN one_liner - print as a single line if true
  * IN verbose - higher values to log additional details
  */
-extern void slurm_print_burst_buffer_info_msg PARAMS(
-		(FILE *out, burst_buffer_info_msg_t *info_ptr, int one_liner,
-		 int verbosity));
+extern void slurm_print_burst_buffer_info_msg(FILE *out,
+					      burst_buffer_info_msg_t *info_ptr,
+					      int one_liner,
+					      int verbosity);
 
 /*
  * slurm_print_burst_buffer_record - output information about a specific Slurm
@@ -4814,9 +4821,10 @@ extern void slurm_print_burst_buffer_info_msg PARAMS(
  * RET out - char * containing formatted output (must be freed after call)
  *	   NULL is returned on failure.
  */
-extern void slurm_print_burst_buffer_record PARAMS(
-			(FILE *out, burst_buffer_info_t *burst_buffer_ptr,
-			 int one_liner, int verbose));
+extern void slurm_print_burst_buffer_record(FILE *out,
+					    burst_buffer_info_t *burst_buffer_ptr,
+			 		    int one_liner,
+					    int verbose);
 
 /*
  * slurm_network_callerid - issue RPC to get the job id of a job from a remote
@@ -4828,11 +4836,20 @@ extern void slurm_print_burst_buffer_record PARAMS(
  * IN node_name_size - size of the node_name buffer
  * RET SLURM_PROTOCOL_SUCCESS or SLURM_FAILURE on error
  */
-extern int slurm_network_callerid PARAMS(
-		(network_callerid_msg_t req, uint32_t *job_id,
-		char *node_name, int node_name_size));
+extern int slurm_network_callerid(network_callerid_msg_t req,
+				  uint32_t *job_id,
+				  char *node_name,
+				  int node_name_size);
 
+/*
+ * Move the specified job ID to the top of the queue for a given user ID,
+ *	partition, account, and QOS.
+ * IN job_id_str - a job id
+ * RET 0 or -1 on error */
+extern int slurm_top_job(char *job_id_str);
 
-END_C_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif
diff --git a/slurm/slurm_errno.h b/slurm/slurm_errno.h
index 7d35b10af..d667c4223 100644
--- a/slurm/slurm_errno.h
+++ b/slurm/slurm_errno.h
@@ -40,33 +40,10 @@
 #ifndef _SLURM_ERRNO_H
 #define _SLURM_ERRNO_H
 
-/* BEGIN_C_DECLS should be used at the beginning of your declarations,
-   so that C++ compilers don't mangle their names.  Use _END_C_DECLS at
-   the end of C declarations. */
-#undef BEGIN_C_DECLS
-#undef END_C_DECLS
 #ifdef __cplusplus
-# define BEGIN_C_DECLS	extern "C" {
-# define END_C_DECLS	}
-#else
-# define BEGIN_C_DECLS	/* empty */
-# define END_C_DECLS	/* empty */
+extern "C" {
 #endif
 
-/* PARAMS is a macro used to wrap function prototypes, so that compilers
-   that don't understand ANSI C prototypes still work, and ANSI C
-   compilers can issue warnings about type mismatches.  */
-#undef PARAMS
-#if defined (__STDC__) || defined (_AIX) \
-	|| (defined (__mips) && defined (_SYSTYPE_SVR4)) \
-	|| defined(WIN32) || defined(__cplusplus)
-# define PARAMS(protos)	protos
-#else
-# define PARAMS(protos)	()
-#endif
-
-BEGIN_C_DECLS
-
 #include <errno.h>
 
 /* set errno to the specified value - then return -1 */
@@ -210,6 +187,7 @@ enum {
 	ESLURM_POWER_NOT_AVAIL,
 	ESLURM_POWER_RESERVED,
 	ESLURM_INVALID_POWERCAP,
+	ESLURM_INVALID_MCS_LABEL,
 
 	/* switch specific error codes, specific values defined in plugin module */
 	ESLURM_SWITCH_MIN = 3000,
@@ -280,21 +258,24 @@ enum {
 	ESLURM_OVER_ALLOCATE,
 
 	/* plugin and custom errors */
-	ESLURM_MISSING_TIME_LIMIT       = 8000
+	ESLURM_MISSING_TIME_LIMIT       = 8000,
+	ESLURM_INVALID_KNL
 };
 
 /* look up an errno value */
-char * slurm_strerror PARAMS((int errnum));
+char * slurm_strerror(int errnum);
 
 /* set an errno value */
-void slurm_seterrno PARAMS((int errnum));
+void slurm_seterrno(int errnum);
 
 /* get an errno value */
-int slurm_get_errno PARAMS((void));
+int slurm_get_errno(void);
 
 /* print message: error string for current errno value */
-void slurm_perror PARAMS((char *msg));
+void slurm_perror(char *msg);
 
-END_C_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_SLURM_ERRNO_H */
diff --git a/slurm/slurmdb.h b/slurm/slurmdb.h
index d323455f4..49bb30eeb 100644
--- a/slurm/slurmdb.h
+++ b/slurm/slurmdb.h
@@ -38,33 +38,10 @@
 #ifndef _SLURMDB_H
 #define _SLURMDB_H
 
-/* BEGIN_C_DECLS should be used at the beginning of your declarations,
-   so that C++ compilers don't mangle their names.  Use END_C_DECLS at
-   the end of C declarations. */
-#undef BEGIN_C_DECLS
-#undef END_C_DECLS
 #ifdef __cplusplus
-# define BEGIN_C_DECLS	extern "C" {
-# define END_C_DECLS	}
-#else
-# define BEGIN_C_DECLS	/* empty */
-# define END_C_DECLS	/* empty */
+extern "C" {
 #endif
 
-/* PARAMS is a macro used to wrap function prototypes, so that compilers
-   that don't understand ANSI C prototypes still work, and ANSI C
-   compilers can issue warnings about type mismatches.  */
-#undef PARAMS
-#if defined (__STDC__) || defined (_AIX)			\
-	|| (defined (__mips) && defined (_SYSTYPE_SVR4))	\
-	|| defined(WIN32) || defined(__cplusplus)
-# define PARAMS(protos)	protos
-#else
-# define PARAMS(protos)	()
-#endif
-
-BEGIN_C_DECLS
-
 #include <slurm/slurm.h>
 
 typedef enum {
@@ -188,6 +165,7 @@ typedef enum {
 #define CLUSTER_FLAG_BGP    0x00000004 /* This is a bluegene/p cluster */
 #define CLUSTER_FLAG_BGQ    0x00000008 /* This is a bluegene/q cluster */
 #define CLUSTER_FLAG_SC     0x00000010 /* This is a sun constellation cluster */
+				       /* Removed v16.05 */
 #define CLUSTER_FLAG_XCPU   0x00000020 /* This has xcpu, removed v15.08 */
 #define CLUSTER_FLAG_AIX    0x00000040 /* This is an aix cluster */
 #define CLUSTER_FLAG_MULTSD 0x00000080 /* This cluster is multiple slurmd */
@@ -724,6 +702,8 @@ typedef struct {
 } slurmdb_job_rec_t;
 
 typedef struct {
+	List acct_limit_list; /* slurmdb_used_limits_t's (DON'T PACK
+			       * for state file) */
 	List job_list; /* list of job pointers to submitted/running
 			  jobs (DON'T PACK) */
 	uint32_t grp_used_jobs;	/* count of active jobs (DON'T PACK
@@ -781,8 +761,12 @@ typedef struct {
 					   * (DON'T PACK) */
 	uint32_t grp_wall; /* total time in hours this qos can run for */
 
+	uint32_t max_jobs_pa;	/* max number of jobs an account can
+				 * run with this qos at one time */
 	uint32_t max_jobs_pu;	/* max number of jobs a user can
 				 * run with this qos at one time */
+	uint32_t max_submit_jobs_pa; /* max number of jobs an account can
+					submit with this qos at once */
 	uint32_t max_submit_jobs_pu; /* max number of jobs a user can
 					submit with this qos at once */
 	char *max_tres_mins_pj;    /* max number of tres seconds this
@@ -791,6 +775,12 @@ typedef struct {
 					  * based off the ordering of the
 					  * total number of TRES in the system
 					  * (DON'T PACK) */
+	char *max_tres_pa;         /* max number of tres this
+				    * QOS can allocate per account */
+	uint64_t *max_tres_pa_ctld;   /* max_tres_pa broken out in an array
+				       * based off the ordering of the
+				       * total number of TRES in the system
+				       * (DON'T PACK) */
 	char *max_tres_pj;         /* max number of tres this
 				    * qos can allocate per job */
 	uint64_t *max_tres_pj_ctld;   /* max_tres_pj broken out in an array
@@ -809,6 +799,18 @@ typedef struct {
 				       * based off the ordering of the
 				       * total number of TRES in the system
 				       * (DON'T PACK) */
+	char *max_tres_run_mins_pa;   /* max number of tres minutes this
+				       * qos can having running at one
+				       * time per account, currently
+				       * this doesn't do anything.
+				       */
+	uint64_t *max_tres_run_mins_pa_ctld; /* max_tres_run_mins_pa
+					      * broken out in an array
+					      * based off the ordering
+					      * of the total number of TRES in
+					      * the system, currently
+					      * this doesn't do anything.
+					      * (DON'T PACK) */
 	char *max_tres_run_mins_pu;   /* max number of tres minutes this
 				       * qos can having running at one
 				       * time, currently this doesn't
@@ -978,15 +980,16 @@ typedef struct {
 } slurmdb_txn_rec_t;
 
 /* Right now this is used in the slurmdb_qos_rec_t structure.  In the
- * user_limit_list. */
+ * user_limit_list and acct_limit_list. */
 typedef struct {
+	char *acct; /* If limits for an account this is the accounts name */
 	uint32_t jobs;	/* count of active jobs */
 	uint32_t submit_jobs; /* count of jobs pending or running */
 	uint64_t *tres; /* array of TRES allocated */
 	uint64_t *tres_run_mins; /* array of how many TRES mins are
 				  * allocated currently, currently this doesn't
 				  * do anything and isn't set up. */
-	uint32_t uid;
+	uint32_t uid; /* If limits for a user this is the users uid */
 } slurmdb_used_limits_t;
 
 typedef struct {
@@ -1221,8 +1224,8 @@ extern List slurmdb_associations_modify(void *db_conn,
  * RET: List containing (char *'s) else NULL on error
  * note List needs to be freed with slurm_list_destroy() when called
  */
-extern List slurmdb_associations_remove(
-	void *db_conn, slurmdb_assoc_cond_t *assoc_cond);
+extern List slurmdb_associations_remove(void *db_conn,
+					slurmdb_assoc_cond_t *assoc_cond);
 
 /************** cluster functions **************/
 
@@ -1299,14 +1302,19 @@ extern List slurmdb_report_cluster_user_by_wckey(void *db_conn,
 
 
 extern List slurmdb_report_job_sizes_grouped_by_top_account(void *db_conn,
-							    slurmdb_job_cond_t *job_cond, List grouping_list, bool flat_view);
+							    slurmdb_job_cond_t *job_cond,
+							    List grouping_list,
+							    bool flat_view);
 
 extern List slurmdb_report_job_sizes_grouped_by_wckey(void *db_conn,
-						      slurmdb_job_cond_t *job_cond, List grouping_list);
+						      slurmdb_job_cond_t *job_cond,
+						      List grouping_list);
 
 extern List slurmdb_report_job_sizes_grouped_by_top_account_then_wckey(
-	void *db_conn, slurmdb_job_cond_t *job_cond,
-	List grouping_list, bool flat_view);
+	void *db_conn,
+	slurmdb_job_cond_t *job_cond,
+	List grouping_list,
+	bool flat_view);
 
 
 /* report on users with top usage
@@ -1345,7 +1353,8 @@ extern int slurmdb_connection_close(void **db_conn);
  * IN:  slurmdb_user_cond_t *user_cond
  * RET: SLURM_SUCCESS on success SLURM_ERROR else
  */
-extern int slurmdb_coord_add(void *db_conn, List acct_list,
+extern int slurmdb_coord_add(void *db_conn,
+			     List acct_list,
 			     slurmdb_user_cond_t *user_cond);
 
 /*
@@ -1440,7 +1449,8 @@ extern List slurmdb_get_info_cluster(char *cluster_names);
  * called
  */
 extern int slurmdb_get_first_avail_cluster(job_desc_msg_t *req,
-        char *cluster_names, slurmdb_cluster_rec_t **cluster_rec);
+					   char *cluster_names,
+					   slurmdb_cluster_rec_t **cluster_rec);
 
 /************** helper functions **************/
 extern void slurmdb_destroy_assoc_usage(void *object);
@@ -1498,19 +1508,20 @@ extern void slurmdb_destroy_report_acct_grouping(void *object);
 extern void slurmdb_destroy_report_cluster_grouping(void *object);
 
 extern void slurmdb_init_assoc_rec(slurmdb_assoc_rec_t *assoc,
-					 bool free_it);
+				   bool free_it);
 extern void slurmdb_init_clus_res_rec(slurmdb_clus_res_rec_t *clus_res,
 				      bool free_it);
 extern void slurmdb_init_cluster_rec(slurmdb_cluster_rec_t *cluster,
 				     bool free_it);
 extern void slurmdb_init_qos_rec(slurmdb_qos_rec_t *qos,
-				 bool free_it, uint32_t init_val);
+				 bool free_it,
+				 uint32_t init_val);
 extern void slurmdb_init_res_rec(slurmdb_res_rec_t *res,
 				 bool free_it);
 extern void slurmdb_init_wckey_rec(slurmdb_wckey_rec_t *wckey,
 				   bool free_it);
 extern void slurmdb_init_tres_cond(slurmdb_tres_cond_t *tres,
-				    bool free_it);
+				   bool free_it);
 extern void slurmdb_init_cluster_cond(slurmdb_cluster_cond_t *cluster,
 				      bool free_it);
 extern void slurmdb_init_res_cond(slurmdb_res_cond_t *cluster,
@@ -1519,7 +1530,8 @@ extern void slurmdb_init_res_cond(slurmdb_res_cond_t *cluster,
 /* The next two functions have pointers to assoc_list so do not
  * destroy assoc_list before using the list returned from this function.
  */
-extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list);
+extern List slurmdb_get_hierarchical_sorted_assoc_list(
+	List assoc_list, bool use_lft);
 extern List slurmdb_get_acct_hierarchical_rec_list(List assoc_list);
 
 
@@ -1629,8 +1641,11 @@ extern List slurmdb_tres_get(void *db_conn, slurmdb_tres_cond_t *tres_cond);
  * IN:  end time stamp for records <=
  * RET: SLURM_SUCCESS on success SLURM_ERROR else
  */
-extern int slurmdb_usage_get(void *db_conn,  void *in, int type,
-			     time_t start, time_t end);
+extern int slurmdb_usage_get(void *db_conn,
+			     void *in,
+			     int type,
+			     time_t start,
+			     time_t end);
 
 /*
  * roll up data in the storage
@@ -1640,7 +1655,8 @@ extern int slurmdb_usage_get(void *db_conn,  void *in, int type,
  * RET: SLURM_SUCCESS on success SLURM_ERROR else
  */
 extern int slurmdb_usage_roll(void *db_conn,
-			      time_t sent_start, time_t sent_end,
+			      time_t sent_start,
+			      time_t sent_end,
 			      uint16_t archive_data);
 
 /************** user functions **************/
@@ -1723,6 +1739,8 @@ extern List slurmdb_wckeys_modify(void *db_conn,
 extern List slurmdb_wckeys_remove(void *db_conn,
 				  slurmdb_wckey_cond_t *wckey_cond);
 
-END_C_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* !_SLURMDB_H */
diff --git a/slurm/spank.h b/slurm/spank.h
index 67fc7f3f2..2db5ec499 100644
--- a/slurm/spank.h
+++ b/slurm/spank.h
@@ -38,16 +38,6 @@
 #ifndef SPANK_H
 #define SPANK_H
 
-#undef BEGIN_C_DECLS
-#undef END_C_DECLS
-#ifdef __cplusplus
-#  define BEGIN_C_DECLS         extern "C" {
-#  define END_C_DECLS           }
-#else  /* !__cplusplus */
-#  define BEGIN_C_DECLS         /* empty */
-#  define END_C_DECLS           /* empty */
-#endif /* !__cplusplus */
-
 /*  SPANK handle. Plug-in's context for running SLURM job
  */
 typedef struct spank_handle * spank_t;
@@ -254,7 +244,9 @@ extern struct spank_option spank_options [];
 
 /*  SPANK interface prototypes
  */
-BEGIN_C_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  *  Return the string representation of a spank_err_t error code.
@@ -425,7 +417,9 @@ extern void slurm_debug2 (const char *format, ...)
 extern void slurm_debug3 (const char *format, ...)
   __attribute__ ((format (printf, 1, 2)));
 
-END_C_DECLS
+#ifdef __cpluscplus
+}
+#endif
 
 /*
  *  All spank plugins must issue the following for the SLURM plugin
@@ -436,5 +430,4 @@ END_C_DECLS
     const char plugin_type [] = "spank"; \
     const unsigned int plugin_version = __ver;
 
-
 #endif /* !SPANK_H */
diff --git a/src/Makefile.am b/src/Makefile.am
index 47807fc65..238c07a15 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,5 +1,6 @@
 SUBDIRS =		\
 	api		\
+	bcast		\
 	common		\
 	database	\
 	db_api		\
diff --git a/src/Makefile.in b/src/Makefile.in
index 7cccffb23..8b1581d30 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -91,7 +91,8 @@ target_triplet = @target@
 @REAL_BG_L_P_LOADED_FALSE@am__append_1 = srun
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -195,7 +196,7 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = api common database db_api layouts plugins sacct \
+DIST_SUBDIRS = api bcast common database db_api layouts plugins sacct \
 	sacctmgr salloc sattach sbatch sbcast scancel scontrol sdiag \
 	sinfo slurmctld slurmd slurmdbd smap smd sprio squeue sreport \
 	srun_cr sshare sstat strigger sview srun
@@ -230,8 +231,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -331,6 +330,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -369,6 +372,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -412,6 +418,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -462,6 +471,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -474,9 +484,9 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = api common database db_api layouts plugins sacct sacctmgr \
-	salloc sattach sbatch sbcast scancel scontrol sdiag sinfo \
-	slurmctld slurmd slurmdbd smap smd sprio squeue sreport \
+SUBDIRS = api bcast common database db_api layouts plugins sacct \
+	sacctmgr salloc sattach sbatch sbcast scancel scontrol sdiag \
+	sinfo slurmctld slurmd slurmdbd smap smd sprio squeue sreport \
 	srun_cr sshare sstat strigger sview $(am__append_1)
 all: all-recursive
 
diff --git a/src/api/Makefile.in b/src/api/Makefile.in
index f9805b3e5..d2b32e71f 100644
--- a/src/api/Makefile.in
+++ b/src/api/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 noinst_PROGRAMS = libslurm.o$(EXEEXT)
 subdir = src/api
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -279,8 +280,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -381,6 +380,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -419,6 +422,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -462,6 +468,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -512,6 +521,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/api/allocate.c b/src/api/allocate.c
index c8b910dfe..359e478d0 100644
--- a/src/api/allocate.c
+++ b/src/api/allocate.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  allocate.c - allocate nodes for a job or step with supplied contraints
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -766,7 +765,8 @@ _handle_msg(slurm_msg_t *msg, resource_allocation_response_msg_t **resp)
 		case RESPONSE_RESOURCE_ALLOCATION:
 			debug2("resource allocation response received");
 			slurm_send_rc_msg(msg, SLURM_SUCCESS);
-			*resp = msg->data;
+			*resp = msg->data;    /* transfer payload to response */
+			msg->data = NULL;
 			rc = 1;
 			break;
 		case SRUN_JOB_COMPLETE:
@@ -820,7 +820,7 @@ _accept_msg_connection(int listen_fd,
 		return SLURM_ERROR;
 	}
 
-	rc = _handle_msg(msg, resp); /* handle_msg frees msg */
+	rc = _handle_msg(msg, resp); /* _handle_msg transfers message payload */
 	slurm_free_msg(msg);
 
 	slurm_close(conn_fd);
diff --git a/src/api/allocate_msg.c b/src/api/allocate_msg.c
index 6c4b84bfc..e60791c3d 100644
--- a/src/api/allocate_msg.c
+++ b/src/api/allocate_msg.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  allocate_msg.c - Message handler for communication with with
  *                       the slurmctld during an allocation.
- *  $Id: allocate_msg.c 11641 2007-06-05 23:03:51Z jette $
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -86,9 +85,9 @@ static void *_msg_thr_internal(void *arg)
 
 	debug("Entering _msg_thr_internal");
 	xsignal_block(signals);
-	pthread_mutex_lock(&msg_thr_start_lock);
+	slurm_mutex_lock(&msg_thr_start_lock);
 	pthread_cond_signal(&msg_thr_start_cond);
-	pthread_mutex_unlock(&msg_thr_start_lock);
+	slurm_mutex_unlock(&msg_thr_start_lock);
 	eio_handle_mainloop((eio_handle_t *)arg);
 	debug("Leaving _msg_thr_internal");
 
@@ -145,7 +144,7 @@ extern allocation_msg_thread_t *slurm_allocation_msg_thr_create(
 		return NULL;
 	}
 	eio_new_initial_obj(msg_thr->handle, obj);
-	pthread_mutex_lock(&msg_thr_start_lock);
+	slurm_mutex_lock(&msg_thr_start_lock);
 	slurm_attr_init(&attr);
 	if (pthread_create(&msg_thr->id, &attr,
 			   _msg_thr_internal, (void *)msg_thr->handle) != 0) {
@@ -160,7 +159,7 @@ extern allocation_msg_thread_t *slurm_allocation_msg_thr_create(
 	/* Wait until the message thread has blocked signals
 	   before continuing. */
 	pthread_cond_wait(&msg_thr_start_cond, &msg_thr_start_lock);
-	pthread_mutex_unlock(&msg_thr_start_lock);
+	slurm_mutex_unlock(&msg_thr_start_lock);
 
 	return (allocation_msg_thread_t *)msg_thr;
 }
@@ -187,8 +186,6 @@ static void _handle_node_fail(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.node_fail != NULL)
 		(msg_thr->callback.node_fail)(nf);
-
-	slurm_free_srun_node_fail_msg(msg->data);
 }
 
 /*
@@ -205,8 +202,6 @@ static void _handle_timeout(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.timeout != NULL)
 		(msg_thr->callback.timeout)(to);
-
-	slurm_free_srun_timeout_msg(msg->data);
 }
 
 static void _handle_user_msg(struct allocation_msg_thread *msg_thr,
@@ -217,8 +212,6 @@ static void _handle_user_msg(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.user_msg != NULL)
 		(msg_thr->callback.user_msg)(um);
-
-	slurm_free_srun_user_msg(msg->data);
 }
 
 static void _handle_ping(struct allocation_msg_thread *msg_thr,
@@ -230,8 +223,6 @@ static void _handle_ping(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.ping != NULL)
 		(msg_thr->callback.ping)(ping);
-
-	slurm_free_srun_ping_msg(msg->data);
 }
 
 static void _handle_job_complete(struct allocation_msg_thread *msg_thr,
@@ -242,8 +233,6 @@ static void _handle_job_complete(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.job_complete != NULL)
 		(msg_thr->callback.job_complete)(comp);
-
-	slurm_free_srun_job_complete_msg(msg->data);
 }
 
 static void _handle_suspend(struct allocation_msg_thread *msg_thr,
@@ -254,8 +243,6 @@ static void _handle_suspend(struct allocation_msg_thread *msg_thr,
 
 	if (msg_thr->callback.job_suspend != NULL)
 		(msg_thr->callback.job_suspend)(sus_msg);
-
-	slurm_free_suspend_msg(msg->data);
 }
 
 static void
diff --git a/src/api/block_info.c b/src/api/block_info.c
index 84b2e4f8c..86cd6523d 100644
--- a/src/api/block_info.c
+++ b/src/api/block_info.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  node_select_info.c - get the node select plugin state information of slurm
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -125,10 +123,10 @@ char *slurm_sprint_block_info(
 
 	/****** Line 1 ******/
 	convert_num_unit((float)block_ptr->cnode_cnt, tmp1, sizeof(tmp1),
-			 UNIT_NONE, CONVERT_NUM_UNIT_EXACT);
+			 UNIT_NONE, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 	if (cluster_flags & CLUSTER_FLAG_BGQ) {
 		convert_num_unit((float)block_ptr->cnode_err_cnt, tmp2,
-				 sizeof(tmp2), UNIT_NONE,
+				 sizeof(tmp2), UNIT_NONE, NO_VAL,
 				 CONVERT_NUM_UNIT_EXACT);
 		tmp_char = xstrdup_printf("%s/%s", tmp1, tmp2);
 	} else
diff --git a/src/api/burst_buffer_info.c b/src/api/burst_buffer_info.c
index 31657216e..c0c6d2a19 100644
--- a/src/api/burst_buffer_info.c
+++ b/src/api/burst_buffer_info.c
@@ -166,7 +166,6 @@ static void _print_burst_buffer_resv(FILE *out,
 {
 	char sz_buf[32], time_buf[64], tmp_line[512];
 	char *out_buf = NULL;
-	int i;
 
 	/****** Line 1 ******/
 	if (burst_buffer_ptr->job_id &&
@@ -194,36 +193,24 @@ static void _print_burst_buffer_resv(FILE *out,
 	}
 	if (verbose) {
 		snprintf(tmp_line, sizeof(tmp_line),
-			 "Account=%s CreateTime=%s Partition=%s QOS=%s "
+			 "Account=%s CreateTime=%s Partition=%s Pool=%s QOS=%s "
 			 "Size=%s State=%s UserID=%s(%u)",
-			 burst_buffer_ptr->account,  time_buf,
-			 burst_buffer_ptr->partition, burst_buffer_ptr->qos,
+			 burst_buffer_ptr->account, time_buf,
+			 burst_buffer_ptr->partition, burst_buffer_ptr->pool,
+			 burst_buffer_ptr->qos,
 			 sz_buf, bb_state_string(burst_buffer_ptr->state),
 			 uid_to_string(burst_buffer_ptr->user_id),
 			 burst_buffer_ptr->user_id);
 	} else {
 		snprintf(tmp_line, sizeof(tmp_line),
-			 "CreateTime=%s Size=%s State=%s UserID=%s(%u)",
-			 time_buf, sz_buf,
+			 "CreateTime=%s Pool=%s Size=%s State=%s UserID=%s(%u)",
+			 time_buf, burst_buffer_ptr->pool, sz_buf,
 			 bb_state_string(burst_buffer_ptr->state),
 			 uid_to_string(burst_buffer_ptr->user_id),
 			 burst_buffer_ptr->user_id);
 	}
 	xstrcat(out_buf, tmp_line);
 
-	/* Gres includes "nodes" on Cray systems */
-	for (i = 0; i < burst_buffer_ptr->gres_cnt; i++) {
-		if (i == 0)
-			xstrcat(out_buf, " Gres=");
-		else
-			xstrcat(out_buf, ",");
-		_get_size_str(sz_buf, sizeof(sz_buf),
-			      burst_buffer_ptr->gres_ptr[i].used_cnt);
-		snprintf(tmp_line, sizeof(tmp_line), "%s:%s",
-			 burst_buffer_ptr->gres_ptr[i].name, sz_buf);
-		xstrcat(out_buf, tmp_line);
-	}
-
 	xstrcat(out_buf, "\n");
 	fprintf(out, "%s", out_buf);
 	xfree(out_buf);
@@ -271,7 +258,7 @@ extern void slurm_print_burst_buffer_record(FILE *out,
 	int i;
 
 	/****** Line ******/
-	_get_size_str(g_sz_buf, sizeof(t_sz_buf),
+	_get_size_str(g_sz_buf, sizeof(g_sz_buf),
 		      burst_buffer_ptr->granularity);
 	_get_size_str(t_sz_buf, sizeof(t_sz_buf),
 		      burst_buffer_ptr->total_space);
@@ -287,16 +274,19 @@ extern void slurm_print_burst_buffer_record(FILE *out,
 		xstrcat(out_buf, "\n");
 
 	/****** Line (optional) ******/
-	/* Gres includes "nodes" on Cray systems */
-	for (i = 0; i < burst_buffer_ptr->gres_cnt; i++) {
+	/* Alternate pool information */
+	for (i = 0; i < burst_buffer_ptr->pool_cnt; i++) {
+		_get_size_str(g_sz_buf, sizeof(g_sz_buf),
+			      burst_buffer_ptr->pool_ptr[i].granularity);
 		_get_size_str(t_sz_buf, sizeof(t_sz_buf),
-			      burst_buffer_ptr->gres_ptr[i].avail_cnt);
+			      burst_buffer_ptr->pool_ptr[i].total_space);
 		_get_size_str(u_sz_buf, sizeof(u_sz_buf),
-			      burst_buffer_ptr->gres_ptr[i].used_cnt);
+			      burst_buffer_ptr->pool_ptr[i].used_space);
 		snprintf(tmp_line, sizeof(tmp_line),
-			 "  Gres[%d] Name=%s AvailCount=%s UsedCount=%s",
-			 i, burst_buffer_ptr->gres_ptr[i].name,
-			 t_sz_buf, u_sz_buf);
+			 "  AltPoolName[%d]=%s Granularity=%s TotalSpace=%s "
+			 "UsedSpace=%s",
+			 i, burst_buffer_ptr->pool_ptr[i].name,
+			 g_sz_buf, t_sz_buf, u_sz_buf);
 		xstrcat(out_buf, tmp_line);
 		if (!one_liner)
 			xstrcat(out_buf, "\n");
@@ -304,10 +294,20 @@ extern void slurm_print_burst_buffer_record(FILE *out,
 
 	/****** Line ******/
 	snprintf(tmp_line, sizeof(tmp_line),
-		"  StageInTimeout=%u StageOutTimeout=%u Flags=%s",
+		"  Flags=%s",
+		slurm_bb_flags2str(burst_buffer_ptr->flags));
+	xstrcat(out_buf, tmp_line);
+	if (!one_liner)
+		xstrcat(out_buf, "\n");
+
+	/****** Line ******/
+	snprintf(tmp_line, sizeof(tmp_line),
+		"  StageInTimeout=%u StageOutTimeout=%u ValidateTimeout=%u "
+		"OtherTimeout=%u",
 		burst_buffer_ptr->stage_in_timeout,
 		burst_buffer_ptr->stage_out_timeout,
-		slurm_bb_flags2str(burst_buffer_ptr->flags));
+		burst_buffer_ptr->validate_timeout,
+		burst_buffer_ptr->other_timeout);
 	xstrcat(out_buf, tmp_line);
 	if (!one_liner)
 		xstrcat(out_buf, "\n");
diff --git a/src/api/checkpoint.c b/src/api/checkpoint.c
index 9ac0e9c7e..9d83426c9 100644
--- a/src/api/checkpoint.c
+++ b/src/api/checkpoint.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  checkpoint.c - Process checkpoint related functions.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/api/complete.c b/src/api/complete.c
index 4d59b5f6c..76efc8113 100644
--- a/src/api/complete.c
+++ b/src/api/complete.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  complete.c - note the completion a slurm job or job step
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/api/config_info.c b/src/api/config_info.c
index c969fdd77..f1ac81519 100644
--- a/src/api/config_info.c
+++ b/src/api/config_info.c
@@ -174,14 +174,14 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 			continue;
 
 		if (node_info_ptr->node_array[i].node_hostname != NULL &&
-		   strcmp(node_info_ptr->node_array[i].node_hostname,
-			  node_info_ptr->node_array[i].name))
+		   xstrcmp(node_info_ptr->node_array[i].node_hostname,
+			   node_info_ptr->node_array[i].name))
 			xstrfmtcat(tmp_str, " NodeHostName=%s",
 				   node_info_ptr->node_array[i].node_hostname);
 
 		if (node_info_ptr->node_array[i].node_addr != NULL &&
-		   strcmp(node_info_ptr->node_array[i].node_addr,
-			  node_info_ptr->node_array[i].name))
+		   xstrcmp(node_info_ptr->node_array[i].node_addr,
+			   node_info_ptr->node_array[i].name))
 		                xstrfmtcat(tmp_str, " NodeAddr=%s",
 				   node_info_ptr->node_array[i].node_addr);
 
@@ -209,7 +209,7 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 		        xstrfmtcat(tmp_str, " TmpDisk=%u",
 				   node_info_ptr->node_array[i].tmp_disk);
 
-		if (node_info_ptr->node_array[i].weight != -1)
+		if (node_info_ptr->node_array[i].weight != 1)
 		        xstrfmtcat(tmp_str, " Weight=%u",
 				   node_info_ptr->node_array[i].weight);
 
@@ -219,7 +219,7 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 
 		/* check for duplicate records */
 		for (crp = rp; crp != NULL; crp = crp->next) {
-			if (!strcmp(crp->rec, tmp_str)) {
+			if (!xstrcmp(crp->rec, tmp_str)) {
 				xfree(tmp_str);
 				break;
 			}
@@ -264,19 +264,19 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 		fprintf(fp, "PartitionName=%s", p[i].name);
 
 		if (p[i].allow_alloc_nodes &&
-		    (strcasecmp(p[i].allow_alloc_nodes, "ALL") != 0))
+		    (xstrcasecmp(p[i].allow_alloc_nodes, "ALL") != 0))
 			fprintf(fp, " AllocNodes=%s",
 				p[i].allow_alloc_nodes);
 
 		if (p[i].allow_accounts &&
-		    (strcasecmp(p[i].allow_accounts, "ALL") != 0))
+		    (xstrcasecmp(p[i].allow_accounts, "ALL") != 0))
 			fprintf(fp, " AllowAccounts=%s", p[i].allow_accounts);
 
 		if (p[i].allow_groups &&
-		    (strcasecmp(p[i].allow_groups, "ALL") != 0))
+		    (xstrcasecmp(p[i].allow_groups, "ALL") != 0))
 			fprintf(fp, " AllowGroups=%s", p[i].allow_groups);
 
-		if (p[i].allow_qos && (strcasecmp(p[i].allow_qos, "ALL") != 0))
+		if (p[i].allow_qos && (xstrcasecmp(p[i].allow_qos, "ALL") != 0))
 			fprintf(fp, " AllowQos=%s", p[i].allow_qos);
 
 		if (p[i].alternate != NULL)
@@ -340,9 +340,10 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 		if (p[i].max_nodes != INFINITE) {
 			char tmp1[16];
 		        if (cluster_flags & CLUSTER_FLAG_BG)
-		                convert_num_unit((float)p[i].max_nodes, tmp1,
-		                                 sizeof(tmp1), UNIT_NONE,
-		                                 CONVERT_NUM_UNIT_EXACT);
+				convert_num_unit((float)p[i].max_nodes, tmp1,
+						 sizeof(tmp1), UNIT_NONE,
+						 NO_VAL,
+						 CONVERT_NUM_UNIT_EXACT);
 		        else
 		                snprintf(tmp1, sizeof(tmp1), "%u",
 					 p[i].max_nodes);
@@ -360,9 +361,10 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 		if (p[i].min_nodes != 1) {
 			char tmp1[16];
 			if (cluster_flags & CLUSTER_FLAG_BG)
-			        convert_num_unit((float)p[i].min_nodes, tmp1,
+				convert_num_unit((float)p[i].min_nodes, tmp1,
 						 sizeof(tmp1), UNIT_NONE,
-			                         CONVERT_NUM_UNIT_EXACT);
+						 NO_VAL,
+						 CONVERT_NUM_UNIT_EXACT);
 			else
 			        snprintf(tmp1, sizeof(tmp1), "%u",
 					 p[i].min_nodes);
@@ -376,8 +378,13 @@ void slurm_write_ctl_conf ( slurm_ctl_conf_info_msg_t * slurm_ctl_conf_ptr,
 			fprintf(fp, " PreemptMode=%s",
 				preempt_mode_string(p[i].preempt_mode));
 
-		if (p[i].priority != 1)
-			fprintf(fp, " Priority=%"PRIu16"", p[i].priority);
+		if (p[i].priority_job_factor != 1)
+			fprintf(fp, " PriorityJobFactor=%"PRIu16,
+				p[i].priority_job_factor);
+
+		if (p[i].priority_tier != 1)
+			fprintf(fp, " PriorityTier=%"PRIu16,
+				p[i].priority_tier);
 
 		if (p[i].qos_char != NULL)
 			fprintf(fp, " QOS=%s", p[i].qos_char);
@@ -719,7 +726,8 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	list_append(ret_list, key_pair);
 	key_pair->name = xstrdup("EnforcePartLimits");
 	key_pair->value = xstrdup(
-		slurm_ctl_conf_ptr->enforce_part_limits ? "Yes" : "No");
+		parse_part_enforce_type_2str(
+			slurm_ctl_conf_ptr->enforce_part_limits));
 
 	key_pair = xmalloc(sizeof(config_key_pair_t));
 	key_pair->name = xstrdup("Epilog");
@@ -750,7 +758,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(tmp_str);
 	list_append(ret_list, key_pair);
 
-	if (strcmp(slurm_ctl_conf_ptr->priority_type, "priority/basic")) {
+	if (xstrcmp(slurm_ctl_conf_ptr->priority_type, "priority/basic")) {
 		snprintf(tmp_str, sizeof(tmp_str), "%u",
 			 slurm_ctl_conf_ptr->fs_dampening_factor);
 		key_pair = xmalloc(sizeof(config_key_pair_t));
@@ -1035,6 +1043,16 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(tmp_str);
 	list_append(ret_list, key_pair);
 
+ 	key_pair = xmalloc(sizeof(config_key_pair_t));
+	key_pair->name = xstrdup("MCSPlugin");
+	key_pair->value = xstrdup(slurm_ctl_conf_ptr->mcs_plugin);
+	list_append(ret_list, key_pair);
+
+	key_pair = xmalloc(sizeof(config_key_pair_t));
+	key_pair->name = xstrdup("MCSParameters");
+	key_pair->value = xstrdup(slurm_ctl_conf_ptr->mcs_plugin_params);
+	list_append(ret_list, key_pair);
+
 	key_pair = xmalloc(sizeof(config_key_pair_t));
 	key_pair->name = xstrdup("MemLimitEnforce");
 	key_pair->value = xstrdup(
@@ -1084,6 +1102,11 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(tmp_str);
 	list_append(ret_list, key_pair);
 
+	key_pair = xmalloc(sizeof(config_key_pair_t));
+	key_pair->name = xstrdup("NodeFeaturesPlugins");
+	key_pair->value = xstrdup(slurm_ctl_conf_ptr->node_features_plugins);
+	list_append(ret_list, key_pair);
+
 	if (slurm_ctl_conf_ptr->over_time_limit == (uint16_t) INFINITE)
 		snprintf(tmp_str, sizeof(tmp_str), "UNLIMITED");
 	else
@@ -1130,7 +1153,7 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(slurm_ctl_conf_ptr->priority_params);
 	list_append(ret_list, key_pair);
 
-	if (strcmp(slurm_ctl_conf_ptr->priority_type, "priority/basic") == 0) {
+	if (xstrcmp(slurm_ctl_conf_ptr->priority_type, "priority/basic") == 0) {
 		key_pair = xmalloc(sizeof(config_key_pair_t));
 		key_pair->name = xstrdup("PriorityType");
 		key_pair->value = xstrdup(slurm_ctl_conf_ptr->priority_type);
@@ -1619,6 +1642,12 @@ extern void *slurm_ctl_conf_2_key_pairs (slurm_ctl_conf_t* slurm_ctl_conf_ptr)
 	key_pair->value = xstrdup(slurm_ctl_conf_ptr->task_prolog);
 	list_append(ret_list, key_pair);
 
+	key_pair = xmalloc(sizeof(config_key_pair_t));
+	key_pair->name = xstrdup("TCPTimeout");
+	key_pair->value = xstrdup_printf("%u sec",
+					 slurm_ctl_conf_ptr->tcp_timeout);
+	list_append(ret_list, key_pair);
+
 	key_pair = xmalloc(sizeof(config_key_pair_t));
 	key_pair->name = xstrdup("TmpFS");
 	key_pair->value = xstrdup(slurm_ctl_conf_ptr->tmp_fs);
@@ -1891,11 +1920,11 @@ static void _write_key_pairs(FILE* out, void *key_pairs)
 	while ((key_pair = list_next(iter))) {
 		/* Ignore ENV variables in config_list; they'll
 		 * cause problems in an active slurm.conf */
-		if (!strcmp(key_pair->name, "BOOT_TIME") ||
-		    !strcmp(key_pair->name, "HASH_VAL") ||
-		    !strcmp(key_pair->name, "NEXT_JOB_ID") ||
-		    !strcmp(key_pair->name, "SLURM_CONF") ||
-		    !strcmp(key_pair->name, "SLURM_VERSION")) {
+		if (!xstrcmp(key_pair->name, "BOOT_TIME") ||
+		    !xstrcmp(key_pair->name, "HASH_VAL") ||
+		    !xstrcmp(key_pair->name, "NEXT_JOB_ID") ||
+		    !xstrcmp(key_pair->name, "SLURM_CONF") ||
+		    !xstrcmp(key_pair->name, "SLURM_VERSION")) {
 			debug("Ignoring %s (not written)", key_pair->name);
 			continue;
 		}
@@ -1905,14 +1934,14 @@ static void _write_key_pairs(FILE* out, void *key_pairs)
 		 * it does imply no value */
 		if ((key_pair->value == NULL) ||
 		    (strlen(key_pair->value) == 0) ||
-		    !strcasecmp(key_pair->value, "(null type)") ||
-		    !strcasecmp(key_pair->value, "(null)") ||
-		    !strcasecmp(key_pair->value, "N/A") ||
-		    (!strcasecmp(key_pair->name, "KeepAliveTime") &&
-		     !strcasecmp(key_pair->value, "SYSTEM_DEFAULT")) ||
-		    !strcasecmp(key_pair->name, "DynAllocPort") ||
-		    (!strcasecmp(key_pair->name, "DefMemPerNode") &&
-		     !strcasecmp(key_pair->value, "UNLIMITED"))) {
+		    !xstrcasecmp(key_pair->value, "(null type)") ||
+		    !xstrcasecmp(key_pair->value, "(null)") ||
+		    !xstrcasecmp(key_pair->value, "N/A") ||
+		    (!xstrcasecmp(key_pair->name, "KeepAliveTime") &&
+		     !xstrcasecmp(key_pair->value, "SYSTEM_DEFAULT")) ||
+		    !xstrcasecmp(key_pair->name, "DynAllocPort") ||
+		    (!xstrcasecmp(key_pair->name, "DefMemPerNode") &&
+		     !xstrcasecmp(key_pair->value, "UNLIMITED"))) {
 			temp = xstrdup_printf("#%s=", key_pair->name);
 			debug("Commenting out %s=%s",
 			      key_pair->name,
@@ -1925,124 +1954,124 @@ static void _write_key_pairs(FILE* out, void *key_pairs)
 					      key_pair->name, temp);
 		}
 
-		if (!strcasecmp(key_pair->name, "ControlMachine") ||
-		    !strcasecmp(key_pair->name, "ControlAddr") ||
-		    !strcasecmp(key_pair->name, "ClusterName") ||
-		    !strcasecmp(key_pair->name, "SlurmUser") ||
-		    !strcasecmp(key_pair->name, "SlurmdUser") ||
-		    !strcasecmp(key_pair->name, "SlurmctldPort") ||
-		    !strcasecmp(key_pair->name, "SlurmdPort") ||
-		    !strcasecmp(key_pair->name, "BackupAddr") ||
-		    !strcasecmp(key_pair->name, "BackupController")) {
+		if (!xstrcasecmp(key_pair->name, "ControlMachine") ||
+		    !xstrcasecmp(key_pair->name, "ControlAddr") ||
+		    !xstrcasecmp(key_pair->name, "ClusterName") ||
+		    !xstrcasecmp(key_pair->name, "SlurmUser") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdUser") ||
+		    !xstrcasecmp(key_pair->name, "SlurmctldPort") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdPort") ||
+		    !xstrcasecmp(key_pair->name, "BackupAddr") ||
+		    !xstrcasecmp(key_pair->name, "BackupController")) {
 			list_append(control_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "StateSaveLocation") ||
-		    !strcasecmp(key_pair->name, "SlurmdSpoolDir") ||
-		    !strcasecmp(key_pair->name, "SlurmctldLogFile") ||
-		    !strcasecmp(key_pair->name, "SlurmdLogFile") ||
-		    !strcasecmp(key_pair->name, "SlurmctldPidFile") ||
-		    !strcasecmp(key_pair->name, "SlurmdPidFile") ||
-		    !strcasecmp(key_pair->name, "SlurmSchedLogFile") ||
-		    !strcasecmp(key_pair->name, "SlurmEventHandlerLogfile")) {
+		if (!xstrcasecmp(key_pair->name, "StateSaveLocation") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdSpoolDir") ||
+		    !xstrcasecmp(key_pair->name, "SlurmctldLogFile") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdLogFile") ||
+		    !xstrcasecmp(key_pair->name, "SlurmctldPidFile") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdPidFile") ||
+		    !xstrcasecmp(key_pair->name, "SlurmSchedLogFile") ||
+		    !xstrcasecmp(key_pair->name, "SlurmEventHandlerLogfile")) {
 			list_append(logging_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "AccountingStorageBackupHost") ||
-		    !strcasecmp(key_pair->name, "AccountingStorageEnforce") ||
-		    !strcasecmp(key_pair->name, "AccountingStorageHost") ||
-		    !strcasecmp(key_pair->name, "AccountingStorageLoc") ||
-		    !strcasecmp(key_pair->name, "AccountingStoragePort") ||
-		    !strcasecmp(key_pair->name, "AccountingStorageType") ||
-		    !strcasecmp(key_pair->name, "AccountingStorageUser") ||
-		    !strcasecmp(key_pair->name, "AccountingStoreJobComment") ||
-		    !strcasecmp(key_pair->name, "AcctGatherEnergyType") ||
-		    !strcasecmp(key_pair->name, "AcctGatherFilesystemType") ||
-		    !strcasecmp(key_pair->name, "AcctGatherInfinibandType") ||
-		    !strcasecmp(key_pair->name, "AcctGatherNodeFreq") ||
-		    !strcasecmp(key_pair->name, "AcctGatherProfileType") ||
-		    !strcasecmp(key_pair->name, "JobAcctGatherFrequency") ||
-		    !strcasecmp(key_pair->name, "JobAcctGatherType") ||
-		    !strcasecmp(key_pair->name, "ExtSensorsType") ||
-		    !strcasecmp(key_pair->name, "ExtSensorsFreq")) {
+		if (!xstrcasecmp(key_pair->name, "AccountingStorageBackupHost") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStorageEnforce") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStorageHost") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStorageLoc") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStoragePort") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStorageType") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStorageUser") ||
+		    !xstrcasecmp(key_pair->name, "AccountingStoreJobComment") ||
+		    !xstrcasecmp(key_pair->name, "AcctGatherEnergyType") ||
+		    !xstrcasecmp(key_pair->name, "AcctGatherFilesystemType") ||
+		    !xstrcasecmp(key_pair->name, "AcctGatherInfinibandType") ||
+		    !xstrcasecmp(key_pair->name, "AcctGatherNodeFreq") ||
+		    !xstrcasecmp(key_pair->name, "AcctGatherProfileType") ||
+		    !xstrcasecmp(key_pair->name, "JobAcctGatherFrequency") ||
+		    !xstrcasecmp(key_pair->name, "JobAcctGatherType") ||
+		    !xstrcasecmp(key_pair->name, "ExtSensorsType") ||
+		    !xstrcasecmp(key_pair->name, "ExtSensorsFreq")) {
 			list_append(accounting_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "SuspendExcNodes") ||
-		    !strcasecmp(key_pair->name, "SuspendExcParts") ||
-		    !strcasecmp(key_pair->name, "SuspendProgram") ||
-		    !strcasecmp(key_pair->name, "SuspendRate") ||
-		    !strcasecmp(key_pair->name, "SuspendTime") ||
-		    !strcasecmp(key_pair->name, "SuspendTimeout") ||
-		    !strcasecmp(key_pair->name, "ResumeProgram") ||
-		    !strcasecmp(key_pair->name, "ResumeRate") ||
-		    !strcasecmp(key_pair->name, "ResumeTimeout")) {
+		if (!xstrcasecmp(key_pair->name, "SuspendExcNodes") ||
+		    !xstrcasecmp(key_pair->name, "SuspendExcParts") ||
+		    !xstrcasecmp(key_pair->name, "SuspendProgram") ||
+		    !xstrcasecmp(key_pair->name, "SuspendRate") ||
+		    !xstrcasecmp(key_pair->name, "SuspendTime") ||
+		    !xstrcasecmp(key_pair->name, "SuspendTimeout") ||
+		    !xstrcasecmp(key_pair->name, "ResumeProgram") ||
+		    !xstrcasecmp(key_pair->name, "ResumeRate") ||
+		    !xstrcasecmp(key_pair->name, "ResumeTimeout")) {
 			list_append(power_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "SelectType") ||
-		    !strcasecmp(key_pair->name, "SelectTypeParameters") ||
-		    !strcasecmp(key_pair->name, "SchedulerParameters") ||
-		    !strcasecmp(key_pair->name, "SchedulerPort") ||
-		    !strcasecmp(key_pair->name, "SchedulerRootFilter") ||
-		    !strcasecmp(key_pair->name, "SchedulerTimeSlice") ||
-		    !strcasecmp(key_pair->name, "SchedulerType") ||
-		    !strcasecmp(key_pair->name, "SlurmSchedLogLevel") ||
-		    !strcasecmp(key_pair->name, "PreemptMode") ||
-		    !strcasecmp(key_pair->name, "PreemptType") ||
-		    !strcasecmp(key_pair->name, "PriorityType") ||
-		    !strcasecmp(key_pair->name, "FastSchedule")) {
+		if (!xstrcasecmp(key_pair->name, "SelectType") ||
+		    !xstrcasecmp(key_pair->name, "SelectTypeParameters") ||
+		    !xstrcasecmp(key_pair->name, "SchedulerParameters") ||
+		    !xstrcasecmp(key_pair->name, "SchedulerPort") ||
+		    !xstrcasecmp(key_pair->name, "SchedulerRootFilter") ||
+		    !xstrcasecmp(key_pair->name, "SchedulerTimeSlice") ||
+		    !xstrcasecmp(key_pair->name, "SchedulerType") ||
+		    !xstrcasecmp(key_pair->name, "SlurmSchedLogLevel") ||
+		    !xstrcasecmp(key_pair->name, "PreemptMode") ||
+		    !xstrcasecmp(key_pair->name, "PreemptType") ||
+		    !xstrcasecmp(key_pair->name, "PriorityType") ||
+		    !xstrcasecmp(key_pair->name, "FastSchedule")) {
 			list_append(sched_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "TopologyPlugin")) {
+		if (!xstrcasecmp(key_pair->name, "TopologyPlugin")) {
 			list_append(topology_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "SlurmctldTimeout") ||
-		    !strcasecmp(key_pair->name, "SlurmdTimeout") ||
-		    !strcasecmp(key_pair->name, "InactiveLimit") ||
-		    !strcasecmp(key_pair->name, "MinJobAge") ||
-		    !strcasecmp(key_pair->name, "KillWait") ||
-		    !strcasecmp(key_pair->name, "BatchStartTimeout") ||
-		    !strcasecmp(key_pair->name, "CompleteWait") ||
-		    !strcasecmp(key_pair->name, "EpilogMsgTime") ||
-		    !strcasecmp(key_pair->name, "GetEnvTimeout") ||
-		    !strcasecmp(key_pair->name, "Waittime")) {
+		if (!xstrcasecmp(key_pair->name, "SlurmctldTimeout") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdTimeout") ||
+		    !xstrcasecmp(key_pair->name, "InactiveLimit") ||
+		    !xstrcasecmp(key_pair->name, "MinJobAge") ||
+		    !xstrcasecmp(key_pair->name, "KillWait") ||
+		    !xstrcasecmp(key_pair->name, "BatchStartTimeout") ||
+		    !xstrcasecmp(key_pair->name, "CompleteWait") ||
+		    !xstrcasecmp(key_pair->name, "EpilogMsgTime") ||
+		    !xstrcasecmp(key_pair->name, "GetEnvTimeout") ||
+		    !xstrcasecmp(key_pair->name, "Waittime")) {
 			list_append(timers_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "SlurmctldDebug") ||
-		    !strcasecmp(key_pair->name, "SlurmdDebug") ||
-		    !strcasecmp(key_pair->name, "DebugFlags")) {
+		if (!xstrcasecmp(key_pair->name, "SlurmctldDebug") ||
+		    !xstrcasecmp(key_pair->name, "SlurmdDebug") ||
+		    !xstrcasecmp(key_pair->name, "DebugFlags")) {
 			list_append(debug_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "TaskPlugin") ||
-		    !strcasecmp(key_pair->name, "TaskPluginParam")) {
+		if (!xstrcasecmp(key_pair->name, "TaskPlugin") ||
+		    !xstrcasecmp(key_pair->name, "TaskPluginParam")) {
 			list_append(resconf_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "ProcTrackType")) {
+		if (!xstrcasecmp(key_pair->name, "ProcTrackType")) {
 			list_append(proctrac_list, temp);
 			continue;
 		}
 
-		if (!strcasecmp(key_pair->name, "Epilog") ||
-		    !strcasecmp(key_pair->name, "Prolog") ||
-		    !strcasecmp(key_pair->name, "SrunProlog") ||
-		    !strcasecmp(key_pair->name, "SrunEpilog") ||
-		    !strcasecmp(key_pair->name, "TaskEpilog") ||
-		    !strcasecmp(key_pair->name, "TaskProlog")) {
+		if (!xstrcasecmp(key_pair->name, "Epilog") ||
+		    !xstrcasecmp(key_pair->name, "Prolog") ||
+		    !xstrcasecmp(key_pair->name, "SrunProlog") ||
+		    !xstrcasecmp(key_pair->name, "SrunEpilog") ||
+		    !xstrcasecmp(key_pair->name, "TaskEpilog") ||
+		    !xstrcasecmp(key_pair->name, "TaskProlog")) {
 			list_append(proepilog_list, temp);
 			continue;
 		} else {
diff --git a/src/api/init_msg.c b/src/api/init_msg.c
index 69eaeea05..e0b3d42af 100644
--- a/src/api/init_msg.c
+++ b/src/api/init_msg.c
@@ -77,7 +77,7 @@ void slurm_init_job_desc_msg(job_desc_msg_t * job_desc_msg)
 	job_desc_msg->mem_bind_type	= (uint16_t) NO_VAL;
 	job_desc_msg->min_cpus		= NO_VAL;
 	job_desc_msg->min_nodes		= NO_VAL;
-	job_desc_msg->nice		= (uint16_t) NO_VAL;
+	job_desc_msg->nice		= NO_VAL;
 	job_desc_msg->ntasks_per_core	= (uint16_t) NO_VAL;
 	job_desc_msg->ntasks_per_node	= (uint16_t) NO_VAL;
 	job_desc_msg->ntasks_per_socket	= (uint16_t) NO_VAL;
@@ -134,7 +134,8 @@ void slurm_init_part_desc_msg (update_part_msg_t * update_part_msg)
 	update_part_msg->min_nodes 	= NO_VAL;
 	update_part_msg->max_time 	= (uint32_t) NO_VAL;
 	update_part_msg->preempt_mode 	= (uint16_t) NO_VAL;
-	update_part_msg->priority 	= (uint16_t) NO_VAL;
+	update_part_msg->priority_job_factor = (uint16_t) NO_VAL;
+	update_part_msg->priority_tier	= (uint16_t) NO_VAL;
 	update_part_msg->state_up 	= (uint16_t) NO_VAL;
 }
 
diff --git a/src/api/job_info.c b/src/api/job_info.c
index 7549bff81..305c2edaf 100644
--- a/src/api/job_info.c
+++ b/src/api/job_info.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2014 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov> et. al.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -49,6 +49,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <time.h>
@@ -88,7 +89,7 @@ static uint32_t _threads_per_core(char *host)
 	slurm_mutex_lock(&job_node_info_lock);
 	for (i = 0; i < job_node_ptr->record_count; i++) {
 		if (job_node_ptr->node_array[i].name &&
-		    !strcmp(host, job_node_ptr->node_array[i].name)) {
+		    !xstrcmp(host, job_node_ptr->node_array[i].name)) {
 			threads = job_node_ptr->node_array[i].threads;
 			break;
 		}
@@ -285,15 +286,15 @@ static void _sprint_range(char *str, uint32_t str_size,
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
 		convert_num_unit((float)lower, tmp, sizeof(tmp), UNIT_NONE,
-			CONVERT_NUM_UNIT_EXACT);
+				 NO_VAL, CONVERT_NUM_UNIT_EXACT);
 	} else {
 		snprintf(tmp, sizeof(tmp), "%u", lower);
 	}
 	if (upper > 0) {
     		char tmp2[128];
 		if (cluster_flags & CLUSTER_FLAG_BG) {
-			convert_num_unit((float)upper, tmp2,
-					 sizeof(tmp2), UNIT_NONE,
+			convert_num_unit((float)upper, tmp2, sizeof(tmp2),
+					 UNIT_NONE, NO_VAL,
 					 CONVERT_NUM_UNIT_EXACT);
 		} else {
 			snprintf(tmp2, sizeof(tmp2), "%u", upper);
@@ -335,10 +336,11 @@ extern char *
 slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
 {
 	int i, j, k;
-	char time_str[32], *group_name, *spec_name, *user_name;
-	char tmp1[128], tmp2[128], tmp3[128], tmp4[128], tmp5[128], tmp6[128];
+	char time_str[32], *group_name, *user_name;
+	char tmp1[128], tmp2[128];
 	char *tmp6_ptr;
 	char tmp_line[1024 * 128];
+	char tmp_path[MAXPATHLEN];
 	char *ionodes = NULL;
 	uint16_t exit_status = 0, term_sig = 0;
 	job_resources_t *job_resrcs = job_ptr->job_resrcs;
@@ -350,7 +352,7 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
 	char *host;
 	int sock_inx, sock_reps, last;
 	int abs_node_inx, rel_node_inx;
-	int nice;
+	int64_t nice;
 	int bit_inx, bit_reps;
 	uint32_t *last_mem_alloc_ptr = NULL;
 	uint32_t last_mem_alloc = NO_VAL;
@@ -359,6 +361,7 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
 	char select_buf[122];
 	uint32_t cluster_flags = slurmdb_setup_cluster_flags();
 	uint32_t threads;
+	char *line_end = (one_liner) ? " " : "\n   ";
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
 		nodelist = "MidplaneList";
@@ -368,117 +371,78 @@ slurm_sprint_job_info ( job_info_t * job_ptr, int one_liner )
 	}
 
 	/****** Line 1 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "JobId=%u ", job_ptr->job_id);
-	out = xstrdup(tmp_line);
+	xstrfmtcat(out, "JobId=%u ", job_ptr->job_id);
+
 	if (job_ptr->array_job_id) {
 		if (job_ptr->array_task_str) {
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "ArrayJobId=%u ArrayTaskId=%s ",
-				 job_ptr->array_job_id,
-				 job_ptr->array_task_str);
+			xstrfmtcat(out, "ArrayJobId=%u ArrayTaskId=%s ",
+				   job_ptr->array_job_id,
+				   job_ptr->array_task_str);
 		} else {
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "ArrayJobId=%u ArrayTaskId=%u ",
-				 job_ptr->array_job_id,
-				 job_ptr->array_task_id);
+			xstrfmtcat(out, "ArrayJobId=%u ArrayTaskId=%u ",
+				   job_ptr->array_job_id,
+				   job_ptr->array_task_id);
 		}
-		xstrcat(out, tmp_line);
 	}
-	snprintf(tmp_line, sizeof(tmp_line), "JobName=%s", job_ptr->name);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "JobName=%s", job_ptr->name);
+	xstrcat(out, line_end);
 
 	/****** Line 2 ******/
 	user_name = uid_to_string((uid_t) job_ptr->user_id);
 	group_name = gid_to_string((gid_t) job_ptr->group_id);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "UserId=%s(%u) GroupId=%s(%u)",
-		 user_name, job_ptr->user_id, group_name, job_ptr->group_id);
+	xstrfmtcat(out, "UserId=%s(%u) GroupId=%s(%u) MCS_label=%s",
+		   user_name, job_ptr->user_id, group_name, job_ptr->group_id,
+		   (job_ptr->mcs_label==NULL) ? "N/A" : job_ptr->mcs_label);
 	xfree(user_name);
 	xfree(group_name);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrcat(out, line_end);
 
 	/****** Line 3 ******/
-	nice  = job_ptr->nice;
-	nice -= NICE_OFFSET;
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Priority=%u Nice=%d Account=%s QOS=%s",
-		 job_ptr->priority, nice, job_ptr->account, job_ptr->qos);
-	xstrcat(out, tmp_line);
-	if (slurm_get_track_wckey()) {
-		snprintf(tmp_line, sizeof(tmp_line),
-			 " WCKey=%s", job_ptr->wckey);
-		xstrcat(out, tmp_line);
-	}
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	nice = ((int64_t)job_ptr->nice) - NICE_OFFSET;
+	xstrfmtcat(out, "Priority=%u Nice=%"PRIi64" Account=%s QOS=%s",
+		   job_ptr->priority, nice, job_ptr->account, job_ptr->qos);
+	if (slurm_get_track_wckey())
+		xstrfmtcat(out, " WCKey=%s", job_ptr->wckey);
+	xstrcat(out, line_end);
 
 	/****** Line 4 ******/
+	xstrfmtcat(out, "JobState=%s ", job_state_string(job_ptr->job_state));
+
 	if (job_ptr->state_desc) {
 		/* Replace white space with underscore for easier parsing */
 		for (j=0; job_ptr->state_desc[j]; j++) {
 			if (isspace((int)job_ptr->state_desc[j]))
 				job_ptr->state_desc[j] = '_';
 		}
-		tmp6_ptr = job_ptr->state_desc;
+		xstrfmtcat(out, "Reason=%s ", job_ptr->state_desc);
 	} else
-		tmp6_ptr = job_reason_string(job_ptr->state_reason);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "JobState=%s Reason=%s Dependency=%s",
-		 job_state_string(job_ptr->job_state), tmp6_ptr,
-		 job_ptr->dependency);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "Reason=%s ", job_reason_string(job_ptr->state_reason));
+
+	xstrfmtcat(out, "Dependency=%s", job_ptr->dependency);
+	xstrcat(out, line_end);
 
 	/****** Line 5 ******/
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Requeue=%u Restarts=%u BatchFlag=%u Reboot=%u ",
+	xstrfmtcat(out, "Requeue=%u Restarts=%u BatchFlag=%u Reboot=%u ",
 		 job_ptr->requeue, job_ptr->restart_cnt, job_ptr->batch_flag,
 		 job_ptr->reboot);
-	xstrcat(out, tmp_line);
 	if (WIFSIGNALED(job_ptr->exit_code))
 		term_sig = WTERMSIG(job_ptr->exit_code);
 	exit_status = WEXITSTATUS(job_ptr->exit_code);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "ExitCode=%u:%u", exit_status, term_sig);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "ExitCode=%u:%u", exit_status, term_sig);
+	xstrcat(out, line_end);
 
 	/****** Line 5a (optional) ******/
-	if (!(job_ptr->show_flags & SHOW_DETAIL))
-		goto line6;
-	if (WIFSIGNALED(job_ptr->derived_ec))
-		term_sig = WTERMSIG(job_ptr->derived_ec);
-	else
-		term_sig = 0;
-	exit_status = WEXITSTATUS(job_ptr->derived_ec);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "DerivedExitCode=%u:%u", exit_status, term_sig);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	if (job_ptr->show_flags & SHOW_DETAIL) {
+		if (WIFSIGNALED(job_ptr->derived_ec))
+			term_sig = WTERMSIG(job_ptr->derived_ec);
+		else
+			term_sig = 0;
+		exit_status = WEXITSTATUS(job_ptr->derived_ec);
+		xstrfmtcat(out, "DerivedExitCode=%u:%u", exit_status, term_sig);
+		xstrcat(out, line_end);
+	}
 
 	/****** Line 6 ******/
-line6:
-	snprintf(tmp_line, sizeof(tmp_line), "RunTime=");
-	xstrcat(out, tmp_line);
 	if (IS_JOB_PENDING(job_ptr))
 		run_time = 0;
 	else if (IS_JOB_SUSPENDED(job_ptr))
@@ -497,150 +461,103 @@ line6:
 			run_time = (time_t)
 				difftime(end_time, job_ptr->start_time);
 	}
-	secs2time_str(run_time, tmp1, sizeof(tmp1));
-	sprintf(tmp_line, "%s ", tmp1);
-	xstrcat(out, tmp_line);
+	secs2time_str(run_time, time_str, sizeof(time_str));
+	xstrfmtcat(out, "RunTime=%s ", time_str);
 
-	snprintf(tmp_line, sizeof(tmp_line), "TimeLimit=");
-	xstrcat(out, tmp_line);
 	if (job_ptr->time_limit == NO_VAL)
-		sprintf(tmp_line, "Partition_Limit");
+		xstrcat(out, "TimeLimit=Partition_Limit ");
 	else {
-		mins2time_str(job_ptr->time_limit, tmp_line,
-			      sizeof(tmp_line));
+		mins2time_str(job_ptr->time_limit, time_str, sizeof(time_str));
+		xstrfmtcat(out, "TimeLimit=%s ", time_str);
 	}
-	xstrcat(out, tmp_line);
-	snprintf(tmp_line, sizeof(tmp_line), " TimeMin=");
-	xstrcat(out, tmp_line);
+
 	if (job_ptr->time_min == 0)
-		sprintf(tmp_line, "N/A");
+		xstrcat(out, "TimeMin=N/A");
 	else {
-		mins2time_str(job_ptr->time_min, tmp_line,
-			      sizeof(tmp_line));
+		mins2time_str(job_ptr->time_min, time_str, sizeof(time_str));
+		xstrfmtcat(out, "TimeMin=%s", time_str);
 	}
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrcat(out, line_end);
 
 	/****** Line 7 ******/
-	slurm_make_time_str((time_t *)&job_ptr->submit_time, time_str,
-			    sizeof(time_str));
-	snprintf(tmp_line, sizeof(tmp_line), "SubmitTime=%s ", time_str);
-	xstrcat(out, tmp_line);
-
-	slurm_make_time_str((time_t *)&job_ptr->eligible_time, time_str,
-			    sizeof(time_str));
-	snprintf(tmp_line, sizeof(tmp_line), "EligibleTime=%s", time_str);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	slurm_make_time_str(&job_ptr->submit_time, time_str, sizeof(time_str));
+	xstrfmtcat(out, "SubmitTime=%s ", time_str);
+
+	slurm_make_time_str(&job_ptr->eligible_time, time_str, sizeof(time_str));
+	xstrfmtcat(out, "EligibleTime=%s", time_str);
+
+	xstrcat(out, line_end);
 
 	/****** Line 8 (optional) ******/
 	if (job_ptr->resize_time) {
-		slurm_make_time_str((time_t *)&job_ptr->resize_time, time_str,
-				    sizeof(time_str));
-		snprintf(tmp_line, sizeof(tmp_line), "ResizeTime=%s", time_str);
-		xstrcat(out, tmp_line);
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		slurm_make_time_str(&job_ptr->resize_time, time_str, sizeof(time_str));
+		xstrfmtcat(out, "ResizeTime=%s", time_str);
+		xstrcat(out, line_end);
 	}
 
 	/****** Line 9 ******/
-	slurm_make_time_str((time_t *)&job_ptr->start_time, time_str,
-			    sizeof(time_str));
-	snprintf(tmp_line, sizeof(tmp_line), "StartTime=%s ", time_str);
-	xstrcat(out, tmp_line);
+	slurm_make_time_str(&job_ptr->start_time, time_str, sizeof(time_str));
+	xstrfmtcat(out, "StartTime=%s ", time_str);
 
-	snprintf(tmp_line, sizeof(tmp_line), "EndTime=");
-	xstrcat(out, tmp_line);
 	if ((job_ptr->time_limit == INFINITE) &&
 	    (job_ptr->end_time > time(NULL)))
-		sprintf(tmp_line, "Unknown");
+		xstrcat(out, "EndTime=Unknown ");
 	else {
-		slurm_make_time_str ((time_t *)&job_ptr->end_time, time_str,
-				     sizeof(time_str));
-		sprintf(tmp_line, "%s", time_str);
+		slurm_make_time_str(&job_ptr->end_time, time_str, sizeof(time_str));
+		xstrfmtcat(out, "EndTime=%s ", time_str);
 	}
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+
+	if (job_ptr->deadline) {
+		slurm_make_time_str(&job_ptr->deadline, time_str, sizeof(time_str));
+		xstrfmtcat(out, "Deadline=%s", time_str);
+	} else {
+		xstrcat(out, "Deadline=N/A");
+	}
+
+	xstrcat(out, line_end);
 
 	/****** Line 10 ******/
 	if (job_ptr->preempt_time == 0)
-		sprintf(tmp_line, "PreemptTime=None ");
+		xstrcat(out, "PreemptTime=None ");
 	else {
-		slurm_make_time_str((time_t *)&job_ptr->preempt_time,
-				    time_str, sizeof(time_str));
-		snprintf(tmp_line, sizeof(tmp_line), "PreemptTime=%s ",
-			 time_str);
+		slurm_make_time_str(&job_ptr->preempt_time, time_str, sizeof(time_str));
+		xstrfmtcat(out, "PreemptTime=%s ", time_str);
 	}
-	xstrcat(out, tmp_line);
+
 	if (job_ptr->suspend_time) {
-		slurm_make_time_str ((time_t *)&job_ptr->suspend_time,
-				     time_str, sizeof(time_str));
-	} else {
-		strncpy(time_str, "None", sizeof(time_str));
-	}
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "SuspendTime=%s SecsPreSuspend=%ld",
-		 time_str, (long int)job_ptr->pre_sus_time);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+		slurm_make_time_str(&job_ptr->suspend_time, time_str, sizeof(time_str));
+		xstrfmtcat(out, "SuspendTime=%s ", time_str);
+	} else
+		xstrcat(out, "SuspendTime=None ");
+
+	xstrfmtcat(out, "SecsPreSuspend=%ld", (long int)job_ptr->pre_sus_time);
+	xstrcat(out, line_end);
 
 	/****** Line 11 ******/
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Partition=%s AllocNode:Sid=%s:%u",
-		 job_ptr->partition, job_ptr->alloc_node, job_ptr->alloc_sid);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "Partition=%s AllocNode:Sid=%s:%u",
+		   job_ptr->partition, job_ptr->alloc_node, job_ptr->alloc_sid);
+	xstrcat(out, line_end);
 
 	/****** Line 12 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "Req%s=%s Exc%s=%s",
-		 nodelist, job_ptr->req_nodes, nodelist, job_ptr->exc_nodes);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "Req%s=%s Exc%s=%s", nodelist, job_ptr->req_nodes,
+		   nodelist, job_ptr->exc_nodes);
+	xstrcat(out, line_end);
 
 	/****** Line 13 ******/
-	xstrfmtcat(out, "%s=", nodelist);
-	xstrcat(out, job_ptr->nodes);
+	xstrfmtcat(out, "%s=%s", nodelist, job_ptr->nodes);
 	if (job_ptr->nodes && ionodes) {
-		snprintf(tmp_line, sizeof(tmp_line), "[%s]", ionodes);
-		xstrcat(out, tmp_line);
+		xstrfmtcat(out, "[%s]", ionodes);
 		xfree(ionodes);
 	}
 	if (job_ptr->sched_nodes)
 		xstrfmtcat(out, " Sched%s=%s", nodelist, job_ptr->sched_nodes);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+
+	xstrcat(out, line_end);
 
 	/****** Line 14 (optional) ******/
 	if (job_ptr->batch_host) {
-		snprintf(tmp_line, sizeof(tmp_line), "BatchHost=%s",
-			 job_ptr->batch_host);
-		xstrcat(out, tmp_line);
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrfmtcat(out, "BatchHost=%s", job_ptr->batch_host);
+		xstrcat(out, line_end);
 	}
 
 	/****** Line 15 ******/
@@ -663,137 +580,112 @@ line6:
 		max_nodes = 0;
 	}
 
-	_sprint_range(tmp1, sizeof(tmp1), job_ptr->num_cpus, job_ptr->max_cpus);
-	_sprint_range(tmp2, sizeof(tmp2), min_nodes, max_nodes);
+	_sprint_range(tmp_line, sizeof(tmp_line), min_nodes, max_nodes);
+	xstrfmtcat(out, "NumNodes=%s ", tmp_line);
+	_sprint_range(tmp_line, sizeof(tmp_line), job_ptr->num_cpus, job_ptr->max_cpus);
+	xstrfmtcat(out, "NumCPUs=%s ", tmp_line);
+
+	xstrfmtcat(out, "NumTasks=%u ", job_ptr->num_tasks);
+	xstrfmtcat(out, "CPUs/Task=%u ", job_ptr->cpus_per_task);
+
 	if (job_ptr->boards_per_node == (uint16_t) NO_VAL)
-		strcpy(tmp3, "*");
+		xstrcat(out, "ReqB:S:C:T=*:");
 	else
-		snprintf(tmp3, sizeof(tmp3), "%u", job_ptr->boards_per_node);
+		xstrfmtcat(out, "ReqB:S:C:T=%u:", job_ptr->boards_per_node);
+
 	if (job_ptr->sockets_per_board == (uint16_t) NO_VAL)
-		strcpy(tmp4, "*");
+		xstrcat(out, "*:");
 	else
-		snprintf(tmp4, sizeof(tmp4), "%u", job_ptr->sockets_per_board);
+		xstrfmtcat(out, "%u:", job_ptr->sockets_per_board);
+
 	if (job_ptr->cores_per_socket == (uint16_t) NO_VAL)
-		strcpy(tmp5, "*");
+		xstrcat(out, "*:");
 	else
-		snprintf(tmp5, sizeof(tmp5), "%u", job_ptr->cores_per_socket);
+		xstrfmtcat(out, "%u:", job_ptr->cores_per_socket);
+
 	if (job_ptr->threads_per_core == (uint16_t) NO_VAL)
-		strcpy(tmp6, "*");
-	else
-		snprintf(tmp6, sizeof(tmp6), "%u", job_ptr->threads_per_core);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "NumNodes=%s NumCPUs=%s CPUs/Task=%u ReqB:S:C:T=%s:%s:%s:%s",
-		 tmp2, tmp1, job_ptr->cpus_per_task, tmp3, tmp4, tmp5, tmp6);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
+		xstrcat(out, "*");
 	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "%u", job_ptr->threads_per_core);
+
+	xstrcat(out, line_end);
 
 	/****** Line 16 ******/
 	/* Tres should already of been converted at this point from simple */
-	snprintf(tmp_line, sizeof(tmp_line), "TRES=%s",
-		 job_ptr->tres_alloc_str ? job_ptr->tres_alloc_str :
-		 job_ptr->tres_req_str);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "TRES=%s",
+		   job_ptr->tres_alloc_str ? job_ptr->tres_alloc_str
+					   : job_ptr->tres_req_str);
+	xstrcat(out, line_end);
 
 	/****** Line 17 ******/
 	if (job_ptr->sockets_per_node == (uint16_t) NO_VAL)
-		strcpy(tmp1, "*");
+		xstrcat(out, "Socks/Node=* ");
 	else
-		snprintf(tmp1, sizeof(tmp1), "%u", job_ptr->sockets_per_node);
+		xstrfmtcat(out, "Socks/Node=%u ", job_ptr->sockets_per_node);
+
 	if (job_ptr->ntasks_per_node == (uint16_t) NO_VAL)
-		strcpy(tmp2, "*");
+		xstrcat(out, "NtasksPerN:B:S:C=*:");
 	else
-		snprintf(tmp2, sizeof(tmp2), "%u", job_ptr->ntasks_per_node);
+		xstrfmtcat(out, "NtasksPerN:B:S:C=%u:", job_ptr->ntasks_per_node);
+
 	if (job_ptr->ntasks_per_board == (uint16_t) NO_VAL)
-		strcpy(tmp3, "*");
+		xstrcat(out, "*:");
 	else
-		snprintf(tmp3, sizeof(tmp3), "%u", job_ptr->ntasks_per_board);
+		xstrfmtcat(out, "%u:", job_ptr->ntasks_per_board);
+
 	if ((job_ptr->ntasks_per_socket == (uint16_t) NO_VAL) ||
 	    (job_ptr->ntasks_per_socket == (uint16_t) INFINITE))
-		strcpy(tmp4, "*");
+		xstrcat(out, "*:");
 	else
-		snprintf(tmp4, sizeof(tmp4), "%u", job_ptr->ntasks_per_socket);
+		xstrfmtcat(out, "%u:", job_ptr->ntasks_per_socket);
+
 	if ((job_ptr->ntasks_per_core == (uint16_t) NO_VAL) ||
 	    (job_ptr->ntasks_per_core == (uint16_t) INFINITE))
-		strcpy(tmp5, "*");
+		xstrcat(out, "* ");
 	else
-		snprintf(tmp5, sizeof(tmp5), "%u", job_ptr->ntasks_per_core);
-	if (job_ptr->core_spec == (uint16_t) NO_VAL) {
-		spec_name = "Core";
-		strcpy(tmp6, "*");
-	} else if (job_ptr->core_spec & CORE_SPEC_THREAD) {
-		spec_name = "Thread";
-		i = job_ptr->core_spec & (~CORE_SPEC_THREAD);
-		snprintf(tmp6, sizeof(tmp6), "%d", i);
-	} else {
-		spec_name = "Core";
-		snprintf(tmp6, sizeof(tmp6), "%u", job_ptr->core_spec);
-	}
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Socks/Node=%s NtasksPerN:B:S:C=%s:%s:%s:%s %sSpec=%s",
-		 tmp1, tmp2, tmp3, tmp4, tmp5, spec_name, tmp6);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
+		xstrfmtcat(out, "%u ", job_ptr->ntasks_per_core);
+
+	if (job_ptr->core_spec == (uint16_t) NO_VAL)
+		xstrcat(out, "CoreSpec=*");
+	else if (job_ptr->core_spec & CORE_SPEC_THREAD)
+		xstrfmtcat(out, "ThreadSpec=%d",
+			   (job_ptr->core_spec & (~CORE_SPEC_THREAD)));
 	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "CoreSpec=%u", job_ptr->core_spec);
 
-	if (!job_resrcs)
-		goto line15;
+	xstrcat(out, line_end);
 
-	if (cluster_flags & CLUSTER_FLAG_BG) {
+	if (job_resrcs && cluster_flags & CLUSTER_FLAG_BG) {
 		if ((job_resrcs->cpu_array_cnt > 0) &&
 		    (job_resrcs->cpu_array_value) &&
 		    (job_resrcs->cpu_array_reps)) {
 			int length = 0;
 			xstrcat(out, "CPUs=");
-			length += 10;
 			for (i = 0; i < job_resrcs->cpu_array_cnt; i++) {
-				if (length > 70) {
+				/* only print 60 characters worth of this record */
+				if (length > 60) {
 					/* skip to last CPU group entry */
 					if (i < job_resrcs->cpu_array_cnt - 1) {
 						continue;
 					}
 					/* add ellipsis before last entry */
 					xstrcat(out, "...,");
-					length += 4;
 				}
 
-				snprintf(tmp_line, sizeof(tmp_line), "%d",
-					 job_resrcs->cpus[i]);
-				xstrcat(out, tmp_line);
-				length += strlen(tmp_line);
+				length += xstrfmtcat(out, "%d", job_resrcs->cpus[i]);
 				if (job_resrcs->cpu_array_reps[i] > 1) {
-					snprintf(tmp_line, sizeof(tmp_line),
-						 "*%d",
-						 job_resrcs->cpu_array_reps[i]);
-					xstrcat(out, tmp_line);
-					length += strlen(tmp_line);
+					length += xstrfmtcat(out, "*%d",
+							     job_resrcs->cpu_array_reps[i]);
 				}
 				if (i < job_resrcs->cpu_array_cnt - 1) {
 					xstrcat(out, ",");
 					length++;
 				}
 			}
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
+			xstrcat(out, line_end);
 		}
-	} else {
-		if (!job_resrcs->core_bitmap)
-			goto line15;
-
-		last  = bit_fls(job_resrcs->core_bitmap);
-		if (last == -1)
-			goto line15;
-
+	} else if (job_resrcs && job_resrcs->core_bitmap
+			&& ((last = bit_fls(job_resrcs->core_bitmap) != -1))) {
 		hl = hostlist_create(job_resrcs->nodes);
 		if (!hl) {
 			error("slurm_sprint_job_info: hostlist_create: %s",
@@ -811,7 +703,7 @@ line6:
 		i = sock_inx = sock_reps = 0;
 		abs_node_inx = job_ptr->node_inx[i];
 
-/*	tmp1[] stores the current cpu(s) allocated	*/
+		/* tmp1[] stores the current cpu(s) allocated */
 		tmp2[0] = '\0';	/* stores last cpu(s) allocated */
 		for (rel_node_inx=0; rel_node_inx < job_resrcs->nhosts;
 		     rel_node_inx++) {
@@ -838,12 +730,12 @@ line6:
 			}
 			bit_fmt(tmp1, sizeof(tmp1), cpu_bitmap);
 			FREE_NULL_BITMAP(cpu_bitmap);
-/*
- *		If the allocation values for this host are not the same as the
- *		last host, print the report of the last group of hosts that had
- *		identical allocation values.
- */
-			if (strcmp(tmp1, tmp2) ||
+			/*
+			 * If the allocation values for this host are not the
+			 * same as the last host, print the report of the last
+			 * group of hosts that had identical allocation values.
+			 */
+			if (xstrcmp(tmp1, tmp2) ||
 			    (last_mem_alloc_ptr != job_resrcs->memory_allocated) ||
 			    (job_resrcs->memory_allocated &&
 			     (last_mem_alloc !=
@@ -852,17 +744,13 @@ line6:
 					last_hosts =
 						hostlist_ranged_string_xmalloc(
 						hl_last);
-					snprintf(tmp_line, sizeof(tmp_line),
-						 "  Nodes=%s CPU_IDs=%s Mem=%u",
-						 last_hosts, tmp2,
-						 last_mem_alloc_ptr ?
-						 last_mem_alloc : 0);
+					xstrfmtcat(out,
+						   "  Nodes=%s CPU_IDs=%s Mem=%u",
+						   last_hosts, tmp2,
+						   last_mem_alloc_ptr ?
+						   last_mem_alloc : 0);
 					xfree(last_hosts);
-					xstrcat(out, tmp_line);
-					if (one_liner)
-						xstrcat(out, " ");
-					else
-						xstrcat(out, "\n   ");
+					xstrcat(out, line_end);
 
 					hostlist_destroy(hl_last);
 					hl_last = hostlist_create(NULL);
@@ -891,22 +779,16 @@ line6:
 
 		if (hostlist_count(hl_last)) {
 			last_hosts = hostlist_ranged_string_xmalloc(hl_last);
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "  Nodes=%s CPU_IDs=%s Mem=%u",
+			xstrfmtcat(out, "  Nodes=%s CPU_IDs=%s Mem=%u",
 				 last_hosts, tmp2,
 				 last_mem_alloc_ptr ? last_mem_alloc : 0);
 			xfree(last_hosts);
-			xstrcat(out, tmp_line);
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
+			xstrcat(out, line_end);
 		}
 		hostlist_destroy(hl);
 		hostlist_destroy(hl_last);
 	}
 	/****** Line 18 ******/
-line15:
 	if (job_ptr->pn_min_memory & MEM_PER_CPU) {
 		job_ptr->pn_min_memory &= (~MEM_PER_CPU);
 		tmp6_ptr = "CPU";
@@ -914,71 +796,38 @@ line15:
 		tmp6_ptr = "Node";
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
-		convert_num_unit((float)job_ptr->pn_min_cpus,
-				 tmp1, sizeof(tmp1), UNIT_NONE,
+		convert_num_unit((float)job_ptr->pn_min_cpus, tmp1,
+				 sizeof(tmp1), UNIT_NONE, NO_VAL,
 				 CONVERT_NUM_UNIT_EXACT);
-		snprintf(tmp_line, sizeof(tmp_line), "MinCPUsNode=%s",	tmp1);
+		xstrfmtcat(out, "MinCPUsNode=%s ", tmp1);
 	} else {
-		snprintf(tmp_line, sizeof(tmp_line), "MinCPUsNode=%u",
-			 job_ptr->pn_min_cpus);
+		xstrfmtcat(out, "MinCPUsNode=%u ", job_ptr->pn_min_cpus);
 	}
 
-	xstrcat(out, tmp_line);
 	convert_num_unit((float)job_ptr->pn_min_memory, tmp1, sizeof(tmp1),
-			 UNIT_MEGA, CONVERT_NUM_UNIT_EXACT);
+			 UNIT_MEGA, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 	convert_num_unit((float)job_ptr->pn_min_tmp_disk, tmp2, sizeof(tmp2),
-			 UNIT_MEGA, CONVERT_NUM_UNIT_EXACT);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 " MinMemory%s=%s MinTmpDiskNode=%s",
-		 tmp6_ptr, tmp1, tmp2);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+			 UNIT_MEGA, NO_VAL, CONVERT_NUM_UNIT_EXACT);
+	xstrfmtcat(out, "MinMemory%s=%s MinTmpDiskNode=%s", tmp6_ptr, tmp1, tmp2);
+	xstrcat(out, line_end);
 
 	/****** Line 19 ******/
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Features=%s Gres=%s Reservation=%s",
-		 job_ptr->features, job_ptr->gres, job_ptr->resv_name);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "Features=%s Gres=%s Reservation=%s",
+		   job_ptr->features, job_ptr->gres, job_ptr->resv_name);
+	xstrcat(out, line_end);
 
 	/****** Line 20 ******/
-	if (job_ptr->shared == 0)
-		tmp6_ptr = "0";
-	else if (job_ptr->shared == 1)
-		tmp6_ptr = "1";
-	else if (job_ptr->shared == 2)
-		tmp6_ptr = "USER";
-	else
-		tmp6_ptr = "OK";
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Shared=%s Contiguous=%d Licenses=%s Network=%s",
-		 tmp6_ptr, job_ptr->contiguous, job_ptr->licenses,
-		 job_ptr->network);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "OverSubscribe=%s Contiguous=%d Licenses=%s Network=%s",
+		   job_share_string(job_ptr->shared), job_ptr->contiguous,
+		   job_ptr->licenses, job_ptr->network);
+	xstrcat(out, line_end);
 
 	/****** Line 21 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "Command=%s",
-		 job_ptr->command);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrfmtcat(out, "Command=%s", job_ptr->command);
+	xstrcat(out, line_end);
 
 	/****** Line 22 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "WorkDir=%s",
-		 job_ptr->work_dir);
-	xstrcat(out, tmp_line);
+	xstrfmtcat(out, "WorkDir=%s", job_ptr->work_dir);
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
 		/****** Line 23 (optional) ******/
@@ -986,13 +835,8 @@ line15:
 					       select_buf, sizeof(select_buf),
 					       SELECT_PRINT_BG_ID);
 		if (select_buf[0] != '\0') {
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "Block_ID=%s", select_buf);
-			xstrcat(out, tmp_line);
+			xstrcat(out, line_end);
+			xstrfmtcat(out, "Block_ID=%s", select_buf);
 		}
 
 		/****** Line 24 (optional) ******/
@@ -1000,10 +844,7 @@ line15:
 					       select_buf, sizeof(select_buf),
 					       SELECT_PRINT_MIXED_SHORT);
 		if (select_buf[0] != '\0') {
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
+			xstrcat(out, line_end);
 			xstrcat(out, select_buf);
 		}
 
@@ -1014,13 +855,8 @@ line15:
 				select_buf, sizeof(select_buf),
 				SELECT_PRINT_BLRTS_IMAGE);
 			if (select_buf[0] != '\0') {
-				if (one_liner)
-					xstrcat(out, " ");
-				else
-					xstrcat(out, "\n   ");
-				snprintf(tmp_line, sizeof(tmp_line),
-					 "BlrtsImage=%s", select_buf);
-				xstrcat(out, tmp_line);
+				xstrcat(out, line_end);
+				xstrfmtcat(out, "BlrtsImage=%s", select_buf);
 			}
 		}
 		/****** Line 26 (optional) ******/
@@ -1028,98 +864,63 @@ line15:
 					       select_buf, sizeof(select_buf),
 					       SELECT_PRINT_LINUX_IMAGE);
 		if (select_buf[0] != '\0') {
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
+			xstrcat(out, line_end);
 			if (cluster_flags & CLUSTER_FLAG_BGL)
-				snprintf(tmp_line, sizeof(tmp_line),
-					 "LinuxImage=%s", select_buf);
+				xstrfmtcat(out, "LinuxImage=%s", select_buf);
 			else
-				snprintf(tmp_line, sizeof(tmp_line),
-					 "CnloadImage=%s", select_buf);
-
-			xstrcat(out, tmp_line);
+				xstrfmtcat(out, "CnloadImage=%s", select_buf);
 		}
 		/****** Line 27 (optional) ******/
 		select_g_select_jobinfo_sprint(job_ptr->select_jobinfo,
 					       select_buf, sizeof(select_buf),
 					       SELECT_PRINT_MLOADER_IMAGE);
 		if (select_buf[0] != '\0') {
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "MloaderImage=%s", select_buf);
-			xstrcat(out, tmp_line);
+			xstrcat(out, line_end);
+			xstrfmtcat(out, "MloaderImage=%s", select_buf);
 		}
 		/****** Line 28 (optional) ******/
 		select_g_select_jobinfo_sprint(job_ptr->select_jobinfo,
 					       select_buf, sizeof(select_buf),
 					       SELECT_PRINT_RAMDISK_IMAGE);
 		if (select_buf[0] != '\0') {
-			if (one_liner)
-				xstrcat(out, " ");
-			else
-				xstrcat(out, "\n   ");
+			xstrcat(out, line_end);
 			if (cluster_flags & CLUSTER_FLAG_BGL)
-				snprintf(tmp_line, sizeof(tmp_line),
-					 "RamDiskImage=%s", select_buf);
+				xstrfmtcat(out, "RamDiskImage=%s", select_buf);
 			else
-				snprintf(tmp_line, sizeof(tmp_line),
-					 "IoloadImage=%s", select_buf);
-			xstrcat(out, tmp_line);
+				xstrfmtcat(out, "IoloadImage=%s", select_buf);
 		}
 	}
 
 	/****** Line 29 (optional) ******/
 	if (job_ptr->comment) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		snprintf(tmp_line, sizeof(tmp_line), "Comment=%s ",
-			 job_ptr->comment);
-		xstrcat(out, tmp_line);
+		xstrcat(out, line_end);
+		xstrfmtcat(out, "Comment=%s ", job_ptr->comment);
 	}
 
 	/****** Line 30 (optional) ******/
 	if (job_ptr->batch_flag) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		slurm_get_job_stderr(tmp_line, sizeof(tmp_line), job_ptr);
-		xstrfmtcat(out, "StdErr=%s", tmp_line);
+		xstrcat(out, line_end);
+		slurm_get_job_stderr(tmp_path, sizeof(tmp_path), job_ptr);
+		xstrfmtcat(out, "StdErr=%s", tmp_path);
 	}
 
 	/****** Line 31 (optional) ******/
 	if (job_ptr->batch_flag) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		slurm_get_job_stdin(tmp_line, sizeof(tmp_line), job_ptr);
-		xstrfmtcat(out, "StdIn=%s", tmp_line);
+		xstrcat(out, line_end);
+		slurm_get_job_stdin(tmp_path, sizeof(tmp_path), job_ptr);
+		xstrfmtcat(out, "StdIn=%s", tmp_path);
 	}
 
 	/****** Line 32 (optional) ******/
 	if (job_ptr->batch_flag) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		slurm_get_job_stdout(tmp_line, sizeof(tmp_line), job_ptr);
-		xstrfmtcat(out, "StdOut=%s", tmp_line);
+		xstrcat(out, line_end);
+		slurm_get_job_stdout(tmp_path, sizeof(tmp_path), job_ptr);
+		xstrfmtcat(out, "StdOut=%s", tmp_path);
 	}
 
 	/****** Line 33 (optional) ******/
 	if (job_ptr->batch_script) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrcat(out, line_end);
 		xstrcat(out, "BatchScript=\n");
 		xstrcat(out, job_ptr->batch_script);
 	}
@@ -1127,66 +928,37 @@ line15:
 	/****** Line 34 (optional) ******/
 	if (job_ptr->req_switch) {
 		char time_buf[32];
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrcat(out, line_end);
 		secs2time_str((time_t) job_ptr->wait4switch, time_buf,
 			      sizeof(time_buf));
-		snprintf(tmp_line, sizeof(tmp_line), "Switches=%u@%s\n",
-			 job_ptr->req_switch, time_buf);
-		xstrcat(out, tmp_line);
+		xstrfmtcat(out, "Switches=%u@%s\n", job_ptr->req_switch, time_buf);
 	}
 
 	/****** Line 35 (optional) ******/
 	if (job_ptr->burst_buffer) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		snprintf(tmp_line, sizeof(tmp_line), "BurstBuffer=%s",
-			 job_ptr->burst_buffer);
-		xstrcat(out, tmp_line);
+		xstrcat(out, line_end);
+		xstrfmtcat(out, "BurstBuffer=%s", job_ptr->burst_buffer);
 	}
 
 	/****** Line 36 (optional) ******/
 	if (cpu_freq_debug(NULL, NULL, tmp1, sizeof(tmp1),
 			   job_ptr->cpu_freq_gov, job_ptr->cpu_freq_min,
 			   job_ptr->cpu_freq_max, NO_VAL) != 0) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrcat(out, line_end);
 		xstrcat(out, tmp1);
 	}
 
 	/****** Line 37 ******/
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "Power=%s SICP=%u",
-		 power_flags_str(job_ptr->power_flags), job_ptr->sicp_mode);
-	xstrcat(out, tmp_line);
+	xstrcat(out, line_end);
+	xstrfmtcat(out, "Power=%s", power_flags_str(job_ptr->power_flags));
 
 	/****** Line 38 (optional) ******/
 	if (job_ptr->bitflags) {
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
-		if (job_ptr->bitflags & KILL_INV_DEP) {
-			snprintf(tmp_line,
-				 sizeof(tmp_line),
-				 "KillOInInvalidDependent=Yes");
-		}
-		if (job_ptr->bitflags & NO_KILL_INV_DEP) {
-			snprintf(tmp_line,
-				 sizeof(tmp_line),
-				 "KillOInInvalidDependent=No");
-		}
-		xstrcat(out, tmp_line);
+		xstrcat(out, line_end);
+		if (job_ptr->bitflags & KILL_INV_DEP)
+			xstrcat(out, "KillOInInvalidDependent=Yes");
+		if (job_ptr->bitflags & NO_KILL_INV_DEP)
+			xstrcat(out, "KillOInInvalidDependent=No");
 	}
 
 	/****** END OF JOB RECORD ******/
@@ -1196,7 +968,6 @@ line15:
 		xstrcat(out, "\n\n");
 
 	return out;
-
 }
 
 /*
diff --git a/src/api/job_step_info.c b/src/api/job_step_info.c
index f8f769a77..d09c84620 100644
--- a/src/api/job_step_info.c
+++ b/src/api/job_step_info.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  job_step_info.c - get/print the job step state information of slurm
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -72,7 +71,7 @@ static int _sort_pids_by_name(void *x, void *y)
 	if (!rec_a->node_name || !rec_b->node_name)
 		return 0;
 
-	diff = strcmp(rec_a->node_name, rec_b->node_name);
+	diff = xstrcmp(rec_a->node_name, rec_b->node_name);
 	if (diff > 0)
 		return 1;
 	else if (diff < 0)
@@ -237,12 +236,12 @@ slurm_sprint_job_step_info ( job_step_info_t * job_step_ptr,
 					    SELECT_JOBDATA_NODE_CNT,
 					    &nodes);
 		convert_num_unit((float)nodes, tmp_node_cnt,
-				 sizeof(tmp_node_cnt), UNIT_NONE,
+				 sizeof(tmp_node_cnt), UNIT_NONE, NO_VAL,
 				 CONVERT_NUM_UNIT_EXACT);
 	} else {
 		convert_num_unit((float)_nodes_in_list(job_step_ptr->nodes),
-				 tmp_node_cnt, sizeof(tmp_node_cnt),
-				 UNIT_NONE, CONVERT_NUM_UNIT_EXACT);
+				 tmp_node_cnt, sizeof(tmp_node_cnt), UNIT_NONE,
+				 NO_VAL, CONVERT_NUM_UNIT_EXACT);
 	}
 
 	snprintf(tmp_line, sizeof(tmp_line),
@@ -385,11 +384,13 @@ slurm_job_step_layout_get(uint32_t job_id, uint32_t step_id)
  * IN job_id
  * IN step_id
  * IN node_list, optional, if NULL then all nodes in step are returned.
+ * IN use_protocol_ver protocol version to use.
  * OUT resp
  * RET SLURM_SUCCESS on success SLURM_ERROR else
  */
 extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id,
 			       char *node_list,
+			       uint16_t use_protocol_ver,
 			       job_step_stat_response_msg_t **resp)
 {
 	slurm_msg_t req_msg;
@@ -414,6 +415,7 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id,
 			return rc;
 		}
 		node_list = step_layout->node_list;
+		use_protocol_ver = step_layout->start_protocol_ver;
 	}
 
  	if (!*resp) {
@@ -433,6 +435,7 @@ extern int slurm_job_step_stat(uint32_t job_id, uint32_t step_id,
 	resp_out->job_id = req.job_id = job_id;
 	resp_out->step_id = req.step_id = step_id;
 
+	req_msg.protocol_version = use_protocol_ver;
 	req_msg.msg_type = REQUEST_JOB_STEP_STAT;
         req_msg.data = &req;
 
diff --git a/src/api/layout_info.c b/src/api/layout_info.c
index 40106e670..3d6cd58ea 100644
--- a/src/api/layout_info.c
+++ b/src/api/layout_info.c
@@ -71,7 +71,7 @@
 }*/
 
 extern int slurm_load_layout (char *layout_type, char *entities, char *type,
-			      uint32_t no_relation, layout_info_msg_t **resp)
+			      uint32_t flags, layout_info_msg_t **resp)
 {
 	int rc;
 	slurm_msg_t req_msg;
@@ -84,7 +84,7 @@ extern int slurm_load_layout (char *layout_type, char *entities, char *type,
 	req.layout_type  = layout_type;
 	req.entities     = entities;
 	req.type         = type;
-	req.no_relation  = no_relation;
+	req.flags        = flags;
 	req_msg.msg_type = REQUEST_LAYOUT_INFO;
 	req_msg.data     = &req;
 
diff --git a/src/api/node_info.c b/src/api/node_info.c
index f4e860ed6..206096463 100644
--- a/src/api/node_info.c
+++ b/src/api/node_info.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  node_info.c - get/print the node state information of slurm
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -128,13 +127,14 @@ slurm_sprint_node_table (node_info_t * node_ptr,
 {
 	uint32_t my_state = node_ptr->node_state;
 	char *cloud_str = "", *comp_str = "", *drain_str = "", *power_str = "";
-	char load_str[32], mem_str[32], tmp_line[512], time_str[32], owner_str[32];
+	char time_str[32];
 	char *out = NULL, *reason_str = NULL, *select_reason_str = NULL;
 	uint16_t err_cpus = 0, alloc_cpus = 0;
 	int cpus_per_node = 1;
 	int idle_cpus;
 	uint32_t cluster_flags = slurmdb_setup_cluster_flags();
 	uint32_t alloc_memory;
+	char *line_end = (one_liner) ? " " : "\n   ";
 
 	if (node_scaling)
 		cpus_per_node = node_ptr->cpus / node_scaling;
@@ -188,8 +188,7 @@ slurm_sprint_node_table (node_info_t * node_ptr,
 	}
 
 	/****** Line 1 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "NodeName=%s ", node_ptr->name);
-	xstrcat(out, tmp_line);
+	xstrfmtcat(out, "NodeName=%s ", node_ptr->name);
 	if (cluster_flags & CLUSTER_FLAG_BG) {
 		slurm_get_select_nodeinfo(node_ptr->select_nodeinfo,
 					  SELECT_NODEDATA_RACK_MP,
@@ -200,232 +199,179 @@ slurm_sprint_node_table (node_info_t * node_ptr,
 		}
 	}
 
-	if (node_ptr->arch) {
-		snprintf(tmp_line, sizeof(tmp_line), "Arch=%s ",
-			 node_ptr->arch);
-		xstrcat(out, tmp_line);
-	}
-	snprintf(tmp_line, sizeof(tmp_line), "CoresPerSocket=%u",
-		 node_ptr->cores);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	if (node_ptr->arch)
+		xstrfmtcat(out, "Arch=%s ", node_ptr->arch);
+
+	xstrfmtcat(out, "CoresPerSocket=%u", node_ptr->cores);
+
+	xstrcat(out, line_end);
+
+	/****** Line ******/
+	xstrfmtcat(out, "CPUAlloc=%u CPUErr=%u CPUTot=%u ",
+		   alloc_cpus, err_cpus, node_ptr->cpus);
 
-	/****** Line 2 ******/
 	if (node_ptr->cpu_load == NO_VAL)
-		strcpy(load_str, "N/A");
-	else {
-		snprintf(load_str, sizeof(load_str), "%.2f",
-			 (node_ptr->cpu_load / 100.0));
-	}
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "CPUAlloc=%u CPUErr=%u CPUTot=%u CPULoad=%s Features=%s",
-		 alloc_cpus, err_cpus, node_ptr->cpus, load_str,
-		 node_ptr->features);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
+		xstrcat(out, "CPULoad=N/A");
 	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "CPULoad=%.2f", (node_ptr->cpu_load / 100.0));
 
-	/****** Line 3 ******/
-	snprintf(tmp_line, sizeof(tmp_line), "Gres=%s", node_ptr->gres);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrcat(out, line_end);
+
+	/****** Line ******/
+	xstrfmtcat(out, "AvailableFeatures=%s", node_ptr->features);
+	xstrcat(out, line_end);
 
-	/****** Line 4 (optional) ******/
+	/****** Line ******/
+	xstrfmtcat(out, "ActiveFeatures=%s", node_ptr->features_act);
+	xstrcat(out, line_end);
+
+	/****** Line ******/
+	xstrfmtcat(out, "Gres=%s", node_ptr->gres);
+	xstrcat(out, line_end);
+
+	/****** Line (optional) ******/
 	if (node_ptr->gres_drain) {
-		snprintf(tmp_line, sizeof(tmp_line), "GresDrain=%s",
-			 node_ptr->gres_drain);
-		xstrcat(out, tmp_line);
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrfmtcat(out, "GresDrain=%s", node_ptr->gres_drain);
+		xstrcat(out, line_end);
 	}
 
-	/****** Line 5 (optional) ******/
+	/****** Line (optional) ******/
 	if (node_ptr->gres_used) {
-		snprintf(tmp_line, sizeof(tmp_line), "GresUsed=%s",
-			 node_ptr->gres_used);
-		xstrcat(out, tmp_line);
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrfmtcat(out, "GresUsed=%s", node_ptr->gres_used);
+		xstrcat(out, line_end);
 	}
 
-	/****** Line 6 (optional) ******/
+	/****** Line (optional) ******/
 	if (node_ptr->node_hostname || node_ptr->node_addr) {
-		snprintf(tmp_line, sizeof(tmp_line),
-			 "NodeAddr=%s NodeHostName=%s Version=%s",
-			 node_ptr->node_addr, node_ptr->node_hostname,
-			 node_ptr->version);
-		xstrcat(out, tmp_line);
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrfmtcat(out, "NodeAddr=%s NodeHostName=%s Version=%s",
+			   node_ptr->node_addr, node_ptr->node_hostname,
+			   node_ptr->version);
+		xstrcat(out, line_end);
 	}
 
-	/****** Line 7 ******/
-	if (node_ptr->os) {
-		snprintf(tmp_line, sizeof(tmp_line), "OS=%s ", node_ptr->os);
-		xstrcat(out, tmp_line);
-	}
-	if (node_ptr->free_mem == NO_VAL)
-		strcpy(mem_str, "N/A");
-	else {
-		snprintf(mem_str, sizeof(mem_str), "%u", node_ptr->free_mem);
-	}
+	/****** Line ******/
+	if (node_ptr->os)
+		xstrfmtcat(out, "OS=%s ", node_ptr->os);
+
 	slurm_get_select_nodeinfo(node_ptr->select_nodeinfo,
 				  SELECT_NODEDATA_MEM_ALLOC,
 				  NODE_STATE_ALLOCATED,
 				  &alloc_memory);
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "RealMemory=%u AllocMem=%u FreeMem=%s Sockets=%u Boards=%u",
-		 node_ptr->real_memory, alloc_memory, mem_str,
-		 node_ptr->sockets, node_ptr->boards);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
+	xstrfmtcat(out, "RealMemory=%u AllocMem=%u ",
+		   node_ptr->real_memory, alloc_memory);
+
+	if (node_ptr->free_mem == NO_VAL)
+		xstrcat(out, "FreeMem=N/A ");
 	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "FreeMem=%u ", node_ptr->free_mem);
+
+	xstrfmtcat(out, "Sockets=%u Boards=%u",
+		   node_ptr->sockets, node_ptr->boards);
+
+	xstrcat(out, line_end);
 
 	/****** core & memory specialization Line (optional) ******/
 	if (node_ptr->core_spec_cnt || node_ptr->cpu_spec_list ||
 	    node_ptr->mem_spec_limit) {
 		if (node_ptr->core_spec_cnt) {
-			snprintf(tmp_line, sizeof(tmp_line),
-				 "CoreSpecCount=%u ", node_ptr->core_spec_cnt);
-			xstrcat(out, tmp_line);
+			xstrfmtcat(out, "CoreSpecCount=%u ",
+				   node_ptr->core_spec_cnt);
 		}
 		if (node_ptr->cpu_spec_list) {
-			snprintf(tmp_line, sizeof(tmp_line), "CPUSpecList=%s ",
-				 node_ptr->cpu_spec_list);
-			xstrcat(out, tmp_line);
+			xstrfmtcat(out, "CPUSpecList=%s ",
+				   node_ptr->cpu_spec_list);
 		}
 		if (node_ptr->mem_spec_limit) {
-			snprintf(tmp_line, sizeof(tmp_line), "MemSpecLimit=%u",
-				 node_ptr->mem_spec_limit);
-			xstrcat(out, tmp_line);
+			xstrfmtcat(out, "MemSpecLimit=%u",
+				   node_ptr->mem_spec_limit);
 		}
-		if (one_liner)
-			xstrcat(out, " ");
-		else
-			xstrcat(out, "\n   ");
+		xstrcat(out, line_end);
 	}
 
-	/****** Line 8 ******/
+	/****** Line ******/
+	xstrfmtcat(out, "State=%s%s%s%s%s ThreadsPerCore=%u TmpDisk=%u Weight=%u ",
+		   node_state_string(my_state),
+		   cloud_str, comp_str, drain_str, power_str,
+		   node_ptr->threads, node_ptr->tmp_disk, node_ptr->weight);
+
 	if (node_ptr->owner == NO_VAL) {
-		snprintf(owner_str, sizeof(owner_str), "N/A");
+		xstrcat(out, "Owner=N/A ");
 	} else {
-		char *user_name;
-		user_name = uid_to_string((uid_t) node_ptr->owner);
-		snprintf(owner_str, sizeof(owner_str), "%s(%u)",
-			 user_name, node_ptr->owner);
+		char *user_name = uid_to_string((uid_t) node_ptr->owner);
+		xstrfmtcat(out, "Owner=%s(%u) ", user_name, node_ptr->owner);
 		xfree(user_name);
 	}
-	snprintf(tmp_line, sizeof(tmp_line),
-		 "State=%s%s%s%s%s ThreadsPerCore=%u TmpDisk=%u Weight=%u "
-		 "Owner=%s",
-		 node_state_string(my_state),
-		 cloud_str, comp_str, drain_str, power_str,
-		 node_ptr->threads, node_ptr->tmp_disk, node_ptr->weight,
-		 owner_str);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
 
-	/****** Line 9 ******/
+	xstrfmtcat(out, "MCS_label=%s",
+		   (node_ptr->mcs_label == NULL) ? "N/A" : node_ptr->mcs_label);
+
+	xstrcat(out, line_end);
+
+	/****** Line ******/
 	if (node_ptr->boot_time) {
-		slurm_make_time_str ((time_t *)&node_ptr->boot_time,
-				     time_str, sizeof(time_str));
+		slurm_make_time_str((time_t *)&node_ptr->boot_time,
+				    time_str, sizeof(time_str));
+		xstrfmtcat(out, "BootTime=%s ", time_str);
 	} else {
-		strncpy(time_str, "None", sizeof(time_str));
+		xstrcat(out, "BootTime=None ");
 	}
-	snprintf(tmp_line, sizeof(tmp_line), "BootTime=%s ", time_str);
-	xstrcat(out, tmp_line);
 
 	if (node_ptr->slurmd_start_time) {
 		slurm_make_time_str ((time_t *)&node_ptr->slurmd_start_time,
 				     time_str, sizeof(time_str));
+		xstrfmtcat(out, "SlurmdStartTime=%s", time_str);
 	} else {
-		strncpy(time_str, "None", sizeof(time_str));
+		xstrcat(out, "SlurmdStartTime=None");
 	}
-	snprintf(tmp_line, sizeof(tmp_line), "SlurmdStartTime=%s", time_str);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+
+	xstrcat(out, line_end);
 
 	/****** Power Management Line ******/
-	if (!node_ptr->power || (node_ptr->power->cap_watts == NO_VAL)) {
-		snprintf(tmp_line, sizeof(tmp_line), "CapWatts=n/a");
-	} else {
-		snprintf(tmp_line, sizeof(tmp_line), "CapWatts=%u",
-			 node_ptr->power->cap_watts);
-	}
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
+	if (!node_ptr->power || (node_ptr->power->cap_watts == NO_VAL))
+		xstrcat(out, "CapWatts=n/a");
 	else
-		xstrcat(out, "\n   ");
+		xstrfmtcat(out, "CapWatts=%u", node_ptr->power->cap_watts);
+
+	xstrcat(out, line_end);
 
 	/****** Power Consumption Line ******/
 	if (!node_ptr->energy || node_ptr->energy->current_watts == NO_VAL)
-		snprintf(tmp_line, sizeof(tmp_line), "CurrentWatts=n/s "
-				"LowestJoules=n/s ConsumedJoules=n/s");
+		xstrcat(out, "CurrentWatts=n/s LowestJoules=n/s ConsumedJoules=n/s");
 	else
-		snprintf(tmp_line, sizeof(tmp_line), "CurrentWatts=%u "
+		xstrfmtcat(out, "CurrentWatts=%u "
 				"LowestJoules=%"PRIu64" "
 				"ConsumedJoules=%"PRIu64"",
 				node_ptr->energy->current_watts,
 				node_ptr->energy->base_consumed_energy,
 				node_ptr->energy->consumed_energy);
-	xstrcat(out, tmp_line);
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+
+	xstrcat(out, line_end);
 
 	/****** external sensors Line ******/
 	if (!node_ptr->ext_sensors
 	    || node_ptr->ext_sensors->consumed_energy == NO_VAL)
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsJoules=n/s ");
+		xstrcat(out, "ExtSensorsJoules=n/s ");
 	else
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsJoules=%"PRIu64" ",
-			 node_ptr->ext_sensors->consumed_energy);
-	xstrcat(out, tmp_line);
+		xstrfmtcat(out, "ExtSensorsJoules=%"PRIu64" ",
+			   node_ptr->ext_sensors->consumed_energy);
+
 	if (!node_ptr->ext_sensors
 	    || node_ptr->ext_sensors->current_watts == NO_VAL)
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsWatts=n/s ");
+		xstrcat(out, "ExtSensorsWatts=n/s ");
 	else
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsWatts=%u ",
-			 node_ptr->ext_sensors->current_watts);
-	xstrcat(out, tmp_line);
+		xstrfmtcat(out, "ExtSensorsWatts=%u ",
+			   node_ptr->ext_sensors->current_watts);
+
 	if (!node_ptr->ext_sensors
 	    || node_ptr->ext_sensors->temperature == NO_VAL)
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsTemp=n/s");
+		xstrcat(out, "ExtSensorsTemp=n/s");
 	else
-		snprintf(tmp_line, sizeof(tmp_line), "ExtSensorsTemp=%u",
-			 node_ptr->ext_sensors->temperature);
-	xstrcat(out, tmp_line);
+		xstrfmtcat(out, "ExtSensorsTemp=%u",
+			   node_ptr->ext_sensors->temperature);
 
-	if (one_liner)
-		xstrcat(out, " ");
-	else
-		xstrcat(out, "\n   ");
+	xstrcat(out, line_end);
 
-	/****** Line 12 ******/
+	/****** Line ******/
 	if (node_ptr->reason && node_ptr->reason[0])
 		xstrcat(reason_str, node_ptr->reason);
 	slurm_get_select_nodeinfo(node_ptr->select_nodeinfo,
@@ -445,21 +391,15 @@ slurm_sprint_node_table (node_info_t * node_ptr,
 			if (inx == 1) {
 				xstrcat(out, "Reason=");
 			} else {
-				if (one_liner)
-					xstrcat(out, " ");
-				else
-					xstrcat(out, "\n   ");
+				xstrcat(out, line_end);
 				xstrcat(out, "       ");
 			}
-			snprintf(tmp_line, sizeof(tmp_line), "%s", tok);
-			xstrcat(out, tmp_line);
+			xstrfmtcat(out, "%s", tok);
 			if ((inx++ == 1) && node_ptr->reason_time) {
 				user_name = uid_to_string(node_ptr->reason_uid);
 				slurm_make_time_str((time_t *)&node_ptr->reason_time,
-						    time_str,sizeof(time_str));
-				snprintf(tmp_line, sizeof(tmp_line),
-					 " [%s@%s]", user_name, time_str);
-				xstrcat(out, tmp_line);
+						    time_str, sizeof(time_str));
+				xstrfmtcat(out, " [%s@%s]", user_name, time_str);
 			}
 			tok = strtok_r(NULL, "\n", &save_ptr);
 		}
diff --git a/src/api/partition_info.c b/src/api/partition_info.c
index 681678f5b..b40eaaf49 100644
--- a/src/api/partition_info.c
+++ b/src/api/partition_info.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov> et. al.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -50,6 +50,7 @@
 
 #include "src/common/parse_time.h"
 #include "src/common/slurm_protocol_api.h"
+#include "src/common/slurm_selecttype_info.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
 
@@ -221,8 +222,8 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
 		xstrcat(out, "MaxNodes=UNLIMITED");
 	else {
 		if (cluster_flags & CLUSTER_FLAG_BG) {
-			convert_num_unit((float)part_ptr->max_nodes,
-					 tmp, sizeof(tmp), UNIT_NONE,
+			convert_num_unit((float)part_ptr->max_nodes, tmp,
+					 sizeof(tmp), UNIT_NONE, NO_VAL,
 					 CONVERT_NUM_UNIT_EXACT);
 			xstrfmtcat(out, "MaxNodes=%s", tmp);
 		} else
@@ -241,8 +242,7 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
 		convert_num_unit((float)part_ptr->min_nodes, tmp, sizeof(tmp),
-				 UNIT_NONE,
-				 CONVERT_NUM_UNIT_EXACT);
+				 UNIT_NONE, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(out, " MinNodes=%s", tmp);
 	} else
 		xstrfmtcat(out, " MinNodes=%u", part_ptr->min_nodes);
@@ -271,7 +271,8 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
 
 	/****** Line 7 ******/
 
-	xstrfmtcat(out, "Priority=%u", part_ptr->priority);
+	xstrfmtcat(out, "PriorityJobFactor=%u", part_ptr->priority_job_factor);
+	xstrfmtcat(out, " PriorityTier=%u", part_ptr->priority_tier);
 
 	if (part_ptr->flags & PART_FLAG_ROOT_ONLY)
 		xstrcat(out, " RootOnly=YES");
@@ -286,14 +287,13 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
 	force = part_ptr->max_share & SHARED_FORCE;
 	val = part_ptr->max_share & (~SHARED_FORCE);
 	if (val == 0)
-		xstrcat(out, " Shared=EXCLUSIVE");
-	else if (force) {
-		xstrfmtcat(out, " Shared=FORCE:%u", val);
-	} else if (val == 1)
-		xstrcat(out, " Shared=NO");
-	else {
-		xstrfmtcat(out, " Shared=YES:%u", val);
-	}
+		xstrcat(out, " OverSubscribe=EXCLUSIVE");
+	else if (force)
+		xstrfmtcat(out, " OverSubscribe=FORCE:%u", val);
+	else if (val == 1)
+		xstrcat(out, " OverSubscribe=NO");
+	else
+		xstrfmtcat(out, " OverSubscribe=YES:%u", val);
 
 	preempt_mode = part_ptr->preempt_mode;
 	if (preempt_mode == (uint16_t) NO_VAL)
@@ -316,29 +316,22 @@ char *slurm_sprint_partition_info ( partition_info_t * part_ptr,
 		xstrcat(out, "State=UNKNOWN");
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
-		convert_num_unit((float)part_ptr->total_cpus, tmp,
-				 sizeof(tmp), UNIT_NONE,
-				 CONVERT_NUM_UNIT_EXACT);
+		convert_num_unit((float)part_ptr->total_cpus, tmp, sizeof(tmp),
+				 UNIT_NONE, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(out, " TotalCPUs=%s", tmp);
 	} else
 		xstrfmtcat(out, " TotalCPUs=%u", part_ptr->total_cpus);
 
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
-		convert_num_unit((float)part_ptr->total_nodes, tmp,
-				 sizeof(tmp), UNIT_NONE,
-				 CONVERT_NUM_UNIT_EXACT);
+		convert_num_unit((float)part_ptr->total_nodes, tmp, sizeof(tmp),
+				 UNIT_NONE, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(out, " TotalNodes=%s", tmp);
 	} else
 		xstrfmtcat(out, " TotalNodes=%u", part_ptr->total_nodes);
 
-
-	if (part_ptr->cr_type & CR_CORE)
-		xstrcat(out, " SelectTypeParameters=CR_CORE");
-	else if (part_ptr->cr_type & CR_SOCKET)
-		xstrcat(out, " SelectTypeParameters=CR_SOCKET");
-	else
-		xstrcat(out, " SelectTypeParameters=N/A");
+	xstrfmtcat(out, " SelectTypeParameters=%s",
+		   select_type_param_string(part_ptr->cr_type));
 
 	xstrcat(out, line_end);
 
diff --git a/src/api/pmi.c b/src/api/pmi.c
index 7dcde3fc4..5abe2432a 100644
--- a/src/api/pmi.c
+++ b/src/api/pmi.c
@@ -314,14 +314,14 @@ int PMI_Finalize( void )
 		fprintf(stderr, "In: PMI_Finalize\n");
 
 	pmi_init = 0;
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++)
 		_del_kvs_rec(&kvs_recs[i]);
 	if (kvs_recs)
 		free(kvs_recs);
 	kvs_recs = NULL;
 	kvs_rec_cnt = 0;
-	pthread_mutex_unlock(&kvs_mutex);
+	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	slurm_pmi_finalize();
 
 	return PMI_SUCCESS;
@@ -655,7 +655,7 @@ have called 'PMI_Barrier()'.
 @*/
 int PMI_Barrier( void )
 {
-	struct kvs_comm_set *kvs_set_ptr = NULL;
+	kvs_comm_set_t *kvs_set_ptr = NULL;
 	struct kvs_comm *kvs_ptr;
 	int i, j, k, rc = PMI_SUCCESS;
 
@@ -881,9 +881,9 @@ int PMI_KVS_Get_my_name( char kvsname[], int length )
 	if (size >= length)	/* truncated */
 		return PMI_ERR_INVALID_LENGTH;
 
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex);   /* DO NOT use slurm_mutex_un/lock */
 	_init_kvs(kvsname);
-	pthread_mutex_unlock(&kvs_mutex);
+	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	return PMI_SUCCESS;
 }
 
@@ -1031,7 +1031,7 @@ int PMI_KVS_Create( char kvsname[], int length )
 	if (pmi_init == 0)
 		return PMI_FAIL;
 
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	size = snprintf(kvsname, length, "%ld.%ld.%d.%d", pmi_jobid,
 			pmi_stepid, pmi_rank, kvs_name_sequence);
 	if (size >= length)	/* truncated */
@@ -1041,7 +1041,7 @@ int PMI_KVS_Create( char kvsname[], int length )
 		_init_kvs(kvsname);
 		rc = PMI_SUCCESS;
 	}
-	pthread_mutex_unlock(&kvs_mutex);
+	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	return rc;
 }
 
@@ -1070,7 +1070,7 @@ int PMI_KVS_Destroy( const char kvsname[] )
 	if (kvsname == NULL)
 		return PMI_ERR_INVALID_ARG;
 
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 		if (strncmp(kvs_recs[i].kvs_name, kvsname, PMI_MAX_KVSNAME_LEN))
 			continue;
@@ -1078,7 +1078,7 @@ int PMI_KVS_Destroy( const char kvsname[] )
 		found = 1;
 		break;
 	}
-	pthread_mutex_unlock(&kvs_mutex);
+	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	if (found == 0)
 		return PMI_ERR_INVALID_ARG;
 	/* FIXME: We need to add mechanism to remove these keys from srun's master copy */
@@ -1130,7 +1130,7 @@ static int _kvs_put( const char kvsname[], const char key[], const char value[],
 	int i, j, rc;
 
 	/* find the proper kvs record */
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 		if (strncmp(kvs_recs[i].kvs_name, kvsname, PMI_MAX_KVSNAME_LEN))
 			continue;
@@ -1197,7 +1197,7 @@ no_dup:
 	}
 	rc = PMI_ERR_INVALID_KVS;
 
-fini:	pthread_mutex_unlock(&kvs_mutex);
+fini:	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	_kvs_dump();
 	return rc;
 }
@@ -1220,7 +1220,7 @@ the specified keyval space. It is a process local operation.
 @*/
 int PMI_KVS_Commit( const char kvsname[] )
 {
-	struct kvs_comm_set kvs_set;
+	kvs_comm_set_t kvs_set;
 	int i, j, rc = PMI_SUCCESS, local_pairs;
 
 	if (pmi_debug)
@@ -1253,7 +1253,7 @@ int PMI_KVS_Commit( const char kvsname[] )
 	kvs_set.kvs_comm_recs = 0;
 	kvs_set.kvs_comm_ptr  = NULL;
 
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 		if (kvs_recs[i].kvs_state == KVS_STATE_DEFUNCT)
 			continue;
@@ -1298,7 +1298,7 @@ int PMI_KVS_Commit( const char kvsname[] )
 			!= SLURM_SUCCESS) {
 		rc = PMI_FAIL;
 	}
-	pthread_mutex_unlock(&kvs_mutex);
+	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 
 	/* Free any temporary storage */
 	free(kvs_set.kvs_host_ptr);
@@ -1366,7 +1366,7 @@ int PMI_KVS_Get( const char kvsname[], const char key[], char value[], int lengt
 		return PMI_ERR_INVALID_VAL;
 
 	/* find the proper kvs record */
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 		if (kvs_recs[i].kvs_state == KVS_STATE_DEFUNCT)
 			continue;
@@ -1390,7 +1390,7 @@ int PMI_KVS_Get( const char kvsname[], const char key[], char value[], int lengt
 	}
 	rc = PMI_ERR_INVALID_KVS;
 
-fini:	pthread_mutex_unlock(&kvs_mutex);
+fini:	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	return rc;
 }
 
@@ -1442,7 +1442,7 @@ int PMI_KVS_Iter_first(const char kvsname[], char key[], int key_len, char val[]
 	val[0] = '\0';
 	/* find the proper kvs record
 	 */
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 
 		if (kvs_recs[i].kvs_state == KVS_STATE_DEFUNCT)
@@ -1471,7 +1471,7 @@ int PMI_KVS_Iter_first(const char kvsname[], char key[], int key_len, char val[]
 	}
 	rc = PMI_ERR_INVALID_KVS;
 
-fini:	pthread_mutex_unlock(&kvs_mutex);
+fini:	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	return rc;
 }
 
@@ -1524,7 +1524,7 @@ int PMI_KVS_Iter_next(const char kvsname[], char key[], int key_len,
 	key[0] = '\0';
 	val[0] = '\0';
 	/* find the proper kvs record */
-	pthread_mutex_lock(&kvs_mutex);
+	pthread_mutex_lock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	for (i=0; i<kvs_rec_cnt; i++) {
 		if (kvs_recs[i].kvs_state == KVS_STATE_DEFUNCT)
 			continue;
@@ -1550,7 +1550,7 @@ int PMI_KVS_Iter_next(const char kvsname[], char key[], int key_len,
 	}
 	rc = PMI_ERR_INVALID_KVS;
 
-fini:	pthread_mutex_unlock(&kvs_mutex);
+fini:	pthread_mutex_unlock(&kvs_mutex); /* DO NOT use slurm_mutex_un/lock */
 	return rc;
 }
 
@@ -1936,7 +1936,7 @@ static int IsPmiKey(char * key) {
 	char strh[5];
 
 	if (pmi_debug)
-		fprintf(stderr, "In: IsPmiKey \n");
+		fprintf(stderr, "In: IsPmiKey\n");
 
 	strncpy(strh, key, 4);
 	strh[4]='\0';
@@ -1954,11 +1954,11 @@ inline static void _kvs_dump(void)
 	int i, j;
 
 	for (i=0; i<kvs_rec_cnt; i++) {
-		info("name=%s state=%u cnt=%u inx=%u",
+		fprintf(stderr, "name=%s state=%u cnt=%u inx=%u\n",
 			kvs_recs[i].kvs_name, kvs_recs[i].kvs_state,
 			kvs_recs[i].kvs_cnt, kvs_recs[i].kvs_inx);
 		for (j=0; j<kvs_recs[i].kvs_cnt; j++) {
-			info("  state=%u key=%s value=%s",
+			fprintf(stderr, "  state=%u key=%s value=%s\n",
 				kvs_recs[i].kvs_key_states[j],
 				kvs_recs[i].kvs_keys[j],
 				kvs_recs[i].kvs_values[j]);
diff --git a/src/api/pmi_server.c b/src/api/pmi_server.c
index b54555efe..94a9139f8 100644
--- a/src/api/pmi_server.c
+++ b/src/api/pmi_server.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  pmi_server.c - Global PMI data as maintained within srun
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -81,7 +80,7 @@ struct agent_arg {
 };				/* details for message agent manager */
 struct msg_arg {
 	struct barrier_resp *bar_ptr;
-	struct kvs_comm_set *kvs_ptr;
+	kvs_comm_set_t *kvs_ptr;
 };
 int agent_cnt = 0;		/* number of active message agents */
 int agent_max_cnt = 32;		/* maximum number of active agents */
@@ -185,7 +184,7 @@ static void *_msg_thread(void *x)
 static void *_agent(void *x)
 {
 	struct agent_arg *args = (struct agent_arg *) x;
-	struct kvs_comm_set *kvs_set;
+	kvs_comm_set_t *kvs_set;
 	struct msg_arg *msg_args;
 	struct kvs_hosts *kvs_host_list;
 	int i, j, kvs_set_cnt = 0, host_cnt, pmi_fanout = 32;
@@ -208,7 +207,7 @@ static void *_agent(void *x)
 	START_TIMER;
 	slurm_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-	kvs_set = xmalloc(sizeof(struct kvs_comm_set) * args->barrier_xmit_cnt);
+	kvs_set = xmalloc(sizeof(kvs_comm_set_t) * args->barrier_xmit_cnt);
 	for (i=0; i<args->barrier_xmit_cnt; i++) {
 		if (args->barrier_xmit_ptr[i].port == 0)
 			continue;	/* already sent message to host */
@@ -414,7 +413,7 @@ static void _print_kvs(void)
 #endif
 }
 
-extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr)
+extern int pmi_kvs_put(kvs_comm_set_t *kvs_set_ptr)
 {
 	int i, usec_timer;
 	struct kvs_comm *kvs_ptr;
@@ -438,7 +437,7 @@ extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr)
 	 * NOTE: We just move pointers rather than copy data where
 	 * possible for improved performance */
 	START_TIMER;
-	pthread_mutex_lock(&kvs_mutex);
+	slurm_mutex_lock(&kvs_mutex);
 	for (i=0; i<kvs_set_ptr->kvs_comm_recs; i++) {
 		kvs_ptr = _find_kvs_by_name(kvs_set_ptr->
 			kvs_comm_ptr[i]->kvs_name);
@@ -450,10 +449,9 @@ extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr)
 			kvs_set_ptr-> kvs_comm_ptr[i] = NULL;
 		}
 	}
-	slurm_free_kvs_comm_set(kvs_set_ptr);
 	_print_kvs();
 	kvs_updated = 1;
-	pthread_mutex_unlock(&kvs_mutex);
+	slurm_mutex_unlock(&kvs_mutex);
 	END_TIMER;
 	usec_timer = DELTA_TIMER;
 	min_time_kvs_put = MIN(min_time_kvs_put, usec_timer);
@@ -487,7 +485,7 @@ extern int pmi_kvs_get(kvs_get_msg_t *kvs_get_ptr)
 	if (kvs_get_ptr->task_id < 10000)
 		tm[kvs_get_ptr->task_id] = cur_time;
 #endif
-	pthread_mutex_lock(&kvs_mutex);
+	slurm_mutex_lock(&kvs_mutex);
 	if (barrier_cnt == 0) {
 		barrier_cnt = kvs_get_ptr->size;
 		barrier_ptr = xmalloc(sizeof(struct barrier_resp)*barrier_cnt);
@@ -521,7 +519,7 @@ extern int pmi_kvs_get(kvs_get_msg_t *kvs_get_ptr)
 #endif
 		_kvs_xmit_tasks();
 	}
-fini:	pthread_mutex_unlock(&kvs_mutex);
+fini:	slurm_mutex_unlock(&kvs_mutex);
 
 	return rc;
 }
@@ -562,11 +560,11 @@ static void _free_kvs_comm(struct kvs_comm *kvs_comm_ptr)
 extern void pmi_kvs_free(void)
 {
 	int i;
-	pthread_mutex_lock(&kvs_mutex);
+	slurm_mutex_lock(&kvs_mutex);
 	for (i = 0; i < kvs_comm_cnt; i ++) {
 		_free_kvs_comm(kvs_comm_ptr[i]);
 	}
 	xfree(kvs_comm_ptr);
 	kvs_comm_cnt = 0;
-	pthread_mutex_unlock(&kvs_mutex);
+	slurm_mutex_unlock(&kvs_mutex);
 }
diff --git a/src/api/pmi_server.h b/src/api/pmi_server.h
index aee5f6465..36784aec2 100644
--- a/src/api/pmi_server.h
+++ b/src/api/pmi_server.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  pmi.h - Global PMI data as maintained within srun
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -33,7 +32,7 @@
 #include "src/common/slurm_protocol_defs.h"
 
 /* Put the supplied kvs values into the common store */
-extern int pmi_kvs_put(struct kvs_comm_set *kvs_set_ptr);
+extern int pmi_kvs_put(kvs_comm_set_t *kvs_set_ptr);
 
 /* Note that a task has reached a barrier,
  * transmit the kvs values to the task */
diff --git a/src/api/reconfigure.c b/src/api/reconfigure.c
index c7503420d..fd08ea72c 100644
--- a/src/api/reconfigure.c
+++ b/src/api/reconfigure.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  reconfigure.c - request that slurmctld shutdown or re-read the
  *	            configuration files
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/api/signal.c b/src/api/signal.c
index 595f88ff9..e7eec6798 100644
--- a/src/api/signal.c
+++ b/src/api/signal.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  signal.c - Send a signal to a slurm job or job step
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -79,6 +78,9 @@ static int _local_send_recv_rc_msgs(const char *nodelist,
 		rc = SLURM_ERROR;
 	}
 
+	/* don't attempt to free a local variable */
+	msg->data = NULL;
+
 	slurm_free_msg(msg);
 	return rc;
 }
diff --git a/src/api/slurm_pmi.c b/src/api/slurm_pmi.c
index 36334b801..6b836a0cd 100644
--- a/src/api/slurm_pmi.c
+++ b/src/api/slurm_pmi.c
@@ -60,7 +60,7 @@ uint16_t srun_port = 0;
 slurm_addr_t srun_addr;
 
 static void _delay_rpc(int pmi_rank, int pmi_size);
-static int  _forward_comm_set(struct kvs_comm_set *kvs_set_ptr);
+static int  _forward_comm_set(kvs_comm_set_t *kvs_set_ptr);
 static int  _get_addr(void);
 static void _set_pmi_time(void);
 
@@ -163,7 +163,7 @@ static void _set_pmi_time(void)
 }
 
 /* Transmit PMI Keyval space data */
-int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr,
+int slurm_send_kvs_comm_set(kvs_comm_set_t *kvs_set_ptr,
 		int pmi_rank, int pmi_size)
 {
 	slurm_msg_t msg_send;
@@ -212,8 +212,8 @@ int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr,
 }
 
 /* Wait for barrier and get full PMI Keyval space data */
-int  slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr,
-		int pmi_rank, int pmi_size)
+int  slurm_get_kvs_comm_set(kvs_comm_set_t **kvs_set_ptr,
+			    int pmi_rank, int pmi_size)
 {
 	int rc, srun_fd, retries = 0, timeout = 0;
 	slurm_msg_t msg_send, msg_rcv;
@@ -331,7 +331,7 @@ int  slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr,
 /* Forward keypair info to other tasks as required.
  * Clear message forward structure upon completion.
  * The messages are forwarded sequentially. */
-static int _forward_comm_set(struct kvs_comm_set *kvs_set_ptr)
+static int _forward_comm_set(kvs_comm_set_t *kvs_set_ptr)
 {
 	int i, rc = SLURM_SUCCESS;
 	int tmp_host_cnt = kvs_set_ptr->host_cnt;
@@ -361,41 +361,6 @@ static int _forward_comm_set(struct kvs_comm_set *kvs_set_ptr)
 	return rc;
 }
 
-static void _free_kvs_comm(struct kvs_comm *kvs_comm_ptr)
-{
-	int i;
-
-	if (kvs_comm_ptr == NULL)
-		return;
-
-	for (i=0; i<kvs_comm_ptr->kvs_cnt; i++) {
-		xfree(kvs_comm_ptr->kvs_keys[i]);
-		xfree(kvs_comm_ptr->kvs_values[i]);
-	}
-	xfree(kvs_comm_ptr->kvs_name);
-	xfree(kvs_comm_ptr->kvs_keys);
-	xfree(kvs_comm_ptr->kvs_values);
-	xfree(kvs_comm_ptr);
-}
-
-/* Free kvs_comm_set returned by slurm_get_kvs_comm_set() */
-void slurm_free_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr)
-{
-	int i;
-
-	if (kvs_set_ptr == NULL)
-		return;
-
-	for (i=0; i<kvs_set_ptr->host_cnt; i++)
-		xfree(kvs_set_ptr->kvs_host_ptr[i].hostname);
-	xfree(kvs_set_ptr->kvs_host_ptr);
-
-	for (i=0; i<kvs_set_ptr->kvs_comm_recs; i++)
-		_free_kvs_comm(kvs_set_ptr->kvs_comm_ptr[i]);
-	xfree(kvs_set_ptr->kvs_comm_ptr);
-	xfree(kvs_set_ptr);
-}
-
 /* Finalization processing */
 void slurm_pmi_finalize(void)
 {
diff --git a/src/api/slurm_pmi.h b/src/api/slurm_pmi.h
index 329f2dd10..8601fb7db 100644
--- a/src/api/slurm_pmi.h
+++ b/src/api/slurm_pmi.h
@@ -53,43 +53,21 @@
 #endif  /*  HAVE_CONFIG_H */
 
 #include "src/common/pack.h"
+#include "src/common/slurm_protocol_defs.h"
 
 #define PMI_MAX_ID_LEN       16	/* Maximim size of PMI process group ID */
 #define PMI_MAX_KEY_LEN     256	/* Maximum size of a PMI key */
 #define PMI_MAX_KVSNAME_LEN 256	/* Maximum size of KVS name */
 #define PMI_MAX_VAL_LEN     1024 /* Maximum size of a PMI value */
 
-struct kvs_hosts {
-	uint32_t	task_id;	/* job step's task id */
-	uint16_t	port;		/* communication port */
-	char *		hostname;	/* communication host */
-};
-struct kvs_comm {
-	char *		kvs_name;
-	uint32_t	kvs_cnt;	/* count of key-pairs */
-	char **		kvs_keys;
-	char **		kvs_values;
-	uint16_t *	kvs_key_sent;
-};
-struct kvs_comm_set {
-
-	uint16_t	host_cnt;	/* hosts getting this message */
-	struct kvs_hosts *kvs_host_ptr;	/* host forwarding info */
- 	uint16_t	kvs_comm_recs;	/* count of kvs_comm entries */
-	struct kvs_comm **kvs_comm_ptr;	/* pointers to kvs_comm entries */
-};
-
 /* Transmit PMI Keyval space data */
-int slurm_send_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr,
+int slurm_send_kvs_comm_set(kvs_comm_set_t *kvs_set_ptr,
 		int pmi_rank, int pmi_size);
 
 /* Wait for barrier and get full PMI Keyval space data */
-int  slurm_get_kvs_comm_set(struct kvs_comm_set **kvs_set_ptr,
+int  slurm_get_kvs_comm_set(kvs_comm_set_t **kvs_set_ptr,
 		int pmi_rank, int pmi_size);
 
-/* Free kvs_comm_set returned by slurm_get_kvs_comm_set() */
-void slurm_free_kvs_comm_set(struct kvs_comm_set *kvs_set_ptr);
-
 /* Finalization processing */
 void slurm_pmi_finalize(void);
 
diff --git a/src/api/step_ctx.h b/src/api/step_ctx.h
index ebcc7bb4b..d208901ad 100644
--- a/src/api/step_ctx.h
+++ b/src/api/step_ctx.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  step_ctx.h - step context declarations
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/api/step_io.c b/src/api/step_io.c
index 4c67d34f3..0ee74b77f 100644
--- a/src/api/step_io.c
+++ b/src/api/step_io.c
@@ -516,9 +516,9 @@ again:
 	 */
 	s->out_msg->ref_count--;
 	if (s->out_msg->ref_count == 0) {
-		pthread_mutex_lock(&s->cio->ioservers_lock);
+		slurm_mutex_lock(&s->cio->ioservers_lock);
 		list_enqueue(s->cio->free_incoming, s->out_msg);
-		pthread_mutex_unlock(&s->cio->ioservers_lock);
+		slurm_mutex_unlock(&s->cio->ioservers_lock);
 	} else
 		debug3("  Could not free msg!!");
 	s->out_msg = NULL;
@@ -674,12 +674,12 @@ static bool _file_readable(eio_obj_t *obj)
 		info->eof = true;
 		return false;
 	}
-	pthread_mutex_lock(&info->cio->ioservers_lock);
+	slurm_mutex_lock(&info->cio->ioservers_lock);
 	if (_incoming_buf_free(info->cio)) {
-		pthread_mutex_unlock(&info->cio->ioservers_lock);
+		slurm_mutex_unlock(&info->cio->ioservers_lock);
 		return true;
 	}
-	pthread_mutex_unlock(&info->cio->ioservers_lock);
+	slurm_mutex_unlock(&info->cio->ioservers_lock);
 
 	debug3("  false");
 	return false;
@@ -695,15 +695,15 @@ static int _file_read(eio_obj_t *obj, List objs)
 	int len;
 
 	debug2("Entering _file_read");
-	pthread_mutex_lock(&info->cio->ioservers_lock);
+	slurm_mutex_lock(&info->cio->ioservers_lock);
 	if (_incoming_buf_free(info->cio)) {
 		msg = list_dequeue(info->cio->free_incoming);
 	} else {
 		debug3("  List free_incoming is empty, no file read");
-		pthread_mutex_unlock(&info->cio->ioservers_lock);
+		slurm_mutex_unlock(&info->cio->ioservers_lock);
 		return SLURM_SUCCESS;
 	}
-	pthread_mutex_unlock(&info->cio->ioservers_lock);
+	slurm_mutex_unlock(&info->cio->ioservers_lock);
 
 	ptr = msg->data + io_hdr_packed_size();
 
@@ -714,9 +714,9 @@ again:
 			if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
 				debug("_file_read returned %s",
 				      errno==EAGAIN?"EAGAIN":"EWOULDBLOCK");
-				pthread_mutex_lock(&info->cio->ioservers_lock);
+				slurm_mutex_lock(&info->cio->ioservers_lock);
 				list_enqueue(info->cio->free_incoming, msg);
-				pthread_mutex_unlock(&info->cio->ioservers_lock);
+				slurm_mutex_unlock(&info->cio->ioservers_lock);
 				return SLURM_SUCCESS;
 			}
 			/* Any other errors, we pretend we got eof */
@@ -857,7 +857,7 @@ _read_io_init_msg(int fd, client_io_t *cio, char *host)
 	cio->ioserver[msg.nodeid] = _create_server_eio_obj(fd, cio, msg.nodeid,
 							   msg.stdout_objs,
 							   msg.stderr_objs);
-	pthread_mutex_lock(&cio->ioservers_lock);
+	slurm_mutex_lock(&cio->ioservers_lock);
 	bit_set(cio->ioservers_ready_bits, msg.nodeid);
 	cio->ioservers_ready = bit_set_count(cio->ioservers_ready_bits);
 	/* Normally using eio_new_initial_obj while the eio mainloop
@@ -865,7 +865,7 @@ _read_io_init_msg(int fd, client_io_t *cio, char *host)
 	 * inside of the eio mainloop there should be no problem.
 	 */
 	eio_new_initial_obj(cio->eio, cio->ioserver[msg.nodeid]);
-	pthread_mutex_unlock(&cio->ioservers_lock);
+	slurm_mutex_unlock(&cio->ioservers_lock);
 
 	if (cio->sls)
 		step_launch_clear_questionable_state(cio->sls, msg.nodeid);
@@ -1128,7 +1128,7 @@ client_io_handler_create(slurm_step_io_fds_t fds,
 	cio->ioserver = (eio_obj_t **)xmalloc(num_nodes*sizeof(eio_obj_t *));
 	cio->ioservers_ready_bits = bit_alloc(num_nodes);
 	cio->ioservers_ready = 0;
-	pthread_mutex_init(&cio->ioservers_lock, NULL);
+	slurm_mutex_init(&cio->ioservers_lock);
 
 	_init_stdio_eio_objs(fds, cio);
 	ports = slurm_get_srun_port_range();
@@ -1278,7 +1278,7 @@ client_io_handler_downnodes(client_io_t *cio,
 	if (cio == NULL)
 		return;
 
-	pthread_mutex_lock(&cio->ioservers_lock);
+	slurm_mutex_lock(&cio->ioservers_lock);
 	for (i = 0; i < num_node_ids; i++) {
 		node_id = node_ids[i];
 		if (node_id >= cio->num_nodes || node_id < 0)
@@ -1297,7 +1297,7 @@ client_io_handler_downnodes(client_io_t *cio,
 				bit_set_count(cio->ioservers_ready_bits);
 		}
 	}
-	pthread_mutex_unlock(&cio->ioservers_lock);
+	slurm_mutex_unlock(&cio->ioservers_lock);
 
 	eio_signal_wakeup(cio->eio);
 }
@@ -1311,7 +1311,7 @@ client_io_handler_abort(client_io_t *cio)
 
 	if (cio == NULL)
 		return;
-	pthread_mutex_lock(&cio->ioservers_lock);
+	slurm_mutex_lock(&cio->ioservers_lock);
 	for (i = 0; i < cio->num_nodes; i++) {
 		if (!bit_test(cio->ioservers_ready_bits, i)) {
 			bit_set(cio->ioservers_ready_bits, i);
@@ -1327,7 +1327,7 @@ client_io_handler_abort(client_io_t *cio)
 			cio->ioserver[i]->shutdown = true;
 		}
 	}
-	pthread_mutex_unlock(&cio->ioservers_lock);
+	slurm_mutex_unlock(&cio->ioservers_lock);
 }
 
 
@@ -1339,7 +1339,7 @@ int client_io_handler_send_test_message(client_io_t *cio, int node_id,
 	Buf packbuf;
 	struct server_io_info *server;
 	int rc = SLURM_SUCCESS;
-	pthread_mutex_lock(&cio->ioservers_lock);
+	slurm_mutex_lock(&cio->ioservers_lock);
 
 	if (sent_message)
 		*sent_message = false;
@@ -1395,6 +1395,6 @@ int client_io_handler_send_test_message(client_io_t *cio, int node_id,
 		goto done;
 	}
 done:
-	pthread_mutex_unlock(&cio->ioservers_lock);
+	slurm_mutex_unlock(&cio->ioservers_lock);
 	return rc;
 }
diff --git a/src/api/step_io.h b/src/api/step_io.h
index 5a494593c..b5c2dd0cc 100644
--- a/src/api/step_io.h
+++ b/src/api/step_io.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/api/step_io.h - job-step client-side I/O routines
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/api/step_launch.c b/src/api/step_launch.c
index d02fb5c9d..2c871f826 100644
--- a/src/api/step_launch.c
+++ b/src/api/step_launch.c
@@ -286,6 +286,10 @@ int slurm_step_launch (slurm_step_ctx_t *ctx,
 	launch.accel_bind_type	= params->accel_bind_type;
 	launch.multi_prog	= params->multi_prog ? 1 : 0;
 	launch.cpus_per_task	= params->cpus_per_task;
+	launch.ntasks_per_board = params->ntasks_per_board;
+	launch.ntasks_per_core  = params->ntasks_per_core;
+	launch.ntasks_per_socket= params->ntasks_per_socket;
+
 	launch.task_dist	= params->task_dist;
 	launch.partition	= params->partition;
 	launch.pty              = params->pty;
@@ -550,11 +554,11 @@ int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx)
 	ts.tv_sec += 600;	/* 10 min allowed for launch */
 
 	/* Wait for all tasks to start */
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	while (bit_set_count(sls->tasks_started) < sls->tasks_requested) {
 		if (sls->abort) {
 			_step_abort(ctx);
-			pthread_mutex_unlock(&sls->lock);
+			slurm_mutex_unlock(&sls->lock);
 			return SLURM_ERROR;
 		}
 		if (pthread_cond_timedwait(&sls->cond, &sls->lock, &ts) ==
@@ -566,7 +570,7 @@ int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx)
 			sls->abort = true;
 			_step_abort(ctx);
 			pthread_cond_broadcast(&sls->cond);
-			pthread_mutex_unlock(&sls->lock);
+			slurm_mutex_unlock(&sls->lock);
 			return SLURM_ERROR;
 		}
 	}
@@ -575,7 +579,7 @@ int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx)
 		while (sls->io.user->connected < sls->tasks_requested) {
 			if (sls->abort) {
 				_step_abort(ctx);
-				pthread_mutex_unlock(&sls->lock);
+				slurm_mutex_unlock(&sls->lock);
 				return SLURM_ERROR;
 			}
 			if (pthread_cond_timedwait(&sls->cond, &sls->lock,
@@ -584,7 +588,7 @@ int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx)
 				sls->abort = true;
 				_step_abort(ctx);
 				pthread_cond_broadcast(&sls->cond);
-				pthread_mutex_unlock(&sls->lock);
+				slurm_mutex_unlock(&sls->lock);
 				return SLURM_ERROR;
 			}
 		}
@@ -592,7 +596,7 @@ int slurm_step_launch_wait_start(slurm_step_ctx_t *ctx)
 
 	_cr_notify_step_launch(ctx);
 
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 	return SLURM_SUCCESS;
 }
 
@@ -612,7 +616,7 @@ void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx)
 	sls = ctx->launch_state;
 
 	/* Wait for all tasks to complete */
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	while (bit_set_count(sls->tasks_exited) < sls->tasks_requested) {
 		if (!sls->abort) {
 			pthread_cond_wait(&sls->cond, &sls->lock);
@@ -692,10 +696,10 @@ void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx)
 	/* Then shutdown the message handler thread */
 	eio_signal_shutdown(sls->msg_handle);
 
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 	if (sls->msg_thread)
 		pthread_join(sls->msg_thread, NULL);
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	pmi_kvs_free();
 
 	if (sls->msg_handle) {
@@ -708,23 +712,23 @@ void slurm_step_launch_wait_finish(slurm_step_ctx_t *ctx)
 		sls->halt_io_test = true;
 		pthread_cond_broadcast(&sls->cond);
 
-		pthread_mutex_unlock(&sls->lock);
+		slurm_mutex_unlock(&sls->lock);
 		pthread_join(sls->io_timeout_thread, NULL);
-		pthread_mutex_lock(&sls->lock);
+		slurm_mutex_lock(&sls->lock);
 	}
 
 	/* Then wait for the IO thread to finish */
 	if (!sls->user_managed_io) {
-		pthread_mutex_unlock(&sls->lock);
+		slurm_mutex_unlock(&sls->lock);
 		client_io_handler_finish(sls->io.normal);
-		pthread_mutex_lock(&sls->lock);
+		slurm_mutex_lock(&sls->lock);
 
 		client_io_handler_destroy(sls->io.normal);
 		sls->io.normal = NULL;
 	}
 
 	mpi_hook_client_fini(sls->mpi_state);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 /*
@@ -741,10 +745,10 @@ void slurm_step_launch_abort(slurm_step_ctx_t *ctx)
 
 	sls = ctx->launch_state;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	sls->abort = true;
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 /*
@@ -770,7 +774,7 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo)
 	msg.job_step_id = ctx->step_resp->job_step_id;
 	msg.signal      = (uint32_t) signo;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	hl = hostlist_create(NULL);
 	for (node_id = 0;
@@ -804,7 +808,7 @@ void slurm_step_launch_fwd_signal(slurm_step_ctx_t *ctx, int signo)
 		}
 	}
 
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 	if (!hostlist_count(hl)) {
 		hostlist_destroy(hl);
@@ -891,7 +895,7 @@ struct step_launch_state *step_launch_state_create(slurm_step_ctx_t *ctx)
 	sls->mpi_info->stepid = ctx->step_resp->job_step_id;
 	sls->mpi_info->step_layout = layout;
 	sls->mpi_state = NULL;
-	pthread_mutex_init(&sls->lock, NULL);
+	slurm_mutex_init(&sls->lock);
 	pthread_cond_init(&sls->cond, NULL);
 
 	for (ii = 0; ii < layout->node_cnt; ii++) {
@@ -973,7 +977,7 @@ static int _connect_srun_cr(char *addr)
 	strcpy(sa.sun_path, addr);
 	sa_len = strlen(sa.sun_path) + sizeof(sa.sun_family);
 
-	while ((rc = connect(fd, (struct sockaddr *)&sa, sa_len) < 0) &&
+	while (((rc = connect(fd, (struct sockaddr *)&sa, sa_len)) < 0) &&
 	       (errno == EINTR));
 
 	if (rc < 0) {
@@ -1089,7 +1093,7 @@ static int _msg_thr_create(struct step_launch_state *sls, int num_nodes)
 		eio_new_initial_obj(sls->msg_handle, obj);
 	}
 	/* finally, add the listening port that we told the slurmctld about
-	   eariler in the step context creation phase */
+	 * eariler in the step context creation phase */
 	if (sls->slurmctld_socket_fd > -1) {
 		obj = eio_obj_create(sls->slurmctld_socket_fd,
 				     &message_socket_ops, (void *)sls);
@@ -1114,12 +1118,12 @@ _launch_handler(struct step_launch_state *sls, slurm_msg_t *resp)
 	launch_tasks_response_msg_t *msg = resp->data;
 	int i;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	if ((msg->count_of_pids > 0) &&
 	    bit_test(sls->tasks_started, msg->task_ids[0])) {
 		debug3("duplicate launch response received from node %s. "
 		       "this is not an error", msg->node_name);
-		pthread_mutex_unlock(&sls->lock);
+		slurm_mutex_unlock(&sls->lock);
 		return;
 	}
 
@@ -1139,7 +1143,7 @@ _launch_handler(struct step_launch_state *sls, slurm_msg_t *resp)
 		(sls->callback.task_start)(msg);
 
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 }
 
@@ -1164,7 +1168,7 @@ _exit_handler(struct step_launch_state *sls, slurm_msg_t *exit_msg)
 			task_exit_signal = i;
 	}
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	for (i = 0; i < msg->num_tasks; i++) {
 		debug("task %u done", msg->task_id_list[i]);
@@ -1175,7 +1179,7 @@ _exit_handler(struct step_launch_state *sls, slurm_msg_t *exit_msg)
 		(sls->callback.task_finish)(msg);
 
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 static void
@@ -1196,10 +1200,10 @@ _job_complete_handler(struct step_launch_state *sls, slurm_msg_t *complete_msg)
 		(sls->callback.step_complete)(step_msg);
 
 	force_terminated_job = true;
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	sls->abort = true;
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 static void
@@ -1211,9 +1215,9 @@ _timeout_handler(struct step_launch_state *sls, slurm_msg_t *timeout_msg)
 	if (sls->callback.step_timeout)
 		(sls->callback.step_timeout)(step_msg);
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 /*
@@ -1240,7 +1244,7 @@ _node_fail_handler(struct step_launch_state *sls, slurm_msg_t *fail_msg)
 	num_node_ids = hostset_count(fail_nodes);
 	node_ids = xmalloc(sizeof(int) * num_node_ids);
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	all_nodes = hostset_create(sls->layout->node_list);
 	/* find the index number of each down node */
 	for (i = 0; i < num_node_ids; i++) {
@@ -1278,7 +1282,7 @@ _node_fail_handler(struct step_launch_state *sls, slurm_msg_t *fail_msg)
 					    num_node_ids);
 	}
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 	xfree(node_ids);
 	hostlist_iterator_destroy(fail_itr);
@@ -1320,7 +1324,7 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg)
 	if (sls->user_managed_io)
 		return;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	if (!sls->io_timeout_thread_created) {
 		if (_start_io_timeout_thread(sls)) {
@@ -1333,7 +1337,7 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg)
 
 			sls->abort = true;
 			pthread_cond_broadcast(&sls->cond);
-			pthread_mutex_unlock(&sls->lock);
+			slurm_mutex_unlock(&sls->lock);
 			return;
 		}
 	}
@@ -1422,7 +1426,7 @@ _step_missing_handler(struct step_launch_state *sls, slurm_msg_t *missing_msg)
 			sls->io_deadline[node_id] = (time_t)NO_VAL;
 		}
 	}
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 	hostlist_iterator_destroy(fail_itr);
 	hostset_destroy(fail_nodes);
@@ -1462,7 +1466,7 @@ _task_user_managed_io_handler(struct step_launch_state *sls,
 	task_user_managed_io_msg_t *msg =
 		(task_user_managed_io_msg_t *) user_io_msg->data;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	debug("task %d user managed io stream established", msg->task_id);
 	/* sanity check */
@@ -1480,7 +1484,7 @@ _task_user_managed_io_handler(struct step_launch_state *sls,
 	user_io_msg->conn_fd = -1;
 
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 }
 
 /*
@@ -1506,62 +1510,51 @@ _handle_msg(void *arg, slurm_msg_t *msg)
 	case RESPONSE_LAUNCH_TASKS:
 		debug2("received task launch");
 		_launch_handler(sls, msg);
-		slurm_free_launch_tasks_response_msg(msg->data);
 		break;
 	case MESSAGE_TASK_EXIT:
 		debug2("received task exit");
 		_exit_handler(sls, msg);
-		slurm_free_task_exit_msg(msg->data);
 		break;
 	case SRUN_PING:
 		debug3("slurmctld ping received");
 		slurm_send_rc_msg(msg, SLURM_SUCCESS);
-		slurm_free_srun_ping_msg(msg->data);
 		break;
 	case SRUN_EXEC:
 		_exec_prog(msg);
-		slurm_free_srun_exec_msg(msg->data);
 		break;
 	case SRUN_JOB_COMPLETE:
 		debug2("received job step complete message");
 		_job_complete_handler(sls, msg);
-		slurm_free_srun_job_complete_msg(msg->data);
 		break;
 	case SRUN_TIMEOUT:
 		debug2("received job step timeout message");
 		_timeout_handler(sls, msg);
-		slurm_free_srun_timeout_msg(msg->data);
 		break;
 	case SRUN_USER_MSG:
 		um = msg->data;
 		info("%s", um->msg);
-		slurm_free_srun_user_msg(msg->data);
 		break;
 	case SRUN_NODE_FAIL:
 		debug2("received srun node fail");
 		_node_fail_handler(sls, msg);
-		slurm_free_srun_node_fail_msg(msg->data);
 		break;
 	case SRUN_STEP_MISSING:
 		debug2("received notice of missing job step");
 		_step_missing_handler(sls, msg);
-		slurm_free_srun_step_missing_msg(msg->data);
 		break;
 	case SRUN_STEP_SIGNAL:
 		debug2("received step signal RPC");
 		_step_step_signal(sls, msg);
-		slurm_free_job_step_kill_msg(msg->data);
 		break;
 	case PMI_KVS_PUT_REQ:
 		debug2("PMI_KVS_PUT_REQ received");
-		rc = pmi_kvs_put((struct kvs_comm_set *) msg->data);
+		rc = pmi_kvs_put((kvs_comm_set_t *) msg->data);
 		slurm_send_rc_msg(msg, rc);
 		break;
 	case PMI_KVS_GET_REQ:
 		debug2("PMI_KVS_GET_REQ received");
 		rc = pmi_kvs_get((kvs_get_msg_t *) msg->data);
 		slurm_send_rc_msg(msg, rc);
-		slurm_free_get_kvs_msg((kvs_get_msg_t *) msg->data);
 		break;
 	case TASK_USER_MANAGED_IO_STREAM:
 		debug2("TASK_USER_MANAGED_IO_STREAM");
@@ -1597,10 +1590,10 @@ static int _fail_step_tasks(slurm_step_ctx_t *ctx, char *node, int ret_code)
 	nodeid = nodelist_find(ctx->step_resp->step_layout->node_list, node);
 #endif
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	sls->abort = true;
 	pthread_cond_broadcast(&sls->cond);
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 	memset(&msg, 0, sizeof(step_complete_msg_t));
 	msg.job_id = ctx->job_id;
@@ -1765,7 +1758,11 @@ _exec_prog(slurm_msg_t *msg)
 	bool checkpoint = false;
 	srun_exec_msg_t *exec_msg = msg->data;
 
-	if (exec_msg->argc > 2) {
+	if ((exec_msg->argc < 1) || (exec_msg->argv == NULL) ||
+	    (exec_msg->argv[0] == NULL)) {
+		error("%s: called with no command to execute", __func__);
+		return;
+	} else if (exec_msg->argc > 2) {
 		verbose("Exec '%s %s' for %u.%u",
 			exec_msg->argv[0], exec_msg->argv[1],
 			exec_msg->job_id, exec_msg->step_id);
@@ -1775,7 +1772,7 @@ _exec_prog(slurm_msg_t *msg)
 			exec_msg->job_id, exec_msg->step_id);
 	}
 
-	if (strcmp(exec_msg->argv[0], "ompi-checkpoint") == 0) {
+	if (xstrcmp(exec_msg->argv[0], "ompi-checkpoint") == 0) {
 		if (srun_ppid)
 			checkpoint = true;
 		else {
@@ -1853,7 +1850,7 @@ fini:	if (checkpoint) {
 int
 step_launch_notify_io_failure(step_launch_state_t *sls, int node_id)
 {
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	bit_set(sls->node_io_error, node_id);
 	debug("IO error on node %d", node_id);
@@ -1884,7 +1881,7 @@ step_launch_notify_io_failure(step_launch_state_t *sls, int node_id)
 		}
 	}
 
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 
 	return SLURM_SUCCESS;
 }
@@ -1901,9 +1898,9 @@ step_launch_notify_io_failure(step_launch_state_t *sls, int node_id)
 int
 step_launch_clear_questionable_state(step_launch_state_t *sls, int node_id)
 {
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 	sls->io_deadline[node_id] = (time_t)NO_VAL;
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 	return SLURM_SUCCESS;
 }
 
@@ -1936,7 +1933,7 @@ _check_io_timeout(void *_sls)
 	struct timespec ts = {0, 0};
 	step_launch_state_t *sls = (step_launch_state_t *)_sls;
 
-	pthread_mutex_lock(&sls->lock);
+	slurm_mutex_lock(&sls->lock);
 
 	while (1) {
 		if (sls->halt_io_test || sls->abort)
@@ -1974,6 +1971,6 @@ _check_io_timeout(void *_sls)
 			pthread_cond_timedwait(&sls->cond, &sls->lock, &ts);
 		}
 	}
-	pthread_mutex_unlock(&sls->lock);
+	slurm_mutex_unlock(&sls->lock);
 	return NULL;
 }
diff --git a/src/api/step_launch.h b/src/api/step_launch.h
index e2890a5f1..07ad09127 100644
--- a/src/api/step_launch.h
+++ b/src/api/step_launch.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  step_launch.h - launch a parallel job step
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2006-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/api/submit.c b/src/api/submit.c
index cb61fcb96..678d30259 100644
--- a/src/api/submit.c
+++ b/src/api/submit.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  submit.c - submit a job with supplied contraints
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/api/suspend.c b/src/api/suspend.c
index 9ddc8bea0..a8f1120e1 100644
--- a/src/api/suspend.c
+++ b/src/api/suspend.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  suspend.c - job step suspend and resume functions.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/api/update_config.c b/src/api/update_config.c
index be0f78d7a..c1793074d 100644
--- a/src/api/update_config.c
+++ b/src/api/update_config.c
@@ -1,6 +1,5 @@
 /****************************************************************************\
  *  update_config.c - request that slurmctld update its configuration
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -272,6 +271,30 @@ slurm_update_step (step_update_request_msg_t * step_msg)
 	return _slurm_update ((void *) step_msg, REQUEST_UPDATE_JOB_STEP);
 }
 
+/*
+ * Move the specified job ID to the top of the queue for a given user ID,
+ *	partition, account, and QOS.
+ * IN job_id_str - a job id
+ * RET 0 or -1 on error */
+extern int
+slurm_top_job(char *job_id_str)
+{
+	int rc = SLURM_SUCCESS;
+	top_job_msg_t top_job_req;
+	slurm_msg_t req_msg;
+
+	slurm_msg_t_init(&req_msg);
+	top_job_req.job_id_str = job_id_str;
+	req_msg.msg_type       = REQUEST_TOP_JOB;
+	req_msg.data           = &top_job_req;
+
+	if (slurm_send_recv_controller_rc_msg(&req_msg, &rc) < 0)
+		return SLURM_ERROR;
+
+	slurm_seterrno(rc);
+	return rc;
+}
+
 /* _slurm_update - issue RPC for all update requests */
 static int
 _slurm_update (void *data, slurm_msg_type_t msg_type)
diff --git a/src/bcast/Makefile.am b/src/bcast/Makefile.am
new file mode 100644
index 000000000..f1df367fe
--- /dev/null
+++ b/src/bcast/Makefile.am
@@ -0,0 +1,13 @@
+# Makefile for bcast library
+
+AUTOMAKE_OPTIONS = foreign
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+
+BCAST_LIB = libfile_bcast.la
+libfile_bcast_la_SOURCES = file_bcast.c file_bcast.h
+libfile_bcast_la_LIBADD  = $(ZLIB_LIBS) $(LZ4_LIBS)
+libfile_bcast_la_LDFLAGS = $(LIB_LDFLAGS) $(ZLIB_LDFLAGS) $(LZ4_LDFLAGS)
+libfile_bcast_la_CFLAGS  = $(ZLIB_CPPFLAGS) $(LZ4_CPPFLAGS) $(AM_CFLAGS)
+
+noinst_LTLIBRARIES = $(BCAST_LIB)
diff --git a/src/bcast/Makefile.in b/src/bcast/Makefile.in
new file mode 100644
index 000000000..8086eb15b
--- /dev/null
+++ b/src/bcast/Makefile.in
@@ -0,0 +1,786 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for bcast library
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/bcast
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libfile_bcast_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+	$(am__DEPENDENCIES_1)
+am_libfile_bcast_la_OBJECTS = libfile_bcast_la-file_bcast.lo
+libfile_bcast_la_OBJECTS = $(am_libfile_bcast_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+libfile_bcast_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(libfile_bcast_la_CFLAGS) $(CFLAGS) \
+	$(libfile_bcast_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libfile_bcast_la_SOURCES)
+DIST_SOURCES = $(libfile_bcast_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/auxdir/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+BCAST_LIB = libfile_bcast.la
+libfile_bcast_la_SOURCES = file_bcast.c file_bcast.h
+libfile_bcast_la_LIBADD = $(ZLIB_LIBS) $(LZ4_LIBS)
+libfile_bcast_la_LDFLAGS = $(LIB_LDFLAGS) $(ZLIB_LDFLAGS) $(LZ4_LDFLAGS)
+libfile_bcast_la_CFLAGS = $(ZLIB_CPPFLAGS) $(LZ4_CPPFLAGS) $(AM_CFLAGS)
+noinst_LTLIBRARIES = $(BCAST_LIB)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/bcast/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/bcast/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+libfile_bcast.la: $(libfile_bcast_la_OBJECTS) $(libfile_bcast_la_DEPENDENCIES) $(EXTRA_libfile_bcast_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(libfile_bcast_la_LINK)  $(libfile_bcast_la_OBJECTS) $(libfile_bcast_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfile_bcast_la-file_bcast.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+libfile_bcast_la-file_bcast.lo: file_bcast.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfile_bcast_la_CFLAGS) $(CFLAGS) -MT libfile_bcast_la-file_bcast.lo -MD -MP -MF $(DEPDIR)/libfile_bcast_la-file_bcast.Tpo -c -o libfile_bcast_la-file_bcast.lo `test -f 'file_bcast.c' || echo '$(srcdir)/'`file_bcast.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libfile_bcast_la-file_bcast.Tpo $(DEPDIR)/libfile_bcast_la-file_bcast.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='file_bcast.c' object='libfile_bcast_la-file_bcast.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libfile_bcast_la_CFLAGS) $(CFLAGS) -c -o libfile_bcast_la-file_bcast.lo `test -f 'file_bcast.c' || echo '$(srcdir)/'`file_bcast.c
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/bcast/file_bcast.c b/src/bcast/file_bcast.c
new file mode 100644
index 000000000..a214cea50
--- /dev/null
+++ b/src/bcast/file_bcast.c
@@ -0,0 +1,561 @@
+/*****************************************************************************\
+ *  file_bcast.c - File transfer agent (handles message traffic)
+ *****************************************************************************
+ *  Copyright (C) 2015-2016 SchedMD LLC.
+ *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
+ *  Copyright (C) 2006-2007 The Regents of the University of California.
+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
+ *  Written by Morris Jette <jette1@llnl.gov>
+ *  CODE-OCEC-09-009. All rights reserved.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <errno.h>
+#include <fcntl.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#if HAVE_LIBZ
+# include <zlib.h>
+#endif
+
+#if HAVE_LZ4
+# include <lz4.h>
+#endif
+
+#include "slurm/slurm_errno.h"
+#include "src/common/forward.h"
+#include "src/common/hostlist.h"
+#include "src/common/log.h"
+#include "src/common/macros.h"
+#include "src/common/read_config.h"
+#include "src/common/slurm_protocol_api.h"
+#include "src/common/slurm_protocol_defs.h"
+#include "src/common/slurm_protocol_interface.h"
+#include "src/common/slurm_time.h"
+#include "src/common/timers.h"
+#include "src/common/uid.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
+
+#include "file_bcast.h"
+
+#define MAX_THREADS      8	/* These can be huge messages, so
+				 * only run MAX_THREADS at one time */
+
+int block_len;				/* block size */
+int fd;					/* source file descriptor */
+void *src;				/* source mmap'd address */
+struct stat f_stat;			/* source file stats */
+job_sbcast_cred_msg_t *sbcast_cred;	/* job alloc info and sbcast cred */
+
+static int   _bcast_file(struct bcast_parameters *params);
+static int   _file_bcast(struct bcast_parameters *params,
+			 file_bcast_msg_t *bcast_msg,
+			 job_sbcast_cred_msg_t *sbcast_cred);
+static int   _file_state(struct bcast_parameters *params);
+static int  _get_job_info(struct bcast_parameters *params);
+
+
+static int _file_state(struct bcast_parameters *params)
+{
+	/* validate the source file */
+	if ((fd = open(params->src_fname, O_RDONLY)) < 0) {
+		error("Can't open `%s`: %s", params->src_fname,
+			strerror(errno));
+		return SLURM_ERROR;
+	}
+	if (fstat(fd, &f_stat)) {
+		error("Can't stat `%s`: %s", params->src_fname,
+			strerror(errno));
+		return SLURM_ERROR;
+	}
+
+	verbose("modes    = %o", (unsigned int) f_stat.st_mode);
+	verbose("uid      = %d", (int) f_stat.st_uid);
+	verbose("gid      = %d", (int) f_stat.st_gid);
+	verbose("atime    = %s", slurm_ctime2(&f_stat.st_atime));
+	verbose("mtime    = %s", slurm_ctime2(&f_stat.st_mtime));
+	verbose("ctime    = %s", slurm_ctime2(&f_stat.st_ctime));
+	verbose("size     = %ld", (long) f_stat.st_size);
+
+	if (!f_stat.st_size) {
+		error("Warning: file `%s` is empty.", params->src_fname);
+		return SLURM_SUCCESS;
+	}
+	src = mmap(NULL, f_stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
+	if (src == (void *) -1) {
+		error("Can't mmap file `%s`, %m.", params->src_fname);
+		return SLURM_ERROR;
+	}
+
+	return SLURM_SUCCESS;
+}
+
+/* get details about this slurm job: jobid and allocated node */
+static int _get_job_info(struct bcast_parameters *params)
+{
+	int rc;
+
+	xassert(params->job_id != NO_VAL);
+
+	rc = slurm_sbcast_lookup(params->job_id, params->step_id, &sbcast_cred);
+	if (rc != SLURM_SUCCESS) {
+		if (params->step_id == NO_VAL) {
+			error("Slurm job ID %u lookup error: %s",
+			      params->job_id,
+			      slurm_strerror(slurm_get_errno()));
+		} else {
+			error("Slurm step ID %u.%u lookup error: %s",
+			      params->job_id, params->step_id,
+			      slurm_strerror(slurm_get_errno()));
+		}
+		return rc;
+	}
+	if (params->step_id == NO_VAL)
+		verbose("jobid      = %u", params->job_id);
+	else
+		verbose("stepid     = %u.%u", params->job_id, params->step_id);
+	verbose("node_cnt   = %u", sbcast_cred->node_cnt);
+	verbose("node_list  = %s", sbcast_cred->node_list);
+	/* also see sbcast_cred->node_addr (array) */
+
+	if (params->verbose)
+		print_sbcast_cred(sbcast_cred->sbcast_cred);
+
+	/* do not bother to release the return message,
+	 * we need to preserve and use most of the information later */
+
+	return rc;
+}
+
+/* Issue the RPC to transfer the file's data */
+static int _file_bcast(struct bcast_parameters *params,
+		       file_bcast_msg_t *bcast_msg,
+		       job_sbcast_cred_msg_t *sbcast_cred)
+{
+	List ret_list = NULL;
+	ListIterator itr;
+	ret_data_info_t *ret_data_info = NULL;
+	int rc = 0, msg_rc;
+	slurm_msg_t msg;
+
+	slurm_msg_t_init(&msg);
+	msg.data = bcast_msg;
+	msg.msg_type = REQUEST_FILE_BCAST;
+
+	ret_list = slurm_send_recv_msgs(
+		sbcast_cred->node_list, &msg, params->timeout, true);
+	if (ret_list == NULL) {
+		error("slurm_send_recv_msgs: %m");
+		exit(1);
+	}
+
+	itr = list_iterator_create(ret_list);
+	while ((ret_data_info = list_next(itr))) {
+		msg_rc = slurm_get_return_code(ret_data_info->type,
+					       ret_data_info->data);
+		if (msg_rc == SLURM_SUCCESS)
+			continue;
+
+		error("REQUEST_FILE_BCAST(%s): %s",
+		      ret_data_info->node_name,
+		      slurm_strerror(msg_rc));
+		rc = MAX(rc, msg_rc);
+	}
+	list_iterator_destroy(itr);
+	FREE_NULL_LIST(ret_list);
+
+	return rc;
+}
+
+/* load a buffer with data from the file to broadcast,
+ * return number of bytes read, zero on end of file */
+static int _get_block_none(char **buffer, int *orig_len, bool *more)
+{
+	static int remaining = -1;
+	static void *position;
+	int size;
+
+	if (remaining < 0) {
+		*buffer = xmalloc(block_len);
+		remaining = f_stat.st_size;
+		position = src;
+	}
+
+	size = MIN(block_len, remaining);
+	memcpy(*buffer, position, size);
+	remaining -= size;
+	position += size;
+
+	*orig_len = size;
+	*more = (remaining) ? true : false;
+	return size;
+}
+
+static int _get_block_zlib(struct bcast_parameters *params,
+			   char **buffer,
+			   int *orig_len,
+			   bool *more)
+{
+#if HAVE_LIBZ
+	static z_stream strm;
+	int chunk = (256 * 1024);
+	int flush = Z_NO_FLUSH;
+
+	static int remaining = -1;
+	static int max_out;
+	static void *position;
+	int chunk_remaining, out_remaining, chunk_bite, size = 0;
+
+	/* allocate deflate state, compress each block independently */
+	strm.zalloc = Z_NULL;
+	strm.zfree = Z_NULL;
+	strm.opaque = Z_NULL;
+	strm.avail_in = 0;
+	strm.next_in = Z_NULL;
+	if (deflateInit(&strm, Z_DEFAULT_COMPRESSION) != Z_OK) {
+		error("File compression configuration error,"
+		      "sending uncompressed file.");
+		params->compress = 0;
+		return _get_block_none(buffer, orig_len, more);
+	}
+
+	/* first pass through, initialize */
+	if (remaining < 0) {
+		remaining = f_stat.st_size;
+		max_out = deflateBound(&strm, block_len);
+		*buffer = xmalloc(max_out);
+		position = src;
+	}
+
+	chunk_remaining = MIN(block_len, remaining);
+	out_remaining = max_out;
+	strm.next_out = (void *) *buffer;
+	while (chunk_remaining) {
+		strm.next_in = position;
+		chunk_bite = MIN(chunk, chunk_remaining);
+		strm.avail_in = chunk_bite;
+		strm.avail_out = out_remaining;
+
+		if (chunk_remaining <= chunk)
+			flush = Z_FINISH;
+
+		if (deflate(&strm, flush) == Z_STREAM_ERROR)
+			fatal("Error compressing file");
+
+		position += chunk_bite;
+		size += chunk_bite;
+		chunk_remaining -= chunk_bite;
+		out_remaining = strm.avail_out;
+	}
+	remaining -= size;
+
+	(void) deflateEnd(&strm);
+
+	*orig_len = size;
+	*more = (remaining) ? true : false;
+	return (max_out - out_remaining);
+#else
+	info("zlib compression not supported, sending uncompressed file.");
+	params->compress = 0;
+	return _get_block_none(buffer, orig_len, more);
+#endif
+}
+
+static int _get_block_lz4(struct bcast_parameters *params,
+			  char **buffer,
+			  int32_t *orig_len,
+			  bool *more)
+{
+#if HAVE_LZ4
+	int size_out;
+	static int remaining = -1;
+	static void *position;
+	int size;
+
+	if (!f_stat.st_size) {
+		*more = false;
+		return 0;
+	}
+
+	if (remaining < 0) {
+		position = src;
+		remaining = f_stat.st_size;
+		*buffer = xmalloc(block_len);
+	}
+
+	/* intentionally limit decompressed size to 10x compressed
+	 * to avoid problems on receive size when decompressed */
+	size = MIN(block_len * 10, remaining);
+	if (!(size_out = LZ4_compress_destSize(position, *buffer,
+					       &size, block_len))) {
+		/* compression failure */
+		fatal("LZ4 compression error");
+	}
+	position += size;
+	remaining -= size;
+
+	*orig_len = size;
+	*more = (remaining) ? true : false;
+	return size_out;
+#else
+	info("lz4 compression not supported, sending uncompressed file.");
+	params->compress = 0;
+	return _get_block_none(buffer, orig_len, more);
+#endif
+
+}
+
+static int _next_block(struct bcast_parameters *params,
+		       char **buffer,
+		       int32_t *orig_len,
+		       bool *more)
+{
+	switch(params->compress) {
+	case COMPRESS_OFF:
+		return _get_block_none(buffer, orig_len, more);
+	case COMPRESS_ZLIB:
+		return _get_block_zlib(params, buffer, orig_len, more);
+	case COMPRESS_LZ4:
+		return _get_block_lz4(params, buffer, orig_len, more);
+	}
+
+	/* compression type not recognized */
+	error("File compression type %u not supported,"
+	      " sending uncompressed file.", params->compress);
+	params->compress = 0;
+	return _get_block_none(buffer, orig_len, more);
+}
+
+/* read and broadcast the file */
+static int _bcast_file(struct bcast_parameters *params)
+{
+	int rc = SLURM_SUCCESS;
+	file_bcast_msg_t bcast_msg;
+	char *buffer = NULL;
+	int32_t orig_len;
+	uint32_t size_uncompressed = 0, size_compressed = 0;
+	uint32_t time_compression = 0;
+	bool more = true;
+	DEF_TIMERS;
+
+	if (params->block_size)
+		block_len = MIN(params->block_size, f_stat.st_size);
+	else
+		block_len = MIN((512 * 1024), f_stat.st_size);
+
+	bzero(&bcast_msg, sizeof(file_bcast_msg_t));
+	bcast_msg.fname		= params->dst_fname;
+	bcast_msg.block_no	= 1;
+	bcast_msg.force		= params->force;
+	bcast_msg.modes		= f_stat.st_mode;
+	bcast_msg.uid		= f_stat.st_uid;
+	bcast_msg.user_name	= uid_to_string(f_stat.st_uid);
+	bcast_msg.gid		= f_stat.st_gid;
+	bcast_msg.file_size	= f_stat.st_size;
+	bcast_msg.cred          = sbcast_cred->sbcast_cred;
+
+	if (params->preserve) {
+		bcast_msg.atime     = f_stat.st_atime;
+		bcast_msg.mtime     = f_stat.st_mtime;
+	}
+
+	if (!params->fanout)
+		params->fanout = MAX_THREADS;
+	slurm_set_tree_width(MIN(MAX_THREADS, params->fanout));
+
+	while (more) {
+		START_TIMER;
+		bcast_msg.block_len = _next_block(params, &buffer, &orig_len,
+						  &more);
+		END_TIMER;
+		time_compression += DELTA_TIMER;
+		size_uncompressed += orig_len;
+		size_compressed += bcast_msg.block_len;
+		debug("block %d, size %u", bcast_msg.block_no,
+		      bcast_msg.block_len);
+		bcast_msg.compress = params->compress;
+		bcast_msg.uncomp_len = orig_len;
+		bcast_msg.block = buffer;
+		if (!more)
+			bcast_msg.last_block = 1;
+
+		rc = _file_bcast(params, &bcast_msg, sbcast_cred);
+		if (rc != SLURM_SUCCESS)
+			break;
+		if (bcast_msg.last_block)
+			break;	/* end of file */
+		bcast_msg.block_no++;
+		bcast_msg.block_offset += orig_len;
+	}
+	xfree(bcast_msg.user_name);
+	xfree(buffer);
+
+	if (size_uncompressed && params->compress != 0) {
+		int64_t pct = (int64_t) size_uncompressed - size_compressed;
+		/* Dividing a negative by a positive in C99 results in
+		 * "truncation towards zero" which gives unexpected values for
+		 * pct. This construct avoids that problem.
+		 */
+		pct = (pct>=0) ? pct * 100 / size_uncompressed
+			       : - (-pct * 100 / size_uncompressed);
+		verbose("File compressed from %u to %u (%d percent) in %u usec",
+			size_uncompressed, size_compressed, (int) pct,
+			time_compression);
+	}
+
+	return rc;
+}
+
+
+static int _decompress_data_zlib(file_bcast_msg_t *req)
+{
+#if HAVE_LIBZ
+	static z_stream strm;
+	int chunk = (256 * 1024); /* must match common/file_bcast.c */
+	int ret;
+	int flush = Z_NO_FLUSH, have;
+	unsigned char zlib_out[chunk];
+	int buf_in_offset = 0;
+	int buf_out_offset = 0;
+	char *out_buf;
+
+	/* Perform decompression */
+	strm.zalloc = Z_NULL;
+	strm.zfree = Z_NULL;
+	strm.opaque = Z_NULL;
+	strm.avail_in = 0;
+	strm.next_in = Z_NULL;
+	ret = inflateInit(&strm);
+	if (ret != Z_OK)
+		return -1;
+
+	out_buf = xmalloc(req->uncomp_len);
+
+	while (req->block_len > buf_in_offset) {
+		strm.next_in = (unsigned char *) (req->block + buf_in_offset);
+		strm.avail_in = MIN(chunk, req->block_len - buf_in_offset);
+		buf_in_offset += strm.avail_in;
+		if (buf_in_offset >= req->block_len)
+			flush = Z_FINISH;
+		do {
+			strm.avail_out = chunk;
+			strm.next_out = zlib_out;
+			ret = inflate(&strm, flush);
+			switch (ret) {
+			case Z_NEED_DICT:
+				/* ret = Z_DATA_ERROR;      and fall through */
+			case Z_DATA_ERROR:
+			case Z_MEM_ERROR:
+				(void)inflateEnd(&strm);
+				xfree(out_buf);
+				return -1;
+			}
+			have = chunk - strm.avail_out;
+			memcpy(out_buf + buf_out_offset, zlib_out, have);
+			buf_out_offset += have;
+		} while (strm.avail_out == 0);
+	}
+	(void)inflateEnd(&strm);
+	xfree(req->block);
+	req->block = out_buf;
+	req->block_len = buf_out_offset;
+	return 0;
+#else
+	return -1;
+#endif
+}
+
+static int _decompress_data_lz4(file_bcast_msg_t *req)
+{
+#if HAVE_LZ4
+	char *out_buf;
+	int out_len;
+
+	if (!req->block_len)
+		return 0;
+
+	out_buf = xmalloc(req->uncomp_len);
+	out_len = LZ4_decompress_safe(req->block, out_buf, req->block_len, req->uncomp_len);
+	xfree(req->block);
+	req->block = out_buf;
+	if (req->uncomp_len != out_len) {
+		error("lz4 decompression error, original block length != decompressed length");
+		return -1;
+	}
+	req->block_len = out_len;
+	return 0;
+#else
+	return -1;
+#endif
+}
+
+extern int bcast_file(struct bcast_parameters *params)
+{
+	int rc;
+
+	if ((rc = _file_state(params)) != SLURM_SUCCESS)
+		return rc;
+	if ((rc = _get_job_info(params)) != SLURM_SUCCESS)
+		return rc;
+	if ((rc = _bcast_file(params)) != SLURM_SUCCESS)
+		return rc;
+
+/*	slurm_free_sbcast_cred_msg(sbcast_cred); */
+	return rc;
+}
+
+extern int bcast_decompress_data(file_bcast_msg_t *req)
+{
+	switch(req->compress) {
+	case COMPRESS_OFF:
+		return 0;
+	case COMPRESS_ZLIB:
+		return _decompress_data_zlib(req);
+	case COMPRESS_LZ4:
+		return _decompress_data_lz4(req);
+	}
+
+	/* compression type not recognized */
+	error("%s: compression type %u not supported.",
+	      __func__, req->compress);
+	return -1;
+}
diff --git a/src/common/file_bcast.h b/src/bcast/file_bcast.h
similarity index 79%
rename from src/common/file_bcast.h
rename to src/bcast/file_bcast.h
index 2c0bd5045..8e538cc26 100644
--- a/src/common/file_bcast.h
+++ b/src/bcast/file_bcast.h
@@ -1,7 +1,7 @@
 /****************************************************************************\
  *  file_bcast.h - definitions used for file broadcast functions
  *****************************************************************************
- *  Copyright (C) 2015 SchedMD LLC.
+ *  Copyright (C) 2015-2016 SchedMD LLC.
  *
  *  This file is part of SLURM, a resource management program.
  *  For details, see <http://slurm.schedmd.com/>.
@@ -46,18 +46,34 @@
 
 struct bcast_parameters {
 	uint32_t block_size;
-	bool compress;
+	uint16_t compress;
+	char *dst_fname;
 	int  fanout;
 	bool force;
 	uint32_t job_id;
-	uint32_t step_id;
 	bool preserve;
+	char *src_fname;
+	uint32_t step_id;
 	int  timeout;
 	int  verbose;
-	char *src_fname;
-	char *dst_fname;
 };
 
+typedef struct file_bcast_info {
+	void *data;		/* mmap of file data */
+	int fd;			/* file descriptor */
+	uint64_t file_size;	/* file size */
+	char *fname;		/* filename */
+	gid_t gid;		/* gid of owner */
+	uint32_t job_id;	/* job id */
+	time_t last_update;	/* transfer last block received */
+	int max_blocks;		/* highest block number (when known) */
+	int received_blocks;	/* number of blocks received */
+	time_t start_time;	/* transfer start time */
+	uid_t uid;		/* uid of owner */
+} file_bcast_info_t;
+
 extern int bcast_file(struct bcast_parameters *params);
 
+extern int bcast_decompress_data(file_bcast_msg_t *req);
+
 #endif
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index f378b1398..f34c6503b 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -31,9 +31,9 @@ noinst_LTLIBRARIES = 			\
 	libspank.la
 
 libcommon_la_SOURCES = 			\
-	cpu_frequency.c cpu_frequency.h \
 	assoc_mgr.c assoc_mgr.h 	\
-	file_bcast.c file_bcast.h	\
+	cpu_frequency.c cpu_frequency.h \
+	node_features.c node_features.h	\
 	xmalloc.c xmalloc.h 		\
 	xassert.c xassert.h		\
 	xstring.c xstring.h		\
@@ -67,6 +67,8 @@ libcommon_la_SOURCES = 			\
 	slurm_cred.c			\
 	slurm_errno.c			\
 	slurm_ext_sensors.c slurm_ext_sensors.h \
+	slurm_mcs.c			\
+	slurm_mcs.h			\
 	slurm_priority.c		\
 	slurm_priority.h		\
 	slurm_protocol_api.c		\
@@ -133,7 +135,8 @@ libcommon_la_SOURCES = 			\
 	mapping.c mapping.h		\
 	xcgroup_read_config.c xcgroup_read_config.h \
 	xlua.c xlua.h			\
-	callerid.c callerid.h
+	callerid.c callerid.h		\
+	siphash24.c siphash_slurm.c siphash.h
 
 EXTRA_libcommon_la_SOURCES = 		\
 	$(extra_unsetenv_src)		\
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index f0f6f5587..13bcc8744 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -104,7 +104,8 @@ noinst_PROGRAMS = libcommon.o$(EXEEXT) libeio.o$(EXEEXT) \
 	libspank.o$(EXEEXT)
 subdir = src/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -117,7 +118,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -130,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -137,6 +138,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -145,7 +147,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -157,23 +158,25 @@ CONFIG_CLEAN_VPATH_FILES =
 LTLIBRARIES = $(noinst_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libcommon_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
-am__libcommon_la_SOURCES_DIST = cpu_frequency.c cpu_frequency.h \
-	assoc_mgr.c assoc_mgr.h file_bcast.c file_bcast.h xmalloc.c \
-	xmalloc.h xassert.c xassert.h xstring.c xstring.h xsignal.c \
-	xsignal.h strnatcmp.c strnatcmp.h forward.c forward.h \
-	msg_aggr.c msg_aggr.h strlcpy.c strlcpy.h list.c list.h \
-	xtree.c xtree.h xhash.c xhash.h net.c net.h log.c log.h cbuf.c \
-	cbuf.h safeopen.c safeopen.h bitstring.c bitstring.h mpi.c \
-	slurm_mpi.h pack.c pack.h parse_config.c parse_config.h \
-	parse_value.c parse_value.h parse_spec.c parse_spec.h plugin.c \
-	plugin.h plugrack.c plugrack.h power.c power.h print_fields.c \
+am__libcommon_la_SOURCES_DIST = assoc_mgr.c assoc_mgr.h \
+	cpu_frequency.c cpu_frequency.h node_features.c \
+	node_features.h xmalloc.c xmalloc.h xassert.c xassert.h \
+	xstring.c xstring.h xsignal.c xsignal.h strnatcmp.c \
+	strnatcmp.h forward.c forward.h msg_aggr.c msg_aggr.h \
+	strlcpy.c strlcpy.h list.c list.h xtree.c xtree.h xhash.c \
+	xhash.h net.c net.h log.c log.h cbuf.c cbuf.h safeopen.c \
+	safeopen.h bitstring.c bitstring.h mpi.c slurm_mpi.h pack.c \
+	pack.h parse_config.c parse_config.h parse_value.c \
+	parse_value.h parse_spec.c parse_spec.h plugin.c plugin.h \
+	plugrack.c plugrack.h power.c power.h print_fields.c \
 	print_fields.h read_config.c read_config.h node_select.c \
 	node_select.h env.c env.h fd.c fd.h slurm_cred.h slurm_cred.c \
 	slurm_errno.c slurm_ext_sensors.c slurm_ext_sensors.h \
-	slurm_priority.c slurm_priority.h slurm_protocol_api.c \
-	slurm_protocol_api.h slurm_protocol_pack.c \
-	slurm_protocol_pack.h slurm_protocol_util.c \
-	slurm_protocol_util.h slurm_protocol_socket_implementation.c \
+	slurm_mcs.c slurm_mcs.h slurm_priority.c slurm_priority.h \
+	slurm_protocol_api.c slurm_protocol_api.h \
+	slurm_protocol_pack.c slurm_protocol_pack.h \
+	slurm_protocol_util.c slurm_protocol_util.h \
+	slurm_protocol_socket_implementation.c \
 	slurm_protocol_socket_common.h slurm_protocol_common.h \
 	slurm_protocol_interface.h slurm_protocol_defs.c \
 	slurm_protocol_defs.h slurm_rlimits_info.h \
@@ -203,23 +206,24 @@ am__libcommon_la_SOURCES_DIST = cpu_frequency.c cpu_frequency.h \
 	node_conf.c gres.h gres.c entity.h entity.c layout.h layout.c \
 	layouts_mgr.h layouts_mgr.c mapping.c mapping.h \
 	xcgroup_read_config.c xcgroup_read_config.h xlua.c xlua.h \
-	callerid.c callerid.h
+	callerid.c callerid.h siphash24.c siphash_slurm.c siphash.h
 @HAVE_UNSETENV_FALSE@am__objects_1 = unsetenv.lo
-am_libcommon_la_OBJECTS = cpu_frequency.lo assoc_mgr.lo file_bcast.lo \
-	xmalloc.lo xassert.lo xstring.lo xsignal.lo strnatcmp.lo \
-	forward.lo msg_aggr.lo strlcpy.lo list.lo xtree.lo xhash.lo \
-	net.lo log.lo cbuf.lo safeopen.lo bitstring.lo mpi.lo pack.lo \
-	parse_config.lo parse_value.lo parse_spec.lo plugin.lo \
-	plugrack.lo power.lo print_fields.lo read_config.lo \
-	node_select.lo env.lo fd.lo slurm_cred.lo slurm_errno.lo \
-	slurm_ext_sensors.lo slurm_priority.lo slurm_protocol_api.lo \
-	slurm_protocol_pack.lo slurm_protocol_util.lo \
-	slurm_protocol_socket_implementation.lo slurm_protocol_defs.lo \
-	slurm_rlimits_info.lo slurmdb_defs.lo slurmdb_pack.lo \
-	slurmdbd_defs.lo working_cluster.lo uid.lo util-net.lo \
-	slurm_auth.lo slurm_acct_gather.lo slurm_accounting_storage.lo \
-	slurm_jobacct_gather.lo slurm_acct_gather_energy.lo \
-	slurm_acct_gather_profile.lo slurm_acct_gather_infiniband.lo \
+am_libcommon_la_OBJECTS = assoc_mgr.lo cpu_frequency.lo \
+	node_features.lo xmalloc.lo xassert.lo xstring.lo xsignal.lo \
+	strnatcmp.lo forward.lo msg_aggr.lo strlcpy.lo list.lo \
+	xtree.lo xhash.lo net.lo log.lo cbuf.lo safeopen.lo \
+	bitstring.lo mpi.lo pack.lo parse_config.lo parse_value.lo \
+	parse_spec.lo plugin.lo plugrack.lo power.lo print_fields.lo \
+	read_config.lo node_select.lo env.lo fd.lo slurm_cred.lo \
+	slurm_errno.lo slurm_ext_sensors.lo slurm_mcs.lo \
+	slurm_priority.lo slurm_protocol_api.lo slurm_protocol_pack.lo \
+	slurm_protocol_util.lo slurm_protocol_socket_implementation.lo \
+	slurm_protocol_defs.lo slurm_rlimits_info.lo slurmdb_defs.lo \
+	slurmdb_pack.lo slurmdbd_defs.lo working_cluster.lo uid.lo \
+	util-net.lo slurm_auth.lo slurm_acct_gather.lo \
+	slurm_accounting_storage.lo slurm_jobacct_gather.lo \
+	slurm_acct_gather_energy.lo slurm_acct_gather_profile.lo \
+	slurm_acct_gather_infiniband.lo \
 	slurm_acct_gather_filesystem.lo slurm_jobcomp.lo \
 	slurm_route.lo slurm_time.lo slurm_topology.lo switch.lo \
 	arg_desc.lo malloc.lo getopt.lo getopt1.lo $(am__objects_1) \
@@ -229,7 +233,7 @@ am_libcommon_la_OBJECTS = cpu_frequency.lo assoc_mgr.lo file_bcast.lo \
 	stepd_api.lo write_labelled_message.lo proc_args.lo \
 	slurm_strcasestr.lo node_conf.lo gres.lo entity.lo layout.lo \
 	layouts_mgr.lo mapping.lo xcgroup_read_config.lo xlua.lo \
-	callerid.lo
+	callerid.lo siphash24.lo siphash_slurm.lo
 am__EXTRA_libcommon_la_SOURCES_DIST = unsetenv.c unsetenv.h \
 	uthash/LICENSE uthash/README uthash/uthash.h
 libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS)
@@ -332,8 +336,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -434,6 +436,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -472,6 +478,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -515,6 +524,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -565,6 +577,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -590,9 +603,9 @@ noinst_LTLIBRARIES = \
 	libspank.la
 
 libcommon_la_SOURCES = \
-	cpu_frequency.c cpu_frequency.h \
 	assoc_mgr.c assoc_mgr.h 	\
-	file_bcast.c file_bcast.h	\
+	cpu_frequency.c cpu_frequency.h \
+	node_features.c node_features.h	\
 	xmalloc.c xmalloc.h 		\
 	xassert.c xassert.h		\
 	xstring.c xstring.h		\
@@ -626,6 +639,8 @@ libcommon_la_SOURCES = \
 	slurm_cred.c			\
 	slurm_errno.c			\
 	slurm_ext_sensors.c slurm_ext_sensors.h \
+	slurm_mcs.c			\
+	slurm_mcs.h			\
 	slurm_priority.c		\
 	slurm_priority.h		\
 	slurm_protocol_api.c		\
@@ -692,7 +707,8 @@ libcommon_la_SOURCES = \
 	mapping.c mapping.h		\
 	xcgroup_read_config.c xcgroup_read_config.h \
 	xlua.c xlua.h			\
-	callerid.c callerid.h
+	callerid.c callerid.h		\
+	siphash24.c siphash_slurm.c siphash.h
 
 EXTRA_libcommon_la_SOURCES = \
 	$(extra_unsetenv_src)		\
@@ -810,7 +826,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entity.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/env.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_bcast.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Plo@am__quote@
@@ -830,6 +845,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_aggr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_conf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_features.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_select.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/optz.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pack.Plo@am__quote@
@@ -845,6 +861,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc_args.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_config.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/safeopen.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siphash24.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siphash_slurm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_accounting_storage.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_acct_gather.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_acct_gather_energy.Plo@am__quote@
@@ -857,6 +875,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_ext_sensors.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_jobacct_gather.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_jobcomp.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_mcs.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_priority.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_protocol_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurm_protocol_defs.Plo@am__quote@
diff --git a/src/common/arg_desc.c b/src/common/arg_desc.c
index 50da98a69..05f0a9b3a 100644
--- a/src/common/arg_desc.c
+++ b/src/common/arg_desc.c
@@ -38,6 +38,7 @@
 #include "src/common/arg_desc.h"
 #include "src/common/macros.h"
 #include "src/common/xassert.h"
+#include "src/common/xstring.h"
 
 /*
  * Define slurm-specific aliases for use by plugins, see slurm_xlator.h
@@ -70,7 +71,7 @@ arg_idx_by_name( const arg_desc_t *desc, const char *name )
 	if ( name == NULL ) return -1;
 
 	for ( i = 0; desc[ i ].name != NULL; ++i ) {
-		if ( strcmp( desc[ i ].name, name ) == 0 ) {
+		if ( xstrcmp( desc[ i ].name, name ) == 0 ) {
 			return i;
 		}
 	}
diff --git a/src/common/assoc_mgr.c b/src/common/assoc_mgr.c
index 8c2994715..16fd1298f 100644
--- a/src/common/assoc_mgr.c
+++ b/src/common/assoc_mgr.c
@@ -221,7 +221,7 @@ static slurmdb_assoc_rec_t *_find_assoc_rec(
 			/* This means the uid isn't set in one of the
 			 * associations, so use the name instead
 			 */
-			if (strcasecmp(assoc->user, assoc_ptr->user)) {
+			if (xstrcasecmp(assoc->user, assoc_ptr->user)) {
 				debug3("%s: 2 not the right user %u != %u",
 				       __func__, assoc->uid, assoc_ptr->uid);
 				goto next;
@@ -234,7 +234,7 @@ static slurmdb_assoc_rec_t *_find_assoc_rec(
 
 		if (assoc->acct &&
 		    (!assoc_ptr->acct
-		     || strcasecmp(assoc->acct, assoc_ptr->acct))) {
+		     || xstrcasecmp(assoc->acct, assoc_ptr->acct))) {
 			debug3("%s: not the right account %s != %s",
 			       __func__, assoc->acct, assoc_ptr->acct);
 			goto next;
@@ -243,15 +243,15 @@ static slurmdb_assoc_rec_t *_find_assoc_rec(
 		/* only check for on the slurmdbd */
 		if (!assoc_mgr_cluster_name && assoc->cluster
 		    && (!assoc_ptr->cluster
-			|| strcasecmp(assoc->cluster, assoc_ptr->cluster))) {
+			|| xstrcasecmp(assoc->cluster, assoc_ptr->cluster))) {
 			debug3("%s: not the right cluster", __func__);
 			goto next;
 		}
 
 		if (assoc->partition
 		    && (!assoc_ptr->partition
-			|| strcasecmp(assoc->partition,
-				      assoc_ptr->partition))) {
+			|| xstrcasecmp(assoc->partition,
+				       assoc_ptr->partition))) {
 			debug3("%s: not the right partition", __func__);
 			goto next;
 		}
@@ -416,21 +416,20 @@ static int _clear_used_assoc_info(slurmdb_assoc_rec_t *assoc)
 	return SLURM_SUCCESS;
 }
 
-static void _clear_qos_user_limit_info(slurmdb_qos_rec_t *qos_ptr)
+static void _clear_qos_used_limit_list(List used_limit_list, uint32_t tres_cnt)
 {
 	slurmdb_used_limits_t *used_limits = NULL;
 	ListIterator itr = NULL;
 	int i;
 
-	if (!qos_ptr->usage->user_limit_list
-	    || !list_count(qos_ptr->usage->user_limit_list))
+	if (!used_limit_list || !list_count(used_limit_list))
 		return;
 
-	itr = list_iterator_create(qos_ptr->usage->user_limit_list);
+	itr = list_iterator_create(used_limit_list);
 	while ((used_limits = list_next(itr))) {
 		used_limits->jobs = 0;
 		used_limits->submit_jobs = 0;
-		for (i=0; i<qos_ptr->usage->tres_cnt; i++) {
+		for (i=0; i<tres_cnt; i++) {
 			used_limits->tres[i] = 0;
 			used_limits->tres_run_mins[i] = 0;
 		}
@@ -440,6 +439,20 @@ static void _clear_qos_user_limit_info(slurmdb_qos_rec_t *qos_ptr)
 	return;
 }
 
+
+
+static void _clear_qos_acct_limit_info(slurmdb_qos_rec_t *qos_ptr)
+{
+	_clear_qos_used_limit_list(qos_ptr->usage->acct_limit_list,
+				   qos_ptr->usage->tres_cnt);
+}
+
+static void _clear_qos_user_limit_info(slurmdb_qos_rec_t *qos_ptr)
+{
+	_clear_qos_used_limit_list(qos_ptr->usage->user_limit_list,
+				   qos_ptr->usage->tres_cnt);
+}
+
 static int _clear_used_qos_info(slurmdb_qos_rec_t *qos)
 {
 	int i;
@@ -458,6 +471,7 @@ static int _clear_used_qos_info(slurmdb_qos_rec_t *qos)
 	 * else where since sometimes we call this and do not want
 	 * shares reset */
 
+	_clear_qos_acct_limit_info(qos);
 	_clear_qos_user_limit_info(qos);
 
 	return SLURM_SUCCESS;
@@ -487,7 +501,7 @@ static int _change_user_name(slurmdb_user_rec_t *user)
 		while ((assoc = list_next(itr))) {
 			if (!assoc->user)
 				continue;
-			if (!strcmp(user->old_name, assoc->user)) {
+			if (!xstrcmp(user->old_name, assoc->user)) {
 				/* Since the uid changed the
 				   hash as well will change.  Remove
 				   the assoc from the hash before the
@@ -508,7 +522,7 @@ static int _change_user_name(slurmdb_user_rec_t *user)
 	if (assoc_mgr_wckey_list) {
 		itr = list_iterator_create(assoc_mgr_wckey_list);
 		while ((wckey = list_next(itr))) {
-			if (!strcmp(user->old_name, wckey->user)) {
+			if (!xstrcmp(user->old_name, wckey->user)) {
 				xfree(wckey->user);
 				wckey->user = xstrdup(user->name);
 				wckey->uid = user->uid;
@@ -576,7 +590,7 @@ static int _local_update_assoc_qos_list(slurmdb_assoc_rec_t *assoc,
 	while ((new_qos = list_next(new_qos_itr))) {
 		if (new_qos[0] == '-') {
 			while ((curr_qos = list_next(curr_qos_itr))) {
-				if (!strcmp(curr_qos, new_qos+1)) {
+				if (!xstrcmp(curr_qos, new_qos+1)) {
 					list_delete_item(curr_qos_itr);
 					break;
 				}
@@ -585,7 +599,7 @@ static int _local_update_assoc_qos_list(slurmdb_assoc_rec_t *assoc,
 			list_iterator_reset(curr_qos_itr);
 		} else if (new_qos[0] == '+') {
 			while ((curr_qos = list_next(curr_qos_itr)))
-				if (!strcmp(curr_qos, new_qos+1))
+				if (!xstrcmp(curr_qos, new_qos+1))
 					break;
 
 			if (!curr_qos) {
@@ -627,7 +641,7 @@ static void _set_user_default_acct(slurmdb_assoc_rec_t *assoc)
 			if (user->uid != assoc->uid)
 				continue;
 			if (!user->default_acct
-			    || strcmp(user->default_acct, assoc->acct)) {
+			    || xstrcmp(user->default_acct, assoc->acct)) {
 				xfree(user->default_acct);
 				user->default_acct = xstrdup(assoc->acct);
 				debug2("user %s default acct is %s",
@@ -655,7 +669,7 @@ static void _set_user_default_wckey(slurmdb_wckey_rec_t *wckey)
 			if (user->uid != wckey->uid)
 				continue;
 			if (!user->default_wckey
-			    || strcmp(user->default_wckey, wckey->name)) {
+			    || xstrcmp(user->default_wckey, wckey->name)) {
 				xfree(user->default_wckey);
 				user->default_wckey = xstrdup(wckey->name);
 				debug2("user %s default wckey is %s",
@@ -933,7 +947,7 @@ static int _post_assoc_list(void)
 	}
 	list_iterator_destroy(itr);
 
-	slurmdb_sort_hierarchical_assoc_list(assoc_mgr_assoc_list);
+	slurmdb_sort_hierarchical_assoc_list(assoc_mgr_assoc_list, true);
 
 	//END_TIMER2("load_associations");
 	return SLURM_SUCCESS;
@@ -1044,7 +1058,7 @@ static int _post_res_list(List res_list)
 					/* only update the local clusters
 					 * res, only one per res
 					 * record, so throw the others away. */
-					if (!strcasecmp(object->clus_res_rec->
+					if (!xstrcasecmp(object->clus_res_rec->
 							cluster,
 							assoc_mgr_cluster_name))
 						break;
@@ -1901,7 +1915,7 @@ extern int assoc_mgr_init(void *db_conn, assoc_init_args_t *args,
 
 	if (!checked_prio) {
 		char *prio = slurm_get_priority_type();
-		if (prio && strcmp(prio, "priority/basic"))
+		if (prio && xstrcmp(prio, "priority/basic"))
 			setup_children = 1;
 
 		xfree(prio);
@@ -2216,11 +2230,10 @@ extern int assoc_mgr_fill_in_tres(void *db_conn,
 			if (tres->id == found_tres->id)
 				break;
 		} else if ((tres->type
-			    && !strcasecmp(tres->type, found_tres->type))
+			    && !xstrcasecmp(tres->type, found_tres->type))
 			   && ((!tres->name && !found_tres->name)
 			       || ((tres->name && found_tres->name) &&
-				   !strcasecmp(tres->name,
-					       found_tres->name))))
+				   !xstrcasecmp(tres->name, found_tres->name))))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -2492,7 +2505,7 @@ extern int assoc_mgr_fill_in_user(void *db_conn, slurmdb_user_rec_t *user,
 			if (user->uid == found_user->uid)
 				break;
 		} else if (user->name
-			   && !strcasecmp(user->name, found_user->name))
+			   && !xstrcasecmp(user->name, found_user->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -2576,7 +2589,7 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, slurmdb_qos_rec_t *qos,
 	while ((found_qos = list_next(itr))) {
 		if (qos->id == found_qos->id)
 			break;
-		else if (qos->name && !strcasecmp(qos->name, found_qos->name))
+		else if (qos->name && !xstrcasecmp(qos->name, found_qos->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -2612,15 +2625,21 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, slurmdb_qos_rec_t *qos,
 
 	if (!qos->max_tres_mins_pj)
 		qos->max_tres_mins_pj = found_qos->max_tres_mins_pj;
+	if (!qos->max_tres_run_mins_pa)
+		qos->max_tres_run_mins_pa = found_qos->max_tres_run_mins_pa;
 	if (!qos->max_tres_run_mins_pu)
 		qos->max_tres_run_mins_pu = found_qos->max_tres_run_mins_pu;
+	if (!qos->max_tres_pa)
+		qos->max_tres_pa     = found_qos->max_tres_pa;
 	if (!qos->max_tres_pj)
 		qos->max_tres_pj     = found_qos->max_tres_pj;
 	if (!qos->max_tres_pn)
 		qos->max_tres_pn     = found_qos->max_tres_pn;
 	if (!qos->max_tres_pu)
 		qos->max_tres_pu     = found_qos->max_tres_pu;
+	qos->max_jobs_pa     = found_qos->max_jobs_pa;
 	qos->max_jobs_pu     = found_qos->max_jobs_pu;
+	qos->max_submit_jobs_pa = found_qos->max_submit_jobs_pa;
 	qos->max_submit_jobs_pu = found_qos->max_submit_jobs_pu;
 	qos->max_wall_pj     = found_qos->max_wall_pj;
 
@@ -2643,6 +2662,9 @@ extern int assoc_mgr_fill_in_qos(void *db_conn, slurmdb_qos_rec_t *qos,
 	   is really in existance here, if they really want it they can
 	   use the pointer that is returned. */
 
+	/* if (!qos->usage->acct_limit_list) */
+	/* 	qos->usage->acct_limit_list = found_qos->usage->acct_limit_list; */
+
 	/* qos->usage->grp_used_tres   = found_qos->usage->grp_used_tres; */
 	/* qos->usage->grp_used_tres_run_mins  = */
 	/* 	found_qos->usage->grp_used_tres_run_mins; */
@@ -2768,14 +2790,14 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, slurmdb_wckey_rec_t *wckey,
 					       wckey->uid, found_wckey->uid);
 					continue;
 				}
-			} else if (wckey->user && strcasecmp(wckey->user,
-							     found_wckey->user))
+			} else if (wckey->user &&
+				   xstrcasecmp(wckey->user, found_wckey->user))
 				continue;
 
 			if (wckey->name
 			    && (!found_wckey->name
-				|| strcasecmp(wckey->name,
-					      found_wckey->name))) {
+				|| xstrcasecmp(wckey->name,
+					       found_wckey->name))) {
 				debug4("not the right name %s != %s",
 				       wckey->name, found_wckey->name);
 				continue;
@@ -2791,8 +2813,8 @@ extern int assoc_mgr_fill_in_wckey(void *db_conn, slurmdb_wckey_rec_t *wckey,
 				}
 
 				if (found_wckey->cluster
-				    && strcasecmp(wckey->cluster,
-						  found_wckey->cluster)) {
+				    && xstrcasecmp(wckey->cluster,
+						   found_wckey->cluster)) {
 					debug4("not the right cluster");
 					continue;
 				}
@@ -2901,7 +2923,7 @@ extern bool assoc_mgr_is_user_acct_coord(void *db_conn,
 	}
 	itr = list_iterator_create(found_user->coord_accts);
 	while ((acct = list_next(itr))) {
-		if (!strcmp(acct_name, acct->name))
+		if (!xstrcmp(acct_name, acct->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -2984,7 +3006,7 @@ extern void assoc_mgr_get_shares(void *db_conn,
 	while ((assoc = list_next(itr))) {
 		if (user_itr && assoc->user) {
 			while ((tmp_char = list_next(user_itr))) {
-				if (!strcasecmp(tmp_char, assoc->user))
+				if (!xstrcasecmp(tmp_char, assoc->user))
 					break;
 			}
 			list_iterator_reset(user_itr);
@@ -2995,7 +3017,7 @@ extern void assoc_mgr_get_shares(void *db_conn,
 
 		if (acct_itr) {
 			while ((tmp_char = list_next(acct_itr))) {
-				if (!strcasecmp(tmp_char, assoc->acct))
+				if (!xstrcasecmp(tmp_char, assoc->acct))
 					break;
 			}
 			list_iterator_reset(acct_itr);
@@ -3010,7 +3032,7 @@ extern void assoc_mgr_get_shares(void *db_conn,
 				slurmdb_coord_rec_t *coord = NULL;
 
 				if (assoc->user &&
-				    !strcmp(assoc->user, user.name))
+				    !xstrcmp(assoc->user, user.name))
 					goto is_user;
 
 				if (!user.coord_accts) {
@@ -3026,8 +3048,8 @@ extern void assoc_mgr_get_shares(void *db_conn,
 
 				itr = list_iterator_create(user.coord_accts);
 				while ((coord = list_next(itr))) {
-					if (!strcasecmp(coord->name,
-							assoc->acct))
+					if (!xstrcasecmp(coord->name,
+							 assoc->acct))
 						break;
 				}
 				list_iterator_destroy(itr);
@@ -3214,7 +3236,7 @@ extern void assoc_mgr_info_get_pack_msg(
 				slurmdb_coord_rec_t *coord = NULL;
 
 				if (assoc_rec->user &&
-				    !strcmp(assoc_rec->user, user.name))
+				    !xstrcmp(assoc_rec->user, user.name))
 					goto is_user;
 
 				if (!user.coord_accts) {
@@ -3230,8 +3252,8 @@ extern void assoc_mgr_info_get_pack_msg(
 
 				itr = list_iterator_create(user.coord_accts);
 				while ((coord = list_next(itr))) {
-					if (!strcasecmp(coord->name,
-							assoc_rec->acct))
+					if (!xstrcasecmp(coord->name,
+							 assoc_rec->acct))
 						break;
 				}
 				list_iterator_destroy(itr);
@@ -3500,8 +3522,8 @@ extern int assoc_mgr_update_assocs(slurmdb_update_object_t *update, bool locked)
 		bool update_jobs = false;
 		if (object->cluster && assoc_mgr_cluster_name) {
 			/* only update the local clusters assocs */
-			if (strcasecmp(object->cluster,
-				       assoc_mgr_cluster_name)) {
+			if (xstrcasecmp(object->cluster,
+					assoc_mgr_cluster_name)) {
 				slurmdb_destroy_assoc_rec(object);
 				continue;
 			}
@@ -3812,7 +3834,7 @@ extern int assoc_mgr_update_assocs(slurmdb_update_object_t *update, bool locked)
 		int reset = 1;
 		g_user_assoc_count = 0;
 		slurmdb_sort_hierarchical_assoc_list(
-			assoc_mgr_assoc_list);
+			assoc_mgr_assoc_list, true);
 
 		itr = list_iterator_create(assoc_mgr_assoc_list);
 		/* flush the children lists */
@@ -3898,7 +3920,7 @@ extern int assoc_mgr_update_assocs(slurmdb_update_object_t *update, bool locked)
 		list_iterator_destroy(itr);
 	} else if (resort)
 		slurmdb_sort_hierarchical_assoc_list(
-			assoc_mgr_assoc_list);
+			assoc_mgr_assoc_list, true);
 
 	if (!locked)
 		assoc_mgr_unlock(&locks);
@@ -3949,8 +3971,8 @@ extern int assoc_mgr_update_wckeys(slurmdb_update_object_t *update, bool locked)
 	while ((object = list_pop(update->objects))) {
 		if (object->cluster && assoc_mgr_cluster_name) {
 			/* only update the local clusters assocs */
-			if (strcasecmp(object->cluster,
-				       assoc_mgr_cluster_name)) {
+			if (xstrcasecmp(object->cluster,
+					assoc_mgr_cluster_name)) {
 				slurmdb_destroy_wckey_rec(object);
 				continue;
 			}
@@ -3975,8 +3997,8 @@ extern int assoc_mgr_update_wckeys(slurmdb_update_object_t *update, bool locked)
 
 				if (object->name
 				    && (!rec->name
-					|| strcasecmp(object->name,
-						      rec->name))) {
+					|| xstrcasecmp(object->name,
+						       rec->name))) {
 					debug4("not the right wckey");
 					continue;
 				}
@@ -3984,8 +4006,8 @@ extern int assoc_mgr_update_wckeys(slurmdb_update_object_t *update, bool locked)
 				/* only check for on the slurmdbd */
 				if (!assoc_mgr_cluster_name && object->cluster
 				    && (!rec->cluster
-					|| strcasecmp(object->cluster,
-						      rec->cluster))) {
+					|| xstrcasecmp(object->cluster,
+						       rec->cluster))) {
 					debug4("not the right cluster");
 					continue;
 				}
@@ -4078,7 +4100,7 @@ extern int assoc_mgr_update_users(slurmdb_update_object_t *update, bool locked)
 				name = object->old_name;
 			else
 				name = object->name;
-			if (!strcasecmp(name, rec->name))
+			if (!xstrcasecmp(name, rec->name))
 				break;
 		}
 
@@ -4314,6 +4336,18 @@ extern int assoc_mgr_update_qos(slurmdb_update_object_t *update, bool locked)
 				rec->grp_wall = object->grp_wall;
 			}
 
+			if (object->max_tres_pa) {
+				update_jobs = true;
+				xfree(rec->max_tres_pa);
+				if (object->max_tres_pa[0]) {
+					rec->max_tres_pa = object->max_tres_pa;
+					object->max_tres_pa = NULL;
+				}
+				assoc_mgr_set_tres_cnt_array(
+					&rec->max_tres_pa_ctld,
+					rec->max_tres_pa, INFINITE64, 1);
+			}
+
 			if (object->max_tres_pj) {
 				update_jobs = true;
 				xfree(rec->max_tres_pj);
@@ -4362,6 +4396,19 @@ extern int assoc_mgr_update_qos(slurmdb_update_object_t *update, bool locked)
 					rec->max_tres_mins_pj, INFINITE64, 1);
 			}
 
+			if (object->max_tres_run_mins_pa) {
+				xfree(rec->max_tres_run_mins_pa);
+				if (object->max_tres_run_mins_pa[0]) {
+					rec->max_tres_run_mins_pa =
+						object->max_tres_run_mins_pa;
+					object->max_tres_run_mins_pa = NULL;
+				}
+				assoc_mgr_set_tres_cnt_array(
+					&rec->max_tres_run_mins_pa_ctld,
+					rec->max_tres_run_mins_pa,
+					INFINITE64, 1);
+			}
+
 			if (object->max_tres_run_mins_pu) {
 				xfree(rec->max_tres_run_mins_pu);
 				if (object->max_tres_run_mins_pu[0]) {
@@ -4375,11 +4422,20 @@ extern int assoc_mgr_update_qos(slurmdb_update_object_t *update, bool locked)
 					INFINITE64, 1);
 			}
 
+			if (object->max_jobs_pa != NO_VAL)
+				rec->max_jobs_pa = object->max_jobs_pa;
+
 			if (object->max_jobs_pu != NO_VAL)
 				rec->max_jobs_pu = object->max_jobs_pu;
+
+			if (object->max_submit_jobs_pa != NO_VAL)
+				rec->max_submit_jobs_pa =
+					object->max_submit_jobs_pa;
+
 			if (object->max_submit_jobs_pu != NO_VAL)
 				rec->max_submit_jobs_pu =
 					object->max_submit_jobs_pu;
+
 			if (object->max_wall_pj != NO_VAL) {
 				update_jobs = true;
 				rec->max_wall_pj = object->max_wall_pj;
@@ -4591,8 +4647,8 @@ extern int assoc_mgr_update_res(slurmdb_update_object_t *update, bool locked)
 				error("Resource doesn't have a cluster name?");
 				slurmdb_destroy_res_rec(object);
 				continue;
-			} else if (strcmp(object->clus_res_rec->cluster,
-					  assoc_mgr_cluster_name)) {
+			} else if (xstrcmp(object->clus_res_rec->cluster,
+					   assoc_mgr_cluster_name)) {
 				debug("Not for our cluster for '%s'",
 				      object->clus_res_rec->cluster);
 				slurmdb_destroy_res_rec(object);
@@ -5348,7 +5404,7 @@ extern int load_assoc_usage(char *state_save_location)
 		uint32_t tmp32;
 		long double usage_tres_raw[g_tres_count];
 
-		if (ver == SLURM_15_08_PROTOCOL_VERSION) {
+		if (ver >= SLURM_15_08_PROTOCOL_VERSION) {
 			safe_unpack32(&assoc_id, buffer);
 			safe_unpacklongdouble(&usage_raw, buffer);
 			safe_unpackstr_xmalloc(&tmp_str, &tmp32, buffer);
@@ -5990,6 +6046,8 @@ extern void assoc_mgr_set_qos_tres_cnt(slurmdb_qos_rec_t *qos)
 				     qos->grp_tres_mins, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->grp_tres_run_mins_ctld,
 				     qos->grp_tres_run_mins, INFINITE64, 1);
+	assoc_mgr_set_tres_cnt_array(&qos->max_tres_pa_ctld,
+				     qos->max_tres_pa, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->max_tres_pj_ctld,
 				     qos->max_tres_pj, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->max_tres_pn_ctld,
@@ -5998,6 +6056,8 @@ extern void assoc_mgr_set_qos_tres_cnt(slurmdb_qos_rec_t *qos)
 				     qos->max_tres_pu, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->max_tres_mins_pj_ctld,
 				     qos->max_tres_mins_pj, INFINITE64, 1);
+	assoc_mgr_set_tres_cnt_array(&qos->max_tres_run_mins_pa_ctld,
+				     qos->max_tres_run_mins_pa, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->max_tres_run_mins_pu_ctld,
 				     qos->max_tres_run_mins_pu, INFINITE64, 1);
 	assoc_mgr_set_tres_cnt_array(&qos->min_tres_pj_ctld,
@@ -6025,11 +6085,27 @@ extern char *assoc_mgr_make_tres_str_from_array(
 			xstrfmtcat(tres_str, "%s%u=%"PRIu64,
 				   tres_str ? "," : "",
 				   assoc_mgr_tres_array[i]->id, tres_cnt[i]);
-		else
-			xstrfmtcat(tres_str, "%s%s=%"PRIu64,
-				   tres_str ? "," : "",
-				   assoc_mgr_tres_name_array[i], tres_cnt[i]);
-
+		else {
+			if ((flags & TRES_STR_CONVERT_UNITS) &&
+			    ((assoc_mgr_tres_array[i]->id == TRES_MEM) ||
+			     (assoc_mgr_tres_array[i]->type &&
+			      !xstrcasecmp(
+				      assoc_mgr_tres_array[i]->type, "bb")))) {
+				char outbuf[32];
+				convert_num_unit((double)tres_cnt[i], outbuf,
+						 sizeof(outbuf), UNIT_MEGA,
+						 NO_VAL,
+						 CONVERT_NUM_UNIT_EXACT);
+				xstrfmtcat(tres_str, "%s%s=%s",
+					   tres_str ? "," : "",
+					   assoc_mgr_tres_name_array[i],
+					   outbuf);
+			} else
+				xstrfmtcat(tres_str, "%s%s=%"PRIu64,
+					   tres_str ? "," : "",
+					   assoc_mgr_tres_name_array[i],
+					   tres_cnt[i]);
+		}
 	}
 
 	if (!locked)
diff --git a/src/common/bitstring.c b/src/common/bitstring.c
index ed4b78f71..4834f707a 100644
--- a/src/common/bitstring.c
+++ b/src/common/bitstring.c
@@ -1246,7 +1246,7 @@ int bit_unfmt_hexmask(bitstr_t * bitmap, const char* str)
 	bitoff_t bitsize = bit_size(bitmap);
 
 	bit_nclear(bitmap, 0, bitsize - 1);
-	if (strncmp(str, "0x", 2) == 0) {	/* Bypass 0x */
+	if (xstrncmp(str, "0x", 2) == 0) {	/* Bypass 0x */
 		str += 2;
 		len -= 2;
 	}
diff --git a/src/common/callerid.c b/src/common/callerid.c
index c3408e442..e18531c6f 100644
--- a/src/common/callerid.c
+++ b/src/common/callerid.c
@@ -58,6 +58,14 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#endif
+
+/*
+ * FIXME: In in6.h, s6_addr32 def is guarded by #ifdef _KERNEL
+ * Is there a portable interface that could be used instead of accessing
+ * structure members directly?
+ */
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 #define s6_addr32 __u6_addr.__u6_addr32
 #endif
 
@@ -245,7 +253,7 @@ static int _find_inode_in_fddir(pid_t pid, ino_t inode)
 		if (!result)
 			break;
 		/* Ignore . and .. */
-		if (strncmp(entryp->d_name, ".", 1)==0)
+		if (xstrncmp(entryp->d_name, ".", 1)==0)
 			continue;
 
 		/* This is a symlink. Follow it to get destination's inode. */
@@ -393,7 +401,7 @@ extern int callerid_get_own_netinfo (callerid_conn_t *conn)
 			break;
 
 		/* Ignore . and .. */
-		if (strncmp(entryp->d_name, ".", 1)==0)
+		if (xstrncmp(entryp->d_name, ".", 1)==0)
 			continue;
 
 		snprintf(fdpath, 1024, "%s/%s", dirpath, entryp->d_name);
diff --git a/src/common/cbuf.c b/src/common/cbuf.c
index df00baf94..d6b148656 100644
--- a/src/common/cbuf.c
+++ b/src/common/cbuf.c
@@ -1,7 +1,5 @@
 /*****************************************************************************
- *  $Id$
- *****************************************************************************
- *  $LSDId: cbuf.c,v 1.35 2005/01/13 00:41:17 dun Exp $
+ *  cbuf.c
  *****************************************************************************
  *  Copyright (C) 2002-2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -166,14 +164,6 @@ static int cbuf_is_valid (cbuf_t cb);
  *  Macros  *
  ************/
 
-#ifndef MAX
-#  define MAX(x,y) (((x) >= (y)) ? (x) : (y))
-#endif /* !MAX */
-
-#ifndef MIN
-#  define MIN(x,y) (((x) <= (y)) ? (x) : (y))
-#endif /* !MIN */
-
 #ifdef WITH_PTHREADS
 
 #  define cbuf_mutex_init(cb)                                                 \
diff --git a/src/common/cbuf.h b/src/common/cbuf.h
index bd7cd1843..d86d143ee 100644
--- a/src/common/cbuf.h
+++ b/src/common/cbuf.h
@@ -1,7 +1,5 @@
 /*****************************************************************************
- *  $Id$
- *****************************************************************************
- *  $LSDId: cbuf.h,v 1.22 2005/01/19 22:35:57 dun Exp $
+ *  cbuf.h
  *****************************************************************************
  *  Copyright (C) 2002-2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/checkpoint.c b/src/common/checkpoint.c
index 2cff488ef..b031d659e 100644
--- a/src/common/checkpoint.c
+++ b/src/common/checkpoint.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  checkpoint.c - implementation-independent checkpoint functions
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/common/checkpoint.h b/src/common/checkpoint.h
index 36df1a457..0cb477eba 100644
--- a/src/common/checkpoint.h
+++ b/src/common/checkpoint.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  checkpoint.h - implementation-independent checkpoint API definitions.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/common/cpu_frequency.c b/src/common/cpu_frequency.c
index 8ff335b8b..a7024b9c2 100644
--- a/src/common/cpu_frequency.c
+++ b/src/common/cpu_frequency.c
@@ -4,6 +4,8 @@
  *  Copyright (C) 2012 Bull
  *  Written by Don Albert, <don.albert@bull.com>
  *  Modified by Rod Schultz, <rod.schultz@bull.com> for min-max:gov
+ *  Modified by Janne Blomqvist, <janne.blomqvist@aalto.fi> for
+ *  intel_pstate support
  *
  *  This file is part of SLURM, a resource management program.
  *  For details, see <http://slurm.schedmd.com/>.
@@ -44,7 +46,7 @@
 #include <ctype.h>
 #include <errno.h>
 #include <fcntl.h>
-#include <limits.h>
+#include <limits.h>     /* for PATH_MAX */
 #include <stdlib.h>
 
 #include "slurm/slurm.h"
@@ -61,7 +63,6 @@
 
 #define PATH_TO_CPU	"/sys/devices/system/cpu/"
 #define LINE_LEN	100
-#define SYSFS_PATH_MAX	255
 #define FREQ_LIST_MAX	32
 #define GOV_NAME_LEN	24
 
@@ -118,14 +119,12 @@ static int _fd_lock_retry(int fd)
  * reset CPU frequency if it was the last job to set the CPU frequency.
  * with gang scheduling and cancellation of suspended or running jobs there
  * can be timing issues.
- * _set_cpu_owner_lock  - set specified job to own the CPU, this CPU file is
- *	locked on exit
- * _test_cpu_owner_lock - test if the specified job owns the CPU, this CPU is
- *	locked on return with true
+ * _set_cpu_owner_lock  - set specified job to own the CPU, file locked at exit
+ * _test_cpu_owner_lock - test if the specified job owns the CPU
  */
 static int _set_cpu_owner_lock(int cpu_id, uint32_t job_id)
 {
-	char tmp[64];
+	char tmp[PATH_MAX];
 	int fd, sz;
 
 	snprintf(tmp, sizeof(tmp), "%s/cpu", slurmd_spooldir);
@@ -148,9 +147,11 @@ static int _set_cpu_owner_lock(int cpu_id, uint32_t job_id)
 	return fd;
 }
 
+/* Test if specified job ID owns this CPU for frequency/governor control
+ * RET 0 if owner, -1 otherwise */
 static int _test_cpu_owner_lock(int cpu_id, uint32_t job_id)
 {
-	char tmp[64];
+	char tmp[PATH_MAX];
 	uint32_t in_job_id;
 	int fd, sz;
 
@@ -174,9 +175,11 @@ static int _test_cpu_owner_lock(int cpu_id, uint32_t job_id)
 	sz = sizeof(uint32_t);
 	if (fd_read_n(fd, (void *) &in_job_id, sz) != sz) {
 		error("%s: read: %m %s", __func__, tmp);
+		(void) fd_release_lock(fd);
 		close(fd);
 		return -1;
 	}
+	(void) fd_release_lock(fd);
 	if (job_id != in_job_id) {
 		/* Result of various race conditions */
 		debug("%s: CPU %d now owned by job %u rather than job %u",
@@ -184,10 +187,11 @@ static int _test_cpu_owner_lock(int cpu_id, uint32_t job_id)
 		close(fd);
 		return -1;
 	}
+	close(fd);
 	debug("%s: CPU %d owned by job %u as expected",
 	      __func__, cpu_id, job_id);
 
-	return fd;
+	return 0;
 }
 
 /*
@@ -200,7 +204,7 @@ static int
 _cpu_freq_cpu_avail(int cpuidx)
 {
 	FILE *fp = NULL;
-	char path[SYSFS_PATH_MAX];
+	char path[PATH_MAX];
 	int i, j, k;
 	uint32_t freq;
 	bool all_avail = false;
@@ -208,11 +212,9 @@ _cpu_freq_cpu_avail(int cpuidx)
 	snprintf(path, sizeof(path),  PATH_TO_CPU
 		 "cpu%u/cpufreq/scaling_available_frequencies", cpuidx);
 	if ( ( fp = fopen(path, "r") ) == NULL ) {
-		static bool open_err_log = true;	/* Log once */
-		if (open_err_log) {
-			error("%s: Could not open %s", __func__, path);
-			open_err_log = false;
-		}
+		/* Don't log an error here,
+		 * scaling_available_frequencies does not exist when
+		 * using the intel_pstate driver.  */
 		return SLURM_FAILURE;
 	}
 	for (i = 0; i < (FREQ_LIST_MAX-1); i++) {
@@ -246,7 +248,7 @@ _cpu_freq_cpu_avail(int cpuidx)
 extern void
 cpu_freq_init(slurmd_conf_t *conf)
 {
-	char path[SYSFS_PATH_MAX];
+	char path[PATH_MAX];
 	struct stat statbuf;
 	FILE *fp;
 	char value[LINE_LEN];
@@ -629,7 +631,7 @@ static int
 _cpu_freq_get_cur_gov(int cpuidx)
 {
 	FILE *fp = NULL;
-	char path[SYSFS_PATH_MAX], gov_value[LINE_LEN];
+	char path[PATH_MAX], gov_value[LINE_LEN];
 	int j;
 
 	snprintf(path, sizeof(path),
@@ -662,7 +664,7 @@ _cpu_freq_get_cur_gov(int cpuidx)
 static int
 _cpu_freq_set_gov(stepd_step_rec_t *job, int cpuidx, char* gov )
 {
-	char path[SYSFS_PATH_MAX];
+	char path[PATH_MAX];
 	FILE *fp;
 	int fd, rc;
 
@@ -678,7 +680,10 @@ _cpu_freq_set_gov(stepd_step_rec_t *job, int cpuidx, char* gov )
 		error("%s: Can not set CPU governor: %m", __func__);
 		rc = SLURM_FAILURE;
 	}
-	(void) close(fd);
+	if (fd >= 0) {
+		(void) fd_release_lock(fd);
+		(void) close(fd);
+	}
 	return rc;
 }
 
@@ -691,7 +696,7 @@ static uint32_t
 _cpu_freq_get_scaling_freq(int cpuidx, char* option)
 {
 	FILE *fp = NULL;
-	char path[SYSFS_PATH_MAX];
+	char path[PATH_MAX];
 	uint32_t freq;
 	/* get the value from 'option' */
 	snprintf(path, sizeof(path), PATH_TO_CPU
@@ -718,7 +723,7 @@ static int
 _cpu_freq_set_scaling_freq(stepd_step_rec_t *job, int cpx, uint32_t freq,
 		char* option)
 {
-	char path[SYSFS_PATH_MAX];
+	char path[PATH_MAX];
 	FILE *fp;
 	int fd, rc;
 	uint32_t newfreq;
@@ -734,7 +739,10 @@ _cpu_freq_set_scaling_freq(stepd_step_rec_t *job, int cpx, uint32_t freq,
 		error("%s: Can not set %s: %m", __func__, option);
 		rc = SLURM_FAILURE;
 	}
-	(void) close(fd);
+	if (fd >= 0) {
+		(void) fd_release_lock(fd);
+		(void) close(fd);
+	}
 	if (debug_flags & DEBUG_FLAG_CPU_FREQ) {
 		newfreq = _cpu_freq_get_scaling_freq(cpx, option);
 		if (newfreq != freq) {
@@ -761,9 +769,12 @@ _cpu_freq_current_state(int cpuidx)
 	 * than the 'cpuinfo' values.
 	 * The 'cpuinfo' values are read only. min/max seem to be raw
 	 * hardware capability.
-	 * The 'scaling' values are set by the governor
+	 * The 'scaling' values are set by the governor.
+	 * For the current frequency, use the cpuinfo_cur_freq file
+	 * since the intel_pstate driver doesn't necessarily create
+	 * the scaling_cur_freq file.
 	 */
-	freq = _cpu_freq_get_scaling_freq(cpuidx, "scaling_cur_freq");
+	freq = _cpu_freq_get_scaling_freq(cpuidx, "cpuinfo_cur_freq");
 	if (freq == 0)
 		return SLURM_FAILURE;
 	cpufreq[cpuidx].org_frequency = freq;
@@ -898,13 +909,18 @@ _cpu_freq_setup_data(stepd_step_rec_t *job, int cpx)
 	if (   (job->cpu_freq_min == NO_VAL || job->cpu_freq_min==0)
 	    && (job->cpu_freq_max == NO_VAL || job->cpu_freq_max==0)
 	    && (job->cpu_freq_gov == NO_VAL || job->cpu_freq_gov==0)) {
-		return; /* No --cpu-freq */
+		/* If no --cpu-freq, use default governor from conf file.  */
+		slurm_ctl_conf_t *conf = slurm_conf_lock();
+		job->cpu_freq_gov = conf->cpu_freq_def;
+		slurm_conf_unlock();
+		if (job->cpu_freq_gov == NO_VAL)
+			return;
 	}
 
 	/* Get current state */
 	if (_cpu_freq_current_state(cpx) == SLURM_FAILURE)
 		return;
-	
+
 	if (job->cpu_freq_min == NO_VAL &&
 	    job->cpu_freq_max != NO_VAL &&
 	    job->cpu_freq_gov == NO_VAL) {
@@ -1020,6 +1036,7 @@ cpu_freq_set(stepd_step_rec_t *job)
 
 	if ((!cpu_freq_count) || (!cpufreq))
 		return;
+
 	for (i = 0; i < cpu_freq_count; i++) {
 		if (cpufreq[i].new_frequency == NO_VAL
 		    && cpufreq[i].new_min_freq == NO_VAL
@@ -1091,7 +1108,7 @@ cpu_freq_set(stepd_step_rec_t *job)
 				continue;
 		}
 		if (cpufreq[i].new_frequency != NO_VAL) {
-			if (strcmp(cpufreq[i].org_governor,"userspace")) {
+			if (xstrcmp(cpufreq[i].org_governor,"userspace")) {
 				rc = _cpu_freq_set_gov(job, i, "userspace");
 				if (rc == SLURM_FAILURE)
 					continue;
@@ -1228,7 +1245,7 @@ cpu_freq_to_string(char *buf, int buf_size, uint32_t cpu_freq)
 			buf[0] = '\0';
 	} else
 		convert_num_unit2((double)cpu_freq, buf, buf_size,
-				  UNIT_KILO, 1000, 0);
+				  UNIT_KILO, NO_VAL, 1000, 0);
 }
 
 /*
@@ -1377,14 +1394,8 @@ cpu_freq_verify_def(const char *arg, uint32_t *freq)
 		*freq = cpufreq;
 		return 0;
 	}
-	cpufreq = _cpu_freq_check_freq(arg);
-	if (cpufreq == 0) {
-		error("cpu_freq_verify_def: CpuFreqDef=%s invalid", arg);
-		return -1;
-	}
-	debug3("cpu_freq_verify_def: %s set", arg);
-	*freq = cpufreq;
-	return 0;
+	error("%s: CpuFreqDef=%s invalid", __func__, arg);
+	return -1;
 }
 
 /*
diff --git a/src/common/daemonize.c b/src/common/daemonize.c
index e0ab826a5..b84a839be 100644
--- a/src/common/daemonize.c
+++ b/src/common/daemonize.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  daemonize.c - daemonization routine
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/daemonize.h b/src/common/daemonize.h
index 3e55f7634..d4f336320 100644
--- a/src/common/daemonize.h
+++ b/src/common/daemonize.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
- * src/slurmd/daemonize.h - function definition for making a daemon
- * $Id$
+ * daemonize.h - daemonization routine
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/eio.c b/src/common/eio.c
index 7a9b73089..93ec62ef0 100644
--- a/src/common/eio.c
+++ b/src/common/eio.c
@@ -208,18 +208,17 @@ int eio_message_socket_accept(eio_obj_t *obj, List objs)
 	slurm_msg_t_init(msg);
 again:
 	if (slurm_receive_msg(fd, msg, obj->ops->timeout) != 0) {
-		if (errno == EINTR) {
+		if (errno == EINTR)
 			goto again;
-		}
 		error("slurm_receive_msg[%u.%u.%u.%u]: %m",
-		      uc[0],uc[1],uc[2],uc[3]);
+		      uc[0], uc[1], uc[2], uc[3]);
 		goto cleanup;
 	}
 
-	(*obj->ops->handle_msg)(obj->arg, msg); /* handle_msg should free
-					      * msg->data */
+	(*obj->ops->handle_msg)(obj->arg, msg);
+
 cleanup:
-	if ((msg->conn_fd >= 0) && slurm_close(msg->conn_fd) < 0)
+	if ((msg->conn_fd >= 0) && (slurm_close(msg->conn_fd) < 0))
 		error ("close(%d): %m", msg->conn_fd);
 	slurm_free_msg(msg);
 
diff --git a/src/common/env.c b/src/common/env.c
index ffd34a3f3..c7da115e9 100644
--- a/src/common/env.c
+++ b/src/common/env.c
@@ -222,9 +222,9 @@ _extend_env(char ***envp)
  *	srun's --get-user-env option */
 static bool _discard_env(char *name, char *value)
 {
-	if ((strcmp(name, "DISPLAY")     == 0) ||
-	    (strcmp(name, "ENVIRONMENT") == 0) ||
-	    (strcmp(name, "HOSTNAME")    == 0))
+	if ((xstrcmp(name, "DISPLAY")     == 0) ||
+	    (xstrcmp(name, "ENVIRONMENT") == 0) ||
+	    (xstrcmp(name, "HOSTNAME")    == 0))
 		return true;
 
 	return false;
@@ -1690,7 +1690,7 @@ void env_array_merge_slurm(char ***dest_array, const char **src_array)
 	for (ptr = (char **)src_array; *ptr != NULL; ptr++) {
 		if (_env_array_entry_splitter(*ptr, name, sizeof(name),
 					      value, ENV_BUFSIZE) &&
-		    (strncmp(name, "SLURM", 5) == 0))
+		    (xstrncmp(name, "SLURM", 5) == 0))
 			env_array_overwrite(dest_array, name, value);
 	}
 	xfree(value);
@@ -1713,7 +1713,7 @@ void env_array_merge_spank(char ***dest_array, const char **src_array)
 	for (ptr = (char **)src_array; *ptr != NULL; ptr++) {
 		if (_env_array_entry_splitter(*ptr, name, sizeof(name),
 					      value, ENV_BUFSIZE)) {
-			if (strncmp(name, "SPANK_" ,6))
+			if (xstrncmp(name, "SPANK_" ,6))
 				env_array_overwrite(dest_array, name, value);
 			else
 				env_array_overwrite(dest_array, name+6, value);
@@ -1835,7 +1835,7 @@ char **env_array_from_file(const char *fname)
 			 * that this new value does not get overwritten
 			 * in the subsequent call to env_array_merge().
 			 */
-			if (strcmp(name, "SLURM_SUBMIT_DIR") == 0)
+			if (xstrcmp(name, "SLURM_SUBMIT_DIR") == 0)
 				unsetenv(name);
 			env_array_overwrite(&env, name, value);
 		}
@@ -1914,7 +1914,8 @@ static char **_load_env_cache(const char *username)
  *    Depending upon the user's login scripts, this may take a very
  *    long time to complete or possibly never return
  * 2. Load the user environment from a cache file. This is used
- *    in the event that option 1 times out.
+ *    in the event that option 1 times out.  This only happens if no_cache isn't
+ *    set.  If it is set then NULL will be returned if the normal load fails.
  *
  * timeout value is in seconds or zero for default (2 secs)
  * mode is 1 for short ("su <user>"), 2 for long ("su - <user>")
@@ -1923,7 +1924,8 @@ static char **_load_env_cache(const char *username)
  * NOTE: The calling process must have an effective uid of root for
  * this function to succeed.
  */
-char **env_array_user_default(const char *username, int timeout, int mode)
+char **env_array_user_default(const char *username, int timeout, int mode,
+			      bool no_cache)
 {
 	char *line = NULL, *last = NULL, name[MAXPATHLEN], *value, *buffer;
 	char **env = NULL;
@@ -1946,8 +1948,9 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	snprintf(stepd_path, sizeof(stepd_path), "%s/sbin/slurmstepd",
 		 SLURM_PREFIX);
 	config_timeout = slurm_get_env_timeout();
+
 	if (config_timeout == 0)	/* just read directly from cache */
-		 return _load_env_cache(username);
+		return _load_env_cache(username);
 
 	if (stat(SUCMD, &buf))
 		fatal("Could not locate command: "SUCMD);
@@ -2080,7 +2083,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	if (!found) {
 		error("Failed to load current user environment variables");
 		xfree(buffer);
-		return _load_env_cache(username);
+		return no_cache ? _load_env_cache(username) : NULL;
 	}
 
 	/* First look for the start token in the output */
@@ -2088,7 +2091,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	found = 0;
 	line = strtok_r(buffer, "\n", &last);
 	while (!found && line) {
-		if (!strncmp(line, starttoken, len)) {
+		if (!xstrncmp(line, starttoken, len)) {
 			found = 1;
 			break;
 		}
@@ -2097,7 +2100,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	if (!found) {
 		error("Failed to get current user environment variables");
 		xfree(buffer);
-		return _load_env_cache(username);
+		return no_cache ? _load_env_cache(username) : NULL;
 	}
 
 	/* Process environment variables until we find the stop token */
@@ -2107,7 +2110,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	line = strtok_r(NULL, "\n", &last);
 	value = xmalloc(ENV_BUFSIZE);
 	while (!found && line) {
-		if (!strncmp(line, stoptoken, len)) {
+		if (!xstrncmp(line, stoptoken, len)) {
 			found = 1;
 			break;
 		}
@@ -2137,7 +2140,7 @@ char **env_array_user_default(const char *username, int timeout, int mode)
 	if (!found) {
 		error("Failed to get all user environment variables");
 		env_array_free(env);
-		return _load_env_cache(username);
+		return no_cache ? _load_env_cache(username) : NULL;
 	}
 
 	return env;
diff --git a/src/common/env.h b/src/common/env.h
index 642f38e70..7f428e5ec 100644
--- a/src/common/env.h
+++ b/src/common/env.h
@@ -293,7 +293,8 @@ char **env_array_from_file(const char *filename);
  *    Depending upon the user's login scripts, this may take a very
  *    long time to complete or possibly never return
  * 2. Load the user environment from a cache file. This is used
- *    in the event that option 1 times out.
+ *    in the event that option 1 times out.  This only happens if no_cache isn't
+ *    set.  If it is set then NULL will be returned if the normal load fails.
  *
  * timeout value is in seconds or zero for default (8 secs)
  * mode is 1 for short ("su <user>"), 2 for long ("su - <user>")
@@ -302,7 +303,8 @@ char **env_array_from_file(const char *filename);
  * NOTE: The calling process must have an effective uid of root for
  * this function to succeed.
  */
-char **env_array_user_default(const char *username, int timeout, int mode);
+char **env_array_user_default(const char *username, int timeout, int mode,
+			      bool no_cache);
 
 /*
  * The cpus-per-node representation in SLURM (and perhaps tasks-per-node
diff --git a/src/common/fd.h b/src/common/fd.h
index 2a1dcc234..37c7c6511 100644
--- a/src/common/fd.h
+++ b/src/common/fd.h
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  $Id$
+ *  fd.h - common file descriptor functions
  *****************************************************************************
  *  Copyright (C) 2001-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -44,6 +44,8 @@
 #  include "config.h"
 #endif /* HAVE_CONFIG_H */
 
+#include <fcntl.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>
 
diff --git a/src/common/file_bcast.c b/src/common/file_bcast.c
deleted file mode 100644
index f928ff30b..000000000
--- a/src/common/file_bcast.c
+++ /dev/null
@@ -1,412 +0,0 @@
-/*****************************************************************************\
- *  file_bcast.c - File transfer agent (handles message traffic)
- *****************************************************************************
- *  Copyright (C) 2015 SchedMD LLC.
- *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
- *  Copyright (C) 2006-2007 The Regents of the University of California.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Morris Jette <jette1@llnl.gov>
- *  CODE-OCEC-09-009. All rights reserved.
- *
- *  This file is part of SLURM, a resource management program.
- *  For details, see <http://slurm.schedmd.com/>.
- *  Please also read the included file: DISCLAIMER.
- *
- *  SLURM is free software; you can redistribute it and/or modify it under
- *  the terms of the GNU General Public License as published by the Free
- *  Software Foundation; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  In addition, as a special exception, the copyright holders give permission
- *  to link the code of portions of this program with the OpenSSL library under
- *  certain conditions as described in each individual source file, and
- *  distribute linked combinations including the two. You must obey the GNU
- *  General Public License in all respects for all of the code used other than
- *  OpenSSL. If you modify file(s) with this exception, you may extend this
- *  exception to your version of the file(s), but you are not obligated to do
- *  so. If you do not wish to do so, delete this exception statement from your
- *  version.  If you delete this exception statement from all source files in
- *  the program, then also delete it here.
- *
- *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
- *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- *  details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with SLURM; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
-
-#if HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "slurm/slurm_errno.h"
-#include "src/common/file_bcast.h"
-#include "src/common/forward.h"
-#include "src/common/hostlist.h"
-#include "src/common/log.h"
-#include "src/common/macros.h"
-#include "src/common/read_config.h"
-#include "src/common/slurm_protocol_api.h"
-#include "src/common/slurm_protocol_defs.h"
-#include "src/common/slurm_protocol_interface.h"
-#include "src/common/slurm_time.h"
-#include "src/common/uid.h"
-#include "src/common/xmalloc.h"
-#include "src/common/xstring.h"
-
-#define MAX_RETRIES     10
-#define MAX_THREADS      8	/* These can be huge messages, so
-				 * only run MAX_THREADS at one time */
-typedef struct thd {
-	pthread_t thread;	/* thread ID */
-	slurm_msg_t msg;	/* message to send */
-	int rc;			/* highest return codes from RPC */
-	char *nodelist;
-} thd_t;
-
-static pthread_mutex_t agent_cnt_mutex = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t  agent_cnt_cond  = PTHREAD_COND_INITIALIZER;
-static int agent_cnt = 0;
-static int msg_timeout = 0;
-
-static int fd;				/* source file descriptor */
-static struct stat f_stat;		/* source file stats */
-job_sbcast_cred_msg_t *sbcast_cred;	/* job alloc info and sbcast cred */
-
-static void *_agent_thread(void *args);
-static int   _bcast_file(struct bcast_parameters *params);
-static int   _file_bcast(struct bcast_parameters *params,
-			 file_bcast_msg_t *bcast_msg,
-			 job_sbcast_cred_msg_t *sbcast_cred);
-static int   _file_state(struct bcast_parameters *params);
-static ssize_t _get_block(struct bcast_parameters *params,
-			  char *buffer, size_t buf_size);
-static int  _get_job_info(struct bcast_parameters *params);
-
-
-static int _file_state(struct bcast_parameters *params)
-{
-	/* validate the source file */
-	if ((fd = open(params->src_fname, O_RDONLY)) < 0) {
-		error("Can't open `%s`: %s", params->src_fname,
-			strerror(errno));
-		return SLURM_ERROR;
-	}
-	if (fstat(fd, &f_stat)) {
-		error("Can't stat `%s`: %s", params->src_fname,
-			strerror(errno));
-		return SLURM_ERROR;
-	}
-	verbose("modes    = %o", (unsigned int) f_stat.st_mode);
-	verbose("uid      = %d", (int) f_stat.st_uid);
-	verbose("gid      = %d", (int) f_stat.st_gid);
-	verbose("atime    = %s", slurm_ctime2(&f_stat.st_atime));
-	verbose("mtime    = %s", slurm_ctime2(&f_stat.st_mtime));
-	verbose("ctime    = %s", slurm_ctime2(&f_stat.st_ctime));
-	verbose("size     = %ld", (long) f_stat.st_size);
-
-	return SLURM_SUCCESS;
-}
-
-/* get details about this slurm job: jobid and allocated node */
-static int _get_job_info(struct bcast_parameters *params)
-{
-	int rc;
-
-	xassert(params->job_id != NO_VAL);
-
-	rc = slurm_sbcast_lookup(params->job_id, params->step_id, &sbcast_cred);
-	if (rc != SLURM_SUCCESS) {
-		if (params->step_id == NO_VAL) {
-			error("Slurm job ID %u lookup error: %s",
-			      params->job_id,
-			      slurm_strerror(slurm_get_errno()));
-		} else {
-			error("Slurm step ID %u.%u lookup error: %s",
-			      params->job_id, params->step_id,
-			      slurm_strerror(slurm_get_errno()));
-		}
-		return rc;
-	}
-	if (params->step_id == NO_VAL)
-		verbose("jobid      = %u", params->job_id);
-	else
-		verbose("stepid     = %u.%u", params->job_id, params->step_id);
-	verbose("node_cnt   = %u", sbcast_cred->node_cnt);
-	verbose("node_list  = %s", sbcast_cred->node_list);
-	/* also see sbcast_cred->node_addr (array) */
-
-	if (params->verbose)
-		print_sbcast_cred(sbcast_cred->sbcast_cred);
-
-	/* do not bother to release the return message,
-	 * we need to preserve and use most of the information later */
-
-	return rc;
-}
-
-
-static void *_agent_thread(void *args)
-{
-	List ret_list = NULL;
-	thd_t *thread_ptr = (thd_t *) args;
-	ListIterator itr;
-	ret_data_info_t *ret_data_info = NULL;
-	int rc = 0, msg_rc;
-
-	ret_list = slurm_send_recv_msgs(thread_ptr->nodelist,
-					&thread_ptr->msg,
-					msg_timeout, false);
-	if (ret_list == NULL) {
-		error("slurm_send_recv_msgs: %m");
-		exit(1);
-	}
-
-	itr = list_iterator_create(ret_list);
-	while ((ret_data_info = list_next(itr))) {
-		msg_rc = slurm_get_return_code(ret_data_info->type,
-					       ret_data_info->data);
-		if (msg_rc == SLURM_SUCCESS)
-			continue;
-
-		error("REQUEST_FILE_BCAST(%s): %s",
-		      ret_data_info->node_name,
-		      slurm_strerror(msg_rc));
-		rc = MAX(rc, msg_rc);
-	}
-
-	thread_ptr->rc = rc;
-	list_iterator_destroy(itr);
-	FREE_NULL_LIST(ret_list);
-	slurm_mutex_lock(&agent_cnt_mutex);
-	agent_cnt--;
-	pthread_cond_broadcast(&agent_cnt_cond);
-	slurm_mutex_unlock(&agent_cnt_mutex);
-	return NULL;
-}
-
-/* Issue the RPC to transfer the file's data */
-static int _file_bcast(struct bcast_parameters *params,
-		       file_bcast_msg_t *bcast_msg,
-		       job_sbcast_cred_msg_t *sbcast_cred)
-{
-	/* Preserve some data structures across calls for better performance */
-	static int threads_used = 0;
-	static thd_t thread_info[MAX_THREADS];
-
-	int i, fanout, rc = SLURM_SUCCESS;
-	int retries = 0;
-	pthread_attr_t attr;
-
-	if (threads_used == 0) {
-		hostlist_t hl;
-		hostlist_t new_hl;
-		int *span = NULL;
-		char *name = NULL;
-
-		if (params->fanout)
-			fanout = MIN(MAX_THREADS, params->fanout);
-		else
-			fanout = MAX_THREADS;
-		msg_timeout = params->timeout;
-
-		span = set_span(sbcast_cred->node_cnt, fanout);
-
-		hl = hostlist_create(sbcast_cred->node_list);
-
-		i = 0;
-		while (i < sbcast_cred->node_cnt) {
-			int j = 0;
-			name = hostlist_shift(hl);
-			if (!name) {
-				debug3("no more nodes to send to");
-				break;
-			}
-			new_hl = hostlist_create(name);
-			free(name);
-			i++;
-			for (j = 0; j < span[threads_used]; j++) {
-				name = hostlist_shift(hl);
-				if (!name)
-					break;
-				hostlist_push_host(new_hl, name);
-				free(name);
-				i++;
-			}
-			thread_info[threads_used].nodelist =
-				hostlist_ranged_string_xmalloc(new_hl);
-			hostlist_destroy(new_hl);
-			slurm_msg_t_init(&thread_info[threads_used].msg);
-			thread_info[threads_used].msg.msg_type =
-				REQUEST_FILE_BCAST;
-			threads_used++;
-		}
-		xfree(span);
-		hostlist_destroy(hl);
-		debug("using %d threads", threads_used);
-	}
-
-	slurm_attr_init(&attr);
-	if (pthread_attr_setstacksize(&attr, 3 * 1024 * 1024))
-		error("pthread_attr_setstacksize: %m");
-	if (pthread_attr_setdetachstate (&attr,
-			PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
-
-	for (i = 0; i < threads_used; i++) {
-		thread_info[i].msg.data = bcast_msg;
-		slurm_mutex_lock(&agent_cnt_mutex);
-		agent_cnt++;
-		slurm_mutex_unlock(&agent_cnt_mutex);
-
-		while (pthread_create(&thread_info[i].thread,
-				      &attr, _agent_thread,
-				      (void *) &thread_info[i])) {
-			error("pthread_create error %m");
-			if (++retries > MAX_RETRIES)
-				fatal("Can't create pthread");
-			sleep(1);	/* sleep and retry */
-		}
-	}
-
-	/* wait until pthreads complete */
-	slurm_mutex_lock(&agent_cnt_mutex);
-	while (agent_cnt)
-		pthread_cond_wait(&agent_cnt_cond, &agent_cnt_mutex);
-	slurm_mutex_unlock(&agent_cnt_mutex);
-	pthread_attr_destroy(&attr);
-
-	for (i = 0; i < threads_used; i++)
-		 rc = MAX(rc, thread_info[i].rc);
-
-	return rc;
-}
-
-/* load a buffer with data from the file to broadcast,
- * return number of bytes read, zero on end of file */
-static ssize_t _get_block(struct bcast_parameters *params,
-			  char *buffer, size_t buf_size)
-{
-	static int fd = 0;
-	ssize_t buf_used = 0, rc;
-
-	if (!fd) {
-		fd = open(params->src_fname, O_RDONLY);
-		if (!fd) {
-			error("Can't open `%s`: %s",
-			      params->src_fname, strerror(errno));
-			return SLURM_ERROR;
-		}
-	}
-
-	while (buf_size) {
-		rc = read(fd, buffer, buf_size);
-		if (rc == -1) {
-			if ((errno == EINTR) || (errno == EAGAIN))
-				continue;
-			error("Can't read `%s`: %s",
-			      params->src_fname, strerror(errno));
-			return SLURM_ERROR;
-		} else if (rc == 0) {
-			debug("end of file reached");
-			break;
-		}
-
-		buffer   += rc;
-		buf_size -= rc;
-		buf_used += rc;
-	}
-	return buf_used;
-}
-
-/* read and broadcast the file */
-static int _bcast_file(struct bcast_parameters *params)
-{
-	int buf_size, rc = SLURM_SUCCESS;
-	ssize_t size_read = 0;
-	file_bcast_msg_t bcast_msg;
-	char *buffer;
-	int32_t block_len;
-
-	if (params->block_size)
-		buf_size = MIN(params->block_size, f_stat.st_size);
-	else
-		buf_size = MIN((512 * 1024), f_stat.st_size);
-
-	bcast_msg.fname		= params->dst_fname;
-	bcast_msg.block_no	= 1;
-	bcast_msg.last_block	= 0;
-	bcast_msg.force		= params->force;
-	bcast_msg.modes		= f_stat.st_mode;
-	bcast_msg.uid		= f_stat.st_uid;
-	bcast_msg.user_name	= uid_to_string(f_stat.st_uid);
-	bcast_msg.gid		= f_stat.st_gid;
-	buffer			= xmalloc(buf_size);
-	bcast_msg.block		= buffer;
-	bcast_msg.block_len	= 0;
-	bcast_msg.cred          = sbcast_cred->sbcast_cred;
-
-	if (params->preserve) {
-		bcast_msg.atime     = f_stat.st_atime;
-		bcast_msg.mtime     = f_stat.st_mtime;
-	} else {
-		bcast_msg.atime     = 0;
-		bcast_msg.mtime     = 0;
-	}
-
-	if (!params->fanout)
-		params->fanout = MAX_THREADS;
-	slurm_set_tree_width(MIN(MAX_THREADS, params->fanout));
-
-	while (1) {
-		block_len = _get_block(params, buffer, buf_size);
-		if (block_len < 0)
-			rc = SLURM_ERROR;
-		if (block_len <= 0)
-			break;
-		bcast_msg.block_len = block_len;
-		debug("block %d, size %u", bcast_msg.block_no,
-		      bcast_msg.block_len);
-		size_read += bcast_msg.block_len;
-		if (size_read >= f_stat.st_size)
-			bcast_msg.last_block = 1;
-
-		rc = _file_bcast(params, &bcast_msg, sbcast_cred);
-		if (rc != SLURM_SUCCESS)
-			break;
-		if (bcast_msg.last_block)
-			break;	/* end of file */
-		bcast_msg.block_no++;
-	}
-	xfree(bcast_msg.user_name);
-	xfree(buffer);
-
-	return rc;
-}
-
-extern int bcast_file(struct bcast_parameters *params)
-{
-	int rc;
-
-	if ((rc = _file_state(params)) != SLURM_SUCCESS)
-		return rc;
-	if ((rc = _get_job_info(params)) != SLURM_SUCCESS)
-		return rc;
-	if ((rc = _bcast_file(params)) != SLURM_SUCCESS)
-		return rc;
-
-/*	slurm_free_sbcast_cred_msg(sbcast_cred); */
-	return rc;
-}
diff --git a/src/common/forward.c b/src/common/forward.c
index 49a6a062f..80000d47e 100644
--- a/src/common/forward.c
+++ b/src/common/forward.c
@@ -242,8 +242,11 @@ void *_forward_thread(void *arg)
 			if (message_timeout < 0)
 				message_timeout =
 					slurm_get_msg_timeout() * 1000;
+			if (!fwd_msg->header.forward.tree_width)
+				fwd_msg->header.forward.tree_width =
+					slurm_get_tree_width();
 			steps = (fwd_msg->header.forward.cnt+1) /
-				slurm_get_tree_width();
+					fwd_msg->header.forward.tree_width;
 			fwd_msg->timeout = (message_timeout*steps);
 			/* info("got %d * %d = %d", message_timeout, */
 			/*      steps, fwd_msg->timeout); */
@@ -298,7 +301,7 @@ void *_forward_thread(void *arg)
 						ret_data_info->node_name =
 							xstrdup(name);
 					}
-					if (!strcmp(tmp,
+					if (!xstrcmp(tmp,
 						   ret_data_info->node_name)) {
 						node_found = 1;
 						break;
@@ -415,8 +418,8 @@ void *_fwd_tree_thread(void *arg)
 						list_iterator_create(ret_list);
 					while ((ret_data_info =
 						list_next(itr))) {
-						if (strcmp(ret_data_info->
-							   node_name, name))
+						if (xstrcmp(ret_data_info->
+							    node_name, name))
 							hostlist_delete_host(
 								fwd_tree->
 								tree_hl,
@@ -617,14 +620,9 @@ static void _forward_msg_internal(hostlist_t hl, hostlist_t* sp_hl,
 extern void forward_init(forward_t *forward, forward_t *from)
 {
 	if (from && from->init == FORWARD_INIT) {
-		forward->cnt = from->cnt;
-		forward->timeout = from->timeout;
-		forward->nodelist = from->nodelist;
-		forward->init = from->init;
+		memcpy(forward, from, sizeof(forward_t));
 	} else {
-		forward->cnt = 0;
-		forward->timeout = 0;
-		forward->nodelist = NULL;
+		memset(forward, 0, sizeof(forward_t));
 		forward->init = FORWARD_INIT;
 	}
 }
@@ -654,7 +652,8 @@ extern int forward_msg(forward_struct_t *forward_struct, header_t *header)
 	hl = hostlist_create(header->forward.nodelist);
 	hostlist_uniq(hl);
 
-	if ( route_g_split_hostlist(hl, &sp_hl, &hl_count) ) {
+	if (route_g_split_hostlist(
+		    hl, &sp_hl, &hl_count, header->forward.tree_width)) {
 		error("unable to split forward hostlist");
 		hostlist_destroy(hl);
 		return SLURM_ERROR;
@@ -698,7 +697,8 @@ extern List start_msg_tree(hostlist_t hl, slurm_msg_t *msg, int timeout)
 	hostlist_uniq(hl);
 	host_count = hostlist_count(hl);
 
-	if ( route_g_split_hostlist(hl, &sp_hl, &hl_count) ) {
+	if (route_g_split_hostlist(hl, &sp_hl, &hl_count,
+				   msg->forward.tree_width)) {
 		error("unable to split forward hostlist");
 		return NULL;
 	}
diff --git a/src/common/forward.h b/src/common/forward.h
index 115e43e89..b24e5d207 100644
--- a/src/common/forward.h
+++ b/src/common/forward.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  forward.h - get/print the job state information of slurm
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/getopt.c b/src/common/getopt.c
index 6cc56cd38..183f58eb4 100644
--- a/src/common/getopt.c
+++ b/src/common/getopt.c
@@ -580,7 +580,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 	 then exchange with previous non-options as if it were an option,
 	 then skip everything else like a non-option.  */
 
-      if (optind != argc && !strcmp (argv[optind], "--"))
+      if (optind != argc && !xstrcmp (argv[optind], "--"))
 	{
 	  optind++;
 
@@ -656,7 +656,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
       /* Test all long options for either exact match
 	 or abbreviated matches.  */
       for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	if (!strncmp (p->name, nextchar, nameend - nextchar))
+	if (!xstrncmp (p->name, nextchar, nameend - nextchar))
 	  {
 	    if ((unsigned int) (nameend - nextchar)
 		== (unsigned int) strlen (p->name))
@@ -848,7 +848,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 	/* Test all long options for either exact match
 	   or abbreviated matches.  */
 	for (p = longopts, option_index = 0; p->name; p++, option_index++)
-	  if (!strncmp (p->name, nextchar, nameend - nextchar))
+	  if (!xstrncmp (p->name, nextchar, nameend - nextchar))
 	    {
 	      if ((unsigned int) (nameend - nextchar) == strlen (p->name))
 		{
diff --git a/src/common/gres.c b/src/common/gres.c
index 960115b36..fc5928441 100644
--- a/src/common/gres.c
+++ b/src/common/gres.c
@@ -73,12 +73,20 @@
 typedef cpuset_t cpu_set_t;
 #endif
 
+#include <ctype.h>
 #include <sched.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <math.h>
 
+#ifdef __NetBSD__
+#define CPU_ZERO(c) cpuset_zero(*(c))
+#define CPU_ISSET(i,c) cpuset_isset((i),*(c))
+#define sched_getaffinity sched_getaffinity_np
+#define SCHED_GETAFFINITY_THREE_ARGS
+#endif
+
 #include "slurm/slurm.h"
 #include "slurm/slurm_errno.h"
 #include "src/common/bitstring.h"
@@ -504,6 +512,29 @@ fini:	slurm_mutex_unlock(&gres_context_lock);
 	return rc;
 }
 
+/* Add a GRES record. This is used by the node_features plugin after the
+ * slurm.conf file is read and the initial GRES records are built by
+ * gres_plugin_init(). */
+extern void gres_plugin_add(char *gres_name)
+{
+	int i;
+
+	slurm_mutex_lock(&gres_context_lock);
+	for (i = 0; i < gres_context_cnt; i++) {
+		if (!xstrcmp(gres_context[i].gres_name, gres_name))
+			goto fini;
+	}
+
+	xrealloc(gres_context,
+		 (sizeof(slurm_gres_context_t) * (gres_context_cnt + 1)));
+	(void) _load_gres_plugin(gres_name, gres_context + gres_context_cnt);
+	/* Ignore return code. Support gres even without the plugin */
+	gres_context[gres_context_cnt].gres_name = xstrdup(gres_name);
+	gres_context[gres_context_cnt].plugin_id =_build_id(gres_name);
+	gres_context_cnt++;
+fini:	slurm_mutex_unlock(&gres_context_lock);
+}
+
 /*
  * Terminate the gres plugin. Free memory.
  *
@@ -846,7 +877,7 @@ static int _parse_gres_config(void **dest, slurm_parser_enum_t type,
 	s_p_hashtbl_destroy(tbl);
 
 	for (i=0; i<gres_context_cnt; i++) {
-		if (strcasecmp(p->name, gres_context[i].gres_name) == 0)
+		if (xstrcasecmp(p->name, gres_context[i].gres_name) == 0)
 			break;
 	}
 	if (i >= gres_context_cnt) {
@@ -937,7 +968,8 @@ extern int gres_plugin_node_config_devices_path(char **dev_path,
 		{NULL}
 	};
 
-	int count = 0, count2 = 0, i, j;
+	int count = 0, i;
+	int ret_count = 0;
 	struct stat config_stat;
 	s_p_hashtbl_t *tbl;
 	gres_slurmd_conf_t **gres_array;
@@ -967,23 +999,25 @@ extern int gres_plugin_node_config_devices_path(char **dev_path,
 		}
 		for (i = 0; i < count; i++) {
 			if ((gres_array[i]) && (gres_array[i]->file)) {
-				dev_path[i]   = gres_array[i]->file;
-				gres_name[i]  = gres_array[i]->name;
+				dev_path[ret_count]  = gres_array[i]->file;
+				gres_name[ret_count] = gres_array[i]->name;
 				gres_array[i] = NULL;
+				ret_count++;
 			}
 		}
 	}
-	if (s_p_get_array((void ***) &gres_array, &count2, "NodeName", tbl)) {
-		if ((count + count2) > array_len) {
+	if (s_p_get_array((void ***) &gres_array, &count, "NodeName", tbl)) {
+		if ((ret_count + count) > array_len) {
 			error("GRES device count exceeds array size (%d > %d)",
-			      (count + count2), array_len);
-			count2 = array_len - count;
+			      (ret_count + count), array_len);
+			count = array_len - count;
 		}
-		for (i = 0, j = count; i < count2; i++, j++) {
+		for (i = 0; i < count; i++) {
 			if ((gres_array[i]) && (gres_array[i]->file)) {
-				dev_path[j]   = gres_array[i]->file;
-				gres_name[j]  = gres_array[i]->name;
+				dev_path[ret_count]  = gres_array[i]->file;
+				gres_name[ret_count] = gres_array[i]->name;
 				gres_array[i] = NULL;
+				ret_count++;
 			}
 		}
 	}
@@ -991,7 +1025,7 @@ extern int gres_plugin_node_config_devices_path(char **dev_path,
 	slurm_mutex_unlock(&gres_context_lock);
 
 	xfree(gres_conf_file);
-	return (count + count2);
+	return ret_count;
 }
 
 /* No gres.conf file found.
@@ -1432,7 +1466,7 @@ static void _add_gres_type(char *type, gres_node_state_t *gres_data,
 {
 	int i;
 
-	if (!strcasecmp(type, "no_consume")) {
+	if (!xstrcasecmp(type, "no_consume")) {
 		gres_data->no_consume = true;
 		return;
 	}
@@ -1767,7 +1801,7 @@ extern int gres_gresid_to_gresname(uint32_t gres_id, char* gres_name,
 		/* Should not reach this as if there are GRES id's then there
 		 * must have been a gres_conf_list.
 		 */
-		info("%s--The gres_conf_list is NULL!!!\n", __FUNCTION__);
+		info("%s--The gres_conf_list is NULL!!!\n", __func__);
 		snprintf(gres_name, gres_name_len, "%u", gres_id);
 		return rc;
 	}
@@ -1803,6 +1837,8 @@ extern int _node_config_validate(char *node_name, char *orig_config,
 	if (gres_ptr->gres_data == NULL)
 		gres_ptr->gres_data = _build_gres_node_state();
 	gres_data = (gres_node_state_t *) gres_ptr->gres_data;
+	if (gres_data->node_feature)
+		return rc;
 
 	gres_cnt = _get_tot_gres_cnt(context_ptr->plugin_id, &set_cnt);
 	if (gres_data->gres_cnt_found != gres_cnt) {
@@ -2027,9 +2063,8 @@ extern int gres_plugin_node_config_validate(char *node_name,
 	rc = gres_plugin_init();
 
 	slurm_mutex_lock(&gres_context_lock);
-	if ((gres_context_cnt > 0) && (*gres_list == NULL)) {
+	if ((gres_context_cnt > 0) && (*gres_list == NULL))
 		*gres_list = list_create(_gres_node_list_delete);
-	}
 	for (i=0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) {
 		/* Find or create gres_state entry on the list */
 		gres_iter = list_iterator_create(*gres_list);
@@ -2053,6 +2088,111 @@ extern int gres_plugin_node_config_validate(char *node_name,
 	return rc;
 }
 
+/* Convert number to new value with suffix (e.g. 2096 -> 2K) */
+static void _gres_scale_value(uint64_t gres_size, uint64_t *gres_scaled,
+			      char **suffix)
+{
+	uint64_t tmp_gres_size = gres_size;
+	int i;
+
+	tmp_gres_size = gres_size;
+	for (i = 0; i < 4; i++) {
+		if ((tmp_gres_size != 0) && ((tmp_gres_size % 1024) == 0))
+			tmp_gres_size /= 1024;
+		else
+			break;
+	}
+
+	*gres_scaled = tmp_gres_size;
+	if (i == 0)
+		*suffix = "";
+	else if (i == 1)
+		*suffix = "K";
+	else if (i == 2)
+		*suffix = "M";
+	else if (i == 3)
+		*suffix = "G";
+	else
+		*suffix = "T";
+}
+
+/*
+ * Add a GRES from node_feature plugin
+ * IN node_name - name of the node for which the gres information applies
+ * IN gres_name - name of the GRES being added or updated from the plugin
+ * IN gres_size - count of this GRES on this node
+ * IN/OUT new_config - Updated GRES info from slurm.conf
+ * IN/OUT gres_list - List of GRES records for this node to track usage
+ */
+extern void gres_plugin_node_feature(char *node_name,
+				     char *gres_name, uint64_t gres_size,
+				     char **new_config, List *gres_list)
+{
+	char *new_gres = NULL, *tok, *save_ptr = NULL, *sep = "", *suffix = "";
+	gres_state_t *gres_ptr;
+	gres_node_state_t *gres_node_ptr;
+	ListIterator gres_iter;
+	uint32_t plugin_id;
+	uint64_t gres_scaled = 0;
+	int gres_name_len;
+
+	xassert(gres_name);
+	gres_name_len = strlen(gres_name);
+	plugin_id = _build_id(gres_name);
+	if (*new_config) {
+		tok = strtok_r(*new_config, ",", &save_ptr);
+		while (tok) {
+			if (!strncmp(tok, gres_name, gres_name_len) &&
+			    ((tok[gres_name_len] == ':') ||
+			     (tok[gres_name_len] == '\0'))) {
+				/* Skip this record */
+			} else {
+				xstrfmtcat(new_gres, "%s%s", sep, tok);
+				sep = ",";
+			}
+			tok = strtok_r(NULL, ",", &save_ptr);
+		}
+	}
+	_gres_scale_value(gres_size, &gres_scaled, &suffix);
+	xstrfmtcat(new_gres, "%s%s:%"PRIu64"%s",
+		   sep, gres_name, gres_scaled, suffix);
+	xfree(*new_config);
+	*new_config = new_gres;
+
+	slurm_mutex_lock(&gres_context_lock);
+	if (gres_context_cnt > 0) {
+		if (*gres_list == NULL)
+			*gres_list = list_create(_gres_node_list_delete);
+		gres_iter = list_iterator_create(*gres_list);
+		while ((gres_ptr = (gres_state_t *) list_next(gres_iter))) {
+			if (gres_ptr->plugin_id == plugin_id)
+				break;
+		}
+		list_iterator_destroy(gres_iter);
+		if (gres_ptr == NULL) {
+			gres_ptr = xmalloc(sizeof(gres_state_t));
+			gres_ptr->plugin_id = plugin_id;
+			gres_ptr->gres_data = _build_gres_node_state();
+			list_append(*gres_list, gres_ptr);
+		}
+		gres_node_ptr = gres_ptr->gres_data;
+		if (gres_size >= gres_node_ptr->gres_cnt_alloc) {
+			gres_node_ptr->gres_cnt_avail = gres_size -
+						gres_node_ptr->gres_cnt_alloc;
+		} else {
+			error("%s: Changed size count of GRES %s from %"PRIu64
+			      " to %"PRIu64", resource over allocated",
+			      __func__, gres_name,
+			      gres_node_ptr->gres_cnt_avail, gres_size);
+			gres_node_ptr->gres_cnt_avail = 0;
+		}
+		gres_node_ptr->gres_cnt_config = gres_size;
+		gres_node_ptr->gres_cnt_found = gres_size;
+		gres_node_ptr->node_feature = true;
+	}
+	slurm_mutex_unlock(&gres_context_lock);
+}
+
 static int _node_reconfig(char *node_name, char *orig_config, char **new_config,
 			  gres_state_t *gres_ptr, uint16_t fast_schedule,
 			  slurm_gres_context_t *context_ptr)
@@ -2113,6 +2253,7 @@ static int _node_reconfig(char *node_name, char *orig_config, char **new_config,
 
 	return rc;
 }
+
 /*
  * Note that a node's configuration has been modified (e.g. "scontol update ..")
  * IN node_name - name of the node for which the gres information applies
@@ -2136,9 +2277,8 @@ extern int gres_plugin_node_reconfig(char *node_name,
 	rc = gres_plugin_init();
 
 	slurm_mutex_lock(&gres_context_lock);
-	if ((gres_context_cnt > 0) && (*gres_list == NULL)) {
+	if ((gres_context_cnt > 0) && (*gres_list == NULL))
 		*gres_list = list_create(_gres_node_list_delete);
-	}
 	for (i=0; ((i < gres_context_cnt) && (rc == SLURM_SUCCESS)); i++) {
 		/* Find gres_state entry on the list */
 		gres_iter = list_iterator_create(*gres_list);
@@ -2674,7 +2814,7 @@ extern uint64_t gres_get_system_cnt(char *name)
 
 	slurm_mutex_lock(&gres_context_lock);
 	for (i=0; i < gres_context_cnt; i++) {
-		if (!strcmp(gres_context[i].gres_name, name)) {
+		if (!xstrcmp(gres_context[i].gres_name, name)) {
 			count = gres_context[i].total_cnt;
 			break;
 		}
@@ -2703,7 +2843,7 @@ extern uint64_t gres_plugin_node_config_cnt(List gres_list, char *name)
 
 	slurm_mutex_lock(&gres_context_lock);
 	for (i=0; i < gres_context_cnt; i++) {
-		if (strcmp(gres_context[i].gres_name, name))
+		if (xstrcmp(gres_context[i].gres_name, name))
 			continue;
 		/* Find or create gres_state entry on the list */
 		gres_iter = list_iterator_create(gres_list);
@@ -2757,58 +2897,93 @@ static void _gres_job_list_delete(void *list_element)
 	slurm_mutex_unlock(&gres_context_lock);
 }
 
-static int _job_state_validate(char *config, gres_job_state_t **gres_data,
-			       slurm_gres_context_t *context_ptr)
+static int _get_gres_req_cnt(
+	char *config, slurm_gres_context_t *context_ptr,
+	uint64_t *cnt_out, char **type_out)
 {
-	gres_job_state_t *gres_ptr;
 	char *type = NULL, *num = NULL, *last_num = NULL;
-	uint64_t cnt;
 
 	if (!xstrcmp(config, context_ptr->gres_name)) {
-		cnt = 1;
+		*cnt_out = 1;
 	} else if (!xstrncmp(config, context_ptr->gres_name_colon,
 			     context_ptr->gres_name_colon_len)) {
+		int64_t cnt = -1;
 		type = strchr(config, ':');
 		num = strrchr(config, ':');
-		if (!num)
-			return SLURM_ERROR;
-		errno = 0;
-		cnt = strtoll(num + 1, &last_num, 10);
-		if (errno != 0)
-			return SLURM_ERROR;
 
-		if (last_num[0] == '\0')
-			;
-		else if ((last_num[0] == 'k') || (last_num[0] == 'K'))
-			cnt *= 1024;
-		else if ((last_num[0] == 'm') || (last_num[0] == 'M'))
-			cnt *= (1024 * 1024);
-		else if ((last_num[0] == 'g') || (last_num[0] == 'G'))
-			cnt *= (1024 * 1024 * 1024);
-		else
-			return SLURM_ERROR;
+		/* If type and num are the same the user did not give
+		 * a count, just set it to 1.  */
+		if (num && isdigit(num[1])) {
+			errno = 0;
+			cnt = strtoll(num + 1, &last_num, 10);
+			if (errno != 0)
+				return SLURM_ERROR;
+		}
 
+		/* handle cases:
+		 * gpu:0k
+		 * gpu:1k
+		 * gpu:1
+		 * gpu:tesla
+		 * gpu:tesla:1
+		 * gpu:tesla:1k */
+		if (!num || cnt == -1)
+			*cnt_out = 1;
+		else {
+			*cnt_out = cnt;
+			if (last_num[0] == '\0')
+				;
+			else if ((last_num[0] == 'k') || (last_num[0] == 'K'))
+				*cnt_out *= 1024;
+			else if ((last_num[0] == 'm') || (last_num[0] == 'M'))
+				*cnt_out *= (1024 * 1024);
+			else if ((last_num[0] == 'g') || (last_num[0] == 'G'))
+				*cnt_out *= (1024 * 1024 * 1024);
+			else
+				return SLURM_ERROR;
+		}
+
+		if (type && ((cnt == -1) || (type != num))) {
+			type[0] = '\0';
+			if (num && type != num)
+				num[0] = '\0';
+			type++;
+			*type_out = xstrdup(type);
+		}
 	} else {
 		/* Did not find this GRES name, check for zero value */
 		num = strrchr(config, ':');
 		if (num) {
-			cnt = strtoll(num + 1, &last_num, 10);
-			if ((last_num[0] != '\0') || (cnt != 0))
+			*cnt_out = strtoll(num + 1, &last_num, 10);
+			if ((last_num[0] != '\0') || (*cnt_out != 0))
 				return SLURM_ERROR;
 		} else
 			return SLURM_ERROR;
 	}
 
+	return SLURM_SUCCESS;
+}
+
+static int _job_state_validate(char *config, gres_job_state_t **gres_data,
+			       slurm_gres_context_t *context_ptr)
+{
+	gres_job_state_t *gres_ptr;
+	char *type = NULL;
+	uint64_t cnt = 0;
+	int rc = SLURM_SUCCESS;
+
+	if ((rc = _get_gres_req_cnt(config, context_ptr, &cnt, &type))
+	    != SLURM_SUCCESS)
+		return rc;
+
 	if (cnt == 0) {
 		*gres_data = NULL;
+		xfree(type);
 	} else {
 		gres_ptr = xmalloc(sizeof(gres_job_state_t));
 		gres_ptr->gres_cnt_alloc = cnt;
-		if (type && num && (type != num)) {
-			type++;
-			num[0] = '\0';
-			gres_ptr->type_model = xstrdup(type);
-		}
+		gres_ptr->type_model = type;
+		type = NULL;
 
 		*gres_data = gres_ptr;
 	}
@@ -2853,6 +3028,7 @@ extern int gres_plugin_job_state_validate(char *req_config, List *gres_list)
 		return rc;
 
 	slurm_mutex_lock(&gres_context_lock);
+
 	tmp_str = xstrdup(req_config);
 	tok = strtok_r(tmp_str, ",", &last);
 	while (tok && (rc == SLURM_SUCCESS)) {
@@ -3105,42 +3281,6 @@ extern int gres_plugin_job_state_pack(List gres_list, Buf buffer,
 				pack8((uint8_t) 0, buffer);
 			}
 			rec_cnt++;
-		} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-			pack32(magic, buffer);
-			pack32(gres_ptr->plugin_id, buffer);
-			pack32(gres_job_ptr->gres_cnt_alloc, buffer);
-			pack32(gres_job_ptr->node_cnt, buffer);
-			if (gres_job_ptr->gres_bit_alloc) {
-				pack8((uint8_t) 1, buffer);
-				for (i = 0; i < gres_job_ptr->node_cnt; i++) {
-					pack_bit_str(gres_job_ptr->
-						     gres_bit_alloc[i],
-						     buffer);
-				}
-			} else {
-				pack8((uint8_t) 0, buffer);
-			}
-			if (details && gres_job_ptr->gres_bit_step_alloc) {
-				pack8((uint8_t) 1, buffer);
-				for (i = 0; i < gres_job_ptr->node_cnt; i++) {
-					pack_bit_str(gres_job_ptr->
-						     gres_bit_step_alloc[i],
-						     buffer);
-				}
-			} else {
-				pack8((uint8_t) 0, buffer);
-			}
-			if (details && gres_job_ptr->gres_cnt_step_alloc) {
-				pack8((uint8_t) 1, buffer);
-				for (i = 0; i < gres_job_ptr->node_cnt; i++) {
-					pack32(gres_job_ptr->
-					       gres_cnt_step_alloc[i],
-					       buffer);
-				}
-			} else {
-				pack8((uint8_t) 0, buffer);
-			}
-			rec_cnt++;
 		} else {
 			error("gres_plugin_node_state_pack: protocol_version"
 			      " %hu not supported", protocol_version);
@@ -3910,8 +4050,6 @@ extern void gres_plugin_job_clear(List job_gres_list)
 	(void) gres_plugin_init();
 	job_gres_iter = list_iterator_create(job_gres_list);
 	while ((job_gres_ptr = (gres_state_t *) list_next(job_gres_iter))) {
-		if (!job_gres_ptr)
-			continue;
 		job_state_ptr = (gres_job_state_t *) job_gres_ptr->gres_data;
 		for (i = 0; i < job_state_ptr->node_cnt; i++) {
 			if (job_state_ptr->gres_bit_alloc) {
@@ -4890,51 +5028,23 @@ static int _step_state_validate(char *config, gres_step_state_t **gres_data,
 				slurm_gres_context_t *context_ptr)
 {
 	gres_step_state_t *gres_ptr;
-	char *type = NULL, *num = NULL, *last_num = NULL;
-	int64_t cnt;
+	char *type = NULL;
+	uint64_t cnt = 0;
+	int rc = SLURM_SUCCESS;
 
-	if (!xstrcmp(config, context_ptr->gres_name)) {
-		cnt = 1;
-	} else if (!xstrncmp(config, context_ptr->gres_name_colon,
-			     context_ptr->gres_name_colon_len)) {
-		type = strchr(config, ':');
-		num = strrchr(config, ':');
-		if (!num)
-			return SLURM_ERROR;
-		cnt = strtoll(num + 1, &last_num, 10);
-		if (last_num[0] == '\0')
-			;
-		else if ((last_num[0] == 'k') || (last_num[0] == 'K'))
-			cnt *= 1024;
-		else if ((last_num[0] == 'm') || (last_num[0] == 'M'))
-			cnt *= (1024 * 1024);
-		else if ((last_num[0] == 'g') || (last_num[0] == 'G'))
-			cnt *= (1024 * 1024 * 1024);
-		else
-			return SLURM_ERROR;
-		if (cnt < 0)
-			return SLURM_ERROR;
-	} else {
-		/* Did not find this GRES name, check for zero value */
-		num = strrchr(config, ':');
-		if (num) {
-			cnt = strtoll(num + 1, &last_num, 10);
-			if ((last_num[0] != '\0') || (cnt != 0))
-				return SLURM_ERROR;
-		} else
-			return SLURM_ERROR;
-	}
+	if ((rc = _get_gres_req_cnt(config, context_ptr, &cnt, &type))
+	    != SLURM_SUCCESS)
+		return rc;
 
 	if (cnt == 0) {
 		*gres_data = NULL;
+		xfree(type);
 	} else {
 		gres_ptr = xmalloc(sizeof(gres_step_state_t));
 		gres_ptr->gres_cnt_alloc = (uint32_t) cnt;
-		if (type && num && (type != num)) {
-			type++;
-			num[0] = '\0';
-			gres_ptr->type_model = xstrdup(type);
-		}
+		gres_ptr->type_model = type;
+		type = NULL;
+
 		*gres_data = gres_ptr;
 	}
 	return SLURM_SUCCESS;
@@ -5567,7 +5677,7 @@ extern uint64_t gres_plugin_step_count(List step_gres_list, char *gres_name)
 
 	slurm_mutex_lock(&gres_context_lock);
 	for (i = 0; i < gres_context_cnt; i++) {
-		if (strcmp(gres_context[i].gres_name, gres_name))
+		if (xstrcmp(gres_context[i].gres_name, gres_name))
 			continue;
 		gres_iter = list_iterator_create(step_gres_list);
 		while ((gres_ptr = (gres_state_t *)list_next(gres_iter))) {
@@ -5591,7 +5701,12 @@ extern uint64_t gres_plugin_step_count(List step_gres_list, char *gres_name)
  * which are available from the CPUs current allocated to this process */
 static bitstr_t * _get_usable_gres(int context_inx)
 {
+#ifdef __NetBSD__
+	// On NetBSD, cpuset_t is an opaque data type
+	cpuset_t *mask = cpuset_create();
+#else
 	cpu_set_t mask;
+#endif
 	bitstr_t *usable_gres = NULL;
 	int i, i_last, rc;
 	ListIterator iter;
@@ -5642,6 +5757,10 @@ static bitstr_t * _get_usable_gres(int context_inx)
 	}
 	list_iterator_destroy(iter);
 
+#ifdef __NetBSD__
+	cpuset_destroy(mask);
+#endif
+
 	return usable_gres;
 }
 
@@ -5669,15 +5788,15 @@ extern void gres_plugin_step_set_env(char ***job_env_ptr, List step_gres_list,
 		if (gres_context[i].ops.step_set_env == NULL)
 			continue;	/* No plugin to call */
 		if (bind_gpu || bind_mic || bind_nic) {
-			if (!strcmp(gres_context[i].gres_name, "gpu")) {
+			if (!xstrcmp(gres_context[i].gres_name, "gpu")) {
 				if (!bind_gpu)
 					continue;
 				usable_gres = _get_usable_gres(i);
-			} else if (!strcmp(gres_context[i].gres_name, "mic")) {
+			} else if (!xstrcmp(gres_context[i].gres_name, "mic")) {
 				if (!bind_mic)
 					continue;
 				usable_gres = _get_usable_gres(i);
-			} else if (!strcmp(gres_context[i].gres_name, "nic")) {
+			} else if (!xstrcmp(gres_context[i].gres_name, "nic")) {
 				if (!bind_nic)
 					continue;
 				usable_gres = _get_usable_gres(i);
@@ -6599,6 +6718,7 @@ extern char *gres_2_tres_str(List gres_list, bool is_job, bool locked)
 	gres_state_t *gres_state_ptr;
 	int i;
 	uint64_t count;
+	char *col_name = NULL;
 	char *tres_str = NULL;
 	static bool first_run = 1;
 	static slurmdb_tres_rec_t tres_req;
@@ -6625,11 +6745,13 @@ extern char *gres_2_tres_str(List gres_list, bool is_job, bool locked)
 		if (is_job) {
 			gres_job_state_t *gres_data_ptr = (gres_job_state_t *)
 				gres_state_ptr->gres_data;
+			col_name = gres_data_ptr->type_model;
 			count = gres_data_ptr->gres_cnt_alloc
 				* (uint64_t)gres_data_ptr->node_cnt;
 		} else {
 			gres_step_state_t *gres_data_ptr = (gres_step_state_t *)
 				gres_state_ptr->gres_data;
+			col_name = gres_data_ptr->type_model;
 			count = gres_data_ptr->gres_cnt_alloc
 				* (uint64_t)gres_data_ptr->node_cnt;
 		}
@@ -6647,17 +6769,36 @@ extern char *gres_2_tres_str(List gres_list, bool is_job, bool locked)
 			continue;
 		}
 
-		if (!(tres_rec = assoc_mgr_find_tres_rec(&tres_req)))
-			continue; /* not tracked */
+		tres_rec = assoc_mgr_find_tres_rec(&tres_req);
 
-		if (slurmdb_find_tres_count_in_string(
-			    tres_str, tres_rec->id) != INFINITE64)
-			continue; /* already handled */
+		if (tres_rec &&
+		    slurmdb_find_tres_count_in_string(
+			    tres_str, tres_rec->id) == INFINITE64)
+			/* New gres */
+			xstrfmtcat(tres_str, "%s%u=%"PRIu64,
+				   tres_str ? "," : "",
+				   tres_rec->id, count);
 
-		/* New gres */
-		xstrfmtcat(tres_str, "%s%u=%"PRIu64,
-			   tres_str ? "," : "",
-			   tres_rec->id, count);
+		/* Now lets put of the : name tres if we are tracking
+		 * it as well.  This would be handy for gres like
+		 * gpu:tesla, where you might want to track both as
+		 * TRES.
+		 */
+		if (col_name && (i < gres_context_cnt)) {
+			tres_req.name = xstrdup_printf(
+				"%s%s",
+				gres_context[i].gres_name_colon,
+				col_name);
+			tres_rec = assoc_mgr_find_tres_rec(&tres_req);
+			xfree(tres_req.name);
+			if (tres_rec &&
+			    slurmdb_find_tres_count_in_string(
+				    tres_str, tres_rec->id) == INFINITE64)
+				/* New gres */
+				xstrfmtcat(tres_str, "%s%u=%"PRIu64,
+					   tres_str ? "," : "",
+					   tres_rec->id, count);
+		}
 	}
 	list_iterator_destroy(itr);
 	slurm_mutex_unlock(&gres_context_lock);
@@ -6677,6 +6818,7 @@ extern void gres_set_job_tres_cnt(List gres_list,
 	gres_state_t *gres_state_ptr;
 	static bool first_run = 1;
 	static slurmdb_tres_rec_t tres_rec;
+	char *col_name = NULL;
 	uint64_t count;
 	int i, tres_pos;
 	assoc_mgr_lock_t locks = { NO_LOCK, NO_LOCK, NO_LOCK, NO_LOCK,
@@ -6701,6 +6843,7 @@ extern void gres_set_job_tres_cnt(List gres_list,
 	while ((gres_state_ptr = list_next(itr))) {
 		gres_job_state_t *gres_data_ptr = (gres_job_state_t *)
 			gres_state_ptr->gres_data;
+		col_name = gres_data_ptr->type_model;
 		count = gres_data_ptr->gres_cnt_alloc * (uint64_t)node_cnt;
 
 		for (i=0; i < gres_context_cnt; i++) {
@@ -6712,13 +6855,30 @@ extern void gres_set_job_tres_cnt(List gres_list,
 		}
 
 		if (!tres_rec.name) {
-			debug("gres_add_tres: couldn't find name");
+			debug("%s: couldn't find name", __func__);
 			continue;
 		}
 
 		if ((tres_pos = assoc_mgr_find_tres_pos(
 			     &tres_rec, true)) != -1)
 			tres_cnt[tres_pos] = count;
+
+		/* Now lets put of the : name tres if we are tracking
+		 * it as well.  This would be handy for gres like
+		 * gpu:tesla, where you might want to track both as
+		 * TRES.
+		 */
+		if (col_name && (i < gres_context_cnt)) {
+			tres_rec.name = xstrdup_printf(
+				"%s%s",
+				gres_context[i].gres_name_colon,
+				col_name);
+
+			if ((tres_pos = assoc_mgr_find_tres_pos(
+				     &tres_rec, true)) != -1)
+				tres_cnt[tres_pos] = count;
+			xfree(tres_rec.name);
+		}
 	}
 	list_iterator_destroy(itr);
 	slurm_mutex_unlock(&gres_context_lock);
diff --git a/src/common/gres.h b/src/common/gres.h
index e8f6696e6..145ed0735 100644
--- a/src/common/gres.h
+++ b/src/common/gres.h
@@ -89,6 +89,9 @@ typedef struct gres_node_state {
 	/* Non-consumable: Do not track resources allocated to jobs */
 	bool no_consume;
 
+	/* True if set by node_feature plugin, ignore info from compute node */
+	bool node_feature;
+
 	/* Total resources available for allocation to jobs.
 	 * gres_cnt_found or gres_cnt_config, depending upon FastSchedule */
 	uint64_t gres_cnt_avail;
@@ -255,6 +258,11 @@ extern void gres_plugin_recv_stepd(int fd);
 extern int gres_plugin_init_node_config(char *node_name, char *orig_config,
 					List *gres_list);
 
+/* Add a GRES record. This is used by the node_features plugin after the
+ * slurm.conf file is read and the initial GRES records are built by
+ * gres_plugin_init(). */
+extern void gres_plugin_add(char *gres_name);
+
 /*
  * Unpack this node's configuration from a buffer (built/packed by slurmd)
  * IN/OUT buffer - message buffer to unpack
@@ -282,6 +290,18 @@ extern int gres_plugin_node_config_validate(char *node_name,
 					    uint16_t fast_schedule,
 					    char **reason_down);
 
+/*
+ * Add a GRES from node_feature plugin
+ * IN node_name - name of the node for which the gres information applies
+ * IN gres_name - name of the GRES being added or updated from the plugin
+ * IN gres_size - count of this GRES on this node
+ * IN/OUT new_config - Updated GRES info from slurm.conf
+ * IN/OUT gres_list - List of GRES records for this node to track usage
+ */
+extern void gres_plugin_node_feature(char *node_name,
+				     char *gres_name, uint64_t gres_size,
+				     char **new_config, List *gres_list);
+
 /*
  * Note that a node's configuration has been modified (e.g. "scontol update ..")
  * IN node_name - name of the node for which the gres information applies
diff --git a/src/common/hostlist.c b/src/common/hostlist.c
index afda8418a..5cd0cc43b 100644
--- a/src/common/hostlist.c
+++ b/src/common/hostlist.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
- *  $Id$
- *****************************************************************************
- *  $LSDId: hostlist.c,v 1.14 2003/10/14 20:11:54 grondo Exp $
+ *  hostlist.c
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -78,6 +76,7 @@
 #include "src/common/working_cluster.h"
 #include "src/common/xassert.h"
 #include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
 
 /*
  * Define slurm-specific aliases for use by plugins, see slurm_xlator.h
@@ -863,7 +862,7 @@ static hostrange_t hostrange_delete_host(hostrange_t hr, unsigned long n)
 
 /* hostrange_cmp() is used to sort hostrange objects. It will
  * sort based on the following (in order):
- *  o result of strcmp on prefixes
+ *  o result of xstrcmp on prefixes
  *  o if widths are compatible, then:
  *       sort based on lowest suffix in range
  *    else
@@ -1118,7 +1117,7 @@ static int hostrange_hn_within(hostrange_t hr, hostname_t hn)
 		 *   which case we return true. Otherwise, there is no
 		 *   possibility that [hn] matches [hr].
 		 */
-		if (strcmp (hn->hostname, hr->prefix) == 0)
+		if (xstrcmp (hn->hostname, hr->prefix) == 0)
 			return 1;
 		else
 			return 0;
@@ -1136,7 +1135,7 @@ static int hostrange_hn_within(hostrange_t hr, hostname_t hn)
 	 *  If hostrange and hostname prefixes don't match, then
 	 *   there is way the hostname falls within the range [hr].
 	 */
-	if (strcmp(hr->prefix, hn->prefix) != 0) {
+	if (xstrcmp(hr->prefix, hn->prefix) != 0) {
 		int len1, len2, ldiff;
 		int dims = slurmdb_setup_cluster_name_dims();
 
@@ -1180,7 +1179,7 @@ static int hostrange_hn_within(hostrange_t hr, hostname_t hn)
 			hn->num = strtoul(hn->suffix, NULL, 10);
 
 			/* Now compare them and see if they match */
-			if (strcmp(hr->prefix, hn->prefix) != 0)
+			if (xstrcmp(hr->prefix, hn->prefix) != 0)
 				return 0;
 		} else
 			return 0;
@@ -1606,7 +1605,7 @@ hostlist_t _hostlist_create(const char *hostlist, char *sep, char *r_op,
 			 */
 			if (pos > 0) {
 				if (pos != strlen(prefix) ||
-				    strncmp(prefix, tok, pos) != 0)
+				    xstrncmp(prefix, tok, pos) != 0)
 					error = 1;
 			}
 
diff --git a/src/common/hostlist.h b/src/common/hostlist.h
index 6de00f33c..08b10121e 100644
--- a/src/common/hostlist.h
+++ b/src/common/hostlist.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
- *  $Id$
- *****************************************************************************
- *  $LSDId: hostlist.h,v 1.4 2003/09/19 21:37:34 grondo Exp $
+ *  hostlist.h
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/io_hdr.c b/src/common/io_hdr.c
index 763da806b..5fda5665c 100644
--- a/src/common/io_hdr.c
+++ b/src/common/io_hdr.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/common/io_hdr.c - IO connection header functions
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/io_hdr.h b/src/common/io_hdr.h
index b8a0f61ab..af924c17f 100644
--- a/src/common/io_hdr.h
+++ b/src/common/io_hdr.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/common/io_hdr.h - IO connection header functions
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/job_options.c b/src/common/job_options.c
index 76d37987f..3787bdd94 100644
--- a/src/common/job_options.c
+++ b/src/common/job_options.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/common/job_options.c  - Extra job options
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -198,7 +197,7 @@ int job_options_unpack (job_options_t opts, Buf buf)
 
 	safe_unpackstr_xmalloc (&tag, &len, buf);
 
-	if (strncmp (tag, JOB_OPTIONS_PACK_TAG, len) != 0) {
+	if (xstrncmp (tag, JOB_OPTIONS_PACK_TAG, len) != 0) {
 		xfree(tag);
 		return (-1);
 	}
diff --git a/src/common/job_options.h b/src/common/job_options.h
index 0441d1de4..c89b41ab8 100644
--- a/src/common/job_options.h
+++ b/src/common/job_options.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/common/job_options.h  - Extra job options
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/job_resources.c b/src/common/job_resources.c
index 101dc05a0..85d26c9f7 100644
--- a/src/common/job_resources.c
+++ b/src/common/job_resources.c
@@ -226,8 +226,7 @@ extern int reset_node_bitmap(job_resources_t *job_resrcs_ptr, uint32_t job_id)
 	if (!job_resrcs_ptr)
 		return SLURM_SUCCESS;
 
-	if (job_resrcs_ptr->node_bitmap)
-		FREE_NULL_BITMAP(job_resrcs_ptr->node_bitmap);
+	FREE_NULL_BITMAP(job_resrcs_ptr->node_bitmap);
 
 	if (job_resrcs_ptr->nodes &&
 	    (node_name2bitmap(job_resrcs_ptr->nodes, false,
@@ -254,6 +253,7 @@ extern int valid_job_resources(job_resources_t *job_resrcs,
 {
 	int i, bitmap_len;
 	int sock_inx = 0, sock_cnt = 0;
+	int total_job_cores, total_node_cores;
 	uint32_t cores, socks;
 	struct node_record *node_ptr, *node_record_table;
 
@@ -285,15 +285,16 @@ extern int valid_job_resources(job_resources_t *job_resrcs,
 			sock_inx++;
 			sock_cnt = 0;
 		}
-		if ((socks != job_resrcs->sockets_per_node[sock_inx]) ||
-		    (cores != job_resrcs->cores_per_socket[sock_inx])) {
-			error("valid_job_resources: "
-			      "%s sockets:%u,%u, cores %u,%u",
+		/* KNL nodes can should maintain a constant total core count,
+		 * but the socket/NUMA count can change on reboot */
+		total_job_cores = job_resrcs->sockets_per_node[sock_inx] *
+				  job_resrcs->cores_per_socket[sock_inx];
+		total_node_cores = socks * cores;
+		if (total_job_cores != total_node_cores) {
+			error("valid_job_resources: %s sockets:%u,%u, cores %u,%u",
 			      node_ptr->name,
-			      socks,
-			      job_resrcs->sockets_per_node[sock_inx],
-			      cores,
-			      job_resrcs->cores_per_socket[sock_inx]);
+			      socks, job_resrcs->sockets_per_node[sock_inx],
+			      cores, job_resrcs->cores_per_socket[sock_inx]);
 			return SLURM_ERROR;
 		}
 		sock_cnt++;
@@ -532,7 +533,7 @@ extern void pack_job_resources(job_resources_t *job_resrcs_ptr, Buf buffer,
 {
 	uint32_t cluster_flags = slurmdb_setup_cluster_flags();
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (job_resrcs_ptr == NULL) {
 			uint32_t empty = NO_VAL;
 			pack32(empty, buffer);
@@ -612,85 +613,6 @@ extern void pack_job_resources(job_resources_t *job_resrcs_ptr, Buf buffer,
 			pack_bit_str_hex(job_resrcs_ptr->core_bitmap_used,
 					 buffer);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		if (job_resrcs_ptr == NULL) {
-			uint32_t empty = NO_VAL;
-			pack32(empty, buffer);
-			return;
-		}
-
-		pack32(job_resrcs_ptr->nhosts, buffer);
-		pack32(job_resrcs_ptr->ncpus, buffer);
-		pack32(job_resrcs_ptr->node_req, buffer);
-		packstr(job_resrcs_ptr->nodes, buffer);
-		pack8(job_resrcs_ptr->whole_node, buffer);
-
-		if (job_resrcs_ptr->cpu_array_reps)
-			pack32_array(job_resrcs_ptr->cpu_array_reps,
-				     job_resrcs_ptr->cpu_array_cnt, buffer);
-		else
-			pack32_array(job_resrcs_ptr->cpu_array_reps, 0, buffer);
-
-		if (job_resrcs_ptr->cpu_array_value)
-			pack16_array(job_resrcs_ptr->cpu_array_value,
-				     job_resrcs_ptr->cpu_array_cnt, buffer);
-		else
-			pack16_array(job_resrcs_ptr->cpu_array_value,
-				     0, buffer);
-
-		if (job_resrcs_ptr->cpus)
-			pack16_array(job_resrcs_ptr->cpus,
-				     job_resrcs_ptr->nhosts, buffer);
-		else
-			pack16_array(job_resrcs_ptr->cpus, 0, buffer);
-
-		if (job_resrcs_ptr->cpus_used)
-			pack16_array(job_resrcs_ptr->cpus_used,
-				     job_resrcs_ptr->nhosts, buffer);
-		else
-			pack16_array(job_resrcs_ptr->cpus_used, 0, buffer);
-
-		if (job_resrcs_ptr->memory_allocated)
-			pack32_array(job_resrcs_ptr->memory_allocated,
-				     job_resrcs_ptr->nhosts, buffer);
-		else
-			pack32_array(job_resrcs_ptr->memory_allocated,
-				     0, buffer);
-
-		if (job_resrcs_ptr->memory_used)
-			pack32_array(job_resrcs_ptr->memory_used,
-				     job_resrcs_ptr->nhosts, buffer);
-		else
-			pack32_array(job_resrcs_ptr->memory_used, 0, buffer);
-		if (!(cluster_flags & CLUSTER_FLAG_BG)) {
-			int i;
-			uint32_t core_cnt = 0, sock_recs = 0;
-			xassert(job_resrcs_ptr->cores_per_socket);
-			xassert(job_resrcs_ptr->sock_core_rep_count);
-			xassert(job_resrcs_ptr->sockets_per_node);
-
-			for (i=0; i<job_resrcs_ptr->nhosts; i++) {
-				core_cnt += job_resrcs_ptr->sockets_per_node[i]
-					* job_resrcs_ptr->cores_per_socket[i] *
-					job_resrcs_ptr->sock_core_rep_count[i];
-				sock_recs += job_resrcs_ptr->
-					     sock_core_rep_count[i];
-				if (sock_recs >= job_resrcs_ptr->nhosts)
-					break;
-			}
-			i++;
-			pack16_array(job_resrcs_ptr->sockets_per_node,
-				     (uint32_t) i, buffer);
-			pack16_array(job_resrcs_ptr->cores_per_socket,
-				     (uint32_t) i, buffer);
-			pack32_array(job_resrcs_ptr->sock_core_rep_count,
-				     (uint32_t) i, buffer);
-
-			xassert(job_resrcs_ptr->core_bitmap);
-			xassert(job_resrcs_ptr->core_bitmap_used);
-			pack_bit_str(job_resrcs_ptr->core_bitmap, buffer);
-			pack_bit_str(job_resrcs_ptr->core_bitmap_used, buffer);
-		}
 	} else {
 		error("pack_job_resources: protocol_version %hu not supported",
 		      protocol_version);
@@ -706,7 +628,7 @@ extern int unpack_job_resources(job_resources_t **job_resrcs_pptr,
 	uint32_t cluster_flags = slurmdb_setup_cluster_flags();
 
 	xassert(job_resrcs_pptr);
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack32(&empty, buffer);
 		if (empty == NO_VAL) {
 			*job_resrcs_pptr = NULL;
@@ -769,68 +691,6 @@ extern int unpack_job_resources(job_resources_t **job_resrcs_pptr,
 			unpack_bit_str_hex(&job_resrcs->core_bitmap_used,
 					   buffer);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		safe_unpack32(&empty, buffer);
-		if (empty == NO_VAL) {
-			*job_resrcs_pptr = NULL;
-			return SLURM_SUCCESS;
-		}
-
-		job_resrcs = xmalloc(sizeof(struct job_resources));
-		job_resrcs->nhosts = empty;
-		safe_unpack32(&job_resrcs->ncpus, buffer);
-		safe_unpack32(&job_resrcs->node_req, buffer);
-		safe_unpackstr_xmalloc(&job_resrcs->nodes, &tmp32, buffer);
-		safe_unpack8(&job_resrcs->whole_node, buffer);
-
-		safe_unpack32_array(&job_resrcs->cpu_array_reps,
-				    &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->cpu_array_reps);
-		job_resrcs->cpu_array_cnt = tmp32;
-
-		safe_unpack16_array(&job_resrcs->cpu_array_value,
-				    &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->cpu_array_value);
-
-		if (tmp32 != job_resrcs->cpu_array_cnt)
-			goto unpack_error;
-
-		safe_unpack16_array(&job_resrcs->cpus, &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->cpus);
-		if (tmp32 != job_resrcs->nhosts)
-			goto unpack_error;
-		safe_unpack16_array(&job_resrcs->cpus_used, &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->cpus_used);
-
-		safe_unpack32_array(&job_resrcs->memory_allocated,
-				    &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->memory_allocated);
-		safe_unpack32_array(&job_resrcs->memory_used, &tmp32, buffer);
-		if (tmp32 == 0)
-			xfree(job_resrcs->memory_used);
-
-		if (!(cluster_flags & CLUSTER_FLAG_BG)) {
-			safe_unpack16_array(&job_resrcs->sockets_per_node,
-					    &tmp32, buffer);
-			if (tmp32 == 0)
-				xfree(job_resrcs->sockets_per_node);
-			safe_unpack16_array(&job_resrcs->cores_per_socket,
-					    &tmp32, buffer);
-			if (tmp32 == 0)
-				xfree(job_resrcs->cores_per_socket);
-			safe_unpack32_array(&job_resrcs->sock_core_rep_count,
-					    &tmp32, buffer);
-			if (tmp32 == 0)
-				xfree(job_resrcs->sock_core_rep_count);
-
-			unpack_bit_str(&job_resrcs->core_bitmap, buffer);
-			unpack_bit_str(&job_resrcs->core_bitmap_used, buffer);
-		}
 	} else {
 		error("unpack_job_resources: protocol_version %hu not "
 		      "supported", protocol_version);
@@ -1097,6 +957,97 @@ extern int clear_job_resources_node(job_resources_t *job_resrcs_ptr,
 	return _change_job_resources_node(job_resrcs_ptr, node_id, false);
 }
 
+/* Completely remove specified node from job resources structure */
+extern int extract_job_resources_node(job_resources_t *job, uint32_t node_id)
+{
+	int i, i_first, i_last, n;
+	int bit_inx = 0, core_cnt = 0, host_cnt, len, node_inx = node_id;
+
+	xassert(job);
+
+	/* Modify core/socket counter arrays to remove this node */
+	host_cnt = job->nhosts;
+	for (i = 0; i < job->nhosts; i++) {
+		host_cnt -= job->sock_core_rep_count[i];
+		if (job->sock_core_rep_count[i] <= node_inx) {
+			bit_inx += job->sockets_per_node[i] *
+				   job->cores_per_socket[i] *
+				   job->sock_core_rep_count[i];
+			node_inx -= job->sock_core_rep_count[i];
+		} else {
+			bit_inx += job->sockets_per_node[i] *
+				   job->cores_per_socket[i] * node_inx;
+			core_cnt = job->sockets_per_node[i] *
+				   job->cores_per_socket[i];
+			job->sock_core_rep_count[i]--;
+			if (job->sock_core_rep_count[i] == 0) {
+				for ( ; host_cnt > 0; i++) {
+					job->cores_per_socket[i] =
+						job->cores_per_socket[i+1];
+					job->sock_core_rep_count[i] =
+						job->sock_core_rep_count[i+1];
+					job->sockets_per_node[i] =
+						job->sockets_per_node[i+1];
+					host_cnt -= job->sock_core_rep_count[i];
+				}
+			}
+			break;
+		}
+	}
+	if (core_cnt < 1) {
+		error("%s: core_cnt=0", __func__);
+		return SLURM_ERROR;
+	}
+
+	/* Shift core_bitmap contents and shrink it to remove this node */
+	len = bit_size(job->core_bitmap);
+	for (i = bit_inx; (i + core_cnt) < len; i++) {
+		if (bit_test(job->core_bitmap, i + core_cnt))
+			bit_set(job->core_bitmap, i);
+		else
+			bit_clear(job->core_bitmap, i);
+		if (!job->core_bitmap_used)
+			;
+		else if (bit_test(job->core_bitmap_used, i + core_cnt))
+			bit_set(job->core_bitmap_used, i);
+		else
+			bit_clear(job->core_bitmap_used, i);
+	}
+	job->core_bitmap = bit_realloc(job->core_bitmap, len - core_cnt);
+	if (job->core_bitmap_used) {
+		job->core_bitmap_used = bit_realloc(job->core_bitmap_used,
+						    len - core_cnt);
+	}
+
+	/* Shift cpus, cpus_used, memory_allocated, and memory_used arrays */
+	i_first = bit_ffs(job->node_bitmap);
+	if (i_first >= 0)
+		i_last = bit_fls(job->node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first, n = -1; i <= i_last; i++) {
+		if (!bit_test(job->node_bitmap, i))
+			continue;
+		if (++n == node_id) {
+			bit_clear(job->node_bitmap, i);
+			break;
+		}
+	}
+	job->nhosts--;
+	for (i = n; i < job->nhosts; i++) {
+		job->cpus[i] = job->cpus[i+1];
+		job->cpus_used[i] = job->cpus_used[i+1];
+		job->memory_allocated[i] = job->memory_allocated[i+1];
+		job->memory_used[i] = job->memory_used[i+1];
+	}
+
+	xfree(job->nodes);
+	job->nodes = bitmap2node_name(job->node_bitmap);
+	job->ncpus = build_job_resources_cpu_array(job);
+
+	return SLURM_SUCCESS;
+}
+
 /* Return the count of core bitmaps set for the specific node */
 extern int count_job_resources_node(job_resources_t *job_resrcs_ptr,
 				    uint32_t node_id)
diff --git a/src/common/job_resources.h b/src/common/job_resources.h
index 5872c54cf..318ec5b4a 100644
--- a/src/common/job_resources.h
+++ b/src/common/job_resources.h
@@ -247,6 +247,10 @@ extern int clear_job_resources_node(job_resources_t *job_resrcs_ptr,
 extern int set_job_resources_node(job_resources_t *job_resrcs_ptr,
 				  uint32_t node_id);
 
+/* Completely remove specified node from job resources structure */
+extern int extract_job_resources_node(job_resources_t *job_resrcs_ptr,
+				      uint32_t node_id);
+
 /* Return the count of core bitmaps set for the specific node */
 extern int count_job_resources_node(job_resources_t *job_resrcs_ptr,
 				    uint32_t node_id);
diff --git a/src/common/layouts_mgr.c b/src/common/layouts_mgr.c
index f44e8b474..56e38a8b3 100644
--- a/src/common/layouts_mgr.c
+++ b/src/common/layouts_mgr.c
@@ -56,6 +56,7 @@
 #include "src/common/plugin.h"
 #include "src/common/read_config.h"
 #include "src/common/slurm_protocol_api.h"
+#include "src/common/strlcpy.h"
 #include "src/common/timers.h"
 #include "src/common/xstring.h"
 #include "src/common/xtree.h"
@@ -268,17 +269,6 @@ static char* _cat(char* dest, const char* src, size_t n)
 	return r;
 }
 
-/* safer behavior than plain strncpy */
-static char* _cpy(char* dest, const char* src, size_t n)
-{
-	char* r;
-	if (n == 0)
-		return dest;
-	r = strncpy(dest, src, n - 1);
-	dest[n - 1] = 0;
-	return r;
-}
-
 static char* trim(char* str)
 {
 	char* str_modifier;
@@ -300,7 +290,7 @@ static int _string_in_array(const char* str, const char** strings)
 	xassert(strings); /* if etypes no specified in plugin, no new entity
 			     should be created */
 	for (; *strings; ++strings) {
-		if (!strcmp(str, *strings))
+		if (!xstrcmp(str, *strings))
 			return 1;
 	}
 	return 0;
@@ -320,7 +310,7 @@ static void _normalize_keydef_keycore(char* buffer, uint32_t size,
 	if (cat) {
 		_cat(buffer, keytmp, size);
 	} else {
-		_cpy(buffer, keytmp, size);
+		strlcpy(buffer, keytmp, size);
 	}
 	_cat(buffer, ".", size);
 	for (i = 0; key[i] && i < PATHLEN - 1; ++i) {
@@ -339,7 +329,7 @@ static void _normalize_keydef_key(char* buffer, uint32_t size,
 static void _normalize_keydef_mgrkey(char* buffer, uint32_t size,
 				     const char* key, const char* plugtype)
 {
-	_cpy(buffer, "mgr.", size);
+	strlcpy(buffer, "mgr.", size);
 	_normalize_keydef_keycore(buffer, size, key, plugtype, true);
 }
 
@@ -630,10 +620,7 @@ int _layouts_entity_get_kv(layout_t* l, entity_t* e, char* key, void* value,
 		return SLURM_ERROR;
 	case L_T_STRING:
 		pstr = (char**) value;
-		if (data)
-			*pstr = xstrdup(data);
-		else
-			*pstr = NULL;
+		*pstr = xstrdup(data);
 		return SLURM_SUCCESS;
 	case L_T_CUSTOM:
 		/* TBD : add a custom_get call */
@@ -849,6 +836,15 @@ static void _layouts_init_keydef(xhash_t* keydefs,
 	}
 }
 
+static void _debug_output_keydefs (void* item, void* args)
+{
+	layouts_keydef_t* keydef = (layouts_keydef_t*) item;
+	debug3("layouts/keydefs: loaded: %s flags=0x%08lx refkey=%s",
+	       keydef->key, (long unsigned int) keydef->flags,
+	       (keydef->ref_key == NULL) ? "-":keydef->ref_key);
+
+}
+
 static int _layouts_init_layouts_walk_helper(void* x, void* arg)
 {
 	layouts_conf_spec_t* spec = (layouts_conf_spec_t*)x;
@@ -888,6 +884,7 @@ static int _layouts_init_layouts_walk_helper(void* x, void* arg)
 	_layouts_init_keydef(mgr->keydefs,
 			     plugin->ops->spec->keyspec,
 			     plugin);
+	xhash_walk(mgr->keydefs, _debug_output_keydefs, NULL);
 	++*i;
 	return SLURM_SUCCESS;
 }
@@ -955,7 +952,7 @@ static char* _conf_get_filename(const char* type)
 {
 	char path[PATHLEN];
 	char* final_path;
-	_cpy(path, "layouts.d/", PATHLEN);
+	strlcpy(path, "layouts.d/", PATHLEN);
 	_cat(path, type, PATHLEN);
 	_cat(path, ".conf", PATHLEN);
 	final_path = get_extra_conf_path(path);
@@ -991,7 +988,7 @@ static s_p_hashtbl_t* _conf_make_hashtbl(int struct_type,
 
 	/* available for constructing a tree */
 	static s_p_options_t tree_options_entity[] = {
-		{"Enclosed", S_P_PLAIN_STRING},
+		{"Enclosed", S_P_STRING},
 		{NULL}
 	};
 	static s_p_options_t tree_options[] = {
@@ -1058,7 +1055,7 @@ static void _layouts_load_automerge(layout_plugin_t* plugin, entity_t* e,
 	char* option_key;
 
 	for (layout_option = plugin->ops->spec->options;
-	     layout_option && strcasecmp("Entity", layout_option->key);
+	     layout_option && xstrcasecmp("Entity", layout_option->key);
 	     ++layout_option);
 	xassert(layout_option);
 
@@ -1292,7 +1289,7 @@ static int _layouts_load_config_common(layout_plugin_t* plugin,
 				rc = SLURM_ERROR;
 				continue;
 			}
-			if (!e->type || strcmp(e_type, e->type)) {
+			if (!e->type || xstrcmp(e_type, e->type)) {
 				info("layouts: entity '%s' type (%s) differs "
 				     "from already registered entity type (%s)"
 				     " skipping", e_name, e_type, e->type);
@@ -1594,7 +1591,7 @@ typedef struct _pack_args {
 	hostlist_t list_entities;
 	char       *type;
 	uint32_t   all;
-	uint32_t   no_relation;
+	uint32_t   flags;
 	uint32_t   record_count;
 } _pack_args_t;
 
@@ -1676,7 +1673,8 @@ static void _pack_entity_layout_data(void* item, void* arg)
 	xassert(keydef);
 
 	/* only dump keys related to the targeted layout */
-	if (!strncmp(keydef->plugin->layout->type, pargs->layout->type, PATHLEN)) {
+	if (!xstrncmp(keydef->plugin->layout->type, pargs->layout->type,
+		      PATHLEN)) {
 		data_dump = _pack_data_key(keydef, data->value);
 		/* avoid printing any error in case of NULL pointer returned */
 		if (data_dump) {
@@ -1750,7 +1748,8 @@ static uint8_t _pack_layout_tree(xtree_node_t* node, uint8_t which,
 	}
 
 	/* print this entity as root if necessary */
-	if (level == 0 && pargs->no_relation != 1 && pargs->type == NULL) {
+	if (level == 0 && !(pargs->flags & LAYOUTS_DUMP_NOLAYOUT)
+	    && pargs->type == NULL) {
 		if (pargs->all != 0 ||
 		    pargs->list_entities == NULL ||
 		    hostlist_find(pargs->list_entities, e_name) != -1) {
@@ -1781,7 +1780,7 @@ static uint8_t _pack_layout_tree(xtree_node_t* node, uint8_t which,
 	pargs->current_line = NULL;
 
 	/* don't print enclosed if no_relation option */
-	if (pargs->no_relation == 1
+	if ((pargs->flags & LAYOUTS_DUMP_NOLAYOUT)
 	    && enclosed_str != NULL
 	    && pargs->list_entities == NULL) {
 		xfree(enclosed_str);
@@ -1807,7 +1806,7 @@ static uint8_t _pack_layout_tree(xtree_node_t* node, uint8_t which,
 
 	/* don't print entities if not type of "type char*" */
 	if (pargs->type != NULL
-	    && (e_type == NULL || strcasecmp(e_type, pargs->type)!=0)) {
+	    && (e_type == NULL || xstrcasecmp(e_type, pargs->type)!=0)) {
 		xfree(str);
 		return 1;
 	}
@@ -1929,8 +1928,8 @@ static void _tree_update_node_entity_data(void* item, void* arg) {
 		return;
 
 	/* only work on keys related to the targeted layout */
-	if (strncmp(keydef->plugin->layout->type, pargs->enode->layout->type,
-		    PATHLEN)) {
+	if (xstrncmp(keydef->plugin->layout->type, pargs->enode->layout->type,
+		     PATHLEN)) {
 		return;
 	}
 
@@ -2535,7 +2534,7 @@ entity_t* layouts_get_entity(const char* name)
 
 
 int layouts_pack_layout(char *l_type, char *char_entities, char *type,
-			uint32_t no_relation, Buf buffer)
+			uint32_t flags, Buf buffer)
 {
 	_pack_args_t pargs;
 	layout_t* layout;
@@ -2557,21 +2556,19 @@ int layouts_pack_layout(char *l_type, char *char_entities, char *type,
 	pargs.all = 0;
 	pargs.list_entities = NULL;
 	if (char_entities != NULL) {
-		if (strcmp(char_entities, "*") == 0)
+		if (xstrcmp(char_entities, "*") == 0)
 			pargs.all = 1;
 		else
 			pargs.list_entities = hostlist_create(char_entities);
 	}
 	pargs.type = type;
-	pargs.no_relation = no_relation;
+	pargs.flags = flags;
 	pargs.record_count = 0;
 	orig_offset = get_buf_offset(buffer);
 	pack32(pargs.record_count, buffer);
 
-	if ( pargs.no_relation == 0
-	     && pargs.list_entities == NULL
-	     && pargs.type == NULL ) {
-		/* start by packing the layout priority */
+	/* start by packing the layout priority in case we are dumping state */
+	if (pargs.flags & LAYOUTS_DUMP_STATE) {
 		str = xstrdup_printf("Priority=%u\n", layout->priority);
 		packstr(str, buffer);
 		pargs.record_count++;
@@ -2604,7 +2601,7 @@ int layouts_update_layout(char *l_type, Buf buffer)
 	int i, rc;
 	slurm_mutex_lock(&mgr->lock);
 	for (i = 0; i < mgr->plugins_count; i++) {
-		if (!strcmp(mgr->plugins[i].name, l_type)) {
+		if (!xstrcmp(mgr->plugins[i].name, l_type)) {
 			rc = _layouts_update_state((layout_plugin_t*)
 						   &mgr->plugins[i],
 						   buffer);
@@ -2648,8 +2645,8 @@ int layouts_state_save_layout(char* l_type)
 	START_TIMER;
 
 	/* pack the targeted layout into a tmp buffer */
-	error_code = layouts_pack_layout(l_type, "*", NULL, 0, buffer);
-
+	error_code = layouts_pack_layout(l_type, "*", NULL,
+					 LAYOUTS_DUMP_STATE, buffer);
 	if (error_code != SLURM_SUCCESS) {
 		error("unable to save layout[%s] state", l_type);
 		return error_code;
diff --git a/src/common/layouts_mgr.h b/src/common/layouts_mgr.h
index 40db1ee6e..027f2743f 100644
--- a/src/common/layouts_mgr.h
+++ b/src/common/layouts_mgr.h
@@ -189,7 +189,7 @@ entity_t* layouts_get_entity(const char* name);
  * Return SLURM_SUCCES or SLURM_ERROR in case of failure
  */
 int layouts_pack_layout(char *l_type, char *entities, char *type,
-			uint32_t no_relation, Buf buffer);
+			uint32_t flags, Buf buffer);
 
 /*
  * layouts_update_layout - update a particular layout loading the information
diff --git a/src/common/list.c b/src/common/list.c
index 17e4f40c7..edec8778d 100644
--- a/src/common/list.c
+++ b/src/common/list.c
@@ -1,7 +1,5 @@
 /*****************************************************************************
- *  $Id: list.c,v 1.28 2003/05/20 23:53:22 dun Exp $
- *****************************************************************************
- *  $LSDId: list.c,v 1.28 2003/05/20 23:53:22 dun Exp $
+ *  list.c
  *****************************************************************************
  *  Copyright (C) 2001-2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/list.h b/src/common/list.h
index 4bab6886a..75c99d3a5 100644
--- a/src/common/list.h
+++ b/src/common/list.h
@@ -1,7 +1,5 @@
 /*****************************************************************************
- *  $Id: list.h,v 1.14 2002/12/11 19:00:36 dun Exp $
- *****************************************************************************
- *  $LSDId: list.h,v 1.14 2002/12/11 19:00:36 dun Exp $
+ *  list.h
  *****************************************************************************
  *  Copyright (C) 2001-2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/log.c b/src/common/log.c
index 01652c18f..7f2c92030 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  log.c - slurm logging facilities
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -47,6 +46,9 @@
 /*
 ** MT safe
 */
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
 
 #if HAVE_CONFIG_H
 #  include "config.h"
@@ -92,6 +94,8 @@
 #  define LINEBUFSIZE 256
 #endif
 
+#define NAMELEN 16
+
 /*
 ** Define slurm-specific aliases for use by plugins, see slurm_xlator.h
 ** for details.
@@ -678,12 +682,18 @@ static void
 set_idbuf(char *idbuf)
 {
 	struct timeval now;
+	char thread_name[NAMELEN];
+	int max_len = 12; /* handles current longest thread name */
 
 	gettimeofday(&now, NULL);
+	if (pthread_getname_np(pthread_self(), thread_name, NAMELEN)) {
+		error("failed to get thread name: %m");
+		return;
+	}
 
-	sprintf(idbuf, "%.15s.%-6d %5d %p", slurm_ctime(&now.tv_sec) + 4,
-	        (int)now.tv_usec, (int)getpid(), (void *)pthread_self());
-
+	sprintf(idbuf, "%.15s.%-6d %5d %-*s %p", slurm_ctime(&now.tv_sec) + 4,
+		(int)now.tv_usec, (int)getpid(), max_len, thread_name,
+		(void *)pthread_self());
 }
 
 /* return a heap allocated string formed from fmt and ap arglist
@@ -973,7 +983,7 @@ static void log_msg(log_level_t level, const char *fmt, va_list args)
 
 	if (SCHED_LOG_INITIALIZED &&
 	    (sched_log->opt.logfile_level > LOG_LEVEL_QUIET) &&
-	    (strncmp(fmt, "sched: ", 7) == 0)) {
+	    (xstrncmp(fmt, "sched: ", 7) == 0)) {
 		buf = vxstrfmt(fmt, args);
 		xlogfmtcat(&msgbuf, "[%M] %s%s%s", sched_log->fpfx, pfx, buf);
 		_log_printf(sched_log, sched_log->fbuf, sched_log->logfp,
@@ -1052,8 +1062,8 @@ static void log_msg(log_level_t level, const char *fmt, va_list args)
 		if (log->fmt == LOG_FMT_THREAD_ID) {
 			char tmp[64];
 			set_idbuf(tmp);
-			_log_printf(log, log->buf, stderr, "%s %s: %s%s\n",
-			            tmp, log->argv0, pfx, buf);
+			_log_printf(log, log->buf, stderr, "%s: %s%s\n",
+			            tmp, pfx, buf);
 		} else {
 			_log_printf(log, log->buf, stderr, "%s: %s%s\n",
 			            log->argv0, pfx, buf);
diff --git a/src/common/macros.h b/src/common/macros.h
index 0b83726c4..cc9644a6c 100644
--- a/src/common/macros.h
+++ b/src/common/macros.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/common/macros.h - some standard macros for slurm
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -61,6 +60,7 @@
 #endif
 
 #include <errno.h>              /* for errno   */
+#include <stdlib.h>		/* for abort() */
 #include "src/common/log.h"	/* for error() */
 
 #ifndef FALSE
@@ -151,100 +151,79 @@
 #  define __NORETURN_ATTR			((void)0)
 #endif /* __GNUC__ */
 
-/* the following is taken directly from glib 2.0, with minor changes */
-
-/* Provide simple macro statement wrappers (adapted from Perl):
- *  _STMT_START { statements; } _STMT_END;
- *  can be used as a single statement, as in
- *  if (x) _STMT_START { ... } _STMT_END; else ...
- *
- *  For gcc we will wrap the statements within `({' and `})' braces.
- *  For SunOS they will be wrapped within `if (1)' and `else (void) 0',
- *  and otherwise within `do' and `while (0)'.
- */
-#if !(defined (_STMT_START) && defined (_STMT_END))
-#  if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
-#    define _STMT_START        (void)(
-#    define _STMT_END          )
-#  else
-#    if (defined (sun) || defined (__sun__))
-#      define _STMT_START      if (1)
-#      define _STMT_END        else (void)0
-#    else
-#      define _STMT_START      do
-#      define _STMT_END        while (0)
-#    endif
-#  endif
-#endif
-
 #ifdef WITH_PTHREADS
 
-#  define slurm_mutex_init(mutex)                                             \
-     _STMT_START {                                                            \
-         int err = pthread_mutex_init(mutex, NULL);                           \
-         if (err) {                                                           \
-             errno = err;                                                     \
-             error("%s:%d %s: pthread_mutex_init(): %m",                      \
-                   __FILE__, __LINE__, __CURRENT_FUNC__);                     \
-         }                                                                    \
-     } _STMT_END
-
-#  define slurm_mutex_destroy(mutex)                                          \
-     _STMT_START {                                                            \
-         int err = pthread_mutex_destroy(mutex);                              \
-         if (err) {                                                           \
-             errno = err;                                                     \
-             error("%s:%d %s: pthread_mutex_destroy(): %m",                   \
-                   __FILE__, __LINE__, __CURRENT_FUNC__);                     \
-         }                                                                    \
-     } _STMT_END
-
-#  define slurm_mutex_lock(mutex)                                             \
-     _STMT_START {                                                            \
-         int err = pthread_mutex_lock(mutex);                                 \
-         if (err) {                                                           \
-             errno = err;                                                     \
-             error("%s:%d %s: pthread_mutex_lock(): %m",                      \
-                   __FILE__, __LINE__, __CURRENT_FUNC__);                     \
-         }                                                                    \
-     } _STMT_END
-
-#  define slurm_mutex_unlock(mutex)                                           \
-     _STMT_START {                                                            \
-         int err = pthread_mutex_unlock(mutex);                               \
-         if (err) {                                                           \
-             errno = err;                                                     \
-             error("%s:%d %s: pthread_mutex_unlock(): %m",                    \
-                   __FILE__, __LINE__, __CURRENT_FUNC__);                     \
-         }                                                                    \
-     } _STMT_END
+#  define slurm_mutex_init(mutex)					\
+	do {								\
+		int err = pthread_mutex_init(mutex, NULL);		\
+		if (err) {						\
+			errno = err;					\
+			fatal("%s:%d %s: pthread_mutex_init(): %m",	\
+				__FILE__, __LINE__, __CURRENT_FUNC__);	\
+			abort();					\
+		}							\
+	} while (0)
+
+#  define slurm_mutex_destroy(mutex)					\
+	do {								\
+		int err = pthread_mutex_destroy(mutex);			\
+		if (err) {						\
+			errno = err;					\
+			fatal("%s:%d %s: pthread_mutex_destroy(): %m",	\
+				__FILE__, __LINE__, __CURRENT_FUNC__);	\
+			abort();					\
+		}							\
+	} while (0)
+
+#  define slurm_mutex_lock(mutex)					\
+	do {								\
+		int err = pthread_mutex_lock(mutex);			\
+		if (err) {						\
+			errno = err;					\
+			fatal("%s:%d %s: pthread_mutex_lock(): %m",	\
+				__FILE__, __LINE__, __CURRENT_FUNC__);	\
+			abort();					\
+		}							\
+	} while (0)
+
+#  define slurm_mutex_unlock(mutex)					\
+	do {								\
+		int err = pthread_mutex_unlock(mutex);			\
+		if (err) {						\
+			errno = err;					\
+			fatal("%s:%d %s: pthread_mutex_unlock(): %m",	\
+				__FILE__, __LINE__, __CURRENT_FUNC__);	\
+			abort();					\
+		}							\
+	} while (0)
 
 #  ifdef PTHREAD_SCOPE_SYSTEM
-#  define slurm_attr_init(attr)                                               \
-     _STMT_START {                                                            \
-	if (pthread_attr_init(attr))                                          \
-		fatal("pthread_attr_init: %m");                               \
-	/* we want 1:1 threads if there is a choice */                        \
-	if (pthread_attr_setscope(attr, PTHREAD_SCOPE_SYSTEM))                \
-		error("pthread_attr_setscope: %m");                           \
-	if (pthread_attr_setstacksize(attr, 1024*1024))                       \
-		error("pthread_attr_setstacksize: %m");                       \
-     } _STMT_END
+#  define slurm_attr_init(attr)						\
+	do {								\
+		if (pthread_attr_init(attr))				\
+			fatal("pthread_attr_init: %m");			\
+		/* we want 1:1 threads if there is a choice */		\
+		if (pthread_attr_setscope(attr, PTHREAD_SCOPE_SYSTEM))	\
+			error("pthread_attr_setscope: %m");		\
+		if (pthread_attr_setstacksize(attr, 1024*1024))		\
+			error("pthread_attr_setstacksize: %m");		\
+	 } while (0)
 #  else
-#  define slurm_attr_init(attr)                                               \
-     _STMT_START {                                                            \
-        if (pthread_attr_init(attr))                                          \
-                fatal("pthread_attr_init: %m");                               \
-        if (pthread_attr_setstacksize(attr, 1024*1024))                       \
-                error("pthread_attr_setstacksize: %m");                       \
-     } _STMT_END
+#  define slurm_attr_init(attr)						\
+	do {								\
+		if (pthread_attr_init(attr))				\
+			fatal("pthread_attr_init: %m");			\
+		if (pthread_attr_setstacksize(attr, 1024*1024))		\
+			error("pthread_attr_setstacksize: %m");		\
+	} while (0)
 #  endif
 
-#  define slurm_attr_destroy(attr)					      \
-     _STMT_START {                                                            \
-        if (pthread_attr_destroy(attr))                                       \
-             error("pthread_attr_destroy failed, possible memory leak!: %m"); \
-     } _STMT_END
+#  define slurm_attr_destroy(attr)					\
+	do {								\
+		if (pthread_attr_destroy(attr))				\
+			error("pthread_attr_destroy failed, "		\
+				"possible memory leak!: %m");		\
+	} while (0)
 
 #else /* !WITH_PTHREADS */
 
@@ -280,7 +259,7 @@
 /* Results strftime() are undefined if buffer too small
  * This variant returns a string of "####"... instead */
 #define slurm_strftime(s, max, format, tm)				\
-_STMT_START {								\
+do {									\
 	if (max > 0) {							\
 		char tmp_string[(max<256?256:max+1)];			\
 		if (strftime(tmp_string, sizeof(tmp_string), format, tm) == 0) \
@@ -288,7 +267,7 @@ _STMT_START {								\
 		tmp_string[max-1] = 0;					\
 		strncpy(s, tmp_string, max);				\
 	}								\
-} _STMT_END
+} while (0)
 
 /* There are places where we put NO_VAL or INFINITE into a float or double
  * Use fuzzy_equal below to test for those values rather than an comparision
diff --git a/src/common/mapping.h b/src/common/mapping.h
index 957f4804a..755e55dec 100644
--- a/src/common/mapping.h
+++ b/src/common/mapping.h
@@ -49,8 +49,6 @@
 #include "src/common/xstring.h"
 #include "src/common/xassert.h"
 
-BEGIN_C_DECLS
-
 extern char *pack_process_mapping(uint32_t node_cnt,
 				  uint32_t task_cnt,
 				  uint16_t *tasks,
@@ -65,6 +63,4 @@ extern int unpack_process_mapping(char *map,
 				  uint16_t *tasks,
 				  uint32_t **tids);
 
-END_C_DECLS
-
 #endif // MAPPING_H
diff --git a/src/common/mpi.c b/src/common/mpi.c
index a87cf2aac..a31ffb5d5 100644
--- a/src/common/mpi.c
+++ b/src/common/mpi.c
@@ -111,7 +111,7 @@ int _mpi_init (char *mpi_type)
 		goto done;
 	}
 
-	if (!strcmp(mpi_type, "list")) {
+	if (!xstrcmp(mpi_type, "list")) {
 		char *plugin_dir;
 		plugrack_t mpi_rack;
 
diff --git a/src/common/node_conf.c b/src/common/node_conf.c
index 53b8eaca7..2937c6704 100644
--- a/src/common/node_conf.c
+++ b/src/common/node_conf.c
@@ -8,6 +8,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
+ *  Copyright (C) 2010-2016 SchedMD LLC.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov> et. al.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -81,17 +82,15 @@
 
 /* Global variables */
 List config_list  = NULL;	/* list of config_record entries */
-List feature_list = NULL;	/* list of features_record entries */
 List front_end_list = NULL;	/* list of slurm_conf_frontend_t entries */
 time_t last_node_update = (time_t) 0;	/* time of last update */
 struct node_record *node_record_table_ptr = NULL;	/* node records */
 xhash_t* node_hash_table = NULL;
 int node_record_count = 0;		/* count in node_record_table_ptr */
-
 uint16_t *cr_node_num_cores = NULL;
 uint32_t *cr_node_cores_offset = NULL;
 
-static void	_add_config_feature(char *feature, bitstr_t *node_bitmap);
+/* Local function defiitions */
 static int	_build_single_nodeline_info(slurm_conf_node_t *node_ptr,
 					    struct config_record *config_ptr);
 static int	_delete_config_record (void);
@@ -103,38 +102,7 @@ static struct node_record *
 static struct node_record *
 		_find_node_record (char *name,bool test_alias,bool log_missing);
 static void	_list_delete_config (void *config_entry);
-static void	_list_delete_feature (void *feature_entry);
 static int	_list_find_config (void *config_entry, void *key);
-static int	_list_find_feature (void *feature_entry, void *key);
-
-
-static void _add_config_feature(char *feature, bitstr_t *node_bitmap)
-{
-	struct features_record *feature_ptr;
-	ListIterator feature_iter;
-	bool match = false;
-
-	/* If feature already exists in feature_list, just update the bitmap */
-	feature_iter = list_iterator_create(feature_list);
-	while ((feature_ptr = (struct features_record *)
-			list_next(feature_iter))) {
-		if (strcmp(feature, feature_ptr->name))
-			continue;
-		bit_or(feature_ptr->node_bitmap, node_bitmap);
-		match = true;
-		break;
-	}
-	list_iterator_destroy(feature_iter);
-
-	if (!match) {	/* Need to create new feature_list record */
-		feature_ptr = xmalloc(sizeof(struct features_record));
-		feature_ptr->magic = FEATURE_MAGIC;
-		feature_ptr->name = xstrdup(feature);
-		feature_ptr->node_bitmap = bit_copy(node_bitmap);
-		list_append(feature_list, feature_ptr);
-	}
-}
-
 
 /*
  * _build_single_nodeline_info - From the slurm.conf reader, build table,
@@ -317,9 +285,8 @@ cleanup:
 static int _delete_config_record (void)
 {
 	last_node_update = time (NULL);
-	(void) list_delete_all (config_list,    &_list_find_config,  NULL);
-	(void) list_delete_all (feature_list,   &_list_find_feature, NULL);
-	(void) list_delete_all (front_end_list, &list_find_frontend, NULL);
+	(void) list_delete_all(config_list,    &_list_find_config,  NULL);
+	(void) list_delete_all(front_end_list, &list_find_frontend, NULL);
 	return SLURM_SUCCESS;
 }
 
@@ -397,7 +364,7 @@ static struct node_record *_find_alias_node_record(char *name, bool log_missing)
 	/* revert to sequential search */
 	else {
 		for (i = 0; i < node_record_count; i++) {
-			if (!strcmp (alias, node_record_table_ptr[i].name)) {
+			if (!xstrcmp (alias, node_record_table_ptr[i].name)) {
 				xfree(alias);
 				return (&node_record_table_ptr[i]);
 			}
@@ -420,26 +387,11 @@ static void _list_delete_config (void *config_entry)
 	xfree(config_ptr->cpu_spec_list);
 	xfree(config_ptr->feature);
 	xfree(config_ptr->gres);
-	build_config_feature_list(config_ptr);
 	xfree (config_ptr->nodes);
 	FREE_NULL_BITMAP (config_ptr->node_bitmap);
 	xfree (config_ptr);
 }
 
-/* _list_delete_feature - delete an entry from the feature list,
- *	see list.h for documentation */
-static void _list_delete_feature (void *feature_entry)
-{
-	struct features_record *feature_ptr = (struct features_record *)
-					     feature_entry;
-
-	xassert(feature_ptr);
-	xassert(feature_ptr->magic == FEATURE_MAGIC);
-	xfree (feature_ptr->name);
-	FREE_NULL_BITMAP (feature_ptr->node_bitmap);
-	xfree (feature_ptr);
-}
-
 /*
  * _list_find_config - find an entry in the config list, see list.h for
  *	documentation
@@ -522,25 +474,6 @@ char * bitmap2node_name (bitstr_t *bitmap)
 	return bitmap2node_name_sortable(bitmap, 1);
 }
 
-/*
- * _list_find_feature - find an entry in the feature list, see list.h for
- *	documentation
- * IN key - is feature name or NULL for all features
- * RET 1 if found, 0 otherwise
- */
-static int _list_find_feature (void *feature_entry, void *key)
-{
-	struct features_record *feature_ptr;
-
-	if (key == NULL)
-		return 1;
-
-	feature_ptr = (struct features_record *) feature_entry;
-	if (strcmp(feature_ptr->name, (char *) key) == 0)
-		return 1;
-	return 0;
-}
-
 #ifdef HAVE_FRONT_END
 /* Log the contents of a frontend record */
 static void _dump_front_end(slurm_conf_frontend_t *fe_ptr)
@@ -691,44 +624,6 @@ extern int build_all_nodeline_info (bool set_bitmap)
 	return max_rc;
 }
 
-/* Given a config_record with it's bitmap already set, update feature_list */
-extern void  build_config_feature_list(struct config_record *config_ptr)
-{
-	struct features_record *feature_ptr;
-	ListIterator feature_iter;
-	int i, j;
-	char *tmp_str, *token, *last = NULL;
-
-	/* Clear these nodes from the feature_list record,
-	 * then restore as needed */
-	feature_iter = list_iterator_create(feature_list);
-	bit_not(config_ptr->node_bitmap);
-	while ((feature_ptr = (struct features_record *)
-			list_next(feature_iter))) {
-		bit_and(feature_ptr->node_bitmap, config_ptr->node_bitmap);
-	}
-	list_iterator_destroy(feature_iter);
-	bit_not(config_ptr->node_bitmap);
-
-	if (config_ptr->feature) {
-		i = strlen(config_ptr->feature) + 1;	/* oversized */
-		tmp_str = xmalloc(i);
-		/* Remove white space from feature specification */
-		for (i=0, j=0; config_ptr->feature[i]; i++) {
-			if (!isspace((int)config_ptr->feature[i]))
-				tmp_str[j++] = config_ptr->feature[i];
-		}
-		if (i != j)
-			strcpy(config_ptr->feature, tmp_str);
-		token = strtok_r(tmp_str, ",", &last);
-		while (token) {
-			_add_config_feature(token, config_ptr->node_bitmap);
-			token = strtok_r(NULL, ",", &last);
-		}
-		xfree(tmp_str);
-	}
-}
-
 /*
  * create_config_record - create a config_record entry and set is values to
  *	the defaults. each config record corresponds to a line in the
@@ -808,6 +703,7 @@ extern struct node_record *create_node_record (
 	node_ptr->energy = acct_gather_energy_alloc(1);
 	node_ptr->ext_sensors = ext_sensors_alloc();
 	node_ptr->owner = NO_VAL;
+	node_ptr->mcs_label = NULL;
 	node_ptr->protocol_version = SLURM_MIN_PROTOCOL_VERSION;
 	xassert (node_ptr->magic = NODE_MAGIC)  /* set value */;
 	return node_ptr;
@@ -875,7 +771,7 @@ static struct node_record *_find_node_record (char *name, bool test_alias,
 		}
 
 		if ((node_record_count == 1) &&
-		    (strcmp(node_record_table_ptr[0].name, "localhost") == 0))
+		    (xstrcmp(node_record_table_ptr[0].name, "localhost") == 0))
 			return (&node_record_table_ptr[0]);
 
 		if (log_missing)
@@ -884,7 +780,7 @@ static struct node_record *_find_node_record (char *name, bool test_alias,
 	/* revert to sequential search */
 	else {
 		for (i = 0; i < node_record_count; i++) {
-			if (!strcmp (name, node_record_table_ptr[i].name)) {
+			if (!xstrcmp (name, node_record_table_ptr[i].name)) {
 				return (&node_record_table_ptr[i]);
 			}
 		}
@@ -931,7 +827,6 @@ extern int init_node_conf (void)
 		(void) _delete_config_record ();
 	else {
 		config_list    = list_create (_list_delete_config);
-		feature_list   = list_create (_list_delete_feature);
 		front_end_list = list_create (destroy_frontend);
 	}
 
@@ -947,7 +842,6 @@ extern void node_fini2 (void)
 
 	if (config_list) {
 		FREE_NULL_LIST(config_list);
-		FREE_NULL_LIST(feature_list);
 		FREE_NULL_LIST(front_end_list);
 	}
 
@@ -1059,6 +953,7 @@ extern void purge_node_rec (struct node_record *node_ptr)
 	xfree(node_ptr->comm_name);
 	xfree(node_ptr->cpu_spec_list);
 	xfree(node_ptr->features);
+	xfree(node_ptr->features_act);
 	xfree(node_ptr->gres);
 	FREE_NULL_LIST(node_ptr->gres_list);
 	xfree(node_ptr->name);
@@ -1109,9 +1004,9 @@ extern int state_str2int(const char *state_str, char *node_name)
 	int i;
 
 	for (i = 0; i <= NODE_STATE_END; i++) {
-		if (strcasecmp(node_state_string(i), "END") == 0)
+		if (xstrcasecmp(node_state_string(i), "END") == 0)
 			break;
-		if (strcasecmp(node_state_string(i), state_str) == 0) {
+		if (xstrcasecmp(node_state_string(i), state_str) == 0) {
 			state_val = i;
 			break;
 		}
diff --git a/src/common/node_conf.h b/src/common/node_conf.h
index c43cb79f3..ee9831678 100644
--- a/src/common/node_conf.h
+++ b/src/common/node_conf.h
@@ -4,6 +4,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
+ *  Copyright (C) 2010-2016 SchedMD LLC.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov> et. al.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -62,7 +63,6 @@
 #include "src/common/xhash.h"
 
 #define CONFIG_MAGIC	0xc065eded
-#define FEATURE_MAGIC	0x34dfd8b5
 #define NODE_MAGIC	0x0de575ed
 
 struct config_record {
@@ -88,13 +88,6 @@ extern List config_list;	/* list of config_record entries */
 
 extern List front_end_list;	/* list of slurm_conf_frontend_t entries */
 
-struct features_record {
-	uint32_t magic;		/* magic cookie to test data integrity */
-	char *name;		/* name of a feature */
-	bitstr_t *node_bitmap;	/* bitmap of nodes with this feature */
-};
-extern List feature_list;	/* list of features_record entries */
-
 struct node_record {
 	uint32_t magic;			/* magic cookie for data integrity */
 	char *name;			/* name of the node. NULL==defunct */
@@ -137,7 +130,10 @@ struct node_record {
 					 * set, ignore if no reason is set. */
 	uint32_t reason_uid;		/* User that set the reason, ignore if
 					 * no reason is set. */
-	char *features;			/* node's features, used only
+	char *features;			/* node's available features, used only
+					 * for state save/restore, DO NOT
+					 * use for scheduling purposes */
+	char *features_act;		/* node's active features, used only
 					 * for state save/restore, DO NOT
 					 * use for scheduling purposes */
 	char *gres;			/* node's generic resources, used only
@@ -178,6 +174,7 @@ struct node_record {
 	char *tres_str;                 /* tres this node has */
 	char *tres_fmt_str;		/* tres this node has */
 	uint64_t *tres_cnt;		/* tres this node has. NO_PACK*/
+	char *mcs_label;		/* mcs_label if mcs plugin in use */
 };
 extern struct node_record *node_record_table_ptr;  /* ptr to node records */
 extern int node_record_count;		/* count in node_record_table_ptr */
@@ -234,9 +231,6 @@ extern int build_all_nodeline_info (bool set_bitmap);
  */
 extern int build_all_frontend_info (bool is_slurmd_context);
 
-/* Given a config_record with it's bitmap already set, update feature_list */
-extern void  build_config_feature_list (struct config_record *config_ptr);
-
 /*
  * create_config_record - create a config_record entry and set is values to
  *	the defaults. each config record corresponds to a line in the
diff --git a/src/common/node_features.c b/src/common/node_features.c
new file mode 100644
index 000000000..8750834ac
--- /dev/null
+++ b/src/common/node_features.c
@@ -0,0 +1,421 @@
+/*****************************************************************************\
+ *  node_features.c - Infrastructure for changing a node's features on user
+ *	demand
+ *****************************************************************************
+ *  Copyright (C) 2015 SchedMD LLC.
+ *  Written by Morris Jette <jette@schedmd.com>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#  if STDC_HEADERS
+#    include <string.h>
+#  endif
+#  if HAVE_SYS_TYPES_H
+#    include <sys/types.h>
+#  endif /* HAVE_SYS_TYPES_H */
+#  if HAVE_UNISTD_H
+#    include <unistd.h>
+#  endif
+#  if HAVE_INTTYPES_H
+#    include <inttypes.h>
+#  else /* ! HAVE_INTTYPES_H */
+#    if HAVE_STDINT_H
+#      include <stdint.h>
+#    endif
+#  endif /* HAVE_INTTYPES_H */
+#else /* ! HAVE_CONFIG_H */
+#  include <sys/types.h>
+#  include <unistd.h>
+#  include <stdint.h>
+#  include <string.h>
+#endif /* HAVE_CONFIG_H */
+
+#include "slurm/slurm.h"
+#include "src/common/macros.h"
+#include "src/common/node_features.h"
+#include "src/common/plugin.h"
+#include "src/common/read_config.h"
+#include "src/common/slurm_protocol_api.h"
+#include "src/common/timers.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
+
+/*
+ * WARNING:  Do not change the order of these fields or add additional
+ * fields at the beginning of the structure.  If you do, this plugins will stop
+ * working.  If you need to add fields, add them to the end of the structure.
+ */
+typedef struct node_features_ops {
+	int	(*get_node)	(char *node_list);
+	int	(*job_valid)	(char *job_features);
+	char *	(*job_xlate)	(char *job_features);
+	bool	(*node_power)	(void);
+	bool	(*node_reboot)	(void);
+	void	(*node_state)	(char **avail_modes, char **current_mode);
+	int	(*node_update)	(char *active_features, bitstr_t *node_bitmap);
+	char *	(*node_xlate)	(char *new_features, char *orig_features);
+	int	(*reconfig)	(void);
+	bool	(*user_update)	(uid_t uid);
+} node_features_ops_t;
+
+/*
+ * These strings must be kept in the same order as the fields
+ * declared for node_features_ops_t.
+ */
+static const char *syms[] = {
+	"node_features_p_get_node",
+	"node_features_p_job_valid",
+	"node_features_p_job_xlate",
+	"node_features_p_node_power",
+	"node_features_p_node_reboot",
+	"node_features_p_node_state",
+	"node_features_p_node_update",
+	"node_features_p_node_xlate",
+	"node_features_p_reconfig",
+	"node_features_p_user_update"
+};
+
+static int g_context_cnt = -1;
+static node_features_ops_t *ops = NULL;
+static plugin_context_t **g_context = NULL;
+static pthread_mutex_t g_context_lock = PTHREAD_MUTEX_INITIALIZER;
+static char *node_features_plugin_list = NULL;
+static bool init_run = false;
+
+/* Perform plugin initialization: read configuration files, etc. */
+extern int node_features_g_init(void)
+{
+	int rc = SLURM_SUCCESS;
+	char *last = NULL, *names;
+	char *plugin_type = "node_features";
+	char *type;
+
+	if (init_run && (g_context_cnt >= 0))
+		return rc;
+
+	slurm_mutex_lock(&g_context_lock);
+	if (g_context_cnt >= 0)
+		goto fini;
+
+	node_features_plugin_list = slurm_get_node_features_plugins();
+	g_context_cnt = 0;
+	if ((node_features_plugin_list == NULL) ||
+	    (node_features_plugin_list[0] == '\0'))
+		goto fini;
+
+	names = node_features_plugin_list;
+	while ((type = strtok_r(names, ",", &last))) {
+		xrealloc(ops,
+			 (sizeof(node_features_ops_t) * (g_context_cnt + 1)));
+		xrealloc(g_context,
+			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
+		if (xstrncmp(type, "node_features/", 14) == 0)
+			type += 14; /* backward compatibility */
+		type = xstrdup_printf("node_features/%s", type);
+		g_context[g_context_cnt] = plugin_context_create(
+			plugin_type, type, (void **)&ops[g_context_cnt],
+			syms, sizeof(syms));
+		if (!g_context[g_context_cnt]) {
+			error("cannot create %s context for %s",
+			      plugin_type, type);
+			rc = SLURM_ERROR;
+			xfree(type);
+			break;
+		}
+
+		xfree(type);
+		g_context_cnt++;
+		names = NULL; /* for next strtok_r() iteration */
+	}
+	init_run = true;
+
+fini:
+	slurm_mutex_unlock(&g_context_lock);
+
+	if (rc != SLURM_SUCCESS)
+		node_features_g_fini();
+
+	return rc;
+}
+
+/* Perform plugin termination: save state, free memory, etc. */
+extern int node_features_g_fini(void)
+{
+	int i, j, rc = SLURM_SUCCESS;
+
+	slurm_mutex_lock(&g_context_lock);
+	if (g_context_cnt < 0)
+		goto fini;
+
+	init_run = false;
+	for (i = 0; i < g_context_cnt; i++) {
+		if (g_context[i]) {
+			j = plugin_context_destroy(g_context[i]);
+			if (j != SLURM_SUCCESS)
+				rc = j;
+		}
+	}
+	xfree(ops);
+	xfree(g_context);
+	xfree(node_features_plugin_list);
+	g_context_cnt = -1;
+
+fini:	slurm_mutex_unlock(&g_context_lock);
+	return rc;
+}
+
+/* Return count of node_feature plugins configured */
+extern int node_features_g_count(void)
+{
+	int rc;
+
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	rc = g_context_cnt;
+	slurm_mutex_unlock(&g_context_lock);
+
+	return rc;
+}
+
+/* Reset plugin configuration information */
+extern int node_features_g_reconfig(void)
+{
+	DEF_TIMERS;
+	int i, rc;
+
+	START_TIMER;
+	rc = node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
+		rc = (*(ops[i].reconfig))();
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_reconfig");
+
+	return rc;
+}
+
+/* Update active and available features on specified nodes, sets features on
+ * all nodes is node_list is NULL */
+extern int node_features_g_get_node(char *node_list)
+{
+	DEF_TIMERS;
+	int i, rc;
+
+	START_TIMER;
+	rc = node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
+		rc = (*(ops[i].get_node))(node_list);
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_get_node");
+
+	return rc;
+}
+
+/* Test if a job's feature specification is valid */
+extern int node_features_g_job_valid(char *job_features)
+{
+	DEF_TIMERS;
+	int i, rc;
+
+	START_TIMER;
+	rc = node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++)
+		rc = (*(ops[i].job_valid))(job_features);
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_job_valid");
+
+	return rc;
+}
+
+/* Translate a job's feature specification to node boot options
+ * RET node boot options, must be xfreed */
+extern char *node_features_g_job_xlate(char *job_features)
+{
+	DEF_TIMERS;
+	char *node_features = NULL, *tmp_str;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; i < g_context_cnt; i++) {
+		tmp_str = (*(ops[i].job_xlate))(job_features);
+		if (tmp_str) {
+			if (node_features) {
+				xstrfmtcat(node_features, ",%s", tmp_str);
+				xfree(tmp_str);
+			} else {
+				node_features = tmp_str;
+			}
+		}
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_job_xlate");
+
+	return node_features;
+}
+
+/* Return true if the plugin requires PowerSave mode for booting nodes */
+extern bool node_features_g_node_power(void)
+{
+	DEF_TIMERS;
+	bool node_power = false;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; i < g_context_cnt; i++) {
+		node_power = (*(ops[i].node_power))();
+		if (node_power)
+			break;
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_node_power");
+
+	return node_power;
+}
+
+/* Return true if the plugin requires RebootProgram for booting nodes */
+extern bool node_features_g_node_reboot(void)
+{
+	DEF_TIMERS;
+	bool node_reboot = false;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; i < g_context_cnt; i++) {
+		node_reboot = (*(ops[i].node_reboot))();
+		if (node_reboot)
+			break;
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_node_reboot");
+
+	return node_reboot;
+}
+
+/* Get this node's current and available MCDRAM and NUMA settings from BIOS.
+ * avail_modes IN/OUT - available modes, must be xfreed
+ * current_mode IN/OUT - current modes, must be xfreed */
+extern void node_features_g_node_state(char **avail_modes, char **current_mode)
+{
+	DEF_TIMERS;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; i < g_context_cnt; i++) {
+		(*(ops[i].node_state))(avail_modes, current_mode);
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_node_state");
+}
+
+/* Note the active features associated with a set of nodes have been updated.
+ * Specifically update the node's "hbm" GRES value as needed.
+ * IN active_features - New active features
+ * IN node_bitmap - bitmap of nodes changed
+ * RET error code */
+extern int node_features_g_node_update(char *active_features,
+				       bitstr_t *node_bitmap)
+{
+	DEF_TIMERS;
+	int i, rc = SLURM_SUCCESS;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; ((i < g_context_cnt) && (rc == SLURM_SUCCESS)); i++) {
+		rc = (*(ops[i].node_update))(active_features, node_bitmap);
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_node_update");
+
+	return rc;
+}
+
+/* Translate a node's feature specification by replacing any features associated
+ * with this plugin in the original value with the new values, preserving any
+ * features that are not associated with this plugin
+ * RET node's new merged features, must be xfreed */
+extern char *node_features_g_node_xlate(char *new_features, char *orig_features)
+{
+	DEF_TIMERS;
+	char *new_value = NULL, *tmp_str;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; i < g_context_cnt; i++) {
+		if (new_value)
+			tmp_str = new_value;
+		else if (orig_features)
+			tmp_str = xstrdup(orig_features);
+		else
+			tmp_str = NULL;
+		new_value = (*(ops[i].node_xlate))(new_features, tmp_str);
+		xfree(tmp_str);
+
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_node_xlate");
+
+	return new_value;
+}
+
+/* Determine if the specified user can modify the currently available node
+ * features */
+extern bool node_features_g_user_update(uid_t uid)
+{
+	DEF_TIMERS;
+	bool result = true;
+	int i;
+
+	START_TIMER;
+	(void) node_features_g_init();
+	slurm_mutex_lock(&g_context_lock);
+	for (i = 0; ((i < g_context_cnt) && (result == true)); i++) {
+		result = (*(ops[i].user_update))(uid);
+	}
+	slurm_mutex_unlock(&g_context_lock);
+	END_TIMER2("node_features_g_user_update");
+
+	return result;
+}
diff --git a/src/common/node_features.h b/src/common/node_features.h
new file mode 100644
index 000000000..e3fb012a5
--- /dev/null
+++ b/src/common/node_features.h
@@ -0,0 +1,96 @@
+/*****************************************************************************\
+ *  node_features.h - Infrastructure for changing a node's features on user
+ *	demand
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *  Written by Morris Jette <jette@schedmd.com>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifndef _NODE_FEATURES_H
+#define _NODE_FEATURES_H
+
+#include "slurm/slurm.h"
+#include "src/common/bitstring.h"
+
+/* Perform plugin initialization: read configuration files, etc. */
+extern int node_features_g_init(void);
+
+/* Perform plugin termination: save state, free memory, etc. */
+extern int node_features_g_fini(void);
+
+/* Return count of node_feature plugins configured */
+extern int node_features_g_count(void);
+
+/* Reset plugin configuration information */
+extern int node_features_g_reconfig(void);
+
+/* Update active and available features on specified nodes, sets features on
+ * all nodes is node_list is NULL */
+extern int node_features_g_get_node(char *node_list);
+
+/* Test if a job's feature specification is valid */
+extern int node_features_g_job_valid(char *job_features);
+
+/* Translate a job's feature specification to node boot options
+ * RET node boot options, must be xfreed */
+extern char *node_features_g_job_xlate(char *job_features);
+
+/* Return true if the plugin requires RebootProgram for booting nodes */
+extern bool node_features_g_node_reboot(void);
+
+/* Return true if the plugin requires PowerSave mode for booting nodes */
+extern bool node_features_g_node_power(void);
+
+/* Get this node's current and available MCDRAM and NUMA settings from BIOS.
+ * avail_modes IN/OUT - available modes, must be xfreed
+ * current_mode IN/OUT - current modes, must be xfreed */
+extern void node_features_g_node_state(char **avail_modes, char **current_mode);
+
+/* Note the active features associated with a set of nodes have been updated.
+ * Specifically update the node's "hbm" GRES value as needed.
+ * IN active_features - New active features
+ * IN node_bitmap - bitmap of nodes changed
+ * RET error code */
+extern int node_features_g_node_update(char *active_features,
+				       bitstr_t *node_bitmap);
+
+/* Translate a node's feature specification by replacing any features associated
+ * with this plugin in the original value with the new values, preserving any
+ * features that are not associated with this plugin
+ * RET node's new merged features, must be xfreed */
+extern char *node_features_g_node_xlate(char *new_features,char *orig_features);
+
+/* Determine if the specified user can modify the currently available node
+ * features */
+extern bool node_features_g_user_update(uid_t uid);
+
+#endif /* !_NODE_FEATURES_H */
diff --git a/src/common/node_select.c b/src/common/node_select.c
index bc7cb74cd..84906bdeb 100644
--- a/src/common/node_select.c
+++ b/src/common/node_select.c
@@ -211,12 +211,12 @@ extern int slurm_select_init(bool only_default)
 		/* just ignore warnings here */
 	} else {
 #ifdef HAVE_BG
-		if (strcasecmp(type, "select/bluegene")) {
+		if (xstrcasecmp(type, "select/bluegene")) {
 			error("%s is incompatible with BlueGene", type);
 			fatal("Use SelectType=select/bluegene");
 		}
 #else
-		if (!strcasecmp(type, "select/bluegene")) {
+		if (!xstrcasecmp(type, "select/bluegene")) {
 			fatal("Requested SelectType=select/bluegene "
 			      "in slurm.conf, but not running on a BG[L|P|Q] "
 			      "system.  If looking to emulate a BG[L|P|Q] "
@@ -226,13 +226,13 @@ extern int slurm_select_init(bool only_default)
 #endif
 
 #ifdef HAVE_ALPS_CRAY
-		if (strcasecmp(type, "select/alps")) {
+		if (xstrcasecmp(type, "select/alps")) {
 			error("%s is incompatible with Cray system "
 			      "running alps", type);
 			fatal("Use SelectType=select/alps");
 		}
 #else
-		if (!strcasecmp(type, "select/alps")) {
+		if (!xstrcasecmp(type, "select/alps")) {
 			fatal("Requested SelectType=select/alps "
 			      "in slurm.conf, but not running on a ALPS Cray "
 			      "system.  If looking to emulate a Alps Cray "
@@ -241,13 +241,13 @@ extern int slurm_select_init(bool only_default)
 #endif
 
 #ifdef HAVE_NATIVE_CRAY
-		if (strcasecmp(type, "select/cray")) {
+		if (xstrcasecmp(type, "select/cray")) {
 			error("%s is incompatible with a native Cray system.",
 			      type);
 			fatal("Use SelectType=select/cray");
 		}
 #else
-		/* if (!strcasecmp(type, "select/cray")) { */
+		/* if (!xstrcasecmp(type, "select/cray")) { */
 		/* 	fatal("Requested SelectType=select/cray " */
 		/* 	      "in slurm.conf, but not running on a native Cray " */
 		/* 	      "system.  If looking to run on a Cray " */
@@ -295,7 +295,7 @@ extern int slurm_select_init(bool only_default)
 			if (!(e = readdir( dirp )))
 				break;
 			/* Check only files with select_ in them. */
-			if (strncmp(e->d_name, "select_", 7))
+			if (xstrncmp(e->d_name, "select_", 7))
 				continue;
 
 			len = strlen(e->d_name);
@@ -305,7 +305,7 @@ extern int slurm_select_init(bool only_default)
 			len -= 3;
 #endif
 			/* Check only shared object files */
-			if (strcmp(e->d_name+len,
+			if (xstrcmp(e->d_name+len,
 #if defined(__CYGWIN__)
 				   ".dll"
 #else
@@ -318,8 +318,8 @@ extern int slurm_select_init(bool only_default)
 			xassert(len<sizeof(full_name));
 			snprintf(full_name, len, "select/%s", e->d_name+7);
 			for (j=0; j<select_context_cnt; j++) {
-				if (!strcmp(full_name,
-					    select_context[j]->type))
+				if (!xstrcmp(full_name,
+					     select_context[j]->type))
 					break;
 			}
 			if (j >= select_context_cnt) {
@@ -339,7 +339,7 @@ extern int slurm_select_init(bool only_default)
 						sizeof(node_select_syms));
 				if (select_context[select_context_cnt]) {
 					/* set the default */
-					if (!strcmp(full_name, type))
+					if (!xstrcmp(full_name, type))
 						select_context_default =
 							select_context_cnt;
 					select_context_cnt++;
@@ -768,14 +768,16 @@ extern int select_g_step_start(struct step_record *step_ptr)
 /*
  * clear what happened in select_g_step_pick_nodes
  * IN/OUT step_ptr - Flush the resources from the job and step.
+ * IN killing_step - if true then we are just starting to kill the step
+ *                   if false, the step is completely terminated
  */
-extern int select_g_step_finish(struct step_record *step_ptr)
+extern int select_g_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	if (slurm_select_init(0) < 0)
 		return SLURM_ERROR;
 
 	return (*(ops[select_context_default].step_finish))
-		(step_ptr);
+		(step_ptr, killing_step);
 }
 
 extern int select_g_pack_select_info(time_t last_query_time,
diff --git a/src/common/node_select.h b/src/common/node_select.h
index 25f8ed953..d68207101 100644
--- a/src/common/node_select.h
+++ b/src/common/node_select.h
@@ -167,7 +167,8 @@ typedef struct slurm_select_ops {
 						 uint32_t node_count,
 						 bitstr_t **avail_nodes);
 	int             (*step_start)           (struct step_record *step_ptr);
-	int             (*step_finish)          (struct step_record *step_ptr);
+	int             (*step_finish)          (struct step_record *step_ptr,
+						 bool killing_step);
 	int		(*pack_select_info)	(time_t last_query_time,
 						 uint16_t show_flags,
 						 Buf *buffer_ptr,
@@ -679,8 +680,10 @@ extern int select_g_step_start(struct step_record *step_ptr);
 /*
  * clear what happened in select_g_step_pick_nodes and/or select_g_step_start
  * IN/OUT step_ptr - step pointer to operate on.
+ * IN killing_step - if true then we are just starting to kill the step
+ *                   if false, the step is completely terminated
  */
-extern int select_g_step_finish(struct step_record *step_ptr);
+extern int select_g_step_finish(struct step_record *step_ptr, bool killing_step);
 
 /*********************************\
  * ADVANCE RESERVATION FUNCTIONS *
diff --git a/src/common/optz.c b/src/common/optz.c
index cc39b68f8..eb7e3c135 100644
--- a/src/common/optz.c
+++ b/src/common/optz.c
@@ -45,6 +45,7 @@
 
 #include "src/common/optz.h"
 #include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
 
 static const struct option opt_table_end = { NULL, 0, NULL, 0 };
 
@@ -68,7 +69,7 @@ int optz_add(struct option **optz, const struct option *opt)
 	struct option *t = *optz;
 
 	for (; op->name != NULL; op++) {
-		if (strcmp(op->name, opt->name) == 0)
+		if (xstrcmp(op->name, opt->name) == 0)
 			slurm_seterrno_ret(EEXIST);
 		len++;
 	}
diff --git a/src/common/parse_config.c b/src/common/parse_config.c
index c9cc8f015..8bb15b7e0 100644
--- a/src/common/parse_config.c
+++ b/src/common/parse_config.c
@@ -158,7 +158,7 @@ static s_p_values_t *_conf_hashtbl_lookup(
 
 	idx = _conf_hashtbl_index(key);
 	for (p = hashtbl[idx]; p != NULL; p = p->next) {
-		if (strcasecmp(p->key, key) == 0)
+		if (xstrcasecmp(p->key, key) == 0)
 			return p;
 	}
 	return NULL;
@@ -1085,8 +1085,8 @@ static char *_parse_for_format(s_p_hashtbl_t *f_hashtbl, char *path)
 			_slurm_set_addr_char(&ip_addr, 0, hostname);
 			_slurm_print_slurm_addr(&ip_addr, ip_str,
 						sizeof(ip_str));
-			if (!strncmp(ip_str, "127.0.0.1", 9) ||
-			    !strncmp(ip_str, "127.0.1.1", 9)) {
+			if (!xstrncmp(ip_str, "127.0.0.1", 9) ||
+			    !xstrncmp(ip_str, "127.0.1.1", 9)) {
 				/* Got address for loopback */
 				error("%s: Could not get unique IP address for "
 				      "include path (hostname=%s)",
@@ -1570,8 +1570,9 @@ static int _parse_expline_doexpand(s_p_hashtbl_t** tables,
 				   int tables_count,
 				   s_p_values_t* item)
 {
-	hostlist_t item_hl;
+	hostlist_t item_hl, sub_item_hl;
 	int item_count, i;
+	int j, items_per_record, items_idx = 0;
 	char* item_str = NULL;
 
 	xassert(item);
@@ -1588,7 +1589,7 @@ static int _parse_expline_doexpand(s_p_hashtbl_t** tables,
 			if (!s_p_parse_pair(tables[i],
 					    item->key,
 					    item->data)) {
-				error("Error parsing %s = %s.",
+				error("parsing %s=%s.",
 				      item->key, (char*)item->data);
 				return 0;
 			}
@@ -1596,25 +1597,72 @@ static int _parse_expline_doexpand(s_p_hashtbl_t** tables,
 		return 1;
 	}
 
-	/* not a plain string in the original s_p_options_t, a temporary
+	/*
+	 * Not a plain string in the original s_p_options_t, a temporary
 	 * hostlist has been generated, parse each expanded value using
-	 * s_p_parse_pair() mapping it to the right master key table */
+	 * s_p_parse_pair() mapping it to the right master key table.
+	 *
+	 * If the number of expanded value is less than the number of
+	 * key tables, cycle around the expanded value in order to
+	 * feed all the requested key tables (entities) with a value.
+	 *
+	 * If the number of expanded value m is greater than the number
+	 * of key tables n (entities) and (m mod(n)) is zero, then split the
+	 * set of expanded values in n consecutive sets (strings).
+	 */
 	item_hl = (hostlist_t)(item->data);
 	item_count = hostlist_count(item_hl);
-	if ((item_count != tables_count) && (item_count != 1)) {
-		error("%s count must equal that of value "
-				"records or there must be no"
-				" more than one (%d != %d).",
-				item->key, item_count, tables_count);
+	if ((item_count < tables_count) || (item_count == 1)) {
+		items_per_record = 1;
+	} else if ((item_count >= tables_count) &&
+		   ((item_count % tables_count) == 0)) {
+		items_per_record = (int) (item_count / tables_count);
+	} else {
+		item_str = hostlist_ranged_string_malloc(item_hl);
+		error("parsing %s=%s : count is not coherent with the"
+		      " amount of records or there must be no more than"
+		      " one (%d vs %d)", item->key, item_str,
+		      item_count, tables_count);
+		free(item_str);
 		return 0;
 	}
+
 	for (i = 0; i < tables_count; ++i) {
-		if (item_count > 0) {
-			--item_count;
+
+		/* Extract the string representation of the proper value(s)
+		 * from the expanded one (if not already done) */
+		if (item_count > 1) {
 			if (item_str)
 				free(item_str);
+			if (items_per_record > 1) {
+				/* multiple items per table,
+				 * extract the consecutive set for this table */
+				item_str = hostlist_nth(item_hl, items_idx++);
+				sub_item_hl = hostlist_create(item_str);
+				for (j = 1; j < items_per_record; j++) {
+					free(item_str);
+					item_str = hostlist_nth(item_hl,
+								items_idx++);
+					hostlist_push_host(sub_item_hl,
+							   item_str);
+				}
+				free(item_str);
+				item_str = hostlist_ranged_string_malloc(
+					sub_item_hl);
+				hostlist_destroy(sub_item_hl);
+			} else {
+				/* one item per table,
+				 * extract the right item for this table */
+				item_str = hostlist_nth(item_hl, items_idx++);
+			}
+			if (items_idx >= item_count)
+				items_idx = 0;
+		} else if (item_count == 1) {
+			/* only one item, extract it once for all */
+			item_count--;
 			item_str = hostlist_shift(item_hl);
 		}
+
 		/*
 		 * The destination tables are created without any info on the
 		 * operator associated with the key in s_p_parse_line_expanded.
@@ -1623,7 +1671,8 @@ static int _parse_expline_doexpand(s_p_hashtbl_t** tables,
 		 */
 		if (!s_p_parse_pair_with_op(tables[i], item->key, item_str,
 					    item->operator)) {
-			error("Error parsing %s = %s.", item->key, item_str);
+			error("parsing %s=%s after expansion.", item->key,
+			      item_str);
 			free(item_str);
 			return 0;
 		}
diff --git a/src/common/parse_config.h b/src/common/parse_config.h
index 171a51755..e50211198 100644
--- a/src/common/parse_config.h
+++ b/src/common/parse_config.h
@@ -2,8 +2,6 @@
  *  parse_config.h - parse any slurm.conf-like configuration file
  *
  *  NOTE: when you see the prefix "s_p_", think "slurm parser".
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/parse_spec.c b/src/common/parse_spec.c
index 8e6955171..e10e6a5e6 100644
--- a/src/common/parse_spec.c
+++ b/src/common/parse_spec.c
@@ -1,4 +1,3 @@
-/* $Id$ */
 /*****************************************************************************\
  * parse_spec.c - configuration file parser
  *****************************************************************************
@@ -95,7 +94,7 @@ slurm_parser (char *spec, ...)
 	va_start(ap, spec);
 	while (error_code == 0) {
 		keyword = va_arg(ap, char *);
-		if (strcmp (keyword, "END") == 0)
+		if (xstrcmp (keyword, "END") == 0)
 			break;
 		type = va_arg(ap, int);
 		switch (type) {
@@ -193,7 +192,7 @@ _load_integer (int *destination, char *keyword, char *in_line)
 			str_ptr2 = (char *) strtok_r (scratch, SEPCHARS,
 			                              &str_ptr3);
 			str_len2 = strlen (str_ptr2);
-			if (strcasecmp (str_ptr2, "UNLIMITED") == 0)
+			if (xstrcasecmp (str_ptr2, "UNLIMITED") == 0)
 				*destination = -1;
 			else if ((str_ptr2[0] >= '0') &&
 			         (str_ptr2[0] <= '9')) {
@@ -250,7 +249,7 @@ _load_long (long *destination, char *keyword, char *in_line)
 			str_ptr2 = (char *) strtok_r (scratch, SEPCHARS,
 			                              &str_ptr3);
 			str_len2 = strlen (str_ptr2);
-			if (strcasecmp (str_ptr2, "UNLIMITED") == 0)
+			if (xstrcasecmp (str_ptr2, "UNLIMITED") == 0)
 				*destination = -1L;
 			else if ((str_ptr2[0] == '-') ||
 				 ((str_ptr2[0] >= '0') &&
diff --git a/src/common/parse_time.c b/src/common/parse_time.c
index 8e8f12f14..734dd1ac8 100644
--- a/src/common/parse_time.c
+++ b/src/common/parse_time.c
@@ -55,6 +55,8 @@
 #include "slurm/slurm.h"
 #include "src/common/macros.h"
 #include "src/common/slurm_time.h"
+#include "src/common/strlcpy.h"
+#include "src/common/xstring.h"
 
 #define _RUN_STAND_ALONE 0
 
@@ -727,15 +729,15 @@ slurm_make_time_str (time_t *time, char *string, int size)
 			/* Format MM/DD-HH:MM:SS */
 			display_fmt = "%m/%d-%T";
 #endif
-			if ((!fmt) || (!*fmt) || (!strcmp(fmt, "standard"))) {
+			if ((!fmt) || (!*fmt) || (!xstrcmp(fmt, "standard"))) {
 				;
-			} else if (strcmp(fmt, "relative") == 0) {
+			} else if (xstrcmp(fmt, "relative") == 0) {
 				use_relative_format = true;
 			} else if ((strchr(fmt, '%')  == NULL) ||
 				   (strlen(fmt) >= sizeof(fmt_buf))) {
 				error("invalid SLURM_TIME_FORMAT = '%s'", fmt);
 			} else {
-				strncpy(fmt_buf, fmt, sizeof(fmt_buf));
+				strlcpy(fmt_buf, fmt, sizeof(fmt_buf));
 				display_fmt = fmt_buf;
 			}
 		}
@@ -779,9 +781,9 @@ extern int time_str2secs(const char *string)
 	if ((string == NULL) || (string[0] == '\0'))
 		return NO_VAL;	/* invalid input */
 
-	if ((!strcasecmp(string, "-1"))
-	    || (!strcasecmp(string, "INFINITE"))
-	    || (!strcasecmp(string, "UNLIMITED"))) {
+	if ((!xstrcasecmp(string, "-1"))
+	    || (!xstrcasecmp(string, "INFINITE"))
+	    || (!xstrcasecmp(string, "UNLIMITED"))) {
 		return INFINITE;
 	}
 
diff --git a/src/common/parse_time.h b/src/common/parse_time.h
index e98ba1068..b98c1df84 100644
--- a/src/common/parse_time.h
+++ b/src/common/parse_time.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/common/parse_time.h - time parsing utility functions
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/parse_value.c b/src/common/parse_value.c
index 5e1e1ed4e..2d4b70060 100644
--- a/src/common/parse_value.c
+++ b/src/common/parse_value.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  parse_value.c - helper functions to simplify typed values management in
  *                  Slurm parser (see parse_config.{h,c})
- *
- *  $Id$
  *****************************************************************************
  *  Initially written by Francois Chevallier <chevallierfrancois@free.fr> @ BULL
  *  for slurm-2.6. Adapted by Matthieu Hautreux <matthieu.hautreux@cea.fr>, CEA,
@@ -66,8 +64,8 @@ int s_p_handle_long(long* data, const char* key, const char* value)
 	num = strtol(value, &endptr, 0);
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if (strcasecmp(value, "UNLIMITED") == 0
-			|| strcasecmp(value, "INFINITE") == 0) {
+		if (xstrcasecmp(value, "UNLIMITED") == 0
+			|| xstrcasecmp(value, "INFINITE") == 0) {
 			num = (long) INFINITE;
 		} else {
 			error("\"%s\" is not a valid number", value);
@@ -90,8 +88,8 @@ int s_p_handle_uint16(uint16_t* data, const char* key, const char *value)
 	num = strtoul(value, &endptr, 0);
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if (strcasecmp(value, "UNLIMITED") == 0
-			|| strcasecmp(value, "INFINITE") == 0) {
+		if (xstrcasecmp(value, "UNLIMITED") == 0
+			|| xstrcasecmp(value, "INFINITE") == 0) {
 			num = (uint16_t) INFINITE;
 		} else {
 			error("%s value \"%s\" is not a valid number",
@@ -127,8 +125,8 @@ int s_p_handle_uint32(uint32_t* data, const char* key, const char* value)
 	}
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if ((strcasecmp(value, "UNLIMITED") == 0) ||
-			(strcasecmp(value, "INFINITE")  == 0)) {
+		if ((xstrcasecmp(value, "UNLIMITED") == 0) ||
+			(xstrcasecmp(value, "INFINITE")  == 0)) {
 			num = (uint32_t) INFINITE;
 		} else {
 			error("%s value (%s) is not a valid number",
@@ -155,15 +153,15 @@ int s_p_handle_boolean(bool* data, const char* key, const char* value)
 {
 	bool flag;
 
-	if (!strcasecmp(value, "yes")
-		|| !strcasecmp(value, "up")
-		|| !strcasecmp(value, "true")
-		|| !strcasecmp(value, "1")) {
+	if (!xstrcasecmp(value, "yes")
+		|| !xstrcasecmp(value, "up")
+		|| !xstrcasecmp(value, "true")
+		|| !xstrcasecmp(value, "1")) {
 		flag = true;
-	} else if (!strcasecmp(value, "no")
-		   || !strcasecmp(value, "down")
-		   || !strcasecmp(value, "false")
-		   || !strcasecmp(value, "0")) {
+	} else if (!xstrcasecmp(value, "no")
+		   || !xstrcasecmp(value, "down")
+		   || !xstrcasecmp(value, "false")
+		   || !xstrcasecmp(value, "0")) {
 		flag = false;
 	} else {
 		error("\"%s\" is not a valid option for \"%s\"",
@@ -184,8 +182,8 @@ int s_p_handle_float(float* data, const char* key, const char* value)
 	num = strtof(value, &endptr);
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if ((strcasecmp(value, "UNLIMITED") == 0) ||
-			(strcasecmp(value, "INFINITE")  == 0)) {
+		if ((xstrcasecmp(value, "UNLIMITED") == 0) ||
+			(xstrcasecmp(value, "INFINITE")  == 0)) {
 			num = INFINITY;
 		} else {
 			error("%s value (%s) is not a valid number",
@@ -209,8 +207,8 @@ int s_p_handle_double(double* data, const char* key, const char* value)
 	num = strtod(value, &endptr);
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if ((strcasecmp(value, "UNLIMITED") == 0) ||
-			(strcasecmp(value, "INFINITE")  == 0)) {
+		if ((xstrcasecmp(value, "UNLIMITED") == 0) ||
+			(xstrcasecmp(value, "INFINITE")  == 0)) {
 			num = HUGE_VAL;
 		} else {
 			error("%s value (%s) is not a valid number",
@@ -235,8 +233,8 @@ int s_p_handle_long_double(long double* data, const char* key,
 	num = strtold(value, &endptr);
 	if ((num == 0 && errno == EINVAL)
 		|| (*endptr != '\0')) {
-		if ((strcasecmp(value, "UNLIMITED") == 0) ||
-			(strcasecmp(value, "INFINITE")  == 0)) {
+		if ((xstrcasecmp(value, "UNLIMITED") == 0) ||
+			(xstrcasecmp(value, "INFINITE")  == 0)) {
 			num = HUGE_VALL;
 		} else {
 			error("%s value (%s) is not a valid number",
diff --git a/src/common/parse_value.h b/src/common/parse_value.h
index 5326a9c24..62f37fc78 100644
--- a/src/common/parse_value.h
+++ b/src/common/parse_value.h
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  parse_value.h - helper functions to simplify typed values management in
  *                  Slurm parser (see parse_config.{h,c})
- *
- *  $Id$
  *****************************************************************************
  *  Initially written by Francois Chevallier <chevallierfrancois@free.fr> @ BULL
  *  for slurm-2.6. Adapted by Matthieu Hautreux <matthieu.hautreux@cea.fr>, CEA,
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 971a1a5da..2e72f943a 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -140,7 +140,7 @@ plugin_peek( const char *fq_path,
 	version = (uint32_t *) dlsym(plug, PLUGIN_VERSION);
 	if (!version) {
 		verbose("%s: plugin_version symbol not defined", fq_path);
-	} else if ((*version != SLURM_VERSION_NUMBER) && strcmp(type, "spank")){
+	} else if ((*version != SLURM_VERSION_NUMBER) && xstrcmp(type,"spank")){
 		/* NOTE: We could alternatly test just the MAJOR.MINOR values */
 		int plugin_major, plugin_minor, plugin_micro;
 		plugin_major = SLURM_VERSION_MAJOR(*version);
@@ -204,7 +204,7 @@ plugin_load_from_file(plugin_handle_t *p, const char *fq_path)
 	version = (uint32_t *) dlsym(plug, PLUGIN_VERSION);
 	if (!version) {
 		verbose("%s: plugin_version symbol not defined", fq_path);
-	} else if ((*version != SLURM_VERSION_NUMBER) && strcmp(type, "spank")){
+	} else if ((*version != SLURM_VERSION_NUMBER) && xstrcmp(type,"spank")){
 		/* NOTE: We could alternatly test just the MAJOR.MINOR values */
 		int plugin_major, plugin_minor, plugin_micro;
 		plugin_major = SLURM_VERSION_MAJOR(*version);
diff --git a/src/common/plugrack.c b/src/common/plugrack.c
index 5c5e9fb63..4dca7f731 100644
--- a/src/common/plugrack.c
+++ b/src/common/plugrack.c
@@ -424,7 +424,7 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir )
 		strcpy( tail, e->d_name );
 
 		/* Check only regular files. */
-		if ( (strncmp(e->d_name, ".", 1) == 0) ||
+		if ( (xstrncmp(e->d_name, ".", 1) == 0) ||
 		     (stat( fq_path, &st ) < 0) ||
 		     (! S_ISREG(st.st_mode)) )
 			continue;
@@ -462,7 +462,7 @@ _plugrack_read_single_dir( plugrack_t rack, char *dir )
 		}
 
 		if (   rack->major_type &&
-		       ( strncmp( rack->major_type,
+		       ( xstrncmp(rack->major_type,
 				  plugin_type,
 				  strlen( rack->major_type ) ) != 0 ) ) {
 			continue;
@@ -504,12 +504,12 @@ _match_major ( const char *path_name, const char *major_type )
 	char *head = (char *)path_name;
 
 	/* Special case for BlueGene systems */
-	if (strncmp(head, "libsched_if", 11) == 0)
+	if (xstrncmp(head, "libsched_if", 11) == 0)
 		return FALSE;
 
-	if (strncmp(head, "lib", 3) == 0)
+	if (xstrncmp(head, "lib", 3) == 0)
 		head += 3;
-	if (strncmp(head, major_type, strlen(major_type)))
+	if (xstrncmp(head, major_type, strlen(major_type)))
 		return FALSE;
 	return TRUE;
 }
@@ -591,7 +591,7 @@ plugrack_use_by_type( plugrack_t rack,
 	while ((e = list_next(it))) {
 		plugin_err_t err;
 
-		if (strcmp(full_type, e->full_type) != 0)
+		if (xstrcmp(full_type, e->full_type) != 0)
 			continue;
 
 		/* See if plugin is loaded. */
diff --git a/src/common/plugstack.c b/src/common/plugstack.c
index 7d0dca6ba..afd7d6e3e 100644
--- a/src/common/plugstack.c
+++ b/src/common/plugstack.c
@@ -280,11 +280,11 @@ typedef enum {
 
 static cf_line_t _plugin_stack_line_type (const char *str)
 {
-	if (strcmp(str, REQUIRED) == 0)
+	if (xstrcmp(str, REQUIRED) == 0)
 		return (CF_REQUIRED);
-	else if (strcmp(str, OPTIONAL) == 0)
+	else if (xstrcmp(str, OPTIONAL) == 0)
 		return (CF_OPTIONAL);
-	else if (strcmp(str, INCLUDE) == 0)
+	else if (xstrcmp(str, INCLUDE) == 0)
 		return (CF_INCLUDE);
 	else {
 		error("spank: Invalid option \"%s\". Must be %s, %s or %s",
@@ -609,6 +609,7 @@ static int _spank_conf_include (struct spank_stack *stack,
 		break;
 	  case GLOB_NOSPACE:
 		errno = ENOMEM;
+		break;
 	  case GLOB_ABORTED:
 		verbose ("%s:%d: cannot read dir %s: %m",
 			file, lineno, pattern);
@@ -1003,7 +1004,7 @@ static int _opt_by_val(struct spank_plugin_opt *opt, int *optvalp)
 
 static int _opt_by_name(struct spank_plugin_opt *opt, char *optname)
 {
-	return (strcmp(opt->opt->name, optname) == 0);
+	return (xstrcmp(opt->opt->name, optname) == 0);
 }
 
 static int
@@ -1446,9 +1447,9 @@ struct opt_find_args {
 static int _opt_find(struct spank_plugin_opt *p,
 		     struct opt_find_args *args)
 {
-	if (strcmp(p->plugin->name, args->plugin_name) != 0)
+	if (xstrcmp(p->plugin->name, args->plugin_name) != 0)
 		return (0);
-	if (strcmp(p->opt->name, args->optname) != 0)
+	if (xstrcmp(p->opt->name, args->optname) != 0)
 		return (0);
 	return (1);
 }
@@ -1657,9 +1658,9 @@ int spank_clear_remote_options_env (char **env)
 
 	for (ep = env; *ep; ep++) {
 		char *p = *ep;
-		if (strncmp (*ep, "SPANK_", 6) == 0)
+		if (xstrncmp (*ep, "SPANK_", 6) == 0)
 			p = *ep+6;
-		if (strncmp (p, SPANK_OPTION_ENV_PREFIX, len) == 0) {
+		if (xstrncmp (p, SPANK_OPTION_ENV_PREFIX, len) == 0) {
 			char *end = strchr (p+len, '=');
 			if (end) {
 				char name[1024];
@@ -1824,7 +1825,7 @@ int spank_symbol_supported (const char *name)
 		return (-1);
 
 	for (i = 0; i < n_spank_syms; i++) {
-		if (strcmp (spank_syms [i], name) == 0)
+		if (xstrcmp (spank_syms [i], name) == 0)
 			return (1);
 	}
 
diff --git a/src/common/power.c b/src/common/power.c
index cf9a8ea00..c89184633 100644
--- a/src/common/power.c
+++ b/src/common/power.c
@@ -101,7 +101,7 @@ extern int power_g_init(void)
 		xrealloc(ops, (sizeof(slurm_power_ops_t)*(g_context_cnt + 1)));
 		xrealloc(g_context,
 			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
-		if (strncmp(type, "power/", 6) == 0)
+		if (xstrncmp(type, "power/", 6) == 0)
 			type += 6; /* backward compatibility */
 		type = xstrdup_printf("power/%s", type);
 		g_context[g_context_cnt] = plugin_context_create(
diff --git a/src/common/proc_args.c b/src/common/proc_args.c
index 52cbcae10..974dc8208 100644
--- a/src/common/proc_args.c
+++ b/src/common/proc_args.c
@@ -174,6 +174,7 @@ void set_distribution(task_dist_states_t distribution,
 		case SLURM_DIST_CYCLIC_CFULL_BLOCK:
 			*dist      = "cyclic:fcyclic:block";
 			*lllp_dist = "fcyclic:block";
+			break;
 		case SLURM_DIST_CYCLIC_CFULL_CFULL:
 			*dist      = "cyclic:fcyclic:fcyclic";
 			*lllp_dist = "fcyclic:fcyclic";
@@ -281,21 +282,21 @@ task_dist_states_t verify_dist_type(const char *arg, uint32_t *plane_size)
 			buf[j][i] = '\0';
 			cur_ptr++;
 		}
-		if (strcmp(buf[0], "*") == 0)
+		if (xstrcmp(buf[0], "*") == 0)
 			/* default node distribution is block */
 			strcpy(buf[0], "block");
 		strcat(outstr, buf[0]);
-		if (strcmp(buf[1], "\0") != 0) {
+		if (xstrcmp(buf[1], "\0") != 0) {
 			strcat(outstr, ":");
-			if (!strcmp(buf[1], "*") || !strcmp(buf[1], "\0")) {
+			if (!xstrcmp(buf[1], "*") || !xstrcmp(buf[1], "\0")) {
 				/* default socket distribution is cyclic */
 				strcpy(buf[1], "cyclic");
 			}
 			strcat(outstr, buf[1]);
 		}
-		if (strcmp(buf[2], "\0") != 0) {
+		if (xstrcmp(buf[2], "\0") != 0) {
 			strcat(outstr, ":");
-			if (!strcmp(buf[2], "*") || !strcmp(buf[2], "\0")) {
+			if (!xstrcmp(buf[2], "*") || !xstrcmp(buf[2], "\0")) {
 				/* default core dist is inherited socket dist */
 				strcpy(buf[2], buf[1]);
 			}
@@ -303,70 +304,70 @@ task_dist_states_t verify_dist_type(const char *arg, uint32_t *plane_size)
 		}
 
 		if (lllp_dist) {
-			if (strcasecmp(outstr, "cyclic:cyclic") == 0) {
+			if (xstrcasecmp(outstr, "cyclic:cyclic") == 0) {
 				result = SLURM_DIST_CYCLIC_CYCLIC;
-			} else if (strcasecmp(outstr, "cyclic:block") == 0) {
+			} else if (xstrcasecmp(outstr, "cyclic:block") == 0) {
 				result = SLURM_DIST_CYCLIC_BLOCK;
-			} else if (strcasecmp(outstr, "block:block") == 0) {
+			} else if (xstrcasecmp(outstr, "block:block") == 0) {
 				result = SLURM_DIST_BLOCK_BLOCK;
-			} else if (strcasecmp(outstr, "block:cyclic") == 0) {
+			} else if (xstrcasecmp(outstr, "block:cyclic") == 0) {
 				result = SLURM_DIST_BLOCK_CYCLIC;
-			} else if (strcasecmp(outstr, "block:fcyclic") == 0) {
+			} else if (xstrcasecmp(outstr, "block:fcyclic") == 0) {
 				result = SLURM_DIST_BLOCK_CFULL;
-			} else if (strcasecmp(outstr, "cyclic:fcyclic") == 0) {
+			} else if (xstrcasecmp(outstr, "cyclic:fcyclic") == 0) {
 				result = SLURM_DIST_CYCLIC_CFULL;
-			} else if (strcasecmp(outstr, "cyclic:cyclic:cyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:cyclic:cyclic")
 				   == 0) {
 				result = SLURM_DIST_CYCLIC_CYCLIC_CYCLIC;
-			} else if (strcasecmp(outstr, "cyclic:cyclic:block")
+			} else if (xstrcasecmp(outstr, "cyclic:cyclic:block")
 				   == 0) {
 				result = SLURM_DIST_CYCLIC_CYCLIC_BLOCK;
-			} else if (strcasecmp(outstr, "cyclic:cyclic:fcyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:cyclic:fcyclic")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_CYCLIC_CFULL;
-			} else if (strcasecmp(outstr, "cyclic:block:cyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:block:cyclic")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_BLOCK_CYCLIC;
-			} else if (strcasecmp(outstr, "cyclic:block:block")
+			} else if (xstrcasecmp(outstr, "cyclic:block:block")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_BLOCK_BLOCK;
-			} else if (strcasecmp(outstr, "cyclic:block:fcyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:block:fcyclic")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_BLOCK_CFULL;
-			} else if (strcasecmp(outstr, "cyclic:fcyclic:cyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:fcyclic:cyclic")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_CFULL_CYCLIC;
-			} else if (strcasecmp(outstr, "cyclic:fcyclic:block")
+			} else if (xstrcasecmp(outstr, "cyclic:fcyclic:block")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_CFULL_BLOCK;
-			} else if (strcasecmp(outstr, "cyclic:fcyclic:fcyclic")
+			} else if (xstrcasecmp(outstr, "cyclic:fcyclic:fcyclic")
 				== 0) {
 				result = SLURM_DIST_CYCLIC_CFULL_CFULL;
-			} else if (strcasecmp(outstr, "block:cyclic:cyclic")
+			} else if (xstrcasecmp(outstr, "block:cyclic:cyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CYCLIC_CYCLIC;
-			} else if (strcasecmp(outstr, "block:cyclic:block")
+			} else if (xstrcasecmp(outstr, "block:cyclic:block")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CYCLIC_BLOCK;
-			} else if (strcasecmp(outstr, "block:cyclic:fcyclic")
+			} else if (xstrcasecmp(outstr, "block:cyclic:fcyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CYCLIC_CFULL;
-			} else if (strcasecmp(outstr, "block:block:cyclic")
+			} else if (xstrcasecmp(outstr, "block:block:cyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_BLOCK_CYCLIC;
-			} else if (strcasecmp(outstr, "block:block:block")
+			} else if (xstrcasecmp(outstr, "block:block:block")
 				== 0) {
 				result = SLURM_DIST_BLOCK_BLOCK_BLOCK;
-			} else if (strcasecmp(outstr, "block:block:fcyclic")
+			} else if (xstrcasecmp(outstr, "block:block:fcyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_BLOCK_CFULL;
-			} else if (strcasecmp(outstr, "block:fcyclic:cyclic")
+			} else if (xstrcasecmp(outstr, "block:fcyclic:cyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CFULL_CYCLIC;
-			} else if (strcasecmp(outstr, "block:fcyclic:block")
+			} else if (xstrcasecmp(outstr, "block:fcyclic:block")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CFULL_BLOCK;
-			} else if (strcasecmp(outstr, "block:fcyclic:fcyclic")
+			} else if (xstrcasecmp(outstr, "block:fcyclic:fcyclic")
 				== 0) {
 				result = SLURM_DIST_BLOCK_CFULL_CFULL;
 			}
@@ -927,7 +928,7 @@ bool verify_hint(const char *arg, int *min_sockets, int *min_cores,
 
 	p = buf;
 	while ((tok = strsep(&p, ";"))) {
-		if (strcasecmp(tok, "help") == 0) {
+		if (xstrcasecmp(tok, "help") == 0) {
 			printf(
 "Application hint options:\n"
 "    --hint=             Bind tasks according to application hints\n"
@@ -936,18 +937,18 @@ bool verify_hint(const char *arg, int *min_sockets, int *min_cores,
 "        [no]multithread [don't] use extra threads with in-core multi-threading\n"
 "        help            show this help message\n");
 			return 1;
-		} else if (strcasecmp(tok, "compute_bound") == 0) {
+		} else if (xstrcasecmp(tok, "compute_bound") == 0) {
 			*min_sockets = NO_VAL;
 			*min_cores   = NO_VAL;
 			*min_threads = 1;
 			if (cpu_bind_type)
 				*cpu_bind_type |= CPU_BIND_TO_CORES;
-		} else if (strcasecmp(tok, "memory_bound") == 0) {
+		} else if (xstrcasecmp(tok, "memory_bound") == 0) {
 			*min_cores   = 1;
 			*min_threads = 1;
 			if (cpu_bind_type)
 				*cpu_bind_type |= CPU_BIND_TO_CORES;
-		} else if (strcasecmp(tok, "multithread") == 0) {
+		} else if (xstrcasecmp(tok, "multithread") == 0) {
 			*min_threads = NO_VAL;
 			if (cpu_bind_type) {
 				*cpu_bind_type |= CPU_BIND_TO_THREADS;
@@ -956,7 +957,7 @@ bool verify_hint(const char *arg, int *min_sockets, int *min_cores,
 			}
 			if (*ntasks_per_core == NO_VAL)
 				*ntasks_per_core = INFINITE;
-		} else if (strcasecmp(tok, "nomultithread") == 0) {
+		} else if (xstrcasecmp(tok, "nomultithread") == 0) {
 			*min_threads = 1;
 			if (cpu_bind_type) {
 				*cpu_bind_type |= CPU_BIND_TO_THREADS;
@@ -981,40 +982,47 @@ uint16_t parse_mail_type(const char *arg)
 {
 	char *buf, *tok, *save_ptr = NULL;
 	uint16_t rc = 0;
+	bool none_set = false;
 
 	if (!arg)
-		return rc;
+		return (uint16_t)INFINITE;
 
 	buf = xstrdup(arg);
 	tok = strtok_r(buf, ",", &save_ptr);
 	while (tok) {
-		if (strcasecmp(tok, "NONE") == 0) {
+		if (xstrcasecmp(tok, "NONE") == 0) {
 			rc = 0;
+			none_set = true;
 			break;
-		} else if (strcasecmp(tok, "BEGIN") == 0)
+		}
+		else if (xstrcasecmp(tok, "ARRAY_TASKS") == 0)
+			rc |= MAIL_ARRAY_TASKS;
+		else if (xstrcasecmp(tok, "BEGIN") == 0)
 			rc |= MAIL_JOB_BEGIN;
-		else if  (strcasecmp(tok, "END") == 0)
+		else if  (xstrcasecmp(tok, "END") == 0)
 			rc |= MAIL_JOB_END;
-		else if (strcasecmp(tok, "FAIL") == 0)
+		else if (xstrcasecmp(tok, "FAIL") == 0)
 			rc |= MAIL_JOB_FAIL;
-		else if (strcasecmp(tok, "REQUEUE") == 0)
+		else if (xstrcasecmp(tok, "REQUEUE") == 0)
 			rc |= MAIL_JOB_REQUEUE;
-		else if (strcasecmp(tok, "ALL") == 0)
+		else if (xstrcasecmp(tok, "ALL") == 0)
 			rc |= MAIL_JOB_BEGIN |  MAIL_JOB_END |  MAIL_JOB_FAIL |
 			      MAIL_JOB_REQUEUE | MAIL_JOB_STAGE_OUT;
-		else if (!strcasecmp(tok, "STAGE_OUT"))
+		else if (!xstrcasecmp(tok, "STAGE_OUT"))
 			rc |= MAIL_JOB_STAGE_OUT;
-		else if (strcasecmp(tok, "TIME_LIMIT") == 0)
+		else if (xstrcasecmp(tok, "TIME_LIMIT") == 0)
 			rc |= MAIL_JOB_TIME100;
-		else if (strcasecmp(tok, "TIME_LIMIT_90") == 0)
+		else if (xstrcasecmp(tok, "TIME_LIMIT_90") == 0)
 			rc |= MAIL_JOB_TIME90;
-		else if (strcasecmp(tok, "TIME_LIMIT_80") == 0)
+		else if (xstrcasecmp(tok, "TIME_LIMIT_80") == 0)
 			rc |= MAIL_JOB_TIME80;
-		else if (strcasecmp(tok, "TIME_LIMIT_50") == 0)
+		else if (xstrcasecmp(tok, "TIME_LIMIT_50") == 0)
 			rc |= MAIL_JOB_TIME50;
 		tok = strtok_r(NULL, ",", &save_ptr);
 	}
 	xfree(buf);
+	if (!rc && !none_set)
+		rc = (uint16_t)INFINITE;
 
 	return rc;
 }
@@ -1027,6 +1035,11 @@ char *print_mail_type(const uint16_t type)
 	if (type == 0)
 		return "NONE";
 
+	if (type & MAIL_ARRAY_TASKS) {
+		if (buf[0])
+			strcat(buf, ",");
+		strcat(buf, "ARRAY_TASKS");
+	}
 	if (type & MAIL_JOB_BEGIN) {
 		if (buf[0])
 			strcat(buf, ",");
@@ -1401,7 +1414,7 @@ void print_db_notok(const char *cname, bool isenv)
 		      "%s or contact your admin to resolve the problem.",
 		      isenv ? "SLURM_CLUSTERS from your environment" :
 		      "--cluster from your command line");
-	else if (!strcasecmp("all", cname))
+	else if (!xstrcasecmp("all", cname))
 		error("No clusters can be reached now. "
 		      "Contact your admin to resolve the problem.");
 	else
@@ -1681,13 +1694,17 @@ parse_resv_flags(const char *flagstr, const char *msg)
 				outflags |= RESERVE_FLAG_NO_STATIC;
 			else
 				outflags |= RESERVE_FLAG_STATIC;
-		} else if (strncasecmp(curr, "Part_Nodes", MAX(taglen,1))
+		} else if (strncasecmp(curr, "Part_Nodes", MAX(taglen, 2))
 			   == 0) {
 			curr += taglen;
 			if (flip)
 				outflags |= RESERVE_FLAG_NO_PART_NODES;
 			else
 				outflags |= RESERVE_FLAG_PART_NODES;
+		} else if (strncasecmp(curr, "PURGE_COMP", MAX(taglen, 2))
+			   == 0) {
+			curr += taglen;
+			outflags |= RESERVE_FLAG_PURGE_COMP;
 		} else if (!strncasecmp(curr, "First_Cores", MAX(taglen,1)) &&
 			   !flip) {
 			curr += taglen;
@@ -1711,3 +1728,29 @@ parse_resv_flags(const char *flagstr, const char *msg)
 	}
 	return outflags;
 }
+
+/* parse --compress for a compression type, set to default type if not found */
+uint16_t parse_compress_type(const char *arg)
+{
+	/* if called with null string return default compression type */
+	if (!arg) {
+#if HAVE_LZ4
+		return COMPRESS_LZ4;
+#elif HAVE_LIBZ
+		return COMPRESS_ZLIB;
+#else
+		error("No compression library available,"
+		      " compression disabled.");
+		return COMPRESS_OFF;
+#endif
+	}
+
+	if (!strcasecmp(arg, "zlib"))
+		return COMPRESS_ZLIB;
+	else if (!strcasecmp(arg, "lz4"))
+		return COMPRESS_LZ4;
+
+	error("Compression type '%s' unknown, disabling compression support.",
+	      arg);
+	return COMPRESS_OFF;
+}
diff --git a/src/common/proc_args.h b/src/common/proc_args.h
index f1b41d7f4..e9023ebc4 100644
--- a/src/common/proc_args.h
+++ b/src/common/proc_args.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  proc_args.h - helper functions for command argument processing
- *  $Id: opt.h 11996 2007-08-10 20:36:26Z jette $
  *****************************************************************************
  *  Copyright (C) 2007 Hewlett-Packard Development Company, L.P.
  *  Written by Christopher Holmes <cholmes@hp.com>, who borrowed heavily
@@ -197,4 +196,6 @@ extern void bg_figure_nodes_tasks(int *min_nodes, int *max_nodes,
 
 extern uint32_t parse_resv_flags(const char *flagstr, const char *msg);
 
+extern uint16_t parse_compress_type(const char *arg);
+
 #endif /* !_PROC_ARGS_H */
diff --git a/src/common/read_config.c b/src/common/read_config.c
index ecdf99fc8..5fb7ff591 100644
--- a/src/common/read_config.c
+++ b/src/common/read_config.c
@@ -5,7 +5,7 @@
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
  *  Portions Copyright (C) 2008 Vijay Ramasubramanian.
- *  Portions Copyright (C) 2010-2013 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Portions (boards) copyright (C) 2012 Bull, <rod.schultz@bull.com>
  *  Portions (route) copyright (C) 2014 Bull, <rod.schultz@bull.com>
  *  Copyright (C) 2012-2013 Los Alamos National Security, LLC.
@@ -73,6 +73,7 @@
 #include "src/common/log.h"
 #include "src/common/macros.h"
 #include "src/common/node_conf.h"
+#include "src/common/node_features.h"
 #include "src/common/parse_config.h"
 #include "src/common/parse_spec.h"
 #include "src/common/parse_time.h"
@@ -207,7 +208,7 @@ s_p_options_t slurm_conf_options[] = {
 	{"DefMemPerNode", S_P_UINT32},
 	{"DisableRootJobs", S_P_BOOLEAN},
 	{"EioTimeout", S_P_UINT16},
-	{"EnforcePartLimits", S_P_BOOLEAN},
+	{"EnforcePartLimits", S_P_STRING},
 	{"Epilog", S_P_STRING},
 	{"EpilogMsgTime", S_P_UINT32},
 	{"EpilogSlurmctld", S_P_STRING},
@@ -256,12 +257,15 @@ s_p_options_t slurm_conf_options[] = {
 	{"MaxMemPerNode", S_P_UINT32},
 	{"MaxStepCount", S_P_UINT32},
 	{"MaxTasksPerNode", S_P_UINT16},
+	{"MCSParameters", S_P_STRING},
+	{"MCSPlugin", S_P_STRING},
 	{"MemLimitEnforce", S_P_STRING},
 	{"MessageTimeout", S_P_UINT16},
 	{"MinJobAge", S_P_UINT32},
 	{"MpiDefault", S_P_STRING},
 	{"MpiParams", S_P_STRING},
 	{"MsgAggregationParams", S_P_STRING},
+	{"NodeFeaturesPlugins", S_P_STRING},
 	{"OverTimeLimit", S_P_UINT16},
 	{"PluginDir", S_P_STRING},
 	{"PlugStackConfig", S_P_STRING},
@@ -345,6 +349,7 @@ s_p_options_t slurm_conf_options[] = {
 	{"TaskProlog", S_P_STRING},
 	{"TaskPlugin", S_P_STRING},
 	{"TaskPluginParam", S_P_STRING},
+	{"TCPTimeout", S_P_UINT16},
 	{"TmpFS", S_P_STRING},
 	{"TopologyParam", S_P_STRING},
 	{"TopologyPlugin", S_P_STRING},
@@ -500,7 +505,7 @@ static int _parse_frontend(void **dest, slurm_parser_enum_t type,
 	s_p_parse_line(tbl, *leftover, leftover);
 	/* s_p_dump_values(tbl, _frontend_options); */
 
-	if (strcasecmp(value, "DEFAULT") == 0) {
+	if (xstrcasecmp(value, "DEFAULT") == 0) {
 		char *tmp;
 		if (s_p_get_string(&tmp, "FrontendAddr", tbl)) {
 			error("FrontendAddr not allowed with "
@@ -582,6 +587,7 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type,
 		{"CPUs", S_P_UINT16},
 		{"CPUSpecList", S_P_STRING},
 		{"Feature", S_P_STRING},
+		{"Features", S_P_STRING},
 		{"Gres", S_P_STRING},
 		{"MemSpecLimit", S_P_UINT32},
 		{"NodeAddr", S_P_STRING},
@@ -603,7 +609,7 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type,
 	s_p_parse_line(tbl, *leftover, leftover);
 	/* s_p_dump_values(tbl, _nodename_options); */
 
-	if (strcasecmp(value, "DEFAULT") == 0) {
+	if (xstrcasecmp(value, "DEFAULT") == 0) {
 		char *tmp;
 		if (s_p_get_string(&tmp, "NodeHostname", tbl)) {
 			error("NodeHostname not allowed with "
@@ -669,8 +675,10 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type,
 		if (!s_p_get_string(&n->cpu_spec_list, "CPUSpecList", tbl))
 			s_p_get_string(&n->cpu_spec_list, "CPUSpecList", dflt);
 
-		if (!s_p_get_string(&n->feature, "Feature", tbl))
-			s_p_get_string(&n->feature, "Feature", dflt);
+		if (!s_p_get_string(&n->feature, "Feature",  tbl) &&
+		    !s_p_get_string(&n->feature, "Features", tbl) &&
+		    !s_p_get_string(&n->feature, "Feature",  dflt))
+			s_p_get_string(&n->feature, "Features", dflt);
 
 		if (!s_p_get_string(&n->gres, "Gres", tbl))
 			s_p_get_string(&n->gres, "Gres", dflt);
@@ -732,6 +740,8 @@ static int _parse_nodename(void **dest, slurm_parser_enum_t type,
 		if (!s_p_get_uint32(&n->weight, "Weight", tbl)
 		    && !s_p_get_uint32(&n->weight, "Weight", dflt))
 			n->weight = 1;
+		else if (n->weight == INFINITE)
+			n->weight -= 1;
 
 		s_p_hashtbl_destroy(tbl);
 
@@ -898,7 +908,7 @@ extern int list_find_frontend (void *front_end_entry, void *key)
 		return 1;
 
 	front_end_ptr = (slurm_conf_frontend_t *) front_end_entry;
-	if (strcmp(front_end_ptr->frontends, (char *) key) == 0)
+	if (xstrcmp(front_end_ptr->frontends, (char *) key) == 0)
 		return 1;
 	return 0;
 }
@@ -1037,6 +1047,7 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 	s_p_hashtbl_t *tbl, *dflt;
 	slurm_conf_partition_t *p;
 	char *tmp = NULL;
+	uint16_t tmp_16 = 0;
 	static s_p_options_t _partition_options[] = {
 		{"AllocNodes", S_P_STRING},
 		{"AllowAccounts",S_P_STRING},
@@ -1062,12 +1073,15 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 		{"MaxNodes", S_P_UINT32}, /* INFINITE or a number */
 		{"MinNodes", S_P_UINT32},
 		{"Nodes", S_P_STRING},
+		{"OverSubscribe", S_P_STRING}, /* YES, NO, or FORCE */
 		{"PreemptMode", S_P_STRING},
 		{"Priority", S_P_UINT16},
+		{"PriorityJobFactor", S_P_UINT16},
+		{"PriorityTier", S_P_UINT16},
 		{"QOS", S_P_STRING},
 		{"RootOnly", S_P_BOOLEAN}, /* YES or NO */
 		{"ReqResv", S_P_BOOLEAN}, /* YES or NO */
-		{"SelectTypeParameters", S_P_STRING}, /* CR_Socket, CR_Core */
+		{"SelectTypeParameters", S_P_STRING},
 		{"Shared", S_P_STRING}, /* YES, NO, or FORCE */
 		{"State", S_P_STRING}, /* UP, DOWN, INACTIVE or DRAIN */
 		{NULL}
@@ -1078,7 +1092,7 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 	s_p_parse_line(tbl, *leftover, leftover);
 	/* s_p_dump_values(tbl, _partition_options); */
 
-	if (strcasecmp(value, "DEFAULT") == 0) {
+	if (xstrcasecmp(value, "DEFAULT") == 0) {
 		if (default_partition_tbl != NULL) {
 			s_p_hashtbl_merge(tbl, default_partition_tbl);
 			s_p_hashtbl_destroy(default_partition_tbl);
@@ -1096,18 +1110,18 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 			s_p_get_string(&p->allow_accounts,
 				       "AllowAccounts", dflt);
 		if (p->allow_accounts &&
-		    (strcasecmp(p->allow_accounts, "ALL") == 0))
+		    (xstrcasecmp(p->allow_accounts, "ALL") == 0))
 			xfree(p->allow_accounts);
 
 		if (!s_p_get_string(&p->allow_groups, "AllowGroups", tbl))
 			s_p_get_string(&p->allow_groups, "AllowGroups", dflt);
 		if (p->allow_groups &&
-		    (strcasecmp(p->allow_groups, "ALL") == 0))
+		    (xstrcasecmp(p->allow_groups, "ALL") == 0))
 			xfree(p->allow_groups);
 
 		if (!s_p_get_string(&p->allow_qos, "AllowQos", tbl))
 			s_p_get_string(&p->allow_qos, "AllowQos", dflt);
-		if (p->allow_qos && (strcasecmp(p->allow_qos, "ALL") == 0))
+		if (p->allow_qos && (xstrcasecmp(p->allow_qos, "ALL") == 0))
 			xfree(p->allow_qos);
 
 		if (!s_p_get_string(&p->deny_accounts, "DenyAccounts", tbl))
@@ -1130,7 +1144,7 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 			s_p_get_string(&p->allow_alloc_nodes, "AllocNodes",
 				       dflt);
 			if (p->allow_alloc_nodes &&
-			    (strcasecmp(p->allow_alloc_nodes, "ALL") == 0))
+			    (xstrcasecmp(p->allow_alloc_nodes, "ALL") == 0))
 				xfree(p->allow_alloc_nodes);
 		}
 
@@ -1277,19 +1291,35 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 		} else
 			p->preempt_mode = (uint16_t) NO_VAL;
 
-		if (!s_p_get_uint16(&p->priority, "Priority", tbl) &&
-		    !s_p_get_uint16(&p->priority, "Priority", dflt))
-			p->priority = 1;
+		if (!s_p_get_uint16(&p->priority_job_factor,
+				    "PriorityJobFactor", tbl) &&
+		    !s_p_get_uint16(&p->priority_job_factor,
+				    "PriorityJobFactor", dflt)) {
+			p->priority_job_factor = 1;
+		}
+		if (!s_p_get_uint16(&p->priority_tier, "PriorityTier", tbl) &&
+		    !s_p_get_uint16(&p->priority_tier, "PriorityTier", dflt)) {
+			p->priority_tier = 1;
+		}
+		if (s_p_get_uint16(&tmp_16, "Priority", tbl) ||
+		    s_p_get_uint16(&tmp_16, "Priority", dflt)) {
+			p->priority_job_factor = tmp_16;
+			p->priority_tier = tmp_16;
+		}
 
 		if (!s_p_get_string(&p->qos_char, "QOS", tbl)
 		    && !s_p_get_string(&p->qos_char, "QOS", dflt))
 			p->qos_char = NULL;
 
 		if (s_p_get_string(&tmp, "SelectTypeParameters", tbl)) {
-			if (strncasecmp(tmp, "CR_Socket", 9) == 0)
-				p->cr_type = CR_SOCKET;
+			if (strncasecmp(tmp, "CR_Core_Memory", 14) == 0)
+				p->cr_type = CR_CORE | CR_MEMORY;
 			else if (strncasecmp(tmp, "CR_Core", 7) == 0)
 				p->cr_type = CR_CORE;
+			else if (strncasecmp(tmp, "CR_Socket_Memory", 16) == 0)
+				p->cr_type = CR_SOCKET | CR_MEMORY;
+			else if (strncasecmp(tmp, "CR_Socket", 9) == 0)
+				p->cr_type = CR_SOCKET;
 			else {
 				error("Bad value for SelectTypeParameters: %s",
 				      tmp);
@@ -1302,31 +1332,33 @@ static int _parse_partitionname(void **dest, slurm_parser_enum_t type,
 		} else
 			p->cr_type = 0;
 
-		if (s_p_get_string(&tmp, "Shared", tbl) ||
+		if (s_p_get_string(&tmp, "OverSubscribe", tbl) ||
+		    s_p_get_string(&tmp, "OverSubscribe", dflt) ||
+		    s_p_get_string(&tmp, "Shared", tbl) ||
 		    s_p_get_string(&tmp, "Shared", dflt)) {
-			if (strcasecmp(tmp, "NO") == 0)
+			if (xstrcasecmp(tmp, "NO") == 0)
 				p->max_share = 1;
-			else if (strcasecmp(tmp, "EXCLUSIVE") == 0)
+			else if (xstrcasecmp(tmp, "EXCLUSIVE") == 0)
 				p->max_share = 0;
 			else if (strncasecmp(tmp, "YES:", 4) == 0) {
 				int i = strtol(&tmp[4], (char **) NULL, 10);
 				if (i <= 1) {
-					error("Ignoring bad Shared value: %s",
+					error("Ignoring bad OverSubscribe value: %s",
 					      tmp);
 					p->max_share = 1; /* Shared=NO */
 				} else
 					p->max_share = i;
-			} else if (strcasecmp(tmp, "YES") == 0)
+			} else if (xstrcasecmp(tmp, "YES") == 0)
 				p->max_share = 4;
 			else if (strncasecmp(tmp, "FORCE:", 6) == 0) {
 				int i = strtol(&tmp[6], (char **) NULL, 10);
 				if (i < 1) {
-					error("Ignoring bad Shared value: %s",
+					error("Ignoring bad OverSubscribe value: %s",
 					      tmp);
 					p->max_share = 1; /* Shared=NO */
 				} else
 					p->max_share = i | SHARED_FORCE;
-			} else if (strcasecmp(tmp, "FORCE") == 0)
+			} else if (xstrcasecmp(tmp, "FORCE") == 0)
 				p->max_share = 4 | SHARED_FORCE;
 			else {
 				error("Bad value \"%s\" for Shared", tmp);
@@ -1524,7 +1556,7 @@ static void _push_to_hashtbls(char *alias, char *hostname,
 	/* Ensure only one slurmd configured on each host */
 	p = host_to_node_hashtbl[hostname_idx];
 	while (p) {
-		if (strcmp(p->hostname, hostname) == 0) {
+		if (xstrcmp(p->hostname, hostname) == 0) {
 			error("Duplicated NodeHostName %s in the config file",
 			      hostname);
 			return;
@@ -1535,7 +1567,7 @@ static void _push_to_hashtbls(char *alias, char *hostname,
 	/* Ensure only one instance of each NodeName */
 	p = node_to_host_hashtbl[alias_idx];
 	while (p) {
-		if (strcmp(p->alias, alias)==0) {
+		if (xstrcmp(p->alias, alias)==0) {
 			if (front_end)
 				fatal("Frontend not configured correctly "
 				      "in slurm.conf.  See man slurm.conf "
@@ -1832,7 +1864,7 @@ static char *_internal_get_hostname(const char *node_name)
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 			return xstrdup(p->hostname);
 		}
 		p = p->next_alias;
@@ -1889,7 +1921,7 @@ extern char *slurm_conf_get_nodename(const char *node_hostname)
 	idx = _get_hash_idx(node_hostname);
 	p = host_to_node_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->hostname, node_hostname) == 0) {
+		if (xstrcmp(p->hostname, node_hostname) == 0) {
 			alias = xstrdup(p->alias);
 			break;
 		}
@@ -1921,7 +1953,7 @@ extern char *slurm_conf_get_aliases(const char *node_hostname)
 
 	p = host_to_node_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->hostname, node_hostname) == 0) {
+		if (xstrcmp(p->hostname, node_hostname) == 0) {
 			if ( aliases == NULL )
 				aliases = xstrdup(p->alias);
 			else {
@@ -1954,7 +1986,7 @@ extern char *slurm_conf_get_nodeaddr(const char *node_hostname)
 
 	p = host_to_node_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->hostname, node_hostname) == 0) {
+		if (xstrcmp(p->hostname, node_hostname) == 0) {
 			char *nodeaddr;
 			if (p->address != NULL)
 				nodeaddr = xstrdup(p->address);
@@ -1978,21 +2010,20 @@ extern char *slurm_conf_get_nodeaddr(const char *node_hostname)
  */
 extern char *slurm_conf_get_nodename_from_addr(const char *node_addr)
 {
-	unsigned char buf[HOSTENT_SIZE];
-	struct hostent *hptr;
+	char hostname[NI_MAXHOST];
 	unsigned long addr = inet_addr(node_addr);
 	char *start_name, *ret_name = NULL, *dot_ptr;
 
-	if (!(hptr = get_host_by_addr((char *)&addr, sizeof(addr), AF_INET,
-				      buf, sizeof(buf), NULL))) {
-		error("No node found with addr %s", node_addr);
+	if (get_name_info((struct sockaddr *)&addr,
+			  sizeof(addr), hostname) != 0) {
+		error("%s: No node found with addr %s", __func__, node_addr);
 		return NULL;
 	}
 
-	if (!strcmp(hptr->h_name, "localhost")) {
+	if (!xstrcmp(hostname, "localhost")) {
 		start_name = xshort_hostname();
 	} else {
-		start_name = xstrdup(hptr->h_name);
+		start_name = xstrdup(hostname);
 		dot_ptr = strchr(start_name, '.');
 		if (dot_ptr)
 			dot_ptr[0] = '\0';
@@ -2070,7 +2101,7 @@ extern uint16_t slurm_conf_get_port(const char *node_name)
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 			uint16_t port;
 			if (!p->port)
 				p->port = (uint16_t) conf_ptr->slurmd_port;
@@ -2100,7 +2131,7 @@ extern void slurm_reset_alias(char *node_name, char *node_addr,
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 			if (node_addr) {
 				xfree(p->address);
 				p->address = xstrdup(node_addr);
@@ -2134,7 +2165,7 @@ extern int slurm_conf_get_addr(const char *node_name, slurm_addr_t *address)
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 			if (!p->port)
 				p->port = (uint16_t) conf_ptr->slurmd_port;
 			if (!p->addr_initialized) {
@@ -2177,7 +2208,7 @@ extern int slurm_conf_get_cpus_bsct(const char *node_name,
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 		    	if (cpus)
 				*cpus    = p->cpus;
 			if (boards)
@@ -2217,7 +2248,7 @@ extern int slurm_conf_get_res_spec_info(const char *node_name,
 	idx = _get_hash_idx(node_name);
 	p = node_to_host_hashtbl[idx];
 	while (p) {
-		if (strcmp(p->alias, node_name) == 0) {
+		if (xstrcmp(p->alias, node_name) == 0) {
 			if (core_spec_cnt)
 				*cpu_spec_list = xstrdup(p->cpu_spec_list);
 			if (core_spec_cnt)
@@ -2321,9 +2352,12 @@ free_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr, bool purge_node_hash)
 	xfree (ctl_conf_ptr->licenses);
 	xfree (ctl_conf_ptr->licenses_used);
 	xfree (ctl_conf_ptr->mail_prog);
+	xfree (ctl_conf_ptr->mcs_plugin);
+	xfree (ctl_conf_ptr->mcs_plugin_params);
 	xfree (ctl_conf_ptr->mpi_default);
 	xfree (ctl_conf_ptr->mpi_params);
 	xfree (ctl_conf_ptr->msg_aggr_params);
+	xfree (ctl_conf_ptr->node_features_plugins);
 	xfree (ctl_conf_ptr->node_prefix);
 	xfree (ctl_conf_ptr->plugindir);
 	xfree (ctl_conf_ptr->plugstack);
@@ -2466,6 +2500,8 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
 	ctl_conf_ptr->max_job_id		= NO_VAL;
 	ctl_conf_ptr->max_mem_per_cpu           = 0;
 	ctl_conf_ptr->max_step_cnt		= (uint32_t) NO_VAL;
+	xfree(ctl_conf_ptr->mcs_plugin);
+	xfree(ctl_conf_ptr->mcs_plugin_params);
 	ctl_conf_ptr->mem_limit_enforce         = true;
 	ctl_conf_ptr->min_job_age = (uint32_t) NO_VAL;
 	xfree (ctl_conf_ptr->mpi_default);
@@ -2473,6 +2509,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
 	xfree (ctl_conf_ptr->msg_aggr_params);
 	ctl_conf_ptr->msg_timeout		= (uint16_t) NO_VAL;
 	ctl_conf_ptr->next_job_id		= (uint32_t) NO_VAL;
+	xfree(ctl_conf_ptr->node_features_plugins);
 	xfree (ctl_conf_ptr->node_prefix);
 	ctl_conf_ptr->over_time_limit           = 0;
 	xfree (ctl_conf_ptr->plugindir);
@@ -2545,6 +2582,7 @@ init_slurm_conf (slurm_ctl_conf_t *ctl_conf_ptr)
 	xfree (ctl_conf_ptr->task_plugin);
 	ctl_conf_ptr->task_plugin_param		= 0;
 	xfree (ctl_conf_ptr->task_prolog);
+	ctl_conf_ptr->tcp_timeout		= (uint16_t) NO_VAL;
 	xfree (ctl_conf_ptr->tmp_fs);
 	xfree (ctl_conf_ptr->topology_param);
 	xfree (ctl_conf_ptr->topology_plugin);
@@ -2601,7 +2639,7 @@ static int _config_is_storage(s_p_hashtbl_t *hashtbl, char *name)
 	conf_ptr->plugindir = xstrdup(default_plugin_path);
 	/* unlock conf_lock and set as initialized before accessing it */
 	conf_initialized = true;
-	pthread_mutex_unlock(&conf_lock);
+	slurm_mutex_unlock(&conf_lock);
 	db_conn = acct_storage_g_get_connection(NULL, 0, false, NULL);
 	if (db_conn == NULL)
 		goto end; /* plugin will out error itself */
@@ -2620,7 +2658,7 @@ static int _config_is_storage(s_p_hashtbl_t *hashtbl, char *name)
 
 end:
 	/* restore status quo now */
-	pthread_mutex_lock(&conf_lock);
+	slurm_mutex_lock(&conf_lock);
 	conf_initialized = false;
 	xfree(cluster);
 	xfree(conf_ptr->accounting_storage_type);
@@ -2703,10 +2741,10 @@ _destroy_slurm_conf(void)
 extern int
 slurm_conf_init(const char *file_name)
 {
-	pthread_mutex_lock(&conf_lock);
+	slurm_mutex_lock(&conf_lock);
 
 	if (conf_initialized) {
-		pthread_mutex_unlock(&conf_lock);
+		slurm_mutex_unlock(&conf_lock);
 		return SLURM_ERROR;
 	}
 
@@ -2715,7 +2753,7 @@ slurm_conf_init(const char *file_name)
 		fatal("Unable to process configuration file");
 	conf_initialized = true;
 
-	pthread_mutex_unlock(&conf_lock);
+	slurm_mutex_unlock(&conf_lock);
 	return SLURM_SUCCESS;
 }
 
@@ -2758,9 +2796,9 @@ slurm_conf_reinit(const char *file_name)
 {
 	int rc;
 
-	pthread_mutex_lock(&conf_lock);
+	slurm_mutex_lock(&conf_lock);
 	rc = _internal_reinit(file_name);
-	pthread_mutex_unlock(&conf_lock);
+	slurm_mutex_unlock(&conf_lock);
 
 	return rc;
 }
@@ -2783,16 +2821,16 @@ slurm_conf_install_fork_handlers(void)
 extern int
 slurm_conf_destroy(void)
 {
-	pthread_mutex_lock(&conf_lock);
+	slurm_mutex_lock(&conf_lock);
 
 	if (!conf_initialized) {
-		pthread_mutex_unlock(&conf_lock);
+		slurm_mutex_unlock(&conf_lock);
 		return SLURM_SUCCESS;
 	}
 
 	_destroy_slurm_conf();
 
-	pthread_mutex_unlock(&conf_lock);
+	slurm_mutex_unlock(&conf_lock);
 
 	return SLURM_SUCCESS;
 }
@@ -2800,7 +2838,7 @@ slurm_conf_destroy(void)
 extern slurm_ctl_conf_t *
 slurm_conf_lock(void)
 {
-	pthread_mutex_lock(&conf_lock);
+	slurm_mutex_lock(&conf_lock);
 
 	if (!conf_initialized) {
 		if (_init_slurm_conf(NULL) != SLURM_SUCCESS) {
@@ -2821,7 +2859,7 @@ slurm_conf_lock(void)
 extern void
 slurm_conf_unlock(void)
 {
-	pthread_mutex_unlock(&conf_lock);
+	slurm_mutex_unlock(&conf_lock);
 }
 
 /* Normalize supplied debug level to be in range per log.h definitions */
@@ -2845,18 +2883,18 @@ static uint16_t _health_node_state(char *state_str)
 
 	token = strtok_r(tmp_str, ",", &last);
 	while (token) {
-		if (!strcasecmp(token, "ANY")) {
+		if (!xstrcasecmp(token, "ANY")) {
 			state_num |= HEALTH_CHECK_NODE_ANY;
 			state_set = true;
-		} else if (!strcasecmp(token, "ALLOC")) {
+		} else if (!xstrcasecmp(token, "ALLOC")) {
 			state_num |= HEALTH_CHECK_NODE_ALLOC;
 			state_set = true;
-		} else if (!strcasecmp(token, "CYCLE")) {
+		} else if (!xstrcasecmp(token, "CYCLE")) {
 			state_num |= HEALTH_CHECK_CYCLE;
-		} else if (!strcasecmp(token, "IDLE")) {
+		} else if (!xstrcasecmp(token, "IDLE")) {
 			state_num |= HEALTH_CHECK_NODE_IDLE;
 			state_set = true;
-		} else if (!strcasecmp(token, "MIXED")) {
+		} else if (!xstrcasecmp(token, "MIXED")) {
 			state_num |= HEALTH_CHECK_NODE_MIXED;
 			state_set = true;
 		} else {
@@ -2896,7 +2934,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 
 	if (s_p_get_string(&conf->backup_controller, "BackupController",
 			   hashtbl)
-	    && strcasecmp("localhost", conf->backup_controller) == 0) {
+	    && xstrcasecmp("localhost", conf->backup_controller) == 0) {
 		xfree(conf->backup_controller);
 		conf->backup_controller = xmalloc (MAX_SLURM_NAME);
 		if (gethostname_short(conf->backup_controller, MAX_SLURM_NAME)){
@@ -2937,7 +2975,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 		error("ControlMachine not specified.");
 		return SLURM_ERROR;
 	}
-	else if (strcasecmp("localhost", conf->control_machine) == 0) {
+	else if (xstrcasecmp("localhost", conf->control_machine) == 0) {
 		xfree (conf->control_machine);
 		conf->control_machine = xmalloc(MAX_SLURM_NAME);
 		if (gethostname_short(conf->control_machine, MAX_SLURM_NAME)) {
@@ -2957,7 +2995,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	}
 
 	if ((conf->backup_controller != NULL) &&
-	    (strcmp(conf->backup_controller, conf->control_machine) == 0)) {
+	    (xstrcmp(conf->backup_controller, conf->control_machine) == 0)) {
 		error("ControlMachine and BackupController identical");
 		xfree(conf->backup_addr);
 		xfree(conf->backup_controller);
@@ -3039,27 +3077,28 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (s_p_get_string(&temp_str, "CpuFreqDef", hashtbl)) {
 		if (cpu_freq_verify_def(temp_str, &conf->cpu_freq_def)) {
 			error("Ignoring invalid CpuFreqDef: %s", temp_str);
-			conf->cpu_freq_def = CPU_FREQ_ONDEMAND;
+			conf->cpu_freq_def = NO_VAL;
 		}
 		xfree(temp_str);
 	} else {
-		conf->cpu_freq_def = CPU_FREQ_ONDEMAND;
+		conf->cpu_freq_def = NO_VAL;
 	}
 
 	if (s_p_get_string(&temp_str, "CpuFreqGovernors", hashtbl)) {
 		if (cpu_freq_verify_govlist(temp_str, &conf->cpu_freq_govs)) {
 			error("Ignoring invalid CpuFreqGovernors: %s",
 				temp_str);
-			conf->cpu_freq_govs = CPU_FREQ_ONDEMAND;
+			conf->cpu_freq_govs = CPU_FREQ_ONDEMAND |
+					      CPU_FREQ_PERFORMANCE;
 		}
 		xfree(temp_str);
 	} else {
-		conf->cpu_freq_govs = CPU_FREQ_ONDEMAND;
+		conf->cpu_freq_govs = CPU_FREQ_ONDEMAND | CPU_FREQ_PERFORMANCE;
 	}
 
 	if (!s_p_get_string(&conf->crypto_type, "CryptoType", hashtbl))
 		 conf->crypto_type = xstrdup(DEFAULT_CRYPTO_TYPE);
-	if ((strcmp(conf->crypto_type, "crypto/openssl") == 0) &&
+	if ((xstrcmp(conf->crypto_type, "crypto/openssl") == 0) &&
 	    ((conf->job_credential_private_key == NULL) ||
 	     (conf->job_credential_public_certificate == NULL))) {
 		error("CryptoType=crypto/openssl requires that both "
@@ -3088,9 +3127,19 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 			     "DisableRootJobs", hashtbl))
 		conf->disable_root_jobs = DEFAULT_DISABLE_ROOT_JOBS;
 
-	if (!s_p_get_boolean((bool *) &conf->enforce_part_limits,
-			     "EnforcePartLimits", hashtbl))
+	if (s_p_get_string(&temp_str,
+			   "EnforcePartLimits", hashtbl)) {
+		uint16_t enforce_param;
+		if (parse_part_enforce_type(temp_str, &enforce_param) < 0) {
+			error("Bad EnforcePartLimits: %s", temp_str);
+			xfree(temp_str);
+			return SLURM_ERROR;
+		}
+		xfree(temp_str);
+		conf->enforce_part_limits = enforce_param;
+	} else {
 		conf->enforce_part_limits = DEFAULT_ENFORCE_PART_LIMITS;
+	}
 
 	s_p_get_string(&conf->epilog, "Epilog", hashtbl);
 
@@ -3154,7 +3203,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 
 	if (!s_p_get_string(&conf->job_comp_type, "JobCompType", hashtbl)) {
 		if (default_storage_type) {
-			if (!strcasecmp("slurmdbd", default_storage_type)) {
+			if (!xstrcasecmp("slurmdbd", default_storage_type)) {
 				error("Can not use the default storage type "
 				      "specified for jobcomp since there is "
 				      "not slurmdbd type.  We are using %s "
@@ -3173,7 +3222,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (!s_p_get_string(&conf->job_comp_loc, "JobCompLoc", hashtbl)) {
 		if (default_storage_loc)
 			conf->job_comp_loc = xstrdup(default_storage_loc);
-		else if (!strcmp(conf->job_comp_type, "jobcomp/mysql"))
+		else if (!xstrcmp(conf->job_comp_type, "jobcomp/mysql"))
 			conf->job_comp_loc = xstrdup(DEFAULT_JOB_COMP_DB);
 		else
 			conf->job_comp_loc = xstrdup(DEFAULT_JOB_COMP_LOC);
@@ -3202,7 +3251,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 			    hashtbl)) {
 		if (default_storage_port)
 			conf->job_comp_port = default_storage_port;
-		else if (!strcmp(conf->job_comp_type, "job_comp/mysql"))
+		else if (!xstrcmp(conf->job_comp_type, "job_comp/mysql"))
 			conf->job_comp_port = DEFAULT_MYSQL_PORT;
 		else
 			conf->job_comp_port = DEFAULT_STORAGE_PORT;
@@ -3335,6 +3384,30 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 		conf->max_tasks_per_node = DEFAULT_MAX_TASKS_PER_NODE;
 	}
 
+	s_p_get_string(&conf->mcs_plugin_params, "MCSParameters", hashtbl);
+	if (!s_p_get_string(&conf->mcs_plugin, "MCSPlugin", hashtbl)) {
+		conf->mcs_plugin = xstrdup(DEFAULT_MCS_PLUGIN);
+		if (conf->mcs_plugin_params) {
+			/* no plugin mcs and a mcs plugin param */
+			error("MCSParameters=%s used and no MCSPlugin",
+				conf->mcs_plugin_params);
+			return SLURM_ERROR;
+		}
+	}
+	if (conf->mcs_plugin_params &&
+	    !xstrcmp(conf->mcs_plugin, "mcs/none")) {
+		/* plugin mcs none and a mcs plugin param */
+		info("WARNING: MCSParameters=%s can't be used with"
+			"MCSPlugin=mcs/none",
+			conf->mcs_plugin_params);
+	}
+	if (!conf->mcs_plugin_params &&
+	    !xstrcmp(conf->mcs_plugin, "mcs/group")) {
+		/* plugin mcs/group and no mcs plugin param */
+		 error("MCSPlugin is mcs/group and no MCSParameters");
+		 return SLURM_ERROR;
+	}
+
 	if (!s_p_get_uint16(&conf->msg_timeout, "MessageTimeout", hashtbl))
 		conf->msg_timeout = DEFAULT_MSG_TIMEOUT;
 	else if (conf->msg_timeout > 100) {
@@ -3386,6 +3459,9 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 				xstrdup(DEFAULT_ACCOUNTING_STORAGE_TYPE);
 	}
 
+	s_p_get_string(&conf->node_features_plugins, "NodeFeaturesPlugins",
+		       hashtbl);
+
 	if (!s_p_get_string(&conf->accounting_storage_tres,
 			    "AccountingStorageTRES", hashtbl))
 		conf->accounting_storage_tres =
@@ -3480,7 +3556,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 		if (default_storage_loc)
 			conf->accounting_storage_loc =
 				xstrdup(default_storage_loc);
-		else if (!strcmp(conf->accounting_storage_type,
+		else if (!xstrcmp(conf->accounting_storage_type,
 				 "accounting_storage/mysql"))
 			conf->accounting_storage_loc =
 				xstrdup(DEFAULT_ACCOUNTING_DB);
@@ -3513,10 +3589,10 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 			    "AccountingStoragePort", hashtbl)) {
 		if (default_storage_port)
 			conf->accounting_storage_port = default_storage_port;
-		else if (!strcmp(conf->accounting_storage_type,
+		else if (!xstrcmp(conf->accounting_storage_type,
 				"accounting_storage/slurmdbd"))
 			conf->accounting_storage_port = SLURMDBD_PORT;
-		else if (!strcmp(conf->accounting_storage_type,
+		else if (!xstrcmp(conf->accounting_storage_type,
 			  "accounting_storage/mysql"))
 			conf->accounting_storage_port = DEFAULT_MYSQL_PORT;
 		else
@@ -3524,7 +3600,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	}
 
 	/* remove the user and loc if using slurmdbd */
-	if (!strcmp(conf->accounting_storage_type,
+	if (!xstrcmp(conf->accounting_storage_type,
 		   "accounting_storage/slurmdbd")) {
 		xfree(conf->accounting_storage_loc);
 		conf->accounting_storage_loc = xstrdup("N/A");
@@ -3564,21 +3640,21 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	}
 	if (!s_p_get_string(&conf->preempt_type, "PreemptType", hashtbl))
 		conf->preempt_type = xstrdup(DEFAULT_PREEMPT_TYPE);
-	if (strcmp(conf->preempt_type, "preempt/qos") == 0) {
+	if (xstrcmp(conf->preempt_type, "preempt/qos") == 0) {
 		int preempt_mode = conf->preempt_mode & (~PREEMPT_MODE_GANG);
 		if (preempt_mode == PREEMPT_MODE_OFF) {
 			error("PreemptType and PreemptMode values "
 			      "incompatible");
 			return SLURM_ERROR;
 		}
-	} else if (strcmp(conf->preempt_type, "preempt/partition_prio") == 0) {
+	} else if (xstrcmp(conf->preempt_type, "preempt/partition_prio") == 0) {
 		int preempt_mode = conf->preempt_mode & (~PREEMPT_MODE_GANG);
 		if (preempt_mode == PREEMPT_MODE_OFF) {
 			error("PreemptType and PreemptMode values "
 			      "incompatible");
 			return SLURM_ERROR;
 		}
-	} else if (strcmp(conf->preempt_type, "preempt/none") == 0) {
+	} else if (xstrcmp(conf->preempt_type, "preempt/none") == 0) {
 		int preempt_mode = conf->preempt_mode & (~PREEMPT_MODE_GANG);
 		if (preempt_mode != PREEMPT_MODE_OFF) {
 			error("PreemptType and PreemptMode values "
@@ -3659,19 +3735,19 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 
 
 	if (s_p_get_string(&temp_str, "PriorityUsageResetPeriod", hashtbl)) {
-		if (strcasecmp(temp_str, "none") == 0)
+		if (xstrcasecmp(temp_str, "none") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_NONE;
-		else if (strcasecmp(temp_str, "now") == 0)
+		else if (xstrcasecmp(temp_str, "now") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_NOW;
-		else if (strcasecmp(temp_str, "daily") == 0)
+		else if (xstrcasecmp(temp_str, "daily") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_DAILY;
-		else if (strcasecmp(temp_str, "weekly") == 0)
+		else if (xstrcasecmp(temp_str, "weekly") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_WEEKLY;
-		else if (strcasecmp(temp_str, "monthly") == 0)
+		else if (xstrcasecmp(temp_str, "monthly") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_MONTHLY;
-		else if (strcasecmp(temp_str, "quarterly") == 0)
+		else if (xstrcasecmp(temp_str, "quarterly") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_QUARTERLY;
-		else if (strcasecmp(temp_str, "yearly") == 0)
+		else if (xstrcasecmp(temp_str, "yearly") == 0)
 			conf->priority_reset_period = PRIORITY_RESET_YEARLY;
 		else {
 			error("Bad value \"%s\" for PriorityUsageResetPeriod",
@@ -3731,31 +3807,22 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 		conf->switch_type = xstrdup(DEFAULT_SWITCH_TYPE);
 
 	if (!s_p_get_string(&conf->proctrack_type, "ProctrackType", hashtbl)) {
-		if (!strcmp(conf->switch_type,"switch/elan"))
-			conf->proctrack_type = xstrdup("proctrack/rms");
-		else
-			conf->proctrack_type =
-				xstrdup(DEFAULT_PROCTRACK_TYPE);
+		conf->proctrack_type = xstrdup(DEFAULT_PROCTRACK_TYPE);
 	}
 #ifdef HAVE_NATIVE_CRAY
-	if (strcmp(conf->proctrack_type, "proctrack/cray")) {
+	if (xstrcmp(conf->proctrack_type, "proctrack/cray")) {
 		error("On a native Cray ProctrackType=proctrack/cray "
 		      "is required");
 		return SLURM_ERROR;
 	}
 #else
 #ifdef HAVE_REAL_CRAY
-	if (strcmp(conf->proctrack_type, "proctrack/sgi_job")) {
+	if (xstrcmp(conf->proctrack_type, "proctrack/sgi_job")) {
 		error("On Cray ProctrackType=proctrack/sgi_job is required");
 		return SLURM_ERROR;
 	}
 #endif
 #endif
-	if ((!strcmp(conf->switch_type, "switch/elan"))
-	    && (!strcmp(conf->proctrack_type,"proctrack/linuxproc"))) {
-		error("proctrack/linuxproc is incompatible with switch/elan");
-		return SLURM_ERROR;
-	}
 
 	conf->private_data = 0; /* Set to default before parsing PrivateData */
 	if (s_p_get_string(&temp_str, "PrivateData", hashtbl)) {
@@ -3894,10 +3961,10 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (!s_p_get_string(&conf->schedtype, "SchedulerType", hashtbl))
 		conf->schedtype = xstrdup(DEFAULT_SCHEDTYPE);
 
-	if (strcmp(conf->priority_type, "priority/multifactor") == 0) {
+	if (xstrcmp(conf->priority_type, "priority/multifactor") == 0) {
 		if (tot_prio_weight &&
-		    (!strcmp(conf->schedtype, "sched/wiki") ||
-		     !strcmp(conf->schedtype, "sched/wiki2"))) {
+		    (!xstrcmp(conf->schedtype, "sched/wiki") ||
+		     !xstrcmp(conf->schedtype, "sched/wiki2"))) {
 			error("PriorityType=priority/multifactor is "
 			      "incompatible with SchedulerType=%s",
 			      conf->schedtype);
@@ -3906,8 +3973,8 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	}
 
 	if (conf->preempt_mode) {
-		if ((strcmp(conf->schedtype, "sched/wiki")  == 0) ||
-		    (strcmp(conf->schedtype, "sched/wiki2") == 0)) {
+		if ((xstrcmp(conf->schedtype, "sched/wiki")  == 0) ||
+		    (xstrcmp(conf->schedtype, "sched/wiki2") == 0)) {
 			error("Job preemption is incompatible with "
 			      "SchedulerType=%s",
 			      conf->schedtype);
@@ -4088,7 +4155,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (!s_p_get_uint16(&conf->suspend_rate, "SuspendRate", hashtbl))
 		conf->suspend_rate = DEFAULT_SUSPEND_RATE;
 	if (s_p_get_string(&temp_str, "SuspendTime", hashtbl)) {
-		if (!strcasecmp(temp_str, "NONE"))
+		if (!xstrcasecmp(temp_str, "NONE"))
 			long_suspend_time = -1;
 		else
 			long_suspend_time = atoi(temp_str);
@@ -4097,7 +4164,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 			error("SuspendTime value (%ld) is less than -1",
 			      long_suspend_time);
 		} else if ((long_suspend_time > -1) &&
-			   (!strcmp(conf->select_type, "select/bluegene"))) {
+			   (!xstrcmp(conf->select_type, "select/bluegene"))) {
 			error("SuspendTime (power save mode) incompatible with "
 			      "select/bluegene");
 			return SLURM_ERROR;
@@ -4114,7 +4181,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (!s_p_get_string(&conf->task_plugin, "TaskPlugin", hashtbl))
 		conf->task_plugin = xstrdup(DEFAULT_TASK_PLUGIN);
 #ifdef HAVE_FRONT_END
-	if (strcmp(conf->task_plugin, "task/none")) {
+	if (xstrcmp(conf->task_plugin, "task/none")) {
 		error("On FrontEnd systems TaskPlugin=task/none is required");
 		return SLURM_ERROR;
 	}
@@ -4125,49 +4192,49 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 		bool set_mode = false, set_unit = false, set_auto = false;
 		tok = strtok_r(temp_str, ",", &last);
 		while (tok) {
-			if (strcasecmp(tok, "none") == 0) {
+			if (xstrcasecmp(tok, "none") == 0) {
 				if (set_unit) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_unit = true;
 				conf->task_plugin_param |= CPU_BIND_NONE;
-			} else if (strcasecmp(tok, "boards") == 0) {
+			} else if (xstrcasecmp(tok, "boards") == 0) {
 				if (set_unit) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_unit = true;
 				conf->task_plugin_param |= CPU_BIND_TO_BOARDS;
-			} else if (strcasecmp(tok, "sockets") == 0) {
+			} else if (xstrcasecmp(tok, "sockets") == 0) {
 				if (set_unit) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_unit = true;
 				conf->task_plugin_param |= CPU_BIND_TO_SOCKETS;
-			} else if (strcasecmp(tok, "cores") == 0) {
+			} else if (xstrcasecmp(tok, "cores") == 0) {
 				if (set_unit) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_unit = true;
 				conf->task_plugin_param |= CPU_BIND_TO_CORES;
-			} else if (strcasecmp(tok, "threads") == 0) {
+			} else if (xstrcasecmp(tok, "threads") == 0) {
 				if (set_unit) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_unit = true;
 				conf->task_plugin_param |= CPU_BIND_TO_THREADS;
-			} else if (strcasecmp(tok, "cpusets") == 0) {
+			} else if (xstrcasecmp(tok, "cpusets") == 0) {
 				if (set_mode) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
 				}
 				set_mode = true;
 				conf->task_plugin_param |= CPU_BIND_CPUSETS;
-			} else if (strcasecmp(tok, "sched") == 0) {
+			} else if (xstrcasecmp(tok, "sched") == 0) {
 				if (set_mode) {
 					error("Bad TaskPluginParam: %s", tok);
 					return SLURM_ERROR;
@@ -4175,7 +4242,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 				set_mode = true;
 				/* No change to task_plugin_param,
 				 * this is the default */
-			} else if (strcasecmp(tok, "verbose") == 0) {
+			} else if (xstrcasecmp(tok, "verbose") == 0) {
 				conf->task_plugin_param |= CPU_BIND_VERBOSE;
 			} else if (strncasecmp(tok, "autobind=",
 						strlen("autobind=")) == 0) {
@@ -4187,17 +4254,20 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 					return SLURM_ERROR;
 				}
 
-				if (strcasecmp(val_ptr, "none") == 0) {
+				if (xstrcasecmp(val_ptr, "none") == 0) {
 					set_auto = true;
-				} else if (strcasecmp(val_ptr, "threads") == 0) {
+				} else if (xstrcasecmp(val_ptr,
+						       "threads") == 0) {
 					set_auto = true;
 					conf->task_plugin_param |=
 						CPU_AUTO_BIND_TO_THREADS;
-				} else if (strcasecmp(val_ptr, "cores") == 0) {
+				} else if (xstrcasecmp(val_ptr,
+						       "cores") == 0) {
 					set_auto = true;
 					conf->task_plugin_param |=
 						CPU_AUTO_BIND_TO_CORES;
-				} else if (strcasecmp(val_ptr, "sockets") == 0) {
+				} else if (xstrcasecmp(val_ptr,
+						       "sockets") == 0) {
 					set_auto = true;
 					conf->task_plugin_param |=
 						CPU_AUTO_BIND_TO_SOCKETS;
@@ -4218,6 +4288,9 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	s_p_get_string(&conf->task_epilog, "TaskEpilog", hashtbl);
 	s_p_get_string(&conf->task_prolog, "TaskProlog", hashtbl);
 
+	if (!s_p_get_uint16(&conf->tcp_timeout, "TCPTimeout", hashtbl))
+		conf->tcp_timeout = DEFAULT_TCP_TIMEOUT;
+
 	if (!s_p_get_string(&conf->tmp_fs, "TmpFS", hashtbl))
 		conf->tmp_fs = xstrdup(DEFAULT_TMP_FS);
 
@@ -4229,7 +4302,7 @@ _validate_and_set_defaults(slurm_ctl_conf_t *conf, s_p_hashtbl_t *hashtbl)
 	if (!s_p_get_string(&conf->topology_plugin, "TopologyPlugin", hashtbl))
 		conf->topology_plugin = xstrdup(DEFAULT_TOPOLOGY_PLUGIN);
 #ifdef HAVE_BG
-	if (strcmp(conf->topology_plugin, "topology/none")) {
+	if (xstrcmp(conf->topology_plugin, "topology/none")) {
 		error("On IBM BlueGene systems TopologyPlugin=topology/none "
 		      "is required");
 		return SLURM_ERROR;
@@ -4373,11 +4446,11 @@ extern uint16_t prolog_str2flags(char *prolog_flags)
 	tmp_str = xstrdup(prolog_flags);
 	tok = strtok_r(tmp_str, ",", &last);
 	while (tok) {
-		if (strcasecmp(tok, "Alloc") == 0)
+		if (xstrcasecmp(tok, "Alloc") == 0)
 			rc |= PROLOG_FLAG_ALLOC;
-		else if (strcasecmp(tok, "Contain") == 0)
+		else if (xstrcasecmp(tok, "Contain") == 0)
 			rc |= (PROLOG_FLAG_ALLOC | PROLOG_FLAG_CONTAIN);
-		else if (strcasecmp(tok, "NoHold") == 0)
+		else if (xstrcasecmp(tok, "NoHold") == 0)
 			rc |= PROLOG_FLAG_NOHOLD;
 		else {
 			error("Invalid PrologFlag: %s", tok);
@@ -4553,6 +4626,11 @@ extern char * debug_flags2str(uint64_t debug_flags)
 			xstrcat(rc, ",");
 		xstrcat(rc, "JobContainer");
 	}
+	if (debug_flags & DEBUG_FLAG_NODE_FEATURES) {
+		if (rc)
+			xstrcat(rc, ",");
+		xstrcat(rc, "NodeFeatures");
+	}
 	if (debug_flags & DEBUG_FLAG_LICENSE) {
 		if (rc)
 			xstrcat(rc, ",");
@@ -4603,11 +4681,6 @@ extern char * debug_flags2str(uint64_t debug_flags)
 			xstrcat(rc, ",");
 		xstrcat(rc, "SelectType");
 	}
-	if (debug_flags & DEBUG_FLAG_SICP) {
-		if (rc)
-			xstrcat(rc, ",");
-		xstrcat(rc, "SICP");
-	}
 	if (debug_flags & DEBUG_FLAG_STEPS) {
 		if (rc)
 			xstrcat(rc, ",");
@@ -4623,12 +4696,16 @@ extern char * debug_flags2str(uint64_t debug_flags)
 			xstrcat(rc, ",");
 		xstrcat(rc, "Task");
 	}
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		if (rc)
+			xstrcat(rc, ",");
+		xstrcat(rc, "TimeCray");
+	}
 	if (debug_flags & DEBUG_FLAG_TRACE_JOBS) {
 		if (rc)
 			xstrcat(rc, ",");
 		xstrcat(rc, "TraceJobs");
 	}
-
 	if (debug_flags & DEBUG_FLAG_TRIGGERS) {
 		if (rc)
 			xstrcat(rc, ",");
@@ -4663,102 +4740,104 @@ extern int debug_str2flags(char *debug_flags, uint64_t *flags_out)
 	tmp_str = xstrdup(debug_flags);
 	tok = strtok_r(tmp_str, ",", &last);
 	while (tok) {
-		if (strcasecmp(tok, "Backfill") == 0)
+		if (xstrcasecmp(tok, "Backfill") == 0)
 			(*flags_out) |= DEBUG_FLAG_BACKFILL;
-		else if (strcasecmp(tok, "BackfillMap") == 0)
+		else if (xstrcasecmp(tok, "BackfillMap") == 0)
 			(*flags_out) |= DEBUG_FLAG_BACKFILL_MAP;
-		else if (strcasecmp(tok, "BGBlockAlgo") == 0)
+		else if (xstrcasecmp(tok, "BGBlockAlgo") == 0)
 			(*flags_out) |= DEBUG_FLAG_BG_ALGO;
-		else if (strcasecmp(tok, "BGBlockAlgoDeep") == 0)
+		else if (xstrcasecmp(tok, "BGBlockAlgoDeep") == 0)
 			(*flags_out) |= DEBUG_FLAG_BG_ALGO_DEEP;
-		else if (strcasecmp(tok, "BGBlockPick") == 0)
+		else if (xstrcasecmp(tok, "BGBlockPick") == 0)
 			(*flags_out) |= DEBUG_FLAG_BG_PICK;
-		else if (strcasecmp(tok, "BGBlockWires") == 0)
+		else if (xstrcasecmp(tok, "BGBlockWires") == 0)
 			(*flags_out) |= DEBUG_FLAG_BG_WIRES;
-		else if (strcasecmp(tok, "BurstBuffer") == 0)
+		else if (xstrcasecmp(tok, "BurstBuffer") == 0)
 			(*flags_out) |= DEBUG_FLAG_BURST_BUF;
-		else if (strcasecmp(tok, "CPU_Bind") == 0)
+		else if (xstrcasecmp(tok, "CPU_Bind") == 0)
 			(*flags_out) |= DEBUG_FLAG_CPU_BIND;
-		else if (strcasecmp(tok, "DB_Archive") == 0)
+		else if (xstrcasecmp(tok, "DB_Archive") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_ARCHIVE;
-		else if (strcasecmp(tok, "DB_Assoc") == 0)
+		else if (xstrcasecmp(tok, "DB_Assoc") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_ASSOC;
-		else if (strcasecmp(tok, "DB_TRES") == 0)
+		else if (xstrcasecmp(tok, "DB_TRES") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_TRES;
-		else if (strcasecmp(tok, "DB_Event") == 0)
+		else if (xstrcasecmp(tok, "DB_Event") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_EVENT;
-		else if (strcasecmp(tok, "DB_Job") == 0)
+		else if (xstrcasecmp(tok, "DB_Job") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_JOB;
-		else if (strcasecmp(tok, "DB_QOS") == 0)
+		else if (xstrcasecmp(tok, "DB_QOS") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_QOS;
-		else if (strcasecmp(tok, "DB_Query") == 0)
+		else if (xstrcasecmp(tok, "DB_Query") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_QUERY;
-		else if (strcasecmp(tok, "DB_Reservation") == 0)
+		else if (xstrcasecmp(tok, "DB_Reservation") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_RESV;
-		else if (strcasecmp(tok, "DB_Resource") == 0)
+		else if (xstrcasecmp(tok, "DB_Resource") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_RES;
-		else if (strcasecmp(tok, "DB_Step") == 0)
+		else if (xstrcasecmp(tok, "DB_Step") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_STEP;
-		else if (strcasecmp(tok, "DB_Usage") == 0)
+		else if (xstrcasecmp(tok, "DB_Usage") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_USAGE;
-		else if (strcasecmp(tok, "DB_WCKey") == 0)
+		else if (xstrcasecmp(tok, "DB_WCKey") == 0)
 			(*flags_out) |= DEBUG_FLAG_DB_WCKEY;
-		else if (strcasecmp(tok, "Elasticsearch") == 0)
+		else if (xstrcasecmp(tok, "Elasticsearch") == 0)
 			(*flags_out) |= DEBUG_FLAG_ESEARCH;
-		else if (strcasecmp(tok, "Energy") == 0)
+		else if (xstrcasecmp(tok, "Energy") == 0)
 			(*flags_out) |= DEBUG_FLAG_ENERGY;
-		else if (strcasecmp(tok, "ExtSensors") == 0)
+		else if (xstrcasecmp(tok, "ExtSensors") == 0)
 			(*flags_out) |= DEBUG_FLAG_EXT_SENSORS;
-		else if (strcasecmp(tok, "FrontEnd") == 0)
+		else if (xstrcasecmp(tok, "FrontEnd") == 0)
 			(*flags_out) |= DEBUG_FLAG_FRONT_END;
-		else if (strcasecmp(tok, "Gang") == 0)
+		else if (xstrcasecmp(tok, "Gang") == 0)
 			(*flags_out) |= DEBUG_FLAG_GANG;
-		else if (strcasecmp(tok, "Gres") == 0)
+		else if (xstrcasecmp(tok, "Gres") == 0)
 			(*flags_out) |= DEBUG_FLAG_GRES;
-		else if (strcasecmp(tok, "Infiniband") == 0)
+		else if (xstrcasecmp(tok, "Infiniband") == 0)
 			(*flags_out) |= DEBUG_FLAG_INFINIBAND;
-		else if (strcasecmp(tok, "Filesystem") == 0)
+		else if (xstrcasecmp(tok, "Filesystem") == 0)
 			(*flags_out) |= DEBUG_FLAG_FILESYSTEM;
-		else if (strcasecmp(tok, "JobContainer") == 0)
+		else if (xstrcasecmp(tok, "JobContainer") == 0)
 			(*flags_out) |= DEBUG_FLAG_JOB_CONT;
-		else if (strcasecmp(tok, "License") == 0)
+		else if (xstrcasecmp(tok, "License") == 0)
 			(*flags_out) |= DEBUG_FLAG_LICENSE;
-		else if (strcasecmp(tok, "NO_CONF_HASH") == 0)
+		else if (xstrcasecmp(tok, "NO_CONF_HASH") == 0)
 			(*flags_out) |= DEBUG_FLAG_NO_CONF_HASH;
-		else if (strcasecmp(tok, "NoRealTime") == 0)
+		else if (xstrcasecmp(tok, "NodeFeatures") == 0)
+			(*flags_out) |= DEBUG_FLAG_NODE_FEATURES;
+		else if (xstrcasecmp(tok, "NoRealTime") == 0)
 			(*flags_out) |= DEBUG_FLAG_NO_REALTIME;
-		else if (strcasecmp(tok, "Priority") == 0)
+		else if (xstrcasecmp(tok, "Priority") == 0)
 			(*flags_out) |= DEBUG_FLAG_PRIO;
-		else if (strcasecmp(tok, "Profile") == 0)
+		else if (xstrcasecmp(tok, "Profile") == 0)
 			(*flags_out) |= DEBUG_FLAG_PROFILE;
-		else if (strcasecmp(tok, "Protocol") == 0)
+		else if (xstrcasecmp(tok, "Protocol") == 0)
 			(*flags_out) |= DEBUG_FLAG_PROTOCOL;
-		else if (strcasecmp(tok, "Reservation") == 0)
+		else if (xstrcasecmp(tok, "Reservation") == 0)
 			(*flags_out) |= DEBUG_FLAG_RESERVATION;
-		else if (strcasecmp(tok, "Route") == 0)
+		else if (xstrcasecmp(tok, "Route") == 0)
 			(*flags_out) |= DEBUG_FLAG_ROUTE;
-		else if (strcasecmp(tok, "SelectType") == 0)
+		else if (xstrcasecmp(tok, "SelectType") == 0)
 			(*flags_out) |= DEBUG_FLAG_SELECT_TYPE;
-		else if (strcasecmp(tok, "SICP") == 0)
-			(*flags_out) |= DEBUG_FLAG_SICP;
-		else if (strcasecmp(tok, "Steps") == 0)
+		else if (xstrcasecmp(tok, "Steps") == 0)
 			(*flags_out) |= DEBUG_FLAG_STEPS;
-		else if (strcasecmp(tok, "Switch") == 0)
+		else if (xstrcasecmp(tok, "Switch") == 0)
 			(*flags_out) |= DEBUG_FLAG_SWITCH;
-		else if (strcasecmp(tok, "Task") == 0)
+		else if (xstrcasecmp(tok, "Task") == 0)
 			(*flags_out) |= DEBUG_FLAG_TASK;
-		else if (strcasecmp(tok, "TraceJobs") == 0)
+		else if (xstrcasecmp(tok, "TraceJobs") == 0)
 			(*flags_out) |= DEBUG_FLAG_TRACE_JOBS;
-		else if (strcasecmp(tok, "Trigger") == 0)
+		else if (xstrcasecmp(tok, "Trigger") == 0)
 			(*flags_out) |= DEBUG_FLAG_TRIGGERS;
-		else if (strcasecmp(tok, "Triggers") == 0)
+		else if (xstrcasecmp(tok, "Triggers") == 0)
 			(*flags_out) |= DEBUG_FLAG_TRIGGERS;
-		else if (strcasecmp(tok, "Wiki") == 0)
+		else if (xstrcasecmp(tok, "Wiki") == 0)
 			(*flags_out) |= DEBUG_FLAG_WIKI;
-		else if (strcasecmp(tok, "CpuFrequency") == 0)
+		else if (xstrcasecmp(tok, "CpuFrequency") == 0)
 			(*flags_out) |= DEBUG_FLAG_CPU_FREQ;
-		else if (strcasecmp(tok, "Power") == 0)
+		else if (xstrcasecmp(tok, "Power") == 0)
 			(*flags_out) |= DEBUG_FLAG_POWER;
+		else if (xstrcasecmp(tok, "TimeCray") == 0)
+			(*flags_out) |= DEBUG_FLAG_TIME_CRAY;
 		else {
 			error("Invalid DebugFlag: %s", tok);
 			(*flags_out) = 0;
@@ -4810,9 +4889,9 @@ extern uint16_t reconfig_str2flags(char *reconfig_flags)
 	tmp_str = xstrdup(reconfig_flags);
 	tok = strtok_r(tmp_str, ",", &last);
 	while (tok) {
-		if (strcasecmp(tok, "KeepPartInfo") == 0)
+		if (xstrcasecmp(tok, "KeepPartInfo") == 0)
 			rc |= RECONFIG_KEEP_PART_INFO;
-		else if (strcasecmp(tok, "KeepPartState") == 0)
+		else if (xstrcasecmp(tok, "KeepPartState") == 0)
 			rc |= RECONFIG_KEEP_PART_STAT;
 		else {
 			error("Invalid ReconfigFlag: %s", tok);
@@ -4867,7 +4946,7 @@ extern int sort_key_pairs(void *v1, void *v2)
 	config_key_pair_t *key_a = *(config_key_pair_t **)v1;
 	config_key_pair_t *key_b = *(config_key_pair_t **)v2;
 
-	int size_a = strcmp(key_a->name, key_b->name);
+	int size_a = xstrcmp(key_a->name, key_b->name);
 
 	if (size_a < 0)
 		return -1;
@@ -4905,7 +4984,7 @@ extern bool run_in_daemon(char *daemons)
 
 	xassert(slurm_prog_name);
 
-	if (!strcmp(daemons, slurm_prog_name))
+	if (!xstrcmp(daemons, slurm_prog_name))
 		return true;
 
 	full = xstrdup(daemons);
@@ -4913,7 +4992,7 @@ extern bool run_in_daemon(char *daemons)
 
 	while (start_char && (end_char = strstr(start_char, ","))) {
 		*end_char = 0;
-		if (!strcmp(start_char, slurm_prog_name)) {
+		if (!xstrcmp(start_char, slurm_prog_name)) {
 			xfree(full);
 			return true;
 		}
@@ -4921,7 +5000,7 @@ extern bool run_in_daemon(char *daemons)
 		start_char = end_char + 1;
 	}
 
-	if (start_char && !strcmp(start_char, slurm_prog_name)) {
+	if (start_char && !xstrcmp(start_char, slurm_prog_name)) {
 		xfree(full);
 		return true;
 	}
diff --git a/src/common/read_config.h b/src/common/read_config.h
index 0883c3968..7609e4e28 100644
--- a/src/common/read_config.h
+++ b/src/common/read_config.h
@@ -5,7 +5,7 @@
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
  *  Portions Copyright (C) 2008 Vijay Ramasubramanian.
- *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Mette <jette1@llnl.gov>.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -75,7 +75,7 @@ extern char *default_plugstack;
 #define DEFAULT_FAST_SCHEDULE       1
 #define DEFAULT_FIRST_JOB_ID        1
 #define DEFAULT_GET_ENV_TIMEOUT     2
-#define DEFAULT_GROUP_INFO          600
+#define DEFAULT_GROUP_INFO          (GROUP_FORCE | 600)
 /* NOTE: DEFAULT_INACTIVE_LIMIT must be 0 for Blue Gene/L systems */
 #define DEFAULT_INACTIVE_LIMIT      0
 #define DEFAULT_JOB_ACCT_GATHER_TYPE  "jobacct_gather/none"
@@ -120,6 +120,7 @@ extern char *default_plugstack;
 #define DEFAULT_MAX_JOB_COUNT       10000
 #define DEFAULT_MAX_JOB_ID          0x7fff0000
 #define DEFAULT_MAX_STEP_COUNT      40000
+#define DEFAULT_MCS_PLUGIN          "mcs/none"
 #define DEFAULT_MEM_PER_CPU         0
 #define DEFAULT_MAX_MEM_PER_CPU     0
 #define DEFAULT_MIN_JOB_AGE         300
@@ -182,6 +183,7 @@ extern char *default_plugstack;
 #  define DEFAULT_SWITCH_TYPE         "switch/none"
 #endif
 #define DEFAULT_TASK_PLUGIN         "task/none"
+#define DEFAULT_TCP_TIMEOUT         2
 #define DEFAULT_TMP_FS              "/tmp"
 #if defined HAVE_3D && !defined HAVE_ALPS_CRAY
 #  define DEFAULT_TOPOLOGY_PLUGIN     "topology/3d_torus"
@@ -270,7 +272,8 @@ typedef struct slurm_conf_partition {
 	char	*name;		/* name of the partition */
 	char 	*nodes;		/* comma delimited list names of nodes */
 	uint16_t preempt_mode;	/* See PREEMPT_MODE_* in slurm/slurm.h */
-	uint16_t priority;	/* scheduling priority for jobs */
+	uint16_t priority_job_factor;	/* job priority weight factor */
+	uint16_t priority_tier;	/* tier for scheduling and preemption */
 	char    *qos_char;      /* Name of QOS associated with partition */
 	bool     req_resv_flag; /* 1 if partition can only be used in a
 				 * reservation */
@@ -576,4 +579,8 @@ extern char *get_extra_conf_path(char *conf_name);
  */
 extern bool run_in_daemon(char *daemons);
 
+/* Translate a job constraint specification into a node feature specification
+ * RET - String MUST be xfreed */
+extern char *xlate_features(char *job_features);
+
 #endif /* !_READ_CONFIG_H */
diff --git a/src/common/safeopen.c b/src/common/safeopen.c
index 2a52d7593..6ad97d105 100644
--- a/src/common/safeopen.c
+++ b/src/common/safeopen.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  safeopen.c - safer interface to open()
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/safeopen.h b/src/common/safeopen.h
index 0b67f15ed..35b610915 100644
--- a/src/common/safeopen.h
+++ b/src/common/safeopen.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  safeopen.h - safer interface to open()
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/siphash.h b/src/common/siphash.h
new file mode 100644
index 000000000..8d7c921ca
--- /dev/null
+++ b/src/common/siphash.h
@@ -0,0 +1,68 @@
+/*****************************************************************************\
+ *  siphash.h - Headers for the siphash 2-4 hash functions
+ *****************************************************************************
+ *  Copyright (C) 2016 Janne Blomqvist
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+/* Siphash home page https://131002.net/siphash/
+ *
+ * Reference implementation of the algorithm in file siphash24.c taken from
+ * https://raw.githubusercontent.com/veorq/SipHash/master/siphash24.c
+ *
+ * Slurm specific utility functions in siphash_slurm.c.
+ *
+ * Siphash is a keyed hash function that is performance competitive
+ * with non-cryptograhic hash functions. It's used as the default hash
+ * function for hash tables e.g. in Perl, Python, Rust. It should be
+ * relatively secure, in the sense of being collision resistant,
+ * preventing stuff like hash flooding DDOS attacks.
+ */
+
+#ifndef _SIPHASH_H
+#define _SIPHASH_H
+
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+#define KEYLEN 16
+#define HASHLEN 8
+
+
+/* The core algorithm, though the interface is a bit cumbersome. See
+ * siphash_str() for a simple to use thing for string hashing.  */
+int siphash(uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k);
+
+/* Hash a string.  */
+uint64_t siphash_str(const char* str);
+
+#endif /* _SIPHASH_H */
diff --git a/src/common/siphash24.c b/src/common/siphash24.c
new file mode 100644
index 000000000..6b2b8a000
--- /dev/null
+++ b/src/common/siphash24.c
@@ -0,0 +1,165 @@
+/*
+   SipHash reference C implementation
+
+   Copyright (c) 2012-2014 Jean-Philippe Aumasson
+   <jeanphilippe.aumasson@gmail.com>
+   Copyright (c) 2012-2014 Daniel J. Bernstein <djb@cr.yp.to>
+
+   To the extent possible under law, the author(s) have dedicated all copyright
+   and related and neighboring rights to this software to the public domain
+   worldwide. This software is distributed without any warranty.
+
+   You should have received a copy of the CC0 Public Domain Dedication along
+   with
+   this software. If not, see
+   <http://creativecommons.org/publicdomain/zero/1.0/>.
+ */
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+
+/* default: SipHash-2-4 */
+#define cROUNDS 2
+#define dROUNDS 4
+
+#define ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
+
+#define U32TO8_LE(p, v)                                                        \
+  (p)[0] = (uint8_t)((v));                                                     \
+  (p)[1] = (uint8_t)((v) >> 8);                                                \
+  (p)[2] = (uint8_t)((v) >> 16);                                               \
+  (p)[3] = (uint8_t)((v) >> 24);
+
+#define U64TO8_LE(p, v)                                                        \
+  U32TO8_LE((p), (uint32_t)((v)));                                             \
+  U32TO8_LE((p) + 4, (uint32_t)((v) >> 32));
+
+#define U8TO64_LE(p)                                                           \
+  (((uint64_t)((p)[0])) | ((uint64_t)((p)[1]) << 8) |                          \
+   ((uint64_t)((p)[2]) << 16) | ((uint64_t)((p)[3]) << 24) |                   \
+   ((uint64_t)((p)[4]) << 32) | ((uint64_t)((p)[5]) << 40) |                   \
+   ((uint64_t)((p)[6]) << 48) | ((uint64_t)((p)[7]) << 56))
+
+#define SIPROUND                                                               \
+  do {                                                                         \
+    v0 += v1;                                                                  \
+    v1 = ROTL(v1, 13);                                                         \
+    v1 ^= v0;                                                                  \
+    v0 = ROTL(v0, 32);                                                         \
+    v2 += v3;                                                                  \
+    v3 = ROTL(v3, 16);                                                         \
+    v3 ^= v2;                                                                  \
+    v0 += v3;                                                                  \
+    v3 = ROTL(v3, 21);                                                         \
+    v3 ^= v0;                                                                  \
+    v2 += v1;                                                                  \
+    v1 = ROTL(v1, 17);                                                         \
+    v1 ^= v2;                                                                  \
+    v2 = ROTL(v2, 32);                                                         \
+  } while (0)
+
+#ifdef DEBUG
+#define TRACE                                                                  \
+  do {                                                                         \
+    printf("(%3d) v0 %08x %08x\n", (int)inlen, (uint32_t)(v0 >> 32),           \
+           (uint32_t)v0);                                                      \
+    printf("(%3d) v1 %08x %08x\n", (int)inlen, (uint32_t)(v1 >> 32),           \
+           (uint32_t)v1);                                                      \
+    printf("(%3d) v2 %08x %08x\n", (int)inlen, (uint32_t)(v2 >> 32),           \
+           (uint32_t)v2);                                                      \
+    printf("(%3d) v3 %08x %08x\n", (int)inlen, (uint32_t)(v3 >> 32),           \
+           (uint32_t)v3);                                                      \
+  } while (0)
+#else
+#define TRACE
+#endif
+
+int siphash(uint8_t *out, const uint8_t *in, uint64_t inlen, const uint8_t *k) {
+  /* "somepseudorandomlygeneratedbytes" */
+  uint64_t v0 = 0x736f6d6570736575ULL;
+  uint64_t v1 = 0x646f72616e646f6dULL;
+  uint64_t v2 = 0x6c7967656e657261ULL;
+  uint64_t v3 = 0x7465646279746573ULL;
+  uint64_t b;
+  uint64_t k0 = U8TO64_LE(k);
+  uint64_t k1 = U8TO64_LE(k + 8);
+  uint64_t m;
+  int i;
+  const uint8_t *end = in + inlen - (inlen % sizeof(uint64_t));
+  const int left = inlen & 7;
+  b = ((uint64_t)inlen) << 56;
+  v3 ^= k1;
+  v2 ^= k0;
+  v1 ^= k1;
+  v0 ^= k0;
+
+#ifdef DOUBLE
+  v1 ^= 0xee;
+#endif
+
+  for (; in != end; in += 8) {
+    m = U8TO64_LE(in);
+    v3 ^= m;
+
+    TRACE;
+    for (i = 0; i < cROUNDS; ++i)
+      SIPROUND;
+
+    v0 ^= m;
+  }
+
+  switch (left) {
+  case 7:
+    b |= ((uint64_t)in[6]) << 48;
+  case 6:
+    b |= ((uint64_t)in[5]) << 40;
+  case 5:
+    b |= ((uint64_t)in[4]) << 32;
+  case 4:
+    b |= ((uint64_t)in[3]) << 24;
+  case 3:
+    b |= ((uint64_t)in[2]) << 16;
+  case 2:
+    b |= ((uint64_t)in[1]) << 8;
+  case 1:
+    b |= ((uint64_t)in[0]);
+    break;
+  case 0:
+    break;
+  }
+
+  v3 ^= b;
+
+  TRACE;
+  for (i = 0; i < cROUNDS; ++i)
+    SIPROUND;
+
+  v0 ^= b;
+
+#ifndef DOUBLE
+  v2 ^= 0xff;
+#else
+  v2 ^= 0xee;
+#endif
+
+  TRACE;
+  for (i = 0; i < dROUNDS; ++i)
+    SIPROUND;
+
+  b = v0 ^ v1 ^ v2 ^ v3;
+  U64TO8_LE(out, b);
+
+#ifdef DOUBLE
+  v1 ^= 0xdd;
+
+  TRACE;
+  for (i = 0; i < dROUNDS; ++i)
+    SIPROUND;
+
+  b = v0 ^ v1 ^ v2 ^ v3;
+  U64TO8_LE(out + 8, b);
+#endif
+
+  return 0;
+}
+
diff --git a/src/slurmctld/sicp.h b/src/common/siphash_slurm.c
similarity index 68%
rename from src/slurmctld/sicp.h
rename to src/common/siphash_slurm.c
index 76a79ae72..0c9f97a3b 100644
--- a/src/slurmctld/sicp.h
+++ b/src/common/siphash_slurm.c
@@ -1,8 +1,7 @@
 /*****************************************************************************\
- *  sicp.h - Inter-cluster job management functions
+ *  siphash_str.c - Slurm specific siphash functions
  *****************************************************************************
- *  Copyright (C) SchedMD LLC (http://www.schedmd.com).
- *  Written by Morris Jette
+ *  Copyright (C) 2016 Janne Blomqvist
  *
  *  This file is part of SLURM, a resource management program.
  *  For details, see <http://slurm.schedmd.com/>.
@@ -34,29 +33,24 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
-#ifndef _HAVE_SICP_H
-#define _HAVE_SICP_H
-
-#include <sys/types.h>
-#include <time.h>
-
-#include "src/common/list.h"
-#include "src/slurmctld/slurmctld.h"
-
-typedef struct sicp_job {
-	uint32_t job_id;		/* Global job ID */
-	uint32_t job_state;		/* state of the job */
-	struct sicp_job *sicp_next;	/* link for hash table */
-	time_t   update_time;		/* Time job last seen */
-} sicp_job_t;
-
-/* For a given inter-cluster job ID, return its state (if found) or NO_VAL */
-extern uint32_t sicp_get_state(uint32_t job_id);
-
-/* Start a thread to poll other clusters for inter-cluster job status */
-extern void sicp_init(void);
-
-/* Shutdown the inter-cluster job status thread */
-extern void sicp_fini(void);
-
-#endif /* !_HAVE_SICP_H */
+#include "src/common/fd.h"
+#include "src/common/siphash.h"
+
+
+/* Use a default value for the key */
+/* Note: Slurm is intentially fixing the key value, and not initializing it
+ * from /dev/urandom as is commonly recommended. Slurm does not rely on
+ * the hash function for any cryptographic functionality, and randomness
+ * would make debugging harder if the hash key changed on each start. */
+static uint8_t siphash_key[KEYLEN] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+                                       12, 13, 14, 15 };
+
+uint64_t siphash_str(const char* str)
+{
+	uint8_t out[HASHLEN];
+	uint64_t out64;
+	const uint8_t *s = (uint8_t *) str;
+	siphash(out, s, strlen(str), siphash_key);
+	memcpy(&out64, out, HASHLEN);
+	return out64;
+}
diff --git a/src/common/slurm_accounting_storage.c b/src/common/slurm_accounting_storage.c
index c82dd7fc6..938786202 100644
--- a/src/common/slurm_accounting_storage.c
+++ b/src/common/slurm_accounting_storage.c
@@ -1,8 +1,5 @@
-
 /*****************************************************************************\
  *  slurm_accounting_storage.c - account storage plugin wrapper.
- *
- *  $Id: slurm_accounting_storage.c 10744 2007-01-11 20:09:18Z da $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -173,6 +170,7 @@ typedef struct slurm_acct_storage_ops {
 	int (*roll_usage)          (void *db_conn,
 				    time_t sent_start, time_t sent_end,
 				    uint16_t archive_data);
+	int (*fix_lost_jobs)       (void *db_conn, uint32_t uid, List jobs);
 	int  (*node_down)          (void *db_conn,
 				    struct node_record *node_ptr,
 				    time_t event_time,
@@ -206,6 +204,8 @@ typedef struct slurm_acct_storage_ops {
 	int (*flush_jobs)          (void *db_conn,
 				    time_t event_time);
 	int (*reconfig)            (void *db_conn, bool dbd);
+	int (*reset_lft_rgt)       (void *db_conn, uid_t uid,
+				    List cluster_list);
 } slurm_acct_storage_ops_t;
 /*
  * Must be synchronized with slurm_acct_storage_ops_t above.
@@ -257,6 +257,7 @@ static const char *syms[] = {
 	"acct_storage_p_get_txn",
 	"acct_storage_p_get_usage",
 	"acct_storage_p_roll_usage",
+	"acct_storage_p_fix_lost_jobs",
 	"clusteracct_storage_p_node_down",
 	"clusteracct_storage_p_node_up",
 	"clusteracct_storage_p_cluster_tres",
@@ -274,6 +275,7 @@ static const char *syms[] = {
 	"acct_storage_p_update_shares_used",
 	"acct_storage_p_flush_jobs_on_cluster",
 	"acct_storage_p_reconfig",
+	"acct_storage_p_reset_lft_rgt",
 };
 
 static slurm_acct_storage_ops_t ops;
@@ -731,6 +733,14 @@ extern int acct_storage_g_roll_usage(void *db_conn,
 	return (*(ops.roll_usage))(db_conn, sent_start, sent_end, archive_data);
 }
 
+extern int acct_storage_g_fix_lost_jobs(void *db_conn, uint32_t uid, List jobs)
+{
+	if (slurm_acct_storage_init(NULL) < 0)
+		return SLURM_ERROR;
+	return (*(ops.fix_lost_jobs))(db_conn, uid, jobs);
+
+}
+
 extern int clusteracct_storage_g_node_down(void *db_conn,
 					   struct node_record *node_ptr,
 					   time_t event_time,
@@ -1003,3 +1013,16 @@ extern int acct_storage_g_reconfig(void *db_conn, bool dbd)
 	return (*(ops.reconfig))(db_conn, dbd);
 
 }
+
+/*
+ * Reset the lft and rights of an association table.
+ * RET: SLURM_SUCCESS on success SLURM_ERROR else
+ */
+extern int acct_storage_g_reset_lft_rgt(void *db_conn, uid_t uid,
+					List cluster_list)
+{
+	if (slurm_acct_storage_init(NULL) < 0)
+		return SLURM_ERROR;
+	return (*(ops.reset_lft_rgt))(db_conn, uid, cluster_list);
+
+}
diff --git a/src/common/slurm_accounting_storage.h b/src/common/slurm_accounting_storage.h
index 7bc0a3695..f968bca61 100644
--- a/src/common/slurm_accounting_storage.h
+++ b/src/common/slurm_accounting_storage.h
@@ -470,6 +470,14 @@ extern int acct_storage_g_get_usage(
 extern int acct_storage_g_roll_usage(void *db_conn,
 				     time_t sent_start, time_t sent_end,
 				     uint16_t archive_data);
+
+/*
+ * Fix lost jobs
+ * IN: jobs, a list of all the lost jobs
+ * RET: SLURM_SUCCESS on success SLURM_ERROR else
+ */
+extern int acct_storage_g_fix_lost_jobs(void *db_conn, uint32_t uid, List jobs);
+
 /*
  * record shares used information for backup in case slurmctld restarts
  * IN:  account_list List of shares_used_object_t *
@@ -492,6 +500,13 @@ extern int acct_storage_g_flush_jobs_on_cluster(
 
 extern int acct_storage_g_reconfig(void *db_conn, bool dbd);
 
+/*
+ * Reset the lft and rights of an association table.
+ * RET: SLURM_SUCCESS on success SLURM_ERROR else
+ */
+extern int acct_storage_g_reset_lft_rgt(void *db_conn, uid_t uid,
+					List cluster_list);
+
 /*********************** CLUSTER ACCOUNTING STORAGE **************************/
 
 extern int clusteracct_storage_g_node_down(void *db_conn,
diff --git a/src/common/slurm_acct_gather_energy.c b/src/common/slurm_acct_gather_energy.c
index 76f2e5e94..56bbf4a50 100644
--- a/src/common/slurm_acct_gather_energy.c
+++ b/src/common/slurm_acct_gather_energy.c
@@ -35,10 +35,18 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include "src/common/macros.h"
 #include "src/common/plugin.h"
 #include "src/common/plugrack.h"
@@ -82,15 +90,28 @@ static pthread_mutex_t g_context_lock =	PTHREAD_MUTEX_INITIALIZER;
 static bool init_run = false;
 static bool acct_shutdown = true;
 static int freq = 0;
-
+static pthread_t watch_node_thread_id = 0;
 
 static void *_watch_node(void *arg)
 {
 	int type = PROFILE_ENERGY;
 	int delta = acct_gather_profile_timer[type].freq - 1;
+
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_SET_NAME, "acctg_energy", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m",
+		      __func__, "acctg_energy");
+	}
+#endif
+	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+	(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+
 	while (init_run && acct_gather_profile_running) {
 		/* Do this until shutdown is requested */
+		slurm_mutex_lock(&g_context_lock);
 		(*(ops.set_data))(ENERGY_DATA_PROFILE, &delta);
+		slurm_mutex_unlock(&g_context_lock);
+
 		slurm_mutex_lock(&acct_gather_profile_timer[type].notify_mutex);
 		pthread_cond_wait(
 			&acct_gather_profile_timer[type].notify,
@@ -142,14 +163,21 @@ done:
 
 extern int acct_gather_energy_fini(void)
 {
-	int rc;
+	int rc = SLURM_SUCCESS;
+
+	slurm_mutex_lock(&g_context_lock);
+	if (g_context) {
+		init_run = false;
 
-	if (!g_context)
-		return SLURM_SUCCESS;
+		if (watch_node_thread_id) {
+			pthread_cancel(watch_node_thread_id);
+			pthread_join(watch_node_thread_id, NULL);
+		}
 
-	init_run = false;
-	rc = plugin_context_destroy(g_context);
-	g_context = NULL;
+		rc = plugin_context_destroy(g_context);
+		g_context = NULL;
+	}
+	slurm_mutex_unlock(&g_context_lock);
 
 	return rc;
 }
@@ -291,7 +319,6 @@ extern int acct_gather_energy_startpoll(uint32_t frequency)
 {
 	int retval = SLURM_SUCCESS;
 	pthread_attr_t attr;
-	pthread_t _watch_node_thread_id;
 
 	if (slurm_acct_gather_energy_init() < 0)
 		return SLURM_ERROR;
@@ -313,10 +340,8 @@ extern int acct_gather_energy_startpoll(uint32_t frequency)
 
 	/* create polling thread */
 	slurm_attr_init(&attr);
-	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
 
-	if (pthread_create(&_watch_node_thread_id, &attr, &_watch_node, NULL)) {
+	if (pthread_create(&watch_node_thread_id, &attr, &_watch_node, NULL)) {
 		debug("acct_gather_energy failed to create _watch_node "
 		      "thread: %m");
 	} else
diff --git a/src/common/slurm_acct_gather_filesystem.c b/src/common/slurm_acct_gather_filesystem.c
index 4a4e9dd45..04f0a23e9 100644
--- a/src/common/slurm_acct_gather_filesystem.c
+++ b/src/common/slurm_acct_gather_filesystem.c
@@ -35,10 +35,18 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include "src/common/macros.h"
 #include "src/common/plugin.h"
 #include "src/common/plugrack.h"
@@ -72,13 +80,26 @@ static pthread_mutex_t g_context_lock =	PTHREAD_MUTEX_INITIALIZER;
 static bool init_run = false;
 static bool acct_shutdown = true;
 static int freq = 0;
+static pthread_t watch_node_thread_id = 0;
 
 static void *_watch_node(void *arg)
 {
 	int type = PROFILE_FILESYSTEM;
-	while (!acct_shutdown && acct_gather_profile_running) {
+
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_SET_NAME, "acctg_fs", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "acctg_fs");
+	}
+#endif
+	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+	(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+
+	while (init_run && acct_gather_profile_running) {
 		/* Do this until shutdown is requested */
+		slurm_mutex_lock(&g_context_lock);
 		(*(ops.node_update))();
+		slurm_mutex_unlock(&g_context_lock);
+
 		slurm_mutex_lock(&acct_gather_profile_timer[type].notify_mutex);
 		pthread_cond_wait(
 			&acct_gather_profile_timer[type].notify,
@@ -127,14 +148,21 @@ done:
 
 extern int acct_gather_filesystem_fini(void)
 {
-	int rc;
+	int rc = SLURM_SUCCESS;
+
+	slurm_mutex_lock(&g_context_lock);
+	if (g_context) {
+		init_run = false;
 
-	if (!g_context)
-		return SLURM_SUCCESS;
+		if (watch_node_thread_id) {
+			pthread_cancel(watch_node_thread_id);
+			pthread_join(watch_node_thread_id, NULL);
+		}
 
-	init_run = false;
-	rc = plugin_context_destroy(g_context);
-	g_context = NULL;
+		rc = plugin_context_destroy(g_context);
+		g_context = NULL;
+	}
+	slurm_mutex_unlock(&g_context_lock);
 
 	return rc;
 }
@@ -143,7 +171,6 @@ extern int acct_gather_filesystem_startpoll(uint32_t frequency)
 {
 	int retval = SLURM_SUCCESS;
 	pthread_attr_t attr;
-	pthread_t _watch_node_thread_id;
 
 	if (acct_gather_filesystem_init() < 0)
 		return SLURM_ERROR;
@@ -165,10 +192,8 @@ extern int acct_gather_filesystem_startpoll(uint32_t frequency)
 
 	/* create polling thread */
 	slurm_attr_init(&attr);
-	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
 
-	if (pthread_create(&_watch_node_thread_id, &attr, &_watch_node, NULL)) {
+	if (pthread_create(&watch_node_thread_id, &attr, &_watch_node, NULL)) {
 		debug("acct_gather_filesystem failed to create _watch_node "
 			"thread: %m");
 	} else
diff --git a/src/common/slurm_acct_gather_infiniband.c b/src/common/slurm_acct_gather_infiniband.c
index ccb52bd3f..cefc5b9a2 100644
--- a/src/common/slurm_acct_gather_infiniband.c
+++ b/src/common/slurm_acct_gather_infiniband.c
@@ -35,10 +35,18 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include "src/common/macros.h"
 #include "src/common/plugin.h"
 #include "src/common/plugrack.h"
@@ -73,13 +81,27 @@ static pthread_mutex_t g_context_lock =	PTHREAD_MUTEX_INITIALIZER;
 static bool init_run = false;
 static bool acct_shutdown = true;
 static int freq = 0;
+static pthread_t watch_node_thread_id = 0;
 
 static void *_watch_node(void *arg)
 {
 	int type = PROFILE_NETWORK;
+
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_SET_NAME, "acctg_ib", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "acctg_ib");
+	}
+#endif
+
+	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+	(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+
 	while (init_run && acct_gather_profile_running) {
 		/* Do this until shutdown is requested */
+		slurm_mutex_lock(&g_context_lock);
 		(*(ops.node_update))();
+		slurm_mutex_unlock(&g_context_lock);
+
 		slurm_mutex_lock(&acct_gather_profile_timer[type].notify_mutex);
 		pthread_cond_wait(
 			&acct_gather_profile_timer[type].notify,
@@ -129,14 +151,21 @@ done:
 
 extern int acct_gather_infiniband_fini(void)
 {
-	int rc;
+	int rc = SLURM_SUCCESS;
+
+	slurm_mutex_lock(&g_context_lock);
+	if (g_context) {
+		init_run = false;
 
-	if (!g_context)
-		return SLURM_SUCCESS;
+		if (watch_node_thread_id) {
+			pthread_cancel(watch_node_thread_id);
+			pthread_join(watch_node_thread_id, NULL);
+		}
 
-	init_run = false;
-	rc = plugin_context_destroy(g_context);
-	g_context = NULL;
+		rc = plugin_context_destroy(g_context);
+		g_context = NULL;
+	}
+	slurm_mutex_unlock(&g_context_lock);
 
 	return rc;
 }
@@ -145,7 +174,6 @@ extern int acct_gather_infiniband_startpoll(uint32_t frequency)
 {
 	int retval = SLURM_SUCCESS;
 	pthread_attr_t attr;
-	pthread_t _watch_node_thread_id;
 
 	if (acct_gather_infiniband_init() < 0)
 		return SLURM_ERROR;
@@ -167,10 +195,7 @@ extern int acct_gather_infiniband_startpoll(uint32_t frequency)
 
 	/* create polling thread */
 	slurm_attr_init(&attr);
-	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
-
-	if (pthread_create(&_watch_node_thread_id, &attr, &_watch_node, NULL)) {
+	if (pthread_create(&watch_node_thread_id, &attr, &_watch_node, NULL)) {
 		debug("acct_gather_infiniband failed to create _watch_node "
 		      "thread: %m");
 	} else
diff --git a/src/common/slurm_acct_gather_profile.c b/src/common/slurm_acct_gather_profile.c
index 74f9770f9..c016c0102 100644
--- a/src/common/slurm_acct_gather_profile.c
+++ b/src/common/slurm_acct_gather_profile.c
@@ -37,10 +37,18 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <pthread.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include "src/common/macros.h"
 #include "src/common/plugin.h"
 #include "src/common/plugrack.h"
@@ -121,8 +129,20 @@ static void _set_freq(int type, char *freq, char *freq_def)
 static void *_timer_thread(void *args)
 {
 	int i, now, diff;
+
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_SET_NAME, "acctg_prof", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m",
+		      __func__, "acctg_prof");
+	}
+#endif
+
+	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+	(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+
 	DEF_TIMERS;
-	while (acct_gather_profile_running) {
+	while (init_run && acct_gather_profile_running) {
+		slurm_mutex_lock(&g_context_lock);
 		START_TIMER;
 		now = time(NULL);
 
@@ -161,6 +181,8 @@ static void *_timer_thread(void *args)
 			acct_gather_profile_timer[i].last_notify = now;
 		}
 		END_TIMER;
+		slurm_mutex_unlock(&g_context_lock);
+
 		usleep(USLEEP_TIME - DELTA_TIMER);
 	}
 
@@ -214,6 +236,8 @@ extern int acct_gather_profile_fini(void)
 	if (!g_context)
 		goto done;
 
+	init_run = false;
+
 	for (i=0; i < PROFILE_CNT; i++) {
 		switch (i) {
 		case PROFILE_ENERGY:
@@ -235,8 +259,12 @@ extern int acct_gather_profile_fini(void)
 		}
 	}
 
+	if (timer_thread_id) {
+		pthread_cancel(timer_thread_id);
+		pthread_join(timer_thread_id, NULL);
+	}
+
 	rc = plugin_context_destroy(g_context);
-	init_run = false;
 	g_context = NULL;
 done:
 	slurm_mutex_unlock(&g_context_lock);
@@ -316,13 +344,13 @@ extern char *acct_gather_profile_type_to_string(uint32_t series)
 
 extern uint32_t acct_gather_profile_type_from_string(char *series_str)
 {
-	if (!strcasecmp(series_str, "energy"))
+	if (!xstrcasecmp(series_str, "energy"))
 		return ACCT_GATHER_PROFILE_ENERGY;
-	else if (!strcasecmp(series_str, "task"))
+	else if (!xstrcasecmp(series_str, "task"))
 		return ACCT_GATHER_PROFILE_TASK;
-	else if (!strcasecmp(series_str, "lustre"))
+	else if (!xstrcasecmp(series_str, "lustre"))
 		return ACCT_GATHER_PROFILE_LUSTRE;
-	else if (!strcasecmp(series_str, "network"))
+	else if (!xstrcasecmp(series_str, "network"))
 		return ACCT_GATHER_PROFILE_NETWORK;
 
 	return ACCT_GATHER_PROFILE_NOT_SET;
@@ -460,8 +488,6 @@ extern int acct_gather_profile_startpoll(char *freq, char *freq_def)
 
 	/* create polling thread */
 	slurm_attr_init(&attr);
-	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
 
 	if  (pthread_create(&timer_thread_id, &attr,
 			    &_timer_thread, NULL)) {
diff --git a/src/common/slurm_auth.c b/src/common/slurm_auth.c
index 33ce3cdb0..bf1af194f 100644
--- a/src/common/slurm_auth.c
+++ b/src/common/slurm_auth.c
@@ -159,7 +159,7 @@ extern int slurm_auth_init( char *auth_type )
 
 	type = slurm_get_auth_type();
 
-	if (strcmp(type, "auth/dummy") == 0) {
+	if (xstrcmp(type, "auth/dummy") == 0) {
 		info( "warning: %s plugin selected", type);
 		auth_dummy = true;
 		goto done;
diff --git a/src/common/slurm_cred.c b/src/common/slurm_cred.c
index 35943bacd..efb22050d 100644
--- a/src/common/slurm_cred.c
+++ b/src/common/slurm_cred.c
@@ -1369,7 +1369,7 @@ slurm_cred_unpack(Buf buffer, uint16_t protocol_version)
 		safe_unpackmem_xmalloc(sigp, &len, buffer);
 		cred->siglen = len;
 		xassert(len > 0);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpack32(&cred->jobid, buffer);
 		safe_unpack32(&cred->stepid, buffer);
 		safe_unpack32(&cred_uid, buffer);
@@ -2412,7 +2412,7 @@ int extract_sbcast_cred(slurm_cred_ctx_t ctx,
 			free_buf(buffer);
 			if (rc)
 				err_str = (char *)(*(ops.crypto_str_error))(rc);
-			if (err_str && strcmp(err_str, "Credential replayed")) {
+			if (err_str && xstrcmp(err_str, "Credential replayed")){
 				error("sbcast_cred verify: %s", err_str);
 				return -1;
 			}
diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c
index efbc86812..688a26854 100644
--- a/src/common/slurm_errno.c
+++ b/src/common/slurm_errno.c
@@ -147,12 +147,6 @@ static slurm_errtab_t slurm_errtab[] = {
 	  "Requested node configuration is not available"	},
 	{ ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE,
 	  "Requested partition configuration not available now" },
-	{ ESLURM_POWER_NOT_AVAIL,
-	  "Required power not available now"},
-	{ ESLURM_POWER_RESERVED,
-	  "Required power at least partially reserved"},
-	{ ESLURM_INVALID_POWERCAP,
-	  "Required powercap is not valid, check min/max values"},
 	{ ESLURM_NODES_BUSY,
 	  "Requested nodes are busy"				},
 	{ ESLURM_INVALID_JOB_ID,
@@ -323,6 +317,14 @@ static slurm_errtab_t slurm_errtab[] = {
 	  "Burst Buffer request invalid"			},
 	{ ESLURM_PRIO_RESET_FAIL,
 	  "Changes to job priority are not persistent, change nice instead" },
+	{ ESLURM_POWER_NOT_AVAIL,
+	  "Required power not available now"			},
+	{ ESLURM_POWER_RESERVED,
+	  "Required power at least partially reserved"		},
+	{ ESLURM_INVALID_POWERCAP,
+	  "Required powercap is not valid, check min/max values"},
+	{ ESLURM_INVALID_MCS_LABEL,
+	  "Invalid mcs_label specified"				},
 
 	/* slurmd error codes */
 	{ ESLRUMD_PIPE_ERROR_ON_TASK_SPAWN,
@@ -429,11 +431,13 @@ static slurm_errtab_t slurm_errtab[] = {
 	{ ESLURM_BAD_NAME,
 	  "Unacceptable name given. (No '.' in name allowed)"   },
 	{ ESLURM_OVER_ALLOCATE,
-	  "You can not allocate more than 100% of a resource"     },
+	  "You can not allocate more than 100% of a resource"	},
 
 	/* plugin and custom errors */
 	{ ESLURM_MISSING_TIME_LIMIT,
-	  "Time limit specification required, but not provided"  }
+	  "Time limit specification required, but not provided"	},
+	{ ESLURM_INVALID_KNL,
+	  "Invalid KNL configuration (MCDRAM or NUMA option)"	}
 };
 
 /*
diff --git a/src/common/slurm_jobacct_gather.c b/src/common/slurm_jobacct_gather.c
index 7e422770b..dcfd103d2 100644
--- a/src/common/slurm_jobacct_gather.c
+++ b/src/common/slurm_jobacct_gather.c
@@ -47,11 +47,19 @@
  *  	 Morris Jette, et al.
 \*****************************************************************************/
 
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
 #include <pthread.h>
 #include <signal.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if HAVE_SYS_PRCTL_H
+#  include <sys/prctl.h>
+#endif
+
 #include "src/common/macros.h"
 #include "src/common/pack.h"
 #include "src/common/plugin.h"
@@ -102,6 +110,7 @@ static slurm_jobacct_gather_ops_t ops;
 static plugin_context_t *g_context = NULL;
 static pthread_mutex_t g_context_lock = PTHREAD_MUTEX_INITIALIZER;
 static bool init_run = false;
+static pthread_t watch_tasks_thread_id = 0;
 
 static int freq = 0;
 static bool pgid_plugin = false;
@@ -193,13 +202,23 @@ static void _task_sleep(int rem)
 static void *_watch_tasks(void *arg)
 {
 	int type = PROFILE_TASK;
+
+#if HAVE_SYS_PRCTL_H
+	if (prctl(PR_SET_NAME, "acctg", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "acctg");
+	}
+#endif
+
+	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+	(void) pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+
 	/* Give chance for processes to spawn before starting
 	 * the polling. This should largely eliminate the
 	 * the chance of having /proc open when the tasks are
 	 * spawned, which would prevent a valid checkpoint/restart
 	 * with some systems */
 	_task_sleep(1);
-	while (!jobacct_shutdown && acct_gather_profile_running) {
+	while (init_run && !jobacct_shutdown && acct_gather_profile_running) {
 		/* Do this until shutdown is requested */
 		slurm_mutex_lock(&acct_gather_profile_timer[type].notify_mutex);
 		pthread_cond_wait(
@@ -207,8 +226,11 @@ static void *_watch_tasks(void *arg)
 			&acct_gather_profile_timer[type].notify_mutex);
 		slurm_mutex_unlock(&acct_gather_profile_timer[type].
 				   notify_mutex);
+		slurm_mutex_lock(&g_context_lock);
 		/* The initial poll is done after the last task is added */
 		_poll_data(1);
+		slurm_mutex_unlock(&g_context_lock);
+
 	}
 	return NULL;
 }
@@ -237,7 +259,7 @@ extern int jobacct_gather_init(void)
 		goto done;
 	}
 
-	if (!strcasecmp(type, "jobacct_gather/none")) {
+	if (!xstrcasecmp(type, "jobacct_gather/none")) {
 		plugin_polling = false;
 		goto done;
 	}
@@ -250,7 +272,7 @@ extern int jobacct_gather_init(void)
 
 	plugin_type = type;
 	type = slurm_get_proctrack_type();
-	if (!strcasecmp(type, "proctrack/pgid")) {
+	if (!xstrcasecmp(type, "proctrack/pgid")) {
 		info("WARNING: We will use a much slower algorithm with "
 		     "proctrack/pgid, use Proctracktype=proctrack/linuxproc "
 		     "or some other proctrack when using %s",
@@ -261,7 +283,7 @@ extern int jobacct_gather_init(void)
 	xfree(plugin_type);
 
 	type = slurm_get_accounting_storage_type();
-	if (!strcasecmp(type, ACCOUNTING_STORAGE_TYPE_NONE)) {
+	if (!xstrcasecmp(type, ACCOUNTING_STORAGE_TYPE_NONE)) {
 		error("WARNING: Even though we are collecting accounting "
 		      "information you have asked for it not to be stored "
 		      "(%s) if this is not what you have in mind you will "
@@ -282,10 +304,17 @@ extern int jobacct_gather_fini(void)
 	slurm_mutex_lock(&g_context_lock);
 	if (g_context) {
 		init_run = false;
+
+		if (watch_tasks_thread_id) {
+			pthread_cancel(watch_tasks_thread_id);
+			pthread_join(watch_tasks_thread_id, NULL);
+		}
+
 		rc = plugin_context_destroy(g_context);
 		g_context = NULL;
 	}
 	slurm_mutex_unlock(&g_context_lock);
+
 	return rc;
 }
 
@@ -293,7 +322,6 @@ extern int jobacct_gather_startpoll(uint16_t frequency)
 {
 	int retval = SLURM_SUCCESS;
 	pthread_attr_t attr;
-	pthread_t _watch_tasks_thread_id;
 
 	if (!plugin_polling)
 		return SLURM_SUCCESS;
@@ -318,10 +346,7 @@ extern int jobacct_gather_startpoll(uint16_t frequency)
 
 	/* create polling thread */
 	slurm_attr_init(&attr);
-	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
-		error("pthread_attr_setdetachstate error %m");
-
-	if  (pthread_create(&_watch_tasks_thread_id, &attr,
+	if  (pthread_create(&watch_tasks_thread_id, &attr,
 			    &_watch_tasks, NULL)) {
 		debug("jobacct_gather failed to create _watch_tasks "
 		      "thread: %m");
@@ -643,7 +668,7 @@ extern int jobacctinfo_setinfo(jobacctinfo_t *jobacct,
 		memcpy(jobacct, send, sizeof(struct jobacctinfo));
 		break;
 	case JOBACCT_DATA_PIPE:
-		if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 			int len;
 			Buf buffer = init_buf(0);
 			jobacctinfo_pack(jobacct, protocol_version,
@@ -756,7 +781,7 @@ extern int jobacctinfo_getinfo(
 		memcpy(send, jobacct, sizeof(struct jobacctinfo));
 		break;
 	case JOBACCT_DATA_PIPE:
-		if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 			char* buf;
 			int len;
 			Buf buffer;
@@ -889,7 +914,7 @@ extern void jobacctinfo_pack(jobacctinfo_t *jobacct,
 			buffer);
 		_pack_jobacct_id(&jobacct->max_disk_write_id, rpc_version,
 			buffer);
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		if (!jobacct || no_pack) {
 			pack8((uint8_t) 0, buffer);
 			return;
@@ -987,7 +1012,7 @@ extern int jobacctinfo_unpack(jobacctinfo_t **jobacct,
 		if (_unpack_jobacct_id(&(*jobacct)->max_disk_write_id,
 			rpc_version, buffer) != SLURM_SUCCESS)
 			goto unpack_error;
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpack8(&uint8_tmp, buffer);
 		if (uint8_tmp == (uint8_t) 0)
 			return SLURM_SUCCESS;
diff --git a/src/common/slurm_mcs.c b/src/common/slurm_mcs.c
new file mode 100644
index 000000000..1c612cf31
--- /dev/null
+++ b/src/common/slurm_mcs.c
@@ -0,0 +1,239 @@
+/*****************************************************************************\
+ *  slurm_mcs.c - Define mcs plugin functions
+ *****************************************************************************
+ *  Copyright (C) 2015 CEA/DAM/DIF
+ *  Written by Aline Roy <aline.roy@cea.fr>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#include "src/common/slurm_mcs.h"
+#include "src/common/plugin.h"
+#include "src/common/plugrack.h"
+#include "src/common/xstring.h"
+
+typedef struct slurm_mcs_ops {
+	int (*set)		(struct job_record *job_ptr,char *label);
+	int (*check)		(uint32_t user_id, char *mcs_label);
+} slurm_mcs_ops_t;
+
+/*
+ * Must be synchronized with slurm_mcs_ops_t above.
+ */
+static const char *syms[] = {
+	"mcs_p_set_mcs_label",
+	"mcs_p_check_mcs_label"
+};
+
+static slurm_mcs_ops_t ops;
+static plugin_context_t *g_mcs_context = NULL;
+static pthread_mutex_t g_mcs_context_lock = PTHREAD_MUTEX_INITIALIZER;
+static bool init_run = false;
+static uint32_t private_data = 0;
+static uint32_t enforced = 0;
+static uint32_t select_enforced = 0;
+static char *mcs_params = NULL;
+static char *mcs_params_common = NULL;
+static char *mcs_params_specific = NULL;
+
+static int _slurm_mcs_check_and_load_enforced(char *params);
+static int _slurm_mcs_check_and_load_select(char *params);
+static int _slurm_mcs_check_and_load_privatedata(char *params);
+
+/*
+ * Initialize context for mcs plugin
+ */
+extern int slurm_mcs_init(void)
+{
+	int retval = SLURM_SUCCESS;
+	char *plugin_type = "mcs";
+	char *type = NULL;
+	char *sep;
+
+	if (init_run && g_mcs_context)
+		return retval;
+	slurm_mutex_lock(&g_mcs_context_lock);
+
+	if (g_mcs_context)
+		goto done;
+
+	xfree(mcs_params);
+	xfree(mcs_params_common);
+	xfree(mcs_params_specific);
+
+	type = slurm_get_mcs_plugin();
+	mcs_params = slurm_get_mcs_plugin_params();
+	if (mcs_params == NULL) {
+		info("No parameter for mcs plugin, default values set");
+	} else {
+		mcs_params_common = xstrdup(mcs_params);
+		sep = index(mcs_params_common, ':');
+		if (sep != NULL) {
+			if (sep[1] != '\0')
+				mcs_params_specific = xstrdup(sep + 1);
+			*sep = '\0';
+		}
+	}
+	_slurm_mcs_check_and_load_privatedata(mcs_params_common);
+	_slurm_mcs_check_and_load_enforced(mcs_params_common);
+	_slurm_mcs_check_and_load_select(mcs_params_common);
+
+	g_mcs_context = plugin_context_create(
+		plugin_type, type, (void **)&ops, syms, sizeof(syms));
+
+	if (!g_mcs_context) {
+		error("cannot create %s context for %s", plugin_type, type);
+		retval = SLURM_ERROR;
+		goto done;
+	}
+	init_run = true;
+
+done:
+	slurm_mutex_unlock(&g_mcs_context_lock);
+	xfree(type);
+	return retval;
+}
+
+extern int slurm_mcs_fini(void)
+{
+	int rc = SLURM_SUCCESS;
+
+	if (!g_mcs_context)
+		return rc;
+
+	init_run = false;
+	rc = plugin_context_destroy(g_mcs_context);
+	g_mcs_context = NULL;
+	xfree(mcs_params_common);
+	xfree(mcs_params_specific);
+	xfree(mcs_params);
+	return rc;
+}
+
+extern int slurm_mcs_reconfig(void)
+{
+	slurm_mcs_fini();
+	return(slurm_mcs_init());
+}
+
+/* slurm_mcs_get_params_specific
+ * RET mcs_params_common_spec, must be xfreed by caller
+ */
+
+extern char *slurm_mcs_get_params_specific(void)
+{
+	char *mcs_params_common_spec = NULL;
+	mcs_params_common_spec = xstrdup(mcs_params_specific);
+	return mcs_params_common_spec;
+}
+
+static int _slurm_mcs_check_and_load_enforced(char *params)
+{
+	enforced = 0;
+	if ((params != NULL) && strstr(params, "enforced"))
+		enforced = 1;
+	else
+		info("mcs: MCSParameters = %s. ondemand set.", params);
+	return SLURM_SUCCESS;
+}
+
+static int _slurm_mcs_check_and_load_select(char *params)
+{
+	select_enforced = 0;
+	if (params == NULL) {
+		return SLURM_SUCCESS;
+	}
+	if (strstr(params, "noselect")) {
+		select_enforced = 2;
+	} else if (strstr(params, "ondemandselect")) {
+		select_enforced = 0;
+	} else if (strstr(params, "select")) {
+		select_enforced = 1;
+	} else {
+		info("mcs: MCSParameters = %s. ondemandselect set.", params);
+	}
+	return SLURM_SUCCESS;
+}
+
+static int _slurm_mcs_check_and_load_privatedata(char *params)
+{
+	if (params == NULL) {
+		private_data = 0;
+		return SLURM_SUCCESS;
+	}
+	if (strstr(params, "privatedata")) {
+		private_data = 1;
+	} else {
+		private_data = 0;
+	}
+	return SLURM_SUCCESS;
+}
+
+extern int slurm_mcs_reset_params(void)
+{
+	enforced = 0;
+	select_enforced = 0;
+	private_data = 0;
+	return SLURM_SUCCESS;
+}
+
+extern int slurm_mcs_get_enforced(void)
+{
+	return(enforced);
+}
+
+extern int slurm_mcs_get_select(struct job_record *job_ptr)
+{
+	if ((select_enforced == 1) || ((select_enforced == 0) &&
+	    job_ptr->details && (job_ptr->details->whole_node == 3)))
+		return 1;
+	else
+		return 0;
+}
+
+extern int slurm_mcs_get_privatedata(void)
+{
+	return private_data;
+}
+
+extern int mcs_g_set_mcs_label(struct job_record *job_ptr, char *label)
+{
+	if (slurm_mcs_init() < 0)
+		return 0;
+
+	return (int) (*(ops.set))(job_ptr, label);
+}
+
+extern int mcs_g_check_mcs_label(uint32_t user_id, char *mcs_label)
+{
+	if (slurm_mcs_init() < 0)
+		return 0;
+	return (int) (*(ops.check))(user_id, mcs_label);
+}
diff --git a/src/common/slurm_mcs.h b/src/common/slurm_mcs.h
new file mode 100644
index 000000000..4d6c6c717
--- /dev/null
+++ b/src/common/slurm_mcs.h
@@ -0,0 +1,64 @@
+/*****************************************************************************\
+ *  slurm_mcs.h - Define mcs plugin functions
+ *****************************************************************************
+ *  Copyright (C) 2015 CEA/DAM/DIF
+ *  Written by Aline Roy <aline.roy@cea.fr>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifndef _SLURM_MCS_H
+#define _SLURM_MCS_H
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+#if HAVE_STDINT_H
+#  include <stdint.h>           /* for uint16_t, uint32_t definitions */
+#endif
+#if HAVE_INTTYPES_H
+#  include <inttypes.h>         /* for uint16_t, uint32_t definitions */
+#endif
+
+#include "src/slurmctld/slurmctld.h"
+
+extern int slurm_mcs_init(void);
+extern int slurm_mcs_fini(void);
+extern int slurm_mcs_reconfig(void);
+extern char *slurm_mcs_get_params_specific(void);
+extern int slurm_mcs_reset_params(void);
+extern int slurm_mcs_get_select(struct job_record *job_ptr);
+extern int slurm_mcs_get_enforced(void);
+extern int slurm_mcs_get_privatedata(void);
+extern char *slurm_mcs_get_params_specific(void);
+extern int mcs_g_set_mcs_label(struct job_record *job_ptr, char *label);
+extern int mcs_g_check_mcs_label(uint32_t user_id, char *mcs_label);
+
+#endif /*_SLURM_MCS_H */
diff --git a/src/common/slurm_protocol_api.c b/src/common/slurm_protocol_api.c
index 2549fe6af..5575c0afd 100644
--- a/src/common/slurm_protocol_api.c
+++ b/src/common/slurm_protocol_api.c
@@ -235,14 +235,6 @@ uint32_t slurm_get_cpu_freq_govs(void)
 	return cpu_freq_govs;
 }
 
-/* update internal configuration data structure as needed.
- *	exit with lock set */
-/* static inline void _lock_update_config() */
-/* { */
-/* 	slurm_api_set_default_config(); */
-/* 	slurm_mutex_lock(&config_lock); */
-/* } */
-
 /* slurm_get_batch_start_timeout
  * RET BatchStartTimeout value from slurm.conf
  */
@@ -518,6 +510,24 @@ char *slurm_get_msg_aggr_params(void)
 	return msg_aggr_params;
 }
 
+/* slurm_get_tcp_timeout
+ * get default tcp timeout value from slurmctld_conf object
+ */
+uint16_t slurm_get_tcp_timeout(void)
+{
+	uint16_t tcp_timeout = 0;
+	slurm_ctl_conf_t *conf;
+
+ 	if (slurmdbd_conf) {
+		tcp_timeout = slurmdbd_conf->tcp_timeout;
+	} else {
+		conf = slurm_conf_lock();
+		tcp_timeout = conf->tcp_timeout;
+		slurm_conf_unlock();
+	}
+	return tcp_timeout;
+}
+
 /* slurm_get_msg_timeout
  * get default message timeout value from slurmctld_conf object
  */
@@ -833,17 +843,6 @@ static int _get_tres_id(char *type, char *name)
 	return assoc_mgr_find_tres_pos(&tres_rec, false);
 }
 
-static int _get_tres_base_unit(char *tres_type)
-{
-	int ret_unit = UNIT_NONE;
-	if ((!strcasecmp(tres_type, "mem")) ||
-	    (!strcasecmp(tres_type, "bb"))) {
-		ret_unit = UNIT_MEGA;
-	}
-
-	return ret_unit;
-}
-
 static int _tres_weight_item(double *weights, char *item_str)
 {
 	char *type = NULL, *value_str = NULL, *val_unit = NULL, *name = NULL;
@@ -879,7 +878,7 @@ static int _tres_weight_item(double *weights, char *item_str)
 	}
 
 	if (val_unit && *val_unit) {
-		int base_unit = _get_tres_base_unit(type);
+		int base_unit = slurmdb_get_tres_base_unit(type);
 		int convert_val = get_convert_unit_val(base_unit, *val_unit);
 		if (convert_val == SLURM_ERROR)
 			return SLURM_ERROR;
@@ -1289,7 +1288,9 @@ extern int slurm_set_tree_width(uint16_t tree_width)
  */
 extern uint16_t slurm_get_tree_width(void)
 {
-	uint16_t tree_width = 0;
+	/* initialize to 1 to silence later warnings
+	 * about potential division by zero */
+	uint16_t tree_width = 1;
 	slurm_ctl_conf_t *conf;
 
 	if (slurmdbd_conf) {
@@ -1397,7 +1398,6 @@ char *slurm_get_gres_plugins(void)
 	return gres_plugins;
 }
 
-
 /* slurm_get_job_submit_plugins
  * get job_submit_plugins from slurmctld_conf object from
  * slurmctld_conf object
@@ -1417,6 +1417,42 @@ char *slurm_get_job_submit_plugins(void)
 	return job_submit_plugins;
 }
 
+/* slurm_get_slurmctld_logfile
+ * get slurmctld_logfile from slurmctld_conf object from slurmctld_conf object
+ * RET char *   - slurmctld_logfile, MUST be xfreed by caller
+ */
+char *slurm_get_job_slurmctld_logfile(void)
+{
+	char *slurmctld_logfile = NULL;
+	slurm_ctl_conf_t *conf;
+
+	if (slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		slurmctld_logfile = xstrdup(conf->slurmctld_logfile);
+		slurm_conf_unlock();
+	}
+	return slurmctld_logfile;
+}
+
+/* slurm_get_node_features_plugins
+ * get node_features_plugins from slurmctld_conf object
+ * RET char *   - knl_plugins, MUST be xfreed by caller
+ */
+char *slurm_get_node_features_plugins(void)
+{
+	char *knl_plugins = NULL;
+	slurm_ctl_conf_t *conf;
+
+	if (slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		knl_plugins = xstrdup(conf->node_features_plugins);
+		slurm_conf_unlock();
+	}
+	return knl_plugins;
+}
+
 /* slurm_get_slurmctld_plugstack
  * get slurmctld_plugstack from slurmctld_conf object from
  * slurmctld_conf object
@@ -1680,10 +1716,10 @@ int slurm_get_is_association_based_accounting(void)
 		return 1;
 	} else {
 		conf = slurm_conf_lock();
-		if (!strcasecmp(conf->accounting_storage_type,
-			       "accounting_storage/slurmdbd") ||
-		    !strcasecmp(conf->accounting_storage_type,
-				"accounting_storage/mysql"))
+		if (!xstrcasecmp(conf->accounting_storage_type,
+				 "accounting_storage/slurmdbd") ||
+		    !xstrcasecmp(conf->accounting_storage_type,
+				 "accounting_storage/mysql"))
 			enforce = 1;
 		slurm_conf_unlock();
 	}
@@ -1746,8 +1782,8 @@ extern int slurm_get_auth_ttl(void)
 		return ttl;
 
 	auth_info = slurm_get_auth_info();
-        if (!auth_info)
-                return 0;
+	if (!auth_info)
+		return 0;
 
 	tmp = strstr(auth_info, "ttl=");
 	if (tmp) {
@@ -2263,6 +2299,38 @@ int slurm_set_launch_type(char *launch_type)
 	return 0;
 }
 
+/* slurm_get_mcs_plugin
+ * RET mcs_plugin name, must be xfreed by caller */
+char *slurm_get_mcs_plugin(void)
+{
+	char *mcs_plugin = NULL;
+	slurm_ctl_conf_t *conf;
+
+	if (slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		mcs_plugin = xstrdup(conf->mcs_plugin);
+		slurm_conf_unlock();
+	}
+	return mcs_plugin;
+}
+
+/* slurm_get_mcs_plugin_params
+ * RET mcs_plugin_params name, must be xfreed by caller */
+char *slurm_get_mcs_plugin_params(void)
+{
+	char *mcs_plugin_params = NULL;
+	slurm_ctl_conf_t *conf;
+
+	if (slurmdbd_conf) {
+	} else {
+		conf = slurm_conf_lock();
+		mcs_plugin_params = xstrdup(conf->mcs_plugin_params);
+		slurm_conf_unlock();
+	}
+	return mcs_plugin_params;
+}
+
 /* slurm_get_preempt_type
  * get PreemptType from slurmctld_conf object
  * RET char *   - preempt type, MUST be xfreed by caller
@@ -2464,7 +2532,7 @@ bool is_cray_select_type(void)
 	if (slurmdbd_conf) {
 	} else {
 		slurm_ctl_conf_t *conf = slurm_conf_lock();
-		result = strcasecmp(conf->select_type, "select/cray") == 0;
+		result = xstrcasecmp(conf->select_type, "select/cray") == 0;
 		slurm_conf_unlock();
 	}
 	return result;
@@ -2800,10 +2868,7 @@ slurm_fd_t slurm_init_msg_engine_addrname_port(char *addr_name, uint16_t port)
 {
 	slurm_addr_t addr;
 
-	if (addr_name)
-		slurm_set_addr(&addr, port, addr_name);
-	else
-		slurm_setup_sockaddr(&addr, port);
+	slurm_setup_sockaddr(&addr, port);
 
 	return slurm_init_msg_engine(&addr);
 }
@@ -2861,12 +2926,13 @@ slurm_fd_t slurm_open_msg_conn(slurm_addr_t * slurm_address)
  * IN/OUT addr     - address of controller contacted
  * RET slurm_fd	- file descriptor of the connection created
  */
-slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr)
+slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr, bool *use_backup)
 {
 	slurm_fd_t fd = -1;
 	slurm_ctl_conf_t *conf;
 	slurm_protocol_config_t *myproto = NULL;
-	int retry, max_retry_period, have_backup = 0;
+	int retry, max_retry_period;
+	static int have_backup = 0;
 
 	if (!working_cluster_rec) {
 		/* This means the addr wasn't set up already.
@@ -2905,25 +2971,33 @@ slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr)
 				goto end_it;
 			debug("Failed to contact controller: %m");
 		} else {
-			fd = slurm_open_msg_conn(&myproto->primary_controller);
-			if (fd >= 0)
-				goto end_it;
-			debug("Failed to contact primary controller: %m");
-
-			if (retry == 0) {
-				conf = slurm_conf_lock();
-				if (conf->backup_controller)
-					have_backup = 1;
-				slurm_conf_unlock();
+			if (!*use_backup) {
+				fd = slurm_open_msg_conn(
+						&myproto->primary_controller);
+				if (fd >= 0) {
+					*use_backup = false;
+					goto end_it;
+				}
+				debug("Failed to contact primary controller: "
+				      "%m");
+
+				if (retry == 0) {
+					conf = slurm_conf_lock();
+					if (conf->backup_controller)
+						have_backup = 1;
+					slurm_conf_unlock();
+				}
 			}
 
-			if (have_backup) {
+			if (have_backup || *use_backup) {
 				fd = slurm_open_msg_conn(&myproto->
 							 secondary_controller);
 				if (fd >= 0) {
 					debug("Contacted secondary controller");
+					*use_backup = true;
 					goto end_it;
 				}
+				*use_backup = false;
 				debug("Failed to contact secondary "
 				      "controller: %m");
 			}
@@ -3435,14 +3509,7 @@ int slurm_receive_msg_and_forward(slurm_fd_t fd, slurm_addr_t *orig_addr,
 		FREE_NULL_LIST(header.ret_list);
 		header.ret_list = NULL;
 	}
-	//info("ret_cnt = %d",header.ret_cnt);
-	/* if (header.ret_cnt > 0) { */
-/* 		while ((ret_data_info = list_pop(header.ret_list))) */
-/* 			list_push(msg->ret_list, ret_data_info); */
-/* 		header.ret_cnt = 0; */
-/* 		FREE_NULL_LIST(header.ret_list); */
-/* 		header.ret_list = NULL; */
-/* 	} */
+
 	/*
 	 * header.orig_addr will be set to where the first message
 	 * came from if this is a forward else we set the
@@ -3609,6 +3676,10 @@ int slurm_send_node_msg(slurm_fd_t fd, slurm_msg_t * msg)
 		forward_init(&msg->forward, NULL);
 		msg->ret_list = NULL;
 	}
+
+	if (!msg->forward.tree_width)
+		msg->forward.tree_width = slurm_get_tree_width();
+
 	forward_wait(msg);
 
 	if (difftime(time(NULL), start_time) >= 60) {
@@ -3990,7 +4061,6 @@ _send_and_recv_msgs(slurm_fd_t fd, slurm_msg_t *req, int timeout)
 	int retry = 0;
 	List ret_list = NULL;
 	int steps = 0;
-	int width;
 
 	if (!req->forward.timeout) {
 		if (!timeout)
@@ -4005,11 +4075,14 @@ _send_and_recv_msgs(slurm_fd_t fd, slurm_msg_t *req, int timeout)
 			 * (timeout+message_timeout sec per step)
 			 * to let the child timeout */
 			if (message_timeout < 0)
-				message_timeout = slurm_get_msg_timeout() * 1000;
+				message_timeout =
+					slurm_get_msg_timeout() * 1000;
 			steps = req->forward.cnt + 1;
-			width = slurm_get_tree_width();
-			if (width)
-				steps /= width;
+			if (!req->forward.tree_width)
+				req->forward.tree_width =
+					slurm_get_tree_width();
+			if (req->forward.tree_width)
+				steps /= req->forward.tree_width;
 			timeout = (message_timeout * steps);
 			steps++;
 
@@ -4047,9 +4120,10 @@ int slurm_send_recv_controller_msg(slurm_msg_t *req, slurm_msg_t *resp)
 	time_t start_time = time(NULL);
 	int retry = 1;
 	slurm_ctl_conf_t *conf;
-	bool backup_controller_flag;
+	bool have_backup;
 	uint16_t slurmctld_timeout;
 	slurm_addr_t ctrl_addr;
+	static bool use_backup = false;
 
 	/* Just in case the caller didn't initialize his slurm_msg_t, and
 	 * since we KNOW that we are only sending to one node (the controller),
@@ -4062,13 +4136,13 @@ int slurm_send_recv_controller_msg(slurm_msg_t *req, slurm_msg_t *resp)
 	if (working_cluster_rec)
 		req->flags |= SLURM_GLOBAL_AUTH_KEY;
 
-	if ((fd = slurm_open_controller_conn(&ctrl_addr)) < 0) {
+	if ((fd = slurm_open_controller_conn(&ctrl_addr, &use_backup)) < 0) {
 		rc = -1;
 		goto cleanup;
 	}
 
 	conf = slurm_conf_lock();
-	backup_controller_flag = conf->backup_controller ? true : false;
+	have_backup = conf->backup_controller ? true : false;
 	slurmctld_timeout = conf->slurmctld_timeout;
 	slurm_conf_unlock();
 
@@ -4086,15 +4160,17 @@ int slurm_send_recv_controller_msg(slurm_msg_t *req, slurm_msg_t *resp)
 		    && (resp->msg_type == RESPONSE_SLURM_RC)
 		    && ((((return_code_msg_t *) resp->data)->return_code)
 			== ESLURM_IN_STANDBY_MODE)
-		    && (backup_controller_flag)
+		    && (have_backup)
 		    && (difftime(time(NULL), start_time)
 			< (slurmctld_timeout + (slurmctld_timeout / 2)))) {
 
-			debug("Neither primary nor backup controller "
-			      "responding, sleep and retry");
+			debug("Primary not responding, backup not in control. "
+			      "sleep and retry");
 			slurm_free_return_code_msg(resp->data);
-			sleep(30);
-			if ((fd = slurm_open_controller_conn(&ctrl_addr))
+			sleep(slurmctld_timeout / 2);
+			use_backup = false;
+			if ((fd = slurm_open_controller_conn(&ctrl_addr,
+							     &use_backup))
 			    < 0) {
 				rc = -1;
 			} else {
@@ -4146,16 +4222,17 @@ int slurm_send_only_controller_msg(slurm_msg_t *req)
 	int      retry = 0;
 	slurm_fd_t fd = -1;
 	slurm_addr_t ctrl_addr;
+	bool     use_backup = false;
 
 	/*
 	 *  Open connection to SLURM controller:
 	 */
-	if ((fd = slurm_open_controller_conn(&ctrl_addr)) < 0) {
+	if ((fd = slurm_open_controller_conn(&ctrl_addr, &use_backup)) < 0) {
 		rc = SLURM_SOCKET_ERROR;
 		goto cleanup;
 	}
 
-	if ((rc = slurm_send_node_msg(fd, req) < 0)) {
+	if ((rc = slurm_send_node_msg(fd, req)) < 0) {
 		rc = SLURM_ERROR;
 	} else {
 		debug3("slurm_send_only_controller_msg: sent %d", rc);
@@ -4194,7 +4271,7 @@ int slurm_send_only_node_msg(slurm_msg_t *req)
 		return SLURM_SOCKET_ERROR;
 	}
 
-	if ((rc = slurm_send_node_msg(fd, req) < 0)) {
+	if ((rc = slurm_send_node_msg(fd, req)) < 0) {
 		rc = SLURM_ERROR;
 	} else {
 		debug3("slurm_send_only_node_msg: sent %d", rc);
@@ -4420,12 +4497,12 @@ extern int *set_span(int total,  uint16_t tree_width)
 /*
  * Free a slurm message
  */
-extern void slurm_free_msg(slurm_msg_t * msg)
+extern void slurm_free_msg(slurm_msg_t *msg)
 {
 	if (msg) {
-		if (msg->auth_cred) {
+		if (msg->auth_cred)
 			(void) g_slurm_auth_destroy(msg->auth_cred);
-		}
+		slurm_free_msg_data(msg->msg_type, msg->data);
 		FREE_NULL_LIST(msg->ret_list);
 		xfree(msg);
 	}
@@ -4447,8 +4524,23 @@ extern int nodelist_find(const char *nodelist, const char *name)
 	return id;
 }
 
+/*
+ * Convert number from one unit to another.
+ * By default, Will convert num to largest divisible unit.
+ * Appends unit type suffix -- if applicable.
+ *
+ * IN num: number to convert.
+ * OUT buf: buffer to copy converted number into.
+ * IN buf_size: size of buffer.
+ * IN orig_type: The original type of num.
+ * IN spec_type: Type to convert num to. If specified, num will be converted up
+ * or down to to this unit type.
+ * IN divisor: size of type
+ * IN flags: flags to control whether to convert exactly or not at all.
+ */
 extern void convert_num_unit2(double num, char *buf, int buf_size,
-			      int orig_type, int divisor, uint32_t flags)
+			      int orig_type, int spec_type, int divisor,
+			      uint32_t flags)
 {
 	char *unit = "\0KMGTP?";
 	uint64_t i;
@@ -4456,7 +4548,7 @@ extern void convert_num_unit2(double num, char *buf, int buf_size,
 	if ((int64_t)num == 0) {
 		snprintf(buf, buf_size, "0");
 		return;
-	} else if (flags & CONVERT_NUM_UNIT_EXACT) {
+	} else if (spec_type == NO_VAL && (flags & CONVERT_NUM_UNIT_EXACT)) {
 		i = (uint64_t)num % (divisor / 2);
 
 		if (i > 0) {
@@ -4466,7 +4558,19 @@ extern void convert_num_unit2(double num, char *buf, int buf_size,
 		}
 	}
 
-	if (!(flags & CONVERT_NUM_UNIT_NO)) {
+	if (spec_type != NO_VAL) {
+		if (spec_type < orig_type) {
+			while (spec_type < orig_type) {
+				num *= divisor;
+				orig_type--;
+			}
+		} else if (spec_type > orig_type) {
+			while (spec_type > orig_type) {
+				num /= divisor;
+				orig_type++;
+			}
+		}
+	} else if (!(flags & CONVERT_NUM_UNIT_NO)) {
 		while (num > divisor) {
 			num /= divisor;
 			orig_type++;
@@ -4487,9 +4591,10 @@ extern void convert_num_unit2(double num, char *buf, int buf_size,
 }
 
 extern void convert_num_unit(double num, char *buf, int buf_size,
-			     int orig_type, uint32_t flags)
+			     int orig_type, int spec_type, uint32_t flags)
 {
-	convert_num_unit2(num, buf, buf_size, orig_type, 1024, flags);
+	convert_num_unit2(num, buf, buf_size, orig_type, spec_type, 1024,
+			  flags);
 }
 
 extern int revert_num_unit(const char *buf)
@@ -4515,16 +4620,11 @@ extern int revert_num_unit(const char *buf)
 
 extern int get_convert_unit_val(int base_unit, char convert_to)
 {
-	char *unit = "\0KMGTP?";
 	int conv_unit = 0, conv_value = 0;
-	char *tmp_char = strchr(unit + 1, toupper(convert_to));
-	if (!tmp_char) {
-		error("Conversion suffix '%c' not found in '%s'",
-		      convert_to, unit + 1);
+
+	if (!(conv_unit = get_unit_type(convert_to)))
 		return SLURM_ERROR;
-	}
 
-	conv_unit = tmp_char - unit;
 	while (base_unit++ < conv_unit) {
 		if (!conv_value)
 			conv_value = 1024;
@@ -4535,6 +4635,26 @@ extern int get_convert_unit_val(int base_unit, char convert_to)
 	return conv_value;
 }
 
+extern int get_unit_type(char unit)
+{
+	char *units = "\0KMGTP";
+	char *tmp_char = NULL;
+
+	if (unit == '\0') {
+		error("Invalid unit type '%c'. Possible options are '%s'",
+		      unit, units + 1);
+		return SLURM_ERROR;
+	}
+
+	tmp_char = strchr(units + 1, toupper(unit));
+	if (!tmp_char) {
+		error("Invalid unit type '%c'. Possible options are '%s'",
+		      unit, units + 1);
+		return SLURM_ERROR;
+	}
+	return tmp_char - units;
+}
+
 #if _DEBUG
 
 static void _print_data(char *data, int len)
@@ -4554,45 +4674,70 @@ static void _print_data(char *data, int len)
 
 /*
  * slurm_forward_data - forward arbitrary data to unix domain sockets on nodes
- * IN nodelist: nodes to forward data to
+ * IN/OUT nodelist: Nodes to forward data to (if failure this list is changed to
+ *                  reflect the failed nodes).
  * IN address: address of unix domain socket
  * IN len: length of data
  * IN data: real data
  * RET: error code
  */
-extern int
-slurm_forward_data(char *nodelist, char *address, uint32_t len, char *data)
+extern int slurm_forward_data(
+	char **nodelist, char *address, uint32_t len, const char *data)
 {
 	List ret_list = NULL;
 	int temp_rc = 0, rc = 0;
 	ret_data_info_t *ret_data_info = NULL;
-	slurm_msg_t *msg = xmalloc(sizeof(slurm_msg_t));
+	slurm_msg_t msg;
 	forward_data_msg_t req;
+	hostlist_t hl = NULL;
+	bool redo_nodelist = false;
+	slurm_msg_t_init(&msg);
 
-	slurm_msg_t_init(msg);
-
-	debug("slurm_forward_data: nodelist=%s, address=%s, len=%u",
-	      nodelist, address, len);
+	debug2("slurm_forward_data: nodelist=%s, address=%s, len=%u",
+	       *nodelist, address, len);
 	req.address = address;
 	req.len = len;
-	req.data = data;
+	req.data = (char *)data;
 
-	msg->msg_type = REQUEST_FORWARD_DATA;
-	msg->data = &req;
+	msg.msg_type = REQUEST_FORWARD_DATA;
+	msg.data = &req;
+
+	if ((ret_list = slurm_send_recv_msgs(*nodelist, &msg, 0, false))) {
+		if (list_count(ret_list) > 1)
+			redo_nodelist = true;
 
-	if ((ret_list = slurm_send_recv_msgs(nodelist, msg, 0, false))) {
 		while ((ret_data_info = list_pop(ret_list))) {
 			temp_rc = slurm_get_return_code(ret_data_info->type,
 							ret_data_info->data);
-			if (temp_rc)
+			if (temp_rc != SLURM_SUCCESS) {
 				rc = temp_rc;
+				if (redo_nodelist) {
+					if (!hl)
+						hl = hostlist_create(
+							ret_data_info->
+							node_name);
+					else
+						hostlist_push_host(
+							hl, ret_data_info->
+							node_name);
+				}
+			}
+			destroy_data_info(ret_data_info);
 		}
 	} else {
 		error("slurm_forward_data: no list was returned");
 		rc = SLURM_ERROR;
 	}
 
-	slurm_free_msg(msg);
+	if (hl) {
+		xfree(*nodelist);
+		hostlist_sort(hl);
+		*nodelist = hostlist_ranged_string_xmalloc(hl);
+		hostlist_destroy(hl);
+	}
+
+	FREE_NULL_LIST(ret_list);
+
 	return rc;
 }
 
diff --git a/src/common/slurm_protocol_api.h b/src/common/slurm_protocol_api.h
index bf58f5d4e..971e36f4b 100644
--- a/src/common/slurm_protocol_api.h
+++ b/src/common/slurm_protocol_api.h
@@ -220,6 +220,11 @@ char *slurm_get_msg_aggr_params(void);
  */
 extern uint16_t slurm_get_msg_timeout(void);
 
+/* slurm_get_tcp_timeout
+ * get default tcp timeout value from slurmctld_conf object
+ */
+extern uint16_t slurm_get_tcp_timeout(void);
+
 /* slurm_api_set_default_config
  *	called by the send_controller_msg function to insure that at least
  *	the compiled in default slurm_protocol_config object is initialized
@@ -259,6 +264,18 @@ char *slurm_get_gres_plugins(void);
  */
 char *slurm_get_job_submit_plugins(void);
 
+/* slurm_get_slurmctld_logfile
+ * get slurmctld_logfile from slurmctld_conf object from slurmctld_conf object
+ * RET char *   - slurmctld_logfile, MUST be xfreed by caller
+ */
+char *slurm_get_job_slurmctld_logfile(void);
+
+/* slurm_get_node_features_plugins
+ * get node_features_plugins from slurmctld_conf object
+ * RET char *   - knl_plugins, MUST be xfreed by caller
+ */
+char *slurm_get_node_features_plugins(void);
+
 /* slurm_get_slurmctld_plugstack
  * get slurmctld_plugstack from slurmctld_conf object from
  * slurmctld_conf object
@@ -608,6 +625,14 @@ char *slurm_get_launch_type(void);
  */
 int slurm_set_launch_type(char *launch_type);
 
+/* slurm_get_mcs_plugin
+ * RET mcs_plugin name, must be xfreed by caller */
+char *slurm_get_mcs_plugin(void);
+
+/* slurm_get_mcs_plugin_params
+ * RET mcs_plugin_params name, must be xfreed by caller */
+char *slurm_get_mcs_plugin_params(void);
+
 /* slurm_get_preempt_mode
  * returns the PreemptMode value from slurmctld_conf object
  * RET uint16_t   - PreemptMode value (See PREEMPT_MODE_* in slurm.h)
@@ -1016,10 +1041,13 @@ int slurm_send_node_msg(slurm_fd_t open_fd, slurm_msg_t *msg);
 
 /* calls connect to make a connection-less datagram connection to the
  *	primary or secondary slurmctld message engine
- * IN/OUT addr     - address of controller contacted
+ * IN/OUT addr       - address of controller contacted
+ * IN/OUT use_backup - IN: whether to try the backup first or not
+ *                     OUT: set to true if connection established with backup
  * RET slurm_fd	- file descriptor of the connection created
  */
-extern slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr);
+extern slurm_fd_t slurm_open_controller_conn(slurm_addr_t *addr,
+					     bool *use_backup);
 extern slurm_fd_t slurm_open_controller_conn_spec(enum controller_id dest);
 
 /* In the bsd socket implementation it creates a SOCK_STREAM socket
@@ -1239,11 +1267,13 @@ extern void slurm_free_msg(slurm_msg_t * msg);
 extern char *nodelist_nth_host(const char *nodelist, int inx);
 extern int nodelist_find(const char *nodelist, const char *name);
 extern void convert_num_unit2(double num, char *buf, int buf_size,
-			      int orig_type, int divisor, uint32_t flags);
+			      int orig_type, int spec_type, int divisor,
+			      uint32_t flags);
 extern void convert_num_unit(double num, char *buf, int buf_size,
-			     int orig_type, uint32_t flags);
+			     int orig_type, int spec_type, uint32_t flags);
 extern int revert_num_unit(const char *buf);
 extern int get_convert_unit_val(int base_type, char convert_to);
+extern int get_unit_type(char unit);
 extern void parse_int_to_array(int in, int *out);
 
 /*
@@ -1262,14 +1292,15 @@ extern int slurm_job_step_create (
 /* Should this be in <slurm/slurm.h> ? */
 /*
  * slurm_forward_data - forward arbitrary data to unix domain sockets on nodes
- * IN nodelist: nodes to forward data to
+ * IN/OUT nodelist: Nodes to forward data to (if failure this list is changed to
+ *                  reflect the failed nodes).
  * IN address: address of unix domain socket
  * IN len: length of data
  * IN data: real data
  * RET: error code
  */
-extern int slurm_forward_data(char *nodelist, char *address, uint32_t len,
-			      char *data);
+extern int slurm_forward_data(
+	char **nodelist, char *address, uint32_t len, const char *data);
 
 /*
  * slurm_setup_sockaddr - setup a sockaddr_in struct to be used for
diff --git a/src/common/slurm_protocol_common.h b/src/common/slurm_protocol_common.h
index 7f39dbb1e..fa372f55a 100644
--- a/src/common/slurm_protocol_common.h
+++ b/src/common/slurm_protocol_common.h
@@ -78,15 +78,16 @@
  * done here with them since we have to support old version of archive
  * files since they don't update once they are created.
  */
+#define SLURM_16_05_PROTOCOL_VERSION ((30 << 8) | 0)
 #define SLURM_15_08_PROTOCOL_VERSION ((29 << 8) | 0)
 #define SLURM_14_11_PROTOCOL_VERSION ((28 << 8) | 0)
-#define SLURM_14_03_PROTOCOL_VERSION ((27 << 8) | 0)
 
-#define SLURM_PROTOCOL_VERSION SLURM_15_08_PROTOCOL_VERSION
-#define SLURM_MIN_PROTOCOL_VERSION SLURM_14_03_PROTOCOL_VERSION
+#define SLURM_PROTOCOL_VERSION SLURM_16_05_PROTOCOL_VERSION
+#define SLURM_MIN_PROTOCOL_VERSION SLURM_14_11_PROTOCOL_VERSION
 
 #if 0
 /* SLURM version 14.11 code removed support for protocol versions before 2.5 */
+#define SLURM_14_03_PROTOCOL_VERSION ((27 << 8) | 0)
 #define SLURM_2_6_PROTOCOL_VERSION ((26 << 8) | 0)
 #define SLURM_2_5_PROTOCOL_VERSION ((25 << 8) | 0)
 #define SLURM_2_4_PROTOCOL_VERSION ((24 << 8) | 0)
diff --git a/src/common/slurm_protocol_defs.c b/src/common/slurm_protocol_defs.c
index ee3ea6a3b..85a0b4b9c 100644
--- a/src/common/slurm_protocol_defs.c
+++ b/src/common/slurm_protocol_defs.c
@@ -75,6 +75,7 @@
 strong_alias(preempt_mode_string, slurm_preempt_mode_string);
 strong_alias(preempt_mode_num, slurm_preempt_mode_num);
 strong_alias(job_reason_string, slurm_job_reason_string);
+strong_alias(job_share_string, slurm_job_share_string);
 strong_alias(job_state_string, slurm_job_state_string);
 strong_alias(job_state_string_compact, slurm_job_state_string_compact);
 strong_alias(job_state_num, slurm_job_state_num);
@@ -188,16 +189,31 @@ extern List slurm_copy_char_list(List char_list)
 	return ret_list;
 }
 
+static int _find_char_in_list(void *x, void *key)
+{
+	char *char1 = (char *)x;
+	char *char2 = (char *)key;
+
+	if (!xstrcasecmp(char1, char2))
+		return 1;
+
+	return 0;
+}
+
 
 /* returns number of objects added to list */
 extern int slurm_addto_char_list(List char_list, char *names)
 {
-	int i=0, start=0;
-	char *name = NULL, *tmp_char = NULL;
+	int i = 0, start = 0;
+	char *name = NULL;
 	ListIterator itr = NULL;
 	char quote_c = '\0';
 	int quote = 0;
 	int count = 0;
+	bool brack_not = false;
+	bool first_brack = false;
+	char *this_node_name;
+	hostlist_t host_list;
 
 	if (!char_list) {
 		error("No list was given to fill in");
@@ -218,69 +234,113 @@ extern int slurm_addto_char_list(List char_list, char *names)
 				break;
 			else if ((names[i] == '\"') || (names[i] == '\''))
 				names[i] = '`';
-			else if (names[i] == ',') {
-				/* If there is a comma at the end just
-				   ignore it */
-				if (!names[i+1])
-					break;
+			else if (names[i] == '[')
+			       /* Make sure there is a open bracket. This
+				* check is to allow comma sperated notation
+				* within the bracket ie. linux[0-1,2]  */
+				first_brack = true;
+			else if (names[i] == ',' && !first_brack) {
+				/* Check that the string before , was
+				 * not a [] notation value */
+				if (!brack_not) {
+					/* If there is a comma at the end just
+					 * ignore it */
+					if (!names[i+1])
+						break;
 
-				name = xstrndup(names+start, (i-start));
+					name = xstrndup(names+start,
+							(i-start));
+					//info("got %s %d", name, i-start);
+
+					/* If we get a duplicate remove the
+					 * first one and tack this on the end.
+					 * This is needed for get associations
+					 * with qos.
+					 */
+					if (list_find(itr,
+						      _find_char_in_list,
+						      name)) {
+						list_delete_item(itr);
+					} else
+						count++;
+
+					xstrtolower(name);
+					list_append(char_list, name);
+
+					list_iterator_reset(itr);
+
+					i++;
+					start = i;
+					if (!names[i]) {
+						info("There is a problem "
+						     "with your request. "
+						     "It appears you have "
+						     "spaces inside your "
+						     "list.");
+						count = 0;
+						goto endit;
+					}
+				} else {
+					brack_not = false;
+					/* Skip over the , so it is
+					 * not included in the char list */
+					start = ++i;
+				}
+			} else if (names[i] == ']') {
+				brack_not = true;
+				first_brack = false;
+				name = xstrndup(names+start, ((i + 1)-start));
 				//info("got %s %d", name, i-start);
 
-				while ((tmp_char = list_next(itr))) {
-					if (!strcasecmp(tmp_char, name))
-						break;
-				}
-				/* If we get a duplicate remove the
-				 * first one and tack this on the end.
-				 * This is needed for get associations
-				 * with qos.
-				 */
-				if (tmp_char)
-					list_delete_item(itr);
-				else
-					count++;
-
-				xstrtolower(name);
-				list_append(char_list, name);
-
-				list_iterator_reset(itr);
-
-				i++;
-				start = i;
-				if (!names[i]) {
-					info("There is a problem with "
-					     "your request.  It appears you "
-					     "have spaces inside your list.");
-					count = 0;
-					goto endit;
+				if ((host_list = hostlist_create(name))) {
+					while ((this_node_name =
+						xstrdup(hostlist_shift
+							(host_list)))) {
+						/* If we get a duplicate
+						 * remove the first one and tack
+						 * this on the end. This is
+						 * needed for get associations
+						 * with qos.
+						 */
+						if (list_find(itr,
+							    _find_char_in_list,
+							    this_node_name)) {
+							list_delete_item(itr);
+						} else
+							count++;
+
+						xstrtolower(this_node_name);
+						list_append(char_list,
+							    this_node_name);
+
+						list_iterator_reset(itr);
+
+						start = i + 1;
+					}
 				}
+				hostlist_destroy(host_list);
 			}
 			i++;
 		}
 
-		name = xstrndup(names+start, (i-start));
-		while ((tmp_char = list_next(itr))) {
-			if (!strcasecmp(tmp_char, name))
-				break;
+		if (i-start) {
+			name = xstrndup(names+start, (i-start));
+			/* If we get a duplicate remove the
+			 * first one and tack this on the end.
+			 * This is needed for get associations
+			 * with qos.
+			 */
+			if (list_find(itr, _find_char_in_list, name)) {
+				list_delete_item(itr);
+			} else
+				count++;
+
+			xstrtolower(name);
+			list_append(char_list, name);
 		}
-
-		/* If we get a duplicate remove the
-		 * first one and tack this on the end.
-		 * This is needed for get associations
-		 * with qos.
-		 */
-		if (tmp_char)
-			list_delete_item(itr);
-		else
-			count++;
-
-		xstrtolower(name);
-		list_append(char_list, name);
 	}
 endit:
 	list_iterator_destroy(itr);
-
 	return count;
 }
 
@@ -311,7 +371,7 @@ static int _addto_step_list_internal(List step_list, char *names,
 	} else {
 		*dot++ = 0;
 		/* can't use NO_VAL since that means all */
-		if (!strcmp(dot, "batch"))
+		if (!xstrcmp(dot, "batch"))
 			selected_step->stepid = INFINITE;
 		else if (isdigit(*dot))
 			selected_step->stepid = atoi(dot);
@@ -390,7 +450,7 @@ extern int slurm_sort_char_list_asc(void *v1, void *v2)
 {
 	char *name_a = *(char **)v1;
 	char *name_b = *(char **)v2;
-	int diff = strcmp(name_a, name_b);
+	int diff = xstrcmp(name_a, name_b);
 
 	if (diff < 0)
 		return -1;
@@ -404,7 +464,7 @@ extern int slurm_sort_char_list_desc(void *v1, void *v2)
 {
 	char *name_a = *(char **)v1;
 	char *name_b = *(char **)v2;
-	int diff = strcmp(name_a, name_b);
+	int diff = xstrcmp(name_a, name_b);
 
 	if (diff > 0)
 		return -1;
@@ -422,6 +482,7 @@ extern void slurm_free_last_update_msg(last_update_msg_t * msg)
 extern void slurm_free_reboot_msg(reboot_msg_t * msg)
 {
 	if (msg) {
+		xfree(msg->features);
 		xfree(msg->node_list);
 		xfree(msg);
 	}
@@ -555,6 +616,7 @@ extern void slurm_free_job_desc_msg(job_desc_msg_t * msg)
 		xfree(msg->licenses);
 		xfree(msg->linuximage);
 		xfree(msg->mail_user);
+		xfree(msg->mcs_label);
 		xfree(msg->mem_bind);
 		xfree(msg->mloaderimage);
 		xfree(msg->name);
@@ -591,6 +653,7 @@ extern void slurm_free_prolog_launch_msg(prolog_launch_msg_t * msg)
 		xfree(msg->std_err);
 		xfree(msg->std_out);
 		xfree(msg->work_dir);
+		xfree(msg->user_name);
 
 		for (i = 0; i < msg->spank_job_env_size; i++)
 			xfree(msg->spank_job_env[i]);
@@ -684,6 +747,7 @@ extern void slurm_free_job_info_members(job_info_t * job)
 		xfree(job->features);
 		xfree(job->gres);
 		xfree(job->licenses);
+		xfree(job->mcs_label);
 		xfree(job->name);
 		xfree(job->network);
 		xfree(job->node_inx);
@@ -735,6 +799,8 @@ extern void slurm_free_node_registration_status_msg(
 		xfree(msg->cpu_spec_list);
 		if (msg->energy)
 			acct_gather_energy_destroy(msg->energy);
+		xfree(msg->features_active);
+		xfree(msg->features_avail);
 		if (msg->gres_info)
 			free_buf(msg->gres_info);
 		xfree(msg->job_id);
@@ -761,6 +827,7 @@ extern void slurm_free_update_node_msg(update_node_msg_t * msg)
 {
 	if (msg) {
 		xfree(msg->features);
+		xfree(msg->features_act);
 		xfree(msg->gres);
 		xfree(msg->node_addr);
 		xfree(msg->node_hostname);
@@ -1123,6 +1190,7 @@ extern void slurm_free_checkpoint_resp_msg(checkpoint_resp_msg_t *msg)
 		xfree(msg);
 	}
 }
+
 extern void slurm_free_suspend_msg(suspend_msg_t *msg)
 {
 	if (msg) {
@@ -1131,6 +1199,14 @@ extern void slurm_free_suspend_msg(suspend_msg_t *msg)
 	}
 }
 
+extern void slurm_free_top_job_msg(top_job_msg_t *msg)
+{
+	if (msg) {
+		xfree(msg->job_id_str);
+		xfree(msg);
+	}
+}
+
 extern void
 slurm_free_requeue_msg(requeue_msg_t *msg)
 {
@@ -1529,6 +1605,28 @@ extern char *job_reason_string(enum job_state_reason inx)
 		return "AssocMaxBBMinutesPerJob";
 	case WAIT_QOS_MIN_BB:
 		return "QOSMinBB";
+	case FAIL_DEADLINE:
+		return "DeadLine";
+	case WAIT_QOS_MAX_BB_PER_ACCT:
+		return "MaxBBPerAccount";
+	case WAIT_QOS_MAX_CPU_PER_ACCT:
+		return "MaxCpuPerAccount";
+	case WAIT_QOS_MAX_ENERGY_PER_ACCT:
+		return "MaxEnergyPerAccount";
+	case WAIT_QOS_MAX_GRES_PER_ACCT:
+		return "MaxGRESPerAccount";
+	case WAIT_QOS_MAX_NODE_PER_ACCT:
+		return "MaxNodePerAccount";
+	case WAIT_QOS_MAX_LIC_PER_ACCT:
+		return "MaxLicensePerAccount";
+	case WAIT_QOS_MAX_MEM_PER_ACCT:
+		return "MaxMemoryPerAccount";
+	case WAIT_QOS_MAX_UNK_PER_ACCT:
+		return "MaxUnknownPerAccount";
+	case WAIT_QOS_MAX_JOB_PER_ACCT:
+		return "MaxJobsPerAccount";
+	case WAIT_QOS_MAX_SUB_JOB_PER_ACCT:
+		return "MaxSubmitJobsPerAccount";
 	default:
 		snprintf(val, sizeof(val), "%d", inx);
 		return val;
@@ -1543,13 +1641,39 @@ extern void slurm_free_get_kvs_msg(kvs_get_msg_t *msg)
 	}
 }
 
+extern void slurm_free_kvs_comm_set(kvs_comm_set_t *msg)
+{
+	int i, j;
+
+	if (msg) {
+		for (i = 0; i < msg->host_cnt; i++)
+			xfree(msg->kvs_host_ptr[i].hostname);
+		xfree(msg->kvs_host_ptr);
+
+		for (i = 0; i < msg->kvs_comm_recs; i++) {
+			if (!msg->kvs_comm_ptr[i])
+				continue;
+
+			xfree(msg->kvs_comm_ptr[i]->kvs_name);
+			for (j = 0; j < msg->kvs_comm_ptr[i]->kvs_cnt; j++) {
+				xfree(msg->kvs_comm_ptr[i]->kvs_keys[j]);
+				xfree(msg->kvs_comm_ptr[i]->kvs_values[j]);
+			}
+			xfree(msg->kvs_comm_ptr[i]->kvs_keys);
+			xfree(msg->kvs_comm_ptr[i]->kvs_values);
+		}
+		xfree(msg->kvs_comm_ptr);
+		xfree(msg);
+	}
+}
+
 extern void slurm_free_will_run_response_msg(will_run_response_msg_t *msg)
 {
-        if (msg) {
-                xfree(msg->node_list);
+	if (msg) {
+		xfree(msg->node_list);
 		FREE_NULL_LIST(msg->preemptee_job_id);
-                xfree(msg);
-        }
+		xfree(msg);
+	}
 }
 
 inline void slurm_free_forward_data_msg(forward_data_msg_t *msg)
@@ -1608,23 +1732,23 @@ extern uint16_t preempt_mode_num(const char *preempt_mode)
 	tmp_str = xstrdup(preempt_mode);
 	tok = strtok_r(tmp_str, ",", &last);
 	while (tok) {
-		if (strcasecmp(tok, "gang") == 0) {
+		if (xstrcasecmp(tok, "gang") == 0) {
 			mode_num |= PREEMPT_MODE_GANG;
-		} else if ((strcasecmp(tok, "off") == 0)
-			   || (strcasecmp(tok, "cluster") == 0)) {
+		} else if ((xstrcasecmp(tok, "off") == 0)
+			   || (xstrcasecmp(tok, "cluster") == 0)) {
 			mode_num += PREEMPT_MODE_OFF;
 			preempt_modes++;
-		} else if (strcasecmp(tok, "cancel") == 0) {
+		} else if (xstrcasecmp(tok, "cancel") == 0) {
 			mode_num += PREEMPT_MODE_CANCEL;
 			preempt_modes++;
-		} else if (strcasecmp(tok, "checkpoint") == 0) {
+		} else if (xstrcasecmp(tok, "checkpoint") == 0) {
 			mode_num += PREEMPT_MODE_CHECKPOINT;
 			preempt_modes++;
-		} else if (strcasecmp(tok, "requeue") == 0) {
+		} else if (xstrcasecmp(tok, "requeue") == 0) {
 			mode_num += PREEMPT_MODE_REQUEUE;
 			preempt_modes++;
-		} else if ((strcasecmp(tok, "on") == 0) ||
-			   (strcasecmp(tok, "suspend") == 0)) {
+		} else if ((xstrcasecmp(tok, "on") == 0) ||
+			   (xstrcasecmp(tok, "suspend") == 0)) {
 			mode_num += PREEMPT_MODE_SUSPEND;
 			preempt_modes++;
 		} else {
@@ -1680,30 +1804,44 @@ extern uint16_t log_string2num(char *name)
 	if ((name[0] >= '0') && (name[0] <= '9'))
 		return (uint16_t) atoi(name);
 
-	if (!strcasecmp(name, "quiet"))
+	if (!xstrcasecmp(name, "quiet"))
 		return (uint16_t) 0;
-	if (!strcasecmp(name, "fatal"))
+	if (!xstrcasecmp(name, "fatal"))
 		return (uint16_t) 1;
-	if (!strcasecmp(name, "error"))
+	if (!xstrcasecmp(name, "error"))
 		return (uint16_t) 2;
-	if (!strcasecmp(name, "info"))
+	if (!xstrcasecmp(name, "info"))
 		return (uint16_t) 3;
-	if (!strcasecmp(name, "verbose"))
+	if (!xstrcasecmp(name, "verbose"))
 		return (uint16_t) 4;
-	if (!strcasecmp(name, "debug"))
+	if (!xstrcasecmp(name, "debug"))
 		return (uint16_t) 5;
-	if (!strcasecmp(name, "debug2"))
+	if (!xstrcasecmp(name, "debug2"))
 		return (uint16_t) 6;
-	if (!strcasecmp(name, "debug3"))
+	if (!xstrcasecmp(name, "debug3"))
 		return (uint16_t) 7;
-	if (!strcasecmp(name, "debug4"))
+	if (!xstrcasecmp(name, "debug4"))
 		return (uint16_t) 8;
-	if (!strcasecmp(name, "debug5"))
+	if (!xstrcasecmp(name, "debug5"))
 		return (uint16_t) 9;
 
 	return (uint16_t) NO_VAL;
 }
 
+extern char *job_share_string(uint16_t shared)
+{
+	if (shared == JOB_SHARED_NONE)
+		return "NO";
+	else if (shared == JOB_SHARED_OK)
+		return "YES";
+	else if (shared == JOB_SHARED_USER)
+		return "USER";
+	else if (shared == JOB_SHARED_MCS)
+		return "MCS";
+	else
+		return "OK";
+}
+
 extern char *job_state_string(uint32_t inx)
 {
 	/* Process JOB_STATE_FLAGS */
@@ -1745,6 +1883,8 @@ extern char *job_state_string(uint32_t inx)
 		return "PREEMPTED";
 	case JOB_BOOT_FAIL:
 		return "BOOT_FAIL";
+	case JOB_DEADLINE:
+		return "DEADLINE";
 	default:
 		return "?";
 	}
@@ -1790,6 +1930,8 @@ extern char *job_state_string_compact(uint32_t inx)
 		return "PR";
 	case JOB_BOOT_FAIL:
 		return "BF";
+	case JOB_DEADLINE:
+		return "DL";
 	default:
 		return "?";
 	}
@@ -1797,8 +1939,8 @@ extern char *job_state_string_compact(uint32_t inx)
 
 static bool _job_name_test(uint32_t state_num, const char *state_name)
 {
-	if (!strcasecmp(state_name, job_state_string(state_num)) ||
-	    !strcasecmp(state_name, job_state_string_compact(state_num))) {
+	if (!xstrcasecmp(state_name, job_state_string(state_num)) ||
+	    !xstrcasecmp(state_name, job_state_string_compact(state_num))) {
 		return true;
 	}
 	return false;
@@ -2022,6 +2164,11 @@ extern char *reservation_flags_string(uint32_t flags)
 			xstrcat(flag_str, ",");
 		xstrcat(flag_str, "REPLACE");
 	}
+	if (flags & RESERVE_FLAG_PURGE_COMP) {
+		if (flag_str[0])
+			xstrcat(flag_str, ",");
+		xstrcat(flag_str, "PURGE_COMP");
+	}
 	return flag_str;
 }
 
@@ -2095,27 +2242,27 @@ extern char *bb_state_string(uint16_t state)
 /* Translate a burst buffer state string to its equivalant numeric value */
 extern uint16_t bb_state_num(char *tok)
 {
-	if (!strcasecmp(tok, "pending"))
+	if (!xstrcasecmp(tok, "pending"))
 		return BB_STATE_PENDING;
-	if (!strcasecmp(tok, "allocating"))
+	if (!xstrcasecmp(tok, "allocating"))
 		return BB_STATE_ALLOCATING;
-	if (!strcasecmp(tok, "allocated"))
+	if (!xstrcasecmp(tok, "allocated"))
 		return BB_STATE_ALLOCATED;
-	if (!strcasecmp(tok, "staging-in"))
+	if (!xstrcasecmp(tok, "staging-in"))
 		return BB_STATE_STAGING_IN;
-	if (!strcasecmp(tok, "staged-in"))
+	if (!xstrcasecmp(tok, "staged-in"))
 		return BB_STATE_STAGED_IN;
-	if (!strcasecmp(tok, "running"))
+	if (!xstrcasecmp(tok, "running"))
 		return BB_STATE_RUNNING;
-	if (!strcasecmp(tok, "suspend"))
+	if (!xstrcasecmp(tok, "suspend"))
 		return BB_STATE_SUSPEND;
-	if (!strcasecmp(tok, "staging-out"))
+	if (!xstrcasecmp(tok, "staging-out"))
 		return BB_STATE_STAGING_OUT;
-	if (!strcasecmp(tok, "staged-out"))
+	if (!xstrcasecmp(tok, "staged-out"))
 		return BB_STATE_STAGED_OUT;
-	if (!strcasecmp(tok, "teardown"))
+	if (!xstrcasecmp(tok, "teardown"))
 		return BB_STATE_TEARDOWN;
-	if (!strcasecmp(tok, "complete"))
+	if (!xstrcasecmp(tok, "complete"))
 		return BB_STATE_COMPLETE;
 	return 0;
 }
@@ -2393,7 +2540,7 @@ extern uint16_t power_flags_id(char *power_flags)
 	tmp = xstrdup(power_flags);
 	tok = strtok_r(tmp, ",", &save_ptr);
 	while (tok) {
-		if (!strcasecmp(tok, "level"))
+		if (!xstrcasecmp(tok, "level"))
 			rc |= SLURM_POWER_FLAGS_LEVEL;
 		else
 			error("Ignoring unrecognized power option (%s)", tok);
@@ -2741,7 +2888,7 @@ extern void slurm_free_sbcast_cred_msg(job_sbcast_cred_msg_t * msg)
 
 /*
  * slurm_free_job_alloc_info_response_msg - free slurm job allocation
- *	                                    info response message
+ *					    info response message
  * IN msg - pointer to job allocation info response message
  * NOTE: buffer is loaded by slurm_allocate_resources
  */
@@ -2976,9 +3123,11 @@ extern void slurm_free_node_info_members(node_info_t * node)
 		ext_sensors_destroy(node->ext_sensors);
 		power_mgmt_data_free(node->power);
 		xfree(node->features);
+		xfree(node->features_act);
 		xfree(node->gres);
 		xfree(node->gres_drain);
 		xfree(node->gres_used);
+		xfree(node->mcs_label);
 		xfree(node->name);
 		xfree(node->node_addr);
 		xfree(node->node_hostname);
@@ -3120,8 +3269,7 @@ extern void slurm_free_topo_info_msg(topo_info_response_msg_t *msg)
  */
 extern void slurm_free_burst_buffer_info_msg(burst_buffer_info_msg_t *msg)
 {
-	int i, j, k;
-	burst_buffer_gres_t *bb_gres_ptr;
+	int i, j;
 	burst_buffer_info_t *bb_info_ptr;
 	burst_buffer_resv_t *bb_resv_ptr;
 
@@ -3133,11 +3281,6 @@ extern void slurm_free_burst_buffer_info_msg(burst_buffer_info_msg_t *msg)
 			xfree(bb_info_ptr->deny_users);
 			xfree(bb_info_ptr->destroy_buffer);
 			xfree(bb_info_ptr->get_sys_state);
-			for (k = 0, bb_gres_ptr = bb_info_ptr->gres_ptr;
-			     k < bb_info_ptr->gres_cnt; k++, bb_gres_ptr++) {
-				xfree(bb_info_ptr->name);
-			}
-			xfree(bb_info_ptr->gres_ptr);
 			xfree(bb_info_ptr->name);
 			xfree(bb_info_ptr->start_stage_in);
 			xfree(bb_info_ptr->start_stage_out);
@@ -3147,15 +3290,10 @@ extern void slurm_free_burst_buffer_info_msg(burst_buffer_info_msg_t *msg)
 			     bb_resv_ptr = bb_info_ptr->burst_buffer_resv_ptr;
 			     j < bb_info_ptr->buffer_count;
 			     j++, bb_resv_ptr++) {
-				for (k = 0, bb_gres_ptr = bb_resv_ptr->gres_ptr;
-				     k < bb_resv_ptr->gres_cnt;
-				     k++, bb_gres_ptr++) {
-					xfree(bb_gres_ptr->name);
-				}
 				xfree(bb_resv_ptr->account);
-				xfree(bb_resv_ptr->gres_ptr);
 				xfree(bb_resv_ptr->name);
 				xfree(bb_resv_ptr->partition);
+				xfree(bb_resv_ptr->pool);
 				xfree(bb_resv_ptr->qos);
 			}
 			xfree(bb_info_ptr->burst_buffer_resv_ptr);
@@ -3426,12 +3564,16 @@ extern void slurm_free_comp_msg_list(void *x)
 {
 	slurm_msg_t *msg = (slurm_msg_t*)x;
 	if (msg) {
-		if (msg->data_size) {
+		if (msg->data_size)
 			free_buf(msg->data);
-			msg->data = NULL;
-		} else
+		else
 			slurm_free_msg_data(msg->msg_type, msg->data);
 
+		/* make sure the data is NULL here or we could cause a
+		 * double free in slurm_free_msg
+		 */
+		msg->data = NULL;
+
 		slurm_free_msg(msg);
 	}
 }
@@ -3446,7 +3588,13 @@ extern void slurm_free_composite_msg(composite_msg_t *msg)
 
 extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 {
-	switch(type) {
+	switch (type) {
+	case RESPONSE_LAUNCH_TASKS:
+		slurm_free_launch_tasks_response_msg(data);
+		break;
+	case MESSAGE_TASK_EXIT:
+		slurm_free_task_exit_msg(data);
+		break;
 	case REQUEST_BUILD_INFO:
 		slurm_free_last_update_msg(data);
 		break;
@@ -3465,7 +3613,9 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case MESSAGE_EPILOG_COMPLETE:
 		slurm_free_epilog_complete_msg(data);
 		break;
+	case REQUEST_KILL_JOB:
 	case REQUEST_CANCEL_JOB_STEP:
+	case SRUN_STEP_SIGNAL:
 		slurm_free_job_step_kill_msg(data);
 		break;
 	case REQUEST_COMPLETE_JOB_ALLOCATION:
@@ -3499,6 +3649,7 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case RESPONSE_ACCT_GATHER_UPDATE:
 		slurm_free_acct_gather_node_resp_msg(data);
 		break;
+	case REQUEST_NODE_REGISTRATION_STATUS:
 	case MESSAGE_NODE_REGISTRATION_STATUS:
 		slurm_free_node_registration_status_msg(data);
 		break;
@@ -3546,9 +3697,6 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case REQUEST_LAYOUT_INFO:
 		slurm_free_layout_info_request_msg(data);
 		break;
-	case REQUEST_NODE_REGISTRATION_STATUS:
-		slurm_free_node_registration_status_msg(data);
-		break;
 	case REQUEST_CHECKPOINT:
 		slurm_free_checkpoint_msg(data);
 		break;
@@ -3568,8 +3716,13 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case REQUEST_SUSPEND_INT:
 		slurm_free_suspend_int_msg(data);
 		break;
-	case REQUEST_JOB_READY:
+	case REQUEST_TOP_JOB:
+		slurm_free_top_job_msg(data);
+		break;
 	case REQUEST_JOB_REQUEUE:
+		slurm_free_requeue_msg(data);
+		break;
+	case REQUEST_JOB_READY:
 	case REQUEST_JOB_INFO_SINGLE:
 		slurm_free_job_id_msg(data);
 		break;
@@ -3595,6 +3748,11 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case REQUEST_STEP_COMPLETE_AGGR:
 		slurm_free_step_complete_msg(data);
 		break;
+	case REQUEST_JOB_STEP_STAT:
+	case REQUEST_JOB_STEP_PIDS:
+	case REQUEST_STEP_LAYOUT:
+		slurm_free_job_step_id_msg(data);
+		break;
 	case RESPONSE_JOB_STEP_STAT:
 		slurm_free_job_step_stat(data);
 		break;
@@ -3660,11 +3818,10 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case REQUEST_HEALTH_CHECK:
 	case REQUEST_ACCT_GATHER_UPDATE:
 	case ACCOUNTING_FIRST_REG:
-	case ACCOUNTING_REGISTER_CTLD:
 	case REQUEST_TOPO_INFO:
- 	case REQUEST_BURST_BUFFER_INFO:
-	case REQUEST_SICP_INFO:
+	case REQUEST_BURST_BUFFER_INFO:
 	case REQUEST_POWERCAP_INFO:
+	case ACCOUNTING_REGISTER_CTLD:
 		/* No body to free */
 		break;
 	case REQUEST_REBOOT_NODES:
@@ -3705,6 +3862,64 @@ extern int slurm_free_msg_data(slurm_msg_type_t type, void *data)
 	case RESPONSE_MESSAGE_COMPOSITE:
 		slurm_free_composite_msg(data);
 		break;
+	case REQUEST_UPDATE_BLOCK:
+		slurm_free_block_info(data);
+		break;
+	case REQUEST_JOB_NOTIFY:
+		slurm_free_job_notify_msg(data);
+		break;
+	case REQUEST_STATS_INFO:
+		slurm_free_stats_info_request_msg(data);
+		break;
+	case REQUEST_LICENSE_INFO:
+		slurm_free_license_info_request_msg(data);
+		break;
+	case REQUEST_ACCT_GATHER_ENERGY:
+		slurm_free_acct_gather_energy_req_msg(data);
+		break;
+	case REQUEST_FORWARD_DATA:
+		slurm_free_forward_data_msg(data);
+		break;
+	case REQUEST_NETWORK_CALLERID:
+		slurm_free_network_callerid_msg(data);
+		break;
+	case SRUN_JOB_COMPLETE:
+		slurm_free_srun_job_complete_msg(data);
+		break;
+	case SRUN_PING:
+		slurm_free_srun_ping_msg(data);
+		break;
+	case SRUN_EXEC:
+		slurm_free_srun_exec_msg(data);
+		break;
+	case SRUN_TIMEOUT:
+		slurm_free_srun_timeout_msg(data);
+		break;
+	case SRUN_USER_MSG:
+		slurm_free_srun_user_msg(data);
+		break;
+	case SRUN_NODE_FAIL:
+		slurm_free_srun_node_fail_msg(data);
+		break;
+	case SRUN_STEP_MISSING:
+		slurm_free_srun_step_missing_msg(data);
+		break;
+	case PMI_KVS_GET_REQ:
+		slurm_free_get_kvs_msg(data);
+		break;
+	case PMI_KVS_GET_RESP:
+	case PMI_KVS_PUT_REQ:
+		slurm_free_kvs_comm_set(data);
+		break;
+	case PMI_KVS_PUT_RESP:
+		/* No body */
+		break;
+	case RESPONSE_RESOURCE_ALLOCATION:
+		slurm_free_resource_allocation_response_msg(data);
+		break;
+	case REQUEST_ASSOC_MGR_INFO:
+		slurm_free_assoc_mgr_info_request_msg(data);
+		break;
 	default:
 		error("invalid type trying to be freed %u", type);
 		break;
@@ -3765,13 +3980,13 @@ extern void slurm_free_job_notify_msg(job_notify_msg_t * msg)
  *   programs running with root privileges.
  */
 extern bool valid_spank_job_env(char **spank_job_env,
-			        uint32_t spank_job_env_size, uid_t uid)
+				uint32_t spank_job_env_size, uid_t uid)
 {
 	int i;
 	char *entry;
 
 	for (i=0; i<spank_job_env_size; i++) {
-		if (!strncmp(spank_job_env[i], "SPANK_", 6))
+		if (!xstrncmp(spank_job_env[i], "SPANK_", 6))
 			continue;
 		entry = spank_job_env[i];
 		spank_job_env[i] = xstrdup_printf ("SPANK_%s", entry);
@@ -3817,7 +4032,7 @@ rpc_num2string(uint16_t opcode)
 	static char buf[16];
 
 	switch (opcode) {
-	case REQUEST_NODE_REGISTRATION_STATUS:
+	case REQUEST_NODE_REGISTRATION_STATUS:			/* 1001 */
 		return "REQUEST_NODE_REGISTRATION_STATUS";
 	case MESSAGE_NODE_REGISTRATION_STATUS:
 		return "MESSAGE_NODE_REGISTRATION_STATUS";
@@ -3836,7 +4051,7 @@ rpc_num2string(uint16_t opcode)
 	case REQUEST_CONTROL:
 		return "REQUEST_CONTROL";
 	case REQUEST_SET_DEBUG_LEVEL:
-		return "REQUEST_SET_DEBUG_LEVEL";
+		return "REQUEST_SET_DEBUG_LEVEL";		/* 1010 */
 	case REQUEST_HEALTH_CHECK:
 		return "REQUEST_HEALTH_CHECK";
 	case REQUEST_TAKEOVER:
@@ -3854,14 +4069,15 @@ rpc_num2string(uint16_t opcode)
 	case RESPONSE_ACCT_GATHER_UPDATE:
 		return "RESPONSE_ACCT_GATHER_UPDATE";
 	case REQUEST_ACCT_GATHER_ENERGY:
-		return "REQUEST_ACCT_GATHER_ENERGY";
+		return "REQUEST_ACCT_GATHER_ENERGY";		/* 1020 */
 	case RESPONSE_ACCT_GATHER_ENERGY:
 		return "RESPONSE_ACCT_GATHER_ENERGY";
 	case REQUEST_LICENSE_INFO:
 		return "REQUEST_LICENSE_INFO";
 	case RESPONSE_LICENSE_INFO:
 		return "RESPONSE_LICENSE_INFO";
-	case REQUEST_BUILD_INFO:
+
+	case REQUEST_BUILD_INFO:				/* 2001 */
 		return "REQUEST_BUILD_INFO";
 	case RESPONSE_BUILD_INFO:
 		return "RESPONSE_BUILD_INFO";
@@ -3880,7 +4096,7 @@ rpc_num2string(uint16_t opcode)
 	case REQUEST_PARTITION_INFO:
 		return "REQUEST_PARTITION_INFO";
 	case RESPONSE_PARTITION_INFO:
-		return "RESPONSE_PARTITION_INFO";
+		return "RESPONSE_PARTITION_INFO";		/* 2010 */
 	case REQUEST_ACCTING_INFO:
 		return "REQUEST_ACCTING_INFO";
 	case RESPONSE_ACCOUNTING_INFO:
@@ -3900,7 +4116,7 @@ rpc_num2string(uint16_t opcode)
 	case REQUEST_TRIGGER_CLEAR:
 		return "REQUEST_TRIGGER_CLEAR";
 	case RESPONSE_TRIGGER_GET:
-		return "RESPONSE_TRIGGER_GET";
+		return "RESPONSE_TRIGGER_GET";			/* 2020 */
 	case REQUEST_JOB_INFO_SINGLE:
 		return "REQUEST_JOB_INFO_SINGLE";
 	case REQUEST_SHARE_INFO:
@@ -3911,10 +4127,6 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_RESERVATION_INFO";
 	case RESPONSE_RESERVATION_INFO:
 		return "RESPONSE_RESERVATION_INFO";
-	case REQUEST_LAYOUT_INFO:
-		return "REQUEST_LAYOUT_INFO";
-	case RESPONSE_LAYOUT_INFO:
-		return "RESPONSE_LAYOUT_INFO";
 	case REQUEST_PRIORITY_FACTORS:
 		return "REQUEST_PRIORITY_FACTORS";
 	case RESPONSE_PRIORITY_FACTORS:
@@ -3924,7 +4136,7 @@ rpc_num2string(uint16_t opcode)
 	case RESPONSE_TOPO_INFO:
 		return "RESPONSE_TOPO_INFO";
 	case REQUEST_TRIGGER_PULL:
-		return "REQUEST_TRIGGER_PULL";
+		return "REQUEST_TRIGGER_PULL";			/* 2030 */
 	case REQUEST_FRONT_END_INFO:
 		return "REQUEST_FRONT_END_INFO";
 	case RESPONSE_FRONT_END_INFO:
@@ -3937,16 +4149,33 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_STATS_INFO";
 	case RESPONSE_STATS_INFO:
 		return "RESPONSE_STATS_INFO";
+	case REQUEST_BURST_BUFFER_INFO:
+		return "REQUEST_BURST_BUFFER_INFO";
+	case RESPONSE_BURST_BUFFER_INFO:
+		return "RESPONSE_BURST_BUFFER_INFO";
 	case REQUEST_JOB_USER_INFO:
 		return "REQUEST_JOB_USER_INFO";
-	case REQUEST_NODE_INFO_SINGLE:
+	case REQUEST_NODE_INFO_SINGLE:				/* 2040 */
 		return "REQUEST_NODE_INFO_SINGLE";
-	case REQUEST_UPDATE_JOB:
+	case REQUEST_POWERCAP_INFO:
+		return "REQUEST_POWERCAP_INFO";
+	case RESPONSE_POWERCAP_INFO:
+		return "RESPONSE_POWERCAP_INFO";
+	case REQUEST_ASSOC_MGR_INFO:
+		return "REQUEST_ASSOC_MGR_INFO";
+	case RESPONSE_ASSOC_MGR_INFO:
+		return "RESPONSE_ASSOC_MGR_INFO";
+	/* case REQUEST_SICP_INFO_DEFUNCT:			DEFUNCT */
+	/* case RESPONSE_SICP_INFO_DEFUNCT:			DEFUNCT */
+	case REQUEST_LAYOUT_INFO:
+		return "REQUEST_LAYOUT_INFO";
+	case RESPONSE_LAYOUT_INFO:
+		return "RESPONSE_LAYOUT_INFO";
+
+	case REQUEST_UPDATE_JOB:				/* 3001 */
 		return "REQUEST_UPDATE_JOB";
 	case REQUEST_UPDATE_NODE:
 		return "REQUEST_UPDATE_NODE";
-	case REQUEST_UPDATE_LAYOUT:
-		return "REQUEST_UPDATE_LAYOUT";
 	case REQUEST_CREATE_PARTITION:
 		return "REQUEST_CREATE_PARTITION";
 	case REQUEST_DELETE_PARTITION:
@@ -3962,10 +4191,15 @@ rpc_num2string(uint16_t opcode)
 	case REQUEST_UPDATE_RESERVATION:
 		return "REQUEST_UPDATE_RESERVATION";
 	case REQUEST_UPDATE_BLOCK:
-		return "REQUEST_UPDATE_BLOCK";
+		return "REQUEST_UPDATE_BLOCK";			/* 3010 */
 	case REQUEST_UPDATE_FRONT_END:
 		return "REQUEST_UPDATE_FRONT_END";
-	case REQUEST_RESOURCE_ALLOCATION:
+	case REQUEST_UPDATE_LAYOUT:
+		return "REQUEST_UPDATE_LAYOUT";
+	case REQUEST_UPDATE_POWERCAP:
+		return "REQUEST_UPDATE_POWERCAP";
+
+	case REQUEST_RESOURCE_ALLOCATION:			/* 4001 */
 		return "REQUEST_RESOURCE_ALLOCATION";
 	case RESPONSE_RESOURCE_ALLOCATION:
 		return "RESPONSE_RESOURCE_ALLOCATION";
@@ -3983,7 +4217,7 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_JOB_RESOURCE";
 	case RESPONSE_JOB_RESOURCE:
 		return "RESPONSE_JOB_RESOURCE";
-	case REQUEST_JOB_ATTACH:
+	case REQUEST_JOB_ATTACH:				/* 4010 */
 		return "REQUEST_JOB_ATTACH";
 	case RESPONSE_JOB_ATTACH:
 		return "RESPONSE_JOB_ATTACH";
@@ -4003,7 +4237,7 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_UPDATE_JOB_TIME";
 	case REQUEST_JOB_READY:
 		return "REQUEST_JOB_READY";
-	case RESPONSE_JOB_READY:
+	case RESPONSE_JOB_READY:				/* 4020 */
 		return "RESPONSE_JOB_READY";
 	case REQUEST_JOB_END_TIME:
 		return "REQUEST_JOB_END_TIME";
@@ -4013,7 +4247,8 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_JOB_SBCAST_CRED";
 	case RESPONSE_JOB_SBCAST_CRED:
 		return "RESPONSE_JOB_SBCAST_CRED";
-	case REQUEST_JOB_STEP_CREATE:
+
+	case REQUEST_JOB_STEP_CREATE:				/* 5001 */
 		return "REQUEST_JOB_STEP_CREATE";
 	case RESPONSE_JOB_STEP_CREATE:
 		return "RESPONSE_JOB_STEP_CREATE";
@@ -4027,11 +4262,10 @@ rpc_num2string(uint16_t opcode)
 		return "RESPONSE_CANCEL_JOB_STEP";
 	case REQUEST_UPDATE_JOB_STEP:
 		return "REQUEST_UPDATE_JOB_STEP";
-	case DEFUNCT_RESPONSE_COMPLETE_JOB_STEP:
-		return "DEFUNCT_RESPONSE_COMPLETE_JOB_STEP";
+	/* case DEFUNCT_RESPONSE_COMPLETE_JOB_STEP:		DEFUNCT */
 	case REQUEST_CHECKPOINT:
 		return "REQUEST_CHECKPOINT";
-	case RESPONSE_CHECKPOINT:
+	case RESPONSE_CHECKPOINT:				/* 5010 */
 		return "RESPONSE_CHECKPOINT";
 	case REQUEST_CHECKPOINT_COMP:
 		return "REQUEST_CHECKPOINT_COMP";
@@ -4045,15 +4279,13 @@ rpc_num2string(uint16_t opcode)
 		return "RESPONSE_SUSPEND";
 	case REQUEST_STEP_COMPLETE:
 		return "REQUEST_STEP_COMPLETE";
-	case REQUEST_STEP_COMPLETE_AGGR:
-		return "REQUEST_STEP_COMPLETE_AGGR";
 	case REQUEST_COMPLETE_JOB_ALLOCATION:
 		return "REQUEST_COMPLETE_JOB_ALLOCATION";
 	case REQUEST_COMPLETE_BATCH_SCRIPT:
 		return "REQUEST_COMPLETE_BATCH_SCRIPT";
 	case REQUEST_JOB_STEP_STAT:
 		return "REQUEST_JOB_STEP_STAT";
-	case RESPONSE_JOB_STEP_STAT:
+	case RESPONSE_JOB_STEP_STAT:				/* 5020 */
 		return "RESPONSE_JOB_STEP_STAT";
 	case REQUEST_STEP_LAYOUT:
 		return "REQUEST_STEP_LAYOUT";
@@ -4073,13 +4305,26 @@ rpc_num2string(uint16_t opcode)
 		return "RESPONSE_JOB_STEP_PIDS";
 	case REQUEST_FORWARD_DATA:
 		return "REQUEST_FORWARD_DATA";
-	case REQUEST_COMPLETE_BATCH_JOB:
+	case REQUEST_COMPLETE_BATCH_JOB:			/* 5030 */
 		return "REQUEST_COMPLETE_BATCH_JOB";
 	case REQUEST_SUSPEND_INT:
 		return "REQUEST_SUSPEND_INT";
 	case REQUEST_KILL_JOB:
 		return "REQUEST_KILL_JOB";
-	case REQUEST_LAUNCH_TASKS:
+	case REQUEST_KILL_JOBSTEP:
+		return "REQUEST_KILL_JOBSTEP";
+	case RESPONSE_JOB_ARRAY_ERRORS:
+		return "RESPONSE_JOB_ARRAY_ERRORS";
+	case REQUEST_NETWORK_CALLERID:
+		return "REQUEST_NETWORK_CALLERID";
+	case RESPONSE_NETWORK_CALLERID:
+		return "RESPONSE_NETWORK_CALLERID";
+	case REQUEST_STEP_COMPLETE_AGGR:
+		return "REQUEST_STEP_COMPLETE_AGGR";
+	case REQUEST_TOP_JOB:
+		return "REQUEST_TOP_JOB";
+
+	case REQUEST_LAUNCH_TASKS:				/* 6001 */
 		return "REQUEST_LAUNCH_TASKS";
 	case RESPONSE_LAUNCH_TASKS:
 		return "RESPONSE_LAUNCH_TASKS";
@@ -4097,7 +4342,7 @@ rpc_num2string(uint16_t opcode)
 		return "RESPONSE_REATTACH_TASKS";
 	case REQUEST_KILL_TIMELIMIT:
 		return "REQUEST_KILL_TIMELIMIT";
-	case REQUEST_SIGNAL_JOB:
+	case REQUEST_SIGNAL_JOB:				/* 6010 */
 		return "REQUEST_SIGNAL_JOB";
 	case REQUEST_TERMINATE_JOB:
 		return "REQUEST_TERMINATE_JOB";
@@ -4115,9 +4360,10 @@ rpc_num2string(uint16_t opcode)
 		return "REQUEST_LAUNCH_PROLOG";
 	case REQUEST_COMPLETE_PROLOG:
 		return "REQUEST_COMPLETE_PROLOG";
-	case RESPONSE_PROLOG_EXECUTING:
+	case RESPONSE_PROLOG_EXECUTING:				/* 6019 */
 		return "RESPONSE_PROLOG_EXECUTING";
-	case SRUN_PING:
+
+	case SRUN_PING:						/* 7001 */
 		return "SRUN_PING";
 	case SRUN_TIMEOUT:
 		return "SRUN_TIMEOUT";
@@ -4135,7 +4381,8 @@ rpc_num2string(uint16_t opcode)
 		return "SRUN_REQUEST_SUSPEND";
 	case SRUN_STEP_SIGNAL:
 		return "SRUN_STEP_SIGNAL";
-	case PMI_KVS_PUT_REQ:
+
+	case PMI_KVS_PUT_REQ:					/* 7201 */
 		return "PMI_KVS_PUT_REQ";
 	case PMI_KVS_PUT_RESP:
 		return "PMI_KVS_PUT_RESP";
@@ -4143,26 +4390,27 @@ rpc_num2string(uint16_t opcode)
 		return "PMI_KVS_GET_REQ";
 	case PMI_KVS_GET_RESP:
 		return "PMI_KVS_GET_RESP";
-	case RESPONSE_SLURM_RC:
+
+	case RESPONSE_SLURM_RC:					/* 8001 */
 		return "RESPONSE_SLURM_RC";
 	case RESPONSE_SLURM_RC_MSG:
 		return "RESPONSE_SLURM_RC_MSG";
-	case RESPONSE_FORWARD_FAILED:
+
+	case RESPONSE_FORWARD_FAILED:				/* 9001 */
 		return "RESPONSE_FORWARD_FAILED";
-	case ACCOUNTING_UPDATE_MSG:
+
+	case ACCOUNTING_UPDATE_MSG:				/* 10001 */
 		return "ACCOUNTING_UPDATE_MSG";
 	case ACCOUNTING_FIRST_REG:
 		return "ACCOUNTING_FIRST_REG";
 	case ACCOUNTING_REGISTER_CTLD:
 		return "ACCOUNTING_REGISTER_CTLD";
-	case MESSAGE_COMPOSITE:
+
+	case MESSAGE_COMPOSITE:					/* 110001 */
 		return "MESSAGE_COMPOSITE";
 	case RESPONSE_MESSAGE_COMPOSITE:
 		return "RESPONSE_MESSAGE_COMPOSITE";
-	case REQUEST_BURST_BUFFER_INFO:
-		return "REQUEST_BURST_BUFFER_INFO";
-	case RESPONSE_BURST_BUFFER_INFO:
-		return "RESPONSE_BURST_BUFFER_INFO";
+
 	default:
 		(void) snprintf(buf, sizeof(buf), "%u", opcode);
 		return buf;
@@ -4262,44 +4510,44 @@ extern void slurm_free_assoc_mgr_info_request_msg(
 	xfree(msg);
 }
 
-extern int slurm_load_sicp(sicp_info_msg_t **sicp_buffer_pptr)
+extern int parse_part_enforce_type(char *enforce_part_type, uint16_t *param)
 {
-	int rc;
-	slurm_msg_t resp_msg;
-	slurm_msg_t req_msg;
+	int rc = SLURM_SUCCESS;
 
-	slurm_msg_t_init(&req_msg);
-	slurm_msg_t_init(&resp_msg);
+	char *value = xstrdup(enforce_part_type);
 
-	req_msg.msg_type = REQUEST_SICP_INFO;
-	req_msg.data     = NULL;
-
-//FIXME: This needs to be modified to communicate with an arbitrary host/port
-	if (slurm_send_recv_controller_msg(&req_msg, &resp_msg) < 0)
-		return SLURM_ERROR;
-
-	switch (resp_msg.msg_type) {
-	case RESPONSE_SICP_INFO:
-		*sicp_buffer_pptr = (sicp_info_msg_t *)resp_msg.data;
-		break;
-	case RESPONSE_SLURM_RC:
-		rc = ((return_code_msg_t *) resp_msg.data)->return_code;
-		slurm_free_return_code_msg(resp_msg.data);
-		if (rc)
-			slurm_seterrno_ret(rc);
-		break;
-	default:
-		slurm_seterrno_ret(SLURM_UNEXPECTED_MSG_ERROR);
-		break;
+	if (!xstrcasecmp(value, "yes")
+		|| !xstrcasecmp(value, "up")
+		|| !xstrcasecmp(value, "true")
+		|| !xstrcasecmp(value, "1") || !xstrcasecmp(value, "any")) {
+		*param = PARTITION_ENFORCE_ANY;
+	} else if (!xstrcasecmp(value, "no")
+		   || !xstrcasecmp(value, "down")
+		   || !xstrcasecmp(value, "false")
+		   || !xstrcasecmp(value, "0")) {
+		*param = PARTITION_ENFORCE_NONE;
+	} else if (!xstrcasecmp(value, "all")) {
+		*param = PARTITION_ENFORCE_ALL;
+	} else {
+		error("Bad EnforcePartLimits: %s\n", value);
+		rc = SLURM_FAILURE;
 	}
 
-	return SLURM_PROTOCOL_SUCCESS;
+	xfree(value);
+	return rc;
 }
 
-extern void slurm_free_sicp_msg(sicp_info_msg_t *sicp_buffer_ptr)
+extern char * parse_part_enforce_type_2str (uint16_t type)
 {
-	if (sicp_buffer_ptr) {
-		xfree(sicp_buffer_ptr->sicp_array);
-		xfree(sicp_buffer_ptr);
+	static char type_str[1024];
+
+	if (type == PARTITION_ENFORCE_NONE) {
+		strcpy(type_str, "NO");
+	} else if (type == PARTITION_ENFORCE_ANY) {
+		strcpy(type_str, "ANY");
+	} else if (type == PARTITION_ENFORCE_ALL) {
+		strcpy(type_str, "ALL");
 	}
+
+	return type_str;
 }
diff --git a/src/common/slurm_protocol_defs.h b/src/common/slurm_protocol_defs.h
index e433891e2..a03ad8ab7 100644
--- a/src/common/slurm_protocol_defs.h
+++ b/src/common/slurm_protocol_defs.h
@@ -65,9 +65,9 @@
 #include "src/common/slurm_cred.h"
 #include "src/common/slurm_protocol_common.h"
 #include "src/common/slurm_step_layout.h"
-#include "src/common/xassert.h"
 #include "src/common/slurmdb_defs.h"
 #include "src/common/working_cluster.h"
+#include "src/common/xassert.h"
 
 #define MAX_SLURM_NAME 64
 #define FORWARD_INIT 0xfffe
@@ -89,6 +89,8 @@
 	((_X->job_state & JOB_STATE_BASE) == JOB_TIMEOUT)
 #define IS_JOB_NODE_FAILED(_X)		\
 	((_X->job_state & JOB_STATE_BASE) == JOB_NODE_FAIL)
+#define IS_JOB_DEADLINE(_X)		\
+	((_X->job_state & JOB_STATE_BASE) == JOB_DEADLINE)
 
 /* Derived job states */
 #define IS_JOB_COMPLETING(_X)		\
@@ -148,6 +150,9 @@
 	(_X->node_state & NODE_STATE_MAINT)
 
 #define THIS_FILE ((strrchr(__FILE__, '/') ?: __FILE__ - 1) + 1)
+#define INFO_LINE(fmt, ...) \
+	info("%s (%s:%d) "fmt, __func__, THIS_FILE, __LINE__, ##__VA_ARGS__);
+
 #define YEAR_MINUTES 365 * 24 * 60
 
 /* These defines have to be here to avoid circular dependancy with
@@ -188,7 +193,7 @@ typedef enum {
 	RESPONSE_SHUTDOWN,
 	REQUEST_PING,
 	REQUEST_CONTROL,
-	REQUEST_SET_DEBUG_LEVEL,
+	REQUEST_SET_DEBUG_LEVEL,	/* 1010 */
 	REQUEST_HEALTH_CHECK,
 	REQUEST_TAKEOVER,
 	REQUEST_SET_SCHEDLOG_LEVEL,
@@ -198,7 +203,7 @@ typedef enum {
 	REQUEST_ACCT_GATHER_UPDATE,
 	RESPONSE_ACCT_GATHER_UPDATE,
 	REQUEST_ACCT_GATHER_ENERGY,
-	RESPONSE_ACCT_GATHER_ENERGY,
+	RESPONSE_ACCT_GATHER_ENERGY,	/* 1020 */
 	REQUEST_LICENSE_INFO,
 	RESPONSE_LICENSE_INFO,
 
@@ -241,13 +246,13 @@ typedef enum {
 	REQUEST_BURST_BUFFER_INFO,
 	RESPONSE_BURST_BUFFER_INFO,
 	REQUEST_JOB_USER_INFO,
-	REQUEST_NODE_INFO_SINGLE,  /* 2040 */
+	REQUEST_NODE_INFO_SINGLE,	/* 2040 */
 	REQUEST_POWERCAP_INFO,
 	RESPONSE_POWERCAP_INFO,
 	REQUEST_ASSOC_MGR_INFO,
 	RESPONSE_ASSOC_MGR_INFO,
-	REQUEST_SICP_INFO,
-	RESPONSE_SICP_INFO,
+	REQUEST_SICP_INFO_DEFUNCT,	/* DEFUNCT */
+	RESPONSE_SICP_INFO_DEFUNCT,	/* DEFUNCT */
 	REQUEST_LAYOUT_INFO,
 	RESPONSE_LAYOUT_INFO,
 
@@ -260,7 +265,7 @@ typedef enum {
 	RESPONSE_CREATE_RESERVATION,
 	REQUEST_DELETE_RESERVATION,
 	REQUEST_UPDATE_RESERVATION,
-	REQUEST_UPDATE_BLOCK,
+	REQUEST_UPDATE_BLOCK,		/* 3010 */
 	REQUEST_UPDATE_FRONT_END,
 	REQUEST_UPDATE_LAYOUT,
 	REQUEST_UPDATE_POWERCAP,
@@ -274,7 +279,7 @@ typedef enum {
 	RESPONSE_CANCEL_JOB,
 	REQUEST_JOB_RESOURCE,
 	RESPONSE_JOB_RESOURCE,
-	REQUEST_JOB_ATTACH,
+	REQUEST_JOB_ATTACH,		/* 4010 */
 	RESPONSE_JOB_ATTACH,
 	REQUEST_JOB_WILL_RUN,
 	RESPONSE_JOB_WILL_RUN,
@@ -284,7 +289,7 @@ typedef enum {
 	RESPONSE_JOB_ALLOCATION_INFO_LITE,
 	REQUEST_UPDATE_JOB_TIME,
 	REQUEST_JOB_READY,
-	RESPONSE_JOB_READY,
+	RESPONSE_JOB_READY,		/* 4020 */
 	REQUEST_JOB_END_TIME,
 	REQUEST_JOB_NOTIFY,
 	REQUEST_JOB_SBCAST_CRED,
@@ -299,7 +304,7 @@ typedef enum {
 	REQUEST_UPDATE_JOB_STEP,
 	DEFUNCT_RESPONSE_COMPLETE_JOB_STEP, /* DEFUNCT */
 	REQUEST_CHECKPOINT,
-	RESPONSE_CHECKPOINT,
+	RESPONSE_CHECKPOINT,		/* 5010 */
 	REQUEST_CHECKPOINT_COMP,
 	REQUEST_CHECKPOINT_TASK_COMP,
 	RESPONSE_CHECKPOINT_COMP,
@@ -309,7 +314,7 @@ typedef enum {
 	REQUEST_COMPLETE_JOB_ALLOCATION,
 	REQUEST_COMPLETE_BATCH_SCRIPT,
 	REQUEST_JOB_STEP_STAT,
-	RESPONSE_JOB_STEP_STAT,
+	RESPONSE_JOB_STEP_STAT,		/* 5020 */
 	REQUEST_STEP_LAYOUT,
 	RESPONSE_STEP_LAYOUT,
 	REQUEST_JOB_REQUEUE,
@@ -319,14 +324,15 @@ typedef enum {
 	REQUEST_JOB_STEP_PIDS,
 	RESPONSE_JOB_STEP_PIDS,
 	REQUEST_FORWARD_DATA,
-	REQUEST_COMPLETE_BATCH_JOB,
+	REQUEST_COMPLETE_BATCH_JOB,	/* 5030 */
 	REQUEST_SUSPEND_INT,
-	REQUEST_KILL_JOB,       /* 5032 */
+	REQUEST_KILL_JOB,		/* 5032 */
 	REQUEST_KILL_JOBSTEP,
 	RESPONSE_JOB_ARRAY_ERRORS,
 	REQUEST_NETWORK_CALLERID,
 	RESPONSE_NETWORK_CALLERID,
 	REQUEST_STEP_COMPLETE_AGGR,
+	REQUEST_TOP_JOB,		/* 5038 */
 
 	REQUEST_LAUNCH_TASKS = 6001,
 	RESPONSE_LAUNCH_TASKS,
@@ -337,7 +343,7 @@ typedef enum {
 	REQUEST_REATTACH_TASKS,
 	RESPONSE_REATTACH_TASKS,
 	REQUEST_KILL_TIMELIMIT,
-	REQUEST_SIGNAL_JOB,
+	REQUEST_SIGNAL_JOB,		/* 6010 */
 	REQUEST_TERMINATE_JOB,
 	MESSAGE_EPILOG_COMPLETE,
 	REQUEST_ABORT_JOB,	/* job shouldn't be running, kill it without
@@ -348,7 +354,7 @@ typedef enum {
 
 	REQUEST_LAUNCH_PROLOG,
 	REQUEST_COMPLETE_PROLOG,
-	RESPONSE_PROLOG_EXECUTING,
+	RESPONSE_PROLOG_EXECUTING,	/* 6019 */
 
 	SRUN_PING = 7001,
 	SRUN_TIMEOUT,
@@ -392,6 +398,7 @@ typedef struct forward {
 	char      *nodelist;	/* ranged string of who to forward the
 				 * message to */
 	uint32_t   timeout;	/* original timeout increments */
+	uint16_t   tree_width;  /* what the treewidth should be */
 } forward_t;
 
 /*core api protocol message structures */
@@ -462,6 +469,25 @@ typedef struct ret_data_info {
 /*****************************************************************************\
  * Slurm Protocol Data Structures
 \*****************************************************************************/
+struct kvs_hosts {
+	uint32_t	task_id;	/* job step's task id */
+	uint16_t	port;		/* communication port */
+	char *		hostname;	/* communication host */
+};
+struct kvs_comm {
+	char *		kvs_name;
+	uint32_t	kvs_cnt;	/* count of key-pairs */
+	char **		kvs_keys;
+	char **		kvs_values;
+	uint16_t *	kvs_key_sent;
+};
+typedef struct kvs_comm_set {
+
+	uint16_t	host_cnt;	/* hosts getting this message */
+	struct kvs_hosts *kvs_host_ptr;	/* host forwarding info */
+ 	uint16_t	kvs_comm_recs;	/* count of kvs_comm entries */
+	struct kvs_comm **kvs_comm_ptr;	/* pointers to kvs_comm entries */
+} kvs_comm_set_t;
 
 typedef struct assoc_shares_object {
 	uint32_t assoc_id;	/* association ID */
@@ -517,7 +543,7 @@ typedef struct priority_factors_object {
 	char    **tres_names;	/* packed as assoc_mgr_tres_names[] */
 	double   *tres_weights; /* PriorityWeightTRES weights as an array */
 
-	uint16_t nice;
+	uint32_t nice;
 } priority_factors_object_t;
 
 typedef struct priority_factors_request_msg {
@@ -598,11 +624,13 @@ typedef struct resv_info_request_msg {
         time_t last_update;
 } resv_info_request_msg_t;
 
+#define LAYOUTS_DUMP_NOLAYOUT 0x00000001
+#define LAYOUTS_DUMP_STATE    0x10000000
 typedef struct layout_info_request_msg {
 	char* layout_type;
 	char* entities;
 	char* type;
-	uint32_t no_relation;
+	uint32_t flags;
 } layout_info_request_msg_t;
 
 typedef struct complete_job_allocation {
@@ -653,6 +681,7 @@ typedef struct epilog_complete_msg {
 } epilog_complete_msg_t;
 
 typedef struct reboot_msg {
+	char *features;
 	char *node_list;
 } reboot_msg_t;
 
@@ -731,6 +760,10 @@ typedef struct launch_tasks_request_msg {
 	uint32_t  job_step_id;
 	uint32_t  nnodes;	/* number of nodes in this job step       */
 	uint32_t  ntasks;	/* number of tasks in this job step   */
+	uint16_t  ntasks_per_board;/* number of tasks to invoke on each board */
+	uint16_t  ntasks_per_core; /* number of tasks to invoke on each core */
+	uint16_t  ntasks_per_socket;/* number of tasks to invoke on
+				     * each socket */
 	uint32_t  uid;
 	char     *user_name;
 	uint32_t  gid;
@@ -910,6 +943,7 @@ typedef struct prolog_launch_msg {
 	char *std_err;			/* pathname of stderr */
 	char *std_out;			/* pathname of stdout */
 	uint32_t uid;
+	char *user_name;		/* job's user name */
 	char *work_dir;			/* full pathname of working directory */
 } prolog_launch_msg_t;
 
@@ -940,6 +974,7 @@ typedef struct batch_job_launch_msg {
 	uint16_t job_core_spec;	/* Count of specialized cores */
 	char *alias_list;	/* node name/address/hostnamne aliases */
 	char *nodes;		/* list of nodes allocated to job_step */
+	uint32_t profile;       /* what to profile for the batch step */
 	char *script;		/* the actual job script, default NONE */
 	char *std_err;		/* pathname of stderr */
 	char *std_in;		/* pathname of stdin */
@@ -1027,11 +1062,18 @@ typedef struct kvs_get_msg {
 	char * hostname;	/* hostname to be sent the kvs data */
 } kvs_get_msg_t;
 
+enum compress_type {
+	COMPRESS_OFF = 0x0,	/* no compression */
+	COMPRESS_ZLIB,		/* zlib (aka gzip) compression */
+	COMPRESS_LZ4		/* lz4 compression */
+};
+
 typedef struct file_bcast_msg {
 	char *fname;		/* name of the destination file */
 	uint16_t block_no;	/* block number of this data */
 	uint16_t last_block;	/* last block of bcast if set */
 	uint16_t force;		/* replace existing file if set */
+	uint16_t compress;	/* compress file if set, use compress_type */
 	uint16_t modes;		/* access rights for destination file */
 	uint32_t uid;		/* owner for destination file */
 	char *user_name;
@@ -1040,7 +1082,10 @@ typedef struct file_bcast_msg {
 	time_t mtime;		/* last modification time for dest file */
 	sbcast_cred_t *cred;	/* credential for the RPC */
 	uint32_t block_len;	/* length of this data block */
+	uint32_t block_offset;	/* offset for this data block */
+	uint32_t uncomp_len;	/* uncompressed length of this data block */
 	char *block;		/* data for this block */
+	uint64_t file_size;	/* file size */
 } file_bcast_msg_t;
 
 typedef struct multi_core_data {
@@ -1097,6 +1142,8 @@ typedef struct slurm_node_registration_status_msg {
 	uint32_t free_mem;	/* Free memory in MiB */
 	char *cpu_spec_list;	/* list of specialized CPUs */
 	acct_gather_energy_t *energy;
+	char *features_active;	/* Currently active node features */
+	char *features_avail;	/* Available node features */
 	Buf gres_info;		/* generic resource info */
 	uint32_t hash_val;      /* hash value of slurm.conf and included files
 				 * existing on node */
@@ -1282,6 +1329,7 @@ extern void slurm_free_checkpoint_task_comp_msg(checkpoint_task_comp_msg_t *msg)
 extern void slurm_free_checkpoint_resp_msg(checkpoint_resp_msg_t *msg);
 extern void slurm_free_suspend_msg(suspend_msg_t *msg);
 extern void slurm_free_suspend_int_msg(suspend_int_msg_t *msg);
+extern void slurm_free_top_job_msg(top_job_msg_t *msg);
 extern void slurm_free_update_step_msg(step_update_request_msg_t * msg);
 extern void slurm_free_resource_allocation_response_msg_members (
 	resource_allocation_response_msg_t * msg);
@@ -1308,6 +1356,7 @@ extern void slurm_free_layout_info_msg(layout_info_msg_t * msg);
 extern void slurm_free_layout_info_request_msg(layout_info_request_msg_t * msg);
 extern void slurm_free_reservation_info_msg(reserve_info_msg_t * msg);
 extern void slurm_free_get_kvs_msg(kvs_get_msg_t *msg);
+extern void slurm_free_kvs_comm_set(kvs_comm_set_t *msg);
 extern void slurm_free_will_run_response_msg(will_run_response_msg_t *msg);
 extern void slurm_free_reserve_info_members(reserve_info_t * resv);
 extern void slurm_free_topo_info_msg(topo_info_response_msg_t *msg);
@@ -1337,9 +1386,6 @@ extern uint32_t slurm_get_return_code(slurm_msg_type_t type, void *data);
 extern void slurm_free_network_callerid_msg(network_callerid_msg_t *mesg);
 extern void slurm_free_network_callerid_resp(network_callerid_resp_t *resp);
 
-extern int  slurm_load_sicp(sicp_info_msg_t **sicp_buffer_pptr);
-extern void slurm_free_sicp_msg(sicp_info_msg_t * sicp_buffer_ptr);
-
 extern char *preempt_mode_string(uint16_t preempt_mode);
 extern uint16_t preempt_mode_num(const char *preempt_mode);
 
@@ -1356,6 +1402,7 @@ extern uint16_t bb_state_num(char *tok);
 extern char *health_check_node_state_str(uint32_t node_state);
 
 extern char *job_reason_string(enum job_state_reason inx);
+extern char *job_share_string(uint16_t shared);
 extern char *job_state_string(uint32_t inx);
 extern char *job_state_string_compact(uint32_t inx);
 extern uint32_t job_state_num(const char *state_name);
@@ -1400,6 +1447,10 @@ extern char *reservation_flags_string(uint32_t flags);
 extern char *   slurm_bb_flags2str(uint32_t bb_flags);
 extern uint32_t slurm_bb_str2flags(char *bb_str);
 
+/* Function to convert enforce type flags between strings and numbers */
+extern int parse_part_enforce_type(char *enforce_part_type, uint16_t *param);
+extern char * parse_part_enforce_type_2str (uint16_t type);
+
 /* Given a protocol opcode return its string
  * description mapping the slurm_msg_type_t
  * to its name.
diff --git a/src/common/slurm_protocol_pack.c b/src/common/slurm_protocol_pack.c
index f4bedf3ce..163da321c 100644
--- a/src/common/slurm_protocol_pack.c
+++ b/src/common/slurm_protocol_pack.c
@@ -47,7 +47,6 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "src/api/slurm_pmi.h"
 #include "src/common/assoc_mgr.h"
 #include "src/common/bitstring.h"
 #include "src/common/forward.h"
@@ -82,7 +81,6 @@
 #define _pack_partition_info_msg(msg,buf)	_pack_buffer_msg(msg,buf)
 #define _pack_stats_response_msg(msg,buf)	_pack_buffer_msg(msg,buf)
 #define _pack_reserve_info_msg(msg,buf)		_pack_buffer_msg(msg,buf)
-#define _pack_sicp_info_msg(msg,buf)		_pack_buffer_msg(msg,buf)
 #define _pack_layout_info_msg(msg,buf)		_pack_buffer_msg(msg,buf)
 #define _pack_assoc_mgr_info_msg(msg,buf)      _pack_buffer_msg(msg,buf)
 
@@ -466,9 +464,6 @@ static int _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr,
 static int _unpack_job_info_msg(job_info_msg_t ** msg, Buf buffer,
 				uint16_t protocol_version);
 
-static int _unpack_sicp_info_msg(sicp_info_msg_t ** msg, Buf buffer,
-				 uint16_t protocol_version);
-
 static void _pack_last_update_msg(last_update_msg_t * msg, Buf buffer,
 				  uint16_t protocol_version);
 static int _unpack_last_update_msg(last_update_msg_t ** msg, Buf buffer,
@@ -572,6 +567,11 @@ static void _pack_suspend_int_msg(suspend_int_msg_t *msg, Buf buffer,
 static int  _unpack_suspend_int_msg(suspend_int_msg_t **msg_ptr, Buf buffer,
 				    uint16_t protocol_version);
 
+static void _pack_top_job_msg(top_job_msg_t *msg, Buf buffer,
+			       uint16_t protocol_version);
+static int  _unpack_top_job_msg(top_job_msg_t **msg_ptr, Buf buffer,
+				uint16_t protocol_version);
+
 static void _pack_buffer_msg(slurm_msg_t * msg, Buf buffer);
 
 static void _pack_kvs_host_rec(struct kvs_hosts *msg_ptr, Buf buffer,
@@ -584,9 +584,9 @@ static void _pack_kvs_rec(struct kvs_comm *msg_ptr, Buf buffer,
 static int  _unpack_kvs_rec(struct kvs_comm **msg_ptr, Buf buffer,
 			    uint16_t protocol_version);
 
-static void _pack_kvs_data(struct kvs_comm_set *msg_ptr, Buf buffer,
+static void _pack_kvs_data(kvs_comm_set_t *msg_ptr, Buf buffer,
 			   uint16_t protocol_version);
-static int  _unpack_kvs_data(struct kvs_comm_set **msg_ptr, Buf buffer,
+static int  _unpack_kvs_data(kvs_comm_set_t **msg_ptr, Buf buffer,
 			     uint16_t protocol_version);
 
 static void _pack_kvs_get(kvs_get_msg_t *msg_ptr, Buf buffer,
@@ -886,7 +886,25 @@ pack_header(header_t * header, Buf buffer)
 {
 	pack16((uint16_t)header->version, buffer);
 
-	if (header->version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (header->version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack16((uint16_t)header->flags, buffer);
+		pack16((uint16_t)header->msg_index, buffer);
+		pack16((uint16_t)header->msg_type, buffer);
+		pack32((uint32_t)header->body_length, buffer);
+		pack16((uint16_t)header->forward.cnt, buffer);
+		if (header->forward.cnt > 0) {
+			packstr(header->forward.nodelist, buffer);
+			pack32((uint32_t)header->forward.timeout, buffer);
+			pack16(header->forward.tree_width, buffer);
+		}
+		pack16((uint16_t)header->ret_cnt, buffer);
+		if (header->ret_cnt > 0) {
+			_pack_ret_list(header->ret_list,
+				       header->ret_cnt, buffer,
+				       header->version);
+		}
+		slurm_pack_slurm_addr(&header->orig_addr, buffer);
+	} else if (header->version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack16((uint16_t)header->flags, buffer);
 		pack16((uint16_t)header->msg_index, buffer);
 		pack16((uint16_t)header->msg_type, buffer);
@@ -939,7 +957,30 @@ unpack_header(header_t * header, Buf buffer)
 	header->ret_list = NULL;
 	safe_unpack16(&header->version, buffer);
 
-	if (header->version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (header->version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack16(&header->flags, buffer);
+		safe_unpack16(&header->msg_index, buffer);
+		safe_unpack16(&header->msg_type, buffer);
+		safe_unpack32(&header->body_length, buffer);
+		safe_unpack16(&header->forward.cnt, buffer);
+		if (header->forward.cnt > 0) {
+			safe_unpackstr_xmalloc(&header->forward.nodelist,
+					       &uint32_tmp, buffer);
+			safe_unpack32(&header->forward.timeout, buffer);
+			safe_unpack16(&header->forward.tree_width, buffer);
+		}
+
+		safe_unpack16(&header->ret_cnt, buffer);
+		if (header->ret_cnt > 0) {
+			if (_unpack_ret_list(&(header->ret_list),
+					     header->ret_cnt, buffer,
+					     header->version))
+				goto unpack_error;
+		} else {
+			header->ret_list = NULL;
+		}
+		slurm_unpack_slurm_addr_no_alloc(&header->orig_addr, buffer);
+	} else if (header->version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack16(&header->flags, buffer);
 		safe_unpack16(&header->msg_index, buffer);
 		safe_unpack16(&header->msg_type, buffer);
@@ -1074,6 +1115,7 @@ pack_msg(slurm_msg_t const *msg, Buf buffer)
 		_pack_update_job_step_msg((step_update_request_msg_t *)
 					  msg->data, buffer,
 					  msg->protocol_version);
+		break;
 	case REQUEST_JOB_END_TIME:
 	case REQUEST_JOB_ALLOCATION_INFO:
 	case REQUEST_JOB_ALLOCATION_INFO_LITE:
@@ -1099,7 +1141,6 @@ pack_msg(slurm_msg_t const *msg, Buf buffer)
 	case ACCOUNTING_REGISTER_CTLD:
 	case REQUEST_TOPO_INFO:
 	case REQUEST_BURST_BUFFER_INFO:
-	case REQUEST_SICP_INFO:
 	case REQUEST_POWERCAP_INFO:
 		/* Message contains no body/information */
 		break;
@@ -1434,7 +1475,10 @@ pack_msg(slurm_msg_t const *msg, Buf buffer)
 		_pack_suspend_int_msg((suspend_int_msg_t *)msg->data, buffer,
 				      msg->protocol_version);
 		break;
-
+	case REQUEST_TOP_JOB:
+		_pack_top_job_msg((top_job_msg_t *)msg->data, buffer,
+				  msg->protocol_version);
+		break;
 	case REQUEST_JOB_READY:
 	case REQUEST_JOB_INFO_SINGLE:
 		_pack_job_ready_msg((job_id_msg_t *)msg->data, buffer,
@@ -1491,7 +1535,7 @@ pack_msg(slurm_msg_t const *msg, Buf buffer)
 		break;
 	case PMI_KVS_PUT_REQ:
 	case PMI_KVS_GET_RESP:
-		_pack_kvs_data((struct kvs_comm_set *) msg->data, buffer,
+		_pack_kvs_data((kvs_comm_set_t *) msg->data, buffer,
 			       msg->protocol_version);
 		break;
 	case PMI_KVS_GET_REQ:
@@ -1623,9 +1667,6 @@ pack_msg(slurm_msg_t const *msg, Buf buffer)
 						  msg->data, buffer,
 						  msg->protocol_version);
 		break;
-	case RESPONSE_SICP_INFO:
-		_pack_sicp_info_msg((slurm_msg_t *) msg, buffer);
-		break;
 	default:
 		debug("No pack method for msg type %u", msg->msg_type);
 		return EINVAL;
@@ -1751,7 +1792,6 @@ unpack_msg(slurm_msg_t * msg, Buf buffer)
 	case ACCOUNTING_REGISTER_CTLD:
 	case REQUEST_TOPO_INFO:
 	case REQUEST_BURST_BUFFER_INFO:
-	case REQUEST_SICP_INFO:
 	case REQUEST_POWERCAP_INFO:
 		/* Message contains no body/information */
 		break;
@@ -2115,7 +2155,10 @@ unpack_msg(slurm_msg_t * msg, Buf buffer)
 		rc = _unpack_suspend_int_msg((suspend_int_msg_t **) &msg->data,
 					     buffer, msg->protocol_version);
 		break;
-
+	case REQUEST_TOP_JOB:
+		rc = _unpack_top_job_msg((top_job_msg_t **) &msg->data, buffer,
+					 msg->protocol_version);
+		break;
 	case REQUEST_JOB_READY:
 	case REQUEST_JOB_INFO_SINGLE:
 		rc = _unpack_job_ready_msg((job_id_msg_t **)
@@ -2182,7 +2225,7 @@ unpack_msg(slurm_msg_t * msg, Buf buffer)
 		break;
 	case PMI_KVS_PUT_REQ:
 	case PMI_KVS_GET_RESP:
-		rc = _unpack_kvs_data((struct kvs_comm_set **) &msg->data,
+		rc = _unpack_kvs_data((kvs_comm_set_t **) &msg->data,
 				      buffer,
 				      msg->protocol_version);
 		break;
@@ -2330,10 +2373,6 @@ unpack_msg(slurm_msg_t * msg, Buf buffer)
 						  &(msg->data), buffer,
 						  msg->protocol_version);
 		break;
-	case RESPONSE_SICP_INFO:
-		rc = _unpack_sicp_info_msg((sicp_info_msg_t **) & (msg->data),
-					   buffer, msg->protocol_version);
-		break;
 	default:
 		debug("No unpack method for msg type %u", msg->msg_type);
 		return EINVAL;
@@ -2922,12 +2961,84 @@ unpack_error:
 
 }
 
+#define OLD_NICE_OFFSET 10000
+/* Translate 32-bit nice value to equivalent 16-bit value.
+ * Remove when version 15.08 support is no longer required. */
+extern uint16_t xlate_nice_new2old(uint32_t new_nice)
+{
+	int64_t tmp_nice;
+	uint16_t old_nice;
+
+	if (new_nice == NO_VAL) {
+		old_nice = (uint16_t) NO_VAL;
+	} else {
+		tmp_nice = ((int64_t)new_nice) - NICE_OFFSET;
+		if (tmp_nice > OLD_NICE_OFFSET)
+			tmp_nice = OLD_NICE_OFFSET;
+		else if (tmp_nice < (0 - OLD_NICE_OFFSET))
+			tmp_nice = (0 - OLD_NICE_OFFSET);
+		old_nice = tmp_nice + OLD_NICE_OFFSET;
+	}
+
+	return old_nice;
+}
+/* Translate 16-bit nice value to equivalent 32-bit value.
+ * Remove when version 15.08 support is no longer required. */
+extern uint32_t xlate_nice_old2new(uint16_t old_nice)
+{
+	int64_t tmp_nice;
+	uint32_t new_nice;
+
+	if (old_nice == (uint16_t) NO_VAL) {
+		new_nice = NO_VAL;
+	} else {
+		tmp_nice = ((int64_t)old_nice) - OLD_NICE_OFFSET;
+		new_nice = tmp_nice + NICE_OFFSET;
+	}
+
+	return new_nice;
+}
+
 static void _pack_priority_factors_object(void *in, Buf buffer,
 					  uint16_t protocol_version)
 {
 	priority_factors_object_t *object = (priority_factors_object_t *)in;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (!object) {
+			pack32(0, buffer);
+			pack32(0, buffer);
+
+			packdouble(0, buffer);
+			packdouble(0, buffer);
+			packdouble(0, buffer);
+			packdouble(0, buffer);
+			packdouble(0, buffer);
+
+			pack32(0, buffer);
+
+			return;
+		}
+
+		pack32(object->job_id, buffer);
+		pack32(object->user_id, buffer);
+
+		packdouble(object->priority_age, buffer);
+		packdouble(object->priority_fs, buffer);
+		packdouble(object->priority_js, buffer);
+		packdouble(object->priority_part, buffer);
+		packdouble(object->priority_qos, buffer);
+
+		packdouble_array(object->priority_tres, object->tres_cnt,
+				 buffer);
+		pack32(object->tres_cnt, buffer);
+		packstr_array(assoc_mgr_tres_name_array, object->tres_cnt,
+			      buffer);
+		packdouble_array(object->tres_weights, object->tres_cnt,
+				 buffer);
+
+		pack32(object->nice, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		if (!object) {
 			pack32(0, buffer);
 			pack32(0, buffer);
@@ -2960,7 +3071,7 @@ static void _pack_priority_factors_object(void *in, Buf buffer,
 		packdouble_array(object->tres_weights, object->tres_cnt,
 				 buffer);
 
-		pack16(object->nice, buffer);
+		pack16(xlate_nice_new2old(object->nice), buffer);
 	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (!object) {
 			pack32(0, buffer);
@@ -2986,7 +3097,7 @@ static void _pack_priority_factors_object(void *in, Buf buffer,
 		packdouble(object->priority_part, buffer);
 		packdouble(object->priority_qos, buffer);
 
-		pack16(object->nice, buffer);
+		pack16(xlate_nice_new2old(object->nice), buffer);
 	}
 }
 
@@ -2999,7 +3110,27 @@ static int _unpack_priority_factors_object(void **object, Buf buffer,
 		xmalloc(sizeof(priority_factors_object_t));
 	*object = (void *) object_ptr;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&object_ptr->job_id, buffer);
+		safe_unpack32(&object_ptr->user_id, buffer);
+
+		safe_unpackdouble(&object_ptr->priority_age, buffer);
+		safe_unpackdouble(&object_ptr->priority_fs, buffer);
+		safe_unpackdouble(&object_ptr->priority_js, buffer);
+		safe_unpackdouble(&object_ptr->priority_part, buffer);
+		safe_unpackdouble(&object_ptr->priority_qos, buffer);
+
+		safe_unpackdouble_array(&object_ptr->priority_tres, &tmp32,
+					buffer);
+		safe_unpack32(&object_ptr->tres_cnt, buffer);
+		safe_unpackstr_array(&object_ptr->tres_names,
+				     &object_ptr->tres_cnt, buffer);
+		safe_unpackdouble_array(&object_ptr->tres_weights, &tmp32,
+					buffer);
+
+		safe_unpack32(&object_ptr->nice, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		safe_unpack32(&object_ptr->job_id, buffer);
 		safe_unpack32(&object_ptr->user_id, buffer);
 
@@ -3017,8 +3148,10 @@ static int _unpack_priority_factors_object(void **object, Buf buffer,
 		safe_unpackdouble_array(&object_ptr->tres_weights, &tmp32,
 					buffer);
 
-		safe_unpack16(&object_ptr->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		object_ptr->nice = xlate_nice_old2new(old_nice);
 	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		safe_unpack32(&object_ptr->job_id, buffer);
 		safe_unpack32(&object_ptr->user_id, buffer);
 
@@ -3028,7 +3161,8 @@ static int _unpack_priority_factors_object(void **object, Buf buffer,
 		safe_unpackdouble(&object_ptr->priority_part, buffer);
 		safe_unpackdouble(&object_ptr->priority_qos, buffer);
 
-		safe_unpack16(&object_ptr->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		object_ptr->nice = xlate_nice_old2new(old_nice);
 	}
 
 	return SLURM_SUCCESS;
@@ -3186,16 +3320,11 @@ _pack_update_front_end_msg(update_front_end_msg_t * msg, Buf buffer,
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		packstr(msg->name, buffer);
 		pack32(msg->node_state, buffer);
 		packstr(msg->reason, buffer);
 		pack32(msg->reason_uid, buffer);
-	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		packstr(msg->name, buffer);
-		pack16(msg->node_state, buffer);
-		packstr(msg->reason, buffer);
-		pack32(msg->reason_uid, buffer);
 	} else {
 		error("_pack_update_front_end_msg: protocol_version "
 		      "%hu not supported", protocol_version);
@@ -3208,26 +3337,18 @@ _unpack_update_front_end_msg(update_front_end_msg_t ** msg, Buf buffer,
 {
 	uint32_t uint32_tmp;
 	update_front_end_msg_t *tmp_ptr;
-	uint16_t tmp_state;
 
 	/* alloc memory for structure */
 	xassert(msg != NULL);
 	tmp_ptr = xmalloc(sizeof(update_front_end_msg_t));
 	*msg = tmp_ptr;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&tmp_ptr->name,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&tmp_ptr->node_state, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->reason, &uint32_tmp, buffer);
 		safe_unpack32(&tmp_ptr->reason_uid, buffer);
-	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		safe_unpackstr_xmalloc(&tmp_ptr->name,
-				       &uint32_tmp, buffer);
-		safe_unpack16(&tmp_state, buffer);
-		safe_unpackstr_xmalloc(&tmp_ptr->reason, &uint32_tmp, buffer);
-		safe_unpack32(&tmp_ptr->reason_uid, buffer);
-		tmp_ptr->node_state = tmp_state;
 	} else {
 		error("_unpack_update_front_end_msg: protocol_version "
 		      "%hu not supported", protocol_version);
@@ -3247,12 +3368,13 @@ _pack_update_node_msg(update_node_msg_t * msg, Buf buffer,
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		packstr(msg->node_addr, buffer);
 		packstr(msg->node_hostname, buffer);
 		packstr(msg->node_names, buffer);
 		pack32(msg->node_state, buffer);
 		packstr(msg->features, buffer);
+		packstr(msg->features_act, buffer);
 		packstr(msg->gres, buffer);
 		packstr(msg->reason, buffer);
 		pack32(msg->weight, buffer);
@@ -3261,7 +3383,7 @@ _pack_update_node_msg(update_node_msg_t * msg, Buf buffer,
 		packstr(msg->node_addr, buffer);
 		packstr(msg->node_hostname, buffer);
 		packstr(msg->node_names, buffer);
-		pack16(msg->node_state, buffer);
+		pack32(msg->node_state, buffer);
 		packstr(msg->features, buffer);
 		packstr(msg->gres, buffer);
 		packstr(msg->reason, buffer);
@@ -3279,14 +3401,13 @@ _unpack_update_node_msg(update_node_msg_t ** msg, Buf buffer,
 {
 	uint32_t uint32_tmp;
 	update_node_msg_t *tmp_ptr;
-	uint16_t tmp_state;
 
 	/* alloc memory for structure */
 	xassert(msg != NULL);
 	tmp_ptr = xmalloc(sizeof(update_node_msg_t));
 	*msg = tmp_ptr;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&tmp_ptr->node_addr,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->node_hostname,
@@ -3295,6 +3416,8 @@ _unpack_update_node_msg(update_node_msg_t ** msg, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&tmp_ptr->node_state, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->features, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->features_act, &uint32_tmp,
+				       buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->gres, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->reason, &uint32_tmp, buffer);
 		safe_unpack32(&tmp_ptr->weight, buffer);
@@ -3306,13 +3429,12 @@ _unpack_update_node_msg(update_node_msg_t ** msg, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->node_names,
 				       &uint32_tmp, buffer);
-		safe_unpack16(&tmp_state, buffer);
+		safe_unpack32(&tmp_ptr->node_state, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->features, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->gres, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->reason, &uint32_tmp, buffer);
 		safe_unpack32(&tmp_ptr->weight, buffer);
 		safe_unpack32(&tmp_ptr->reason_uid, buffer);
-		tmp_ptr->node_state = tmp_state;
 	} else {
 		error("_unpack_update_node_msg: protocol_version "
 		      "%hu not supported", protocol_version);
@@ -3474,10 +3596,12 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t *
 	uint32_t gres_info_size = 0;
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		pack_time(msg->timestamp, buffer);
 		pack_time(msg->slurmd_start_time, buffer);
 		pack32(msg->status, buffer);
+		packstr(msg->features_active, buffer);
+		packstr(msg->features_avail, buffer);
 		packstr(msg->node_name, buffer);
 		packstr(msg->arch, buffer);
 		packstr(msg->cpu_spec_list, buffer);
@@ -3514,7 +3638,7 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t *
 		}
 		acct_gather_energy_pack(msg->energy, buffer, protocol_version);
 		packstr(msg->version, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack_time(msg->timestamp, buffer);
 		pack_time(msg->slurmd_start_time, buffer);
 		pack32(msg->status, buffer);
@@ -3532,6 +3656,7 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t *
 		pack32(msg->up_time, buffer);
 		pack32(msg->hash_val, buffer);
 		pack32(msg->cpu_load, buffer);
+		pack32(msg->free_mem, buffer);
 
 		pack32(msg->job_count, buffer);
 		for (i = 0; i < msg->job_count; i++) {
@@ -3553,12 +3678,13 @@ _pack_node_registration_status_msg(slurm_node_registration_status_msg_t *
 		}
 		acct_gather_energy_pack(msg->energy, buffer, protocol_version);
 		packstr(msg->version, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		pack_time(msg->timestamp, buffer);
 		pack_time(msg->slurmd_start_time, buffer);
 		pack32(msg->status, buffer);
 		packstr(msg->node_name, buffer);
 		packstr(msg->arch, buffer);
+		packstr(msg->cpu_spec_list, buffer);
 		packstr(msg->os, buffer);
 		pack16(msg->cpus, buffer);
 		pack16(msg->boards, buffer);
@@ -3612,12 +3738,16 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t
 	node_reg_ptr = xmalloc(sizeof(slurm_node_registration_status_msg_t));
 	*msg = node_reg_ptr;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&node_reg_ptr->timestamp, buffer);
 		safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer);
 		/* load the data values */
 		safe_unpack32(&node_reg_ptr->status, buffer);
+		safe_unpackstr_xmalloc(&node_reg_ptr->features_active,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node_reg_ptr->features_avail,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node_reg_ptr->node_name,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node_reg_ptr->arch,
@@ -3672,7 +3802,7 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t
 			goto unpack_error;
 		safe_unpackstr_xmalloc(&node_reg_ptr->version,
 				       &uint32_tmp, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&node_reg_ptr->timestamp, buffer);
 		safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer);
@@ -3695,6 +3825,7 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t
 		safe_unpack32(&node_reg_ptr->up_time, buffer);
 		safe_unpack32(&node_reg_ptr->hash_val, buffer);
 		safe_unpack32(&node_reg_ptr->cpu_load, buffer);
+		safe_unpack32(&node_reg_ptr->free_mem, buffer);
 
 		safe_unpack32(&node_reg_ptr->job_count, buffer);
 		node_reg_ptr->job_id =
@@ -3731,7 +3862,7 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t
 			goto unpack_error;
 		safe_unpackstr_xmalloc(&node_reg_ptr->version,
 				       &uint32_tmp, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&node_reg_ptr->timestamp, buffer);
 		safe_unpack_time(&node_reg_ptr->slurmd_start_time, buffer);
@@ -3741,6 +3872,8 @@ _unpack_node_registration_status_msg(slurm_node_registration_status_msg_t
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node_reg_ptr->arch,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node_reg_ptr->cpu_spec_list,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node_reg_ptr->os, &uint32_tmp, buffer);
 		safe_unpack16(&node_reg_ptr->cpus, buffer);
 		safe_unpack16(&node_reg_ptr->boards, buffer);
@@ -3808,7 +3941,35 @@ _pack_resource_allocation_response_msg(resource_allocation_response_msg_t *msg,
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		packstr(msg->account, buffer);
+		packstr(msg->alias_list, buffer);
+		packstr_array(msg->environment, msg->env_size, buffer);
+		pack32(msg->error_code, buffer);
+		pack32(msg->job_id, buffer);
+		pack32(msg->node_cnt, buffer);
+		packstr(msg->node_list, buffer);
+		pack16(msg->ntasks_per_board, buffer);
+		pack16(msg->ntasks_per_core, buffer);
+		pack16(msg->ntasks_per_socket, buffer);
+		pack32(msg->num_cpu_groups, buffer);
+		if (msg->num_cpu_groups) {
+			pack16_array(msg->cpus_per_node,
+				     msg->num_cpu_groups,
+				     buffer);
+			pack32_array(msg->cpu_count_reps,
+				     msg->num_cpu_groups,
+				     buffer);
+		}
+		packstr(msg->partition, buffer);
+		pack32(msg->pn_min_memory, buffer);
+		packstr(msg->qos, buffer);
+		packstr(msg->resv_name, buffer);
+		select_g_select_jobinfo_pack(msg->select_jobinfo,
+					     buffer,
+					     protocol_version);
+
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		packstr(msg->account, buffer);
 		packstr(msg->alias_list, buffer);
 		packstr_array(msg->environment, msg->env_size, buffer);
@@ -3833,7 +3994,7 @@ _pack_resource_allocation_response_msg(resource_allocation_response_msg_t *msg,
 					     buffer,
 					     protocol_version);
 
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		pack32(msg->error_code, buffer);
 		pack32(msg->job_id, buffer);
 		pack32(msg->pn_min_memory, buffer);
@@ -3843,8 +4004,10 @@ _pack_resource_allocation_response_msg(resource_allocation_response_msg_t *msg,
 
 		pack32(msg->num_cpu_groups, buffer);
 		if (msg->num_cpu_groups) {
-			pack16_array(msg->cpus_per_node, msg->num_cpu_groups, buffer);
-			pack32_array(msg->cpu_count_reps, msg->num_cpu_groups, buffer);
+			pack16_array(msg->cpus_per_node,
+				     msg->num_cpu_groups, buffer);
+			pack32_array(msg->cpu_count_reps,
+				     msg->num_cpu_groups, buffer);
 		}
 
 		pack32(msg->node_cnt, buffer);
@@ -3870,7 +4033,49 @@ _unpack_resource_allocation_response_msg(
 	tmp_ptr = xmalloc(sizeof(resource_allocation_response_msg_t));
 	*msg = tmp_ptr;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&tmp_ptr->account, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->alias_list, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_array(&tmp_ptr->environment,
+				     &tmp_ptr->env_size, buffer);
+		safe_unpack32(&tmp_ptr->error_code, buffer);
+		safe_unpack32(&tmp_ptr->job_id, buffer);
+		safe_unpack32(&tmp_ptr->node_cnt, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->node_list, &uint32_tmp,
+				       buffer);
+		safe_unpack16(&tmp_ptr->ntasks_per_board, buffer);
+		safe_unpack16(&tmp_ptr->ntasks_per_core, buffer);
+		safe_unpack16(&tmp_ptr->ntasks_per_socket, buffer);
+		safe_unpack32(&tmp_ptr->num_cpu_groups, buffer);
+		if (tmp_ptr->num_cpu_groups > 0) {
+			safe_unpack16_array(&tmp_ptr->cpus_per_node,
+					    &uint32_tmp, buffer);
+			if (tmp_ptr->num_cpu_groups != uint32_tmp)
+				goto unpack_error;
+			safe_unpack32_array(&tmp_ptr->cpu_count_reps,
+					    &uint32_tmp, buffer);
+			if (tmp_ptr->num_cpu_groups != uint32_tmp)
+				goto unpack_error;
+		} else {
+			tmp_ptr->cpus_per_node = NULL;
+			tmp_ptr->cpu_count_reps = NULL;
+		}
+		safe_unpackstr_xmalloc(&tmp_ptr->partition, &uint32_tmp,
+				       buffer);
+		safe_unpack32(&tmp_ptr->pn_min_memory, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->qos, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->resv_name, &uint32_tmp,
+				       buffer);
+		if (select_g_select_jobinfo_unpack(&tmp_ptr->select_jobinfo,
+						   buffer, protocol_version))
+			goto unpack_error;
+
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		tmp_ptr->ntasks_per_board = (uint16_t)NO_VAL;
+		tmp_ptr->ntasks_per_core = (uint16_t)NO_VAL;
+		tmp_ptr->ntasks_per_socket = (uint16_t)NO_VAL;
 		safe_unpackstr_xmalloc(&tmp_ptr->account, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->alias_list, &uint32_tmp,
@@ -3906,7 +4111,10 @@ _unpack_resource_allocation_response_msg(
 						   buffer, protocol_version))
 			goto unpack_error;
 
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		tmp_ptr->ntasks_per_board = (uint16_t)NO_VAL;
+		tmp_ptr->ntasks_per_core = (uint16_t)NO_VAL;
+		tmp_ptr->ntasks_per_socket = (uint16_t)NO_VAL;
 		safe_unpack32(&tmp_ptr->error_code, buffer);
 		safe_unpack32(&tmp_ptr->job_id, buffer);
 		safe_unpack32(&tmp_ptr->pn_min_memory, buffer);
@@ -4173,13 +4381,10 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 			  uint16_t protocol_version)
 {
 	uint32_t uint32_tmp;
-	uint16_t tmp_state;
 
 	xassert(node != NULL);
 
-	tmp_state = node->node_state;
-
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp,
 				       buffer);
@@ -4196,6 +4401,7 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 		safe_unpack32(&node->real_memory, buffer);
 		safe_unpack32(&node->tmp_disk, buffer);
 
+		safe_unpackstr_xmalloc(&node->mcs_label, &uint32_tmp, buffer);
 		safe_unpack32(&node->owner, buffer);
 		safe_unpack16(&node->core_spec_cnt, buffer);
 		safe_unpack32(&node->mem_spec_limit, buffer);
@@ -4216,6 +4422,9 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 
 		safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node->features_act, &uint32_tmp, buffer);
+		if (!node->features_act)
+			node->features_act = xstrdup(node->features);
 		safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->gres_drain, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->gres_used, &uint32_tmp, buffer);
@@ -4235,7 +4444,7 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 
 		safe_unpackstr_xmalloc(&node->tres_fmt_str, &uint32_tmp,
 				       buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp,
 				       buffer);
@@ -4252,12 +4461,14 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 		safe_unpack32(&node->real_memory, buffer);
 		safe_unpack32(&node->tmp_disk, buffer);
 
+		safe_unpack32(&node->owner, buffer);
 		safe_unpack16(&node->core_spec_cnt, buffer);
 		safe_unpack32(&node->mem_spec_limit, buffer);
 		safe_unpackstr_xmalloc(&node->cpu_spec_list, &uint32_tmp,
 				       buffer);
 
 		safe_unpack32(&node->cpu_load, buffer);
+		safe_unpack32(&node->free_mem, buffer);
 		safe_unpack32(&node->weight, buffer);
 		safe_unpack32(&node->reason_uid, buffer);
 
@@ -4270,6 +4481,7 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 
 		safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer);
+		node->features_act = xstrdup(node->features);
 		safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->gres_drain, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->gres_used, &uint32_tmp, buffer);
@@ -4283,12 +4495,18 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 					      protocol_version)
 		    != SLURM_SUCCESS)
 			goto unpack_error;
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		if (power_mgmt_data_unpack(&node->power, buffer,
+					   protocol_version) != SLURM_SUCCESS)
+			goto unpack_error;
+
+		safe_unpackstr_xmalloc(&node->tres_fmt_str, &uint32_tmp,
+				       buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&node->name, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->node_hostname, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&node->node_addr, &uint32_tmp, buffer);
-		safe_unpack16(&tmp_state, buffer);
+		safe_unpack32(&node->node_state, buffer);
 		safe_unpackstr_xmalloc(&node->version, &uint32_tmp, buffer);
 
 		safe_unpack16(&node->cpus, buffer);
@@ -4299,6 +4517,12 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 
 		safe_unpack32(&node->real_memory, buffer);
 		safe_unpack32(&node->tmp_disk, buffer);
+
+		safe_unpack16(&node->core_spec_cnt, buffer);
+		safe_unpack32(&node->mem_spec_limit, buffer);
+		safe_unpackstr_xmalloc(&node->cpu_spec_list, &uint32_tmp,
+				       buffer);
+
 		safe_unpack32(&node->cpu_load, buffer);
 		safe_unpack32(&node->weight, buffer);
 		safe_unpack32(&node->reason_uid, buffer);
@@ -4312,7 +4536,10 @@ _unpack_node_info_members(node_info_t * node, Buf buffer,
 
 		safe_unpackstr_xmalloc(&node->arch, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->features, &uint32_tmp, buffer);
+		node->features_act = xstrdup(node->features);
 		safe_unpackstr_xmalloc(&node->gres, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node->gres_drain, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node->gres_used, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->os, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&node->reason, &uint32_tmp, buffer);
 		if (acct_gather_energy_unpack(&node->energy, buffer,
@@ -4341,7 +4568,34 @@ _pack_update_partition_msg(update_part_msg_t * msg, Buf buffer,
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		packstr(msg->allow_accounts, buffer);
+		packstr(msg->allow_alloc_nodes, buffer);
+		packstr(msg->allow_groups, buffer);
+		packstr(msg->allow_qos,    buffer);
+		packstr(msg->qos_char,     buffer);
+		packstr(msg->alternate,    buffer);
+		packstr(msg->deny_accounts, buffer);
+		packstr(msg->deny_qos,     buffer);
+		packstr(msg->name,         buffer);
+		packstr(msg->nodes,        buffer);
+
+		pack32(msg-> grace_time,   buffer);
+		pack32(msg-> max_time,     buffer);
+		pack32(msg-> default_time, buffer);
+		pack32(msg-> max_nodes,    buffer);
+		pack32(msg-> min_nodes,    buffer);
+		pack32(msg-> max_cpus_per_node, buffer);
+		pack32(msg-> def_mem_per_cpu, buffer);
+		pack32(msg-> max_mem_per_cpu, buffer);
+
+		pack16(msg-> flags,        buffer);
+		pack16(msg-> max_share,    buffer);
+		pack16(msg-> preempt_mode, buffer);
+		pack16(msg-> priority_job_factor, buffer);
+		pack16(msg-> priority_tier, buffer);
+		pack16(msg-> state_up,     buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		packstr(msg->allow_accounts, buffer);
 		packstr(msg->allow_alloc_nodes, buffer);
 		packstr(msg->allow_groups, buffer);
@@ -4365,9 +4619,9 @@ _pack_update_partition_msg(update_part_msg_t * msg, Buf buffer,
 		pack16(msg-> flags,        buffer);
 		pack16(msg-> max_share,    buffer);
 		pack16(msg-> preempt_mode, buffer);
-		pack16(msg-> priority,     buffer);
+		pack16(msg-> priority_tier, buffer);
 		pack16(msg-> state_up,     buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		packstr(msg->allow_accounts, buffer);
 		packstr(msg->allow_alloc_nodes, buffer);
 		packstr(msg->allow_groups, buffer);
@@ -4390,7 +4644,7 @@ _pack_update_partition_msg(update_part_msg_t * msg, Buf buffer,
 		pack16(msg-> flags,        buffer);
 		pack16(msg-> max_share,    buffer);
 		pack16(msg-> preempt_mode, buffer);
-		pack16(msg-> priority,     buffer);
+		pack16(msg-> priority_tier, buffer);
 		pack16(msg-> state_up,     buffer);
 	} else {
 		error("_pack_update_partition_msg: protocol_version "
@@ -4411,7 +4665,7 @@ _unpack_update_partition_msg(update_part_msg_t ** msg, Buf buffer,
 	tmp_ptr = xmalloc(sizeof(update_part_msg_t));
 	*msg = tmp_ptr;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&tmp_ptr->allow_accounts,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->allow_alloc_nodes,
@@ -4443,9 +4697,45 @@ _unpack_update_partition_msg(update_part_msg_t ** msg, Buf buffer,
 		safe_unpack16(&tmp_ptr->flags,     buffer);
 		safe_unpack16(&tmp_ptr->max_share, buffer);
 		safe_unpack16(&tmp_ptr->preempt_mode, buffer);
-		safe_unpack16(&tmp_ptr->priority,  buffer);
+		safe_unpack16(&tmp_ptr->priority_job_factor, buffer);
+		safe_unpack16(&tmp_ptr->priority_tier, buffer);
 		safe_unpack16(&tmp_ptr->state_up,  buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&tmp_ptr->allow_accounts,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->allow_alloc_nodes,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->allow_groups,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->allow_qos,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->qos_char,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->alternate, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->deny_accounts,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->deny_qos,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&tmp_ptr->nodes, &uint32_tmp, buffer);
+
+		safe_unpack32(&tmp_ptr->grace_time, buffer);
+		safe_unpack32(&tmp_ptr->max_time, buffer);
+		safe_unpack32(&tmp_ptr->default_time, buffer);
+		safe_unpack32(&tmp_ptr->max_nodes, buffer);
+		safe_unpack32(&tmp_ptr->min_nodes, buffer);
+		safe_unpack32(&tmp_ptr->max_cpus_per_node, buffer);
+		safe_unpack32(&tmp_ptr->def_mem_per_cpu, buffer);
+		safe_unpack32(&tmp_ptr->max_mem_per_cpu, buffer);
+
+		safe_unpack16(&tmp_ptr->flags,     buffer);
+		safe_unpack16(&tmp_ptr->max_share, buffer);
+		safe_unpack16(&tmp_ptr->preempt_mode, buffer);
+		tmp_ptr->priority_job_factor = (uint16_t) NO_VAL;
+		safe_unpack16(&tmp_ptr->priority_tier,  buffer);
+		safe_unpack16(&tmp_ptr->state_up,  buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&tmp_ptr->allow_accounts,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->allow_alloc_nodes,
@@ -4475,7 +4765,8 @@ _unpack_update_partition_msg(update_part_msg_t ** msg, Buf buffer,
 		safe_unpack16(&tmp_ptr->flags,     buffer);
 		safe_unpack16(&tmp_ptr->max_share, buffer);
 		safe_unpack16(&tmp_ptr->preempt_mode, buffer);
-		safe_unpack16(&tmp_ptr->priority,  buffer);
+		tmp_ptr->priority_job_factor = (uint16_t) NO_VAL;
+		safe_unpack16(&tmp_ptr->priority_tier, buffer);
 		safe_unpack16(&tmp_ptr->state_up,  buffer);
 	} else {
 		error("_unpack_update_partition_msg: protocol_version "
@@ -4546,7 +4837,7 @@ _pack_update_resv_msg(resv_desc_msg_t * msg, Buf buffer,
 		packstr(msg->users,        buffer);
 		packstr(msg->accounts,     buffer);
 		packstr(msg->burst_buffer, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		packstr(msg->name,         buffer);
 		pack_time(msg->start_time, buffer);
 		pack_time(msg->end_time,   buffer);
@@ -4636,7 +4927,7 @@ _unpack_update_resv_msg(resv_desc_msg_t ** msg, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&tmp_ptr->burst_buffer,
 				       &uint32_tmp, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&tmp_ptr->name, &uint32_tmp, buffer);
 		safe_unpack_time(&tmp_ptr->start_time, buffer);
 		safe_unpack_time(&tmp_ptr->end_time,   buffer);
@@ -5085,20 +5376,10 @@ _pack_epilog_comp_msg(epilog_complete_msg_t * msg, Buf buffer,
 		      uint16_t protocol_version)
 {
 	xassert(msg != NULL);
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		pack32((uint32_t)msg->job_id, buffer);
-		pack32((uint32_t)msg->return_code, buffer);
-		packstr(msg->node_name, buffer);
-	} else {
-		switch_node_info_t *switch_nodeinfo = NULL;
-
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack32((uint32_t)msg->job_id, buffer);
 		pack32((uint32_t)msg->return_code, buffer);
 		packstr(msg->node_name, buffer);
-		switch_g_alloc_node_info(&switch_nodeinfo);
-		switch_g_pack_node_info(switch_nodeinfo, buffer,
-					protocol_version);
-		switch_g_free_node_info(&switch_nodeinfo);
 	}
 }
 
@@ -5113,24 +5394,11 @@ _unpack_epilog_comp_msg(epilog_complete_msg_t ** msg, Buf buffer,
 	tmp_ptr = xmalloc(sizeof(epilog_complete_msg_t));
 	*msg = tmp_ptr;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		safe_unpack32(&(tmp_ptr->job_id), buffer);
-		safe_unpack32(&(tmp_ptr->return_code), buffer);
-		safe_unpackstr_xmalloc(&(tmp_ptr->node_name),
-				       &uint32_tmp, buffer);
-	} else {
-		switch_node_info_t *switch_nodeinfo = NULL;
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack32(&(tmp_ptr->job_id), buffer);
 		safe_unpack32(&(tmp_ptr->return_code), buffer);
 		safe_unpackstr_xmalloc(&(tmp_ptr->node_name),
 				       &uint32_tmp, buffer);
-		if (switch_g_alloc_node_info(&switch_nodeinfo)
-		    || switch_g_unpack_node_info(switch_nodeinfo, buffer,
-						 protocol_version)) {
-			switch_g_free_node_info(&switch_nodeinfo);
-			goto unpack_error;
-		}
-		switch_g_free_node_info(&switch_nodeinfo);
 	}
 
 	return SLURM_SUCCESS;
@@ -5464,7 +5732,57 @@ _unpack_partition_info_members(partition_info_t * part, Buf buffer,
 	uint32_t uint32_tmp;
 	char *node_inx_str = NULL;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&part->name, &uint32_tmp, buffer);
+		if (part->name == NULL)
+			part->name = xmalloc(1);/* part->name = "" implicit */
+		safe_unpack32(&part->grace_time,   buffer);
+		safe_unpack32(&part->max_time,     buffer);
+		safe_unpack32(&part->default_time, buffer);
+		safe_unpack32(&part->max_nodes,    buffer);
+		safe_unpack32(&part->min_nodes,    buffer);
+		safe_unpack32(&part->total_nodes,  buffer);
+		safe_unpack32(&part->total_cpus,   buffer);
+		safe_unpack32(&part->def_mem_per_cpu, buffer);
+		safe_unpack32(&part->max_cpus_per_node, buffer);
+		safe_unpack32(&part->max_mem_per_cpu, buffer);
+		safe_unpack16(&part->flags,        buffer);
+		safe_unpack16(&part->max_share,    buffer);
+		safe_unpack16(&part->preempt_mode, buffer);
+		safe_unpack16(&part->priority_job_factor, buffer);
+		safe_unpack16(&part->priority_tier, buffer);
+		safe_unpack16(&part->state_up,     buffer);
+		safe_unpack16(&part->cr_type ,     buffer);
+
+		safe_unpackstr_xmalloc(&part->allow_accounts, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->allow_groups, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->allow_alloc_nodes, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->allow_qos, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->qos_char, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->alternate, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&part->deny_accounts, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->deny_qos, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->nodes, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer);
+		if (node_inx_str == NULL)
+			part->node_inx = bitfmt2int("");
+		else {
+			part->node_inx = bitfmt2int(node_inx_str);
+			xfree(node_inx_str);
+			node_inx_str = NULL;
+		}
+		safe_unpackstr_xmalloc(&part->billing_weights_str, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&part->tres_fmt_str, &uint32_tmp,
+				       buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&part->name, &uint32_tmp, buffer);
 		if (part->name == NULL)
 			part->name = xmalloc(1);/* part->name = "" implicit */
@@ -5481,7 +5799,8 @@ _unpack_partition_info_members(partition_info_t * part, Buf buffer,
 		safe_unpack16(&part->flags,        buffer);
 		safe_unpack16(&part->max_share,    buffer);
 		safe_unpack16(&part->preempt_mode, buffer);
-		safe_unpack16(&part->priority,     buffer);
+		safe_unpack16(&part->priority_tier, buffer);
+		part->priority_job_factor = part->priority_tier;
 		safe_unpack16(&part->state_up,     buffer);
 		safe_unpack16(&part->cr_type ,     buffer);
 
@@ -5513,7 +5832,7 @@ _unpack_partition_info_members(partition_info_t * part, Buf buffer,
 				       buffer);
 		safe_unpackstr_xmalloc(&part->tres_fmt_str, &uint32_tmp,
 				       buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&part->name, &uint32_tmp, buffer);
 		if (part->name == NULL)
 			part->name = xmalloc(1);/* part->name = "" implicit */
@@ -5530,7 +5849,8 @@ _unpack_partition_info_members(partition_info_t * part, Buf buffer,
 		safe_unpack16(&part->flags,        buffer);
 		safe_unpack16(&part->max_share,    buffer);
 		safe_unpack16(&part->preempt_mode, buffer);
-		safe_unpack16(&part->priority,     buffer);
+		safe_unpack16(&part->priority_tier, buffer);
+		part->priority_job_factor = part->priority_tier;
 		safe_unpack16(&part->state_up,     buffer);
 		safe_unpack16(&part->cr_type ,     buffer);
 
@@ -5683,7 +6003,7 @@ _unpack_reserve_info_members(reserve_info_t * resv, Buf buffer,
 			xfree(node_inx_str);
 			node_inx_str = NULL;
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&resv->accounts,	&uint32_tmp, buffer);
 		safe_unpack32(&resv->core_cnt,          buffer);
 		resv->tres_str = xstrdup_printf(
@@ -5733,7 +6053,48 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer,
 	uint16_t uint16_tmp;
 	char *node_inx_str;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&step->array_job_id, buffer);
+		safe_unpack32(&step->array_task_id, buffer);
+		safe_unpack32(&step->job_id, buffer);
+		safe_unpack32(&step->step_id, buffer);
+		safe_unpack16(&step->ckpt_interval, buffer);
+		safe_unpack32(&step->user_id, buffer);
+		safe_unpack32(&step->num_cpus, buffer);
+		safe_unpack32(&step->cpu_freq_min, buffer);
+		safe_unpack32(&step->cpu_freq_max, buffer);
+		safe_unpack32(&step->cpu_freq_gov, buffer);
+		safe_unpack32(&step->num_tasks, buffer);
+		safe_unpack32(&step->task_dist, buffer);
+		safe_unpack32(&step->time_limit, buffer);
+		safe_unpack32(&step->state, buffer);
+
+		safe_unpack_time(&step->start_time, buffer);
+		safe_unpack_time(&step->run_time, buffer);
+
+		safe_unpackstr_xmalloc(&step->partition, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->resv_ports, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->nodes, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->name, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->network, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&node_inx_str, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->ckpt_dir, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step->gres, &uint32_tmp, buffer);
+		if (node_inx_str == NULL)
+			step->node_inx = bitfmt2int("");
+		else {
+			step->node_inx = bitfmt2int(node_inx_str);
+			xfree(node_inx_str);
+		}
+
+		if (select_g_select_jobinfo_unpack(&step->select_jobinfo,
+						   buffer, protocol_version))
+			goto unpack_error;
+
+		safe_unpackstr_xmalloc(&step->tres_alloc_str,
+				       &uint32_tmp, buffer);
+		safe_unpack16(&step->start_protocol_ver, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack32(&step->array_job_id, buffer);
 		safe_unpack32(&step->array_task_id, buffer);
 		safe_unpack32(&step->job_id, buffer);
@@ -5773,7 +6134,7 @@ _unpack_job_step_info_members(job_step_info_t * step, Buf buffer,
 
 		safe_unpackstr_xmalloc(&step->tres_alloc_str,
 				       &uint32_tmp, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpack32(&step->array_job_id, buffer);
 		safe_unpack32(&step->array_task_id, buffer);
 		safe_unpack32(&step->job_id, buffer);
@@ -5903,66 +6264,6 @@ unpack_error:
 	return SLURM_ERROR;
 }
 
-static int
-_unpack_sicp_info_msg(sicp_info_msg_t ** msg, Buf buffer,
-		      uint16_t protocol_version)
-{
-	int i;
-	sicp_info_t *job = NULL;
-	uint16_t uint16_tmp;
-
-	xassert(msg != NULL);
-	*msg = xmalloc(sizeof(sicp_info_msg_t));
-
-	/* load buffer's header (data structure version and time) */
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
-		safe_unpack32(&((*msg)->record_count), buffer);
-
-		if (protocol_version == SLURM_PROTOCOL_VERSION) {
-			job = (*msg)->sicp_array =
-				xmalloc_nz(sizeof(sicp_info_t) *
-					   (*msg)->record_count);
-		} else {
-			job = (*msg)->sicp_array =
-				xmalloc(sizeof(sicp_info_t) *
-					(*msg)->record_count);
-		}
-		/* load individual inter-cluster job info */
-		for (i = 0; i < (*msg)->record_count; i++, job++) {
-			safe_unpack32(&job->job_id, buffer);
-			safe_unpack32(&job->job_state, buffer);
-		}
-	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		safe_unpack32(&((*msg)->record_count), buffer);
-
-		if (protocol_version == SLURM_PROTOCOL_VERSION) {
-			job = (*msg)->sicp_array =
-				xmalloc_nz(sizeof(sicp_info_t) *
-					   (*msg)->record_count);
-		} else {
-			job = (*msg)->sicp_array =
-				xmalloc(sizeof(sicp_info_t) *
-					(*msg)->record_count);
-		}
-		/* load individual inter-cluster job info */
-		for (i = 0; i < (*msg)->record_count; i++, job++) {
-			safe_unpack32(&job->job_id, buffer);
-			safe_unpack16(&uint16_tmp, buffer);
-			job->job_state = uint16_tmp;
-		}
-	} else {
-		error("_unpack_sicp_info_msg: protocol_version "
-		      "%hu not supported", protocol_version);
-		goto unpack_error;
-	}
-	return SLURM_SUCCESS;
-
-unpack_error:
-	slurm_free_sicp_msg(*msg);
-	*msg = NULL;
-	return SLURM_ERROR;
-}
-
 /* Translate bitmap representation from hex to decimal format, replacing
  * array_task_str and store the bitmap in job->array_bitmap. */
 static void _xlate_task_str(job_info_t *job_ptr)
@@ -6062,12 +6363,13 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 {
 	uint32_t uint32_tmp = 0;
 	uint16_t uint16_tmp = 0;
+	uint8_t uint8_tmp = 0;
 	char *node_inx_str;
 	multi_core_data_t *mc_ptr;
 
 	job->ntasks_per_node = (uint16_t)NO_VAL;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpack32(&job->array_job_id, buffer);
 		safe_unpack32(&job->array_task_id, buffer);
 		/* The array_task_str value is stored in slurmctld and passed
@@ -6089,15 +6391,15 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack16(&job->state_reason, buffer);
 		safe_unpack8 (&job->power_flags,  buffer);
 		safe_unpack8 (&job->reboot,       buffer);
-		safe_unpack8 (&job->sicp_mode,    buffer);
 		safe_unpack16(&job->restart_cnt,  buffer);
 		safe_unpack16(&job->show_flags,   buffer);
+		safe_unpack_time(&job->deadline, buffer);
 
 		safe_unpack32(&job->alloc_sid,    buffer);
 		safe_unpack32(&job->time_limit,   buffer);
 		safe_unpack32(&job->time_min,     buffer);
 
-		safe_unpack16(&job->nice, buffer);
+		safe_unpack32(&job->nice, buffer);
 
 		safe_unpack_time(&job->submit_time, buffer);
 		safe_unpack_time(&job->eligible_time, buffer);
@@ -6123,6 +6425,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpackstr_xmalloc(&job->licenses, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->state_desc, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->resv_name,  &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&job->mcs_label,  &uint32_tmp, buffer);
 
 		safe_unpack32(&job->exit_code, buffer);
 		safe_unpack32(&job->derived_ec, buffer);
@@ -6159,6 +6462,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack32(&job->max_nodes,   buffer);
 		safe_unpack16(&job->requeue,     buffer);
 		safe_unpack16(&job->ntasks_per_node, buffer);
+		safe_unpack32(&job->num_tasks, buffer);
 
 		safe_unpack16(&job->shared,        buffer);
 		safe_unpack32(&job->cpu_freq_min, buffer);
@@ -6213,7 +6517,9 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->tres_req_str,
 				       &uint32_tmp, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		safe_unpack16(&job->start_protocol_ver, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		safe_unpack32(&job->array_job_id, buffer);
 		safe_unpack32(&job->array_task_id, buffer);
 		/* The array_task_str value is stored in slurmctld and passed
@@ -6230,11 +6536,12 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack32(&job->group_id, buffer);
 		safe_unpack32(&job->profile,  buffer);
 
-		safe_unpack16(&uint16_tmp, buffer);
-		job->job_state = uint16_tmp;
+		safe_unpack32(&job->job_state,    buffer);
 		safe_unpack16(&job->batch_flag,   buffer);
 		safe_unpack16(&job->state_reason, buffer);
+		safe_unpack8 (&job->power_flags,  buffer);
 		safe_unpack8 (&job->reboot,       buffer);
+		safe_unpack8 (&uint8_tmp,         buffer);	/* vestigial */
 		safe_unpack16(&job->restart_cnt,  buffer);
 		safe_unpack16(&job->show_flags,   buffer);
 
@@ -6242,7 +6549,8 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack32(&job->time_limit,   buffer);
 		safe_unpack32(&job->time_min,     buffer);
 
-		safe_unpack16(&job->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		job->nice = xlate_nice_old2new(old_nice);
 
 		safe_unpack_time(&job->submit_time, buffer);
 		safe_unpack_time(&job->eligible_time, buffer);
@@ -6253,6 +6561,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack_time(&job->resize_time, buffer);
 		safe_unpack_time(&job->preempt_time, buffer);
 		safe_unpack32(&job->priority, buffer);
+		safe_unpackdouble(&job->billable_tres, buffer);
 		safe_unpackstr_xmalloc(&job->nodes, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->sched_nodes, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->partition, &uint32_tmp, buffer);
@@ -6262,6 +6571,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpackstr_xmalloc(&job->gres, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->batch_host, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->batch_script, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&job->burst_buffer, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->qos, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->licenses, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->state_desc, &uint32_tmp, buffer);
@@ -6297,17 +6607,18 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpackstr_xmalloc(&job->command,    &uint32_tmp, buffer);
 
 		safe_unpack32(&job->num_cpus, buffer);
-		job->tres_alloc_str = xstrdup_printf(
-			"%d=%u", TRES_CPU, job->num_cpus);
-
 		safe_unpack32(&job->max_cpus, buffer);
 		safe_unpack32(&job->num_nodes,   buffer);
 		safe_unpack32(&job->max_nodes,   buffer);
 		safe_unpack16(&job->requeue,     buffer);
 		safe_unpack16(&job->ntasks_per_node, buffer);
 
-		/*** unpack pending job details ***/
 		safe_unpack16(&job->shared,        buffer);
+		safe_unpack32(&job->cpu_freq_min, buffer);
+		safe_unpack32(&job->cpu_freq_max, buffer);
+		safe_unpack32(&job->cpu_freq_gov, buffer);
+
+		/*** unpack pending job details ***/
 		safe_unpack16(&job->contiguous,    buffer);
 		safe_unpack16(&job->core_spec,     buffer);
 		safe_unpack16(&job->cpus_per_task, buffer);
@@ -6350,27 +6661,43 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 			job->ntasks_per_core   = mc_ptr->ntasks_per_core;
 			xfree(mc_ptr);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		safe_unpack32(&job->bitflags, buffer);
+		safe_unpackstr_xmalloc(&job->tres_alloc_str,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&job->tres_req_str,
+				       &uint32_tmp, buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		safe_unpack32(&job->array_job_id, buffer);
 		safe_unpack32(&job->array_task_id, buffer);
+		/* The array_task_str value is stored in slurmctld and passed
+		 * here in hex format for best scalability. Its format needs
+		 * to be converted to human readable form by the client. */
+		safe_unpackstr_xmalloc(&job->array_task_str, &uint32_tmp,
+				       buffer);
+		safe_unpack32(&job->array_max_tasks, buffer);
+		_xlate_task_str(job);
+
 		safe_unpack32(&job->assoc_id, buffer);
-		safe_unpack32(&job->job_id, buffer);
-		safe_unpack32(&job->user_id, buffer);
+		safe_unpack32(&job->job_id,   buffer);
+		safe_unpack32(&job->user_id,  buffer);
 		safe_unpack32(&job->group_id, buffer);
-		safe_unpack32(&job->profile, buffer);
+		safe_unpack32(&job->profile,  buffer);
 
 		safe_unpack16(&uint16_tmp, buffer);
 		job->job_state = uint16_tmp;
 		safe_unpack16(&job->batch_flag,   buffer);
 		safe_unpack16(&job->state_reason, buffer);
-		safe_unpack16(&job->restart_cnt, buffer);
-		safe_unpack16(&job->show_flags, buffer);
+		safe_unpack8 (&job->reboot,       buffer);
+		safe_unpack16(&job->restart_cnt,  buffer);
+		safe_unpack16(&job->show_flags,   buffer);
 
 		safe_unpack32(&job->alloc_sid,    buffer);
 		safe_unpack32(&job->time_limit,   buffer);
-		safe_unpack32(&job->time_min,   buffer);
+		safe_unpack32(&job->time_min,     buffer);
 
-		safe_unpack16(&job->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		job->nice = xlate_nice_old2new(old_nice);
 
 		safe_unpack_time(&job->submit_time, buffer);
 		safe_unpack_time(&job->eligible_time, buffer);
@@ -6382,6 +6709,7 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpack_time(&job->preempt_time, buffer);
 		safe_unpack32(&job->priority, buffer);
 		safe_unpackstr_xmalloc(&job->nodes, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&job->sched_nodes, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->partition, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->account, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job->network, &uint32_tmp, buffer);
@@ -6424,6 +6752,8 @@ _unpack_job_info_members(job_info_t * job, Buf buffer,
 		safe_unpackstr_xmalloc(&job->command,    &uint32_tmp, buffer);
 
 		safe_unpack32(&job->num_cpus, buffer);
+		job->tres_alloc_str = xstrdup_printf(
+			"%d=%u", TRES_CPU, job->num_cpus);
 
 		safe_unpack32(&job->max_cpus, buffer);
 		safe_unpack32(&job->num_nodes,   buffer);
@@ -6494,7 +6824,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 	uint32_t count = NO_VAL;
 	uint32_t cluster_flags = slurmdb_setup_cluster_flags();
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		pack_time(build_ptr->last_update, buffer);
 
 		pack16(build_ptr->accounting_storage_enforce, buffer);
@@ -6629,6 +6959,10 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack32(build_ptr->max_mem_per_cpu, buffer);
 		pack32(build_ptr->max_step_cnt, buffer);
 		pack16(build_ptr->max_tasks_per_node, buffer);
+
+		packstr(build_ptr->mcs_plugin, buffer);
+		packstr(build_ptr->mcs_plugin_params, buffer);
+
 		pack16(build_ptr->mem_limit_enforce, buffer);
 		pack32(build_ptr->min_job_age, buffer);
 		packstr(build_ptr->mpi_default, buffer);
@@ -6637,6 +6971,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->msg_timeout, buffer);
 
 		pack32(build_ptr->next_job_id, buffer);
+		packstr(build_ptr->node_features_plugins, buffer);
 		packstr(build_ptr->node_prefix, buffer);
 
 		pack16(build_ptr->over_time_limit, buffer);
@@ -6752,6 +7087,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->task_prolog, buffer);
 		packstr(build_ptr->task_plugin, buffer);
 		pack32(build_ptr->task_plugin_param, buffer);
+		pack16(build_ptr->tcp_timeout, buffer);
 		packstr(build_ptr->tmp_fs, buffer);
 		packstr(build_ptr->topology_param, buffer);
 		packstr(build_ptr->topology_plugin, buffer);
@@ -6769,8 +7105,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->z_16, buffer);
 		pack32(build_ptr->z_32, buffer);
 		packstr(build_ptr->z_char, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		uint16_t dynalloc_port = 0;
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack_time(build_ptr->last_update, buffer);
 
 		pack16(build_ptr->accounting_storage_enforce, buffer);
@@ -6778,6 +7113,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->accounting_storage_host, buffer);
 		packstr(build_ptr->accounting_storage_loc, buffer);
 		pack32(build_ptr->accounting_storage_port, buffer);
+		packstr(build_ptr->accounting_storage_tres, buffer);
 		packstr(build_ptr->accounting_storage_type, buffer);
 		packstr(build_ptr->accounting_storage_user, buffer);
 		pack16(build_ptr->acctng_store_job_comment, buffer);
@@ -6811,7 +7147,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->backup_controller, buffer);
 		pack16(build_ptr->batch_start_timeout, buffer);
 		pack_time(build_ptr->boot_time, buffer);
-
+		packstr(build_ptr->bb_type, buffer);
 		packstr(build_ptr->checkpoint_type, buffer);
 		packstr(build_ptr->chos_loc, buffer);
 		packstr(build_ptr->cluster_name, buffer);
@@ -6820,13 +7156,14 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->control_machine, buffer);
 		packstr(build_ptr->core_spec_plugin, buffer);
 		pack32(build_ptr->cpu_freq_def, buffer);
+		pack32(build_ptr->cpu_freq_govs, buffer);
 		packstr(build_ptr->crypto_type, buffer);
 
 		pack32(build_ptr->def_mem_per_cpu, buffer);
 		pack64(build_ptr->debug_flags, buffer);
 		pack16(build_ptr->disable_root_jobs, buffer);
-		pack16(dynalloc_port, buffer);
 
+		pack16(build_ptr->eio_timeout, buffer);
 		pack16(build_ptr->enforce_part_limits, buffer);
 		packstr(build_ptr->epilog, buffer);
 		pack32(build_ptr->epilog_msg_time, buffer);
@@ -6890,6 +7227,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->kill_on_bad_exit, buffer);
 		pack16(build_ptr->kill_wait, buffer);
 
+		packstr(build_ptr->launch_params, buffer);
 		packstr(build_ptr->launch_type, buffer);
 		packstr(build_ptr->layouts, buffer);
 		packstr(build_ptr->licenses, buffer);
@@ -6903,9 +7241,10 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack32(build_ptr->max_step_cnt, buffer);
 		pack16(build_ptr->max_tasks_per_node, buffer);
 		pack16(build_ptr->mem_limit_enforce, buffer);
-		pack16((uint16_t)build_ptr->min_job_age, buffer);
+		pack32(build_ptr->min_job_age, buffer);
 		packstr(build_ptr->mpi_default, buffer);
 		packstr(build_ptr->mpi_params, buffer);
+		packstr(build_ptr->msg_aggr_params, buffer);
 		pack16(build_ptr->msg_timeout, buffer);
 
 		pack32(build_ptr->next_job_id, buffer);
@@ -6915,6 +7254,8 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 
 		packstr(build_ptr->plugindir, buffer);
 		packstr(build_ptr->plugstack, buffer);
+		packstr(build_ptr->power_parameters, buffer);
+		packstr(build_ptr->power_plugin, buffer);
 		pack16(build_ptr->preempt_mode, buffer);
 		packstr(build_ptr->preempt_type, buffer);
 
@@ -6931,10 +7272,12 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack32(build_ptr->priority_weight_js, buffer);
 		pack32(build_ptr->priority_weight_part, buffer);
 		pack32(build_ptr->priority_weight_qos, buffer);
+		packstr(build_ptr->priority_weight_tres, buffer);
 
 		pack16(build_ptr->private_data, buffer);
 		packstr(build_ptr->proctrack_type, buffer);
 		packstr(build_ptr->prolog, buffer);
+		pack16(build_ptr->prolog_epilog_timeout, buffer);
 		packstr(build_ptr->prolog_slurmctld, buffer);
 		pack16(build_ptr->prolog_flags, buffer);
 		pack16(build_ptr->propagate_prio_process, buffer);
@@ -7019,8 +7362,9 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->task_epilog, buffer);
 		packstr(build_ptr->task_prolog, buffer);
 		packstr(build_ptr->task_plugin, buffer);
-		pack16(build_ptr->task_plugin_param, buffer);
+		pack32(build_ptr->task_plugin_param, buffer);
 		packstr(build_ptr->tmp_fs, buffer);
+		packstr(build_ptr->topology_param, buffer);
 		packstr(build_ptr->topology_plugin, buffer);
 		pack16(build_ptr->track_wckey, buffer);
 		pack16(build_ptr->tree_width, buffer);
@@ -7036,7 +7380,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->z_16, buffer);
 		pack32(build_ptr->z_32, buffer);
 		packstr(build_ptr->z_char, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint16_t dynalloc_port = 0;
 		pack_time(build_ptr->last_update, buffer);
 
@@ -7080,15 +7424,17 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack_time(build_ptr->boot_time, buffer);
 
 		packstr(build_ptr->checkpoint_type, buffer);
+		packstr(build_ptr->chos_loc, buffer);
 		packstr(build_ptr->cluster_name, buffer);
 		pack16(build_ptr->complete_wait, buffer);
 		packstr(build_ptr->control_addr, buffer);
 		packstr(build_ptr->control_machine, buffer);
 		packstr(build_ptr->core_spec_plugin, buffer);
+		pack32(build_ptr->cpu_freq_def, buffer);
 		packstr(build_ptr->crypto_type, buffer);
 
 		pack32(build_ptr->def_mem_per_cpu, buffer);
-		pack32((uint32_t)build_ptr->debug_flags, buffer);
+		pack64(build_ptr->debug_flags, buffer);
 		pack16(build_ptr->disable_root_jobs, buffer);
 		pack16(dynalloc_port, buffer);
 
@@ -7156,6 +7502,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->kill_wait, buffer);
 
 		packstr(build_ptr->launch_type, buffer);
+		packstr(build_ptr->layouts, buffer);
 		packstr(build_ptr->licenses, buffer);
 		packstr(build_ptr->licenses_used, buffer);
 
@@ -7166,6 +7513,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack32(build_ptr->max_mem_per_cpu, buffer);
 		pack32(build_ptr->max_step_cnt, buffer);
 		pack16(build_ptr->max_tasks_per_node, buffer);
+		pack16(build_ptr->mem_limit_enforce, buffer);
 		pack16((uint16_t)build_ptr->min_job_age, buffer);
 		packstr(build_ptr->mpi_default, buffer);
 		packstr(build_ptr->mpi_params, buffer);
@@ -7186,6 +7534,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->priority_favor_small, buffer);
 		pack16(build_ptr->priority_flags, buffer);
 		pack32(build_ptr->priority_max_age, buffer);
+		packstr(build_ptr->priority_params, buffer);
 		pack16(build_ptr->priority_reset_period, buffer);
 		packstr(build_ptr->priority_type, buffer);
 		pack32(build_ptr->priority_weight_age, buffer);
@@ -7205,6 +7554,8 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 
 		packstr(build_ptr->reboot_program, buffer);
 		pack16(build_ptr->reconfig_flags, buffer);
+		packstr(build_ptr->requeue_exit, buffer);
+		packstr(build_ptr->requeue_exit_hold, buffer);
 		packstr(build_ptr->resume_program, buffer);
 		pack16(build_ptr->resume_rate, buffer);
 		pack16(build_ptr->resume_timeout, buffer);
@@ -7213,6 +7564,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->resv_prolog, buffer);
 		pack16(build_ptr->ret2service, buffer);
 
+		packstr(build_ptr->route_plugin, buffer);
 		packstr(build_ptr->salloc_default_command, buffer);
 		packstr(build_ptr->sched_params, buffer);
 		pack16(build_ptr->schedport, buffer);
@@ -7263,6 +7615,8 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		packstr(build_ptr->slurmd_spooldir, buffer);
 		pack16(build_ptr->slurmd_timeout, buffer);
 		packstr(build_ptr->srun_epilog, buffer);
+		pack16(build_ptr->srun_port_range[0], buffer);
+		pack16(build_ptr->srun_port_range[1], buffer);
 		packstr(build_ptr->srun_prolog, buffer);
 		packstr(build_ptr->state_save_location, buffer);
 		packstr(build_ptr->suspend_exc_nodes, buffer);
@@ -7283,6 +7637,7 @@ _pack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t * build_ptr, Buf buffer,
 		pack16(build_ptr->tree_width, buffer);
 
 		pack16(build_ptr->use_pam, buffer);
+		pack16(build_ptr->use_spec_resources, buffer);
 		packstr(build_ptr->unkillable_program, buffer);
 		pack16(build_ptr->unkillable_timeout, buffer);
 		packstr(build_ptr->version, buffer);
@@ -7315,8 +7670,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 	build_ptr->hash_val = NO_VAL;
 
 	/* load the data values */
-
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&build_ptr->last_update, buffer);
 
@@ -7500,6 +7854,10 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->max_mem_per_cpu, buffer);
 		safe_unpack32(&build_ptr->max_step_cnt, buffer);
 		safe_unpack16(&build_ptr->max_tasks_per_node, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->mcs_plugin,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->mcs_plugin_params,
+				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->mem_limit_enforce, buffer);
 		safe_unpack32(&build_ptr->min_job_age, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->mpi_default,
@@ -7511,6 +7869,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack16(&build_ptr->msg_timeout, buffer);
 
 		safe_unpack32(&build_ptr->next_job_id, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->node_features_plugins,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->node_prefix,
 				       &uint32_tmp, buffer);
 
@@ -7680,6 +8040,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpackstr_xmalloc(&build_ptr->task_plugin,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&build_ptr->task_plugin_param, buffer);
+		safe_unpack16(&build_ptr->tcp_timeout, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->tmp_fs, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&build_ptr->topology_param,
@@ -7704,8 +8065,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->z_32, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp,
 				       buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		uint16_t dynalloc_port = 0;
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&build_ptr->last_update, buffer);
 
@@ -7718,6 +8078,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpackstr_xmalloc(&build_ptr->accounting_storage_loc,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&build_ptr->accounting_storage_port, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->accounting_storage_tres,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->accounting_storage_type,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->accounting_storage_user,
@@ -7729,7 +8091,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 			List tmp_list = list_create(destroy_config_key_pair);
 			config_key_pair_t *object = NULL;
 			int i;
-			for (i=0; i<count; i++) {
+			for (i = 0; i < count; i++) {
 				if (unpack_config_key_pair(
 					    (void *)&object, protocol_version,
 					    buffer)
@@ -7761,6 +8123,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->batch_start_timeout, buffer);
 		safe_unpack_time(&build_ptr->boot_time, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->bb_type,
+				       &uint32_tmp, buffer);
 
 		safe_unpackstr_xmalloc(&build_ptr->checkpoint_type,
 				       &uint32_tmp, buffer);
@@ -7776,14 +8140,15 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpackstr_xmalloc(&build_ptr->core_spec_plugin,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&build_ptr->cpu_freq_def, buffer);
+		safe_unpack32(&build_ptr->cpu_freq_govs, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->crypto_type, &uint32_tmp,
 				       buffer);
 
 		safe_unpack32(&build_ptr->def_mem_per_cpu, buffer);
 		safe_unpack64(&build_ptr->debug_flags, buffer);
 		safe_unpack16(&build_ptr->disable_root_jobs, buffer);
-		safe_unpack16(&dynalloc_port, buffer);
 
+		safe_unpack16(&build_ptr->eio_timeout, buffer);
 		safe_unpack16(&build_ptr->enforce_part_limits, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->epilog, &uint32_tmp,
 				       buffer);
@@ -7796,7 +8161,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 			List tmp_list = list_create(destroy_config_key_pair);
 			config_key_pair_t *object = NULL;
 			int i;
-			for (i=0; i<count; i++) {
+			for (i = 0; i < count; i++) {
 				if (unpack_config_key_pair(
 					    (void *)&object, protocol_version,
 					    buffer)
@@ -7865,6 +8230,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack16(&build_ptr->kill_on_bad_exit, buffer);
 		safe_unpack16(&build_ptr->kill_wait, buffer);
 
+		safe_unpackstr_xmalloc(&build_ptr->launch_params,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->launch_type,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->layouts,
@@ -7883,11 +8250,13 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->max_step_cnt, buffer);
 		safe_unpack16(&build_ptr->max_tasks_per_node, buffer);
 		safe_unpack16(&build_ptr->mem_limit_enforce, buffer);
-		safe_unpack16((uint16_t *)&build_ptr->min_job_age, buffer);
+		safe_unpack32(&build_ptr->min_job_age, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->mpi_default,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->mpi_params,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->msg_aggr_params,
+				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->msg_timeout, buffer);
 
 		safe_unpack32(&build_ptr->next_job_id, buffer);
@@ -7900,10 +8269,15 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->plugstack,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->power_parameters,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->power_plugin,
+				       &uint32_tmp, buffer);
 
 		safe_unpack16(&build_ptr->preempt_mode, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->preempt_type,
 				       &uint32_tmp, buffer);
+
 		safe_unpack32(&build_ptr->priority_decay_hl, buffer);
 		safe_unpack32(&build_ptr->priority_calc_period, buffer);
 		safe_unpack16(&build_ptr->priority_favor_small, buffer);
@@ -7919,12 +8293,15 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->priority_weight_js, buffer);
 		safe_unpack32(&build_ptr->priority_weight_part, buffer);
 		safe_unpack32(&build_ptr->priority_weight_qos, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->priority_weight_tres,
+				       &uint32_tmp, buffer);
 
 		safe_unpack16(&build_ptr->private_data, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->proctrack_type, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&build_ptr->prolog, &uint32_tmp,
 				       buffer);
+		safe_unpack16(&build_ptr->prolog_epilog_timeout, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->prolog_slurmctld,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->prolog_flags, buffer);
@@ -7975,7 +8352,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 			List tmp_list = list_create(destroy_config_key_pair);
 			config_key_pair_t *object = NULL;
 			int i;
-			for (i=0; i<count; i++) {
+			for (i = 0; i < count; i++) {
 				if (unpack_config_key_pair(
 					    (void *)&object, protocol_version,
 					    buffer)
@@ -8051,9 +8428,11 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->task_plugin,
 				       &uint32_tmp, buffer);
-		safe_unpack16((uint16_t *)&build_ptr->task_plugin_param, buffer);
+		safe_unpack32(&build_ptr->task_plugin_param, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->tmp_fs, &uint32_tmp,
 				       buffer);
+		safe_unpackstr_xmalloc(&build_ptr->topology_param,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->topology_plugin,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->track_wckey, buffer);
@@ -8074,7 +8453,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->z_32, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->z_char, &uint32_tmp,
 				       buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint16_t dynalloc_port = 0;
 		/* unpack timestamp of snapshot */
 		safe_unpack_time(&build_ptr->last_update, buffer);
@@ -8134,6 +8513,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 
 		safe_unpackstr_xmalloc(&build_ptr->checkpoint_type,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->chos_loc,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->cluster_name,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->complete_wait, buffer);
@@ -8143,12 +8524,12 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp,buffer);
 		safe_unpackstr_xmalloc(&build_ptr->core_spec_plugin,
 				       &uint32_tmp, buffer);
+		safe_unpack32(&build_ptr->cpu_freq_def, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->crypto_type, &uint32_tmp,
 				       buffer);
 
 		safe_unpack32(&build_ptr->def_mem_per_cpu, buffer);
-		safe_unpack32(&uint32_tmp, buffer);
-		build_ptr->debug_flags = (uint64_t)uint32_tmp;
+		safe_unpack64(&build_ptr->debug_flags, buffer);
 		safe_unpack16(&build_ptr->disable_root_jobs, buffer);
 		safe_unpack16(&dynalloc_port, buffer);
 
@@ -8235,6 +8616,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 
 		safe_unpackstr_xmalloc(&build_ptr->launch_type,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->layouts,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->licenses,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->licenses_used,
@@ -8248,6 +8631,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack32(&build_ptr->max_mem_per_cpu, buffer);
 		safe_unpack32(&build_ptr->max_step_cnt, buffer);
 		safe_unpack16(&build_ptr->max_tasks_per_node, buffer);
+		safe_unpack16(&build_ptr->mem_limit_enforce, buffer);
 		safe_unpack16((uint16_t *)&build_ptr->min_job_age, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->mpi_default,
 				       &uint32_tmp, buffer);
@@ -8265,15 +8649,17 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->plugstack,
 				       &uint32_tmp, buffer);
+
 		safe_unpack16(&build_ptr->preempt_mode, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->preempt_type,
 				       &uint32_tmp, buffer);
-
 		safe_unpack32(&build_ptr->priority_decay_hl, buffer);
 		safe_unpack32(&build_ptr->priority_calc_period, buffer);
 		safe_unpack16(&build_ptr->priority_favor_small, buffer);
 		safe_unpack16(&build_ptr->priority_flags, buffer);
 		safe_unpack32(&build_ptr->priority_max_age, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->priority_params, &uint32_tmp,
+				       buffer);
 		safe_unpack16(&build_ptr->priority_reset_period, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->priority_type, &uint32_tmp,
 				       buffer);
@@ -8300,6 +8686,12 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpackstr_xmalloc(&build_ptr->reboot_program, &uint32_tmp,
 				       buffer);
 		safe_unpack16(&build_ptr->reconfig_flags, buffer);
+
+		safe_unpackstr_xmalloc(&build_ptr->requeue_exit,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&build_ptr->requeue_exit_hold,
+				       &uint32_tmp, buffer);
+
 		safe_unpackstr_xmalloc(&build_ptr->resume_program,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->resume_rate, buffer);
@@ -8311,6 +8703,8 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       buffer);
 		safe_unpack16(&build_ptr->ret2service, buffer);
 
+		safe_unpackstr_xmalloc(&build_ptr->route_plugin,
+				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->salloc_default_command,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->sched_params,
@@ -8379,6 +8773,11 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 
 		safe_unpackstr_xmalloc(&build_ptr->srun_epilog,
 				       &uint32_tmp, buffer);
+
+		build_ptr->srun_port_range = xmalloc(2 * sizeof(uint16_t));
+		safe_unpack16(&build_ptr->srun_port_range[0], buffer);
+		safe_unpack16(&build_ptr->srun_port_range[1], buffer);
+
 		safe_unpackstr_xmalloc(&build_ptr->srun_prolog,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->state_save_location,
@@ -8401,8 +8800,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->task_plugin,
 				       &uint32_tmp, buffer);
-		safe_unpack16((uint16_t *)&build_ptr->task_plugin_param,
-			      buffer);
+		safe_unpack16((uint16_t *)&build_ptr->task_plugin_param, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->tmp_fs, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&build_ptr->topology_plugin,
@@ -8411,6 +8809,7 @@ _unpack_slurm_ctl_conf_msg(slurm_ctl_conf_info_msg_t **build_buffer_ptr,
 		safe_unpack16(&build_ptr->tree_width, buffer);
 
 		safe_unpack16(&build_ptr->use_pam, buffer);
+		safe_unpack16(&build_ptr->use_spec_resources, buffer);
 		safe_unpackstr_xmalloc(&build_ptr->unkillable_program,
 				       &uint32_tmp, buffer);
 		safe_unpack16(&build_ptr->unkillable_timeout, buffer);
@@ -8447,8 +8846,10 @@ static void
 _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		   uint16_t protocol_version)
 {
+	uint8_t uint8_tmp = 0;
+
 	/* load the data values */
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		packstr(job_desc_ptr->clusters, buffer);
 		pack16(job_desc_ptr->contiguous, buffer);
 		pack16(job_desc_ptr->core_spec, buffer);
@@ -8478,9 +8879,10 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->dependency, buffer);
 		packstr(job_desc_ptr->account, buffer);
 		packstr(job_desc_ptr->comment, buffer);
-		pack16(job_desc_ptr->nice, buffer);
+		pack32(job_desc_ptr->nice, buffer);
 		pack32(job_desc_ptr->profile, buffer);
 		packstr(job_desc_ptr->qos, buffer);
+		packstr(job_desc_ptr->mcs_label, buffer);
 
 		pack8(job_desc_ptr->open_mode,   buffer);
 		pack8(job_desc_ptr->overcommit,  buffer);
@@ -8497,7 +8899,6 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->script, buffer);
 		packstr_array(job_desc_ptr->argv, job_desc_ptr->argc, buffer);
 
-		pack8(job_desc_ptr->sicp_mode,   buffer);
 		packstr(job_desc_ptr->std_err, buffer);
 		packstr(job_desc_ptr->std_in, buffer);
 		packstr(job_desc_ptr->std_out, buffer);
@@ -8539,6 +8940,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->network, buffer);
 		pack_time(job_desc_ptr->begin_time, buffer);
 		pack_time(job_desc_ptr->end_time, buffer);
+		pack_time(job_desc_ptr->deadline, buffer);
 
 		packstr(job_desc_ptr->licenses, buffer);
 		pack16(job_desc_ptr->mail_type, buffer);
@@ -8609,12 +9011,11 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		}
 		pack16(job_desc_ptr->wait_all_nodes, buffer);
 		pack32(job_desc_ptr->bitflags, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		uint16_t old_task_dist;
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		packstr(job_desc_ptr->clusters, buffer);
 		pack16(job_desc_ptr->contiguous, buffer);
 		pack16(job_desc_ptr->core_spec, buffer);
-		old_task_dist = task_dist_new2old(job_desc_ptr->task_dist);
-		pack16(old_task_dist, buffer);
+		pack32(job_desc_ptr->task_dist, buffer);
 		pack16(job_desc_ptr->kill_on_node_fail, buffer);
 		packstr(job_desc_ptr->features, buffer);
 		packstr(job_desc_ptr->gres, buffer);
@@ -8625,16 +9026,22 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->alloc_node, buffer);
 		pack32(job_desc_ptr->alloc_sid, buffer);
 		packstr(job_desc_ptr->array_inx, buffer);
+		packstr(job_desc_ptr->burst_buffer, buffer);
 		pack16(job_desc_ptr->pn_min_cpus, buffer);
 		pack32(job_desc_ptr->pn_min_memory, buffer);
 		pack32(job_desc_ptr->pn_min_tmp_disk, buffer);
+		pack8(job_desc_ptr->power_flags, buffer);
+
+		pack32(job_desc_ptr->cpu_freq_min, buffer);
+		pack32(job_desc_ptr->cpu_freq_max, buffer);
+		pack32(job_desc_ptr->cpu_freq_gov, buffer);
 
 		packstr(job_desc_ptr->partition, buffer);
 		pack32(job_desc_ptr->priority, buffer);
 		packstr(job_desc_ptr->dependency, buffer);
 		packstr(job_desc_ptr->account, buffer);
 		packstr(job_desc_ptr->comment, buffer);
-		pack16(job_desc_ptr->nice, buffer);
+		pack16(xlate_nice_new2old(job_desc_ptr->nice), buffer);
 		pack32(job_desc_ptr->profile, buffer);
 		packstr(job_desc_ptr->qos, buffer);
 
@@ -8653,6 +9060,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->script, buffer);
 		packstr_array(job_desc_ptr->argv, job_desc_ptr->argc, buffer);
 
+		pack8(uint8_tmp, buffer);	/* DEFUNCT */
 		packstr(job_desc_ptr->std_err, buffer);
 		packstr(job_desc_ptr->std_in, buffer);
 		packstr(job_desc_ptr->std_out, buffer);
@@ -8763,7 +9171,8 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 			job_desc_ptr->select_jobinfo = NULL;
 		}
 		pack16(job_desc_ptr->wait_all_nodes, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		pack32(job_desc_ptr->bitflags, buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint16_t old_task_dist;
 		pack16(job_desc_ptr->contiguous, buffer);
 		pack16(job_desc_ptr->core_spec, buffer);
@@ -8773,6 +9182,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->features, buffer);
 		packstr(job_desc_ptr->gres, buffer);
 		pack32(job_desc_ptr->job_id, buffer);
+		packstr(job_desc_ptr->job_id_str, buffer);
 		packstr(job_desc_ptr->name, buffer);
 
 		packstr(job_desc_ptr->alloc_node, buffer);
@@ -8787,7 +9197,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->dependency, buffer);
 		packstr(job_desc_ptr->account, buffer);
 		packstr(job_desc_ptr->comment, buffer);
-		pack16(job_desc_ptr->nice, buffer);
+		pack16(xlate_nice_new2old(job_desc_ptr->nice), buffer);
 		pack32(job_desc_ptr->profile, buffer);
 		packstr(job_desc_ptr->qos, buffer);
 
@@ -8813,6 +9223,7 @@ _pack_job_desc_msg(job_desc_msg_t * job_desc_ptr, Buf buffer,
 		packstr(job_desc_ptr->ckpt_dir, buffer);
 
 		pack16(job_desc_ptr->immediate, buffer);
+		pack16(job_desc_ptr->reboot, buffer);
 		pack16(job_desc_ptr->requeue, buffer);
 		pack16(job_desc_ptr->shared, buffer);
 		pack16(job_desc_ptr->cpus_per_task, buffer);
@@ -8932,10 +9343,11 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		     uint16_t protocol_version)
 {
 	uint32_t uint32_tmp;
+	uint8_t uint8_tmp;
 	job_desc_msg_t *job_desc_ptr = NULL;
 
 	/* alloc memory for structure */
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		job_desc_ptr = xmalloc(sizeof(job_desc_msg_t));
 		*job_desc_buffer_ptr = job_desc_ptr;
 
@@ -8981,10 +9393,12 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->comment,
 				       &uint32_tmp, buffer);
-		safe_unpack16(&job_desc_ptr->nice, buffer);
+		safe_unpack32(&job_desc_ptr->nice, buffer);
 		safe_unpack32(&job_desc_ptr->profile, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->qos, &uint32_tmp,
 				       buffer);
+		safe_unpackstr_xmalloc(&job_desc_ptr->mcs_label, &uint32_tmp,
+					buffer);
 
 		safe_unpack8(&job_desc_ptr->open_mode,   buffer);
 		safe_unpack8(&job_desc_ptr->overcommit,  buffer);
@@ -9007,7 +9421,6 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		safe_unpackstr_array(&job_desc_ptr->argv,
 				     &job_desc_ptr->argc, buffer);
 
-		safe_unpack8(&job_desc_ptr->sicp_mode,   buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->std_err,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->std_in,
@@ -9057,6 +9470,7 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpack_time(&job_desc_ptr->begin_time, buffer);
 		safe_unpack_time(&job_desc_ptr->end_time, buffer);
+		safe_unpack_time(&job_desc_ptr->deadline, buffer);
 
 		safe_unpackstr_xmalloc(&job_desc_ptr->licenses,
 				       &uint32_tmp, buffer);
@@ -9090,16 +9504,17 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		job_desc_ptr->ramdiskimage = NULL;
 		safe_unpack16(&job_desc_ptr->wait_all_nodes, buffer);
 		safe_unpack32(&job_desc_ptr->bitflags, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
-		uint16_t old_task_dist = 0;
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		job_desc_ptr = xmalloc(sizeof(job_desc_msg_t));
 		*job_desc_buffer_ptr = job_desc_ptr;
 
 		/* load the data values */
+		safe_unpackstr_xmalloc(&job_desc_ptr->clusters,
+				       &uint32_tmp, buffer);
 		safe_unpack16(&job_desc_ptr->contiguous, buffer);
 		safe_unpack16(&job_desc_ptr->core_spec, buffer);
-		safe_unpack16(&old_task_dist, buffer);
-		job_desc_ptr->task_dist = task_dist_old2new(old_task_dist);
+		safe_unpack32(&job_desc_ptr->task_dist, buffer);
 		safe_unpack16(&job_desc_ptr->kill_on_node_fail, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->features,
 				       &uint32_tmp, buffer);
@@ -9116,9 +9531,16 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		safe_unpack32(&job_desc_ptr->alloc_sid, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->array_inx,
 				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&job_desc_ptr->burst_buffer,
+				       &uint32_tmp, buffer);
 		safe_unpack16(&job_desc_ptr->pn_min_cpus, buffer);
 		safe_unpack32(&job_desc_ptr->pn_min_memory, buffer);
 		safe_unpack32(&job_desc_ptr->pn_min_tmp_disk, buffer);
+		safe_unpack8(&job_desc_ptr->power_flags,   buffer);
+
+		safe_unpack32(&job_desc_ptr->cpu_freq_min, buffer);
+		safe_unpack32(&job_desc_ptr->cpu_freq_max, buffer);
+		safe_unpack32(&job_desc_ptr->cpu_freq_gov, buffer);
 
 		safe_unpackstr_xmalloc(&job_desc_ptr->partition,
 				       &uint32_tmp, buffer);
@@ -9129,7 +9551,8 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->comment,
 				       &uint32_tmp, buffer);
-		safe_unpack16(&job_desc_ptr->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		job_desc_ptr->nice = xlate_nice_old2new(old_nice);
 		safe_unpack32(&job_desc_ptr->profile, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->qos, &uint32_tmp,
 				       buffer);
@@ -9155,6 +9578,7 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		safe_unpackstr_array(&job_desc_ptr->argv,
 				     &job_desc_ptr->argc, buffer);
 
+		safe_unpack8(&uint8_tmp, buffer);	/* DEFUNCT */
 		safe_unpackstr_xmalloc(&job_desc_ptr->std_err,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->std_in,
@@ -9236,7 +9660,9 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		job_desc_ptr->mloaderimage = NULL;
 		job_desc_ptr->ramdiskimage = NULL;
 		safe_unpack16(&job_desc_ptr->wait_all_nodes, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		safe_unpack32(&job_desc_ptr->bitflags, buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		uint16_t old_task_dist = 0;
 		job_desc_ptr = xmalloc(sizeof(job_desc_msg_t));
 		*job_desc_buffer_ptr = job_desc_ptr;
@@ -9251,6 +9677,9 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->gres, &uint32_tmp,buffer);
 		safe_unpack32(&job_desc_ptr->job_id, buffer);
+		safe_unpackstr_xmalloc(&job_desc_ptr->job_id_str,
+				       &uint32_tmp,
+				       buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->name,
 				       &uint32_tmp, buffer);
 
@@ -9272,7 +9701,8 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->comment,
 				       &uint32_tmp, buffer);
-		safe_unpack16(&job_desc_ptr->nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		job_desc_ptr->nice = xlate_nice_old2new(old_nice);
 		safe_unpack32(&job_desc_ptr->profile, buffer);
 		safe_unpackstr_xmalloc(&job_desc_ptr->qos, &uint32_tmp,
 				       buffer);
@@ -9310,6 +9740,7 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 				       &uint32_tmp, buffer);
 
 		safe_unpack16(&job_desc_ptr->immediate, buffer);
+		safe_unpack16(&job_desc_ptr->reboot, buffer);
 		safe_unpack16(&job_desc_ptr->requeue, buffer);
 		safe_unpack16(&job_desc_ptr->shared, buffer);
 		safe_unpack16(&job_desc_ptr->cpus_per_task, buffer);
@@ -9372,7 +9803,6 @@ _unpack_job_desc_msg(job_desc_msg_t ** job_desc_buffer_ptr, Buf buffer,
 		 */
 		job_desc_ptr->geometry[0] = (uint16_t)NO_VAL;
 		job_desc_ptr->conn_type[0] = (uint16_t)NO_VAL;
-		job_desc_ptr->reboot = (uint16_t)NO_VAL;
 		job_desc_ptr->rotate = (uint16_t)NO_VAL;
 		job_desc_ptr->blrtsimage = NULL;
 		job_desc_ptr->linuximage = NULL;
@@ -9757,7 +10187,90 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer,
 
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack32(msg->job_id, buffer);
+		pack32(msg->job_step_id, buffer);
+		pack32(msg->ntasks, buffer);
+		pack16(msg->ntasks_per_board, buffer);
+		pack16(msg->ntasks_per_core, buffer);
+		pack16(msg->ntasks_per_socket, buffer);
+		pack32(msg->uid, buffer);
+		packstr(msg->partition, buffer);
+		packstr(msg->user_name, buffer);
+		pack32(msg->gid, buffer);
+		pack32(msg->job_mem_lim, buffer);
+		pack32(msg->step_mem_lim, buffer);
+
+		pack32(msg->nnodes, buffer);
+		pack16(msg->cpus_per_task, buffer);
+		pack32(msg->task_dist, buffer);
+		pack16(msg->node_cpus, buffer);
+		pack16(msg->job_core_spec, buffer);
+		pack16(msg->accel_bind_type, buffer);
+
+		slurm_cred_pack(msg->cred, buffer, protocol_version);
+		for (i = 0; i < msg->nnodes; i++) {
+			pack16(msg->tasks_to_launch[i], buffer);
+			pack32_array(msg->global_task_ids[i],
+				     (uint32_t) msg->tasks_to_launch[i],
+				     buffer);
+		}
+		pack16(msg->num_resp_port, buffer);
+		for (i = 0; i < msg->num_resp_port; i++)
+			pack16(msg->resp_port[i], buffer);
+		slurm_pack_slurm_addr(&msg->orig_addr, buffer);
+		packstr_array(msg->env, msg->envc, buffer);
+		packstr_array(msg->spank_job_env, msg->spank_job_env_size,
+			      buffer);
+		packstr(msg->cwd, buffer);
+		pack16(msg->cpu_bind_type, buffer);
+		packstr(msg->cpu_bind, buffer);
+		pack16(msg->mem_bind_type, buffer);
+		packstr(msg->mem_bind, buffer);
+		packstr_array(msg->argv, msg->argc, buffer);
+		pack16(msg->task_flags, buffer);
+		pack16(msg->multi_prog, buffer);
+		pack16(msg->user_managed_io, buffer);
+		if (msg->user_managed_io == 0) {
+			packstr(msg->ofname, buffer);
+			packstr(msg->efname, buffer);
+			packstr(msg->ifname, buffer);
+			pack8(msg->buffered_stdio, buffer);
+			pack8(msg->labelio, buffer);
+			pack16(msg->num_io_port, buffer);
+			for (i = 0; i < msg->num_io_port; i++)
+				pack16(msg->io_port[i], buffer);
+		}
+		pack32(msg->profile, buffer);
+		packstr(msg->task_prolog, buffer);
+		packstr(msg->task_epilog, buffer);
+		pack16(msg->slurmd_debug, buffer);
+		switch_g_pack_jobinfo(msg->switch_job, buffer,
+				      protocol_version);
+		job_options_pack(msg->options, buffer);
+		packstr(msg->alias_list, buffer);
+		packstr(msg->complete_nodelist, buffer);
+
+		pack8(msg->open_mode, buffer);
+		pack8(msg->pty, buffer);
+		packstr(msg->acctg_freq, buffer);
+		pack32(msg->cpu_freq_min, buffer);
+		pack32(msg->cpu_freq_max, buffer);
+		pack32(msg->cpu_freq_gov, buffer);
+		packstr(msg->ckpt_dir, buffer);
+		packstr(msg->restart_dir, buffer);
+		if (!(cluster_flags & CLUSTER_FLAG_BG)) {
+			/* If on a Blue Gene cluster do not send this to the
+			 * slurmstepd, it will overwrite the environment that
+			 * ia already set up correctly for both the job and the
+			 * step. The slurmstep treats this select_jobinfo as if
+			 * were for the job  instead of for the step.
+			 */
+			select_g_select_jobinfo_pack(msg->select_jobinfo,
+						     buffer,
+						     protocol_version);
+		}
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack32(msg->job_id, buffer);
 		pack32(msg->job_step_id, buffer);
 		pack32(msg->ntasks, buffer);
@@ -9837,7 +10350,7 @@ _pack_launch_tasks_request_msg(launch_tasks_request_msg_t * msg, Buf buffer,
 						     buffer,
 						     protocol_version);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint16_t old_task_dist;
 		pack32(msg->job_id, buffer);
 		pack32(msg->job_step_id, buffer);
@@ -9936,10 +10449,13 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 	msg = xmalloc(sizeof(launch_tasks_request_msg_t));
 	*msg_ptr = msg;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpack32(&msg->job_id, buffer);
 		safe_unpack32(&msg->job_step_id, buffer);
 		safe_unpack32(&msg->ntasks, buffer);
+		safe_unpack16(&msg->ntasks_per_board, buffer);
+		safe_unpack16(&msg->ntasks_per_core, buffer);
+		safe_unpack16(&msg->ntasks_per_socket, buffer);
 		safe_unpack32(&msg->uid, buffer);
 		safe_unpackstr_xmalloc(&msg->partition, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&msg->user_name, &uint32_tmp, buffer);
@@ -10040,8 +10556,11 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 						       buffer,
 						       protocol_version);
 		}
-	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		uint16_t old_task_dist = 0;
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		msg->ntasks_per_board = (uint16_t)NO_VAL;
+		msg->ntasks_per_core = (uint16_t)NO_VAL;
+		msg->ntasks_per_socket = (uint16_t)NO_VAL;
+
 		safe_unpack32(&msg->job_id, buffer);
 		safe_unpack32(&msg->job_step_id, buffer);
 		safe_unpack32(&msg->ntasks, buffer);
@@ -10054,10 +10573,10 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 
 		safe_unpack32(&msg->nnodes, buffer);
 		safe_unpack16(&msg->cpus_per_task, buffer);
-		safe_unpack16(&old_task_dist, buffer);
-		msg->task_dist = task_dist_old2new(old_task_dist);
+		safe_unpack32(&msg->task_dist, buffer);
 		safe_unpack16(&msg->node_cpus, buffer);
 		safe_unpack16(&msg->job_core_spec, buffer);
+		safe_unpack16(&msg->accel_bind_type, buffer);
 
 		if (!(msg->cred = slurm_cred_unpack(buffer, protocol_version)))
 			goto unpack_error;
@@ -10135,7 +10654,9 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 		safe_unpack8(&msg->open_mode, buffer);
 		safe_unpack8(&msg->pty, buffer);
 		safe_unpackstr_xmalloc(&msg->acctg_freq, &uint32_tmp, buffer);
+		safe_unpack32(&msg->cpu_freq_min, buffer);
 		safe_unpack32(&msg->cpu_freq_max, buffer);
+		safe_unpack32(&msg->cpu_freq_gov, buffer);
 		safe_unpackstr_xmalloc(&msg->ckpt_dir, &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&msg->restart_dir, &uint32_tmp, buffer);
 		if (!(cluster_flags & CLUSTER_FLAG_BG)) {
@@ -10143,59 +10664,167 @@ _unpack_launch_tasks_request_msg(launch_tasks_request_msg_t **
 						       buffer,
 						       protocol_version);
 		}
-	} else {
-		error("_unpack_launch_tasks_request_msg: protocol_version "
-		      "%hu not supported", protocol_version);
-		goto unpack_error;
-	}
-	return SLURM_SUCCESS;
-
-unpack_error:
-	slurm_free_launch_tasks_request_msg(msg);
-	*msg_ptr = NULL;
-	return SLURM_ERROR;
-}
-
-static void
-_pack_task_user_managed_io_stream_msg(task_user_managed_io_msg_t * msg,
-				      Buf buffer,
-				      uint16_t protocol_version)
-{
-	xassert(msg != NULL);
-	pack32(msg->task_id, buffer);
-}
-
-static int
-_unpack_task_user_managed_io_stream_msg(task_user_managed_io_msg_t **msg_ptr,
-					Buf buffer,
-					uint16_t protocol_version)
-{
-	task_user_managed_io_msg_t *msg;
-
-	xassert(msg_ptr != NULL);
-	msg = xmalloc(sizeof(task_user_managed_io_msg_t));
-	*msg_ptr = msg;
+	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		uint16_t old_task_dist = 0;
 
-	safe_unpack32(&msg->task_id, buffer);
+		msg->ntasks_per_board = (uint16_t)NO_VAL;
+		msg->ntasks_per_core = (uint16_t)NO_VAL;
+		msg->ntasks_per_socket = (uint16_t)NO_VAL;
 
-	return SLURM_SUCCESS;
+		safe_unpack32(&msg->job_id, buffer);
+		safe_unpack32(&msg->job_step_id, buffer);
+		safe_unpack32(&msg->ntasks, buffer);
+		safe_unpack32(&msg->uid, buffer);
+		safe_unpackstr_xmalloc(&msg->partition, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&msg->user_name, &uint32_tmp, buffer);
+		safe_unpack32(&msg->gid, buffer);
+		safe_unpack32(&msg->job_mem_lim, buffer);
+		safe_unpack32(&msg->step_mem_lim, buffer);
 
-unpack_error:
-	slurm_free_task_user_managed_io_stream_msg(msg);
-	*msg_ptr = NULL;
-	return SLURM_ERROR;
-}
+		safe_unpack32(&msg->nnodes, buffer);
+		safe_unpack16(&msg->cpus_per_task, buffer);
+		safe_unpack16(&old_task_dist, buffer);
+		msg->task_dist = task_dist_old2new(old_task_dist);
+		safe_unpack16(&msg->node_cpus, buffer);
+		safe_unpack16(&msg->job_core_spec, buffer);
 
-static void
-_pack_cancel_tasks_msg(kill_tasks_msg_t * msg, Buf buffer,
-		       uint16_t protocol_version)
-{
-	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		pack32((uint32_t)msg->job_id, buffer);
-		pack32((uint32_t)msg->job_step_id, buffer);
-		pack32((uint32_t)msg->signal, buffer);
-	} else {
-		error("_pack_cancel_tasks_msg: protocol_version "
+		if (!(msg->cred = slurm_cred_unpack(buffer, protocol_version)))
+			goto unpack_error;
+		msg->tasks_to_launch = xmalloc(sizeof(uint16_t) * msg->nnodes);
+		msg->global_task_ids = xmalloc(sizeof(uint32_t *) *
+					       msg->nnodes);
+		for (i = 0; i < msg->nnodes; i++) {
+			safe_unpack16(&msg->tasks_to_launch[i], buffer);
+			safe_unpack32_array(&msg->global_task_ids[i],
+					    &uint32_tmp,
+					    buffer);
+			if (msg->tasks_to_launch[i] != (uint16_t) uint32_tmp)
+				goto unpack_error;
+		}
+		safe_unpack16(&msg->num_resp_port, buffer);
+		if (msg->num_resp_port > 0) {
+			msg->resp_port = xmalloc(sizeof(uint16_t) *
+						 msg->num_resp_port);
+			for (i = 0; i < msg->num_resp_port; i++)
+				safe_unpack16(&msg->resp_port[i], buffer);
+		}
+		slurm_unpack_slurm_addr_no_alloc(&msg->orig_addr, buffer);
+		safe_unpackstr_array(&msg->env, &msg->envc, buffer);
+		safe_unpackstr_array(&msg->spank_job_env,
+				     &msg->spank_job_env_size, buffer);
+		safe_unpackstr_xmalloc(&msg->cwd, &uint32_tmp, buffer);
+		safe_unpack16(&msg->cpu_bind_type, buffer);
+		safe_unpackstr_xmalloc(&msg->cpu_bind, &uint32_tmp, buffer);
+		safe_unpack16(&msg->mem_bind_type, buffer);
+		safe_unpackstr_xmalloc(&msg->mem_bind, &uint32_tmp, buffer);
+		safe_unpackstr_array(&msg->argv, &msg->argc, buffer);
+		safe_unpack16(&msg->task_flags, buffer);
+		safe_unpack16(&msg->multi_prog, buffer);
+		safe_unpack16(&msg->user_managed_io, buffer);
+		if (msg->user_managed_io == 0) {
+			safe_unpackstr_xmalloc(&msg->ofname, &uint32_tmp,
+					       buffer);
+			safe_unpackstr_xmalloc(&msg->efname, &uint32_tmp,
+					       buffer);
+			safe_unpackstr_xmalloc(&msg->ifname, &uint32_tmp,
+					       buffer);
+			safe_unpack8(&msg->buffered_stdio, buffer);
+			safe_unpack8(&msg->labelio, buffer);
+			safe_unpack16(&msg->num_io_port, buffer);
+			if (msg->num_io_port > 0) {
+				msg->io_port = xmalloc(sizeof(uint16_t) *
+						       msg->num_io_port);
+				for (i = 0; i < msg->num_io_port; i++)
+					safe_unpack16(&msg->io_port[i],
+						      buffer);
+			}
+		}
+		safe_unpack32(&msg->profile, buffer);
+		safe_unpackstr_xmalloc(&msg->task_prolog, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&msg->task_epilog, &uint32_tmp, buffer);
+		safe_unpack16(&msg->slurmd_debug, buffer);
+
+		switch_g_alloc_jobinfo(&msg->switch_job,
+				       msg->job_id, msg->job_step_id);
+		if (switch_g_unpack_jobinfo(msg->switch_job, buffer,
+					    protocol_version) < 0) {
+			error("switch_g_unpack_jobinfo: %m");
+			switch_g_free_jobinfo(msg->switch_job);
+			goto unpack_error;
+		}
+		msg->options = job_options_create();
+		if (job_options_unpack(msg->options, buffer) < 0) {
+			error("Unable to unpack extra job options: %m");
+			goto unpack_error;
+		}
+		safe_unpackstr_xmalloc(&msg->alias_list, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&msg->complete_nodelist, &uint32_tmp,
+				       buffer);
+
+		safe_unpack8(&msg->open_mode, buffer);
+		safe_unpack8(&msg->pty, buffer);
+		safe_unpackstr_xmalloc(&msg->acctg_freq, &uint32_tmp, buffer);
+		safe_unpack32(&msg->cpu_freq_max, buffer);
+		safe_unpackstr_xmalloc(&msg->ckpt_dir, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&msg->restart_dir, &uint32_tmp, buffer);
+		if (!(cluster_flags & CLUSTER_FLAG_BG)) {
+			select_g_select_jobinfo_unpack(&msg->select_jobinfo,
+						       buffer,
+						       protocol_version);
+		}
+	} else {
+		error("_unpack_launch_tasks_request_msg: protocol_version "
+		      "%hu not supported", protocol_version);
+		goto unpack_error;
+	}
+	return SLURM_SUCCESS;
+
+unpack_error:
+	slurm_free_launch_tasks_request_msg(msg);
+	*msg_ptr = NULL;
+	return SLURM_ERROR;
+}
+
+static void
+_pack_task_user_managed_io_stream_msg(task_user_managed_io_msg_t * msg,
+				      Buf buffer,
+				      uint16_t protocol_version)
+{
+	xassert(msg != NULL);
+	pack32(msg->task_id, buffer);
+}
+
+static int
+_unpack_task_user_managed_io_stream_msg(task_user_managed_io_msg_t **msg_ptr,
+					Buf buffer,
+					uint16_t protocol_version)
+{
+	task_user_managed_io_msg_t *msg;
+
+	xassert(msg_ptr != NULL);
+	msg = xmalloc(sizeof(task_user_managed_io_msg_t));
+	*msg_ptr = msg;
+
+	safe_unpack32(&msg->task_id, buffer);
+
+	return SLURM_SUCCESS;
+
+unpack_error:
+	slurm_free_task_user_managed_io_stream_msg(msg);
+	*msg_ptr = NULL;
+	return SLURM_ERROR;
+}
+
+static void
+_pack_cancel_tasks_msg(kill_tasks_msg_t * msg, Buf buffer,
+		       uint16_t protocol_version)
+{
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		pack32((uint32_t)msg->job_id, buffer);
+		pack32((uint32_t)msg->job_step_id, buffer);
+		pack32((uint32_t)msg->signal, buffer);
+	} else {
+		error("_pack_cancel_tasks_msg: protocol_version "
 		      "%hu not supported", protocol_version);
 	}
 }
@@ -10273,10 +10902,20 @@ static void
 _pack_reboot_msg(reboot_msg_t * msg, Buf buffer,
 		 uint16_t protocol_version)
 {
-	if (msg && msg->node_list)
-		packstr(msg->node_list, buffer);
-	else
-		packnull(buffer);
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (msg) {
+			packstr(msg->features, buffer);
+			packstr(msg->node_list, buffer);
+		} else {
+			packnull(buffer);
+			packnull(buffer);
+		}
+	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		if (msg)
+			packstr(msg->node_list, buffer);
+		else
+			packnull(buffer);
+	}
 }
 
 static int
@@ -10289,7 +10928,12 @@ _unpack_reboot_msg(reboot_msg_t ** msg_ptr, Buf buffer,
 	msg = xmalloc(sizeof(reboot_msg_t));
 	*msg_ptr = msg;
 
-	safe_unpackstr_xmalloc(&msg->node_list, &uint32_tmp, buffer);
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&msg->features, &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&msg->node_list, &uint32_tmp, buffer);
+	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&msg->node_list, &uint32_tmp, buffer);
+	}
 	return SLURM_SUCCESS;
 
 unpack_error:
@@ -10333,17 +10977,12 @@ static void
 _pack_job_step_kill_msg(job_step_kill_msg_t * msg, Buf buffer,
 			uint16_t protocol_version)
 {
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		packstr(msg->sjob_id, buffer);
 		pack32((uint32_t)msg->job_id, buffer);
 		pack32((uint32_t)msg->job_step_id, buffer);
 		pack16((uint16_t)msg->signal, buffer);
 		pack16((uint16_t)msg->flags, buffer);
-	} else {
-		pack32((uint32_t)msg->job_id, buffer);
-		pack32((uint32_t)msg->job_step_id, buffer);
-		pack16((uint16_t)msg->signal, buffer);
-		pack16((uint16_t)msg->flags, buffer);
 	}
 }
 
@@ -10363,17 +11002,12 @@ _unpack_job_step_kill_msg(job_step_kill_msg_t ** msg_ptr, Buf buffer,
 	msg = xmalloc(sizeof(job_step_kill_msg_t));
 	*msg_ptr = msg;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&(msg)->sjob_id, &cc, buffer);
 		safe_unpack32(&msg->job_id, buffer);
 		safe_unpack32(&msg->job_step_id, buffer);
 		safe_unpack16(&msg->signal, buffer);
 		safe_unpack16(&msg->flags, buffer);
-	} else {
-		safe_unpack32(&msg->job_id, buffer);
-		safe_unpack32(&msg->job_step_id, buffer);
-		safe_unpack16(&msg->signal, buffer);
-		safe_unpack16(&msg->flags, buffer);
 	}
 
 	return SLURM_SUCCESS;
@@ -10514,7 +11148,22 @@ _pack_prolog_launch_msg(
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack32(msg->job_id, buffer);
+		pack32(msg->uid, buffer);
+		pack32(msg->gid, buffer);
+
+		packstr(msg->alias_list, buffer);
+		packstr(msg->nodes, buffer);
+		packstr(msg->partition, buffer);
+		packstr(msg->std_err, buffer);
+		packstr(msg->std_out, buffer);
+		packstr(msg->work_dir, buffer);
+		packstr_array(msg->spank_job_env, msg->spank_job_env_size,
+			      buffer);
+		slurm_cred_pack(msg->cred, buffer, protocol_version);
+		packstr(msg->user_name, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack32(msg->job_id, buffer);
 		pack32(msg->uid, buffer);
 		pack32(msg->gid, buffer);
@@ -10556,7 +11205,34 @@ _unpack_prolog_launch_msg(
 	launch_msg_ptr = xmalloc(sizeof(prolog_launch_msg_t));
 	*msg = launch_msg_ptr;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&launch_msg_ptr->job_id, buffer);
+		safe_unpack32(&launch_msg_ptr->uid, buffer);
+		safe_unpack32(&launch_msg_ptr->gid, buffer);
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->alias_list, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->nodes, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->partition, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->std_err, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->std_out, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->work_dir, &uint32_tmp,
+				       buffer);
+
+		safe_unpackstr_array(&launch_msg_ptr->spank_job_env,
+				     &launch_msg_ptr->spank_job_env_size,
+				     buffer);
+		if (!(launch_msg_ptr->cred = slurm_cred_unpack(buffer,
+							protocol_version)))
+			goto unpack_error;
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->user_name, &uint32_tmp,
+				       buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack32(&launch_msg_ptr->job_id, buffer);
 		safe_unpack32(&launch_msg_ptr->uid, buffer);
 		safe_unpack32(&launch_msg_ptr->gid, buffer);
@@ -11165,88 +11841,189 @@ static int _unpack_burst_buffer_info_msg(
 	safe_unpack32(&bb_msg_ptr->record_count, buffer);
 	bb_msg_ptr->burst_buffer_array = xmalloc(sizeof(burst_buffer_info_t) *
 						 bb_msg_ptr->record_count);
-	for (i = 0, bb_info_ptr = bb_msg_ptr->burst_buffer_array;
-	     i < bb_msg_ptr->record_count; i++, bb_info_ptr++) {
-		safe_unpackstr_xmalloc(&bb_info_ptr->name, &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->allow_users, &uint32_tmp,
-				       buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->create_buffer,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->default_pool,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->deny_users, &uint32_tmp,
-				       buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->destroy_buffer,
-				       &uint32_tmp, buffer);
-		safe_unpack32(&bb_info_ptr->flags, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->get_sys_state, &uint32_tmp,
-				       buffer);
-		safe_unpack64(&bb_info_ptr->granularity, buffer);
-		safe_unpack32(&bb_info_ptr->gres_cnt, buffer);
-		bb_info_ptr->gres_ptr = xmalloc(bb_info_ptr->gres_cnt *
-						sizeof(burst_buffer_gres_t));
-		for (j = 0; j < bb_info_ptr->gres_cnt; j++) {
-			safe_unpackstr_xmalloc(&bb_info_ptr->gres_ptr[j].name,
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		for (i = 0, bb_info_ptr = bb_msg_ptr->burst_buffer_array;
+		     i < bb_msg_ptr->record_count; i++, bb_info_ptr++) {
+			safe_unpackstr_xmalloc(&bb_info_ptr->name, &uint32_tmp,
+					       buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->allow_users,
 					       &uint32_tmp, buffer);
-			safe_unpack64(&bb_info_ptr->gres_ptr[j].avail_cnt,
-				      buffer);
-			safe_unpack64(&bb_info_ptr->gres_ptr[j].used_cnt,
-				      buffer);
-		}
-		safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_in,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_out,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_in,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_out,
-				       &uint32_tmp, buffer);
-		safe_unpack32(&bb_info_ptr->stage_in_timeout, buffer);
-		safe_unpack32(&bb_info_ptr->stage_out_timeout, buffer);
-		safe_unpack64(&bb_info_ptr->total_space, buffer);
-		safe_unpack64(&bb_info_ptr->used_space, buffer);
-
-		safe_unpack32(&bb_info_ptr->buffer_count, buffer);
-		bb_info_ptr->burst_buffer_resv_ptr =
-			xmalloc(sizeof(burst_buffer_resv_t) *
-				bb_info_ptr->buffer_count);
-		for (j = 0, bb_resv_ptr = bb_info_ptr->burst_buffer_resv_ptr;
-		     j < bb_info_ptr->buffer_count; j++, bb_resv_ptr++) {
-			safe_unpackstr_xmalloc(&bb_resv_ptr->account,
+			safe_unpackstr_xmalloc(&bb_info_ptr->create_buffer,
 					       &uint32_tmp, buffer);
-			safe_unpack32(&bb_resv_ptr->array_job_id, buffer);
-			safe_unpack32(&bb_resv_ptr->array_task_id, buffer);
-			safe_unpack_time(&bb_resv_ptr->create_time, buffer);
-			safe_unpack32(&bb_resv_ptr->gres_cnt, buffer);
-			bb_resv_ptr->gres_ptr = xmalloc(bb_resv_ptr->gres_cnt *
-						sizeof(burst_buffer_gres_t));
-			for (k = 0; k < bb_resv_ptr->gres_cnt; k++) {
-				safe_unpackstr_xmalloc(&bb_resv_ptr->
-						       gres_ptr[k].name,
-						       &uint32_tmp, buffer);
-				safe_unpack64(&bb_resv_ptr->gres_ptr[k].
-					      used_cnt, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->default_pool,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->deny_users,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->destroy_buffer,
+					       &uint32_tmp, buffer);
+			safe_unpack32(&bb_info_ptr->flags, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->get_sys_state,
+					       &uint32_tmp, buffer);
+			safe_unpack64(&bb_info_ptr->granularity, buffer);
+			safe_unpack32(&bb_info_ptr->pool_cnt, buffer);
+			bb_info_ptr->pool_ptr = xmalloc(bb_info_ptr->pool_cnt *
+						sizeof(burst_buffer_pool_t));
+			for (j = 0; j < bb_info_ptr->pool_cnt; j++) {
+				safe_unpackstr_xmalloc(
+					&bb_info_ptr->pool_ptr[j].name,
+					&uint32_tmp, buffer);
+				safe_unpack64(
+					&bb_info_ptr->pool_ptr[j].total_space,
+					     buffer);
+				safe_unpack64(
+					&bb_info_ptr->pool_ptr[j].granularity,
+					     buffer);
+				safe_unpack64(
+					&bb_info_ptr->pool_ptr[j].used_space,
+					buffer);
 			}
-			safe_unpack32(&bb_resv_ptr->job_id, buffer);
-			safe_unpackstr_xmalloc(&bb_resv_ptr->name,
+			safe_unpack32(&bb_info_ptr->other_timeout, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_in,
 					       &uint32_tmp, buffer);
-			safe_unpackstr_xmalloc(&bb_resv_ptr->partition,
+			safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_out,
 					       &uint32_tmp, buffer);
-			safe_unpackstr_xmalloc(&bb_resv_ptr->qos,
+			safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_in,
 					       &uint32_tmp, buffer);
-			safe_unpack64(&bb_resv_ptr->size, buffer);
-			safe_unpack16(&bb_resv_ptr->state, buffer);
-			safe_unpack32(&bb_resv_ptr->user_id, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_out,
+					       &uint32_tmp, buffer);
+			safe_unpack32(&bb_info_ptr->stage_in_timeout, buffer);
+			safe_unpack32(&bb_info_ptr->stage_out_timeout, buffer);
+			safe_unpack64(&bb_info_ptr->total_space, buffer);
+			safe_unpack64(&bb_info_ptr->used_space, buffer);
+			safe_unpack32(&bb_info_ptr->validate_timeout, buffer);
+
+			safe_unpack32(&bb_info_ptr->buffer_count, buffer);
+			bb_info_ptr->burst_buffer_resv_ptr =
+				xmalloc(sizeof(burst_buffer_resv_t) *
+					bb_info_ptr->buffer_count);
+			for (j = 0,
+			     bb_resv_ptr = bb_info_ptr->burst_buffer_resv_ptr;
+			     j < bb_info_ptr->buffer_count; j++, bb_resv_ptr++){
+				safe_unpackstr_xmalloc(&bb_resv_ptr->account,
+						       &uint32_tmp, buffer);
+				safe_unpack32(&bb_resv_ptr->array_job_id,
+					      buffer);
+				safe_unpack32(&bb_resv_ptr->array_task_id,
+					      buffer);
+				safe_unpack_time(&bb_resv_ptr->create_time,
+						 buffer);
+				safe_unpack32(&bb_resv_ptr->job_id, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->name,
+						       &uint32_tmp, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->partition,
+						       &uint32_tmp, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->pool,
+						       &uint32_tmp, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->qos,
+						       &uint32_tmp, buffer);
+				safe_unpack64(&bb_resv_ptr->size, buffer);
+				safe_unpack16(&bb_resv_ptr->state, buffer);
+				safe_unpack32(&bb_resv_ptr->user_id, buffer);
+			}
+
+			safe_unpack32(&bb_info_ptr->use_count, buffer);
+			bb_info_ptr->burst_buffer_use_ptr =
+				xmalloc(sizeof(burst_buffer_use_t) *
+					bb_info_ptr->use_count);
+			for (j = 0,
+			     bb_use_ptr = bb_info_ptr->burst_buffer_use_ptr;
+			     j < bb_info_ptr->use_count; j++, bb_use_ptr++) {
+				safe_unpack64(&bb_use_ptr->used, buffer);
+				safe_unpack32(&bb_use_ptr->user_id, buffer);
+			}
 		}
+	} else {
+		uint32_t pool_cnt = 0;
+		uint64_t used_cnt = 0;
+		char *pool_name = NULL;
+		for (i = 0, bb_info_ptr = bb_msg_ptr->burst_buffer_array;
+		     i < bb_msg_ptr->record_count; i++, bb_info_ptr++) {
+			safe_unpackstr_xmalloc(&bb_info_ptr->name, &uint32_tmp,
+					       buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->allow_users,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->create_buffer,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->default_pool,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->deny_users,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->destroy_buffer,
+					       &uint32_tmp, buffer);
+			safe_unpack32(&bb_info_ptr->flags, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->get_sys_state,
+					       &uint32_tmp, buffer);
+			safe_unpack64(&bb_info_ptr->granularity, buffer);
+			safe_unpack32(&bb_info_ptr->pool_cnt, buffer);
+			bb_info_ptr->pool_ptr = xmalloc(bb_info_ptr->pool_cnt *
+						sizeof(burst_buffer_pool_t));
+			for (j = 0; j < bb_info_ptr->pool_cnt; j++) {
+				safe_unpackstr_xmalloc(
+					&bb_info_ptr->pool_ptr[j].name,
+					&uint32_tmp, buffer);
+				safe_unpack64(
+					&bb_info_ptr->pool_ptr[j].total_space,
+					     buffer);
+				safe_unpack64(
+					&bb_info_ptr->pool_ptr[j].used_space,
+					buffer);
+			}
+			safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_in,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->start_stage_out,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_in,
+					       &uint32_tmp, buffer);
+			safe_unpackstr_xmalloc(&bb_info_ptr->stop_stage_out,
+					       &uint32_tmp, buffer);
+			safe_unpack32(&bb_info_ptr->stage_in_timeout, buffer);
+			safe_unpack32(&bb_info_ptr->stage_out_timeout, buffer);
+			safe_unpack64(&bb_info_ptr->total_space, buffer);
+			safe_unpack64(&bb_info_ptr->used_space, buffer);
+
+			safe_unpack32(&bb_info_ptr->buffer_count, buffer);
+			bb_info_ptr->burst_buffer_resv_ptr =
+				xmalloc(sizeof(burst_buffer_resv_t) *
+					bb_info_ptr->buffer_count);
+			for (j = 0,
+			     bb_resv_ptr = bb_info_ptr->burst_buffer_resv_ptr;
+			     j < bb_info_ptr->buffer_count; j++, bb_resv_ptr++){
+				safe_unpackstr_xmalloc(&bb_resv_ptr->account,
+						       &uint32_tmp, buffer);
+				safe_unpack32(&bb_resv_ptr->array_job_id,
+					      buffer);
+				safe_unpack32(&bb_resv_ptr->array_task_id,
+					      buffer);
+				safe_unpack_time(&bb_resv_ptr->create_time,
+						 buffer);
+				safe_unpack32(&pool_cnt, buffer);
+				for (k = 0; k < pool_cnt; k++) {
+					safe_unpackmem_ptr(&pool_name,
+						&uint32_tmp, buffer);
+					safe_unpack64(&used_cnt, buffer);
+				}
+				safe_unpack32(&bb_resv_ptr->job_id, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->name,
+						       &uint32_tmp, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->partition,
+						       &uint32_tmp, buffer);
+				safe_unpackstr_xmalloc(&bb_resv_ptr->qos,
+						       &uint32_tmp, buffer);
+				safe_unpack64(&bb_resv_ptr->size, buffer);
+				safe_unpack16(&bb_resv_ptr->state, buffer);
+				safe_unpack32(&bb_resv_ptr->user_id, buffer);
+			}
 
-		safe_unpack32(&bb_info_ptr->use_count, buffer);
-		bb_info_ptr->burst_buffer_use_ptr =
-			xmalloc(sizeof(burst_buffer_use_t) *
-				bb_info_ptr->use_count);
-		for (j = 0, bb_use_ptr = bb_info_ptr->burst_buffer_use_ptr;
-		     j < bb_info_ptr->use_count; j++, bb_use_ptr++) {
-			safe_unpack64(&bb_use_ptr->used, buffer);
-			safe_unpack32(&bb_use_ptr->user_id, buffer);
+			safe_unpack32(&bb_info_ptr->use_count, buffer);
+			bb_info_ptr->burst_buffer_use_ptr =
+				xmalloc(sizeof(burst_buffer_use_t) *
+					bb_info_ptr->use_count);
+			for (j = 0,
+			     bb_use_ptr = bb_info_ptr->burst_buffer_use_ptr;
+			     j < bb_info_ptr->use_count; j++, bb_use_ptr++) {
+				safe_unpack64(&bb_use_ptr->used, buffer);
+				safe_unpack32(&bb_use_ptr->user_id, buffer);
+			}
 		}
 	}
 	*burst_buffer_info = bb_msg_ptr;
@@ -11412,11 +12189,10 @@ _unpack_front_end_info_members(front_end_info_t *front_end, Buf buffer,
 			       uint16_t protocol_version)
 {
 	uint32_t uint32_tmp;
-	uint16_t tmp_state;
 
 	xassert(front_end != NULL);
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&front_end->allow_groups, &uint32_tmp,
 				       buffer);
 		safe_unpackstr_xmalloc(&front_end->allow_users, &uint32_tmp,
@@ -11428,34 +12204,14 @@ _unpack_front_end_info_members(front_end_info_t *front_end, Buf buffer,
 				       buffer);
 		safe_unpackstr_xmalloc(&front_end->name, &uint32_tmp, buffer);
 		safe_unpack32(&front_end->node_state, buffer);
-		safe_unpackstr_xmalloc(&front_end->version, &uint32_tmp, buffer);
-
-		safe_unpackstr_xmalloc(&front_end->reason, &uint32_tmp, buffer);
-		safe_unpack_time(&front_end->reason_time, buffer);
-		safe_unpack32(&front_end->reason_uid, buffer);
-
-		safe_unpack_time(&front_end->slurmd_start_time, buffer);
-
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		safe_unpackstr_xmalloc(&front_end->allow_groups, &uint32_tmp,
-				       buffer);
-		safe_unpackstr_xmalloc(&front_end->allow_users, &uint32_tmp,
+		safe_unpackstr_xmalloc(&front_end->version, &uint32_tmp,
 				       buffer);
-		safe_unpack_time(&front_end->boot_time, buffer);
-		safe_unpackstr_xmalloc(&front_end->deny_groups, &uint32_tmp,
-				       buffer);
-		safe_unpackstr_xmalloc(&front_end->deny_users, &uint32_tmp,
-				       buffer);
-		safe_unpackstr_xmalloc(&front_end->name, &uint32_tmp, buffer);
-		safe_unpack16(&tmp_state, buffer);
-		safe_unpackstr_xmalloc(&front_end->version, &uint32_tmp, buffer);
 
 		safe_unpackstr_xmalloc(&front_end->reason, &uint32_tmp, buffer);
 		safe_unpack_time(&front_end->reason_time, buffer);
 		safe_unpack32(&front_end->reason_uid, buffer);
 
 		safe_unpack_time(&front_end->slurmd_start_time, buffer);
-		front_end->node_state = tmp_state;
 
 	} else {
 		error("_unpack_front_end_info_members: protocol_version "
@@ -11528,7 +12284,7 @@ _pack_layout_info_request_msg(layout_info_request_msg_t * msg, Buf buffer,
 	packstr(msg->layout_type, buffer);
 	packstr(msg->entities, buffer);
 	packstr(msg->type, buffer);
-	pack32(msg->no_relation, buffer);
+	pack32(msg->flags, buffer);
 }
 
 static int
@@ -11544,7 +12300,7 @@ _unpack_layout_info_request_msg(layout_info_request_msg_t ** msg, Buf buffer,
 	safe_unpackstr_xmalloc(&layout_info->layout_type, &uint32_tmp, buffer);
 	safe_unpackstr_xmalloc(&layout_info->entities, &uint32_tmp, buffer);
 	safe_unpackstr_xmalloc(&layout_info->type, &uint32_tmp, buffer);
-	safe_unpack32(&layout_info->no_relation, buffer);
+	safe_unpack32(&layout_info->flags, buffer);
 	return SLURM_SUCCESS;
 
 unpack_error:
@@ -11607,41 +12363,102 @@ _unpack_ret_list(List *ret_list,
 	slurm_msg_t_init(&msg);
 	msg.protocol_version = protocol_version;
 
-	*ret_list = list_create(destroy_data_info);
+	*ret_list = list_create(destroy_data_info);
+
+	for (i=0; i<size_val; i++) {
+		ret_data_info = xmalloc(sizeof(ret_data_info_t));
+		list_push(*ret_list, ret_data_info);
+
+		safe_unpack32((uint32_t *)&ret_data_info->err, buffer);
+		safe_unpack16(&ret_data_info->type, buffer);
+		safe_unpackstr_xmalloc(&ret_data_info->node_name,
+				       &uint32_tmp, buffer);
+		msg.msg_type = ret_data_info->type;
+		if (unpack_msg(&msg, buffer) != SLURM_SUCCESS)
+			goto unpack_error;
+		ret_data_info->data = msg.data;
+	}
+
+	return SLURM_SUCCESS;
+
+unpack_error:
+	if (ret_data_info && ret_data_info->type) {
+		error("_unpack_ret_list: message type %u, record %d of %u",
+		      ret_data_info->type, i, size_val);
+	}
+	FREE_NULL_LIST(*ret_list);
+	*ret_list = NULL;
+	return SLURM_ERROR;
+}
+
+static void
+_pack_batch_job_launch_msg(batch_job_launch_msg_t * msg, Buf buffer,
+			   uint16_t protocol_version)
+{
+	xassert(msg != NULL);
+
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack32(msg->job_id, buffer);
+		pack32(msg->step_id, buffer);
+		pack32(msg->uid, buffer);
+		packstr(msg->partition, buffer);
+		packstr(msg->user_name, buffer);
+		pack32(msg->gid, buffer);
+		pack32(msg->ntasks, buffer);
+		pack32(msg->pn_min_memory, buffer);
+
+		pack8(msg->open_mode, buffer);
+		pack8(msg->overcommit, buffer);
+
+		pack32(msg->array_job_id,   buffer);
+		pack32(msg->array_task_id,  buffer);
+
+		packstr(msg->acctg_freq,     buffer);
+		pack16(msg->cpu_bind_type,  buffer);
+		pack16(msg->cpus_per_task,  buffer);
+		pack16(msg->restart_cnt,    buffer);
+		pack16(msg->job_core_spec,  buffer);
+
+		pack32(msg->num_cpu_groups, buffer);
+		if (msg->num_cpu_groups) {
+			pack16_array(msg->cpus_per_node, msg->num_cpu_groups,
+				     buffer);
+			pack32_array(msg->cpu_count_reps, msg->num_cpu_groups,
+				     buffer);
+		}
+
+		packstr(msg->alias_list, buffer);
+		packstr(msg->cpu_bind, buffer);
+		packstr(msg->nodes,    buffer);
+		packstr(msg->script,   buffer);
+		packstr(msg->work_dir, buffer);
+		packstr(msg->ckpt_dir, buffer);
+		packstr(msg->restart_dir, buffer);
+
+		packstr(msg->std_err, buffer);
+		packstr(msg->std_in, buffer);
+		packstr(msg->std_out, buffer);
 
-	for (i=0; i<size_val; i++) {
-		ret_data_info = xmalloc(sizeof(ret_data_info_t));
-		list_push(*ret_list, ret_data_info);
+		pack32(msg->argc, buffer);
+		packstr_array(msg->argv, msg->argc, buffer);
+		packstr_array(msg->spank_job_env, msg->spank_job_env_size,
+			      buffer);
 
-		safe_unpack32((uint32_t *)&ret_data_info->err, buffer);
-		safe_unpack16(&ret_data_info->type, buffer);
-		safe_unpackstr_xmalloc(&ret_data_info->node_name,
-				       &uint32_tmp, buffer);
-		msg.msg_type = ret_data_info->type;
-		if (unpack_msg(&msg, buffer) != SLURM_SUCCESS)
-			goto unpack_error;
-		ret_data_info->data = msg.data;
-	}
+		pack32(msg->envc, buffer);
+		packstr_array(msg->environment, msg->envc, buffer);
 
-	return SLURM_SUCCESS;
+		pack32(msg->job_mem, buffer);
 
-unpack_error:
-	if (ret_data_info && ret_data_info->type) {
-		error("_unpack_ret_list: message type %u, record %d of %u",
-		      ret_data_info->type, i, size_val);
-	}
-	FREE_NULL_LIST(*ret_list);
-	*ret_list = NULL;
-	return SLURM_ERROR;
-}
+		slurm_cred_pack(msg->cred, buffer, protocol_version);
 
-static void
-_pack_batch_job_launch_msg(batch_job_launch_msg_t * msg, Buf buffer,
-			   uint16_t protocol_version)
-{
-	xassert(msg != NULL);
+		select_g_select_jobinfo_pack(msg->select_jobinfo, buffer,
+					     protocol_version);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		packstr(msg->account, buffer);
+		packstr(msg->qos, buffer);
+		packstr(msg->resv_name, buffer);
+		pack32(msg->profile, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack32(msg->job_id, buffer);
 		pack32(msg->step_id, buffer);
 		pack32(msg->uid, buffer);
@@ -11702,7 +12519,7 @@ _pack_batch_job_launch_msg(batch_job_launch_msg_t * msg, Buf buffer,
 		packstr(msg->qos, buffer);
 		packstr(msg->resv_name, buffer);
 
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		pack32(msg->job_id, buffer);
 		pack32(msg->step_id, buffer);
 		pack32(msg->uid, buffer);
@@ -11775,7 +12592,98 @@ _unpack_batch_job_launch_msg(batch_job_launch_msg_t ** msg, Buf buffer,
 	launch_msg_ptr = xmalloc(sizeof(batch_job_launch_msg_t));
 	*msg = launch_msg_ptr;
 
-	if (protocol_version >=  SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >=  SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&launch_msg_ptr->job_id, buffer);
+		safe_unpack32(&launch_msg_ptr->step_id, buffer);
+		safe_unpack32(&launch_msg_ptr->uid, buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->partition,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->user_name,
+				       &uint32_tmp, buffer);
+		safe_unpack32(&launch_msg_ptr->gid, buffer);
+		safe_unpack32(&launch_msg_ptr->ntasks, buffer);
+		safe_unpack32(&launch_msg_ptr->pn_min_memory, buffer);
+
+		safe_unpack8(&launch_msg_ptr->open_mode, buffer);
+		safe_unpack8(&launch_msg_ptr->overcommit, buffer);
+
+		safe_unpack32(&launch_msg_ptr->array_job_id,   buffer);
+		safe_unpack32(&launch_msg_ptr->array_task_id,  buffer);
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->acctg_freq,
+				       &uint32_tmp, buffer);
+		safe_unpack16(&launch_msg_ptr->cpu_bind_type,  buffer);
+		safe_unpack16(&launch_msg_ptr->cpus_per_task,  buffer);
+		safe_unpack16(&launch_msg_ptr->restart_cnt,    buffer);
+		safe_unpack16(&launch_msg_ptr->job_core_spec,  buffer);
+
+		safe_unpack32(&launch_msg_ptr->num_cpu_groups, buffer);
+		if (launch_msg_ptr->num_cpu_groups) {
+			safe_unpack16_array(&(launch_msg_ptr->cpus_per_node),
+					    &uint32_tmp, buffer);
+			if (launch_msg_ptr->num_cpu_groups != uint32_tmp)
+				goto unpack_error;
+			safe_unpack32_array(&(launch_msg_ptr->cpu_count_reps),
+					    &uint32_tmp, buffer);
+			if (launch_msg_ptr->num_cpu_groups != uint32_tmp)
+				goto unpack_error;
+		}
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->alias_list,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->cpu_bind, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->nodes,    &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->script,   &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->work_dir, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->ckpt_dir, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->restart_dir,
+				       &uint32_tmp, buffer);
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->std_err, &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->std_in,  &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->std_out, &uint32_tmp,
+				       buffer);
+
+		safe_unpack32(&launch_msg_ptr->argc, buffer);
+		safe_unpackstr_array(&launch_msg_ptr->argv,
+				     &launch_msg_ptr->argc, buffer);
+		safe_unpackstr_array(&launch_msg_ptr->spank_job_env,
+				     &launch_msg_ptr->spank_job_env_size,
+				     buffer);
+
+		safe_unpack32(&launch_msg_ptr->envc, buffer);
+		safe_unpackstr_array(&launch_msg_ptr->environment,
+				     &launch_msg_ptr->envc, buffer);
+
+		safe_unpack32(&launch_msg_ptr->job_mem, buffer);
+
+		if (!(launch_msg_ptr->cred = slurm_cred_unpack(
+			      buffer, protocol_version)))
+			goto unpack_error;
+
+		if (select_g_select_jobinfo_unpack(&launch_msg_ptr->
+						   select_jobinfo,
+						   buffer, protocol_version))
+			goto unpack_error;
+
+		safe_unpackstr_xmalloc(&launch_msg_ptr->account,
+				       &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->qos,
+				       &uint32_tmp,
+				       buffer);
+		safe_unpackstr_xmalloc(&launch_msg_ptr->resv_name,
+				       &uint32_tmp,
+				       buffer);
+		safe_unpack32(&launch_msg_ptr->profile, buffer);
+	} else if (protocol_version >=  SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack32(&launch_msg_ptr->job_id, buffer);
 		safe_unpack32(&launch_msg_ptr->step_id, buffer);
 		safe_unpack32(&launch_msg_ptr->uid, buffer);
@@ -11866,7 +12774,7 @@ _unpack_batch_job_launch_msg(batch_job_launch_msg_t ** msg, Buf buffer,
 				       &uint32_tmp,
 				       buffer);
 
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpack32(&launch_msg_ptr->job_id, buffer);
 		safe_unpack32(&launch_msg_ptr->step_id, buffer);
 		safe_unpack32(&launch_msg_ptr->uid, buffer);
@@ -12187,20 +13095,10 @@ _pack_job_requeue_msg(requeue_msg_t *msg, Buf buf, uint16_t protocol_version)
 {
 	xassert(msg != NULL);
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack32(msg->job_id, buf);
 		packstr(msg->job_id_str, buf);
 		pack32(msg->state, buf);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		pack32(msg->job_id, buf);
-		pack32(msg->state, buf);
-	} else {
-		/* For backward compatibility we emulate _pack_job_ready_msg()
-		 */
-		uint16_t cc;
-		cc = 0;
-		pack32(msg->job_id, buf);
-		pack16(cc, buf);
 	}
 }
 
@@ -12210,23 +13108,10 @@ _unpack_job_requeue_msg(requeue_msg_t **msg, Buf buf, uint16_t protocol_version)
 	uint32_t uint32_tmp = 0;
 	*msg = xmalloc(sizeof(requeue_msg_t));
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack32(&(*msg)->job_id, buf);
 		safe_unpackstr_xmalloc(&(*msg)->job_id_str, &uint32_tmp, buf);
 		safe_unpack32(&(*msg)->state, buf);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		safe_unpack32(&(*msg)->job_id, buf);
-		safe_unpack32(&(*msg)->state, buf);
-	} else {
-		/* Translate job_id_msg_t into requeue_msg_t
-		 */
-		uint16_t cc;
-		safe_unpack32(&(*msg)->job_id, buf) ;
-		safe_unpack16(&cc, buf);
-		/* Arghh.. versions < 1312 pack random bytes
-		 * in the unused show_flag member.
-		 */
-		(*msg)->state = 0;
 	}
 
 	return SLURM_SUCCESS;
@@ -12333,13 +13218,10 @@ static void _pack_suspend_msg(suspend_msg_t *msg, Buf buffer,
 			      uint16_t protocol_version)
 {
 	xassert ( msg != NULL );
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack16(msg -> op, buffer);
 		pack32(msg->job_id,  buffer);
 		packstr(msg->job_id_str, buffer);
-	} else {
-		pack16(msg -> op, buffer);
-		pack32(msg->job_id,  buffer);
 	}
 }
 
@@ -12353,14 +13235,12 @@ static int  _unpack_suspend_msg(suspend_msg_t **msg_ptr, Buf buffer,
 	msg = xmalloc ( sizeof (suspend_msg_t) );
 	*msg_ptr = msg ;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack16(&msg->op,      buffer);
 		safe_unpack32(&msg->job_id , buffer);
 		safe_unpackstr_xmalloc(&msg->job_id_str, &uint32_tmp, buffer);
-	} else {
-		safe_unpack16(&msg->op,      buffer);
-		safe_unpack32(&msg->job_id , buffer);
 	}
+
 	return SLURM_SUCCESS;
 
 unpack_error:
@@ -12373,26 +13253,13 @@ static void _pack_suspend_int_msg(suspend_int_msg_t *msg, Buf buffer,
 				  uint16_t protocol_version)
 {
 	xassert ( msg != NULL );
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack8(msg->indf_susp, buffer);
 		pack16(msg->job_core_spec, buffer);
 		pack32(msg->job_id,  buffer);
 		pack16(msg->op, buffer);
 		switch_g_job_suspend_info_pack(msg->switch_info, buffer,
 					       protocol_version);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		pack16(msg->job_core_spec, buffer);
-		pack16(msg->op, buffer);
-		pack32(msg->job_id,  buffer);
-		pack8(msg->indf_susp, buffer);
-		switch_g_job_suspend_info_pack(msg->switch_info, buffer,
-					       protocol_version);
-	} else {
-		pack16(msg->op, buffer);
-		pack32(msg->job_id,  buffer);
-		pack8(msg->indf_susp, buffer);
-		switch_g_job_suspend_info_pack(msg->switch_info, buffer,
-					       protocol_version);
 	}
 }
 
@@ -12405,7 +13272,7 @@ static int  _unpack_suspend_int_msg(suspend_int_msg_t **msg_ptr, Buf buffer,
 	msg = xmalloc ( sizeof (suspend_int_msg_t) );
 	*msg_ptr = msg ;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack8(&msg->indf_susp, buffer);
 		safe_unpack16(&msg->job_core_spec, buffer);
 		safe_unpack32(&msg->job_id, buffer);
@@ -12413,22 +13280,8 @@ static int  _unpack_suspend_int_msg(suspend_int_msg_t **msg_ptr, Buf buffer,
 		if (switch_g_job_suspend_info_unpack(&msg->switch_info, buffer,
 						     protocol_version))
 			goto unpack_error;
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		safe_unpack16(&msg->job_core_spec, buffer);
-		safe_unpack16(&msg->op,     buffer);
-		safe_unpack32(&msg->job_id, buffer);
-		safe_unpack8(&msg->indf_susp, buffer);
-		if (switch_g_job_suspend_info_unpack(&msg->switch_info, buffer,
-						     protocol_version))
-			goto unpack_error;
-	} else {
-		safe_unpack16(&msg->op,     buffer);
-		safe_unpack32(&msg->job_id, buffer);
-		safe_unpack8(&msg->indf_susp, buffer);
-		if (switch_g_job_suspend_info_unpack(&msg->switch_info, buffer,
-						     protocol_version))
-			goto unpack_error;
 	}
+
 	return SLURM_SUCCESS;
 
 unpack_error:
@@ -12437,6 +13290,41 @@ unpack_error:
 	return SLURM_ERROR;
 }
 
+static void _pack_top_job_msg(top_job_msg_t *msg, Buf buffer,
+			      uint16_t protocol_version)
+{
+	xassert ( msg != NULL );
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		pack16(msg -> op, buffer);
+		pack32(msg->job_id,  buffer);
+		packstr(msg->job_id_str, buffer);
+	}
+}
+
+static int  _unpack_top_job_msg(top_job_msg_t **msg_ptr, Buf buffer,
+				uint16_t protocol_version)
+{
+	top_job_msg_t * msg;
+	uint32_t uint32_tmp = 0;
+	xassert ( msg_ptr != NULL );
+
+	msg = xmalloc ( sizeof (top_job_msg_t) );
+	*msg_ptr = msg ;
+
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
+		safe_unpack16(&msg->op,      buffer);
+		safe_unpack32(&msg->job_id , buffer);
+		safe_unpackstr_xmalloc(&msg->job_id_str, &uint32_tmp, buffer);
+	}
+
+	return SLURM_SUCCESS;
+
+unpack_error:
+	*msg_ptr = NULL;
+	slurm_free_top_job_msg(msg);
+	return SLURM_ERROR;
+}
+
 static void _pack_forward_data_msg(forward_data_msg_t *msg,
 				   Buf buffer, uint16_t protocol_version)
 {
@@ -12657,8 +13545,9 @@ static void _pack_file_bcast(file_bcast_msg_t * msg , Buf buffer,
 
 	grow_buf(buffer,  msg->block_len);
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		pack16 ( msg->block_no, buffer );
+		pack16 ( msg->compress, buffer );
 		pack16 ( msg->last_block, buffer );
 		pack16 ( msg->force, buffer );
 		pack16 ( msg->modes, buffer );
@@ -12672,15 +13561,19 @@ static void _pack_file_bcast(file_bcast_msg_t * msg , Buf buffer,
 
 		packstr ( msg->fname, buffer );
 		pack32 ( msg->block_len, buffer );
+		pack32(msg->uncomp_len, buffer);
+		pack32(msg->block_offset, buffer);
+		pack64(msg->file_size, buffer);
 		packmem ( msg->block, msg->block_len, buffer );
 		pack_sbcast_cred( msg->cred, buffer );
-	} else {
+	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack16 ( msg->block_no, buffer );
 		pack16 ( msg->last_block, buffer );
 		pack16 ( msg->force, buffer );
 		pack16 ( msg->modes, buffer );
 
 		pack32 ( msg->uid, buffer );
+		packstr ( msg->user_name, buffer );
 		pack32 ( msg->gid, buffer );
 
 		pack_time ( msg->atime, buffer );
@@ -12704,8 +13597,9 @@ static int _unpack_file_bcast(file_bcast_msg_t ** msg_ptr , Buf buffer,
 	msg = xmalloc ( sizeof (file_bcast_msg_t) ) ;
 	*msg_ptr = msg;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpack16 ( & msg->block_no, buffer );
+		safe_unpack16 ( & msg->compress, buffer );
 		safe_unpack16 ( & msg->last_block, buffer );
 		safe_unpack16 ( & msg->force, buffer );
 		safe_unpack16 ( & msg->modes, buffer );
@@ -12719,6 +13613,9 @@ static int _unpack_file_bcast(file_bcast_msg_t ** msg_ptr , Buf buffer,
 
 		safe_unpackstr_xmalloc ( & msg->fname, &uint32_tmp, buffer );
 		safe_unpack32 ( & msg->block_len, buffer );
+		safe_unpack32(&msg->uncomp_len, buffer);
+		safe_unpack32(&msg->block_offset, buffer);
+		safe_unpack64(&msg->file_size, buffer);
 		safe_unpackmem_xmalloc ( & msg->block, &uint32_tmp , buffer ) ;
 		if ( uint32_tmp != msg->block_len )
 			goto unpack_error;
@@ -12726,13 +13623,14 @@ static int _unpack_file_bcast(file_bcast_msg_t ** msg_ptr , Buf buffer,
 		msg->cred = unpack_sbcast_cred( buffer );
 		if (msg->cred == NULL)
 			goto unpack_error;
-	} else {
+	} else if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack16 ( & msg->block_no, buffer );
 		safe_unpack16 ( & msg->last_block, buffer );
 		safe_unpack16 ( & msg->force, buffer );
 		safe_unpack16 ( & msg->modes, buffer );
 
 		safe_unpack32 ( & msg->uid, buffer );
+		safe_unpackstr_xmalloc ( &msg->user_name, &uint32_tmp, buffer );
 		safe_unpack32 ( & msg->gid, buffer );
 
 		safe_unpack_time ( & msg->atime, buffer );
@@ -12740,7 +13638,11 @@ static int _unpack_file_bcast(file_bcast_msg_t ** msg_ptr , Buf buffer,
 
 		safe_unpackstr_xmalloc ( & msg->fname, &uint32_tmp, buffer );
 		safe_unpack32 ( & msg->block_len, buffer );
+
+		msg->block_offset = msg->block_len * msg->block_no;
+
 		safe_unpackmem_xmalloc ( & msg->block, &uint32_tmp , buffer ) ;
+
 		if ( uint32_tmp != msg->block_len )
 			goto unpack_error;
 
@@ -12887,36 +13789,36 @@ static int  _unpack_kvs_rec(struct kvs_comm **msg_ptr, Buf buffer,
 unpack_error:
 	return SLURM_ERROR;
 }
-static void _pack_kvs_data(struct kvs_comm_set *msg_ptr, Buf buffer,
+static void _pack_kvs_data(kvs_comm_set_t *msg_ptr, Buf buffer,
 			   uint16_t protocol_version)
 {
 	int i;
 	xassert(msg_ptr != NULL);
 
 	pack16(msg_ptr->host_cnt, buffer);
-	for (i=0; i<msg_ptr->host_cnt; i++)
+	for (i = 0; i < msg_ptr->host_cnt; i++)
 		_pack_kvs_host_rec(&msg_ptr->kvs_host_ptr[i], buffer,
 				   protocol_version);
 
 	pack16(msg_ptr->kvs_comm_recs, buffer);
-	for (i=0; i<msg_ptr->kvs_comm_recs; i++)
+	for (i = 0; i < msg_ptr->kvs_comm_recs; i++)
 		_pack_kvs_rec(msg_ptr->kvs_comm_ptr[i], buffer,
 			      protocol_version);
 }
 
-static int  _unpack_kvs_data(struct kvs_comm_set **msg_ptr, Buf buffer,
+static int  _unpack_kvs_data(kvs_comm_set_t **msg_ptr, Buf buffer,
 			     uint16_t protocol_version)
 {
-	struct kvs_comm_set *msg;
-	int i, j;
+	kvs_comm_set_t *msg;
+	int i;
 
-	msg = xmalloc(sizeof(struct kvs_comm_set));
+	msg = xmalloc(sizeof(kvs_comm_set_t));
 	*msg_ptr = msg;
 
 	safe_unpack16(&msg->host_cnt, buffer);
 	msg->kvs_host_ptr = xmalloc(sizeof(struct kvs_hosts) *
 				    msg->host_cnt);
-	for (i=0; i<msg->host_cnt; i++) {
+	for (i = 0; i < msg->host_cnt; i++) {
 		if (_unpack_kvs_host_rec(&msg->kvs_host_ptr[i], buffer,
 					 protocol_version))
 			goto unpack_error;
@@ -12925,7 +13827,7 @@ static int  _unpack_kvs_data(struct kvs_comm_set **msg_ptr, Buf buffer,
 	safe_unpack16(&msg->kvs_comm_recs, buffer);
 	msg->kvs_comm_ptr = xmalloc(sizeof(struct kvs_comm) *
 				    msg->kvs_comm_recs);
-	for (i=0; i<msg->kvs_comm_recs; i++) {
+	for (i = 0; i < msg->kvs_comm_recs; i++) {
 		if (_unpack_kvs_rec(&msg->kvs_comm_ptr[i], buffer,
 				    protocol_version))
 			goto unpack_error;
@@ -12933,20 +13835,7 @@ static int  _unpack_kvs_data(struct kvs_comm_set **msg_ptr, Buf buffer,
 	return SLURM_SUCCESS;
 
 unpack_error:
-	for (i=0; i<msg->host_cnt; i++)
-		xfree(msg->kvs_host_ptr[i].hostname);
-	xfree(msg->kvs_host_ptr);
-	for (i=0; i<msg->kvs_comm_recs; i++) {
-		xfree(msg->kvs_comm_ptr[i]->kvs_name);
-		for (j=0; j<msg->kvs_comm_ptr[i]->kvs_cnt; j++) {
-			xfree(msg->kvs_comm_ptr[i]->kvs_keys[j]);
-			xfree(msg->kvs_comm_ptr[i]->kvs_values[j]);
-		}
-		xfree(msg->kvs_comm_ptr[i]->kvs_keys);
-		xfree(msg->kvs_comm_ptr[i]->kvs_values);
-	}
-	xfree(msg->kvs_comm_ptr);
-	xfree(msg);
+	slurm_free_kvs_comm_set(msg);
 	*msg_ptr = NULL;
 	return SLURM_ERROR;
 }
@@ -13162,12 +14051,9 @@ static void
 _pack_set_debug_flags_msg(set_debug_flags_msg_t * msg, Buf buffer,
 			  uint16_t protocol_version)
 {
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack64(msg->debug_flags_minus, buffer);
 		pack64(msg->debug_flags_plus,  buffer);
-	} else {
-		pack32((uint32_t)msg->debug_flags_minus, buffer);
-		pack32((uint32_t)msg->debug_flags_plus,  buffer);
 	}
 }
 
@@ -13180,15 +14066,9 @@ _unpack_set_debug_flags_msg(set_debug_flags_msg_t ** msg_ptr, Buf buffer,
 	msg = xmalloc(sizeof(set_debug_flags_msg_t));
 	*msg_ptr = msg;
 
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack64(&msg->debug_flags_minus, buffer);
 		safe_unpack64(&msg->debug_flags_plus,  buffer);
-	} else {
-		uint32_t tmp_uint32;
-		safe_unpack32(&tmp_uint32, buffer);
-		msg->debug_flags_minus = tmp_uint32;
-		safe_unpack32(&tmp_uint32, buffer);
-		msg->debug_flags_plus = tmp_uint32;
 	}
 
 	return SLURM_SUCCESS;
@@ -13292,15 +14172,7 @@ static void _pack_accounting_update_msg(accounting_update_msg_t *msg,
 	ListIterator itr = NULL;
 	slurmdb_update_object_t *rec = NULL;
 
-	/* We need to work off the version sent in the message since
-	   we might not know what the protocol_version is at this
-	   moment (we might not of been updated before other parts of
-	   SLURM).
-
-	   IN 14.12 we can remove rpc_version from the mix and just
-	   use protocol_version since we standarized them in 14_03.
-	*/
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (msg->update_list)
 			count = list_count(msg->update_list);
 
@@ -13314,21 +14186,6 @@ static void _pack_accounting_update_msg(accounting_update_msg_t *msg,
 			}
 			list_iterator_destroy(itr);
 		}
-	} else {
-		pack16(msg->rpc_version, buffer);
-		if (msg->update_list)
-			count = list_count(msg->update_list);
-
-		pack32(count, buffer);
-
-		if (count) {
-			itr = list_iterator_create(msg->update_list);
-			while ((rec = list_next(itr))) {
-				slurmdb_pack_update_object(
-					rec, msg->rpc_version, buffer);
-			}
-			list_iterator_destroy(itr);
-		}
 	}
 }
 
@@ -13344,7 +14201,7 @@ static int _unpack_accounting_update_msg(accounting_update_msg_t **msg,
 
 	*msg = msg_ptr;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack32(&count, buffer);
 		msg_ptr->update_list = list_create(
 			slurmdb_destroy_update_object);
@@ -13754,7 +14611,7 @@ _unpack_license_info_msg(license_info_msg_t **msg,
 
 	/* load buffer's header (data structure version and time)
 	 */
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 
 		safe_unpack32(&((*msg)->num_lic), buffer);
 		safe_unpack_time(&((*msg)->last_update), buffer);
@@ -13772,7 +14629,8 @@ _unpack_license_info_msg(license_info_msg_t **msg,
 			/* The total number of licenses can decrease
 			 * at runtime.
 			 */
-			if ((*msg)->lic_array[i].total < (*msg)->lic_array[i].in_use)
+			if ((*msg)->lic_array[i].total <
+			    (*msg)->lic_array[i].in_use)
 				(*msg)->lic_array[i].available = 0;
 			else
 				(*msg)->lic_array[i].available =
diff --git a/src/common/slurm_protocol_pack.h b/src/common/slurm_protocol_pack.h
index 2b2c3c14f..e608cb19d 100644
--- a/src/common/slurm_protocol_pack.h
+++ b/src/common/slurm_protocol_pack.h
@@ -171,4 +171,11 @@ extern int slurm_unpack_block_info_msg(
 extern uint16_t task_dist_new2old(uint32_t new_task_dist);
 /* Translate task_dist value from v14.11- format to v15.08+ format */
 extern uint32_t task_dist_old2new(uint16_t old_task_dist);
+
+/* Translate 32-bit nice value to equivalent 16-bit value.
+ * Remove when version 15.08 support is no longer required. */
+extern uint16_t xlate_nice_new2old(uint32_t new_nice);
+/* Translate 16-bit nice value to equivalent 32-bit value.
+ * Remove when version 15.08 support is no longer required. */
+extern uint32_t xlate_nice_old2new(uint16_t old_nice);
 #endif
diff --git a/src/common/slurm_protocol_socket_implementation.c b/src/common/slurm_protocol_socket_implementation.c
index 154f2b8cf..e7082a5fa 100644
--- a/src/common/slurm_protocol_socket_implementation.c
+++ b/src/common/slurm_protocol_socket_implementation.c
@@ -599,7 +599,7 @@ static int _slurm_connect (int __fd, struct sockaddr const * __addr,
 	ufds.revents = 0;
 
 	if (timeout == 0)
-		timeout = slurm_get_msg_timeout() * 1000 / 2;
+		timeout = slurm_get_tcp_timeout() * 1000;
 
 again:	rc = poll(&ufds, 1, timeout);
 	if (rc == -1) {
@@ -712,13 +712,15 @@ static int _slurm_vfcntl(int fd, int cmd, va_list va )
 
 extern void slurm_set_addr_char (slurm_addr_t * addr, uint16_t port, char *host)
 {
+#if 1
+/* NOTE: gethostbyname() is obsolete, but the alternative function (below)
+ * does not work reliably. See bug 2186. */
 	struct hostent * he    = NULL;
 	int	   h_err = 0;
 	char *	   h_buf[4096];
 
 	/*
-	 * If NULL hostname passed in, we only update the port
-	 *   of addr
+	 * If NULL hostname passed in, we only update the port of addr
 	 */
 	addr->sin_family = AF_SLURM;
 	addr->sin_port   = htons(port);
@@ -735,6 +737,40 @@ extern void slurm_set_addr_char (slurm_addr_t * addr, uint16_t port, char *host)
 		addr->sin_port = 0;
 	}
 	return;
+#else
+/* NOTE: getaddrinfo() currently does not support aliases and is failing with
+ * EAGAIN repeatedly in some cases. Comment out this logic until the function
+ * works as designed. See bug 2186. */
+	struct addrinfo *addrs;
+	struct addrinfo *addr_ptr;
+
+	/*
+	 * If NULL hostname passed in, we only update the port of addr
+	 */
+	addr->sin_family = AF_SLURM;
+	addr->sin_port   = htons(port);
+	if (host == NULL)
+		return;
+
+	addrs = get_addr_info(host);
+	for (addr_ptr = addrs; addr_ptr != NULL; addr_ptr = addr_ptr->ai_next) {
+		if (addr_ptr->ai_family == AF_INET)
+			break;
+	}
+	if (addr_ptr) {
+		struct sockaddr_in *addr2;
+		addr2 = (struct sockaddr_in *)addr_ptr->ai_addr;
+		memcpy(&addr->sin_addr.s_addr,
+		       &addr2->sin_addr.s_addr, sizeof(addr2->sin_addr.s_addr));
+	} else {
+		error("%s: Unable to resolve \"%s\"", __func__, host);
+		addr->sin_family = 0;
+		addr->sin_port = 0;
+	}
+
+	if (addrs)
+		free_addr_info(addrs);
+#endif
 }
 
 extern void slurm_get_addr (slurm_addr_t *addr, uint16_t *port, char *host,
diff --git a/src/common/slurm_protocol_util.c b/src/common/slurm_protocol_util.c
index b7cf31f1f..8ecc1d1fd 100644
--- a/src/common/slurm_protocol_util.c
+++ b/src/common/slurm_protocol_util.c
@@ -65,8 +65,8 @@ int check_header_version(header_t * header)
 
 	if (slurmdbd_conf) {
 		if ((header->version != SLURM_PROTOCOL_VERSION)     &&
-		    (header->version != SLURM_14_11_PROTOCOL_VERSION) &&
-		    (header->version != SLURM_14_03_PROTOCOL_VERSION)) {
+		    (header->version != SLURM_15_08_PROTOCOL_VERSION) &&
+		    (header->version != SLURM_14_11_PROTOCOL_VERSION)) {
 			debug("unsupported RPC version %hu msg type %s(%u)",
 			      header->version, rpc_num2string(header->msg_type),
 			      header->msg_type);
@@ -90,8 +90,8 @@ int check_header_version(header_t * header)
 			}
 		default:
 			if ((header->version != SLURM_PROTOCOL_VERSION)     &&
-			    (header->version != SLURM_14_11_PROTOCOL_VERSION) &&
-			    (header->version != SLURM_14_03_PROTOCOL_VERSION)) {
+			    (header->version != SLURM_15_08_PROTOCOL_VERSION) &&
+			    (header->version != SLURM_14_11_PROTOCOL_VERSION)) {
 				debug("Unsupported RPC version %hu "
 				      "msg type %s(%u)", header->version,
 				      rpc_num2string(header->msg_type),
diff --git a/src/common/slurm_resource_info.c b/src/common/slurm_resource_info.c
index fb0f13413..6ecb77f48 100644
--- a/src/common/slurm_resource_info.c
+++ b/src/common/slurm_resource_info.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  slurm_resource_info.c - Functions to determine number of available resources
- *  $Id: slurm_resource_info.c,v 1.12 2006/10/04 21:52:24 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 Hewlett-Packard Development Company, L.P.
  *  Written by Susanne M. Balle, <susanne.balle@hp.com>
@@ -92,7 +91,7 @@ static bool _have_task_affinity(void)
 	bool rc = true;
 	char *plugin_name = slurm_get_task_plugin();
 
-	if (plugin_name && !strcmp(plugin_name, "task/none"))
+	if (plugin_name && !xstrcmp(plugin_name, "task/none"))
 		rc = false;
 	xfree(plugin_name);
 	return rc;
@@ -295,7 +294,7 @@ int slurm_verify_cpu_bind(const char *arg, char **cpu_bind,
 
 	p = buf;
 	while ((tok = strsep(&p, ";"))) {
-		if (strcasecmp(tok, "help") == 0) {
+		if (xstrcasecmp(tok, "help") == 0) {
 			slurm_print_cpu_bind_help();
 			return 1;
 		}
@@ -304,19 +303,19 @@ int slurm_verify_cpu_bind(const char *arg, char **cpu_bind,
 			     "binding");
 			log_binding = false;
 		}
-		if ((strcasecmp(tok, "q") == 0) ||
-			   (strcasecmp(tok, "quiet") == 0)) {
+		if ((xstrcasecmp(tok, "q") == 0) ||
+			   (xstrcasecmp(tok, "quiet") == 0)) {
 		        *flags &= ~CPU_BIND_VERBOSE;
-		} else if ((strcasecmp(tok, "v") == 0) ||
-			   (strcasecmp(tok, "verbose") == 0)) {
+		} else if ((xstrcasecmp(tok, "v") == 0) ||
+			   (xstrcasecmp(tok, "verbose") == 0)) {
 		        *flags |= CPU_BIND_VERBOSE;
-		} else if ((strcasecmp(tok, "one_thread") == 0)) {
+		} else if ((xstrcasecmp(tok, "one_thread") == 0)) {
 		        *flags |= CPU_BIND_ONE_THREAD_PER_CORE;
-		} else if ((strcasecmp(tok, "no") == 0) ||
-			   (strcasecmp(tok, "none") == 0)) {
+		} else if ((xstrcasecmp(tok, "no") == 0) ||
+			   (xstrcasecmp(tok, "none") == 0)) {
 			_clear_then_set((int *)flags, bind_bits, CPU_BIND_NONE);
 			xfree(*cpu_bind);
-		} else if (strcasecmp(tok, "rank") == 0) {
+		} else if (xstrcasecmp(tok, "rank") == 0) {
 			_clear_then_set((int *)flags, bind_bits, CPU_BIND_RANK);
 			xfree(*cpu_bind);
 		} else if ((strncasecmp(tok, "map_cpu", 7) == 0) ||
@@ -349,7 +348,7 @@ int slurm_verify_cpu_bind(const char *arg, char **cpu_bind,
 				xfree(buf);
 				return -1;
 			}
-		} else if (strcasecmp(tok, "rank_ldom") == 0) {
+		} else if (xstrcasecmp(tok, "rank_ldom") == 0) {
 			_clear_then_set((int *)flags, bind_bits,
 					CPU_BIND_LDRANK);
 			xfree(*cpu_bind);
@@ -385,68 +384,63 @@ int slurm_verify_cpu_bind(const char *arg, char **cpu_bind,
 				xfree(buf);
 				return -1;
 			}
-		} else if ((strcasecmp(tok, "socket") == 0) ||
-		           (strcasecmp(tok, "sockets") == 0)) {
+		} else if ((xstrcasecmp(tok, "socket") == 0) ||
+		           (xstrcasecmp(tok, "sockets") == 0)) {
 			if (task_plugin_param &
 			    (CPU_BIND_NONE | CPU_BIND_TO_CORES |
 			     CPU_BIND_TO_THREADS | CPU_BIND_TO_LDOMS |
 			     CPU_BIND_TO_BOARDS)) {
-				error("--cpu_bind=sockets incompatible with "
+				debug("--cpu_bind=sockets incompatible with "
 				      "TaskPluginParam configuration "
 				      "parameter");
-				return -1;
 			}
 			_clear_then_set((int *)flags, bind_to_bits,
 				       CPU_BIND_TO_SOCKETS);
-		} else if ((strcasecmp(tok, "core") == 0) ||
-		           (strcasecmp(tok, "cores") == 0)) {
+		} else if ((xstrcasecmp(tok, "core") == 0) ||
+		           (xstrcasecmp(tok, "cores") == 0)) {
 			if (task_plugin_param &
 			    (CPU_BIND_NONE | CPU_BIND_TO_SOCKETS |
 			     CPU_BIND_TO_THREADS | CPU_BIND_TO_LDOMS |
 			     CPU_BIND_TO_BOARDS)) {
-				error("--cpu_bind=cores incompatible with "
+				debug("--cpu_bind=cores incompatible with "
 				      "TaskPluginParam configuration "
 				      "parameter");
-				return -1;
 			}
 			_clear_then_set((int *)flags, bind_to_bits,
 				       CPU_BIND_TO_CORES);
-		} else if ((strcasecmp(tok, "thread") == 0) ||
-		           (strcasecmp(tok, "threads") == 0)) {
+		} else if ((xstrcasecmp(tok, "thread") == 0) ||
+		           (xstrcasecmp(tok, "threads") == 0)) {
 			if (task_plugin_param &
 			    (CPU_BIND_NONE | CPU_BIND_TO_SOCKETS |
 			     CPU_BIND_TO_CORES | CPU_BIND_TO_LDOMS |
 			     CPU_BIND_TO_BOARDS)) {
-				error("--cpu_bind=threads incompatible with "
+				debug("--cpu_bind=threads incompatible with "
 				      "TaskPluginParam configuration "
 				      "parameter");
-				return -1;
 			}
 			_clear_then_set((int *)flags, bind_to_bits,
 				       CPU_BIND_TO_THREADS);
-		} else if ((strcasecmp(tok, "ldom") == 0) ||
-		           (strcasecmp(tok, "ldoms") == 0)) {
+		} else if ((xstrcasecmp(tok, "ldom") == 0) ||
+		           (xstrcasecmp(tok, "ldoms") == 0)) {
 			if (task_plugin_param &
 			    (CPU_BIND_NONE | CPU_BIND_TO_SOCKETS |
 			     CPU_BIND_TO_CORES | CPU_BIND_TO_THREADS |
 			     CPU_BIND_TO_BOARDS)) {
-				error("--cpu_bind=threads incompatible with "
+				debug("--cpu_bind=threads incompatible with "
 				      "TaskPluginParam configuration "
 				      "parameter");
-				return -1;
 			}
 			_clear_then_set((int *)flags, bind_to_bits,
 				       CPU_BIND_TO_LDOMS);
-		} else if ((strcasecmp(tok, "board") == 0) ||
-		           (strcasecmp(tok, "boards") == 0)) {
+		} else if ((xstrcasecmp(tok, "board") == 0) ||
+		           (xstrcasecmp(tok, "boards") == 0)) {
 			if (task_plugin_param &
 			    (CPU_BIND_NONE | CPU_BIND_TO_SOCKETS |
 			     CPU_BIND_TO_CORES | CPU_BIND_TO_THREADS |
 			     CPU_BIND_TO_LDOMS)) {
-				error("--cpu_bind=threads incompatible with "
+				debug("--cpu_bind=threads incompatible with "
 				      "TaskPluginParam configuration "
 				      "parameter");
-				return -1;
 			}
 			_clear_then_set((int *)flags, bind_to_bits,
 				       CPU_BIND_TO_BOARDS);
@@ -458,6 +452,22 @@ int slurm_verify_cpu_bind(const char *arg, char **cpu_bind,
 	}
 	xfree(buf);
 
+	/* Set system default CPU binding as needed */
+	if ((*flags & (~CPU_BIND_VERBOSE)) == 0) {
+                if (task_plugin_param & CPU_BIND_NONE)
+                        *flags = CPU_BIND_NONE;
+                else if (task_plugin_param & CPU_BIND_TO_SOCKETS)
+                        *flags = CPU_BIND_TO_SOCKETS;
+                else if (task_plugin_param & CPU_BIND_TO_CORES)
+                        *flags = CPU_BIND_TO_CORES;
+                else if (task_plugin_param & CPU_BIND_TO_THREADS)
+                        *flags |= CPU_BIND_TO_THREADS;
+                else if (task_plugin_param & CPU_BIND_TO_LDOMS)
+                        *flags |= CPU_BIND_TO_LDOMS;
+                else if (task_plugin_param & CPU_BIND_TO_BOARDS)
+                        *flags |= CPU_BIND_TO_BOARDS;
+	}
+
 	return 0;
 }
 
@@ -513,25 +523,25 @@ int slurm_verify_mem_bind(const char *arg, char **mem_bind,
 
 	p = buf;
 	while ((tok = strsep(&p, ";"))) {
-		if (strcasecmp(tok, "help") == 0) {
+		if (xstrcasecmp(tok, "help") == 0) {
 			slurm_print_mem_bind_help();
 			return 1;
 
-		} else if ((strcasecmp(tok, "q") == 0) ||
-			   (strcasecmp(tok, "quiet") == 0)) {
+		} else if ((xstrcasecmp(tok, "q") == 0) ||
+			   (xstrcasecmp(tok, "quiet") == 0)) {
 		        *flags &= ~MEM_BIND_VERBOSE;
-		} else if ((strcasecmp(tok, "v") == 0) ||
-			   (strcasecmp(tok, "verbose") == 0)) {
+		} else if ((xstrcasecmp(tok, "v") == 0) ||
+			   (xstrcasecmp(tok, "verbose") == 0)) {
 		        *flags |= MEM_BIND_VERBOSE;
-		} else if ((strcasecmp(tok, "no") == 0) ||
-			   (strcasecmp(tok, "none") == 0)) {
+		} else if ((xstrcasecmp(tok, "no") == 0) ||
+			   (xstrcasecmp(tok, "none") == 0)) {
 			_clear_then_set((int *)flags, bind_bits, MEM_BIND_NONE);
 			xfree(*mem_bind);
-		} else if (strcasecmp(tok, "rank") == 0) {
+		} else if (xstrcasecmp(tok, "rank") == 0) {
 			_clear_then_set((int *)flags, bind_bits, MEM_BIND_RANK);
 			xfree(*mem_bind);
-		} else if (strcasecmp(tok, "local") == 0) {
-			_clear_then_set((int *)flags, bind_bits, MEM_BIND_LOCAL);
+		} else if (xstrcasecmp(tok, "local") == 0) {
+			_clear_then_set((int *)flags, bind_bits,MEM_BIND_LOCAL);
 			xfree(*mem_bind);
 		} else if ((strncasecmp(tok, "map_mem", 7) == 0) ||
 		           (strncasecmp(tok, "mapmem", 6) == 0)) {
diff --git a/src/common/slurm_resource_info.h b/src/common/slurm_resource_info.h
index c979a4c88..202846785 100644
--- a/src/common/slurm_resource_info.h
+++ b/src/common/slurm_resource_info.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  resource_info.h - Functions to determine number of available resources
- *  $Id: slurm_resource_info.h,v 1.6 2006/10/04 18:53:13 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 Hewlett-Packard Development Company, L.P.
  *  Written by Susanne M. Balle, <susanne.balle@hp.com>
diff --git a/src/common/slurm_rlimits_info.c b/src/common/slurm_rlimits_info.c
index 8276920e4..cdea04adf 100644
--- a/src/common/slurm_rlimits_info.c
+++ b/src/common/slurm_rlimits_info.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  slurm_rlimits_info.c - resource limits that are used by srun and the slurmd
- *  $Id: slurm.hp.rlimits.patch,v 1.5 2005/07/18 18:39:11 danielc Exp $
  *****************************************************************************
- *
  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
  *
  *  This file is part of SLURM, a resource management program.
@@ -126,12 +124,12 @@ parse_rlimits( char *rlimits_str, int propagate_flag )
 
 	xassert( rlimits_str );
 
-	if (strcmp(rlimits_str, "NONE") == 0) {
+	if (xstrcmp(rlimits_str, "NONE") == 0) {
 		propagate_none = true;
 		propagate_flag = !propagate_flag;
 	}
 
-	if (propagate_none || strcmp( rlimits_str, "ALL" ) == 0) {
+	if (propagate_none || xstrcmp( rlimits_str, "ALL" ) == 0) {
 		/*
 		 * Propagate flag value applies to all rlimits
 		 */
@@ -158,9 +156,9 @@ parse_rlimits( char *rlimits_str, int propagate_flag )
 				/*
 				 * Accept either "RLIMIT_CORE" or "CORE"
 				 */
-				if (strncmp( tp, RLIMIT_, LEN_RLIMIT_ ) == 0)
+				if (xstrncmp( tp, RLIMIT_, LEN_RLIMIT_ ) == 0)
 					tp += LEN_RLIMIT_;
-				if (strcmp( tp, rli->name ))
+				if (xstrcmp( tp, rli->name ))
 					continue;
 				rli->propagate_flag = propagate_flag;
 				found = TRUE;
diff --git a/src/common/slurm_rlimits_info.h b/src/common/slurm_rlimits_info.h
index 2b5c07a8b..cc3c66744 100644
--- a/src/common/slurm_rlimits_info.h
+++ b/src/common/slurm_rlimits_info.h
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  slurm_rlimits_info.h - resource limits that are used by srun and the slurmd
- * $Id: slurm.hp.rlimits.patch,v 1.5 2005/07/18 18:39:11 danielc Exp $
  *****************************************************************************
- *
  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
  *
  *  This file is part of SLURM, a resource management program.
diff --git a/src/common/slurm_route.c b/src/common/slurm_route.c
index f7d30297b..8d473c82d 100644
--- a/src/common/slurm_route.c
+++ b/src/common/slurm_route.c
@@ -63,7 +63,7 @@ strong_alias(route_split_hostlist_treewidth,
 typedef struct slurm_route_ops {
 	int  (*split_hostlist)    (hostlist_t hl,
 				   hostlist_t** sp_hl,
-				   int* count);
+				   int* count, uint16_t tree_width);
 	int  (*reconfigure)       (void);
 	slurm_addr_t* (*next_collector) (bool* is_collector);
 	slurm_addr_t* (*next_collector_backup) (void);
@@ -84,7 +84,7 @@ static plugin_context_t	*g_context = NULL;
 static pthread_mutex_t g_context_lock = PTHREAD_MUTEX_INITIALIZER;
 static bool init_run = false;
 static uint32_t debug_flags = 0;
-static uint16_t tree_width;
+static uint16_t g_tree_width;
 static bool this_is_collector = false; /* this node is a collector node */
 static slurm_addr_t *msg_collect_node = NULL; /* address of node to aggregate
 						 messages from this node */
@@ -155,7 +155,7 @@ static void _set_collectors(char *this_node_name)
 	backup_port = parent_port;
 	slurm_conf_unlock();
 	while (1) {
-		if ( route_g_split_hostlist(nodes, &hll, &hl_count) ) {
+		if (route_g_split_hostlist(nodes, &hll, &hl_count, 0)) {
 			error("unable to split forward hostlist");
 			goto clean; /* collector addrs remains null */
 		}
@@ -235,7 +235,7 @@ static void _set_collectors(char *this_node_name)
 		/* set our parent, backup, and continue search */
 		parent = hostlist_shift(nodes);
 		backup = hostlist_nth(nodes, 0);
-		if (strcmp(backup, this_node_name) == 0) {
+		if (xstrcmp(backup, this_node_name) == 0) {
 			free(backup);
 			backup = NULL;
 			if (hostlist_count(nodes) > 1)
@@ -298,7 +298,7 @@ extern int route_init(char *node_name)
 		goto done;
 	}
 
-	tree_width = slurm_get_tree_width();
+	g_tree_width = slurm_get_tree_width();
 	debug_flags = slurm_get_debug_flags();
 
 	init_run = true;
@@ -351,7 +351,7 @@ extern int route_fini(void)
  */
 extern int route_g_split_hostlist(hostlist_t hl,
 				  hostlist_t** sp_hl,
-				  int* count)
+				  int* count, uint16_t tree_width)
 {
 	int rc;
 	int j, nnodes, nnodex;
@@ -366,11 +366,13 @@ extern int route_g_split_hostlist(hostlist_t hl,
 		 * split_hostlise call.  */
 		nnodes = hostlist_count(hl);
 		buf = hostlist_ranged_string_xmalloc(hl);
-		info("ROUTE: split_hostlist: hl=%s",buf);
+		info("ROUTE: split_hostlist: hl=%s tree_width %u",
+		     buf, tree_width);
 		xfree(buf);
 	}
 
-	rc = (*(ops.split_hostlist))(hl, sp_hl, count);
+	rc = (*(ops.split_hostlist))(hl, sp_hl, count,
+				     tree_width ? tree_width : g_tree_width);
 	if (debug_flags & DEBUG_FLAG_ROUTE) {
 		/* Sanity check to make sure all nodes in msg list are in
 		 * a child list */
@@ -400,7 +402,7 @@ extern int route_g_reconfigure(void)
 	if (route_init(NULL) != SLURM_SUCCESS)
 		return SLURM_ERROR;
 	debug_flags = slurm_get_debug_flags();
-	tree_width = slurm_get_tree_width();
+	g_tree_width = slurm_get_tree_width();
 
 	return (*(ops.reconfigure))();
 }
@@ -464,7 +466,7 @@ extern slurm_addr_t* route_g_next_collector_backup(void)
  */
 extern int route_split_hostlist_treewidth(hostlist_t hl,
 					  hostlist_t** sp_hl,
-					  int* count)
+					  int* count, uint16_t tree_width)
 {
 	int host_count;
 	int *span = NULL;
@@ -473,6 +475,9 @@ extern int route_split_hostlist_treewidth(hostlist_t hl,
 	int nhl = 0;
 	int j;
 
+	if (!tree_width)
+		tree_width = g_tree_width;
+
 	host_count = hostlist_count(hl);
 	span = set_span(host_count, tree_width);
 	*sp_hl = (hostlist_t*) xmalloc(tree_width * sizeof(hostlist_t));
diff --git a/src/common/slurm_route.h b/src/common/slurm_route.h
index fc85a2172..5a6d230a3 100644
--- a/src/common/slurm_route.h
+++ b/src/common/slurm_route.h
@@ -72,6 +72,7 @@ extern int route_fini(void);
  *                                as similar code replaced in forward.c
  * OUT: sp_hl    - hostlist_t** - the array of hostlists that will be malloced
  * OUT: count    - int*         - the count of created hostlists
+ * IN: tree_width- int          - Max width of each branch on the tree.
  * RET: SLURM_SUCCESS - int
  *
  * Note: created hostlist will have to be freed independently using
@@ -80,7 +81,7 @@ extern int route_fini(void);
  */
 extern int route_g_split_hostlist(hostlist_t hl,
 				  hostlist_t** sp_hl,
-				  int* count);
+				  int* count, uint16_t tree_width);
 
 /*
  * route_g_reconfigure - reset during reconfigure
@@ -123,6 +124,7 @@ extern slurm_addr_t* route_g_next_collector_backup ( void );
  *                                as similar code replaced in forward.c
  * OUT: sp_hl    - hostlist_t** - the array of hostlists that will be malloced
  * OUT: count    - int*         - the count of created hostlists
+ * IN: tree_width- int          - Max width of each branch on the tree.
  * RET: SLURM_SUCCESS - int
  *
  * Note: created hostlist will have to be freed independently using
@@ -131,7 +133,7 @@ extern slurm_addr_t* route_g_next_collector_backup ( void );
  */
 extern int route_split_hostlist_treewidth(hostlist_t hl,
 					  hostlist_t** sp_hl,
-					  int* count);
+					  int* count, uint16_t tree_width);
 
 /*
  * route_next_collector - return address of next collector
diff --git a/src/common/slurm_selecttype_info.c b/src/common/slurm_selecttype_info.c
index 1ccda85df..aaaaf1823 100644
--- a/src/common/slurm_selecttype_info.c
+++ b/src/common/slurm_selecttype_info.c
@@ -57,52 +57,52 @@ int parse_select_type_param(char *select_type_parameters, uint16_t *param)
 	st_str = xstrdup(select_type_parameters);
 	str_parameters = strtok(st_str,",");
 	while (str_parameters) {
-		if (!strcasecmp(str_parameters, "CR_Socket")) {
+		if (!xstrcasecmp(str_parameters, "CR_Socket")) {
 			*param |= CR_SOCKET;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_Socket_Memory")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_Socket_Memory")) {
 			*param |= CR_SOCKET;
 			*param |= CR_MEMORY;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_Core")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_Core")) {
 			*param |= CR_CORE;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_Core_Memory")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_Core_Memory")) {
 			*param |= CR_CORE;
 			*param |= CR_MEMORY;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_Memory")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_Memory")) {
 			*param |= CR_MEMORY;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_CPU")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_CPU")) {
 			*param |= CR_CPU;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "CR_CPU_Memory")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_CPU_Memory")) {
 			*param |= CR_CPU;
 			*param |= CR_MEMORY;
 			param_cnt++;
-		} else if (!strcasecmp(str_parameters, "other_cons_res")) {
+		} else if (!xstrcasecmp(str_parameters, "other_cons_res")) {
 			*param |= CR_OTHER_CONS_RES;
-		} else if (!strcasecmp(str_parameters,
+		} else if (!xstrcasecmp(str_parameters,
 				       "CR_ALLOCATE_FULL_SOCKET")) {
 			verbose("CR_ALLOCATE_FULL_SOCKET is deprecated.  "
 				"It is now the default for CR_SOCKET*.  "
 				"It is safe to remove it "
 				"from your slurm.conf");
-		} else if (!strcasecmp(str_parameters,
+		} else if (!xstrcasecmp(str_parameters,
 				       "CR_ONE_TASK_PER_CORE")) {
 			*param |= CR_ONE_TASK_PER_CORE;
-		} else if (!strcasecmp(str_parameters,
+		} else if (!xstrcasecmp(str_parameters,
 				       "CR_CORE_DEFAULT_DIST_BLOCK")) {
 			*param |= CR_CORE_DEFAULT_DIST_BLOCK;
-		} else if (!strcasecmp(str_parameters, "CR_LLN")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_LLN")) {
 			*param |= CR_LLN;
-		} else if (!strcasecmp(str_parameters, "NHC_No")) {
+		} else if (!xstrcasecmp(str_parameters, "NHC_No")) {
 			*param |= CR_NHC_STEP_NO;
 			*param |= CR_NHC_NO;
-		} else if (!strcasecmp(str_parameters, "NHC_No_Steps")) {
+		} else if (!xstrcasecmp(str_parameters, "NHC_No_Steps")) {
 			*param |= CR_NHC_STEP_NO;
-		} else if (!strcasecmp(str_parameters, "CR_PACK_NODES")) {
+		} else if (!xstrcasecmp(str_parameters, "CR_PACK_NODES")) {
 			*param |= CR_PACK_NODES;
 		} else {
 			error("Bad SelectTypeParameter: %s", str_parameters);
diff --git a/src/common/slurm_step_layout.c b/src/common/slurm_step_layout.c
index 38ef01fda..911555c5f 100644
--- a/src/common/slurm_step_layout.c
+++ b/src/common/slurm_step_layout.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  slurm_step_layout.c - functions to distribute tasks over nodes.
- *  $Id$
  *****************************************************************************
- *
  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
  *  Written by Chris Holmes, <cholmes@hp.com>, who borrowed heavily
  *  from other parts of SLURM.
@@ -243,6 +241,7 @@ extern slurm_step_layout_t *slurm_step_layout_copy(
 	layout = xmalloc(sizeof(slurm_step_layout_t));
 	layout->node_list = xstrdup(step_layout->node_list);
 	layout->node_cnt = step_layout->node_cnt;
+	layout->start_protocol_ver = step_layout->start_protocol_ver;
 	layout->task_cnt = step_layout->task_cnt;
 	layout->task_dist = step_layout->task_dist;
 
@@ -265,7 +264,26 @@ extern void pack_slurm_step_layout(slurm_step_layout_t *step_layout,
 {
 	uint32_t i = 0;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (step_layout)
+			i = 1;
+
+		pack16(i, buffer);
+		if (!i)
+			return;
+		packstr(step_layout->front_end, buffer);
+		packstr(step_layout->node_list, buffer);
+		pack32(step_layout->node_cnt, buffer);
+		pack16(step_layout->start_protocol_ver, buffer);
+		pack32(step_layout->task_cnt, buffer);
+		pack32(step_layout->task_dist, buffer);
+
+		for (i = 0; i < step_layout->node_cnt; i++) {
+			pack32_array(step_layout->tids[i],
+				     step_layout->tasks[i],
+				     buffer);
+		}
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		if (step_layout)
 			i = 1;
 
@@ -317,12 +335,40 @@ extern int unpack_slurm_step_layout(slurm_step_layout_t **layout, Buf buffer,
 	slurm_step_layout_t *step_layout = NULL;
 	int i;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack16(&uint16_tmp, buffer);
+		if (!uint16_tmp)
+			return SLURM_SUCCESS;
+
+		step_layout = xmalloc(sizeof(slurm_step_layout_t));
+		*layout = step_layout;
+
+		safe_unpackstr_xmalloc(&step_layout->front_end,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&step_layout->node_list,
+				       &uint32_tmp, buffer);
+		safe_unpack32(&step_layout->node_cnt, buffer);
+		safe_unpack16(&step_layout->start_protocol_ver, buffer);
+		safe_unpack32(&step_layout->task_cnt, buffer);
+		safe_unpack32(&step_layout->task_dist, buffer);
+
+		step_layout->tasks =
+			xmalloc(sizeof(uint32_t) * step_layout->node_cnt);
+		step_layout->tids = xmalloc(sizeof(uint32_t *)
+					    * step_layout->node_cnt);
+		for (i = 0; i < step_layout->node_cnt; i++) {
+			safe_unpack32_array(&(step_layout->tids[i]),
+					    &num_tids,
+					    buffer);
+			step_layout->tasks[i] = num_tids;
+		}
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack16(&uint16_tmp, buffer);
 		if (!uint16_tmp)
 			return SLURM_SUCCESS;
 
 		step_layout = xmalloc(sizeof(slurm_step_layout_t));
+		step_layout->start_protocol_ver = protocol_version;
 		*layout = step_layout;
 
 		safe_unpackstr_xmalloc(&step_layout->front_end,
@@ -350,6 +396,7 @@ extern int unpack_slurm_step_layout(slurm_step_layout_t **layout, Buf buffer,
 			return SLURM_SUCCESS;
 
 		step_layout = xmalloc(sizeof(slurm_step_layout_t));
+		step_layout->start_protocol_ver = protocol_version;
 		*layout = step_layout;
 
 		safe_unpackstr_xmalloc(&step_layout->front_end,
@@ -553,7 +600,7 @@ static int _task_layout_hostfile(slurm_step_layout_t *step_layout,
 	while((host = hostlist_next(itr))) {
 		step_layout->tasks[i] = 0;
 		while((host_task = hostlist_next(itr_task))) {
-			if (!strcmp(host, host_task)) {
+			if (!xstrcmp(host, host_task)) {
 				step_layout->tasks[i]++;
 				task_cnt++;
 			}
@@ -570,7 +617,7 @@ static int _task_layout_hostfile(slurm_step_layout_t *step_layout,
 		j = 0;
 		hostlist_iterator_reset(itr_task);
 		while((host_task = hostlist_next(itr_task))) {
-			if (!strcmp(host, host_task)) {
+			if (!xstrcmp(host, host_task)) {
 				step_layout->tids[i][j] = taskid;
 				j++;
 			}
diff --git a/src/common/slurm_step_layout.h b/src/common/slurm_step_layout.h
index 3e32e94f5..c3583209d 100644
--- a/src/common/slurm_step_layout.h
+++ b/src/common/slurm_step_layout.h
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  slurm_step_layout.c - function to distribute tasks over nodes.
- *  $Id: slurm.hp.elan.patch,v 1.1 2005/07/28 04:08:19 cholmes Exp $
  *****************************************************************************
- *
  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
  *  Written by Chris Holmes, <cholmes@hp.com>, who borrowed heavily
  *  from other parts of SLURM.
diff --git a/src/common/slurmdb_defs.c b/src/common/slurmdb_defs.c
index 3fc04c976..3c326e71c 100644
--- a/src/common/slurmdb_defs.c
+++ b/src/common/slurmdb_defs.c
@@ -163,7 +163,7 @@ static int _sort_children_list(void *v1, void *v2)
 		return 1;
 
 	/* Sort by alpha */
-	diff = strcmp(assoc_a->sort_name, assoc_b->sort_name);
+	diff = xstrcmp(assoc_a->sort_name, assoc_b->sort_name);
 
 	if (diff < 0)
 		return -1;
@@ -385,9 +385,9 @@ static int _sort_local_cluster(void *v1, void *v2)
 	else if (rec_a->preempt_cnt > rec_b->preempt_cnt)
 		return 1;
 
-	if (!strcmp(local_cluster_name, rec_a->cluster_rec->name))
+	if (!xstrcmp(local_cluster_name, rec_a->cluster_rec->name))
 		return -1;
-	else if (!strcmp(local_cluster_name, rec_b->cluster_rec->name))
+	else if (!xstrcmp(local_cluster_name, rec_b->cluster_rec->name))
 		return 1;
 
 	return 0;
@@ -470,6 +470,85 @@ static int _set_qos_bit_from_string(bitstr_t *valid_qos, char *name)
 	return SLURM_SUCCESS;
 }
 
+static int _find_arch_in_list(void *x, void *key)
+{
+	slurmdb_hierarchical_rec_t *arch_rec = (slurmdb_hierarchical_rec_t *)x;
+	slurmdb_assoc_rec_t *assoc_rec = (slurmdb_assoc_rec_t *)key;
+
+	if ((assoc_rec->parent_id == arch_rec->assoc->id) &&
+	    !xstrcmp(assoc_rec->cluster, arch_rec->assoc->cluster))
+		return 1;
+
+	return 0;
+}
+
+static void _add_arch_rec(slurmdb_assoc_rec_t *assoc_rec,
+			  List arch_rec_list, List total_arch_list)
+{
+	slurmdb_hierarchical_rec_t *arch_rec =
+		xmalloc(sizeof(slurmdb_hierarchical_rec_t));
+
+	arch_rec->children =
+		list_create(slurmdb_destroy_hierarchical_rec);
+	arch_rec->assoc = assoc_rec;
+
+	if (!assoc_rec->parent_id)
+		arch_rec->sort_name = assoc_rec->cluster;
+	else if (assoc_rec->user)
+		arch_rec->sort_name = assoc_rec->user;
+	else
+		arch_rec->sort_name = assoc_rec->acct;
+
+	assoc_rec->rgt = 0;
+	list_append(arch_rec_list, arch_rec);
+	list_append(total_arch_list, arch_rec);
+}
+
+static void _find_create_parent(slurmdb_assoc_rec_t *assoc_rec, List assoc_list,
+				List arch_rec_list, List total_arch_list)
+{
+	slurmdb_assoc_rec_t *par_assoc_rec = NULL;
+	slurmdb_hierarchical_rec_t *par_arch_rec = NULL;
+
+	if (assoc_rec->parent_id) {
+		if ((par_arch_rec = list_find_first(
+			    total_arch_list, _find_arch_in_list,
+			    assoc_rec))) {
+
+			_add_arch_rec(assoc_rec, par_arch_rec->children,
+				      total_arch_list);
+			return;
+		}
+
+		if (!(par_assoc_rec = list_find_first(
+			      assoc_list, slurmdb_find_assoc_in_list,
+			      &assoc_rec->parent_id))) {
+
+			/* This means we weren't starting at root */
+			_add_arch_rec(assoc_rec, arch_rec_list,
+				      total_arch_list);
+			return;
+		}
+
+		_find_create_parent(par_assoc_rec, assoc_list, arch_rec_list,
+				    total_arch_list);
+		/* Now that it has been added lets try again */
+		if ((par_arch_rec = list_find_first(
+			    total_arch_list, _find_arch_in_list,
+			    assoc_rec))) {
+
+			_add_arch_rec(assoc_rec, par_arch_rec->children,
+				      total_arch_list);
+			return;
+		}
+		error("%s: no parent found, this should never happen",
+		      __func__);
+	} else
+		_add_arch_rec(assoc_rec, arch_rec_list, total_arch_list);
+
+	return;
+}
+
 extern slurmdb_job_rec_t *slurmdb_create_job_rec()
 {
 	slurmdb_job_rec_t *job = xmalloc(sizeof(slurmdb_job_rec_t));
@@ -562,6 +641,7 @@ extern void slurmdb_destroy_qos_usage(void *object)
 		(slurmdb_qos_usage_t *)object;
 
 	if (usage) {
+		FREE_NULL_LIST(usage->acct_limit_list);
 		FREE_NULL_LIST(usage->job_list);
 		FREE_NULL_LIST(usage->user_limit_list);
 		xfree(usage->grp_used_tres_run_secs);
@@ -752,8 +832,12 @@ extern void slurmdb_free_qos_rec_members(slurmdb_qos_rec_t *qos)
 		xfree(qos->grp_tres_run_mins_ctld);
 		xfree(qos->max_tres_mins_pj);
 		xfree(qos->max_tres_mins_pj_ctld);
+		xfree(qos->max_tres_run_mins_pa);
+		xfree(qos->max_tres_run_mins_pa_ctld);
 		xfree(qos->max_tres_run_mins_pu);
 		xfree(qos->max_tres_run_mins_pu_ctld);
+		xfree(qos->max_tres_pa);
+		xfree(qos->max_tres_pa_ctld);
 		xfree(qos->max_tres_pj);
 		xfree(qos->max_tres_pj_ctld);
 		xfree(qos->max_tres_pn);
@@ -1120,6 +1204,7 @@ extern void slurmdb_destroy_used_limits(void *object)
 		(slurmdb_used_limits_t *)object;
 
 	if (slurmdb_used_limits) {
+		xfree(slurmdb_used_limits->acct);
 		xfree(slurmdb_used_limits->tres);
 		xfree(slurmdb_used_limits->tres_run_mins);
 		xfree(slurmdb_used_limits);
@@ -1210,7 +1295,7 @@ extern List slurmdb_get_info_cluster(char *cluster_names)
 	ListIterator itr, itr2;
 	bool all_clusters = 0;
 
-	if (cluster_names && !strcmp(cluster_names, "all"))
+	if (cluster_names && !xstrcmp(cluster_names, "all"))
 		all_clusters = 1;
 
 	cluster_name = slurm_get_cluster_name();
@@ -1239,7 +1324,7 @@ extern List slurmdb_get_info_cluster(char *cluster_names)
 		itr2 = list_iterator_create(cluster_cond.cluster_list);
 		while ((cluster_name = list_next(itr2))) {
 			while ((cluster_rec = list_next(itr))) {
-				if (!strcmp(cluster_name, cluster_rec->name))
+				if (!xstrcmp(cluster_name, cluster_rec->name))
 					break;
 			}
 			if (!cluster_rec) {
@@ -1356,10 +1441,14 @@ extern void slurmdb_init_qos_rec(slurmdb_qos_rec_t *qos, bool free_it,
 	qos->grp_wall = init_val;
 
 	/* qos->max_tres_mins_pj = NULL; */
+	/* qos->max_tres_run_mins_pa = NULL; */
 	/* qos->max_tres_run_mins_pu = NULL; */
+	/* qos->max_tres_pa = NULL; */
 	/* qos->max_tres_pj = NULL; */
 	/* qos->max_tres_pu = NULL; */
+	qos->max_jobs_pa = init_val;
 	qos->max_jobs_pu = init_val;
+	qos->max_submit_jobs_pa = init_val;
 	qos->max_submit_jobs_pu = init_val;
 	qos->max_wall_pj = init_val;
 
@@ -1477,7 +1566,7 @@ extern uint32_t str_2_slurmdb_qos(List qos_list, char *level)
 
 	itr = list_iterator_create(qos_list);
 	while((qos = list_next(itr))) {
-		if (!strcasecmp(working_level, qos->name))
+		if (!xstrcasecmp(working_level, qos->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1665,12 +1754,20 @@ extern slurmdb_admin_level_t str_2_slurmdb_admin_level(char *level)
 
 /* This reorders the list into a alphabetical hierarchy returned in a
  * separate list.  The orginal list is not affected */
-extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list)
+extern List slurmdb_get_hierarchical_sorted_assoc_list(
+	List assoc_list, bool use_lft)
 {
-	List slurmdb_hierarchical_rec_list =
-		slurmdb_get_acct_hierarchical_rec_list(assoc_list);
+	List slurmdb_hierarchical_rec_list;
 	List ret_list = list_create(NULL);
 
+	if (use_lft)
+		slurmdb_hierarchical_rec_list =
+			slurmdb_get_acct_hierarchical_rec_list(assoc_list);
+	else
+		slurmdb_hierarchical_rec_list =
+			slurmdb_get_acct_hierarchical_rec_list_no_lft(
+				assoc_list);
+
 	_append_hierarchical_children_ret_list(ret_list,
 					       slurmdb_hierarchical_rec_list);
 	FREE_NULL_LIST(slurmdb_hierarchical_rec_list);
@@ -1679,14 +1776,23 @@ extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list)
 }
 
 /* This reorders the list into a alphabetical hierarchy. */
-extern void slurmdb_sort_hierarchical_assoc_list(List assoc_list)
+extern void slurmdb_sort_hierarchical_assoc_list(
+	List assoc_list, bool use_lft)
 {
-	List slurmdb_hierarchical_rec_list =
-		slurmdb_get_acct_hierarchical_rec_list(assoc_list);
+	List slurmdb_hierarchical_rec_list;
+
+	if (use_lft)
+		slurmdb_hierarchical_rec_list =
+			slurmdb_get_acct_hierarchical_rec_list(assoc_list);
+	else
+		slurmdb_hierarchical_rec_list =
+			slurmdb_get_acct_hierarchical_rec_list_no_lft(
+				assoc_list);
+
 	/* Clear all the pointers out of the list without freeing the
 	   memory since we will just add them back in later.
 	*/
-	while(list_pop(assoc_list)) {
+	while (list_pop(assoc_list)) {
 	}
 
 	_append_hierarchical_children_ret_list(assoc_list,
@@ -1694,6 +1800,38 @@ extern void slurmdb_sort_hierarchical_assoc_list(List assoc_list)
 	FREE_NULL_LIST(slurmdb_hierarchical_rec_list);
 }
 
+/* Build a hierarchical list using only association id's along with
+ * parent id's.  This method is slower than the non _no_lft function
+ * below, but it is needed if the lft and rgt's ever get messed up.
+ * Each association in here will result in a 0 rgt afterwards.
+ */
+extern List slurmdb_get_acct_hierarchical_rec_list_no_lft(List assoc_list)
+{
+	slurmdb_assoc_rec_t *assoc = NULL;
+	List total_arch_list = list_create(NULL);
+	List arch_rec_list = list_create(slurmdb_destroy_hierarchical_rec);
+	ListIterator itr;
+	/* DEF_TIMERS; */
+	/* START_TIMER; */
+
+	itr = list_iterator_create(assoc_list);
+	while ((assoc = list_next(itr))) {
+		if (assoc->rgt == 0) // already processed
+			continue;
+
+		_find_create_parent(assoc, assoc_list,
+				    arch_rec_list, total_arch_list);
+	}
+	list_iterator_destroy(itr);
+	/* END_TIMER; */
+	/* info("took %s", TIME_STR); */
+	FREE_NULL_LIST(total_arch_list);
+//	info("got %d", list_count(arch_rec_list));
+	_sort_slurmdb_hierarchical_rec_list(arch_rec_list);
+
+	return arch_rec_list;
+}
+
 extern List slurmdb_get_acct_hierarchical_rec_list(List assoc_list)
 {
 	slurmdb_hierarchical_rec_t *par_arch_rec = NULL;
@@ -1741,19 +1879,19 @@ extern List slurmdb_get_acct_hierarchical_rec_list(List assoc_list)
 			arch_rec->sort_name = assoc->acct;
 
 		if (last_parent && assoc->parent_id == last_parent->assoc->id
-		    && !strcmp(assoc->cluster, last_parent->assoc->cluster)) {
+		    && !xstrcmp(assoc->cluster, last_parent->assoc->cluster)) {
 			par_arch_rec = last_parent;
 		} else if (last_acct_parent
 			   && (assoc->parent_id == last_acct_parent->assoc->id)
-			   && !strcmp(assoc->cluster,
-				      last_acct_parent->assoc->cluster)) {
+			   && !xstrcmp(assoc->cluster,
+				       last_acct_parent->assoc->cluster)) {
 			par_arch_rec = last_acct_parent;
 		} else {
 			list_iterator_reset(itr2);
 			while((par_arch_rec = list_next(itr2))) {
 				if (assoc->parent_id == par_arch_rec->assoc->id
-				    && !strcmp(assoc->cluster,
-					       par_arch_rec->assoc->cluster)) {
+				    && !xstrcmp(assoc->cluster,
+						par_arch_rec->assoc->cluster)) {
 					if (assoc->user)
 						last_parent = par_arch_rec;
 					else
@@ -1800,9 +1938,9 @@ extern char *slurmdb_tree_name_get(char *name, char *parent, List tree_list)
 		if (slurmdb_print_tree->user)
 			continue;
 
-		if (!strcmp(name, slurmdb_print_tree->name))
+		if (!xstrcmp(name, slurmdb_print_tree->name))
 			break;
-		else if (parent && !strcmp(parent, slurmdb_print_tree->name))
+		else if (parent && !xstrcmp(parent, slurmdb_print_tree->name))
 			par_slurmdb_print_tree = slurmdb_print_tree;
 
 	}
@@ -2450,7 +2588,8 @@ extern int slurmdb_addto_qos_char_list(List char_list, List qos_list,
 						name = xstrdup_printf("%u", id);
 					}
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 					list_iterator_reset(itr);
@@ -2525,7 +2664,7 @@ extern int slurmdb_addto_qos_char_list(List char_list, List qos_list,
 				name = xstrdup_printf("%u", id);
 			}
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -2580,12 +2719,7 @@ extern int slurmdb_send_accounting_update(List update_list, char *cluster,
 	slurm_msg_t_init(&req);
 	slurm_set_addr_char(&req.address, port, host);
 
-	/* We standarized on SLURM_PROTOCOL_VERSION in 14.03 in 15.03
-	   this check can go away as well as the rpc_version of the
-	   accounting_update_msg_t.
-	*/
-	if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION)
-		req.protocol_version = rpc_version;
+	req.protocol_version = rpc_version;
 
 	req.msg_type = ACCOUNTING_UPDATE_MSG;
 	if (slurmdbd_conf)
@@ -2805,16 +2939,22 @@ extern void slurmdb_copy_qos_rec_limits(slurmdb_qos_rec_t *out,
 	out->grp_tres_run_mins = xstrdup(in->grp_tres_run_mins);
 	out->grp_wall = in->grp_wall;
 
+	out->max_jobs_pa = in->max_jobs_pa;
 	out->max_jobs_pu = in->max_jobs_pu;
+	out->max_submit_jobs_pa = in->max_submit_jobs_pa;
 	out->max_submit_jobs_pu = in->max_submit_jobs_pu;
 	xfree(out->max_tres_mins_pj);
 	out->max_tres_mins_pj =	xstrdup(in->max_tres_mins_pj);
+	xfree(out->max_tres_pa);
+	out->max_tres_pa = xstrdup(in->max_tres_pa);
 	xfree(out->max_tres_pj);
 	out->max_tres_pj = xstrdup(in->max_tres_pj);
 	xfree(out->max_tres_pn);
 	out->max_tres_pn = xstrdup(in->max_tres_pn);
 	xfree(out->max_tres_pu);
 	out->max_tres_pu = xstrdup(in->max_tres_pu);
+	xfree(out->max_tres_run_mins_pa);
+	out->max_tres_run_mins_pa = xstrdup(in->max_tres_run_mins_pa);
 	xfree(out->max_tres_run_mins_pu);
 	out->max_tres_run_mins_pu = xstrdup(in->max_tres_run_mins_pu);
 	out->max_wall_pj = in->max_wall_pj;
@@ -2975,7 +3115,8 @@ extern char *slurmdb_make_tres_string_from_arrays(char **tres_names,
 }
 
 extern char *slurmdb_make_tres_string_from_simple(
-	char *tres_in, List full_tres_list)
+	char *tres_in, List full_tres_list, int spec_unit,
+	uint32_t convert_flags)
 {
 	char *tres_str = NULL;
 	char *tmp_str = tres_in;
@@ -3019,9 +3160,19 @@ extern char *slurmdb_make_tres_string_from_simple(
 				   tres_rec->type,
 				   tres_rec->name ? "/" : "",
 				   tres_rec->name ? tres_rec->name : "");
-		if (count != INFINITE64)
-			xstrfmtcat(tres_str, "%"PRIu64, count);
-		else
+		if (count != INFINITE64) {
+			if ((tres_rec->id == TRES_MEM) ||
+			    (tres_rec->type &&
+			     !xstrcasecmp(tres_rec->type, "bb"))) {
+				char outbuf[FORMAT_STRING_SIZE];
+				convert_num_unit((double)count, outbuf,
+						 sizeof(outbuf), UNIT_MEGA,
+						 spec_unit, convert_flags);
+				xstrfmtcat(tres_str, "%s", outbuf);
+			} else {
+				xstrfmtcat(tres_str, "%"PRIu64, count);
+			}
+		} else
 			xstrfmtcat(tres_str, "NONE");
 
 
@@ -3038,6 +3189,7 @@ extern char *slurmdb_format_tres_str(
 	char *tres_in, List full_tres_list, bool simple)
 {
 	char *tres_str = NULL;
+	char *val_unit = NULL;
 	char *tmp_str = tres_in;
 	uint64_t count;
 	slurmdb_tres_rec_t *tres_rec;
@@ -3095,7 +3247,16 @@ extern char *slurmdb_format_tres_str(
 			      "no value found");
 			break;
 		}
-		count = slurm_atoull(++tmp_str);
+		count = strtoull(++tmp_str, &val_unit, 10);
+		if (val_unit && *val_unit != ',' && *val_unit != '\0' &&
+		    tres_rec->type) {
+			int base_unit =
+				slurmdb_get_tres_base_unit(tres_rec->type);
+			int convert_val =
+				get_convert_unit_val(base_unit, *val_unit);
+			if (convert_val > 0)
+				count *= convert_val;
+		}
 
 		if (tres_str)
 			xstrcat(tres_str, ",");
@@ -3129,6 +3290,23 @@ extern int slurmdb_sort_tres_by_id_asc(void *v1, void *v2)
 	slurmdb_tres_rec_t *tres_a = *(slurmdb_tres_rec_t **)v1;
 	slurmdb_tres_rec_t *tres_b = *(slurmdb_tres_rec_t **)v2;
 
+	if ((tres_a->id > TRES_STATIC_CNT) &&
+	    (tres_b->id > TRES_STATIC_CNT)) {
+		int diff = xstrcmp(tres_a->type, tres_b->type);
+
+		if (diff < 0)
+			return -1;
+		else if (diff > 0)
+			return 1;
+
+		diff = xstrcmp(tres_a->name, tres_b->name);
+
+		if (diff < 0)
+			return -1;
+		else if (diff > 0)
+			return 1;
+	}
+
 	if (tres_a->id < tres_b->id)
 		return -1;
 	else if (tres_a->id > tres_b->id)
@@ -3331,6 +3509,29 @@ extern int slurmdb_find_selected_step_in_list(void *x, void *key)
 	return 0;
 }
 
+extern int slurmdb_find_assoc_in_list(void *x, void *key)
+{
+	slurmdb_assoc_rec_t *assoc_rec = (slurmdb_assoc_rec_t *)x;
+	uint32_t assoc_id = *(uint32_t *)key;
+
+	if (assoc_rec->id == assoc_id)
+		return 1;
+
+	return 0;
+}
+
+extern int slurmdb_find_update_object_in_list(void *x, void *key)
+{
+	slurmdb_update_object_t *update_object = (slurmdb_update_object_t *)x;
+	slurmdb_update_type_t type = *(slurmdb_update_type_t *)key;
+
+	if (update_object->type == type)
+		return 1;
+
+	return 0;
+}
+
+
 extern int slurmdb_find_tres_in_list(void *x, void *key)
 {
 	slurmdb_tres_rec_t *tres_rec = (slurmdb_tres_rec_t *)x;
@@ -3577,45 +3778,13 @@ extern int slurmdb_get_old_tres_pos(slurmdb_tres_rec_t **new_array,
 	return pos;
 }
 
-extern void slurmdb_set_new_tres_cnt(uint64_t **tres_cnt_in,
-				     slurmdb_tres_rec_t **new_array,
-				     slurmdb_tres_rec_t **old_array,
-				     int cur_cnt, int max_cnt)
+extern int slurmdb_get_tres_base_unit(char *tres_type)
 {
-	int i, pos;
-	uint64_t tres_cnt[cur_cnt];
-	bool changed = false;
-
-	/* This means we don't have to redo the tres */
-	if (!old_array || !new_array || !tres_cnt_in || !*tres_cnt_in)
-		return;
-
-	for (i=0; i<cur_cnt; i++) {
-		/* Done! */
-		if (!new_array[i])
-			break;
-
-		pos = slurmdb_get_old_tres_pos(
-			new_array, old_array, i, max_cnt);
-
-		if (pos != i)
-			changed = true;
-
-		if (pos != NO_VAL)
-			tres_cnt[i] = *tres_cnt_in[pos];
+	int ret_unit = UNIT_NONE;
+	if ((!xstrcasecmp(tres_type, "mem")) ||
+	    (!xstrcasecmp(tres_type, "bb"))) {
+		ret_unit = UNIT_MEGA;
 	}
 
-	if (!changed)
-		return;
-
-	/* get the array the correct size */
-	i = sizeof(uint64_t) * cur_cnt;
-	if (cur_cnt != max_cnt)
-		xrealloc(*tres_cnt_in, i);
-
-	/* copy the data from tres_cnt which should contain
-	 * the new ordered tres values */
-	memcpy(*tres_cnt_in, tres_cnt, i);
-
-	return;
+	return ret_unit;
 }
diff --git a/src/common/slurmdb_defs.h b/src/common/slurmdb_defs.h
index 391c9bd59..36ee64cc5 100644
--- a/src/common/slurmdb_defs.h
+++ b/src/common/slurmdb_defs.h
@@ -62,6 +62,7 @@ typedef enum {
 	TRES_MEM,
 	TRES_ENERGY,
 	TRES_NODE,
+	TRES_STATIC_CNT
 } tres_types_t;
 
 /* These #defines are for the tres_str functions below and should be
@@ -91,6 +92,7 @@ typedef enum {
 #define TRES_STR_FLAG_COMMA1      0x00000020 /* make a first char a comma */
 #define TRES_STR_FLAG_NO_NULL     0x00000040 /* return blank string
 					      * instead of NULL */
+#define TRES_STR_CONVERT_UNITS    0x00000080 /* Convert number units */
 
 typedef struct {
 	slurmdb_cluster_rec_t *cluster_rec;
@@ -114,16 +116,18 @@ extern char *slurmdb_res_type_str(slurmdb_resource_type_t type);
 extern char *slurmdb_admin_level_str(slurmdb_admin_level_t level);
 extern slurmdb_admin_level_t str_2_slurmdb_admin_level(char *level);
 
-/* The next two functions have pointers to assoc_list so do not
+/* The next three functions have pointers to assoc_list so do not
  * destroy assoc_list before using the list returned from this function.
  */
-extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list);
+extern List slurmdb_get_hierarchical_sorted_assoc_list(List assoc_list,
+						       bool use_lft);
 extern List slurmdb_get_acct_hierarchical_rec_list(List assoc_list);
+extern List slurmdb_get_acct_hierarchical_rec_list_no_lft(List assoc_list);
 
 /* This reorders the list into a alphabetical hierarchy.
    IN/OUT: assoc_list
  */
-extern void slurmdb_sort_hierarchical_assoc_list(List assoc_list);
+extern void slurmdb_sort_hierarchical_assoc_list(List assoc_list, bool use_lft);
 
 /* IN/OUT: tree_list a list of slurmdb_print_tree_t's */
 extern char *slurmdb_tree_name_get(char *name, char *parent, List tree_list);
@@ -210,7 +214,8 @@ extern char *slurmdb_make_tres_string_from_arrays(char **tres_names,
 						  uint32_t flags);
 
 extern char *slurmdb_make_tres_string_from_simple(
-	char *tres_in, List full_tres_list);
+	char *tres_in, List full_tres_list, int spec_unit,
+	uint32_t convert_flags);
 /* Used to combine 2 different TRES strings together
  *
  * IN/OUT: tres_str_old - original simple tres string
@@ -232,6 +237,8 @@ extern slurmdb_tres_rec_t *slurmdb_find_tres_in_string(
 extern uint64_t slurmdb_find_tres_count_in_string(char *tres_str_in, int id);
 extern int slurmdb_find_qos_in_list_by_name(void *x, void *key);
 extern int slurmdb_find_selected_step_in_list(void *x, void *key);
+extern int slurmdb_find_assoc_in_list(void *x, void *key);
+extern int slurmdb_find_update_object_in_list(void *x, void *key);
 extern int slurmdb_find_tres_in_list(void *x, void *key);
 extern int slurmdb_find_tres_in_list_by_count(void *x, void *key);
 extern int slurmdb_find_tres_in_list_by_type(void *x, void *key);
@@ -258,9 +265,7 @@ extern void slurmdb_transfer_tres_time(
 extern int slurmdb_get_old_tres_pos(slurmdb_tres_rec_t **new_array,
 				    slurmdb_tres_rec_t **old_array,
 				    int cur_pos, int old_cnt);
-extern void slurmdb_set_new_tres_cnt(uint64_t **tres_cnt_in,
-				     slurmdb_tres_rec_t **new_array,
-				     slurmdb_tres_rec_t **old_array,
-				     int cur_cnt, int max_cnt);
+
+extern int slurmdb_get_tres_base_unit(char *tres_type);
 
 #endif
diff --git a/src/common/slurmdb_pack.c b/src/common/slurmdb_pack.c
index 9a5fcceaa..ccb95495b 100644
--- a/src/common/slurmdb_pack.c
+++ b/src/common/slurmdb_pack.c
@@ -49,7 +49,7 @@ static void _pack_slurmdb_stats(slurmdb_stats_t *stats,
 {
 	int i=0;
 
-	if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (!stats) {
 			for (i=0; i<3; i++)
 				pack64(0, buffer);
@@ -99,7 +99,7 @@ static void _pack_slurmdb_stats(slurmdb_stats_t *stats,
 static int _unpack_slurmdb_stats(slurmdb_stats_t *stats,
 				 uint16_t rpc_version, Buf buffer)
 {
-	if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack64(&stats->vsize_max, buffer);
 		safe_unpack64(&stats->rss_max, buffer);
 		safe_unpack64(&stats->pages_max, buffer);
@@ -288,20 +288,39 @@ extern void slurmdb_pack_used_limits(void *in, uint32_t tres_cnt,
 {
 	slurmdb_used_limits_t *object = (slurmdb_used_limits_t *)in;
 
-	if (!object) {
-		pack32(0, buffer);
-		pack32(0, buffer);
-		pack64_array(NULL, 0, buffer);
-		pack64_array(NULL, 0, buffer);
-		pack32(0, buffer);
-		return;
-	}
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (!object) {
+			packnull(buffer);
+			pack32(0, buffer);
+			pack32(0, buffer);
+			pack64_array(NULL, 0, buffer);
+			pack64_array(NULL, 0, buffer);
+			pack32(0, buffer);
+			return;
+		}
+
+		packstr(object->acct, buffer);
+		pack32(object->jobs, buffer);
+		pack32(object->submit_jobs, buffer);
+		pack64_array(object->tres, tres_cnt, buffer);
+		pack64_array(object->tres_run_mins, tres_cnt, buffer);
+		pack32(object->uid, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		if (!object) {
+			pack32(0, buffer);
+			pack32(0, buffer);
+			pack64_array(NULL, 0, buffer);
+			pack64_array(NULL, 0, buffer);
+			pack32(0, buffer);
+			return;
+		}
 
-	pack32(object->jobs, buffer);
-	pack32(object->submit_jobs, buffer);
-	pack64_array(object->tres, tres_cnt, buffer);
-	pack64_array(object->tres_run_mins, tres_cnt, buffer);
-	pack32(object->uid, buffer);
+		pack32(object->jobs, buffer);
+		pack32(object->submit_jobs, buffer);
+		pack64_array(object->tres, tres_cnt, buffer);
+		pack64_array(object->tres_run_mins, tres_cnt, buffer);
+		pack32(object->uid, buffer);
+	}
 }
 
 extern int slurmdb_unpack_used_limits(void **object, uint32_t tres_cnt,
@@ -313,16 +332,33 @@ extern int slurmdb_unpack_used_limits(void **object, uint32_t tres_cnt,
 
 	*object = (void *)object_ptr;
 
-	safe_unpack32(&object_ptr->jobs, buffer);
-	safe_unpack32(&object_ptr->submit_jobs, buffer);
-	safe_unpack64_array(&object_ptr->tres, &tmp32, buffer);
-	if (tmp32 != tres_cnt)
-		goto unpack_error;
-	safe_unpack64_array(&object_ptr->tres_run_mins, &tmp32, buffer);
-	if (tmp32 != tres_cnt)
-		goto unpack_error;
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&object_ptr->acct, &tmp32, buffer);
+		safe_unpack32(&object_ptr->jobs, buffer);
+		safe_unpack32(&object_ptr->submit_jobs, buffer);
+		safe_unpack64_array(&object_ptr->tres, &tmp32, buffer);
+		if (tmp32 != tres_cnt)
+			goto unpack_error;
+		safe_unpack64_array(&object_ptr->tres_run_mins, &tmp32, buffer);
+		if (tmp32 != tres_cnt)
+			goto unpack_error;
 
-	safe_unpack32(&object_ptr->uid, buffer);
+		safe_unpack32(&object_ptr->uid, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		safe_unpack32(&object_ptr->jobs, buffer);
+		safe_unpack32(&object_ptr->submit_jobs, buffer);
+		safe_unpack64_array(&object_ptr->tres, &tmp32, buffer);
+		if (tmp32 != tres_cnt)
+			goto unpack_error;
+		safe_unpack64_array(&object_ptr->tres_run_mins, &tmp32, buffer);
+		if (tmp32 != tres_cnt)
+			goto unpack_error;
+
+		safe_unpack32(&object_ptr->uid, buffer);
+	} else {
+		error("%s: too old of a version %u", __func__, rpc_version);
+		goto unpack_error;
+	}
 
 	return SLURM_SUCCESS;
 
@@ -495,7 +531,7 @@ extern void slurmdb_pack_cluster_accounting_rec(void *in, uint16_t rpc_version,
 		pack64(object->pdown_secs, buffer);
 		pack_time(object->period_start, buffer);
 		pack64(object->resv_secs, buffer);
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		/* We only want to send the CPU tres to older
 		   versions of SLURM.
 		*/
@@ -546,7 +582,7 @@ extern int slurmdb_unpack_cluster_accounting_rec(void **object,
 		safe_unpack64(&object_ptr->pdown_secs, buffer);
 		safe_unpack_time(&object_ptr->period_start, buffer);
 		safe_unpack64(&object_ptr->resv_secs, buffer);
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint64_t tmp_64;
 		object_ptr->tres_rec.id = TRES_CPU;
 		object_ptr->tres_rec.name = xstrdup("cpu");
@@ -840,8 +876,11 @@ extern void slurmdb_pack_accounting_rec(void *in, uint16_t rpc_version,
 		slurmdb_pack_tres_rec(&object->tres_rec, rpc_version, buffer);
 		pack32(object->id, buffer);
 		pack_time(object->period_start, buffer);
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		if (!object) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		/* We only want to send the CPU tres to older
+		   versions of SLURM.
+		*/
+		if (!object || (object->tres_rec.id != TRES_CPU)) {
 			pack64(0, buffer);
 			pack64(0, buffer);
 			pack32(0, buffer);
@@ -873,7 +912,7 @@ extern int slurmdb_unpack_accounting_rec(void **object, uint16_t rpc_version,
 			goto unpack_error;
 		safe_unpack32(&object_ptr->id, buffer);
 		safe_unpack_time(&object_ptr->period_start, buffer);
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint64_t tmp_64;
 
 		object_ptr->tres_rec.id = TRES_CPU;
@@ -1645,7 +1684,97 @@ extern void slurmdb_pack_qos_rec(void *in, uint16_t rpc_version, Buf buffer)
 	char *tmp_info = NULL;
 	uint64_t uint64_tmp;
 
-	if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (!object) {
+			packnull(buffer);
+			pack32(0, buffer);
+
+			pack32(QOS_FLAG_NOTSET, buffer);
+
+			pack32(NO_VAL, buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+			pack32(NO_VAL, buffer);
+			packnull(buffer);
+
+			packnull(buffer);
+
+			pack_bit_str_hex(NULL, buffer);
+			pack32(NO_VAL, buffer);
+
+			pack16(0, buffer);
+			pack32(0, buffer);
+
+			packdouble(NO_VAL64, buffer);
+			packdouble(NO_VAL64, buffer);
+			return;
+		}
+		packstr(object->description, buffer);
+		pack32(object->id, buffer);
+
+		pack32(object->flags, buffer);
+
+		pack32(object->grace_time, buffer);
+		packstr(object->grp_tres_mins, buffer);
+		packstr(object->grp_tres_run_mins, buffer);
+		packstr(object->grp_tres, buffer);
+		pack32(object->grp_jobs, buffer);
+		pack32(object->grp_submit_jobs, buffer);
+		pack32(object->grp_wall, buffer);
+
+		packstr(object->max_tres_mins_pj, buffer);
+		packstr(object->max_tres_run_mins_pa, buffer);
+		packstr(object->max_tres_run_mins_pu, buffer);
+		packstr(object->max_tres_pa, buffer);
+		packstr(object->max_tres_pj, buffer);
+		packstr(object->max_tres_pn, buffer);
+		packstr(object->max_tres_pu, buffer);
+		pack32(object->max_jobs_pa, buffer);
+		pack32(object->max_jobs_pu, buffer);
+		pack32(object->max_submit_jobs_pa, buffer);
+		pack32(object->max_submit_jobs_pu, buffer);
+		pack32(object->max_wall_pj, buffer);
+		packstr(object->min_tres_pj, buffer);
+
+		packstr(object->name, buffer);
+
+		pack_bit_str_hex(object->preempt_bitstr, buffer);
+
+		if (object->preempt_list)
+			count = list_count(object->preempt_list);
+
+		pack32(count, buffer);
+
+		if (count && count != NO_VAL) {
+			itr = list_iterator_create(object->preempt_list);
+			while ((tmp_info = list_next(itr))) {
+				packstr(tmp_info, buffer);
+			}
+			list_iterator_destroy(itr);
+		}
+
+		pack16(object->preempt_mode, buffer);
+		pack32(object->priority, buffer);
+
+		packdouble(object->usage_factor, buffer);
+		packdouble(object->usage_thres, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		if (!object) {
 			packnull(buffer);
 			pack32(0, buffer);
@@ -1980,7 +2109,68 @@ extern int slurmdb_unpack_qos_rec(void **object, uint16_t rpc_version,
 
 	slurmdb_init_qos_rec(object_ptr, 0, NO_VAL);
 
-	if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&object_ptr->description,
+				       &uint32_tmp, buffer);
+		safe_unpack32(&object_ptr->id, buffer);
+
+		safe_unpack32(&object_ptr->flags, buffer);
+
+		safe_unpack32(&object_ptr->grace_time, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->grp_tres_mins,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->grp_tres_run_mins,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->grp_tres,
+				       &uint32_tmp, buffer);
+		safe_unpack32(&object_ptr->grp_jobs, buffer);
+		safe_unpack32(&object_ptr->grp_submit_jobs, buffer);
+		safe_unpack32(&object_ptr->grp_wall, buffer);
+
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_mins_pj,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_run_mins_pa,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_run_mins_pu,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_pa,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_pj,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_pn,
+				       &uint32_tmp, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->max_tres_pu,
+				       &uint32_tmp, buffer);
+		safe_unpack32(&object_ptr->max_jobs_pa, buffer);
+		safe_unpack32(&object_ptr->max_jobs_pu, buffer);
+		safe_unpack32(&object_ptr->max_submit_jobs_pa, buffer);
+		safe_unpack32(&object_ptr->max_submit_jobs_pu, buffer);
+		safe_unpack32(&object_ptr->max_wall_pj, buffer);
+		safe_unpackstr_xmalloc(&object_ptr->min_tres_pj,
+				       &uint32_tmp, buffer);
+
+		safe_unpackstr_xmalloc(&object_ptr->name, &uint32_tmp, buffer);
+
+		unpack_bit_str_hex(&object_ptr->preempt_bitstr, buffer);
+
+		safe_unpack32(&count, buffer);
+		if (count != NO_VAL) {
+			object_ptr->preempt_list =
+				list_create(slurm_destroy_char);
+			for (i = 0; i < count; i++) {
+				safe_unpackstr_xmalloc(&tmp_info, &uint32_tmp,
+						       buffer);
+				list_append(object_ptr->preempt_list,
+					    tmp_info);
+			}
+		}
+
+		safe_unpack16(&object_ptr->preempt_mode, buffer);
+		safe_unpack32(&object_ptr->priority, buffer);
+
+		safe_unpackdouble(&object_ptr->usage_factor, buffer);
+		safe_unpackdouble(&object_ptr->usage_thres, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&object_ptr->description,
 				       &uint32_tmp, buffer);
 		safe_unpack32(&object_ptr->id, buffer);
@@ -2332,27 +2522,78 @@ extern void slurmdb_pack_qos_usage(void *in, uint16_t rpc_version, Buf buffer)
 	ListIterator itr;
 	void *used_limits;
 
-	pack32(usage->grp_used_jobs, buffer);
-	pack32(usage->grp_used_submit_jobs, buffer);
-	pack64_array(usage->grp_used_tres, usage->tres_cnt, buffer);
-	pack64_array(usage->grp_used_tres_run_secs, usage->tres_cnt, buffer);
-	packdouble(usage->grp_used_wall, buffer);
-	packdouble(usage->norm_priority, buffer);
-	packlongdouble(usage->usage_raw, buffer);
-	packlongdouble_array(usage->usage_tres_raw, usage->tres_cnt, buffer);
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack32(usage->grp_used_jobs, buffer);
+		pack32(usage->grp_used_submit_jobs, buffer);
+		pack64_array(usage->grp_used_tres, usage->tres_cnt, buffer);
+		pack64_array(usage->grp_used_tres_run_secs,
+			     usage->tres_cnt, buffer);
+		packdouble(usage->grp_used_wall, buffer);
+		packdouble(usage->norm_priority, buffer);
+		packlongdouble(usage->usage_raw, buffer);
+		packlongdouble_array(usage->usage_tres_raw,
+				     usage->tres_cnt, buffer);
+
+		if (!usage->user_limit_list ||
+		    !(count = list_count(usage->user_limit_list)))
+			count = NO_VAL;
 
-	if (!usage->user_limit_list ||
-	    !(count = list_count(usage->user_limit_list)))
-		count = NO_VAL;
+		/* We have to pack anything that is verified by
+		 * tres_cnt after this.  It is used in the unpack,
+		 * that is the reason it isn't alpha.
+		 */
+		pack32(count, buffer);
+		if (count != NO_VAL) {
+			itr = list_iterator_create(usage->user_limit_list);
+			while ((used_limits = list_next(itr)))
+				slurmdb_pack_used_limits(
+					used_limits, usage->tres_cnt,
+					rpc_version, buffer);
+			list_iterator_destroy(itr);
+		}
+		if (!usage->acct_limit_list ||
+		    !(count = list_count(usage->acct_limit_list)))
+			count = NO_VAL;
 
-	pack32(count, buffer);
-	if (count != NO_VAL) {
-		itr = list_iterator_create(usage->user_limit_list);
-		while ((used_limits = list_next(itr)))
-			slurmdb_pack_used_limits(used_limits, usage->tres_cnt,
-						 rpc_version, buffer);
-		list_iterator_destroy(itr);
+		pack32(count, buffer);
+		if (count != NO_VAL) {
+			itr = list_iterator_create(usage->acct_limit_list);
+			while ((used_limits = list_next(itr)))
+				slurmdb_pack_used_limits(
+					used_limits, usage->tres_cnt,
+					rpc_version, buffer);
+			list_iterator_destroy(itr);
+		}
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		pack32(usage->grp_used_jobs, buffer);
+		pack32(usage->grp_used_submit_jobs, buffer);
+		pack64_array(usage->grp_used_tres, usage->tres_cnt, buffer);
+		pack64_array(usage->grp_used_tres_run_secs,
+			     usage->tres_cnt, buffer);
+		packdouble(usage->grp_used_wall, buffer);
+		packdouble(usage->norm_priority, buffer);
+		packlongdouble(usage->usage_raw, buffer);
+		packlongdouble_array(usage->usage_tres_raw,
+				     usage->tres_cnt, buffer);
+
+		if (!usage->user_limit_list ||
+		    !(count = list_count(usage->user_limit_list)))
+			count = NO_VAL;
+
+		pack32(count, buffer);
+		if (count != NO_VAL) {
+			itr = list_iterator_create(usage->user_limit_list);
+			while ((used_limits = list_next(itr)))
+				slurmdb_pack_used_limits(
+					used_limits, usage->tres_cnt,
+					rpc_version, buffer);
+			list_iterator_destroy(itr);
+		}
+	} else {
+		error("%s: version too old %u", __func__, rpc_version);
+		return;
 	}
+
 }
 
 extern int slurmdb_unpack_qos_usage(void **object, uint16_t rpc_version,
@@ -2366,30 +2607,81 @@ extern int slurmdb_unpack_qos_usage(void **object, uint16_t rpc_version,
 
 	*object = object_ptr;
 
-	safe_unpack32(&object_ptr->grp_used_jobs, buffer);
-	safe_unpack32(&object_ptr->grp_used_submit_jobs, buffer);
-	safe_unpack64_array(&object_ptr->grp_used_tres,
-			    &object_ptr->tres_cnt, buffer);
-	safe_unpack64_array(&object_ptr->grp_used_tres_run_secs,
-			    &object_ptr->tres_cnt, buffer);
-	safe_unpackdouble(&object_ptr->grp_used_wall, buffer);
-	safe_unpackdouble(&object_ptr->norm_priority, buffer);
-	safe_unpacklongdouble(&object_ptr->usage_raw, buffer);
-	safe_unpacklongdouble_array(&object_ptr->usage_tres_raw,
-				    &count, buffer);
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&object_ptr->grp_used_jobs, buffer);
+		safe_unpack32(&object_ptr->grp_used_submit_jobs, buffer);
+		safe_unpack64_array(&object_ptr->grp_used_tres,
+				    &object_ptr->tres_cnt, buffer);
+		safe_unpack64_array(&object_ptr->grp_used_tres_run_secs,
+				    &object_ptr->tres_cnt, buffer);
+		safe_unpackdouble(&object_ptr->grp_used_wall, buffer);
+		safe_unpackdouble(&object_ptr->norm_priority, buffer);
+		safe_unpacklongdouble(&object_ptr->usage_raw, buffer);
+		safe_unpacklongdouble_array(&object_ptr->usage_tres_raw,
+					    &count, buffer);
 
-	safe_unpack32(&count, buffer);
-	if (count != NO_VAL) {
-		object_ptr->user_limit_list =
-			list_create(slurmdb_destroy_used_limits);
-		for (i = 0; i < count; i++) {
-			if (slurmdb_unpack_used_limits(&used_limits,
-						       object_ptr->tres_cnt,
-						       rpc_version, buffer)
-			    != SLURM_SUCCESS)
-				goto unpack_error;
-			list_append(object_ptr->user_limit_list, used_limits);
+		safe_unpack32(&count, buffer);
+		if (count != NO_VAL) {
+			object_ptr->user_limit_list =
+				list_create(slurmdb_destroy_used_limits);
+			for (i = 0; i < count; i++) {
+				if (slurmdb_unpack_used_limits(
+					    &used_limits,
+					    object_ptr->tres_cnt,
+					    rpc_version, buffer)
+				    != SLURM_SUCCESS)
+					goto unpack_error;
+				list_append(object_ptr->user_limit_list,
+					    used_limits);
+			}
+		}
+
+		safe_unpack32(&count, buffer);
+		if (count != NO_VAL) {
+			object_ptr->acct_limit_list =
+				list_create(slurmdb_destroy_used_limits);
+			for (i = 0; i < count; i++) {
+				if (slurmdb_unpack_used_limits(
+					    &used_limits,
+					    object_ptr->tres_cnt,
+					    rpc_version, buffer)
+				    != SLURM_SUCCESS)
+					goto unpack_error;
+				list_append(object_ptr->acct_limit_list,
+					    used_limits);
+			}
+		}
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		safe_unpack32(&object_ptr->grp_used_jobs, buffer);
+		safe_unpack32(&object_ptr->grp_used_submit_jobs, buffer);
+		safe_unpack64_array(&object_ptr->grp_used_tres,
+				    &object_ptr->tres_cnt, buffer);
+		safe_unpack64_array(&object_ptr->grp_used_tres_run_secs,
+				    &object_ptr->tres_cnt, buffer);
+		safe_unpackdouble(&object_ptr->grp_used_wall, buffer);
+		safe_unpackdouble(&object_ptr->norm_priority, buffer);
+		safe_unpacklongdouble(&object_ptr->usage_raw, buffer);
+		safe_unpacklongdouble_array(&object_ptr->usage_tres_raw,
+					    &count, buffer);
+
+		safe_unpack32(&count, buffer);
+		if (count != NO_VAL) {
+			object_ptr->user_limit_list =
+				list_create(slurmdb_destroy_used_limits);
+			for (i = 0; i < count; i++) {
+				if (slurmdb_unpack_used_limits(
+					    &used_limits,
+					    object_ptr->tres_cnt,
+					    rpc_version, buffer)
+				    != SLURM_SUCCESS)
+					goto unpack_error;
+				list_append(object_ptr->user_limit_list,
+					    used_limits);
+			}
 		}
+	} else {
+		error("%s: version too old %u", __func__, rpc_version);
+		goto unpack_error;
 	}
 
 	return SLURM_SUCCESS;
@@ -2408,28 +2700,59 @@ extern void slurmdb_pack_qos_rec_with_usage(void *in, uint16_t rpc_version,
 
 	slurmdb_pack_qos_rec(in, rpc_version, buffer);
 
-	pack64_array(object->grp_tres_mins_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->grp_tres_run_mins_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->grp_tres_ctld,
-		     object->usage->tres_cnt, buffer);
-
-	pack64_array(object->max_tres_mins_pj_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->max_tres_run_mins_pu_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->max_tres_pj_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->max_tres_pn_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->max_tres_pu_ctld,
-		     object->usage->tres_cnt, buffer);
-	pack64_array(object->min_tres_pj_ctld,
-		     object->usage->tres_cnt, buffer);
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack64_array(object->grp_tres_mins_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->grp_tres_run_mins_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->grp_tres_ctld,
+			     object->usage->tres_cnt, buffer);
+
+		pack64_array(object->max_tres_mins_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_run_mins_pa_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_run_mins_pu_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pa_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pn_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pu_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->min_tres_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		pack64_array(object->grp_tres_mins_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->grp_tres_run_mins_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->grp_tres_ctld,
+			     object->usage->tres_cnt, buffer);
+
+		pack64_array(object->max_tres_mins_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_run_mins_pu_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pn_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->max_tres_pu_ctld,
+			     object->usage->tres_cnt, buffer);
+		pack64_array(object->min_tres_pj_ctld,
+			     object->usage->tres_cnt, buffer);
+
+	} else {
+		error("%s: version too old %u", __func__, rpc_version);
+		return;
+	}
 
 	slurmdb_pack_qos_usage(object->usage,
 			       rpc_version, buffer);
+
 }
 
 extern int slurmdb_unpack_qos_rec_with_usage(void **object,
@@ -2446,25 +2769,54 @@ extern int slurmdb_unpack_qos_rec_with_usage(void **object,
 
 	object_ptr = *object;
 
-	safe_unpack64_array(&object_ptr->grp_tres_mins_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->grp_tres_run_mins_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->grp_tres_ctld,
-			    &uint32_tmp, buffer);
-
-	safe_unpack64_array(&object_ptr->max_tres_mins_pj_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->max_tres_run_mins_pu_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->max_tres_pj_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->max_tres_pn_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->max_tres_pu_ctld,
-			    &uint32_tmp, buffer);
-	safe_unpack64_array(&object_ptr->min_tres_pj_ctld,
-			    &uint32_tmp, buffer);
+	if (rpc_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack64_array(&object_ptr->grp_tres_mins_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->grp_tres_run_mins_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->grp_tres_ctld,
+				    &uint32_tmp, buffer);
+
+		safe_unpack64_array(&object_ptr->max_tres_mins_pj_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_run_mins_pa_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_run_mins_pu_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pa_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pj_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pn_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pu_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->min_tres_pj_ctld,
+				    &uint32_tmp, buffer);
+	} else if (rpc_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		safe_unpack64_array(&object_ptr->grp_tres_mins_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->grp_tres_run_mins_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->grp_tres_ctld,
+				    &uint32_tmp, buffer);
+
+		safe_unpack64_array(&object_ptr->max_tres_mins_pj_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_run_mins_pu_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pj_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pn_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->max_tres_pu_ctld,
+				    &uint32_tmp, buffer);
+		safe_unpack64_array(&object_ptr->min_tres_pj_ctld,
+				    &uint32_tmp, buffer);
+	} else {
+		error("%s: version too old %u", __func__, rpc_version);
+		goto unpack_error;
+	}
 
 	rc = slurmdb_unpack_qos_usage((void **)&object_ptr->usage,
 				      rpc_version, buffer);
@@ -2529,7 +2881,7 @@ extern void slurmdb_pack_reservation_rec(void *in, uint16_t rpc_version,
 			}
 			list_iterator_destroy(itr);
 		}
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		slurmdb_tres_rec_t *tres_rec = NULL;
 		int tres_id = TRES_CPU;
 
@@ -2619,7 +2971,7 @@ extern int slurmdb_unpack_reservation_rec(void **object, uint16_t rpc_version,
 				list_append(object_ptr->tres_list, tmp_info);
 			}
 		}
-	} else if (rpc_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint64_t uint64_tmp;
 		safe_unpack64(&uint64_tmp, buffer); /* not needed (alloc_secs) */
 		safe_unpackstr_xmalloc(&object_ptr->assocs, &uint32_tmp,
@@ -3247,15 +3599,6 @@ extern int slurmdb_unpack_user_cond(void **object, uint16_t rpc_version,
 		safe_unpack16(&object_ptr->with_coords, buffer);
 		safe_unpack16(&object_ptr->with_deleted, buffer);
 		safe_unpack16(&object_ptr->with_wckeys, buffer);
-
-		/* If we get the call from an older version of SLURM
-		   just automatically set this to get the defaults */
-		if (rpc_version < 8) {
-			if (!object_ptr->with_assocs)
-				object_ptr->assoc_cond->only_defs = 1;
-			else
-				object_ptr->with_wckeys = 1;
-		}
 	}
 
 	return SLURM_SUCCESS;
@@ -4636,8 +4979,12 @@ extern int slurmdb_unpack_job_cond(void **object, uint16_t rpc_version,
 			object_ptr->step_list =
 				list_create(slurmdb_destroy_selected_step);
 			for (i=0; i<count; i++) {
-				slurmdb_unpack_selected_step(
-					&job, rpc_version, buffer);
+				if (slurmdb_unpack_selected_step(
+					&job, rpc_version, buffer)
+				    != SLURM_SUCCESS) {
+					error("unpacking selected step");
+					goto unpack_error;
+				}
 				/* There is no such thing as jobid 0,
 				 * if we process it the database will
 				 * return all jobs. */
@@ -5433,13 +5780,10 @@ unpack_error:
 extern void slurmdb_pack_selected_step(slurmdb_selected_step_t *step,
 				       uint16_t rpc_version, Buf buffer)
 {
-	if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack32(step->array_task_id, buffer);
 		pack32(step->jobid, buffer);
 		pack32(step->stepid, buffer);
-	} else if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		pack32(step->jobid, buffer);
-		pack32(step->stepid, buffer);
 	}
 }
 
@@ -5453,13 +5797,10 @@ extern int slurmdb_unpack_selected_step(slurmdb_selected_step_t **step,
 
 	step_ptr->array_task_id = NO_VAL;
 
-	if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack32(&step_ptr->array_task_id, buffer);
 		safe_unpack32(&step_ptr->jobid, buffer);
 		safe_unpack32(&step_ptr->stepid, buffer);
-	} else if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		safe_unpack32(&step_ptr->jobid, buffer);
-		safe_unpack32(&step_ptr->stepid, buffer);
 	}
 
 	return SLURM_SUCCESS;
@@ -6252,7 +6593,7 @@ extern void slurmdb_pack_archive_cond(void *in, uint16_t rpc_version,
 {
 	slurmdb_archive_cond_t *object = (slurmdb_archive_cond_t *)in;
 
-	if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (!object) {
 			packnull(buffer);
 			packnull(buffer);
@@ -6273,25 +6614,6 @@ extern void slurmdb_pack_archive_cond(void *in, uint16_t rpc_version,
 		pack32(object->purge_resv, buffer);
 		pack32(object->purge_step, buffer);
 		pack32(object->purge_suspend, buffer);
-	} else if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		if (!object) {
-			packnull(buffer);
-			packnull(buffer);
-			slurmdb_pack_job_cond(NULL, rpc_version, buffer);
-			pack32(NO_VAL, buffer);
-			pack32(NO_VAL, buffer);
-			pack32(NO_VAL, buffer);
-			pack32(NO_VAL, buffer);
-			return;
-		}
-
-		packstr(object->archive_dir, buffer);
-		packstr(object->archive_script, buffer);
-		slurmdb_pack_job_cond(object->job_cond, rpc_version, buffer);
-		pack32(object->purge_event, buffer);
-		pack32(object->purge_job, buffer);
-		pack32(object->purge_step, buffer);
-		pack32(object->purge_suspend, buffer);
 	}
 }
 
@@ -6304,7 +6626,7 @@ extern int slurmdb_unpack_archive_cond(void **object, uint16_t rpc_version,
 
 	*object = object_ptr;
 
-	if (rpc_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&object_ptr->archive_dir,
 				       &uint32_tmp, buffer);
 		safe_unpackstr_xmalloc(&object_ptr->archive_script,
@@ -6317,18 +6639,6 @@ extern int slurmdb_unpack_archive_cond(void **object, uint16_t rpc_version,
 		safe_unpack32(&object_ptr->purge_resv, buffer);
 		safe_unpack32(&object_ptr->purge_step, buffer);
 		safe_unpack32(&object_ptr->purge_suspend, buffer);
-	} else if (rpc_version >= SLURM_MIN_PROTOCOL_VERSION) {
-		safe_unpackstr_xmalloc(&object_ptr->archive_dir,
-				       &uint32_tmp, buffer);
-		safe_unpackstr_xmalloc(&object_ptr->archive_script,
-				       &uint32_tmp, buffer);
-		if (slurmdb_unpack_job_cond((void *)&object_ptr->job_cond,
-					    rpc_version, buffer) == SLURM_ERROR)
-			goto unpack_error;
-		safe_unpack32(&object_ptr->purge_event, buffer);
-		safe_unpack32(&object_ptr->purge_job, buffer);
-		safe_unpack32(&object_ptr->purge_step, buffer);
-		safe_unpack32(&object_ptr->purge_suspend, buffer);
 	}
 
 	return SLURM_SUCCESS;
diff --git a/src/common/slurmdbd_defs.c b/src/common/slurmdbd_defs.c
index 055a0b9e3..da48ed0e6 100644
--- a/src/common/slurmdbd_defs.c
+++ b/src/common/slurmdbd_defs.c
@@ -521,6 +521,7 @@ extern Buf pack_slurmdbd_msg(slurmdbd_msg_t *req, uint16_t rpc_version)
 	case DBD_GOT_MULT_JOB_START:
 	case DBD_SEND_MULT_MSG:
 	case DBD_GOT_MULT_MSG:
+	case DBD_FIX_LOST_JOB:
 		slurmdbd_pack_list_msg(
 			(dbd_list_msg_t *)req->data, rpc_version,
 			req->msg_type, buffer);
@@ -859,171 +860,171 @@ extern slurmdbd_msg_type_t str_2_slurmdbd_msg_type(char *msg_type)
 {
 	if (!msg_type) {
 		return NO_VAL;
-	} else if (!strcasecmp(msg_type, "Init")) {
+	} else if (!xstrcasecmp(msg_type, "Init")) {
 		return DBD_INIT;
-	} else if (!strcasecmp(msg_type, "Fini")) {
+	} else if (!xstrcasecmp(msg_type, "Fini")) {
 		return DBD_FINI;
-	} else if (!strcasecmp(msg_type, "Add Accounts")) {
+	} else if (!xstrcasecmp(msg_type, "Add Accounts")) {
 		return DBD_ADD_ACCOUNTS;
-	} else if (!strcasecmp(msg_type, "Add Account Coord")) {
+	} else if (!xstrcasecmp(msg_type, "Add Account Coord")) {
 		return DBD_ADD_ACCOUNT_COORDS;
-	} else if (!strcasecmp(msg_type, "Add TRES")) {
+	} else if (!xstrcasecmp(msg_type, "Add TRES")) {
 		return DBD_ADD_TRES;
-	} else if (!strcasecmp(msg_type, "Add Associations")) {
+	} else if (!xstrcasecmp(msg_type, "Add Associations")) {
 		return DBD_ADD_ASSOCS;
-	} else if (!strcasecmp(msg_type, "Add Clusters")) {
+	} else if (!xstrcasecmp(msg_type, "Add Clusters")) {
 		return DBD_ADD_CLUSTERS;
-	} else if (!strcasecmp(msg_type, "Add Resources")) {
+	} else if (!xstrcasecmp(msg_type, "Add Resources")) {
 		return DBD_ADD_RES;
-	} else if (!strcasecmp(msg_type, "Add Users")) {
+	} else if (!xstrcasecmp(msg_type, "Add Users")) {
 		return DBD_ADD_USERS;
-	} else if (!strcasecmp(msg_type, "Cluster TRES")) {
+	} else if (!xstrcasecmp(msg_type, "Cluster TRES")) {
 		return DBD_CLUSTER_TRES;
-	} else if (!strcasecmp(msg_type, "Flush Jobs")) {
+	} else if (!xstrcasecmp(msg_type, "Flush Jobs")) {
 		return DBD_FLUSH_JOBS;
-	} else if (!strcasecmp(msg_type, "Get Accounts")) {
+	} else if (!xstrcasecmp(msg_type, "Get Accounts")) {
 		return DBD_GET_ACCOUNTS;
-	} else if (!strcasecmp(msg_type, "Get TRES")) {
+	} else if (!xstrcasecmp(msg_type, "Get TRES")) {
 		return DBD_GET_TRES;
-	} else if (!strcasecmp(msg_type, "Get Associations")) {
+	} else if (!xstrcasecmp(msg_type, "Get Associations")) {
 		return DBD_GET_ASSOCS;
-	} else if (!strcasecmp(msg_type, "Get Association Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Get Association Usage")) {
 		return DBD_GET_ASSOC_USAGE;
-	} else if (!strcasecmp(msg_type, "Get Clusters")) {
+	} else if (!xstrcasecmp(msg_type, "Get Clusters")) {
 		return DBD_GET_CLUSTERS;
-	} else if (!strcasecmp(msg_type, "Get Cluster Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Get Cluster Usage")) {
 		return DBD_GET_CLUSTER_USAGE;
-	} else if (!strcasecmp(msg_type, "Get Events")) {
+	} else if (!xstrcasecmp(msg_type, "Get Events")) {
 		return DBD_GET_EVENTS;
-	} else if (!strcasecmp(msg_type, "Reconfigure")) {
+	} else if (!xstrcasecmp(msg_type, "Reconfigure")) {
 		return DBD_RECONFIG;
-	} else if (!strcasecmp(msg_type, "Get Problems")) {
+	} else if (!xstrcasecmp(msg_type, "Get Problems")) {
 		return DBD_GET_PROBS;
-	} else if (!strcasecmp(msg_type, "Get Resources")) {
+	} else if (!xstrcasecmp(msg_type, "Get Resources")) {
 		return DBD_GET_RES;
-	} else if (!strcasecmp(msg_type, "Get Users")) {
+	} else if (!xstrcasecmp(msg_type, "Get Users")) {
 		return DBD_GET_USERS;
-	} else if (!strcasecmp(msg_type, "Got Accounts")) {
+	} else if (!xstrcasecmp(msg_type, "Got Accounts")) {
 		return DBD_GOT_ACCOUNTS;
-	} else if (!strcasecmp(msg_type, "Got TRES")) {
+	} else if (!xstrcasecmp(msg_type, "Got TRES")) {
 		return DBD_GOT_TRES;
-	} else if (!strcasecmp(msg_type, "Got Associations")) {
+	} else if (!xstrcasecmp(msg_type, "Got Associations")) {
 		return DBD_GOT_ASSOCS;
-	} else if (!strcasecmp(msg_type, "Got Association Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Got Association Usage")) {
 		return DBD_GOT_ASSOC_USAGE;
-	} else if (!strcasecmp(msg_type, "Got Clusters")) {
+	} else if (!xstrcasecmp(msg_type, "Got Clusters")) {
 		return DBD_GOT_CLUSTERS;
-	} else if (!strcasecmp(msg_type, "Got Cluster Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Got Cluster Usage")) {
 		return DBD_GOT_CLUSTER_USAGE;
-	} else if (!strcasecmp(msg_type, "Got Events")) {
+	} else if (!xstrcasecmp(msg_type, "Got Events")) {
 		return DBD_GOT_EVENTS;
-	} else if (!strcasecmp(msg_type, "Got Jobs")) {
+	} else if (!xstrcasecmp(msg_type, "Got Jobs")) {
 		return DBD_GOT_JOBS;
-	} else if (!strcasecmp(msg_type, "Got List")) {
+	} else if (!xstrcasecmp(msg_type, "Got List")) {
 		return DBD_GOT_LIST;
-	} else if (!strcasecmp(msg_type, "Got Problems")) {
+	} else if (!xstrcasecmp(msg_type, "Got Problems")) {
 		return DBD_GOT_PROBS;
-	} else if (!strcasecmp(msg_type, "Got Resources")) {
+	} else if (!xstrcasecmp(msg_type, "Got Resources")) {
 		return DBD_GOT_RES;
-	} else if (!strcasecmp(msg_type, "Got Users")) {
+	} else if (!xstrcasecmp(msg_type, "Got Users")) {
 		return DBD_GOT_USERS;
-	} else if (!strcasecmp(msg_type, "Job Complete")) {
+	} else if (!xstrcasecmp(msg_type, "Job Complete")) {
 		return DBD_JOB_COMPLETE;
-	} else if (!strcasecmp(msg_type, "Job Start")) {
+	} else if (!xstrcasecmp(msg_type, "Job Start")) {
 		return DBD_JOB_START;
-	} else if (!strcasecmp(msg_type, "ID RC")) {
+	} else if (!xstrcasecmp(msg_type, "ID RC")) {
 		return DBD_ID_RC;
-	} else if (!strcasecmp(msg_type, "Job Suspend")) {
+	} else if (!xstrcasecmp(msg_type, "Job Suspend")) {
 		return DBD_JOB_SUSPEND;
-	} else if (!strcasecmp(msg_type, "Modify Accounts")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Accounts")) {
 		return DBD_MODIFY_ACCOUNTS;
-	} else if (!strcasecmp(msg_type, "Modify Associations")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Associations")) {
 		return DBD_MODIFY_ASSOCS;
-	} else if (!strcasecmp(msg_type, "Modify Clusters")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Clusters")) {
 		return DBD_MODIFY_CLUSTERS;
-	} else if (!strcasecmp(msg_type, "Modify Job")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Job")) {
 		return DBD_MODIFY_JOB;
-	} else if (!strcasecmp(msg_type, "Modify QOS")) {
+	} else if (!xstrcasecmp(msg_type, "Modify QOS")) {
 		return DBD_MODIFY_QOS;
-	} else if (!strcasecmp(msg_type, "Modify Resources")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Resources")) {
 		return DBD_MODIFY_RES;
-	} else if (!strcasecmp(msg_type, "Modify Users")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Users")) {
 		return DBD_MODIFY_USERS;
-	} else if (!strcasecmp(msg_type, "Node State")) {
+	} else if (!xstrcasecmp(msg_type, "Node State")) {
 		return DBD_NODE_STATE;
-	} else if (!strcasecmp(msg_type, "RC")) {
+	} else if (!xstrcasecmp(msg_type, "RC")) {
 		return DBD_RC;
-	} else if (!strcasecmp(msg_type, "Register Cluster")) {
+	} else if (!xstrcasecmp(msg_type, "Register Cluster")) {
 		return DBD_REGISTER_CTLD;
-	} else if (!strcasecmp(msg_type, "Remove Accounts")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Accounts")) {
 		return DBD_REMOVE_ACCOUNTS;
-	} else if (!strcasecmp(msg_type, "Remove Account Coords")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Account Coords")) {
 		return DBD_REMOVE_ACCOUNT_COORDS;
-	} else if (!strcasecmp(msg_type, "Archive Dump")) {
+	} else if (!xstrcasecmp(msg_type, "Archive Dump")) {
 		return DBD_ARCHIVE_DUMP;
-	} else if (!strcasecmp(msg_type, "Archive Load")) {
+	} else if (!xstrcasecmp(msg_type, "Archive Load")) {
 		return DBD_ARCHIVE_LOAD;
-	} else if (!strcasecmp(msg_type, "Remove Associations")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Associations")) {
 		return DBD_REMOVE_ASSOCS;
-	} else if (!strcasecmp(msg_type, "Remove Clusters")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Clusters")) {
 		return DBD_REMOVE_CLUSTERS;
-	} else if (!strcasecmp(msg_type, "Remove Resources")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Resources")) {
 		return DBD_REMOVE_RES;
-	} else if (!strcasecmp(msg_type, "Remove Users")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Users")) {
 		return DBD_REMOVE_USERS;
-	} else if (!strcasecmp(msg_type, "Roll Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Roll Usage")) {
 		return DBD_ROLL_USAGE;
-	} else if (!strcasecmp(msg_type, "Step Complete")) {
+	} else if (!xstrcasecmp(msg_type, "Step Complete")) {
 		return DBD_STEP_COMPLETE;
-	} else if (!strcasecmp(msg_type, "Step Start")) {
+	} else if (!xstrcasecmp(msg_type, "Step Start")) {
 		return DBD_STEP_START;
-	} else if (!strcasecmp(msg_type, "Get Jobs Conditional")) {
+	} else if (!xstrcasecmp(msg_type, "Get Jobs Conditional")) {
 		return DBD_GET_JOBS_COND;
-	} else if (!strcasecmp(msg_type, "Get Transations")) {
+	} else if (!xstrcasecmp(msg_type, "Get Transations")) {
 		return DBD_GET_TXN;
-	} else if (!strcasecmp(msg_type, "Got Transations")) {
+	} else if (!xstrcasecmp(msg_type, "Got Transations")) {
 		return DBD_GOT_TXN;
-	} else if (!strcasecmp(msg_type, "Add QOS")) {
+	} else if (!xstrcasecmp(msg_type, "Add QOS")) {
 		return DBD_ADD_QOS;
-	} else if (!strcasecmp(msg_type, "Get QOS")) {
+	} else if (!xstrcasecmp(msg_type, "Get QOS")) {
 		return DBD_GET_QOS;
-	} else if (!strcasecmp(msg_type, "Got QOS")) {
+	} else if (!xstrcasecmp(msg_type, "Got QOS")) {
 		return DBD_GOT_QOS;
-	} else if (!strcasecmp(msg_type, "Remove QOS")) {
+	} else if (!xstrcasecmp(msg_type, "Remove QOS")) {
 		return DBD_REMOVE_QOS;
-	} else if (!strcasecmp(msg_type, "Add WCKeys")) {
+	} else if (!xstrcasecmp(msg_type, "Add WCKeys")) {
 		return DBD_ADD_WCKEYS;
-	} else if (!strcasecmp(msg_type, "Get WCKeys")) {
+	} else if (!xstrcasecmp(msg_type, "Get WCKeys")) {
 		return DBD_GET_WCKEYS;
-	} else if (!strcasecmp(msg_type, "Got WCKeys")) {
+	} else if (!xstrcasecmp(msg_type, "Got WCKeys")) {
 		return DBD_GOT_WCKEYS;
-	} else if (!strcasecmp(msg_type, "Remove WCKeys")) {
+	} else if (!xstrcasecmp(msg_type, "Remove WCKeys")) {
 		return DBD_REMOVE_WCKEYS;
-	} else if (!strcasecmp(msg_type, "Get WCKey Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Get WCKey Usage")) {
 		return DBD_GET_WCKEY_USAGE;
-	} else if (!strcasecmp(msg_type, "Got WCKey Usage")) {
+	} else if (!xstrcasecmp(msg_type, "Got WCKey Usage")) {
 		return DBD_GOT_WCKEY_USAGE;
-	} else if (!strcasecmp(msg_type, "Add Reservation")) {
+	} else if (!xstrcasecmp(msg_type, "Add Reservation")) {
 		return DBD_ADD_RESV;
-	} else if (!strcasecmp(msg_type, "Remove Reservation")) {
+	} else if (!xstrcasecmp(msg_type, "Remove Reservation")) {
 		return DBD_REMOVE_RESV;
-	} else if (!strcasecmp(msg_type, "Modify Reservation")) {
+	} else if (!xstrcasecmp(msg_type, "Modify Reservation")) {
 		return DBD_MODIFY_RESV;
-	} else if (!strcasecmp(msg_type, "Get Reservations")) {
+	} else if (!xstrcasecmp(msg_type, "Get Reservations")) {
 		return DBD_GET_RESVS;
-	} else if (!strcasecmp(msg_type, "Got Reservations")) {
+	} else if (!xstrcasecmp(msg_type, "Got Reservations")) {
 		return DBD_GOT_RESVS;
-	} else if (!strcasecmp(msg_type, "Get Config")) {
+	} else if (!xstrcasecmp(msg_type, "Get Config")) {
 		return DBD_GET_CONFIG;
-	} else if (!strcasecmp(msg_type, "Got Config")) {
+	} else if (!xstrcasecmp(msg_type, "Got Config")) {
 		return DBD_GOT_CONFIG;
-	} else if (!strcasecmp(msg_type, "Send Multiple Job Starts")) {
+	} else if (!xstrcasecmp(msg_type, "Send Multiple Job Starts")) {
 		return DBD_SEND_MULT_JOB_START;
-	} else if (!strcasecmp(msg_type, "Got Multiple Job Starts")) {
+	} else if (!xstrcasecmp(msg_type, "Got Multiple Job Starts")) {
 		return DBD_GOT_MULT_JOB_START;
-	} else if (!strcasecmp(msg_type, "Send Multiple Messages")) {
+	} else if (!xstrcasecmp(msg_type, "Send Multiple Messages")) {
 		return DBD_SEND_MULT_MSG;
-	} else if (!strcasecmp(msg_type, "Got Multiple Message Returns")) {
+	} else if (!xstrcasecmp(msg_type, "Got Multiple Message Returns")) {
 		return DBD_GOT_MULT_MSG;
 	} else {
 		return NO_VAL;
@@ -1856,16 +1857,16 @@ static Buf _recv_msg(int read_timeout)
 		return NULL;
 
 	if (!_fd_readable(slurmdbd_fd, read_timeout))
-		return NULL;
+		goto endit;
 	msg_read = read(slurmdbd_fd, &nw_size, sizeof(nw_size));
 	if (msg_read != sizeof(nw_size))
-		return NULL;
+		goto endit;
 	msg_size = ntohl(nw_size);
 	/* We don't error check for an upper limit here
   	 * since size could possibly be massive */
 	if (msg_size < 2) {
 		error("slurmdbd: Invalid msg_size (%u)", msg_size);
-		return NULL;
+		goto endit;
 	}
 
 	msg = xmalloc(msg_size);
@@ -1887,11 +1888,19 @@ static Buf _recv_msg(int read_timeout)
 			      offset, msg_size);
 		}	/* else in shutdown mode */
 		xfree(msg);
-		return NULL;
+		goto endit;
 	}
 
 	buffer = create_buf(msg, msg_size);
 	return buffer;
+
+endit:
+	/* Close it since we abondoned it.  If the connection does still exist
+	 * on the other end we can't rely on it after this point since we didn't
+	 * listen long enough for this response.
+	 */
+	_reopen_slurmdbd_fd();
+	return NULL;
 }
 
 /* Return time in msec since "start time" */
@@ -2349,7 +2358,7 @@ static void _load_dbd_state(void)
 			char curr_ver_str[10];
 			snprintf(curr_ver_str, sizeof(curr_ver_str),
 				 "VER%d", SLURM_PROTOCOL_VERSION);
-			if (!strcmp(ver_str, curr_ver_str))
+			if (!xstrcmp(ver_str, curr_ver_str))
 				rpc_version = SLURM_PROTOCOL_VERSION;
 		}
 
@@ -3662,6 +3671,7 @@ extern void slurmdbd_pack_list_msg(dbd_list_msg_t *msg,
 		my_function = pack_config_key_pair;
 		break;
 	case DBD_GOT_JOBS:
+	case DBD_FIX_LOST_JOB:
 		my_function = slurmdb_pack_job_rec;
 		break;
 	case DBD_GOT_LIST:
@@ -3763,6 +3773,7 @@ extern int slurmdbd_unpack_list_msg(dbd_list_msg_t **msg, uint16_t rpc_version,
 		my_destroy = destroy_config_key_pair;
 		break;
 	case DBD_GOT_JOBS:
+	case DBD_FIX_LOST_JOB:
 		my_function = slurmdb_unpack_job_rec;
 		my_destroy = slurmdb_destroy_job_rec;
 		break;
diff --git a/src/common/slurmdbd_defs.h b/src/common/slurmdbd_defs.h
index dcb563dd8..a177d60d8 100644
--- a/src/common/slurmdbd_defs.h
+++ b/src/common/slurmdbd_defs.h
@@ -156,6 +156,7 @@ typedef enum {
 	DBD_ADD_TRES,         /* Add tres to the database           */
 	DBD_GET_TRES,         /* Get tres from the database         */
 	DBD_GOT_TRES,         /* Got tres from the database         */
+	DBD_FIX_LOST_JOB,      /* Fix the lost jobs */
 } slurmdbd_msg_type_t;
 
 /*****************************************************************************\
diff --git a/src/common/stepd_api.c b/src/common/stepd_api.c
index 397ceff47..bad03d626 100644
--- a/src/common/stepd_api.c
+++ b/src/common/stepd_api.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/common/stepd_api.c - slurmstepd message API
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/common/stepd_api.h b/src/common/stepd_api.h
index dda8b1582..a3e906ff6 100644
--- a/src/common/stepd_api.h
+++ b/src/common/stepd_api.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/common/stepd_api.h - slurmstepd message API
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/common/strnatcmp.c b/src/common/strnatcmp.c
index c91d87fc0..27f21de1a 100644
--- a/src/common/strnatcmp.c
+++ b/src/common/strnatcmp.c
@@ -147,7 +147,7 @@ static int strnatcmp0(nat_char const *a, nat_char const *b, int fold_case)
 
 		if (!ca && !cb) {
 			/* The strings compare the same.  Perhaps the caller
-			   will want to call strcmp to break the tie. */
+			   will want to call xstrcmp to break the tie. */
 			return 0;
 		}
 
diff --git a/src/common/switch.h b/src/common/switch.h
index 9210eb39b..b9d367b6e 100644
--- a/src/common/switch.h
+++ b/src/common/switch.h
@@ -186,7 +186,7 @@ extern int switch_g_job_step_part_comp(switch_jobinfo_t *jobinfo,
  * completion calls (i.e. switch_g_job_step_part_comp). Support
  * of partition completions is compute intensive, so it should
  * be avoided unless switch resources are in short supply (e.g.
- * switch/federation). Otherwise return FALSE.
+ * switch/nrt). Otherwise return FALSE.
  */
 extern bool switch_g_part_comp(void);
 
diff --git a/src/common/uid.c b/src/common/uid.c
index 1c3f1a537..0bdd86c85 100644
--- a/src/common/uid.c
+++ b/src/common/uid.c
@@ -318,7 +318,7 @@ slurm_find_group_user(struct passwd *pwd, gid_t gid)
 		if (grpp->gr_gid != gid)
 			continue;
 		for (cc = 0; grpp->gr_mem[cc] ; cc++) {
-			if (strcmp(pwd->pw_name, grpp->gr_mem[cc]) == 0) {
+			if (xstrcmp(pwd->pw_name, grpp->gr_mem[cc]) == 0) {
 				endgrent();
 				return 1;
 			}
@@ -386,7 +386,7 @@ extern int slurm_valid_uid_gid(uid_t uid, gid_t *gid, char **user_name,
 	}
 
 	for (i = 0; grp->gr_mem[i]; i++) {
-		if (!strcmp(result->pw_name, grp->gr_mem[i])) {
+		if (!xstrcmp(result->pw_name, grp->gr_mem[i])) {
 			result->pw_gid = *gid;
 			return 1;
 		}
diff --git a/src/common/uid.h b/src/common/uid.h
index 4831328d4..b97357dcc 100644
--- a/src/common/uid.h
+++ b/src/common/uid.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/common/uid.h - uid/gid lookup utility functions
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/util-net.c b/src/common/util-net.c
index 2357c1b24..e5346d20e 100644
--- a/src/common/util-net.c
+++ b/src/common/util-net.c
@@ -59,6 +59,7 @@
 #include "src/common/strlcpy.h"
 #include "src/common/util-net.h"
 #include "src/common/macros.h"
+#include "src/common/xstring.h"
 
 
 #ifndef INET_ADDRSTRLEN
@@ -306,14 +307,14 @@ static int validate_hostent_copy(
 		return(-1);
 	if (src->h_name == dst->h_name)
 		return(-1);
-	if (strcmp(src->h_name, dst->h_name))
+	if (xstrcmp(src->h_name, dst->h_name))
 		return(-1);
 	if (src->h_addrtype != dst->h_addrtype)
 		return(-1);
 	if (src->h_length != dst->h_length)
 		return(-1);
 	for (p=src->h_aliases, q=dst->h_aliases; *p; p++, q++)
-		if ((!q) || (p == q) || (strcmp(*p, *q)))
+		if ((!q) || (p == q) || (xstrcmp(*p, *q)))
 			return(-1);
 	for (p=src->h_addr_list, q=dst->h_addr_list; *p; p++, q++)
 		if ((!q) || (p == q) || (memcmp(*p, *q, src->h_length)))
@@ -412,3 +413,54 @@ extern char *make_full_path(char *rpath)
 	return cwd2;
 }
 
+struct addrinfo *
+get_addr_info(const char *hostname)
+{
+	struct addrinfo* result = NULL;
+	struct addrinfo hints;
+	int err;
+
+	if (hostname == NULL)
+		return NULL;
+
+	memset(&hints, 0, sizeof(struct addrinfo));
+	hints.ai_family = AF_UNSPEC;
+	hints.ai_flags = AI_CANONNAME;
+
+	err = getaddrinfo(hostname, NULL, &hints, &result);
+	if (err == EAI_SYSTEM) {
+		error("%s: getaddrinfo() failed: %s: %m", __func__,
+		      gai_strerror(err));
+		return NULL;
+	} else if (err != 0) {
+		error("%s: getaddrinfo() failed: %s", __func__,
+		      gai_strerror(err));
+		return NULL;
+	}
+
+	return result;
+}
+
+int
+get_name_info(struct sockaddr *sa, socklen_t len, char *host)
+{
+	int err;
+
+        err = getnameinfo(sa, len, host, NI_MAXHOST, NULL, 0, 0);
+	if (err != 0) {
+		error("%s: getaddrinfo() failed: %s", __func__,
+		      gai_strerror(err));
+		return -1;
+	}
+
+	return 0;
+}
+
+void
+free_addr_info(struct addrinfo *info)
+{
+	if (info == NULL)
+		return;
+
+	freeaddrinfo(info);
+}
diff --git a/src/common/util-net.h b/src/common/util-net.h
index 2e949be88..66e1d7c3a 100644
--- a/src/common/util-net.h
+++ b/src/common/util-net.h
@@ -1,5 +1,5 @@
 /*****************************************************************************\
- *  $Id$
+ *  util-net.h - assorted network functions
  *****************************************************************************
  *  Copyright (C) 2001-2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -141,4 +141,11 @@ extern bool is_full_path(const char *);
  */
 extern char *make_full_path(char *);
 
+/* Wrapper functions for name and address resolution routines.
+ */
+extern struct addrinfo *get_addr_info(const char *);
+extern int get_name_info(struct sockaddr *, socklen_t, char *);
+extern void free_addr_info(struct addrinfo *);
+
+
 #endif /* !_UTIL_NET_H */
diff --git a/src/common/working_cluster.c b/src/common/working_cluster.c
index 77350950c..27bf3b5bb 100644
--- a/src/common/working_cluster.c
+++ b/src/common/working_cluster.c
@@ -119,9 +119,6 @@ extern uint32_t slurmdb_setup_cluster_flags(void)
 #ifdef HAVE_BGQ
 	cluster_flags |= CLUSTER_FLAG_BGQ;
 #endif
-#ifdef HAVE_SUN_CONST
-	cluster_flags |= CLUSTER_FLAG_SC;
-#endif
 #ifdef HAVE_AIX
 	cluster_flags |= CLUSTER_FLAG_AIX;
 #endif
@@ -167,9 +164,6 @@ static uint32_t _str_2_cluster_flags(char *flags_in)
 	if (slurm_strcasestr(flags_in, "MultipleSlurmd"))
 		return CLUSTER_FLAG_MULTSD;
 
-	if (slurm_strcasestr(flags_in, "SunConstellation"))
-		return CLUSTER_FLAG_SC;
-
 	if (slurm_strcasestr(flags_in, "Cray"))
 		return CLUSTER_FLAG_CRAY_N;
 
@@ -246,12 +240,6 @@ extern char *slurmdb_cluster_flags_2_str(uint32_t flags_in)
 		xstrcat(cluster_flags, "MultipleSlurmd");
 	}
 
-	if (flags_in & CLUSTER_FLAG_SC) {
-		if (cluster_flags)
-			xstrcat(cluster_flags, ",");
-		xstrcat(cluster_flags, "SunConstellation");
-	}
-
 	if (flags_in & CLUSTER_FLAG_CRAY_N) {
 		if (cluster_flags)
 			xstrcat(cluster_flags, ",");
@@ -263,3 +251,10 @@ extern char *slurmdb_cluster_flags_2_str(uint32_t flags_in)
 
 	return cluster_flags;
 }
+
+extern uint32_t slurmdb_setup_plugin_id_select(void)
+{
+	if (working_cluster_rec)
+		return working_cluster_rec->plugin_id_select;
+	return select_get_plugin_id();
+}
diff --git a/src/common/working_cluster.h b/src/common/working_cluster.h
index b76bf5478..e5038a4ce 100644
--- a/src/common/working_cluster.h
+++ b/src/common/working_cluster.h
@@ -69,4 +69,9 @@ extern uint32_t slurmdb_str_2_cluster_flags(char *flags_in);
  */
 extern char *slurmdb_cluster_flags_2_str(uint32_t flags_in);
 
+/*
+ * Return the plugin select id of the cluster working or current
+ */
+extern uint32_t slurmdb_setup_plugin_id_select(void);
+
 #endif
diff --git a/src/common/xassert.c b/src/common/xassert.c
index bfb70f6e6..75827a5f5 100644
--- a/src/common/xassert.c
+++ b/src/common/xassert.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  xassert.c - replacement for assert which sends error to log instead
  *		of stderr
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/xassert.h b/src/common/xassert.h
index 743452e0a..a53ce29d3 100644
--- a/src/common/xassert.h
+++ b/src/common/xassert.h
@@ -2,7 +2,6 @@
  *  xassert.h: assert type macro with configurable handling
  *             If NDEBUG is defined, do nothing.
  *             If not, and expression is zero, log an error message and abort.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -54,10 +53,10 @@
 
 #else /* !NDEBUG */
 
-#  define xassert(__ex)  _STMT_START { \
+#  define xassert(__ex)  do { \
      (__ex) ? ((void)0) : \
      __xassert_failed(__STRING(__ex), __FILE__,  __LINE__, __CURRENT_FUNC__);\
-     } _STMT_END
+     } while (0)
 
 /*  This prints the assertion failed message to the slurm log facility
  *  (see log.h) and aborts the calling program
diff --git a/src/common/xcgroup_read_config.c b/src/common/xcgroup_read_config.c
index 6e388106b..e8cf07be6 100644
--- a/src/common/xcgroup_read_config.c
+++ b/src/common/xcgroup_read_config.c
@@ -57,7 +57,7 @@
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
 
-#define DEFAULT_CGROUP_BASEDIR "/cgroup"
+#define DEFAULT_CGROUP_BASEDIR "/sys/fs/cgroup"
 
 slurm_cgroup_conf_t *slurm_cgroup_conf = NULL;
 
diff --git a/src/common/xhash.c b/src/common/xhash.c
index 515f63153..4ecb6a3c6 100644
--- a/src/common/xhash.c
+++ b/src/common/xhash.c
@@ -34,10 +34,11 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#include "src/common/siphash.h"
+#include "src/common/xhash.h"
 #include "src/common/xmalloc.h"
-#include "src/common/uthash/uthash.h"
 #include "src/common/xstring.h"
-#include "src/common/xhash.h"
+#include "src/common/uthash/uthash.h"
 
 #if 0
 /* undefine default allocators */
@@ -204,7 +205,6 @@ static struct hash_entry *_hash_lookup(struct hash_tab *, const char *);
 static void _rehash(struct hash_tab *, int);
 static int _find_closest_prime(int);
 static int _is_prime(int);
-static int _pjw_hash(const char *, uint32_t);
 
 static int primes[] = {
 	293,
@@ -288,7 +288,7 @@ void *
 hash_remove(struct hash_tab *t, const char *key)
 {
 	struct hash_entry *e;
-	int cc;
+	size_t cc;
 	void *v;
 
 	if (t == NULL
@@ -297,7 +297,7 @@ hash_remove(struct hash_tab *t, const char *key)
 
 	slurm_mutex_lock(&hash_mutex);
 
-	cc = _pjw_hash(key, t->size);
+	cc = siphash_str(key) % t->size;
 	if (t->lists[cc] == NULL) {
 		slurm_mutex_unlock(&hash_mutex);
 		return NULL;
@@ -307,7 +307,7 @@ hash_remove(struct hash_tab *t, const char *key)
 	     e!= (void *)t->lists[cc];
 	     e = e->forw) {
 
-		if (strcmp(e->key, key) == 0) {
+		if (xstrcmp(e->key, key) == 0) {
 			list_rm_(t->lists[cc], (struct list_ *)e);
 			t->num_ents--;
 			v = e->data;
@@ -433,35 +433,13 @@ _is_prime(int s)
 	return 1;
 }
 
-/* _pjw_hash()
- *
- * Hash a string using an algorithm taken from Aho, Sethi, and Ullman,
- * "Compilers: Principles, Techniques, and Tools," Addison-Wesley,
- * 1985, p. 436.  PJW stands for Peter J. Weinberger, who apparently
- * originally suggested the function.
- */
-static int
-_pjw_hash(const char *x, uint32_t size)
-{
-	const char *s = x;
-	unsigned int h = 0;
-	unsigned int g;
-
-	while (*s != 0)	 {
-		h = (h << 4) + *s++;
-		if ((g = h & (unsigned int) 0xf0000000) != 0)
-			h = (h ^ (g >> 24)) ^ g;
-	}
-
-	return h % size;
-}
 
 /* _hash_install()
  */
 static int
 _hash_install(struct hash_tab *t, const char *key, void *data)
 {
-	int cc;
+	size_t cc;
 	struct hash_entry *e;
 
 	if (t == NULL
@@ -480,7 +458,7 @@ _hash_install(struct hash_tab *t, const char *key, void *data)
 	}
 	e->data = data;
 
-	cc = _pjw_hash(key, t->size);
+	cc = siphash_str(key) % t->size;
 	if (t->lists[cc] == NULL)
 		t->lists[cc] = list_make_("");
 	list_push_(t->lists[cc], (struct list_ *)e);
@@ -495,20 +473,20 @@ static struct hash_entry *
 _hash_lookup(struct hash_tab *t, const char *key)
 {
 	struct hash_entry *e;
-	int cc;
+	size_t cc;
 
 	if (t == NULL
 	    || key == NULL)
 		return NULL;
 
-	cc = _pjw_hash(key, t->size);
+	cc = siphash_str(key) % t->size;
 	if (t->lists[cc] == NULL)
 		return NULL;
 
 	for (e = (struct hash_entry *)t->lists[cc]->forw;
 	     e!= (void *)t->lists[cc];
 	     e = e->forw) {
-		if (strcmp(e->key, key) == 0)
+		if (xstrcmp(e->key, key) == 0)
 			return e;
 	}
 
diff --git a/src/common/xmalloc.c b/src/common/xmalloc.c
index 02bf8b0e7..025eac62f 100644
--- a/src/common/xmalloc.c
+++ b/src/common/xmalloc.c
@@ -2,7 +2,6 @@
  *  xmalloc.c - enhanced malloc routines
  *  Started with Jim Garlick's xmalloc and tied into slurm log facility.
  *  Also added ability to print file, line, and function of caller.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -59,11 +58,11 @@
 #else
 static void malloc_assert_failed(char *, const char *, int,
                                  const char *, const char *);
-#  define xmalloc_assert(expr)  _STMT_START {                                 \
+#  define xmalloc_assert(expr)  do {                                          \
           (expr) ? ((void)(0)) :                                              \
           malloc_assert_failed(__STRING(expr), file, line, func,              \
                                __CURRENT_FUNC__);                             \
-          } _STMT_END
+          } while (0)
 #endif /* NDEBUG */
 
 
diff --git a/src/common/xmalloc.h b/src/common/xmalloc.h
index af0663f9b..1d5f6b983 100644
--- a/src/common/xmalloc.h
+++ b/src/common/xmalloc.h
@@ -3,7 +3,6 @@
  *  - default: never return if errors are encountered.
  *  - attempt to report file, line, and calling function on assertion failure
  *  - use configurable slurm log facility for reporting errors
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/xsignal.h b/src/common/xsignal.h
index 4d8eaa93a..bc4e3b1af 100644
--- a/src/common/xsignal.h
+++ b/src/common/xsignal.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/common/xsignal.h - POSIX signal wrapper functions
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/common/xstring.h b/src/common/xstring.h
index 3223f7014..e310b7212 100644
--- a/src/common/xstring.h
+++ b/src/common/xstring.h
@@ -52,7 +52,9 @@
 #define xstrfmtcat(__p, __fmt, args...)	_xstrfmtcat(&(__p), __fmt, ## args)
 #define xmemcat(__p, __s, __e)          _xmemcat(&(__p), __s, __e)
 #define xstrsubstitute(__p, __pat, __rep) _xstrsubstitute(&(__p), __pat, __rep)
-#define xstrsubstituteall(__p, __pat, __rep) while (_xstrsubstitute(&(__p), __pat, __rep));
+#define xstrsubstituteall(__p, __pat, __rep)			\
+	while (_xstrsubstitute(&(__p), __pat, __rep))		\
+		;
 
 /*
 ** The following functions take a ptr to a string and expand the
diff --git a/src/database/Makefile.in b/src/database/Makefile.in
index 46b125ce9..b1a3cdd63 100644
--- a/src/database/Makefile.in
+++ b/src/database/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/database
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -230,8 +231,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -331,6 +330,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -369,6 +372,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -412,6 +418,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -462,6 +471,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/database/mysql_common.c b/src/database/mysql_common.c
index 6fbd59677..967ac41dc 100644
--- a/src/database/mysql_common.c
+++ b/src/database/mysql_common.c
@@ -202,7 +202,7 @@ static int _mysql_make_table_current(mysql_conn_t *mysql_conn, char *table_name,
 	xfree(query);
 	while ((row = mysql_fetch_row(result))) {
 		// row[2] is the key name
-		if (!strcasecmp(row[2], "PRIMARY"))
+		if (!xstrcasecmp(row[2], "PRIMARY"))
 			old_primary = 1;
 		else if (!old_index)
 			old_index = xstrdup(row[2]);
@@ -226,7 +226,7 @@ static int _mysql_make_table_current(mysql_conn_t *mysql_conn, char *table_name,
 		else
 			list_iterator_reset(itr);
 		while ((db_key = list_next(itr))) {
-			if (!strcmp(db_key->name, row[2]))
+			if (!xstrcmp(db_key->name, row[2]))
 				break;
 		}
 
@@ -282,7 +282,7 @@ static int _mysql_make_table_current(mysql_conn_t *mysql_conn, char *table_name,
 
 		list_iterator_reset(itr);
 		while ((col = list_next(itr))) {
-			if (!strcmp(col, fields[i].name)) {
+			if (!xstrcmp(col, fields[i].name)) {
 				xstrfmtcat(query, " modify `%s` %s,",
 					   fields[i].name,
 					   fields[i].options);
@@ -417,7 +417,7 @@ static int _mysql_make_table_current(mysql_conn_t *mysql_conn, char *table_name,
 			new_key_name = xstrndup(temp+6, name_end-6);
 			new_key = xstrndup(temp+2, end-2); // skip ', '
 			while ((db_key = list_next(itr))) {
-				if (!strcmp(db_key->name, new_key_name)) {
+				if (!xstrcmp(db_key->name, new_key_name)) {
 					list_remove(itr);
 					break;
 				}
@@ -790,7 +790,7 @@ extern int mysql_db_delete_affected_rows(mysql_conn_t *mysql_conn, char *query)
 	}
 	slurm_mutex_lock(&mysql_conn->lock);
 	if (!(rc = _mysql_query_internal(mysql_conn->db_conn, query)))
-			rc = mysql_affected_rows(mysql_conn->db_conn);
+		rc = mysql_affected_rows(mysql_conn->db_conn);
 	slurm_mutex_unlock(&mysql_conn->lock);
 	return rc;
 }
diff --git a/src/db_api/Makefile.in b/src/db_api/Makefile.in
index 794375c2b..44c8211f9 100644
--- a/src/db_api/Makefile.in
+++ b/src/db_api/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 noinst_PROGRAMS = libslurmdb.o$(EXEEXT)
 subdir = src/db_api
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -262,8 +263,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -364,6 +363,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -402,6 +405,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -445,6 +451,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -495,6 +504,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/db_api/cluster_report_functions.c b/src/db_api/cluster_report_functions.c
index cdba1a579..46c112707 100644
--- a/src/db_api/cluster_report_functions.c
+++ b/src/db_api/cluster_report_functions.c
@@ -67,8 +67,8 @@ static void _process_ua(List user_list, slurmdb_assoc_rec_t *assoc)
 	*/
 	itr = list_iterator_create(user_list);
 	while((slurmdb_report_user = list_next(itr))) {
-		if (!strcmp(slurmdb_report_user->name, assoc->user)
-		   && !strcmp(slurmdb_report_user->acct, assoc->acct))
+		if (!xstrcmp(slurmdb_report_user->name, assoc->user)
+		   && !xstrcmp(slurmdb_report_user->acct, assoc->acct))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -155,7 +155,7 @@ static void _process_wu(List assoc_list, slurmdb_wckey_rec_t *wckey)
 	itr = list_iterator_create(assoc_list);
 	while((parent_assoc = list_next(itr))) {
 		if (!parent_assoc->user
-		   && !strcmp(parent_assoc->acct, wckey->name))
+		   && !xstrcmp(parent_assoc->acct, wckey->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -199,7 +199,7 @@ static void _process_assoc_type(
 			continue;
 		}
 
-		if (strcmp(cluster_name, assoc->cluster))
+		if (xstrcmp(cluster_name, assoc->cluster))
 			continue;
 
 		if (type == CLUSTER_REPORT_UA)
@@ -230,7 +230,7 @@ static void _process_wckey_type(
 			continue;
 		}
 
-		if (strcmp(cluster_name, wckey->cluster))
+		if (xstrcmp(cluster_name, wckey->cluster))
 			continue;
 
 		if (type == CLUSTER_REPORT_UW)
@@ -322,7 +322,7 @@ static List _process_util_by_report(void *db_conn, char *calling_name,
 	if ((type == CLUSTER_REPORT_UA) || (type == CLUSTER_REPORT_AU)) {
 		first_list = type_list;
 		type_list = slurmdb_get_hierarchical_sorted_assoc_list(
-			first_list);
+			first_list, true);
 	}
 
 	/* set up the structures for easy retrieval later */
diff --git a/src/db_api/job_report_functions.c b/src/db_api/job_report_functions.c
index 2e0ecdc59..1faf3b724 100644
--- a/src/db_api/job_report_functions.c
+++ b/src/db_api/job_report_functions.c
@@ -77,7 +77,7 @@ static void _check_create_grouping(
 
 	itr = list_iterator_create(cluster_list);
 	while((cluster_group = list_next(itr))) {
-		if (!strcmp(cluster, cluster_group->cluster))
+		if (!xstrcmp(cluster, cluster_group->cluster))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -93,7 +93,7 @@ static void _check_create_grouping(
 
 	itr = list_iterator_create(cluster_group->acct_list);
 	while ((acct_group = list_next(itr))) {
-		if (!strcmp(name, acct_group->acct))
+		if (!xstrcmp(name, acct_group->acct))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -223,7 +223,7 @@ static List _process_grouped_report(
 			tmp = xstrdup_printf("%"PRIu64, count);
 
 			while ((group = list_next(group_itr))) {
-				if (!strcmp(group, tmp)) {
+				if (!xstrcmp(group, tmp)) {
 					break;
 				}
 			}
@@ -310,13 +310,13 @@ static List _process_grouped_report(
 				(slurmdb_assoc_rec_t *)object2;
 			char name[200];
 			if (!wckey_type) {
-				if (strcmp(assoc->cluster, wckey2->cluster))
+				if (xstrcmp(assoc->cluster, wckey2->cluster))
 					continue;
 				cluster = assoc->cluster;
 				snprintf(name, sizeof(name), "%s:%s",
 					 assoc->acct, wckey2->name);
 			} else {
-				if (strcmp(wckey->cluster, assoc2->cluster))
+				if (xstrcmp(wckey->cluster, assoc2->cluster))
 					continue;
 				cluster = wckey->cluster;
 				snprintf(name, sizeof(name), "%s:%s",
@@ -371,7 +371,7 @@ no_objects:
 
 		list_iterator_reset(cluster_itr);
 		while((cluster_group = list_next(cluster_itr))) {
-			if (!strcmp(local_cluster, cluster_group->cluster))
+			if (!xstrcmp(local_cluster, cluster_group->cluster))
 				break;
 		}
 		if (!cluster_group) {
@@ -391,7 +391,7 @@ no_objects:
 		acct_itr = list_iterator_create(cluster_group->acct_list);
 		while((acct_group = list_next(acct_itr))) {
 			if (wckey_type) {
-				if (!strcmp(tmp_acct, acct_group->acct))
+				if (!xstrcmp(tmp_acct, acct_group->acct))
 					break;
 				continue;
 			}
@@ -400,7 +400,7 @@ no_objects:
 			   && (acct_group->lft != (uint32_t)NO_VAL)
 			   && (job->lft != (uint32_t)NO_VAL)) {
 				/* keep separate since we don't want
-				 * to so a strcmp if we don't have to
+				 * to so a xstrcmp if we don't have to
 				 */
 				if (job->lft > acct_group->lft
 				    && job->lft < acct_group->rgt) {
@@ -413,10 +413,10 @@ no_objects:
 						break;
 					else if (!mywckey || !job->wckey)
 						continue;
-					else if (!strcmp(mywckey, job->wckey))
+					else if (!xstrcmp(mywckey, job->wckey))
 						break;
 				}
-			} else if (!strcmp(acct_group->acct, tmp_acct))
+			} else if (!xstrcmp(acct_group->acct, tmp_acct))
 				break;
 		}
 		list_iterator_destroy(acct_itr);
diff --git a/src/db_api/user_report_functions.c b/src/db_api/user_report_functions.c
index 63e453c24..8f896b2cf 100644
--- a/src/db_api/user_report_functions.c
+++ b/src/db_api/user_report_functions.c
@@ -172,8 +172,8 @@ extern List slurmdb_report_user_top_usage(void *db_conn,
 
 			while((slurmdb_report_cluster =
 			       list_next(cluster_itr))) {
-				if (!strcmp(slurmdb_report_cluster->name,
-					   assoc->cluster)) {
+				if (!xstrcmp(slurmdb_report_cluster->name,
+					     assoc->cluster)) {
 					ListIterator user_itr = NULL;
 					if (!group_accounts) {
 						slurmdb_report_user = NULL;
@@ -192,7 +192,7 @@ extern List slurmdb_report_user_top_usage(void *db_conn,
 								break;
 						} else if (slurmdb_report_user->
 							  name
-							  && !strcasecmp(
+							  && !xstrcasecmp(
 								  slurmdb_report_user->
 								  name,
 								  user->name))
@@ -243,7 +243,7 @@ extern List slurmdb_report_user_top_usage(void *db_conn,
 			itr3 = list_iterator_create(
 				slurmdb_report_user->acct_list);
 			while((object = list_next(itr3))) {
-				if (!strcmp(object, assoc->acct))
+				if (!xstrcmp(object, assoc->acct))
 					break;
 			}
 			list_iterator_destroy(itr3);
diff --git a/src/layouts/Makefile.in b/src/layouts/Makefile.in
index de51c5f66..64ce30d94 100644
--- a/src/layouts/Makefile.in
+++ b/src/layouts/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/layouts
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/layouts/power/Makefile.in b/src/layouts/power/Makefile.in
index 305818749..c6abaaaab 100644
--- a/src/layouts/power/Makefile.in
+++ b/src/layouts/power/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/layouts/power
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -258,8 +259,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -359,6 +358,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -397,6 +400,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -440,6 +446,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -490,6 +499,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/layouts/unit/Makefile.in b/src/layouts/unit/Makefile.in
index 36f5db9ff..eea8ff59f 100644
--- a/src/layouts/unit/Makefile.in
+++ b/src/layouts/unit/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/layouts/unit
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
index 49204713c..0d7a81e9a 100644
--- a/src/plugins/Makefile.am
+++ b/src/plugins/Makefile.am
@@ -16,7 +16,9 @@ SUBDIRS = \
 	job_container		\
 	job_submit		\
 	launch			\
+	mcs			\
 	mpi			\
+	node_features		\
 	power			\
 	preempt			\
 	priority		\
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 2bcd391cd..399a37646 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -488,7 +498,9 @@ SUBDIRS = \
 	job_container		\
 	job_submit		\
 	launch			\
+	mcs			\
 	mpi			\
+	node_features		\
 	power			\
 	preempt			\
 	priority		\
diff --git a/src/plugins/accounting_storage/Makefile.in b/src/plugins/accounting_storage/Makefile.in
index 0775c24a2..01e065f5f 100644
--- a/src/plugins/accounting_storage/Makefile.in
+++ b/src/plugins/accounting_storage/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/accounting_storage/common/Makefile.in b/src/plugins/accounting_storage/common/Makefile.in
index 98e098b7c..a2660df8e 100644
--- a/src/plugins/accounting_storage/common/Makefile.in
+++ b/src/plugins/accounting_storage/common/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -218,8 +219,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -319,6 +318,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -357,6 +360,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -400,6 +406,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -450,6 +459,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/accounting_storage/common/common_as.c b/src/plugins/accounting_storage/common/common_as.c
index bdd7bb2d7..3872617d5 100644
--- a/src/plugins/accounting_storage/common/common_as.c
+++ b/src/plugins/accounting_storage/common/common_as.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  common_as.c - common functions for accounting storage
- *
- *  $Id: common_as.c 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -503,7 +501,7 @@ extern void merge_delta_qos_list(List qos_list, List delta_qos_list)
 	while((new_qos = list_next(new_itr))) {
 		if (new_qos[0] == '-') {
 			while((curr_qos = list_next(curr_itr))) {
-				if (!strcmp(curr_qos, new_qos+1)) {
+				if (!xstrcmp(curr_qos, new_qos+1)) {
 					list_delete_item(curr_itr);
 					break;
 				}
@@ -511,7 +509,7 @@ extern void merge_delta_qos_list(List qos_list, List delta_qos_list)
 			list_iterator_reset(curr_itr);
 		} else if (new_qos[0] == '+') {
 			while((curr_qos = list_next(curr_itr))) {
-				if (!strcmp(curr_qos, new_qos+1)) {
+				if (!xstrcmp(curr_qos, new_qos+1)) {
 					break;
 				}
 			}
@@ -560,7 +558,7 @@ extern bool is_user_coord(slurmdb_user_rec_t *user, char *account)
 
 	itr = list_iterator_create(user->coord_accts);
 	while((coord = list_next(itr))) {
-		if (!strcasecmp(coord->name, account))
+		if (!xstrcasecmp(coord->name, account))
 			break;
 	}
 	list_iterator_destroy(itr);
diff --git a/src/plugins/accounting_storage/common/common_as.h b/src/plugins/accounting_storage/common/common_as.h
index 4930630ae..f859c27de 100644
--- a/src/plugins/accounting_storage/common/common_as.h
+++ b/src/plugins/accounting_storage/common/common_as.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  common_as.h - header for common functions for accounting storage
- *
- *  $Id: common_as.c 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008 Lawrence Livermore National Security.
diff --git a/src/plugins/accounting_storage/filetxt/Makefile.in b/src/plugins/accounting_storage/filetxt/Makefile.in
index b0c4edd9a..ac289fc20 100644
--- a/src/plugins/accounting_storage/filetxt/Makefile.in
+++ b/src/plugins/accounting_storage/filetxt/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage/filetxt
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c b/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c
index 83ed28233..49c9478fa 100644
--- a/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c
+++ b/src/plugins/accounting_storage/filetxt/accounting_storage_filetxt.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  accounting_storage_filetxt.c - account interface to filetxt.
- *
- *  $Id: accounting_storage_filetxt.c 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -467,7 +465,7 @@ extern List acct_storage_p_get_accts(void *db_conn, uid_t uid,
 }
 
 extern List acct_storage_p_get_clusters(void *db_conn, uid_t uid,
-					slurmdb_account_cond_t *cluster_q)
+					slurmdb_cluster_cond_t *cluster_cond)
 {
 	return NULL;
 }
@@ -549,6 +547,12 @@ extern int acct_storage_p_roll_usage(void *db_conn,
 	return rc;
 }
 
+extern int acct_storage_p_fix_lost_jobs(void *db_conn, uint32_t uid,
+					List jobs)
+{
+	return SLURM_SUCCESS;
+}
+
 extern int clusteracct_storage_p_node_down(void *db_conn,
 					   struct node_record *node_ptr,
 					   time_t event_time, char *reason,
@@ -1048,3 +1052,9 @@ extern int acct_storage_p_reconfig(void *db_conn)
 {
 	return SLURM_SUCCESS;
 }
+
+extern int acct_storage_p_reset_lft_rgt(void *db_conn, uid_t uid,
+					List cluster_list)
+{
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c
index ff5e7968d..96b38d117 100644
--- a/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c
+++ b/src/plugins/accounting_storage/filetxt/filetxt_jobacct_process.c
@@ -583,7 +583,7 @@ static int _parse_line(char *f[], void **data, int len)
 			if (isspace((*job)->nodes[i]))
 				(*job)->nodes[i] = '\0';
 		}
-		if (!strcmp((*job)->nodes, "(null)")) {
+		if (!xstrcmp((*job)->nodes, "(null)")) {
 			xfree((*job)->nodes);
 			(*job)->nodes = xstrdup("(unknown)");
 		}
@@ -799,7 +799,7 @@ static void _process_step(List job_list, char *f[], int lc,
 		if (list_count(job->steps) > 1)
 			job->track_steps = 1;
 		else if (step && step->stepname && job->jobname) {
-			if (strcmp(step->stepname, job->jobname))
+			if (xstrcmp(step->stepname, job->jobname))
 				job->track_steps = 1;
 		}
 	}
@@ -808,7 +808,7 @@ static void _process_step(List job_list, char *f[], int lc,
 		job->header.timestamp = step->header.timestamp;
 	job->job_step_seen = 1;
 	job->ntasks += step->ntasks;
-	if (!job->nodes || !strcmp(job->nodes, "(unknown)")) {
+	if (!job->nodes || !xstrcmp(job->nodes, "(unknown)")) {
 		xfree(job->nodes);
 		job->nodes = xstrdup(step->nodes);
 	}
@@ -1004,7 +1004,7 @@ extern List filetxt_jobacct_process_get_jobs(slurmdb_job_cond_t *job_cond)
 		    && list_count(job_cond->jobname_list)) {
 			itr = list_iterator_create(job_cond->jobname_list);
 			while((object = list_next(itr))) {
-				if (!strcasecmp(f[F_JOBNAME], object)) {
+				if (!xstrcasecmp(f[F_JOBNAME], object)) {
 					list_iterator_destroy(itr);
 					goto foundjobname;
 				}
@@ -1043,7 +1043,7 @@ extern List filetxt_jobacct_process_get_jobs(slurmdb_job_cond_t *job_cond)
 		    && list_count(job_cond->partition_list)) {
 			itr = list_iterator_create(job_cond->partition_list);
 			while((object = list_next(itr)))
-				if (!strcasecmp(f[F_PARTITION], object)) {
+				if (!xstrcasecmp(f[F_PARTITION], object)) {
 					list_iterator_destroy(itr);
 					goto foundp;
 				}
@@ -1253,7 +1253,8 @@ extern int filetxt_jobacct_process_archive(slurmdb_archive_cond_t *arch_cond)
 				itr = list_iterator_create(
 					job_cond->partition_list);
 				while((object = list_next(itr)))
-					if (!strcasecmp(f[F_PARTITION], object))
+					if (!xstrcasecmp(f[F_PARTITION],
+							 object))
 						break;
 
 				list_iterator_destroy(itr);
diff --git a/src/plugins/accounting_storage/mysql/Makefile.am b/src/plugins/accounting_storage/mysql/Makefile.am
index bcb364c1b..178459e25 100644
--- a/src/plugins/accounting_storage/mysql/Makefile.am
+++ b/src/plugins/accounting_storage/mysql/Makefile.am
@@ -13,6 +13,7 @@ AS_MYSQL_SOURCES = accounting_storage_mysql.c accounting_storage_mysql.h \
 		as_mysql_assoc.c as_mysql_assoc.h \
 		as_mysql_cluster.c as_mysql_cluster.h \
 		as_mysql_convert.c as_mysql_convert.h \
+		as_mysql_fix_lost_jobs.c as_mysql_fix_lost_jobs.h \
 		as_mysql_job.c as_mysql_job.h \
 		as_mysql_jobacct_process.c as_mysql_jobacct_process.h \
 		as_mysql_problems.c as_mysql_problems.h \
diff --git a/src/plugins/accounting_storage/mysql/Makefile.in b/src/plugins/accounting_storage/mysql/Makefile.in
index 85963af1d..98427145a 100644
--- a/src/plugins/accounting_storage/mysql/Makefile.in
+++ b/src/plugins/accounting_storage/mysql/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage/mysql
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -182,6 +183,7 @@ am__accounting_storage_mysql_la_SOURCES_DIST =  \
 	as_mysql_tres.h as_mysql_archive.c as_mysql_archive.h \
 	as_mysql_assoc.c as_mysql_assoc.h as_mysql_cluster.c \
 	as_mysql_cluster.h as_mysql_convert.c as_mysql_convert.h \
+	as_mysql_fix_lost_jobs.c as_mysql_fix_lost_jobs.h \
 	as_mysql_job.c as_mysql_job.h as_mysql_jobacct_process.c \
 	as_mysql_jobacct_process.h as_mysql_problems.c \
 	as_mysql_problems.h as_mysql_qos.c as_mysql_qos.h \
@@ -198,6 +200,7 @@ am__objects_1 =  \
 	accounting_storage_mysql_la-as_mysql_assoc.lo \
 	accounting_storage_mysql_la-as_mysql_cluster.lo \
 	accounting_storage_mysql_la-as_mysql_convert.lo \
+	accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo \
 	accounting_storage_mysql_la-as_mysql_job.lo \
 	accounting_storage_mysql_la-as_mysql_jobacct_process.lo \
 	accounting_storage_mysql_la-as_mysql_problems.lo \
@@ -217,6 +220,7 @@ am__EXTRA_accounting_storage_mysql_la_SOURCES_DIST =  \
 	as_mysql_tres.h as_mysql_archive.c as_mysql_archive.h \
 	as_mysql_assoc.c as_mysql_assoc.h as_mysql_cluster.c \
 	as_mysql_cluster.h as_mysql_convert.c as_mysql_convert.h \
+	as_mysql_fix_lost_jobs.c as_mysql_fix_lost_jobs.h \
 	as_mysql_job.c as_mysql_job.h as_mysql_jobacct_process.c \
 	as_mysql_jobacct_process.h as_mysql_problems.c \
 	as_mysql_problems.h as_mysql_qos.c as_mysql_qos.h \
@@ -305,8 +309,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -406,6 +408,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -444,6 +450,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -487,6 +496,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -537,6 +549,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -559,6 +572,7 @@ AS_MYSQL_SOURCES = accounting_storage_mysql.c accounting_storage_mysql.h \
 		as_mysql_assoc.c as_mysql_assoc.h \
 		as_mysql_cluster.c as_mysql_cluster.h \
 		as_mysql_convert.c as_mysql_convert.h \
+		as_mysql_fix_lost_jobs.c as_mysql_fix_lost_jobs.h \
 		as_mysql_job.c as_mysql_job.h \
 		as_mysql_jobacct_process.c as_mysql_jobacct_process.h \
 		as_mysql_problems.c as_mysql_problems.h \
@@ -666,6 +680,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_assoc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_cluster.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_convert.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_fix_lost_jobs.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_job.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_jobacct_process.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accounting_storage_mysql_la-as_mysql_problems.Plo@am__quote@
@@ -749,6 +764,13 @@ accounting_storage_mysql_la-as_mysql_convert.lo: as_mysql_convert.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(accounting_storage_mysql_la_CFLAGS) $(CFLAGS) -c -o accounting_storage_mysql_la-as_mysql_convert.lo `test -f 'as_mysql_convert.c' || echo '$(srcdir)/'`as_mysql_convert.c
 
+accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo: as_mysql_fix_lost_jobs.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(accounting_storage_mysql_la_CFLAGS) $(CFLAGS) -MT accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo -MD -MP -MF $(DEPDIR)/accounting_storage_mysql_la-as_mysql_fix_lost_jobs.Tpo -c -o accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo `test -f 'as_mysql_fix_lost_jobs.c' || echo '$(srcdir)/'`as_mysql_fix_lost_jobs.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/accounting_storage_mysql_la-as_mysql_fix_lost_jobs.Tpo $(DEPDIR)/accounting_storage_mysql_la-as_mysql_fix_lost_jobs.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='as_mysql_fix_lost_jobs.c' object='accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(accounting_storage_mysql_la_CFLAGS) $(CFLAGS) -c -o accounting_storage_mysql_la-as_mysql_fix_lost_jobs.lo `test -f 'as_mysql_fix_lost_jobs.c' || echo '$(srcdir)/'`as_mysql_fix_lost_jobs.c
+
 accounting_storage_mysql_la-as_mysql_job.lo: as_mysql_job.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(accounting_storage_mysql_la_CFLAGS) $(CFLAGS) -MT accounting_storage_mysql_la-as_mysql_job.lo -MD -MP -MF $(DEPDIR)/accounting_storage_mysql_la-as_mysql_job.Tpo -c -o accounting_storage_mysql_la-as_mysql_job.lo `test -f 'as_mysql_job.c' || echo '$(srcdir)/'`as_mysql_job.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/accounting_storage_mysql_la-as_mysql_job.Tpo $(DEPDIR)/accounting_storage_mysql_la-as_mysql_job.Plo
diff --git a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
index cedccd23a..4c6774cde 100644
--- a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
+++ b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  accounting_storage_mysql.c - accounting interface to as_mysql.
- *
- *  $Id: accounting_storage_mysql.c 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -53,6 +51,7 @@
 #include "as_mysql_assoc.h"
 #include "as_mysql_cluster.h"
 #include "as_mysql_convert.h"
+#include "as_mysql_fix_lost_jobs.h"
 #include "as_mysql_job.h"
 #include "as_mysql_jobacct_process.h"
 #include "as_mysql_problems.h"
@@ -201,7 +200,7 @@ static List _get_cluster_names(mysql_conn_t *mysql_conn, bool with_deleted)
 	ret_list = list_create(slurm_destroy_char);
 	while ((row = mysql_fetch_row(result))) {
 		if (row[0] && row[0][0]) {
-			if (cluster_name && !strcmp(cluster_name, row[0]))
+			if (cluster_name && !xstrcmp(cluster_name, row[0]))
 				found = 1;
 			list_append(ret_list, xstrdup(row[0]));
 		}
@@ -553,12 +552,16 @@ static int _as_mysql_acct_check_tables(mysql_conn_t *mysql_conn)
 		{ "description", "text" },
 		{ "flags", "int unsigned default 0" },
 		{ "grace_time", "int unsigned default NULL" },
+		{ "max_jobs_pa", "int default NULL" },
 		{ "max_jobs_per_user", "int default NULL" },
+		{ "max_submit_jobs_pa", "int default NULL" },
 		{ "max_submit_jobs_per_user", "int default NULL" },
+		{ "max_tres_pa", "text not null default ''" },
 		{ "max_tres_pj", "text not null default ''" },
 		{ "max_tres_pn", "text not null default ''" },
 		{ "max_tres_pu", "text not null default ''" },
 		{ "max_tres_mins_pj", "text not null default ''" },
+		{ "max_tres_run_mins_pa", "text not null default ''" },
 		{ "max_tres_run_mins_pu", "text not null default ''" },
 		{ "min_tres_pj", "text not null default ''" },
 		{ "max_wall_duration_per_job", "int default NULL" },
@@ -1074,7 +1077,8 @@ extern void reset_mysql_conn(mysql_conn_t *mysql_conn)
 	list_flush(mysql_conn->update_list);
 }
 
-extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name)
+extern int create_cluster_assoc_table(
+	mysql_conn_t *mysql_conn, char *cluster_name)
 {
 	storage_field_t assoc_table_fields[] = {
 		{ "creation_time", "int unsigned not null" },
@@ -1108,6 +1112,24 @@ extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name)
 		{ NULL, NULL}
 	};
 
+	char table_name[200];
+
+	snprintf(table_name, sizeof(table_name), "\"%s_%s\"",
+		 cluster_name, assoc_table);
+	if (mysql_db_create_table(mysql_conn, table_name,
+				  assoc_table_fields,
+				  ", primary key (id_assoc), "
+				  "unique index (user(20), acct(20), "
+				  "`partition`(20)), "
+				  "key lft (lft), key account (acct(20)))")
+	    == SLURM_ERROR)
+		return SLURM_ERROR;
+
+	return SLURM_SUCCESS;
+}
+
+extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name)
+{
 	storage_field_t cluster_usage_table_fields[] = {
 		{ "creation_time", "int unsigned not null" },
 		{ "mod_time", "int unsigned default 0 not null" },
@@ -1289,14 +1311,7 @@ extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name)
 
 	char table_name[200];
 
-	snprintf(table_name, sizeof(table_name), "\"%s_%s\"",
-		 cluster_name, assoc_table);
-	if (mysql_db_create_table(mysql_conn, table_name,
-				  assoc_table_fields,
-				  ", primary key (id_assoc), "
-				  "unique index (user(20), acct(20), "
-				  "`partition`(20)), "
-				  "key lft (lft), key account (acct(20)))")
+	if (create_cluster_assoc_table(mysql_conn, cluster_name)
 	    == SLURM_ERROR)
 		return SLURM_ERROR;
 
@@ -2009,12 +2024,16 @@ extern int remove_common(mysql_conn_t *mysql_conn,
 			"update %s set "
 			"mod_time=%ld, deleted=1, "
 			"grace_time=DEFAULT, "
+			"max_jobs_pa=DEFAULT, "
 			"max_jobs_per_user=DEFAULT, "
+			"max_submit_jobs_pa=DEFAULT, "
 			"max_submit_jobs_per_user=DEFAULT, "
+			"max_tres_pa=DEFAULT, "
 			"max_tres_pj=DEFAULT, "
 			"max_tres_pn=DEFAULT, "
 			"max_tres_pu=DEFAULT, "
 			"max_tres_mins_pj=DEFAULT, "
+			"max_tres_run_mins_pa=DEFAULT, "
 			"max_tres_run_mins_pu=DEFAULT, "
 			"min_tres_pj=DEFAULT, "
 			"max_wall_duration_per_job=DEFAULT, "
@@ -2521,8 +2540,8 @@ extern int acct_storage_p_commit(mysql_conn_t *mysql_conn, bool commit)
 				while ((rem_cluster = list_next(itr3))) {
 					while ((cluster_name =
 						list_next(itr2))) {
-						if (!strcmp(cluster_name,
-							    rem_cluster)) {
+						if (!xstrcmp(cluster_name,
+							     rem_cluster)) {
 							list_delete_item(itr2);
 							break;
 						}
@@ -2856,6 +2875,12 @@ extern int acct_storage_p_roll_usage(mysql_conn_t *mysql_conn,
 				   sent_end, archive_data);
 }
 
+extern int acct_storage_p_fix_lost_jobs(void *db_conn, uint32_t uid,
+					List jobs)
+{
+	return as_mysql_fix_lost_jobs(db_conn, uid, jobs);
+}
+
 extern int clusteracct_storage_p_node_down(mysql_conn_t *mysql_conn,
 					   struct node_record *node_ptr,
 					   time_t event_time, char *reason,
@@ -3076,3 +3101,12 @@ extern int acct_storage_p_reconfig(mysql_conn_t *mysql_conn, bool dbd)
 	debug_flags = slurm_get_debug_flags();
 	return SLURM_SUCCESS;
 }
+
+extern int acct_storage_p_reset_lft_rgt(mysql_conn_t *mysql_conn, uid_t uid,
+					List cluster_list)
+{
+	if (check_connection(mysql_conn) != SLURM_SUCCESS)
+		return ESLURM_DB_CONNECTION;
+
+	return as_mysql_reset_lft_rgt(mysql_conn, uid, cluster_list);
+}
diff --git a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.h b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.h
index 27c6481a1..16ade4c1a 100644
--- a/src/plugins/accounting_storage/mysql/accounting_storage_mysql.h
+++ b/src/plugins/accounting_storage/mysql/accounting_storage_mysql.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  accounting_storage_mysql.h - accounting interface to as_mysql header file.
- *
- *  $Id: accounting_storage_mysql.h 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -121,6 +119,8 @@ extern int check_connection(mysql_conn_t *mysql_conn);
 extern char *fix_double_quotes(char *str);
 extern int last_affected_rows(mysql_conn_t *mysql_conn);
 extern void reset_mysql_conn(mysql_conn_t *mysql_conn);
+extern int create_cluster_assoc_table(
+	mysql_conn_t *mysql_conn, char *cluster_name);
 extern int create_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name);
 extern int remove_cluster_tables(mysql_conn_t *mysql_conn, char *cluster_name);
 extern int setup_assoc_limits(slurmdb_assoc_rec_t *assoc,
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_acct.c b/src/plugins/accounting_storage/mysql/as_mysql_acct.c
index 5034f5cf3..5c6603a2f 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_acct.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_acct.c
@@ -753,7 +753,7 @@ empty:
 		assoc_itr = list_iterator_create(assoc_list);
 		while ((acct = list_next(itr))) {
 			while ((assoc = list_next(assoc_itr))) {
-				if (strcmp(assoc->acct, acct->name))
+				if (xstrcmp(assoc->acct, acct->name))
 					continue;
 
 				if (!acct->assoc_list)
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_archive.c b/src/plugins/accounting_storage/mysql/as_mysql_archive.c
index 3e7f724dd..9cb29cc49 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_archive.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_archive.c
@@ -47,6 +47,11 @@
 #include "src/common/slurm_time.h"
 #include "src/common/slurmdbd_defs.h"
 
+#define SLURM_14_03_PROTOCOL_VERSION ((27 << 8) | 0) /* slurm version
+						      * 14.03, not
+						      * needed here
+						      * but added for
+						      * reference. */
 #define SLURMDBD_2_6_VERSION   12	/* slurm version 2.6 */
 #define SLURMDBD_2_5_VERSION   11	/* slurm version 2.5 */
 
@@ -1100,23 +1105,23 @@ static int _process_old_sql_line(const char *data_in,
 	bool new_cluster = 0;
 
 	while (data_in[i]) {
-		if (!strncmp("insert into ", data_in+i, 12)) {
+		if (!xstrncmp("insert into ", data_in+i, 12)) {
 			beginning = xstrndup(data_in+i, 11);
 			i+=12;
 			break;
-		} else if (!strncmp("delete from ", data_in+i, 12)) {
+		} else if (!xstrncmp("delete from ", data_in+i, 12)) {
 			beginning = xstrndup(data_in+i, 11);
 			i+=12;
 			delete = 1;
 			break;
-		} else if (!strncmp("drop table ", data_in+i, 11)) {
+		} else if (!xstrncmp("drop table ", data_in+i, 11)) {
 			start = i;
 			i+=11;
 			while (data_in[i] && data_in[i-1] != ';')
 				i++;
 			xstrncat(data_out, data_in+start, i-start);
 			goto end_it;
-		} else if (!strncmp("truncate table ", data_in+i, 15)) {
+		} else if (!xstrncmp("truncate table ", data_in+i, 15)) {
 			start = i;
 			i+=15;
 			while (data_in[i] && data_in[i-1] != ';')
@@ -1132,34 +1137,34 @@ static int _process_old_sql_line(const char *data_in,
 
 	//info("processing %s", data_in);
 	/* get table name */
-	if (!strncmp("cluster_event_table", data_in+i, 19)) {
+	if (!xstrncmp("cluster_event_table", data_in+i, 19)) {
 		i+=19;
 		table = event_table;
-	} else if (!strncmp("job_table", data_in+i, 9)) {
+	} else if (!xstrncmp("job_table", data_in+i, 9)) {
 		i+=9;
 		table = job_table;
-	} else if (!strncmp("step_table", data_in+i, 10)) {
+	} else if (!xstrncmp("step_table", data_in+i, 10)) {
 		i+=10;
 		table = step_table;
-	} else if (!strncmp("suspend_table", data_in+i, 13)) {
+	} else if (!xstrncmp("suspend_table", data_in+i, 13)) {
 		i+=13;
 		table = suspend_table;
-	} else if (!strncmp("cluster_day_usage_table", data_in+i, 23)) {
+	} else if (!xstrncmp("cluster_day_usage_table", data_in+i, 23)) {
 		i+=23;
 		table = cluster_day_table;
-	} else if (!strncmp("cluster_hour_usage_table", data_in+i, 24)) {
+	} else if (!xstrncmp("cluster_hour_usage_table", data_in+i, 24)) {
 		i+=24;
 		table = cluster_hour_table;
-	} else if (!strncmp("cluster_month_usage_table", data_in+i, 25)) {
+	} else if (!xstrncmp("cluster_month_usage_table", data_in+i, 25)) {
 		i+=25;
 		table = cluster_month_table;
-	} else if (!strncmp("assoc_day_usage_table", data_in+i, 21)) {
+	} else if (!xstrncmp("assoc_day_usage_table", data_in+i, 21)) {
 		i+=21;
 		table = assoc_day_table;
-	} else if (!strncmp("assoc_hour_usage_table", data_in+i, 22)) {
+	} else if (!xstrncmp("assoc_hour_usage_table", data_in+i, 22)) {
 		i+=22;
 		table = assoc_hour_table;
-	} else if (!strncmp("assoc_month_usage_table", data_in+i, 23)) {
+	} else if (!xstrncmp("assoc_month_usage_table", data_in+i, 23)) {
 		i+=23;
 		table = assoc_month_table;
 	} else {
@@ -1176,76 +1181,76 @@ static int _process_old_sql_line(const char *data_in,
 			i++;
 	//info("table is %s '%s'", table, data_in+i);
 	while (data_in[i] && data_in[i] != ')') {
-		if (delete && !strncmp("where ", data_in+i, 6)) {
+		if (delete && !xstrncmp("where ", data_in+i, 6)) {
 			i+=6;
 			continue;
-		} else if (!strncmp("period_start", data_in+i, 12)) {
+		} else if (!xstrncmp("period_start", data_in+i, 12)) {
 			xstrcat(fields, "time_start");
 			i+=12;
-		} else if (!strncmp("period_end", data_in+i, 10)) {
+		} else if (!xstrncmp("period_end", data_in+i, 10)) {
 			xstrcat(fields, "time_end");
 			i+=10;
-		} else if (!strncmp("cpu_count", data_in+i, 9)) {
+		} else if (!xstrncmp("cpu_count", data_in+i, 9)) {
 			xstrcat(fields, "count");
 			i+=9;
-		} else if (!strncmp("jobid", data_in+i, 5)) {
+		} else if (!xstrncmp("jobid", data_in+i, 5)) {
 			xstrcat(fields, "id_job");
 			i+=5;
-		} else if (!strncmp("stepid", data_in+i, 6)) {
+		} else if (!xstrncmp("stepid", data_in+i, 6)) {
 			xstrcat(fields, "id_step");
 			i+=6;
-		} else if (!strncmp("associd", data_in+i, 7)) {
+		} else if (!xstrncmp("associd", data_in+i, 7)) {
 			xstrcat(fields, "id_assoc");
 			i+=7;
-		} else if (!strncmp("blockid", data_in+i, 7)) {
+		} else if (!xstrncmp("blockid", data_in+i, 7)) {
 			xstrcat(fields, "id_block");
 			i+=7;
-		} else if (!strncmp("wckeyid", data_in+i, 7)) {
+		} else if (!xstrncmp("wckeyid", data_in+i, 7)) {
 			xstrcat(fields, "id_wckey");
 			i+=7;
-		} else if (!strncmp("qos", data_in+i, 3)) {
+		} else if (!xstrncmp("qos", data_in+i, 3)) {
 			xstrcat(fields, "id_qos");
 			i+=3;
-		} else if (!strncmp("uid", data_in+i, 3)) {
+		} else if (!xstrncmp("uid", data_in+i, 3)) {
 			xstrcat(fields, "id_user");
 			i+=3;
-		} else if (!strncmp("gid", data_in+i, 3)) {
+		} else if (!xstrncmp("gid", data_in+i, 3)) {
 			xstrcat(fields, "id_group");
 			i+=3;
-		} else if (!strncmp("submit", data_in+i, 6)) {
+		} else if (!xstrncmp("submit", data_in+i, 6)) {
 			xstrcat(fields, "time_submit");
 			i+=6;
-		} else if (!strncmp("eligible", data_in+i, 8)) {
+		} else if (!xstrncmp("eligible", data_in+i, 8)) {
 			xstrcat(fields, "time_eligible");
 			i+=8;
-		} else if (!strncmp("start", data_in+i, 5)) {
+		} else if (!xstrncmp("start", data_in+i, 5)) {
 			xstrcat(fields, "time_start");
 			i+=5;
-		} else if (!strncmp("suspended", data_in+i, 9)) {
+		} else if (!xstrncmp("suspended", data_in+i, 9)) {
 			xstrcat(fields, "time_suspended");
 			i+=9;
-		} else if (!strncmp("end", data_in+i, 3)) {
+		} else if (!xstrncmp("end", data_in+i, 3)) {
 			xstrcat(fields, "time_end");
 			i+=3;
-		} else if (!strncmp("comp_code", data_in+i, 9)) {
+		} else if (!xstrncmp("comp_code", data_in+i, 9)) {
 			xstrcat(fields, "exit_code");
 			i+=9;
-		} else if (!strncmp("alloc_cpus", data_in+i, 10)) {
+		} else if (!xstrncmp("alloc_cpus", data_in+i, 10)) {
 			xstrcat(fields, "cpus_alloc");
 			i+=10;
-		} else if (!strncmp("req_cpus", data_in+i, 8)) {
+		} else if (!xstrncmp("req_cpus", data_in+i, 8)) {
 			xstrcat(fields, "cpus_req");
 			i+=8;
-		} else if (!strncmp("alloc_nodes", data_in+i, 11)) {
+		} else if (!xstrncmp("alloc_nodes", data_in+i, 11)) {
 			xstrcat(fields, "nodes_alloc");
 			i+=11;
-		} else if (!strncmp("name", data_in+i, 4)) {
+		} else if (!xstrncmp("name", data_in+i, 4)) {
 			if (table == job_table)
 				xstrcat(fields, "job_name");
 			else if (table == step_table)
 				xstrcat(fields, "step_name");
 			i+=4;
-		} else if (!strncmp("id_tres", data_in+i, 7)) {
+		} else if (!xstrncmp("id_tres", data_in+i, 7)) {
 			start = i;
 			while (data_in[i]
 			       && data_in[i] != ',' && data_in[i] != ')') {
@@ -1257,7 +1262,7 @@ static int _process_old_sql_line(const char *data_in,
 				goto end_it;
 			}
 			xstrncat(fields, data_in+start, (i-start));
-		} else if (!strncmp("id", data_in+i, 2)) {
+		} else if (!xstrncmp("id", data_in+i, 2)) {
 			i+=2;
 			if ((table == assoc_day_table)
 			    || (table == assoc_hour_table)
@@ -1292,12 +1297,12 @@ static int _process_old_sql_line(const char *data_in,
 				xfree(id_assoc);
 			} else
 				xstrcat(fields, "job_db_inx");
-		} else if (!strncmp("cluster_nodes", data_in+i, 13)) {
+		} else if (!xstrncmp("cluster_nodes", data_in+i, 13)) {
 			/* this is here just to make it easier to
 			   handle the cluster field. */
 			xstrcat(fields, "cluster_nodes");
 			i+=13;
-		} else if (!strncmp("cluster", data_in+i, 7)) {
+		} else if (!xstrncmp("cluster", data_in+i, 7)) {
 			i+=7;
 			if (!delete) {
 				cluster_inx = cnt;
@@ -1361,92 +1366,92 @@ static int _process_old_sql_line(const char *data_in,
 		ending_end = i;
 		ending_start = 0;
 		while (data_in[ending_end] && data_in[ending_end-1] != ';') {
-			if (!strncmp(data_in+ending_end,
+			if (!xstrncmp(data_in+ending_end,
 				     "on duplicate key", 16)) {
 				ending_start = ending_end;
 			}
 			if (ending_start) {
-				if (!strncmp("period_start",
-					     data_in+ending_end, 12)) {
+				if (!xstrncmp("period_start",
+					      data_in+ending_end, 12)) {
 					xstrcat(ending, "time_start");
 					ending_end+=12;
-				} else if (!strncmp("period_end",
-						    data_in+ending_end, 10)) {
+				} else if (!xstrncmp("period_end",
+						     data_in+ending_end, 10)) {
 					xstrcat(ending, "time_end");
 					ending_end+=10;
-				} else if (!strncmp("jobid",
-						    data_in+ending_end, 5)) {
+				} else if (!xstrncmp("jobid",
+						     data_in+ending_end, 5)) {
 					xstrcat(ending, "id_job");
 					ending_end+=5;
-				} else if (!strncmp("stepid",
-						    data_in+ending_end, 6)) {
+				} else if (!xstrncmp("stepid",
+						     data_in+ending_end, 6)) {
 					xstrcat(ending, "id_step");
 					ending_end+=6;
-				} else if (!strncmp("associd",
-						    data_in+ending_end, 7)) {
+				} else if (!xstrncmp("associd",
+						     data_in+ending_end, 7)) {
 					xstrcat(ending, "id_assoc");
 					ending_end+=7;
-				} else if (!strncmp("blockid",
-						    data_in+ending_end, 7)) {
+				} else if (!xstrncmp("blockid",
+						     data_in+ending_end, 7)) {
 					xstrcat(ending, "id_block");
 					ending_end+=7;
-				} else if (!strncmp("wckeyid",
-						    data_in+ending_end, 7)) {
+				} else if (!xstrncmp("wckeyid",
+						     data_in+ending_end, 7)) {
 					xstrcat(ending, "id_wckey");
 					ending_end+=7;
-				} else if (!strncmp("uid",
-						    data_in+ending_end, 3)) {
+				} else if (!xstrncmp("uid",
+						     data_in+ending_end, 3)) {
 					xstrcat(ending, "id_user");
 					ending_end+=3;
-				} else if (!strncmp("gid",
-						    data_in+ending_end, 3)) {
+				} else if (!xstrncmp("gid",
+						     data_in+ending_end, 3)) {
 					xstrcat(ending, "id_group");
 					ending_end+=3;
-				} else if (!strncmp("submit",
-						    data_in+ending_end, 6)) {
+				} else if (!xstrncmp("submit",
+						     data_in+ending_end, 6)) {
 					xstrcat(ending, "time_submit");
 					ending_end+=6;
-				} else if (!strncmp("eligible",
-						    data_in+ending_end, 8)) {
+				} else if (!xstrncmp("eligible",
+						     data_in+ending_end, 8)) {
 					xstrcat(ending, "time_eligible");
 					ending_end+=8;
-				} else if (!strncmp("start",
-						    data_in+ending_end, 5)) {
+				} else if (!xstrncmp("start",
+						     data_in+ending_end, 5)) {
 					xstrcat(ending, "time_start");
 					ending_end+=5;
-				} else if (!strncmp("suspended",
-						    data_in+ending_end, 9)) {
+				} else if (!xstrncmp("suspended",
+						     data_in+ending_end, 9)) {
 					xstrcat(ending, "time_suspended");
 					ending_end+=9;
-				} else if (!strncmp("end",
-						    data_in+ending_end, 3)) {
+				} else if (!xstrncmp("end",
+						     data_in+ending_end, 3)) {
 					xstrcat(ending, "time_end");
 					ending_end+=3;
-				} else if (!strncmp("comp_code",
-						    data_in+ending_end, 9)) {
+				} else if (!xstrncmp("comp_code",
+						     data_in+ending_end, 9)) {
 					xstrcat(ending, "exit_code");
 					ending_end+=9;
-				} else if (!strncmp("alloc_cpus",
-						    data_in+ending_end, 10)) {
+				} else if (!xstrncmp("alloc_cpus",
+						     data_in+ending_end, 10)) {
 					xstrcat(ending, "cpus_alloc");
 					ending_end+=10;
-				} else if (!strncmp("req_cpus",
-						    data_in+ending_end, 8)) {
+				} else if (!xstrncmp("req_cpus",
+						     data_in+ending_end, 8)) {
 					xstrcat(ending, "cpus_req");
 					ending_end+=8;
-				} else if (!strncmp("alloc_nodes",
-						    data_in+ending_end, 11)) {
+				} else if (!xstrncmp("alloc_nodes",
+						     data_in+ending_end, 11)) {
 					xstrcat(ending, "nodes_alloc");
 					ending_end+=11;
-				} else if (!strncmp("name",
-						    data_in+ending_end, 4)) {
+				} else if (!xstrncmp("name",
+						     data_in+ending_end, 4)) {
 					if (table == job_table)
 						xstrcat(ending, "job_name");
 					else if (table == step_table)
 						xstrcat(ending, "step_name");
 					ending_end+=4;
-				} else if (!strncmp("id",
-						    data_in+ending_end, 2)) {
+				} else if (!xstrncmp("id",
+						     data_in+ending_end, 2)) {
 					if ((table == assoc_day_table)
 					    || (table == assoc_hour_table)
 					    || (table == assoc_month_table))
@@ -1490,8 +1495,8 @@ static int _process_old_sql_line(const char *data_in,
 					xstrncat(new_cluster_name,
 						 data_in+start+1, (i-start-2));
 					if (*cluster_name) {
-						if (strcmp(*cluster_name,
-							   new_cluster_name))
+						if (xstrcmp(*cluster_name,
+							    new_cluster_name))
 							new_cluster = 1;
 						else
 							xfree(new_cluster_name);
@@ -2237,8 +2242,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 	uint32_t cnt = 0;
 	Buf buffer;
 	int error_code = 0;
-	static Buf (*pack_func)(MYSQL_RES *result, char *cluster_name,
-				uint32_t cnt, time_t *period_start);
+	Buf (*pack_func)(MYSQL_RES *result, char *cluster_name,
+			 uint32_t cnt, time_t *period_start);
 
 	cols = _get_archive_columns(type);
 
@@ -2247,7 +2252,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 		pack_func = &_pack_archive_events;
 		query = xstrdup_printf("select %s from \"%s_%s\" where "
 				       "time_start <= %ld && time_end != 0 "
-				       "order by time_start asc",
+				       "order by time_start asc "
+				       "for update",
 				       cols, cluster_name, event_table,
 				       period_end);
 		break;
@@ -2255,7 +2261,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 		pack_func = &_pack_archive_suspends;
 		query = xstrdup_printf("select %s from \"%s_%s\" where "
 				       "time_start <= %ld && time_end != 0 "
-				       "order by time_start asc",
+				       "order by time_start asc "
+				       "for update",
 				       cols, cluster_name, suspend_table,
 				       period_end);
 		break;
@@ -2263,7 +2270,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 		pack_func = &_pack_archive_resvs;
 		query = xstrdup_printf("select %s from \"%s_%s\" where "
 				       "time_start <= %ld && time_end != 0 "
-				       "order by time_start asc",
+				       "order by time_start asc "
+				       "for update",
 				       cols, cluster_name, resv_table,
 				       period_end);
 		break;
@@ -2271,7 +2279,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 		pack_func = &_pack_archive_jobs;
 		query = xstrdup_printf("select %s from \"%s_%s\" where "
 				       "time_submit < %ld && time_end != 0 "
-				       "&& !deleted order by time_submit asc",
+				       "&& !deleted order by time_submit asc "
+				       "for update",
 				       cols, cluster_name, job_table,
 				       period_end);
 		break;
@@ -2279,7 +2288,8 @@ static uint32_t _archive_table(purge_type_t type, mysql_conn_t *mysql_conn,
 		pack_func = &_pack_archive_steps;
 		query = xstrdup_printf("select %s from \"%s_%s\" where "
 				       "time_start <= %ld && time_end != 0 "
-				       "&& !deleted order by time_start asc",
+				       "&& !deleted order by time_start asc "
+				       "for update",
 				       cols, cluster_name, step_table,
 				       period_end);
 		break;
@@ -2477,12 +2487,25 @@ static int _archive_purge_table(purge_type_t purge_type,
 			DB_DEBUG(mysql_conn->conn, "query\n%s", query);
 
 		while ((rc = mysql_db_delete_affected_rows(
-						mysql_conn,query)) > 0);
+				mysql_conn, query)) > 0) {
+			/* Commit here every time since this could create a huge
+			 * transaction.
+			 */
+			if (mysql_db_commit(mysql_conn)) {
+				error("Couldn't commit cluster (%s) purge",
+				      cluster_name);
+				break;
+			}
+		}
 
 		xfree(query);
 		if (rc != SLURM_SUCCESS) {
 			error("Couldn't remove old event data");
 			return SLURM_ERROR;
+		} else if (mysql_db_commit(mysql_conn)) {
+			error("Couldn't commit cluster (%s) purge",
+			      cluster_name);
+			break;
 		}
 	} while (tmp_end < curr_end);
 
@@ -2647,10 +2670,10 @@ extern int as_mysql_jobacct_process_archive_load(
 	/* this is the old version of an archive file where the file
 	   was straight sql. */
 	if ((strlen(data) >= 12)
-	    && (!strncmp("insert into ", data, 12)
-		|| !strncmp("delete from ", data, 12)
-		|| !strncmp("drop table ", data, 11)
-		|| !strncmp("truncate table ", data, 15))) {
+	    && (!xstrncmp("insert into ", data, 12)
+		|| !xstrncmp("delete from ", data, 12)
+		|| !xstrncmp("drop table ", data, 11)
+		|| !xstrncmp("truncate table ", data, 15))) {
 		_process_old_sql(&data);
 		goto got_sql;
 	}
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_assoc.c b/src/plugins/accounting_storage/mysql/as_mysql_assoc.c
index 2370efbb7..e279f7cb2 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_assoc.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_assoc.c
@@ -40,6 +40,9 @@
 #include "as_mysql_assoc.h"
 #include "as_mysql_usage.h"
 
+static char *tmp_cluster_name = "slurmredolftrgttemp";
+
+
 /* if this changes you will need to edit the corresponding enum */
 char *assoc_req_inx[] = {
 	"id_assoc",
@@ -197,7 +200,7 @@ static int _assoc_sort_cluster(void *r1, void *r2)
 	slurmdb_assoc_rec_t *rec_b = *(slurmdb_assoc_rec_t **)r2;
 	int diff;
 
-	diff = strcmp(rec_a->cluster, rec_b->cluster);
+	diff = xstrcmp(rec_a->cluster, rec_b->cluster);
 	if (diff < 0)
 		return -1;
 	else if (diff > 0)
@@ -961,8 +964,8 @@ static int _modify_unset_users(mysql_conn_t *mysql_conn,
 
 						if ((qos_char[0]
 						     != delta_char[0])
-						    && (!strcmp(qos_char+1,
-								delta_char+1)))
+						    && (!xstrcmp(qos_char+1,
+								 delta_char+1)))
 							break;
 					}
 					list_iterator_reset(delta_itr);
@@ -1286,7 +1289,7 @@ static int _process_modify_assoc_results(mysql_conn_t *mysql_conn,
 			}
 			itr = list_iterator_create(user->coord_accts);
 			while ((coord = list_next(itr))) {
-				if (!strcasecmp(coord->name, account))
+				if (!xstrcasecmp(coord->name, account))
 					break;
 			}
 			list_iterator_destroy(itr);
@@ -1347,7 +1350,7 @@ static int _process_modify_assoc_results(mysql_conn_t *mysql_conn,
 				row[MASSOC_USER]);
 		} else {
 			if (assoc->parent_acct) {
-				if (!strcasecmp(row[MASSOC_ACCT],
+				if (!xstrcasecmp(row[MASSOC_ACCT],
 						assoc->parent_acct)) {
 					error("You can't make an account be a "
 					      "child of it's self");
@@ -1392,7 +1395,7 @@ static int _process_modify_assoc_results(mysql_conn_t *mysql_conn,
 			xstrfmtcat(name_char, "(id_assoc=%s", row[MASSOC_ID]);
 
 		/* Only do this when not dealing with the root association. */
-		if (strcmp(orig_acct, "root") || row[MASSOC_USER][0]) {
+		if (xstrcmp(orig_acct, "root") || row[MASSOC_USER][0]) {
 			MYSQL_ROW row2;
 			/* If there is a variable cleared here we need to make
 			   sure we get the parent's information, if any. */
@@ -1742,7 +1745,7 @@ static int _process_remove_assoc_results(mysql_conn_t *mysql_conn,
 			}
 			itr = list_iterator_create(user->coord_accts);
 			while ((coord = list_next(itr))) {
-				if (!strcasecmp(coord->name,
+				if (!xstrcasecmp(coord->name,
 						row[RASSOC_ACCT]))
 					break;
 			}
@@ -2012,8 +2015,8 @@ static int _cluster_get_assocs(mysql_conn_t *mysql_conn,
 
 		if (!without_parent_info && parent_acct &&
 		    (!last_acct || !last_cluster
-		     || strcmp(parent_acct, last_acct)
-		     || strcmp(cluster_name, last_cluster))) {
+		     || xstrcmp(parent_acct, last_acct)
+		     || xstrcmp(cluster_name, last_cluster))) {
 			query = xstrdup_printf(
 				"call get_parent_limits('%s', "
 				"'%s', '%s', %u); %s",
@@ -2203,8 +2206,8 @@ static int _cluster_get_assocs(mysql_conn_t *mysql_conn,
 				if (new_qos[0] == '-') {
 					while ((curr_qos =
 						list_next(curr_qos_itr))) {
-						if (!strcmp(curr_qos,
-							    new_qos+1)) {
+						if (!xstrcmp(curr_qos,
+							     new_qos+1)) {
 							list_delete_item(
 								curr_qos_itr);
 							break;
@@ -2214,8 +2217,8 @@ static int _cluster_get_assocs(mysql_conn_t *mysql_conn,
 				} else if (new_qos[0] == '+') {
 					while ((curr_qos =
 						list_next(curr_qos_itr))) {
-						if (!strcmp(curr_qos,
-							    new_qos+1)) {
+						if (!xstrcmp(curr_qos,
+							     new_qos+1)) {
 							break;
 						}
 					}
@@ -2351,7 +2354,7 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 				account = object->parent_acct;
 			list_iterator_reset(itr2);
 			while ((coord = list_next(itr2))) {
-				if (!strcasecmp(coord->name, account))
+				if (!xstrcasecmp(coord->name, account))
 					break;
 			}
 			if (!coord)
@@ -2458,6 +2461,13 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 			list_append(added_user_list, object->user);
 		}
 
+		if (object->id) {
+			xstrcat(cols, ", id_assoc");
+			xstrfmtcat(vals, ", '%u'", object->id);
+			xstrfmtcat(update, " && id_assoc='%u'", object->id);
+			xstrfmtcat(extra, ", id_assoc='%u'", object->id);
+		}
+
 		setup_assoc_limits(object, &cols, &vals, &extra,
 				   QOS_LEVEL_NONE, 1);
 
@@ -2498,8 +2508,8 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 			 * while.
 			 */
 			if (!old_parent || !old_cluster
-			    || strcasecmp(parent, old_parent)
-			    || strcasecmp(object->cluster, old_cluster)) {
+			    || xstrcasecmp(parent, old_parent)
+			    || xstrcasecmp(object->cluster, old_cluster)) {
 				char *sel_query = xstrdup_printf(
 					"SELECT lft FROM \"%s_%s\" WHERE "
 					"acct = '%s' and user = '' "
@@ -2611,7 +2621,8 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 /* 				   vals); */
 		} else if (!slurm_atoul(row[AASSOC_DELETED])) {
 			/* We don't need to do anything here */
-			debug("This account was added already");
+			debug("This account %s was added already",
+			      object->acct);
 			xfree(cols);
 			xfree(vals);
 			xfree(update);
@@ -2629,8 +2640,8 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 			 */
 			assoc_id = slurm_atoul(row[AASSOC_ID]);
 			if (object->parent_acct
-			    && strcasecmp(object->parent_acct,
-					  row[AASSOC_PACCT])) {
+			    && xstrcasecmp(object->parent_acct,
+					   row[AASSOC_PACCT])) {
 
 				/* We need to move the parent! */
 				if (_move_parent(mysql_conn, uid,
@@ -2683,8 +2694,8 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 		 * happened */
 		if (!moved_parent &&
 		    (!last_parent || !last_cluster
-		     || strcmp(parent, last_parent)
-		     || strcmp(object->cluster, last_cluster))) {
+		     || xstrcmp(parent, last_parent)
+		     || xstrcmp(object->cluster, last_cluster))) {
 			uint32_t tmp32 = 0;
 			if ((tmp32 = _get_parent_id(mysql_conn,
 						    parent,
@@ -2709,25 +2720,32 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 			list_remove(itr);
 		}
 
-		/* we always have a ', ' as the first 2 chars */
-		tmp_extra = slurm_add_slash_to_quotes(extra+2);
+		/* We don't want to record the transactions of the
+		 * tmp_cluster.
+		 */
 
-		if (txn_query)
-			xstrfmtcat(txn_query,
-				   ", (%ld, %d, 'id_assoc=%d', "
-				   "'%s', '%s', '%s')",
-				   now, DBD_ADD_ASSOCS, assoc_id, user_name,
-				   tmp_extra, object->cluster);
-		else
-			xstrfmtcat(txn_query,
-				   "insert into %s "
-				   "(timestamp, action, name, actor, "
-				   "info, cluster) values (%ld, %d, "
-				   "'id_assoc=%d', '%s', '%s', '%s')",
-				   txn_table,
-				   now, DBD_ADD_ASSOCS, assoc_id, user_name,
-				   tmp_extra, object->cluster);
-		xfree(tmp_extra);
+		if (xstrcmp(object->cluster, tmp_cluster_name)) {
+			/* we always have a ', ' as the first 2 chars */
+			tmp_extra = slurm_add_slash_to_quotes(extra+2);
+			if (txn_query)
+				xstrfmtcat(txn_query,
+					   ", (%ld, %d, 'id_assoc=%d', "
+					   "'%s', '%s', '%s')",
+					   now, DBD_ADD_ASSOCS, assoc_id,
+					   user_name,
+					   tmp_extra, object->cluster);
+			else
+				xstrfmtcat(txn_query,
+					   "insert into %s "
+					   "(timestamp, action, name, actor, "
+					   "info, cluster) values (%ld, %d, "
+					   "'id_assoc=%d', '%s', '%s', '%s')",
+					   txn_table,
+					   now, DBD_ADD_ASSOCS, assoc_id,
+					   user_name,
+					   tmp_extra, object->cluster);
+			xfree(tmp_extra);
+		}
 		xfree(extra);
 	}
 	list_iterator_destroy(itr);
@@ -2788,8 +2806,8 @@ extern int as_mysql_add_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 				uint32_t smallest_lft = 0xFFFFFFFF;
 				while ((object = list_next(itr2))) {
 					if (object->lft < smallest_lft
-					    && !strcmp(object->cluster,
-						       cluster_name))
+					    && !xstrcmp(object->cluster,
+							cluster_name))
 						smallest_lft = object->lft;
 				}
 				list_iterator_reset(itr2);
@@ -3297,3 +3315,215 @@ empty:
 	//END_TIMER2("get_assocs");
 	return assoc_list;
 }
+
+extern int as_mysql_reset_lft_rgt(mysql_conn_t *mysql_conn, uid_t uid,
+				  List cluster_list)
+{
+	List assoc_list = NULL;
+	ListIterator itr = NULL, assoc_itr;
+	int i=0, is_admin=1;
+	slurmdb_user_rec_t user;
+	char *query = NULL, *tmp = NULL, *cluster_name = NULL;
+	slurmdb_assoc_cond_t assoc_cond;
+	slurmdb_assoc_rec_t *assoc_rec;
+	int rc = SLURM_SUCCESS;
+	slurmdb_update_object_t *update_object;
+	slurmdb_update_type_t type;
+	List use_cluster_list = as_mysql_cluster_list;
+
+	info("Resetting lft and rgt's called");
+	/* This is not safe if ran during the middle of a slurmdbd
+	 * run since we can not lock as_mysql_cluster_list_lock when
+	 * no list is given.  At the time of this writing the function
+	 * was only called at the beginning of the DBD.  If this ever
+	 * changes please make the appropriate changes to allow empty lists.
+	 */
+	if (cluster_list && list_count(cluster_list))
+		use_cluster_list = cluster_list;
+	/* else */
+	/* 	slurm_mutex_lock(&as_mysql_cluster_list_lock); */
+
+	memset(&assoc_cond, 0, sizeof(slurmdb_assoc_cond_t));
+
+	xfree(tmp);
+	xstrfmtcat(tmp, "t1.%s", assoc_req_inx[i]);
+	for (i=1; i<ASSOC_REQ_COUNT; i++) {
+		xstrfmtcat(tmp, ", t1.%s", assoc_req_inx[i]);
+	}
+
+	memset(&user, 0, sizeof(slurmdb_user_rec_t));
+	user.uid = uid;
+
+	itr = list_iterator_create(use_cluster_list);
+	while ((cluster_name = list_next(itr))) {
+		time_t now = time(NULL);
+		DEF_TIMERS;
+		START_TIMER;
+		info("Resetting cluster %s", cluster_name);
+		assoc_list = list_create(slurmdb_destroy_assoc_rec);
+		/* set this up to get the associations without parent_limits */
+		assoc_cond.without_parent_limits = 1;
+
+		/* Get the associations for the cluster that needs to
+		 * somehow got lft and rgt's messed up. */
+		if ((rc = _cluster_get_assocs(mysql_conn, &user, &assoc_cond,
+					      cluster_name, tmp,
+					      " deleted=1 || deleted=0",
+					      is_admin, assoc_list))
+		    != SLURM_SUCCESS) {
+			info("fail for cluster %s", cluster_name);
+			FREE_NULL_LIST(assoc_list);
+			continue;
+		}
+
+		if (!list_count(assoc_list)) {
+			info("Cluster %s has no associations, nothing to reset",
+			     cluster_name);
+			FREE_NULL_LIST(assoc_list);
+			continue;
+		}
+
+		slurmdb_sort_hierarchical_assoc_list(assoc_list, false);
+		info("Got current associations for cluster %s", cluster_name);
+		/* Set the cluster name to the tmp name and remove qos */
+		assoc_itr = list_iterator_create(assoc_list);
+		while ((assoc_rec = list_next(assoc_itr))) {
+			if (assoc_rec->id == 1) {
+				/* Remove root association as we will make it
+				 * manually in the next step.
+				 */
+				list_delete_item(assoc_itr);
+				continue;
+			}
+			xfree(assoc_rec->cluster);
+			assoc_rec->cluster = xstrdup(tmp_cluster_name);
+			/* Remove the qos_list just to simplify things
+			 * since we really want to just simplify
+			 * things.
+			 */
+			FREE_NULL_LIST(assoc_rec->qos_list);
+		}
+		list_iterator_destroy(assoc_itr);
+
+		/* What we are going to do now is add all the
+		 * associations to a tmp cluster this will recreate
+		 * the lft and rgt hierarchy.  Then when this is done
+		 * we will move those lft/rgts back over to the
+		 * original cluster based on the same id_assoc's.
+		 * After that we will send these new objects out to
+		 * the slurmctld to use.
+		 */
+
+		create_cluster_assoc_table(mysql_conn, tmp_cluster_name);
+
+		/* We must add the root association here to make it so
+		 * the adds work afterwards.
+		 */
+		xstrfmtcat(query,
+			   "insert into \"%s_%s\" "
+			   "(creation_time, mod_time, acct, lft, rgt) "
+			   "values (%ld, %ld, 'root', 1, 2) "
+			   "on duplicate key update deleted=0, "
+			   "id_assoc=LAST_INSERT_ID(id_assoc), mod_time=%ld;",
+			   tmp_cluster_name, assoc_table, now, now, now);
+
+		if (debug_flags & DEBUG_FLAG_DB_ASSOC)
+			DB_DEBUG(mysql_conn->conn, "query\n%s", query);
+
+		rc = mysql_db_query(mysql_conn, query);
+		xfree(query);
+
+		if (rc != SLURM_SUCCESS) {
+			error("Couldn't add cluster root assoc");
+			break;
+		}
+
+		info("Redoing the hierarchy in a temporary table");
+		if (as_mysql_add_assocs(mysql_conn, uid, assoc_list) !=
+		    SLURM_SUCCESS)
+			goto endit;
+
+		/* Since the list we now have has deleted
+		 * items in it we need to get a list with just
+		 * the current items instead
+		 */
+		list_flush(assoc_list);
+
+		info("Resetting cluster with correct lft and rgt's");
+		/* Update the normal table with the correct lft and rgts */
+		query = xstrdup_printf(
+			"update \"%s_%s\" t1 left outer join \"%s_%s\" t2 on "
+			"t1.id_assoc = t2.id_assoc set t1.lft = t2.lft, "
+			"t1.rgt = t2.rgt, t1.mod_time = t2.mod_time;",
+			cluster_name, assoc_table,
+			tmp_cluster_name, assoc_table);
+
+		if (debug_flags & DEBUG_FLAG_DB_ASSOC)
+			DB_DEBUG(mysql_conn->conn, "query\n%s", query);
+
+		rc = mysql_db_query(mysql_conn, query);
+		xfree(query);
+		if (rc != SLURM_SUCCESS)
+			error("Couldn't fix assocs");
+
+		/* Now we will remove the adds that happened and
+		 * replace them with mod's so we can push the new
+		 * lft's to the cluster.
+		 */
+		type = SLURMDB_ADD_ASSOC;
+		assoc_itr = list_iterator_create(mysql_conn->update_list);
+		while ((update_object = list_next(assoc_itr))) {
+			if (update_object->type == type) {
+				list_delete_item(assoc_itr);
+				break;
+			}
+		}
+		list_iterator_destroy(assoc_itr);
+
+		/* Make the mod assoc update_object if it doesn't exist */
+		type = SLURMDB_MODIFY_ASSOC;
+		if (!(update_object = list_find_first(
+			      mysql_conn->update_list,
+			      slurmdb_find_update_object_in_list,
+			      &type))) {
+			update_object = xmalloc(
+				sizeof(slurmdb_update_object_t));
+			list_append(mysql_conn->update_list, update_object);
+			update_object->type = type;
+			update_object->objects = list_create(
+				slurmdb_destroy_assoc_rec);
+		}
+
+		/* set this up to get the associations with parent_limits */
+		assoc_cond.without_parent_limits = 0;
+		if ((rc = _cluster_get_assocs(mysql_conn, &user, &assoc_cond,
+					      cluster_name, tmp,
+					      " deleted=0",
+					      is_admin, assoc_list))
+		    != SLURM_SUCCESS) {
+			goto endit;
+		}
+		list_transfer(update_object->objects, assoc_list);
+	endit:
+		FREE_NULL_LIST(assoc_list);
+		/* Get rid of the temporary table. */
+		query = xstrdup_printf("drop table \"%s_%s\";",
+				       tmp_cluster_name, assoc_table);
+		rc = mysql_db_query(mysql_conn, query);
+		xfree(query);
+		if (rc != SLURM_SUCCESS) {
+			error("problem with update query");
+			rc = SLURM_ERROR;
+		}
+		END_TIMER;
+		info("resetting took %s", TIME_STR);
+	}
+	list_iterator_destroy(itr);
+
+	xfree(tmp);
+
+	/* if (use_cluster_list == as_mysql_cluster_list) */
+	/* 	slurm_mutex_unlock(&as_mysql_cluster_list_lock); */
+
+	return rc;
+}
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_assoc.h b/src/plugins/accounting_storage/mysql/as_mysql_assoc.h
index b758fdbb8..63c100ade 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_assoc.h
+++ b/src/plugins/accounting_storage/mysql/as_mysql_assoc.h
@@ -59,4 +59,7 @@ extern List as_mysql_remove_assocs(mysql_conn_t *mysql_conn, uint32_t uid,
 extern List as_mysql_get_assocs(mysql_conn_t *mysql_conn, uid_t uid,
 				slurmdb_assoc_cond_t *assoc_cond);
 
+extern int as_mysql_reset_lft_rgt(mysql_conn_t *mysql_conn, uid_t uid,
+				  List cluster_list);
+
 #endif
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_cluster.c b/src/plugins/accounting_storage/mysql/as_mysql_cluster.c
index f64ea144c..593c20659 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_cluster.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_cluster.c
@@ -264,7 +264,7 @@ extern int as_mysql_add_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
 			slurm_mutex_lock(&as_mysql_cluster_list_lock);
 			check_itr = list_iterator_create(as_mysql_cluster_list);
 			while ((tmp_name = list_next(check_itr))) {
-				if (!strcmp(tmp_name, object->name))
+				if (!xstrcmp(tmp_name, object->name))
 					break;
 			}
 			list_iterator_destroy(check_itr);
@@ -445,6 +445,7 @@ extern List as_mysql_modify_clusters(mysql_conn_t *mysql_conn, uint32_t uid,
 		if (debug_flags & DEBUG_FLAG_DB_ASSOC)
 			DB_DEBUG(mysql_conn->conn,
 				 "didn't effect anything\n%s", query);
+		xfree(name_char);
 		xfree(vals);
 		xfree(query);
 		return ret_list;
@@ -775,7 +776,7 @@ empty:
 	assoc_itr = list_iterator_create(assoc_list);
 	while ((cluster = list_next(itr))) {
 		while ((assoc = list_next(assoc_itr))) {
-			if (strcmp(assoc->cluster, cluster->name))
+			if (xstrcmp(assoc->cluster, cluster->name))
 				continue;
 
 			if (cluster->root_assoc) {
@@ -1098,7 +1099,7 @@ extern int as_mysql_node_down(mysql_conn_t *mysql_conn,
 	row = mysql_fetch_row(result);
 	if (row && (node_ptr->node_state == slurm_atoul(row[0])) &&
 	    my_reason && row[1] &&
-	    !strcasecmp(my_reason, row[1])) {
+	    !xstrcasecmp(my_reason, row[1])) {
 		debug("as_mysql_node_down: no change needed %u == %s "
 		      "and %s == %s",
 		     node_ptr->node_state, row[0], my_reason, row[1]);
@@ -1199,7 +1200,7 @@ extern int as_mysql_register_ctld(mysql_conn_t *mysql_conn,
 
 	/* check if we are running on the backup controller */
 	if (slurmctld_conf.backup_controller
-	    && !strcmp(slurmctld_conf.backup_controller, hostname)) {
+	    && !xstrcmp(slurmctld_conf.backup_controller, hostname)) {
 		address = slurmctld_conf.backup_addr;
 	} else
 		address = slurmctld_conf.control_addr;
@@ -1391,7 +1392,7 @@ extern int as_mysql_cluster_tres(mysql_conn_t *mysql_conn,
 				(void) mysql_db_query(mysql_conn, query);
 				xfree(query);
 				goto update_it;
-			} else if (!strcmp(cluster_nodes, row[1])) {
+			} else if (!xstrcmp(cluster_nodes, row[1])) {
 				if (debug_flags & DEBUG_FLAG_DB_EVENT)
 					DB_DEBUG(mysql_conn->conn,
 						 "we have the same nodes "
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_convert.c b/src/plugins/accounting_storage/mysql/as_mysql_convert.c
index 2d64476f7..c4612d28e 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_convert.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_convert.c
@@ -68,7 +68,7 @@ static int _rename_usage_columns(mysql_conn_t *mysql_conn, char *table)
 		else
 			xstrcat(query, ", ");
 
-		if (!strcmp("id", new_char))
+		if (!xstrcmp("id", new_char))
 			xstrfmtcat(query, "change %s %s int unsigned not null",
 				   row[0], new_char);
 		else
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.c b/src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.c
new file mode 100644
index 000000000..b07dfc56f
--- /dev/null
+++ b/src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.c
@@ -0,0 +1,143 @@
+/*****************************************************************************\
+ *  as_mysql_fix_lost_jobs.c - functions dealing with lost jobs.
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *  Written by Nathan Yee <nyee32@schedmd.com>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#include "as_mysql_fix_lost_jobs.h"
+#include "src/common/list.h"
+
+static int _job_sort_by_start_time(void *void1, void * void2)
+{
+	time_t start1 = (*(slurmdb_job_rec_t **)void1)->start;
+	time_t start2 = (*(slurmdb_job_rec_t **)void2)->start;
+
+	if (start1 < start2)
+		return -1;
+	else if (start1 > start2)
+		return 1;
+	else
+		return 0;
+}
+
+static int _first_job_roll_up(mysql_conn_t *mysql_conn, time_t first_start)
+{
+	int rc = SLURM_SUCCESS;
+	char *query;
+	struct tm start_tm;
+	time_t month_start;
+
+	/* set up the month period */
+	if (!slurm_localtime_r(&first_start, &start_tm)) {
+		error("mktime for start failed for rollup\n");
+		return SLURM_ERROR;
+	}
+
+	// Go to the last day of the previous month for rollup start
+	start_tm.tm_sec = 0;
+	start_tm.tm_min = 0;
+	start_tm.tm_hour = 0;
+	start_tm.tm_mday = 0;
+	start_tm.tm_isdst = -1;
+	month_start = slurm_mktime(&start_tm);
+
+	query = xstrdup_printf("UPDATE \"%s_%s\" SET hourly_rollup = %ld, "
+			       "daily_rollup = %ld, monthly_rollup = %ld",
+			       mysql_conn->cluster_name, last_ran_table,
+			       month_start, month_start, month_start);
+
+	if (debug_flags & DEBUG_FLAG_DB_QUERY)
+		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
+	rc = mysql_db_query(mysql_conn, query);
+	if (rc != SLURM_SUCCESS)
+		error("%s Failed to rollup at the end of previous month",
+		      __func__);
+
+	xfree(query);
+	return rc;
+}
+
+extern int as_mysql_fix_lost_jobs(mysql_conn_t *mysql_conn, uint32_t uid,
+				  List lost_jobs)
+{
+	char *query = NULL, *job_ids = NULL;
+	slurmdb_job_rec_t *job = NULL;
+	ListIterator iter = NULL;
+	int rc = SLURM_SUCCESS;
+	slurmdb_job_rec_t *first_job;
+
+	list_sort(lost_jobs, _job_sort_by_start_time);
+	first_job = list_peek(lost_jobs);
+
+	if (check_connection(mysql_conn) != SLURM_SUCCESS)
+		return ESLURM_DB_CONNECTION;
+
+	if (!is_user_min_admin_level(mysql_conn, uid, SLURMDB_ADMIN_OPERATOR)) {
+		slurmdb_user_rec_t user;
+
+		memset(&user, 0, sizeof(slurmdb_user_rec_t));
+		user.uid = uid;
+
+		if (!is_user_any_coord(mysql_conn, &user)) {
+			error("Only admins/operators/coordinators "
+			      "can fix lost jobs");
+			return ESLURM_ACCESS_DENIED;
+		}
+	}
+
+	iter = list_iterator_create(lost_jobs);
+	while ((job = list_next(iter))) {
+		xstrfmtcat(job_ids, "%s%d", ((job_ids) ? "," : ""), job->jobid);
+	}
+
+	query = xstrdup_printf("UPDATE \"%s_%s\" SET time_end=time_start, "
+			       "state=%d WHERE id_job IN (%s);",
+			       mysql_conn->cluster_name, job_table,
+			       JOB_COMPLETE, job_ids);
+
+	if (debug_flags & DEBUG_FLAG_DB_QUERY)
+		DB_DEBUG(mysql_conn->conn, "query\n%s", query);
+	mysql_db_query(mysql_conn, query);
+	xfree(query);
+	xfree(job_ids);
+
+	/* Set rollup to the the last day of the previous month of the first
+	 * lost job */
+	rc = _first_job_roll_up(mysql_conn, first_job->start);
+	if (rc != SLURM_SUCCESS) {
+		error("Failed to fix lost jobs");
+		return SLURM_ERROR;
+	}
+
+	return rc;
+}
diff --git a/src/slurmdbd/agent.h b/src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.h
similarity index 82%
rename from src/slurmdbd/agent.h
rename to src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.h
index 7a60d7310..fba0103a3 100644
--- a/src/slurmdbd/agent.h
+++ b/src/plugins/accounting_storage/mysql/as_mysql_fix_lost_jobs.h
@@ -1,10 +1,8 @@
 /*****************************************************************************\
- *  agent.h - data structures and function definitions for queued requests
+ *  as_mysql_fix_lost_jobs.h - functions dealing with lost jobs.
  *****************************************************************************
- *  Copyright (C) 2008 Lawrence Livermore National Security.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Morris Jette <jette@llnl.gov>
- *  CODE-OCEC-09-009. All rights reserved.
+ *  Copyright (C) 2016 SchedMD LLC.
+ *  Written by Nathan Yee <nyee32@schedmd.com>
  *
  *  This file is part of SLURM, a resource management program.
  *  For details, see <http://slurm.schedmd.com/>.
@@ -36,8 +34,13 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
-#ifndef _AGENT_H
-#define _AGENT_H
+#ifndef _HAVE_MYSQL_FIX_LOST_JOBS_H
+#define _HAVE_MYSQL_FIX_LOST_JOBS_H
 
+#include "accounting_storage_mysql.h"
+#include "src/common/slurm_time.h"
 
-#endif /* !_AGENT_H */
+extern int as_mysql_fix_lost_jobs(mysql_conn_t *mysql_conn, uint32_t uid,
+				  List lost_jobs);
+
+#endif
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_job.c b/src/plugins/accounting_storage/mysql/as_mysql_job.c
index 04a704253..dd959dedf 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_job.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_job.c
@@ -1166,7 +1166,7 @@ extern int as_mysql_step_complete(mysql_conn_t *mysql_conn,
 	}
 
 	exit_code = step_ptr->exit_code;
-	comp_status = step_ptr->state;
+	comp_status = step_ptr->state & JOB_STATE_BASE;
 	if (comp_status < JOB_COMPLETE) {
 		if (WIFSIGNALED(exit_code)) {
 			comp_status = JOB_CANCELLED;
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
index 617c7f41d..5d4c328b2 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_jobacct_process.c
@@ -330,6 +330,7 @@ static void _state_time_string(char **extra, char *cluster_name, uint32_t state,
 	case JOB_TIMEOUT:
 	case JOB_NODE_FAIL:
 	case JOB_PREEMPTED:
+	case JOB_DEADLINE:
 	default:
 		xstrfmtcat(*extra, "(t1.state='%u' && (t1.time_end && ", state);
 		if (start) {
@@ -701,7 +702,7 @@ static int _cluster_get_jobs(mysql_conn_t *mysql_conn,
 		if (row[JOB_REQ_NODELIST])
 			job->nodes = xstrdup(row[JOB_REQ_NODELIST]);
 
-		if (!job->nodes || !strcmp(job->nodes, "(null)")) {
+		if (!job->nodes || !xstrcmp(job->nodes, "(null)")) {
 			xfree(job->nodes);
 			job->nodes = xstrdup("(unknown)");
 		}
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_qos.c b/src/plugins/accounting_storage/mysql/as_mysql_qos.c
index 28867ff5c..25b4f2e3e 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_qos.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_qos.c
@@ -47,7 +47,9 @@ static char *mqos_req_inx[] = {
 	"grp_tres_run_mins",
 	"grp_tres",
 	"max_tres_mins_pj",
+	"max_tres_run_mins_pa",
 	"max_tres_run_mins_pu",
+	"max_tres_pa",
 	"max_tres_pj",
 	"max_tres_pn",
 	"max_tres_pu",
@@ -62,7 +64,9 @@ enum {
 	MQOS_GTRM,
 	MQOS_GT,
 	MQOS_MTMPJ,
+	MQOS_MTRMA,
 	MQOS_MTRM,
+	MQOS_MTPA,
 	MQOS_MTPJ,
 	MQOS_MTPN,
 	MQOS_MTPU,
@@ -136,8 +140,12 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 			qos->grp_submit_jobs = INFINITE;
 		if (qos->grp_wall == NO_VAL)
 			qos->grp_wall = INFINITE;
+		if (qos->max_jobs_pa == NO_VAL)
+			qos->max_jobs_pa = INFINITE;
 		if (qos->max_jobs_pu == NO_VAL)
 			qos->max_jobs_pu = INFINITE;
+		if (qos->max_submit_jobs_pa == NO_VAL)
+			qos->max_submit_jobs_pa = INFINITE;
 		if (qos->max_submit_jobs_pu == NO_VAL)
 			qos->max_submit_jobs_pu = INFINITE;
 		if (qos->max_wall_pj == NO_VAL)
@@ -225,6 +233,17 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 		xstrfmtcat(*extra, ", grp_wall=%u", qos->grp_wall);
 	}
 
+	if (qos->max_jobs_pa == INFINITE) {
+		xstrcat(*cols, ", max_jobs_pa");
+		xstrcat(*vals, ", NULL");
+		xstrcat(*extra, ", max_jobs_pa=NULL");
+	} else if ((qos->max_jobs_pa != NO_VAL)
+		   && ((int32_t)qos->max_jobs_pa >= 0)) {
+		xstrcat(*cols, ", max_jobs_pa");
+		xstrfmtcat(*vals, ", %u", qos->max_jobs_pa);
+		xstrfmtcat(*extra, ", max_jobs_pa=%u", qos->max_jobs_pa);
+	}
+
 	if (qos->max_jobs_pu == INFINITE) {
 		xstrcat(*cols, ", max_jobs_per_user");
 		xstrcat(*vals, ", NULL");
@@ -236,6 +255,18 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 		xstrfmtcat(*extra, ", max_jobs_per_user=%u", qos->max_jobs_pu);
 	}
 
+	if (qos->max_submit_jobs_pa == INFINITE) {
+		xstrcat(*cols, ", max_submit_jobs_pa");
+		xstrcat(*vals, ", NULL");
+		xstrcat(*extra, ", max_submit_jobs_pa=NULL");
+	} else if ((qos->max_submit_jobs_pa != NO_VAL)
+		   && ((int32_t)qos->max_submit_jobs_pa >= 0)) {
+		xstrcat(*cols, ", max_submit_jobs_pa");
+		xstrfmtcat(*vals, ", %u", qos->max_submit_jobs_pa);
+		xstrfmtcat(*extra, ", max_submit_jobs_pa=%u",
+			   qos->max_submit_jobs_pa);
+	}
+
 	if (qos->max_submit_jobs_pu == INFINITE) {
 		xstrcat(*cols, ", max_submit_jobs_per_user");
 		xstrcat(*vals, ", NULL");
@@ -405,6 +436,18 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 			   qos->grp_tres_run_mins);
 	}
 
+	if (qos->max_tres_pa) {
+		if (!for_add) {
+			xstrcat(*extra, "");
+			goto end_modify;
+		}
+		xstrcat(*cols, ", max_tres_pa");
+		slurmdb_combine_tres_strings(
+			&qos->max_tres_pa, NULL, tres_str_flags);
+		xstrfmtcat(*vals, ", '%s'", qos->max_tres_pa);
+		xstrfmtcat(*extra, ", max_tres_pa='%s'", qos->max_tres_pa);
+	}
+
 	if (qos->max_tres_pj) {
 		if (!for_add) {
 			xstrcat(*extra, "");
@@ -454,6 +497,19 @@ static int _setup_qos_limits(slurmdb_qos_rec_t *qos,
 			   qos->max_tres_mins_pj);
 	}
 
+	if (qos->max_tres_run_mins_pa) {
+		if (!for_add) {
+			xstrcat(*extra, "");
+			goto end_modify;
+		}
+		xstrcat(*cols, ", max_tres_run_mins_pa");
+		slurmdb_combine_tres_strings(
+			&qos->max_tres_run_mins_pa, NULL, tres_str_flags);
+		xstrfmtcat(*vals, ", '%s'", qos->max_tres_run_mins_pa);
+		xstrfmtcat(*extra, ", max_tres_run_mins_pa='%s'",
+			   qos->max_tres_run_mins_pa);
+	}
+
 	if (qos->max_tres_run_mins_pu) {
 		if (!for_add) {
 			xstrcat(*extra, "");
@@ -761,6 +817,9 @@ extern List as_mysql_modify_qos(mysql_conn_t *mysql_conn, uint32_t uid,
 		qos_rec->grp_submit_jobs = qos->grp_submit_jobs;
 		qos_rec->grp_wall = qos->grp_wall;
 
+		mod_tres_str(&qos_rec->max_tres_pa,
+			     qos->max_tres_pa, row[MQOS_MTPA],
+			     NULL, "max_tres_pa", &vals, qos_rec->id, 0);
 		mod_tres_str(&qos_rec->max_tres_pj,
 			     qos->max_tres_pj, row[MQOS_MTPJ],
 			     NULL, "max_tres_pj", &vals, qos_rec->id, 0);
@@ -773,12 +832,18 @@ extern List as_mysql_modify_qos(mysql_conn_t *mysql_conn, uint32_t uid,
 		mod_tres_str(&qos_rec->max_tres_mins_pj,
 			     qos->max_tres_mins_pj, row[MQOS_MTMPJ],
 			     NULL, "max_tres_mins_pj", &vals, qos_rec->id, 0);
+		mod_tres_str(&qos_rec->max_tres_run_mins_pa,
+			     qos->max_tres_run_mins_pa, row[MQOS_MTRM],
+			     NULL, "max_tres_run_mins_pa", &vals,
+			     qos_rec->id, 0);
 		mod_tres_str(&qos_rec->max_tres_run_mins_pu,
 			     qos->max_tres_run_mins_pu, row[MQOS_MTRM],
 			     NULL, "max_tres_run_mins_pu", &vals,
 			     qos_rec->id, 0);
 
+		qos_rec->max_jobs_pa  = qos->max_jobs_pa;
 		qos_rec->max_jobs_pu  = qos->max_jobs_pu;
+		qos_rec->max_submit_jobs_pa  = qos->max_submit_jobs_pa;
 		qos_rec->max_submit_jobs_pu  = qos->max_submit_jobs_pu;
 		qos_rec->max_wall_pj = qos->max_wall_pj;
 
@@ -1076,11 +1141,15 @@ extern List as_mysql_get_qos(mysql_conn_t *mysql_conn, uid_t uid,
 		"grp_submit_jobs",
 		"grp_wall",
 		"max_tres_mins_pj",
+		"max_tres_run_mins_pa",
 		"max_tres_run_mins_pu",
+		"max_tres_pa",
 		"max_tres_pj",
 		"max_tres_pn",
 		"max_tres_pu",
+		"max_jobs_pa",
 		"max_jobs_per_user",
+		"max_submit_jobs_pa",
 		"max_submit_jobs_per_user",
 		"max_wall_duration_per_job",
 		"substr(preempt, 1, length(preempt) - 1)",
@@ -1103,11 +1172,15 @@ extern List as_mysql_get_qos(mysql_conn_t *mysql_conn, uid_t uid,
 		QOS_REQ_GSJ,
 		QOS_REQ_GW,
 		QOS_REQ_MTMPJ,
+		QOS_REQ_MTRMA,
 		QOS_REQ_MTRM,
+		QOS_REQ_MTPA,
 		QOS_REQ_MTPJ,
 		QOS_REQ_MTPN,
 		QOS_REQ_MTPU,
+		QOS_REQ_MJPA,
 		QOS_REQ_MJPU,
+		QOS_REQ_MSJPA,
 		QOS_REQ_MSJPU,
 		QOS_REQ_MWPJ,
 		QOS_REQ_PREE,
@@ -1242,16 +1315,31 @@ empty:
 		else
 			qos->grp_wall = INFINITE;
 
+		if (row[QOS_REQ_MJPA])
+			qos->max_jobs_pa = slurm_atoul(row[QOS_REQ_MJPA]);
+		else
+			qos->max_jobs_pa = INFINITE;
+
 		if (row[QOS_REQ_MJPU])
 			qos->max_jobs_pu = slurm_atoul(row[QOS_REQ_MJPU]);
 		else
 			qos->max_jobs_pu = INFINITE;
+
+		if (row[QOS_REQ_MSJPA])
+			qos->max_submit_jobs_pa =
+				slurm_atoul(row[QOS_REQ_MSJPA]);
+		else
+			qos->max_submit_jobs_pa = INFINITE;
+
 		if (row[QOS_REQ_MSJPU])
 			qos->max_submit_jobs_pu =
 				slurm_atoul(row[QOS_REQ_MSJPU]);
 		else
 			qos->max_submit_jobs_pu = INFINITE;
 
+		if (row[QOS_REQ_MTPA][0])
+			qos->max_tres_pa = xstrdup(row[QOS_REQ_MTPA]);
+
 		if (row[QOS_REQ_MTPJ][0])
 			qos->max_tres_pj = xstrdup(row[QOS_REQ_MTPJ]);
 
@@ -1264,6 +1352,9 @@ empty:
 		if (row[QOS_REQ_MTMPJ][0])
 			qos->max_tres_mins_pj = xstrdup(row[QOS_REQ_MTMPJ]);
 
+		if (row[QOS_REQ_MTRMA][0])
+			qos->max_tres_run_mins_pa = xstrdup(row[QOS_REQ_MTRMA]);
+
 		if (row[QOS_REQ_MTRM][0])
 			qos->max_tres_run_mins_pu = xstrdup(row[QOS_REQ_MTRM]);
 
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_resource.c b/src/plugins/accounting_storage/mysql/as_mysql_resource.c
index 82444997e..5e2789f26 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_resource.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_resource.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  as_mysql_resource.c - functions dealing with resources.
  *****************************************************************************
- *
  *  Copyright (C) 2013 Bull S. A. S.
  *		Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois.
  *
@@ -1025,7 +1024,6 @@ extern List as_mysql_modify_res(mysql_conn_t *mysql_conn, uint32_t uid,
 	char *clus_extra = NULL;
 	MYSQL_RES *result = NULL;
 	MYSQL_ROW row;
-	int rc = SLURM_SUCCESS;
 	int query_clusters = 0;
 	bool send_update = 0;
 	bool res_added = 0;
@@ -1256,11 +1254,5 @@ extern List as_mysql_modify_res(mysql_conn_t *mysql_conn, uint32_t uid,
 	xfree(name_char);
 	xfree(user_name);
 
-	if (rc != SLURM_SUCCESS) {
-		error("Couldn't modify Resource");
-		FREE_NULL_LIST(ret_list);
-		errno = SLURM_ERROR;
-	}
-
 	return ret_list;
 }
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_rollup.c b/src/plugins/accounting_storage/mysql/as_mysql_rollup.c
index 6cd08bbd9..179b23169 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_rollup.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_rollup.c
@@ -310,8 +310,10 @@ static void _add_tres_2_list(List tres_list, char *tres_str, int seconds)
 /* This will destroy the *loc_tres given after it is transfered */
 static void _transfer_loc_tres(List *loc_tres, local_id_usage_t *usage)
 {
-	if (!usage)
+	if (!usage) {
+		FREE_NULL_LIST(*loc_tres);
 		return;
+	}
 
 	if (!usage->loc_tres) {
 		usage->loc_tres = *loc_tres;
@@ -1600,9 +1602,18 @@ end_it:
 
 	/* go check to see if we archive and purge */
 
-	if (rc == SLURM_SUCCESS)
-		rc = _process_purge(mysql_conn, cluster_name, archive_data,
-				    SLURMDB_PURGE_HOURS);
+	if (rc == SLURM_SUCCESS) {
+		if (mysql_db_commit(mysql_conn)) {
+			char start[25], end[25];
+			error("Couldn't commit cluster (%s) "
+			      "hour rollup for %s - %s",
+			      cluster_name, slurm_ctime2_r(&curr_start, start),
+			      slurm_ctime2_r(&curr_end, end));
+			rc = SLURM_ERROR;
+		} else
+			rc = _process_purge(mysql_conn, cluster_name,
+					    archive_data, SLURMDB_PURGE_HOURS);
+	}
 
 	return rc;
 }
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_tres.c b/src/plugins/accounting_storage/mysql/as_mysql_tres.c
index 52e43195d..dd16d0aea 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_tres.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_tres.c
@@ -69,9 +69,9 @@ extern int as_mysql_add_tres(mysql_conn_t *mysql_conn,
 			error("We need a tres type.");
 			rc = SLURM_ERROR;
 			continue;
-		} else if ((!strcasecmp(object->type, "gres") ||
-			    !strcasecmp(object->type, "bb") ||
-			    !strcasecmp(object->type, "license"))) {
+		} else if ((!xstrcasecmp(object->type, "gres") ||
+			    !xstrcasecmp(object->type, "bb") ||
+			    !xstrcasecmp(object->type, "license"))) {
 			if (!object->name) {
 				error("%s type tres "
 				      "need to have a name, "
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_usage.c b/src/plugins/accounting_storage/mysql/as_mysql_usage.c
index 1a03ff510..0bd4edde6 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_usage.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_usage.c
@@ -831,7 +831,7 @@ extern int as_mysql_get_usage(mysql_conn_t *mysql_conn, uid_t uid,
 			user.uid = uid;
 			is_coord = is_user_any_coord(mysql_conn, &user);
 
-			if (username && !strcmp(username, user.name))
+			if (username && !xstrcmp(username, user.name))
 				goto is_user;
 
 			if (type != DBD_GET_ASSOC_USAGE)
@@ -853,8 +853,8 @@ extern int as_mysql_get_usage(mysql_conn_t *mysql_conn, uid_t uid,
 			*/
 			itr = list_iterator_create(user.coord_accts);
 			while ((coord = list_next(itr)))
-				if (!strcasecmp(coord->name,
-						slurmdb_assoc->acct))
+				if (!xstrcasecmp(coord->name,
+						 slurmdb_assoc->acct))
 					break;
 			list_iterator_destroy(itr);
 
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_user.c b/src/plugins/accounting_storage/mysql/as_mysql_user.c
index d00fbf44d..3bc8371d4 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_user.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_user.c
@@ -244,7 +244,7 @@ static int _get_user_coords(mysql_conn_t *mysql_conn, slurmdb_user_rec_t *user)
 		while ((row = mysql_fetch_row(result))) {
 			list_iterator_reset(itr);
 			while ((coord = list_next(itr))) {
-				if (!strcmp(coord->name, row[0]))
+				if (!xstrcmp(coord->name, row[0]))
 					break;
 			}
 
@@ -380,7 +380,7 @@ extern int as_mysql_add_users(mysql_conn_t *mysql_conn, uint32_t uid,
 				   since there could be multiple
 				   clusters here.
 				*/
-				if (!strcmp(assoc->acct, object->default_acct))
+				if (!xstrcmp(assoc->acct, object->default_acct))
 					assoc->is_def = 1;
 			}
 			list_iterator_destroy(assoc_itr);
@@ -398,8 +398,8 @@ extern int as_mysql_add_users(mysql_conn_t *mysql_conn, uint32_t uid,
 					   since there could be multiple
 					   clusters here.
 					*/
-					if (!strcmp(wckey->name,
-						    object->default_wckey))
+					if (!xstrcmp(wckey->name,
+						     object->default_wckey))
 						wckey->is_def = 1;
 				}
 				list_iterator_destroy(wckey_itr);
@@ -479,7 +479,7 @@ extern int as_mysql_add_coord(mysql_conn_t *mysql_conn, uint32_t uid,
 		itr2 = list_iterator_create(user.coord_accts);
 		while ((acct = list_next(itr))) {
 			while ((coord = list_next(itr2))) {
-				if (!strcasecmp(coord->name, acct))
+				if (!xstrcasecmp(coord->name, acct))
 					break;
 			}
 			if (!coord)
@@ -1080,7 +1080,7 @@ extern List as_mysql_remove_coord(mysql_conn_t *mysql_conn, uint32_t uid,
 			}
 			itr = list_iterator_create(user.coord_accts);
 			while ((coord = list_next(itr))) {
-				if (!strcasecmp(coord->name, row[1]))
+				if (!xstrcasecmp(coord->name, row[1]))
 					break;
 			}
 			list_iterator_destroy(itr);
@@ -1097,7 +1097,7 @@ extern List as_mysql_remove_coord(mysql_conn_t *mysql_conn, uint32_t uid,
 				return NULL;
 			}
 		}
-		if (!last_user || strcasecmp(last_user, row[0])) {
+		if (!last_user || xstrcasecmp(last_user, row[0])) {
 			list_append(user_list, xstrdup(row[0]));
 			last_user = row[0];
 		}
@@ -1371,7 +1371,7 @@ get_wckeys:
 		wckey_itr = list_iterator_create(wckey_list);
 		while ((user = list_next(itr))) {
 			while ((wckey = list_next(wckey_itr))) {
-				if (strcmp(wckey->user, user->name))
+				if (xstrcmp(wckey->user, user->name))
 					continue;
 
 				/* Set up the default.  This is needed
diff --git a/src/plugins/accounting_storage/none/Makefile.in b/src/plugins/accounting_storage/none/Makefile.in
index 294c048db..67b960add 100644
--- a/src/plugins/accounting_storage/none/Makefile.in
+++ b/src/plugins/accounting_storage/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/accounting_storage/none/accounting_storage_none.c b/src/plugins/accounting_storage/none/accounting_storage_none.c
index ca11ae075..2bd1b7b8c 100644
--- a/src/plugins/accounting_storage/none/accounting_storage_none.c
+++ b/src/plugins/accounting_storage/none/accounting_storage_none.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  accounting_storage_none.c - account interface to none.
- *
- *  $Id: accounting_storage_none.c 13061 2008-01-22 21:23:56Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008 Lawrence Livermore National Security.
@@ -291,7 +289,7 @@ extern List acct_storage_p_get_accts(void *db_conn, uid_t uid,
 }
 
 extern List acct_storage_p_get_clusters(void *db_conn, uid_t uid,
-					slurmdb_account_cond_t *cluster_q)
+					slurmdb_cluster_cond_t *cluster_cond)
 {
 	return NULL;
 }
@@ -373,6 +371,12 @@ extern int acct_storage_p_roll_usage(void *db_conn,
 	return rc;
 }
 
+extern int acct_storage_p_fix_lost_jobs(void *db_conn, uint32_t uid,
+					List jobs)
+{
+	return SLURM_SUCCESS;
+}
+
 extern int clusteracct_storage_p_node_down(void *db_conn,
 					   struct node_record *node_ptr,
 					   time_t event_time, char *reason,
@@ -503,3 +507,9 @@ extern int acct_storage_p_reconfig(void *db_conn)
 {
 	return SLURM_SUCCESS;
 }
+
+extern int acct_storage_p_reset_lft_rgt(void *db_conn, uid_t uid,
+					List cluster_list)
+{
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/accounting_storage/slurmdbd/Makefile.in b/src/plugins/accounting_storage/slurmdbd/Makefile.in
index 51f147d43..c9ce90111 100644
--- a/src/plugins/accounting_storage/slurmdbd/Makefile.in
+++ b/src/plugins/accounting_storage/slurmdbd/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/accounting_storage/slurmdbd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
index 5329e08c3..fdad80448 100644
--- a/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
+++ b/src/plugins/accounting_storage/slurmdbd/accounting_storage_slurmdbd.c
@@ -252,9 +252,8 @@ static void *_set_db_inx_thread(void *no_data)
 	/* DEF_TIMERS; */
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_dbinx", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_dbinx");
+	if (prctl(PR_SET_NAME, "dbinx", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "dbinx");
 	}
 #endif
 	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
@@ -1657,7 +1656,7 @@ extern List acct_storage_p_get_accts(void *db_conn, uid_t uid,
 }
 
 extern List acct_storage_p_get_clusters(void *db_conn, uid_t uid,
-					slurmdb_account_cond_t *cluster_cond)
+					slurmdb_cluster_cond_t *cluster_cond)
 {
 	slurmdbd_msg_t req, resp;
 	dbd_cond_msg_t get_msg;
@@ -2245,6 +2244,28 @@ extern int acct_storage_p_roll_usage(void *db_conn,
 	return rc;
 }
 
+extern int acct_storage_p_fix_lost_jobs(void *db_conn, uint32_t uid,
+					List jobs)
+{
+	slurmdbd_msg_t req;
+	dbd_list_msg_t get_msg;
+	int rc, resp_code = SLURM_SUCCESS;
+
+	memset(&get_msg, 0, sizeof(dbd_list_msg_t));
+	get_msg.my_list = jobs;
+
+	req.msg_type = DBD_FIX_LOST_JOB;
+	req.data = &get_msg;
+
+	rc = slurm_send_slurmdbd_recv_rc_msg(SLURM_PROTOCOL_VERSION,
+					     &req, &resp_code);
+
+	if (resp_code != SLURM_SUCCESS)
+		rc = resp_code;
+
+	return rc;
+}
+
 extern int clusteracct_storage_p_node_down(void *db_conn,
 					   struct node_record *node_ptr,
 					   time_t event_time, char *reason,
@@ -2863,3 +2884,9 @@ extern int acct_storage_p_reconfig(void *db_conn, bool dbd)
 
 	return rc;
 }
+
+extern int acct_storage_p_reset_lft_rgt(void *db_conn, uid_t uid,
+					List cluster_list)
+{
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/acct_gather_energy/Makefile.in b/src/plugins/acct_gather_energy/Makefile.in
index 1cff09149..9808db77d 100644
--- a/src/plugins/acct_gather_energy/Makefile.in
+++ b/src/plugins/acct_gather_energy/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/cray/Makefile.in b/src/plugins/acct_gather_energy/cray/Makefile.in
index faade3bae..2186fb7cf 100644
--- a/src/plugins/acct_gather_energy/cray/Makefile.in
+++ b/src/plugins/acct_gather_energy/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/ibmaem/Makefile.in b/src/plugins/acct_gather_energy/ibmaem/Makefile.in
index 2c669722e..475b0c5fd 100644
--- a/src/plugins/acct_gather_energy/ibmaem/Makefile.in
+++ b/src/plugins/acct_gather_energy/ibmaem/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy/ibmaem
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/ipmi/Makefile.in b/src/plugins/acct_gather_energy/ipmi/Makefile.in
index f9d74fe65..38e058797 100644
--- a/src/plugins/acct_gather_energy/ipmi/Makefile.in
+++ b/src/plugins/acct_gather_energy/ipmi/Makefile.in
@@ -96,7 +96,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy/ipmi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -267,8 +268,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -368,6 +367,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -406,6 +409,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -449,6 +455,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -499,6 +508,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c b/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c
index 39c2e7a6e..9865738c5 100644
--- a/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c
+++ b/src/plugins/acct_gather_energy/ipmi/acct_gather_energy_ipmi.c
@@ -1314,13 +1314,13 @@ extern void acct_gather_energy_p_conf_set(s_p_hashtbl_t *tbl)
 			       "EnergyIPMITimeout", tbl);
 
 		if (s_p_get_string(&tmp_char, "EnergyIPMIVariable", tbl)) {
-			if (!strcmp(tmp_char, "Temp"))
+			if (!xstrcmp(tmp_char, "Temp"))
 				slurm_ipmi_conf.variable =
 					IPMI_MONITORING_SENSOR_UNITS_CELSIUS;
-			else if (!strcmp(tmp_char, "Voltage"))
+			else if (!xstrcmp(tmp_char, "Voltage"))
 				slurm_ipmi_conf.variable =
 					IPMI_MONITORING_SENSOR_UNITS_VOLTS;
-			else if (!strcmp(tmp_char, "Fan"))
+			else if (!xstrcmp(tmp_char, "Fan"))
 				slurm_ipmi_conf.variable =
 					IPMI_MONITORING_SENSOR_UNITS_RPM;
 			xfree(tmp_char);
diff --git a/src/plugins/acct_gather_energy/none/Makefile.in b/src/plugins/acct_gather_energy/none/Makefile.in
index 360d96c09..41ac4df34 100644
--- a/src/plugins/acct_gather_energy/none/Makefile.in
+++ b/src/plugins/acct_gather_energy/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/rapl/Makefile.in b/src/plugins/acct_gather_energy/rapl/Makefile.in
index c2c84cb69..935919191 100644
--- a/src/plugins/acct_gather_energy/rapl/Makefile.in
+++ b/src/plugins/acct_gather_energy/rapl/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_energy/rapl
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
index 8a0b6bf00..a3e839ee7 100644
--- a/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
+++ b/src/plugins/acct_gather_energy/rapl/acct_gather_energy_rapl.c
@@ -241,11 +241,11 @@ static void _hardware(void)
 	if ((fd = fopen("/proc/cpuinfo", "r")) == 0)
 		fatal("RAPL: error on attempt to open /proc/cpuinfo");
 	while (fgets(buf, 1024, fd)) {
-		if (strncmp(buf, "processor", sizeof("processor") - 1) == 0) {
+		if (xstrncmp(buf, "processor", sizeof("processor") - 1) == 0) {
 			sscanf(buf, "processor\t: %d", &cpu);
 			continue;
 		}
-		if (!strncmp(buf, "physical id", sizeof("physical id") - 1)) {
+		if (!xstrncmp(buf, "physical id", sizeof("physical id") - 1)) {
 			sscanf(buf, "physical id\t: %d", &pkg);
 
 			if (pkg > MAX_PKGS)
diff --git a/src/plugins/acct_gather_filesystem/Makefile.in b/src/plugins/acct_gather_filesystem/Makefile.in
index 88b7558bc..3384de4b2 100644
--- a/src/plugins/acct_gather_filesystem/Makefile.in
+++ b/src/plugins/acct_gather_filesystem/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_filesystem
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_filesystem/lustre/Makefile.in b/src/plugins/acct_gather_filesystem/lustre/Makefile.in
index f37d27353..503b3b1d3 100644
--- a/src/plugins/acct_gather_filesystem/lustre/Makefile.in
+++ b/src/plugins/acct_gather_filesystem/lustre/Makefile.in
@@ -96,7 +96,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_filesystem/lustre
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +255,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +354,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +396,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +442,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +495,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c b/src/plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c
index 10b4953cb..9a3190a57 100644
--- a/src/plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c
+++ b/src/plugins/acct_gather_filesystem/lustre/acct_gather_filesystem_lustre.c
@@ -184,8 +184,8 @@ static int _read_lustre_counters(void)
 		bool bread;
 		bool bwrote;
 
-		if (strcmp(entry->d_name, ".") == 0
-		    || strcmp(entry->d_name, "..") == 0)
+		if (xstrcmp(entry->d_name, ".") == 0
+		    || xstrcmp(entry->d_name, "..") == 0)
 			continue;
 
 		snprintf(path_stats, PATH_MAX - 1, "%s/%s/stats", lustre_dir,
@@ -310,6 +310,7 @@ static int _update_node_filesystem(void)
 		if (dataset_id == SLURM_ERROR) {
 			error("FileSystem: Failed to create the dataset "
 			      "for Lustre");
+			slurm_mutex_unlock(&lustre_lock);
 			return SLURM_ERROR;
 		}
 
diff --git a/src/plugins/acct_gather_filesystem/none/Makefile.in b/src/plugins/acct_gather_filesystem/none/Makefile.in
index 6829b1c36..b37bec8e1 100644
--- a/src/plugins/acct_gather_filesystem/none/Makefile.in
+++ b/src/plugins/acct_gather_filesystem/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_filesystem/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_infiniband/Makefile.in b/src/plugins/acct_gather_infiniband/Makefile.in
index 4d076b209..5abceacfd 100644
--- a/src/plugins/acct_gather_infiniband/Makefile.in
+++ b/src/plugins/acct_gather_infiniband/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_infiniband
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_infiniband/none/Makefile.in b/src/plugins/acct_gather_infiniband/none/Makefile.in
index ead5efe14..cfbf44c9f 100644
--- a/src/plugins/acct_gather_infiniband/none/Makefile.in
+++ b/src/plugins/acct_gather_infiniband/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_infiniband/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_infiniband/ofed/Makefile.in b/src/plugins/acct_gather_infiniband/ofed/Makefile.in
index 163d6d738..951ca1c1f 100644
--- a/src/plugins/acct_gather_infiniband/ofed/Makefile.in
+++ b/src/plugins/acct_gather_infiniband/ofed/Makefile.in
@@ -96,7 +96,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_infiniband/ofed
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -263,8 +264,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -364,6 +363,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -402,6 +405,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -445,6 +451,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -495,6 +504,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_profile/Makefile.in b/src/plugins/acct_gather_profile/Makefile.in
index ce7265bef..fedf7339b 100644
--- a/src/plugins/acct_gather_profile/Makefile.in
+++ b/src/plugins/acct_gather_profile/Makefile.in
@@ -93,7 +93,8 @@ target_triplet = @target@
 @BUILD_HDF5_TRUE@am__append_1 = hdf5
 subdir = src/plugins/acct_gather_profile
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -229,8 +230,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +329,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +371,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +417,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +470,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_profile/hdf5/Makefile.in b/src/plugins/acct_gather_profile/hdf5/Makefile.in
index dcfef935c..f7edc79a4 100644
--- a/src/plugins/acct_gather_profile/hdf5/Makefile.in
+++ b/src/plugins/acct_gather_profile/hdf5/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_profile/hdf5
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -318,8 +319,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -419,6 +418,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -457,6 +460,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -500,6 +506,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -550,6 +559,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
index 77aa0bd39..f38e51d54 100644
--- a/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
+++ b/src/plugins/acct_gather_profile/hdf5/acct_gather_profile_hdf5.c
@@ -142,7 +142,6 @@ static void _reset_slurm_profile_conf(void)
 static uint32_t _determine_profile(void)
 {
 	uint32_t profile;
-
 	xassert(g_job);
 
 	if (g_profile_running != ACCT_GATHER_PROFILE_NOT_SET)
@@ -308,11 +307,6 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
 
 	g_job = job;
 
-	if (g_job->stepid == NO_VAL) {
-		g_profile_running = ACCT_GATHER_PROFILE_NONE;
-		return rc;
-	}
-
 	xassert(hdf5_conf.dir);
 
 	if (debug_flags & DEBUG_FLAG_PROFILE) {
@@ -328,10 +322,22 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
 
 	_create_directories();
 
-	profile_file_name = xstrdup_printf(
-		"%s/%s/%u_%u_%s.h5",
-		hdf5_conf.dir, g_job->user_name,
-		g_job->jobid, g_job->stepid, g_job->node_name);
+	/* Use a more user friendly string "batch" rather
+	 * then 4294967294.
+	 */
+	if (g_job->stepid == NO_VAL) {
+		profile_file_name = xstrdup_printf("%s/%s/%u_%s_%s.h5",
+						   hdf5_conf.dir,
+						   g_job->user_name,
+						   g_job->jobid,
+						   "batch",
+						   g_job->node_name);
+	} else {
+		profile_file_name = xstrdup_printf(
+			"%s/%s/%u_%u_%s.h5",
+			hdf5_conf.dir, g_job->user_name,
+			g_job->jobid, g_job->stepid, g_job->node_name);
+	}
 
 	if (debug_flags & DEBUG_FLAG_PROFILE) {
 		profile_str = acct_gather_profile_to_string(g_profile_running);
@@ -361,6 +367,7 @@ extern int acct_gather_profile_p_node_step_start(stepd_step_rec_t* job)
 		info("PROFILE: Failed to create Node group");
 		return SLURM_FAILURE;
 	}
+	put_int_attribute(gid_node, ATTR_NODEINX, g_job->nodeid);
 	put_string_attribute(gid_node, ATTR_NODENAME, g_job->node_name);
 	put_int_attribute(gid_node, ATTR_NTASKS, g_job->node_tasks);
 	put_int_attribute(gid_node, ATTR_CPUPERTASK, g_job->cpus_per_task);
@@ -395,9 +402,6 @@ extern int acct_gather_profile_p_node_step_end(void)
 
 	xassert(_run_in_daemon());
 
-	if (g_job->stepid == NO_VAL)
-		return rc;
-
 	xassert(g_profile_running != ACCT_GATHER_PROFILE_NOT_SET);
 
 	// No check for --profile as we always want to close the HDF5 file
@@ -442,9 +446,6 @@ extern int acct_gather_profile_p_task_start(uint32_t taskid)
 	xassert(_run_in_daemon());
 	xassert(g_job);
 
-	if (g_job->stepid == NO_VAL)
-		return rc;
-
 	xassert(g_profile_running != ACCT_GATHER_PROFILE_NOT_SET);
 
 	if (g_profile_running <= ACCT_GATHER_PROFILE_NONE)
@@ -597,8 +598,6 @@ extern int acct_gather_profile_p_add_sample_data(int table_id, void *data,
 	/* ensure that we have to record something */
 	xassert(_run_in_daemon());
 	xassert(g_job);
-	if (g_job->stepid == NO_VAL)
-		return SLURM_SUCCESS;
 	xassert(g_profile_running != ACCT_GATHER_PROFILE_NOT_SET);
 
 	if (g_profile_running <= ACCT_GATHER_PROFILE_NONE)
diff --git a/src/plugins/acct_gather_profile/hdf5/hdf5_api.c b/src/plugins/acct_gather_profile/hdf5/hdf5_api.c
index 42cfceeb5..8b626a5b5 100644
--- a/src/plugins/acct_gather_profile/hdf5/hdf5_api.c
+++ b/src/plugins/acct_gather_profile/hdf5/hdf5_api.c
@@ -75,7 +75,7 @@ extern hid_t get_attribute_handle(hid_t parent, char *name)
 		// Get the name of the attribute.
 		len = H5Aget_name(aid, MAX_ATTR_NAME, buf);
 		if (len < MAX_ATTR_NAME) {
-			if (strcmp(buf, name) == 0) {
+			if (xstrcmp(buf, name) == 0) {
 				return aid;
 			}
 		}
@@ -106,7 +106,7 @@ extern hid_t get_group(hid_t parent, const char *name)
 					 H5_ITER_INC, i, buf, MAX_GROUP_NAME,
 					 H5P_DEFAULT);
 		if ((len > 0) && (len < MAX_GROUP_NAME)) {
-			if (strcmp(buf, name) == 0) {
+			if (xstrcmp(buf, name) == 0) {
 				gid = H5Gopen(parent, name, H5P_DEFAULT);
 				if (gid < 0)
 					error("PROFILE: Failed to open %s",
diff --git a/src/plugins/acct_gather_profile/hdf5/hdf5_api.h b/src/plugins/acct_gather_profile/hdf5/hdf5_api.h
index 0b8936fa4..9f59cfd8e 100644
--- a/src/plugins/acct_gather_profile/hdf5/hdf5_api.h
+++ b/src/plugins/acct_gather_profile/hdf5/hdf5_api.h
@@ -65,6 +65,7 @@
 #define MAX_ATTR_NAME 64
 #define MAX_GROUP_NAME 64
 
+#define ATTR_NODEINX "Node Index"
 #define ATTR_NODENAME "Node Name"
 #define ATTR_NSTEPS "Number of Steps"
 #define ATTR_NNODES "Number of Nodes"
diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/Makefile.in b/src/plugins/acct_gather_profile/hdf5/sh5util/Makefile.in
index b17be1e72..02fb4d3fe 100644
--- a/src/plugins/acct_gather_profile/hdf5/sh5util/Makefile.in
+++ b/src/plugins/acct_gather_profile/hdf5/sh5util/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 @BUILD_HDF5_TRUE@bin_PROGRAMS = sh5util$(EXEEXT)
 subdir = src/plugins/acct_gather_profile/hdf5/sh5util
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -273,8 +274,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -374,6 +373,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -412,6 +415,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -455,6 +461,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -505,6 +514,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile.in b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile.in
index 5b53aa361..3a465d4e1 100644
--- a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile.in
+++ b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/Makefile.in
@@ -95,7 +95,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -223,8 +224,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -324,6 +323,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -362,6 +365,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -405,6 +411,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -455,6 +464,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/hdf5_api.c b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/hdf5_api.c
index 473d20ae6..4557a352c 100644
--- a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/hdf5_api.c
+++ b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/hdf5_api.c
@@ -340,19 +340,19 @@ static double* _energy_get_series_values(char* data_name, void* data, int nsmp)
 		info("PROFILE: Failed to get memory for energy data");
 		return NULL;
 	}
-	if (strcasecmp(data_name,"Time") == 0) {
+	if (xstrcasecmp(data_name,"Time") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			energy_values[ix] = (double) energy_series[ix].time;
 
 		}
 		return energy_values;
-	} else if (strcasecmp(data_name,"Power") == 0) {
+	} else if (xstrcasecmp(data_name,"Power") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			energy_values[ix] = (double) energy_series[ix].power;
 
 		}
 		return energy_values;
-	} else if (strcasecmp(data_name,"CPU_Frequency") == 0) {
+	} else if (xstrcasecmp(data_name,"CPU_Frequency") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			energy_values[ix] = (double) energy_series[ix].cpu_freq;
 
@@ -619,31 +619,31 @@ static double* _io_get_series_values(char* data_name, void* data, int nsmp)
 		info("PROFILE: Failed to get memory for io data");
 		return NULL;
 	}
-	if (strcasecmp(data_name,"Time") == 0) {
+	if (xstrcasecmp(data_name,"Time") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			io_values[ix] = (double) io_series[ix].time;
 
 		}
 		return io_values;
-	} else if (strcasecmp(data_name,"Reads") == 0) {
+	} else if (xstrcasecmp(data_name,"Reads") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			io_values[ix] = (double) io_series[ix].reads;
 
 		}
 		return io_values;
-	} else if (strcasecmp(data_name,"Megabytes_Read") == 0) {
+	} else if (xstrcasecmp(data_name,"Megabytes_Read") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			io_values[ix] = io_series[ix].read_size;
 
 		}
 		return io_values;
-	} else if (strcasecmp(data_name,"Writes") == 0) {
+	} else if (xstrcasecmp(data_name,"Writes") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			io_values[ix] = (double) io_series[ix].writes;
 
 		}
 		return io_values;
-	} else if (strcasecmp(data_name,"Megabytes_Write") == 0) {
+	} else if (xstrcasecmp(data_name,"Megabytes_Write") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			io_values[ix] = io_series[ix].write_size;
 
@@ -940,33 +940,33 @@ static double* _network_get_series_values(char* data_name, void* data, int nsmp)
 		info("PROFILE: Failed to get memory for network data");
 		return NULL;
 	}
-	if (strcasecmp(data_name,"Time") == 0) {
+	if (xstrcasecmp(data_name,"Time") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			network_values[ix] = (double) network_series[ix].time;
 
 		}
 		return network_values;
-	} else if (strcasecmp(data_name,"Packets_In") == 0) {
+	} else if (xstrcasecmp(data_name,"Packets_In") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			network_values[ix] =
 					(double) network_series[ix].packets_in;
 
 		}
 		return network_values;
-	} else if (strcasecmp(data_name,"Megabytes_In") == 0) {
+	} else if (xstrcasecmp(data_name,"Megabytes_In") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			network_values[ix] = network_series[ix].size_in;
 
 		}
 		return network_values;
-	} else if (strcasecmp(data_name,"Packets_Out") == 0) {
+	} else if (xstrcasecmp(data_name,"Packets_Out") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			network_values[ix] =
 					(double) network_series[ix].packets_out;
 
 		}
 		return network_values;
-	} else if (strcasecmp(data_name,"Megabytes_Out") == 0) {
+	} else if (xstrcasecmp(data_name,"Megabytes_Out") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			network_values[ix] = network_series[ix].size_out;
 
@@ -1294,55 +1294,55 @@ static double* _task_get_series_values(char* data_name, void* data, int nsmp)
 		info("PROFILE: Failed to get memory for task data");
 		return NULL;
 	}
-	if (strcasecmp(data_name,"Time") == 0) {
+	if (xstrcasecmp(data_name,"Time") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].time;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"CPU_Frequency") == 0) {
+	} else if (xstrcasecmp(data_name,"CPU_Frequency") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].cpu_freq;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"CPU_Time") == 0) {
+	} else if (xstrcasecmp(data_name,"CPU_Time") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].cpu_time;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"CPU_Utilization") == 0) {
+	} else if (xstrcasecmp(data_name,"CPU_Utilization") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = task_series[ix].cpu_utilization;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"RSS") == 0) {
+	} else if (xstrcasecmp(data_name,"RSS") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].rss;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"VM_Size") == 0) {
+	} else if (xstrcasecmp(data_name,"VM_Size") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].vm_size;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"Pages") == 0) {
+	} else if (xstrcasecmp(data_name,"Pages") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = (double) task_series[ix].pages;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"Read_Megabytes") == 0) {
+	} else if (xstrcasecmp(data_name,"Read_Megabytes") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = task_series[ix].read_size;
 
 		}
 		return task_values;
-	} else if (strcasecmp(data_name,"Write_Megabytes") == 0) {
+	} else if (xstrcasecmp(data_name,"Write_Megabytes") == 0) {
 		for (ix=0; ix < nsmp; ix++) {
 			task_values[ix] = task_series[ix].write_size;
 
@@ -1726,7 +1726,7 @@ extern void *get_hdf5_data(hid_t parent, uint32_t type,
 		       type_name);
 		return NULL;
 	}
-	if (strcmp(subtype, SUBDATA_SUMMARY))
+	if (xstrcmp(subtype, SUBDATA_SUMMARY))
 		dtyp_memory = (*(ops->create_memory_datatype))();
 	else
 		dtyp_memory = (*(ops->create_s_memory_datatype))();
@@ -1790,7 +1790,7 @@ extern void put_hdf5_data(hid_t parent, uint32_t type, char *subtype,
 		return;
 	}
 	// Create the datatypes.
-	if (strcmp(subtype, SUBDATA_SUMMARY)) {
+	if (xstrcmp(subtype, SUBDATA_SUMMARY)) {
 		dtyp_memory = (*(ops->create_memory_datatype))();
 		dtyp_file = (*(ops->create_file_datatype))();
 	} else {
diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/sh5util.c b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/sh5util.c
index d70248ffc..259cc8434 100644
--- a/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/sh5util.c
+++ b/src/plugins/acct_gather_profile/hdf5/sh5util/libsh5util_old/sh5util.c
@@ -749,12 +749,12 @@ static hid_t _get_series_parent(hid_t group)
 {
 	hid_t gid_level = -1;
 
-	if (strcasecmp(params.level, "Node:Totals") == 0) {
+	if (xstrcasecmp(params.level, "Node:Totals") == 0) {
 		gid_level = get_group(group, GRP_TOTALS);
 		if (gid_level < 0) {
 			info("Failed to open  group %s", GRP_TOTALS);
 		}
-	} else if (strcasecmp(params.level, "Node:TimeSeries") == 0) {
+	} else if (xstrcasecmp(params.level, "Node:TimeSeries") == 0) {
 		gid_level = get_group(group, GRP_SAMPLES);
 		if (gid_level < 0) {
 			info("Failed to open group %s", GRP_SAMPLES);
@@ -835,7 +835,7 @@ static void _extract_series(FILE* fp, int stepx, bool header, hid_t gid_level,
 	data = get_hdf5_data(
 		gid_series, type, data_set_name, &size_data);
 	if (data) {
-		if (strcmp(subtype,SUBDATA_SUMMARY) != 0)
+		if (xstrcmp(subtype,SUBDATA_SUMMARY) != 0)
 			(*(ops->extract_series)) (fp, header, params.job_id,
 				 stepx, node_name, data_set_name,
 				 data, size_data);
@@ -875,8 +875,8 @@ static void _extract_node_level(FILE* fp, int stepx, hid_t jgid_nodes,
 			continue;
 		}
 		if (params.node
-		    && strcmp(params.node, "*")
-		    && strcmp(params.node, jgrp_node_name))
+		    && xstrcmp(params.node, "*")
+		    && xstrcmp(params.node, jgrp_node_name))
 			continue;
 		gid_level = _get_series_parent(jgid_node);
 		if (gid_level == -1) {
@@ -1036,7 +1036,7 @@ static int _extract_data(void)
 			H5Gclose(jgid_level);
 			H5Gclose(jgid_node);
 
-			if (!params.series || !strcmp(params.series, "*")) {
+			if (!params.series || !xstrcmp(params.series, "*")) {
 				for (isx = 0; isx < num_series; isx++) {
 					if (strncasecmp(series_names[isx],
 							GRP_TASK,
@@ -1047,8 +1047,8 @@ static int _extract_data(void)
 					                    series_names[isx]);
 					// Now handle all tasks.
 				}
-			} else if (strcasecmp(params.series, GRP_TASKS) == 0
-			           || strcasecmp(params.series, GRP_TASK) == 0) {
+			} else if (xstrcasecmp(params.series, GRP_TASKS) == 0 ||
+				   xstrcasecmp(params.series, GRP_TASK) == 0) {
 				for (isx = 0; isx < num_series; isx++) {
 					if (strstr(series_names[isx],
 					           GRP_TASK)) {
@@ -1066,7 +1066,7 @@ static int _extract_data(void)
 			_delete_string_list(series_names, num_series);
 			series_names = NULL;
 			num_series = 0;
-			if (!params.series || !strcmp(params.series, "*"))
+			if (!params.series || !xstrcmp(params.series, "*"))
 				_extract_all_tasks(fp, jgid_step, jgid_nodes,
 						nnodes, stepx);
 
@@ -1443,7 +1443,7 @@ static void _get_all_task_series(FILE *fp, bool hd, hid_t jgid_step, int stepx)
 		if (jgid_node < 0)
 			fatal("Failed to open group %s", jgrp_node_name);
 		for (itx = 0; itx<ntasks; itx++) {
-			if (strcmp(jgrp_node_name, task_node_name[itx]) != 0)
+			if (xstrcmp(jgrp_node_name, task_node_name[itx]) != 0)
 				continue;
 			tid = task_id[itx];
 			series_name[itx] = xstrdup_printf("%s_%d %s",
@@ -1554,7 +1554,7 @@ static int _series_data(void)
 			return -1;
 		}
 
-		if (strncmp(params.series,GRP_TASK,strlen(GRP_TASK)) == 0)
+		if (xstrncmp(params.series,GRP_TASK,strlen(GRP_TASK)) == 0)
 			_get_all_task_series(fp,hd,jgid_step, stepx);
 		else
 			_get_all_node_series(fp,hd,jgid_step, stepx);
diff --git a/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c b/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
index 54edd2e50..51c263083 100644
--- a/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
+++ b/src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
@@ -6,7 +6,7 @@
  *  Copyright (C) 2013 Bull S. A. S.
  *		Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois.
  *
- *  Copyright (C) 2013 SchedMD LLC
+ *  Copyright (C) 2013-2016 SchedMD LLC
  *
  *  Initially written by Rod Schultz <rod.schultz@bull.com> @ Bull
  *  and Danny Auble <da@schedmd.com> @ SchedMD.
@@ -122,6 +122,13 @@ typedef struct table {
 	const char *name;
 } table_t;
 
+typedef struct {
+	char *file_name;
+	int job_id;
+	char *node_name;
+	int step_id;
+} sh5util_file_t;
+
 static FILE* output_file;
 static bool group_mode = false;
 static const char *current_step;
@@ -138,45 +145,42 @@ static void _remove_empty_output(void);
 static int _list_items(void);
 static int _fields_intersection(hid_t fid_job, List tables, List fields);
 
-
 static void _help_msg(void)
 {
-	printf("\
-Usage sh5util [<OPTION>] -j <job[.stepid]>\n"
-"\n"
-"Valid <OPTION> values are:\n"
-" -L, --list           Print the items of a series contained in a job file.\n"
-"     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
-"     -s, --series     Name of series:\n"
-"                      Energy | Lustre | Network | Tasks\n"
-" -E, --extract        Extract data series from job file.\n"
-"     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
-"     -N, --node       Node name to extract (default is all)\n"
-"     -l, --level      Level to which series is attached\n"
-"                      [Node:Totals|Node:TimeSeries] (default Node:Totals)\n"
-"     -s, --series     Name of series:\n"
-"                      Energy | Lustre | Network | Tasks | Task_#\n"
-"                      'Tasks' is all tasks, Task_# is task_id (default is all)\n"
-" -I, --item-extract   Extract data item from one series from \n"
-"                      all samples on all nodes from thejob file.\n"
-"     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
-"     -s, --series     Name of series:\n"
-"                      Energy | Lustre | Network | Task\n"
-"     -d, --data       Name of data item in series (see man page) \n"
-" -j, --jobs           Format is <job(.step)>. Merge this job/step.\n"
-"                      or comma-separated list of job steps. This option is\n"
-"                      required.  Not specifying a step will result in all\n"
-"                      steps found to be processed.\n"
-" -h, --help           Print this description of use.\n"
-" -o, --output         Path to a file into which to write.\n"
-"                      Default for merge is ./job_$jobid.h5\n"
-"                      Default for extract is ./extract_$jobid.csv\n"
-" -p, --profiledir     Profile directory location where node-step files exist\n"
-"		               default is what is set in acct_gather.conf\n"
-" -S, --savefiles      Don't remove node-step files after merging them \n"
-" --user               User who profiled job. (Handy for root user, defaults to \n"
-"		               user running this command.)\n"
-" --usage              Display brief usage message\n");
+	printf("Usage sh5util [<OPTION>] -j <job[.stepid]>\n\n"
+	       "Valid <OPTION> values are:\n"
+	       " -L, --list           Print the items of a series contained in a job file.\n"
+	       "     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
+	       "     -s, --series     Name of series:\n"
+	       "                      Energy | Lustre | Network | Tasks\n"
+	       " -E, --extract        Extract data series from job file.\n"
+	       "     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
+	       "     -N, --node       Node name to extract (default is all)\n"
+	       "     -l, --level      Level to which series is attached\n"
+	       "                      [Node:Totals|Node:TimeSeries] (default Node:Totals)\n"
+	       "     -s, --series     Name of series:\n"
+	       "                      Energy | Lustre | Network | Tasks | Task_#\n"
+	       "                      'Tasks' is all tasks, Task_# is task_id (default is all)\n"
+	       " -I, --item-extract   Extract data item from one series from \n"
+	       "                      all samples on all nodes from thejob file.\n"
+	       "     -i, --input      merged file to extract from (default ./job_$jobid.h5)\n"
+	       "     -s, --series     Name of series:\n"
+	       "                      Energy | Lustre | Network | Task\n"
+	       "     -d, --data       Name of data item in series (see man page) \n"
+	       " -j, --jobs           Format is <job(.step)>. Merge this job/step.\n"
+	       "                      or comma-separated list of job steps. This option is\n"
+	       "                      required.  Not specifying a step will result in all\n"
+	       "                      steps found to be processed.\n"
+	       " -h, --help           Print this description of use.\n"
+	       " -o, --output         Path to a file into which to write.\n"
+	       "                      Default for merge is ./job_$jobid.h5\n"
+	       "                      Default for extract is ./extract_$jobid.csv\n"
+	       " -p, --profiledir     Profile directory location where node-step files exist\n"
+	       "		               default is what is set in acct_gather.conf\n"
+	       " -S, --savefiles      Don't remove node-step files after merging them \n"
+	       " --user               User who profiled job. (Handy for root user, defaults to \n"
+	       "		               user running this command.)\n"
+	       " --usage              Display brief usage message\n");
 }
 
 
@@ -195,29 +199,29 @@ main(int argc, char **argv)
 		goto ouch;
 
 	switch (params.mode) {
-		case SH5UTIL_MODE_MERGE:
-			info("Merging node-step files into %s",
-			     params.output);
-			cc = _merge_step_files();
-			break;
-		case SH5UTIL_MODE_EXTRACT:
-			info("Extracting job data from %s into %s",
-			     params.input, params.output);
-			cc = _extract_series();
-			break;
-		case SH5UTIL_MODE_ITEM_EXTRACT:
-			info("Extracting '%s' from '%s' data from %s into %s",
-			     params.data_item, params.series,
-			     params.input, params.output);
-			cc = _extract_item();
-			break;
-		case SH5UTIL_MODE_ITEM_LIST:
-			info("Listing items from %s", params.input);
-			cc = _list_items();
-			break;
-		default:
-			error("Unknown type %d", params.mode);
-			break;
+	case SH5UTIL_MODE_MERGE:
+		info("Merging node-step files into %s",
+		     params.output);
+		cc = _merge_step_files();
+		break;
+	case SH5UTIL_MODE_EXTRACT:
+		info("Extracting job data from %s into %s",
+		     params.input, params.output);
+		cc = _extract_series();
+		break;
+	case SH5UTIL_MODE_ITEM_EXTRACT:
+		info("Extracting '%s' from '%s' data from %s into %s",
+		     params.data_item, params.series,
+		     params.input, params.output);
+		cc = _extract_item();
+		break;
+	case SH5UTIL_MODE_ITEM_LIST:
+		info("Listing items from %s", params.input);
+		cc = _list_items();
+		break;
+	default:
+		error("Unknown type %d", params.mode);
+		break;
 	}
 
 	if (cc == SLURM_PROTOCOL_VERSION_ERROR)
@@ -228,6 +232,33 @@ ouch:
 	return cc;
 }
 
+static void _destroy_sh5util_file(void *arg)
+{
+	sh5util_file_t *object;
+
+	if (!arg)
+		return;
+
+	object = (sh5util_file_t *)arg;
+
+	xfree(object->file_name);
+	xfree(object->node_name);
+	xfree(object);
+}
+
+static int _sh5util_sort_files_dec(void *s1, void *s2)
+{
+	sh5util_file_t* rec_a = *(sh5util_file_t **)s1;
+	sh5util_file_t* rec_b = *(sh5util_file_t **)s2;
+
+	if (rec_a->step_id < rec_b->step_id)
+		return -1;
+	else if (rec_a->step_id > rec_b->step_id)
+		return 1;
+
+	return 0;
+}
+
 static void _cleanup(void)
 {
 	_remove_empty_output();
@@ -334,82 +365,82 @@ static int _set_options(const int argc, char **argv)
 	while ((cc = getopt_long(argc, argv, "d:Ehi:Ij:l:LN:o:p:s:Su:UvV",
 	                         long_options, &option_index)) != EOF) {
 		switch (cc) {
-			case 'd':
-				params.data_item = xstrdup(optarg);
-				/* params.data_item =
-				   xstrtolower(params.data_item); */
-				break;
-			case 'E':
-				params.mode = SH5UTIL_MODE_EXTRACT;
-				break;
-			case 'I':
-				params.mode = SH5UTIL_MODE_ITEM_EXTRACT;
-				break;
-			case 'L':
-				params.mode = SH5UTIL_MODE_ITEM_LIST;
-				break;
-			case 'h':
-				_help_msg();
-				return -1;
-				break;
-			case 'i':
-				params.input = xstrdup(optarg);
-				break;
-			case 'j':
-				params.job_id = strtol(optarg, &next_str, 10);
-				if (next_str[0] == '.')
-					params.step_id =
-						strtol(next_str + 1, NULL, 10);
-				break;
-			case 'l':
-				params.level = xstrdup(optarg);
-				break;
-			case 'N':
-				params.node = xstrdup(optarg);
-				break;
-			case 'o':
-				params.output = xstrdup(optarg);
-				break;
-			case 'p':
-				params.dir = xstrdup(optarg);
-				break;
-			case 's':
-				if (strcmp(optarg, GRP_ENERGY)
-				    && strcmp(optarg, GRP_LUSTRE)
-				    && strcmp(optarg, GRP_NETWORK)
-				    && strncmp(optarg,GRP_TASK,
-					       strlen(GRP_TASK))) {
-					error("Bad value for --series=\"%s\"",
-					      optarg);
-					return -1;
-				}
-				params.series = xstrdup(optarg);
-				break;
-			case 'S':
-				params.keepfiles = 1;
-				break;
-			case 'u':
-				if (uid_from_string(optarg, &u) < 0) {
-					error("No such user --uid=\"%s\"",
-					      optarg);
-					return -1;
-				}
-				params.user = uid_to_string(u);
-				break;
-			case 'U':
-				_help_msg();
-				return -1;
-				break;
-			case 'v':
-				params.verbose++;
-				break;
-			case 'V':
-				print_slurm_version();
+		case 'd':
+			params.data_item = xstrdup(optarg);
+			/* params.data_item =
+			   xstrtolower(params.data_item); */
+			break;
+		case 'E':
+			params.mode = SH5UTIL_MODE_EXTRACT;
+			break;
+		case 'I':
+			params.mode = SH5UTIL_MODE_ITEM_EXTRACT;
+			break;
+		case 'L':
+			params.mode = SH5UTIL_MODE_ITEM_LIST;
+			break;
+		case 'h':
+			_help_msg();
+			return -1;
+			break;
+		case 'i':
+			params.input = xstrdup(optarg);
+			break;
+		case 'j':
+			params.job_id = strtol(optarg, &next_str, 10);
+			if (next_str[0] == '.')
+				params.step_id =
+					strtol(next_str + 1, NULL, 10);
+			break;
+		case 'l':
+			params.level = xstrdup(optarg);
+			break;
+		case 'N':
+			params.node = xstrdup(optarg);
+			break;
+		case 'o':
+			params.output = xstrdup(optarg);
+			break;
+		case 'p':
+			params.dir = xstrdup(optarg);
+			break;
+		case 's':
+			if (xstrcmp(optarg, GRP_ENERGY)
+			    && xstrcmp(optarg, GRP_LUSTRE)
+			    && xstrcmp(optarg, GRP_NETWORK)
+			    && xstrncmp(optarg,GRP_TASK,
+					strlen(GRP_TASK))) {
+				error("Bad value for --series=\"%s\"",
+				      optarg);
 				return -1;
-				break;
-			case ':':
-			case '?': /* getopt() has explained it */
+			}
+			params.series = xstrdup(optarg);
+			break;
+		case 'S':
+			params.keepfiles = 1;
+			break;
+		case 'u':
+			if (uid_from_string(optarg, &u) < 0) {
+				error("No such user --uid=\"%s\"",
+				      optarg);
 				return -1;
+			}
+			params.user = uid_to_string(u);
+			break;
+		case 'U':
+			_help_msg();
+			return -1;
+			break;
+		case 'v':
+			params.verbose++;
+			break;
+		case 'V':
+			print_slurm_version();
+			return -1;
+			break;
+		case ':':
+		case '?': /* getopt() has explained it */
+			return -1;
 		}
 	}
 
@@ -463,7 +494,8 @@ _check_params(void)
 			fatal("Must specify series option --series");
 
 		if (!params.input)
-			params.input = xstrdup_printf("./job_%d.h5", params.job_id);
+			params.input = xstrdup_printf("./job_%d.h5",
+						      params.job_id);
 
 		if (!params.output)
 			params.output = xstrdup_printf("./%s_%s_%d.csv",
@@ -487,11 +519,12 @@ _check_params(void)
 
 /* Copy the group "/{NodeName}" of the hdf5 file file_name into the location
  * jgid_nodes */
-static int _merge_node_step_data(char* file_name, char* node_name,
-				 hid_t jgid_nodes, hid_t jgid_tasks)
+static int _merge_node_step_data(char* file_name, hid_t jgid_nodes,
+				 sh5util_file_t *sh5util_file)
 {
 	hid_t fid_nodestep;
-	char group_name[MAX_GROUP_NAME+1];
+	char *group_name = NULL;
+	int rc = SLURM_SUCCESS;
 
 	fid_nodestep = H5Fopen(file_name, H5F_ACC_RDONLY, H5P_DEFAULT);
 	if (fid_nodestep < 0) {
@@ -499,23 +532,26 @@ static int _merge_node_step_data(char* file_name, char* node_name,
 		return SLURM_ERROR;
 	}
 
-	sprintf(group_name, "/%s", node_name);
+	group_name = xstrdup_printf("/%s", sh5util_file->node_name);
 	hid_t ocpypl_id = H5Pcreate(H5P_OBJECT_COPY); /* default copy */
 	hid_t lcpl_id   = H5Pcreate(H5P_LINK_CREATE); /* parameters */
-	if (H5Ocopy(fid_nodestep, group_name, jgid_nodes, node_name,
+	if (H5Ocopy(fid_nodestep, group_name, jgid_nodes,
+		    sh5util_file->node_name,
 	            ocpypl_id, lcpl_id) < 0) {
 		debug("Failed to copy node step data of %s into the job file, "
 		      "trying with old method",
-		      node_name);
-		return SLURM_PROTOCOL_VERSION_ERROR;
+		      sh5util_file->node_name);
+		rc = SLURM_PROTOCOL_VERSION_ERROR;
+		goto endit;
 	}
 
-	H5Fclose(fid_nodestep);
-
 	if (!params.keepfiles)
 		remove(file_name);
+endit:
+	xfree(group_name);
+	H5Fclose(fid_nodestep);
 
-	return SLURM_SUCCESS;
+	return rc;
 }
 
 /* Look for step and node files and merge them together into one job file */
@@ -525,153 +561,173 @@ static int _merge_step_files(void)
 	hid_t jgid_steps = -1;
 	hid_t jgid_step = -1;
 	hid_t jgid_nodes = -1;
-	hid_t jgid_tasks = -1;
 	DIR *dir;
 	struct  dirent *de;
-	char file_name[MAX_PROFILE_PATH+1];
-	char step_dir[MAX_PROFILE_PATH+1];
-	char step_path[MAX_PROFILE_PATH+1];
-	char jgrp_step_name[MAX_GROUP_NAME+1];
-	char jgrp_nodes_name[MAX_GROUP_NAME+1];
-	char *step_node;
-	char *pos_char;
-	char *stepno;
-	int	stepx = 0;
-	int num_steps = 0;
-	int nodex = -1;
-	int max_step = -1;
-	int	jobid, stepid;
-	bool found_files = false;
-	int rc = SLURM_SUCCESS;
 
-	sprintf(step_dir, "%s/%s", params.dir, params.user);
+	char *file_name = NULL;
+	char *jgrp_nodes_name = NULL;
+	char *jgrp_step_name = NULL;
+	char *pos_char = NULL;
+	char *step_dir = NULL;
+	char *step_path = NULL;
+	char *stepno = NULL;
+	int node_cnt = -1;
+	int last_step = -1, step_cnt = 0;
+	int job_id;
+	int rc = SLURM_SUCCESS;
+	ListIterator itr;
+	List file_list = NULL;
+	sh5util_file_t *sh5util_file = NULL;
 
-	while (max_step == -1 || stepx <= max_step) {
+	step_dir = xstrdup_printf("%s/%s", params.dir, params.user);
 
-		if (!(dir = opendir(step_dir))) {
-			error("Cannot open %s job profile directory: %m", step_dir);
-			return -1;
-		}
+	if (!(dir = opendir(step_dir))) {
+		error("Cannot open %s job profile directory: %m",
+		      step_dir);
+		rc = -1;
+		goto endit;
+	}
 
-		nodex = 0;
-		while ((de = readdir(dir))) {
+	while ((de = readdir(dir))) {
+		xfree(file_name);
+		file_name = xstrdup(de->d_name);
 
-			strcpy(file_name, de->d_name);
-			if (file_name[0] == '.')
-				continue;
+		if (file_name[0] == '.')
+			continue;
 
-			pos_char = strstr(file_name,".h5");
-			if (!pos_char)
-				continue;
-			*pos_char = 0;
+		pos_char = strstr(file_name, ".h5");
+		if (!pos_char)
+			continue;
+		*pos_char = 0;
 
-			pos_char = strchr(file_name,'_');
-			if (!pos_char)
-				continue;
-			*pos_char = 0;
+		pos_char = strchr(file_name, '_');
+		if (!pos_char)
+			continue;
+		*pos_char = 0;
 
-			jobid = strtol(file_name, NULL, 10);
-			if (jobid != params.job_id)
-				continue;
+		job_id = strtol(file_name, NULL, 10);
+		if (job_id != params.job_id)
+			continue;
 
-			stepno = pos_char + 1;
-			pos_char = strchr(stepno,'_');
-			if (!pos_char) {
-				continue;
-			}
-			*pos_char = 0;
+		stepno = pos_char + 1;
+		pos_char = strchr(stepno, '_');
+		if (!pos_char) {
+			continue;
+		}
+		*pos_char = 0;
 
-			stepid = strtol(stepno, NULL, 10);
-			if (stepid > max_step)
-				max_step = stepid;
-			if (stepid != stepx)
-				continue;
+		if (!file_list)
+			file_list = list_create(_destroy_sh5util_file);
 
-			step_node = pos_char + 1;
+		sh5util_file = xmalloc(sizeof(sh5util_file_t));
+		list_append(file_list, sh5util_file);
 
-			if (!found_files) {
-				fid_job = H5Fcreate(params.output,
-				                    H5F_ACC_TRUNC,
-				                    H5P_DEFAULT,
-				                    H5P_DEFAULT);
-				if (fid_job < 0) {
-					error("Failed create HDF5 file %s", params.output);
-					return -1;
-				}
-				found_files = true;
+		sh5util_file->file_name = xstrdup(de->d_name);
+		sh5util_file->job_id = job_id;
 
-				jgid_steps = make_group(fid_job, GRP_STEPS);
-				if (jgid_steps < 0) {
-					error("Failed to create group %s", GRP_STEPS);
-					continue;
-				}
-			}
+		if (!xstrcmp(stepno, "batch"))
+			sh5util_file->step_id = -2;
+		else
+			sh5util_file->step_id = strtol(stepno, NULL, 10);
 
-			if (nodex == 0) {
+		stepno = pos_char + 1;
+		sh5util_file->node_name = xstrdup(stepno);
+	}
+	closedir(dir);
 
-				num_steps++;
-				sprintf(jgrp_step_name, "/%s/%d", GRP_STEPS,
-				        stepx);
+	if (!file_list || !list_count(file_list)) {
+		info("No node-step files found for jobid %d", params.job_id);
+		goto endit;
+	}
 
-				jgid_step = make_group(fid_job, jgrp_step_name);
-				if (jgid_step < 0) {
-					error("Failed to create %s", jgrp_step_name);
-					continue;
-				}
+	fid_job = H5Fcreate(
+		params.output, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+	if (fid_job < 0) {
+		error("Failed create HDF5 file %s", params.output);
+		rc = -1;
+		goto endit;
+	}
 
-				sprintf(jgrp_nodes_name,"%s/%s",
-				        jgrp_step_name,
-				        GRP_NODES);
-				jgid_nodes = make_group(jgid_step,
-				                        jgrp_nodes_name);
-				if (jgid_nodes < 0) {
-					error("Failed to create %s", jgrp_nodes_name);
-					continue;
-				}
+	jgid_steps = make_group(fid_job, GRP_STEPS);
+	if (jgid_steps < 0) {
+		error("Failed to create group %s",
+		      GRP_STEPS);
+		rc = -1;
+		goto endit;
+	}
 
-				/*
-				sprintf(jgrp_tasks_name,"%s/%s",
-				        jgrp_step_name,
-				        GRP_TASKS);
-				jgid_tasks = make_group(jgid_step,
-				                        jgrp_tasks_name);
-				if (jgid_tasks < 0) {
-					error("Failed to create %s", jgrp_tasks_name);
-					continue;
-				}
-				*/
+	/* sort the files so they are in step order */
+	list_sort(file_list, (ListCmpF) _sh5util_sort_files_dec);
+
+	node_cnt = 0;
+	itr = list_iterator_create(file_list);
+	while ((sh5util_file = list_next(itr))) {
+		//info("got file of %s", sh5util_file->file_name);
+
+		/* make a group for each step */
+		if (sh5util_file->step_id != last_step) {
+			last_step = sh5util_file->step_id;
+			step_cnt++;
+			/* on to the next step, close down the last one */
+			if (jgid_step) {
+				put_int_attribute(
+					jgid_step, ATTR_NNODES, node_cnt);
+				H5Gclose(jgid_nodes);
+				H5Gclose(jgid_step);
+				node_cnt = 0;
 			}
 
-			sprintf(step_path, "%s/%s", step_dir, de->d_name);
-			debug("Adding %s to the job file", step_path);
-			rc = _merge_node_step_data(step_path, step_node,
-						   jgid_nodes, jgid_tasks);
-			nodex++;
-		}
+			if (sh5util_file->step_id == -2)
+				jgrp_step_name = xstrdup_printf(
+					"/%s/batch", GRP_STEPS);
+			else
+				jgrp_step_name = xstrdup_printf(
+					"/%s/%d", GRP_STEPS,
+					sh5util_file->step_id);
+
+//			info("making group for step %d", sh5util_file->step_id);
+			jgid_step = make_group(fid_job, jgrp_step_name);
+			if (jgid_step < 0) {
+				error("Failed to create %s",
+				      jgrp_step_name);
+				xfree(jgrp_step_name);
+				continue;
+			}
 
-		closedir(dir);
+			jgrp_nodes_name = xstrdup_printf(
+				"%s/%s", jgrp_step_name, GRP_NODES);
+			xfree(jgrp_step_name);
 
-		if (nodex > 0) {
-			put_int_attribute(jgid_step, ATTR_NNODES, nodex);
-			H5Gclose(jgid_tasks);
-			H5Gclose(jgid_nodes);
-			H5Gclose(jgid_step);
+			jgid_nodes = make_group(
+				jgid_step, jgrp_nodes_name);
+			if (jgid_nodes < 0) {
+				error("Failed to create %s",
+				      jgrp_nodes_name);
+				xfree(jgrp_nodes_name);
+				continue;
+			}
+			xfree(jgrp_nodes_name);
 		}
 
-		/* If we did not find the step 0
-		 * bail out.
-		 */
-		if (stepx == 0
-			&& !found_files)
-			break;
+		node_cnt++;
+
+		/* append onto the step */
+		step_path = xstrdup_printf(
+			"%s/%s", step_dir, sh5util_file->file_name);
+		rc = _merge_node_step_data(
+			step_path, jgid_nodes, sh5util_file);
+		xfree(step_path);
 
-		stepx++;
 	}
+	list_iterator_destroy(itr);
 
-	if (!found_files)
-		info("No node-step files found for jobid %d", params.job_id);
-	else
-		put_int_attribute(fid_job, ATTR_NSTEPS, num_steps);
+	put_int_attribute(fid_job, ATTR_NSTEPS, step_cnt);
+
+
+endit:
+	FREE_NULL_LIST(file_list);
+	xfree(file_name);
+	xfree(step_dir);
 
 	if (jgid_steps != -1)
 		H5Gclose(jgid_steps);
@@ -739,8 +795,8 @@ static herr_t _collect_tables_node(hid_t g_id, const char *name,
 
 	/* node filter */
 	if (params.node
-	    && strcmp(params.node, "*") != 0
-	    && strcmp(params.node, name) != 0)
+	    && xstrcmp(params.node, "*") != 0
+	    && xstrcmp(params.node, name) != 0)
 		return 0;
 
 	snprintf(object_path, MAX_PROFILE_PATH+1, "%s/%s", name, params.series);
@@ -763,7 +819,8 @@ static herr_t _collect_tables_node(hid_t g_id, const char *name,
 		err = H5Literate(object_id, H5_INDEX_NAME, H5_ITER_INC, NULL,
 		                 _collect_tables_group, op_data);
 		if (err < 0) {
-			debug("2 Failed to iterate through group %s", object_path);
+			debug("2 Failed to iterate through group %s",
+			      object_path);
 			return SLURM_PROTOCOL_VERSION_ERROR;
 		}
 	} else {
@@ -929,7 +986,7 @@ static void _extract_totals(size_t nb_fields, size_t *offsets, hid_t *types,
  * the content of the table and then handles both timeseries and totals levels.
  */
 static int _extract_series_table(hid_t fid_job, table_t *table, List fields,
-				    FILE *output, bool level_total)
+				 FILE *output, bool level_total)
 {
 	char path[MAX_PROFILE_PATH];
 
@@ -1165,8 +1222,10 @@ error:
  * @param step_name  Name of the current step
  */
 static void _item_analysis_uint(hsize_t nb_tables, hid_t *tables,
-	hsize_t *nb_records, size_t buf_size, size_t *offsets,
-	const char *names[], const char *nodes[], const char *step_name)
+				hsize_t *nb_records, size_t buf_size,
+				size_t *offsets,
+				const char *names[], const char *nodes[],
+				const char *step_name)
 {
 	size_t   i;
 	uint64_t min_val;
@@ -1264,8 +1323,10 @@ static void _item_analysis_uint(hsize_t nb_tables, hid_t *tables,
  * See _item_analysis_uint for parameters description.
  */
 static void _item_analysis_double(hsize_t nb_tables, hid_t *tables,
-	hsize_t *nb_records, size_t buf_size, size_t *offsets,
-	const char *names[], const char *nodes[], const char *step_name)
+				  hsize_t *nb_records, size_t buf_size,
+				  size_t *offsets,
+				  const char *names[], const char *nodes[],
+				  const char *step_name)
 {
 	size_t   i;
 	double   min_val;
@@ -1486,7 +1547,8 @@ static herr_t _extract_item_step(hid_t g_id, const char *step_name,
 			if (group_mode)
 				fprintf(output_file, ",%s", t->node);
 			else
-				fprintf(output_file, ",%s %s", t->name, t->node);
+				fprintf(output_file, ",%s %s",
+					t->name, t->node);
 		}
 		fputc('\n', output_file);
 	}
@@ -1497,7 +1559,8 @@ static herr_t _extract_item_step(hid_t g_id, const char *step_name,
 		_item_analysis_uint(nb_tables, tables_id, nb_records, buf_size,
 		                    offsets, names, nodes, step_name);
 	} else if (H5Tequal(item_type, H5T_NATIVE_DOUBLE)) {
-		_item_analysis_double(nb_tables, tables_id, nb_records, buf_size,
+		_item_analysis_double(nb_tables, tables_id,
+				      nb_records, buf_size,
 		                      offsets, names, nodes, step_name);
 	} else {
 		error("Unknown type");
diff --git a/src/plugins/acct_gather_profile/none/Makefile.in b/src/plugins/acct_gather_profile/none/Makefile.in
index ebe1bb967..d98ff1015 100644
--- a/src/plugins/acct_gather_profile/none/Makefile.in
+++ b/src/plugins/acct_gather_profile/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/acct_gather_profile/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/auth/Makefile.am b/src/plugins/auth/Makefile.am
index 95bdd081f..8011dd2aa 100644
--- a/src/plugins/auth/Makefile.am
+++ b/src/plugins/auth/Makefile.am
@@ -1,3 +1,3 @@
 # Makefile for auth plugins
 
-SUBDIRS = authd munge none
+SUBDIRS = munge none
diff --git a/src/plugins/auth/Makefile.in b/src/plugins/auth/Makefile.in
index 2e60ad265..2f15d5a6f 100644
--- a/src/plugins/auth/Makefile.in
+++ b/src/plugins/auth/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/auth
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -472,7 +482,7 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = authd munge none
+SUBDIRS = munge none
 all: all-recursive
 
 .SUFFIXES:
diff --git a/src/plugins/auth/authd/Makefile.am b/src/plugins/auth/authd/Makefile.am
deleted file mode 100644
index 7e44d8954..000000000
--- a/src/plugins/auth/authd/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-# Makefile for auth/authd plugin
-
-AUTOMAKE_OPTIONS = foreign
-
-PLUGIN_FLAGS = -module -avoid-version --export-dynamic
-
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
-
-# Add your plugin to this line, following the naming conventions.
-if WITH_AUTHD
-AUTHD = auth_authd.la
-endif
-
-pkglib_LTLIBRARIES = $(AUTHD)
-
-# Authd authentication plugin -- requires libauth
-auth_authd_la_SOURCES = auth_authd.c
-auth_authd_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
-auth_authd_la_LIBADD = -lauth -le
-
diff --git a/src/plugins/auth/authd/auth_authd.c b/src/plugins/auth/authd/auth_authd.c
deleted file mode 100644
index 5040a575b..000000000
--- a/src/plugins/auth/authd/auth_authd.c
+++ /dev/null
@@ -1,367 +0,0 @@
-/*****************************************************************************\
- *  auth_authd - plugin for Brent Chun's authd
- *****************************************************************************
- *  Copyright (C) 2002-2007 The Regents of the University of California.
- *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Kevin Tew <tew1@llnl.gov> et. al.
- *  CODE-OCEC-09-009. All rights reserved.
- *
- *  This file is part of SLURM, a resource management program.
- *  For details, see <http://slurm.schedmd.com/>.
- *  Please also read the included file: DISCLAIMER.
- *
- *  SLURM is free software; you can redistribute it and/or modify it under
- *  the terms of the GNU General Public License as published by the Free
- *  Software Foundation; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  In addition, as a special exception, the copyright holders give permission
- *  to link the code of portions of this program with the OpenSSL library under
- *  certain conditions as described in each individual source file, and
- *  distribute linked combinations including the two. You must obey the GNU
- *  General Public License in all respects for all of the code used other than
- *  OpenSSL. If you modify file(s) with this exception, you may extend this
- *  exception to your version of the file(s), but you are not obligated to do
- *  so. If you do not wish to do so, delete this exception statement from your
- *  version.  If you delete this exception statement from all source files in
- *  the program, then also delete it here.
- *
- *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
- *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- *  details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with SLURM; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
-
-#if HAVE_CONFIG_H
-#  include "config.h"
-#  if STDC_HEADERS
-#    include <stdio.h>
-#    include <string.h>
-#  endif /* STDC_HEADERS */
-#  if HAVE_UNISTD_H
-#    include <unistd.h>
-#  endif /* HAVE_UNISTD_H */
-#else /* ! HAVE_CONFIG_H */
-#  include <stdio.h>
-#  include <unistd.h>
-#  include <string.h>
-#  include <auth.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <pwd.h>
-#include <grp.h>
-#include <auth.h>
-
-#ifndef UNIX_PATH_MAX
-#define UNIX_PATH_MAX 108  /* Cribbed from linux/un.h */
-#endif
-
-#include "slurm/slurm_errno.h"
-#include "src/common/slurm_xlator.h"
-#include "src/common/slurm_time.h"
-
-/*
- * These variables are required by the generic plugin interface.  If they
- * are not found in the plugin, the plugin loader will ignore it.
- *
- * plugin_name - a string giving a human-readable description of the
- * plugin.  There is no maximum length, but the symbol must refer to
- * a valid string.
- *
- * plugin_type - a string suggesting the type of the plugin or its
- * applicability to a particular form of data or method of data handling.
- * If the low-level plugin API is used, the contents of this string are
- * unimportant and may be anything.  SLURM uses the higher-level plugin
- * interface which requires this string to be of the form
- *
- *	<application>/<method>
- *
- * where <application> is a description of the intended application of
- * the plugin (e.g., "auth" for SLURM authentication) and <method> is a
- * description of how this plugin satisfies that application.  SLURM will
- * only load authentication plugins if the plugin_type string has a prefix
- * of "auth/".
- *
- * plugin_version - an unsigned 32-bit integer containing the Slurm version
- * (major.minor.micro combined into a single number).
- */
-const char plugin_name[]        = "Brent Chun's authd authentication plugin";
-const char plugin_type[]        = "auth/authd";
-const uint32_t plugin_version = SLURM_VERSION_NUMBER;
-
-/* Default timeout. */
-static const int AUTHD_TTL = 2;
-
-typedef struct _slurm_auth_credential {
-	credentials cred;
-	signature sig;
-	int cr_errno;
-} slurm_auth_credential_t;
-
-/* Plugin-global errno. */
-static int plugin_errno = SLURM_SUCCESS;
-
-/*
- * Errno values.  If you add something here you have to add its
- * corresponding error string in slurm_auth_errstr() below.
- */
-enum {
-	SLURM_AUTH_UNPACK = SLURM_AUTH_FIRST_LOCAL_ERROR,
-	SLURM_AUTH_EXPIRED
-};
-
-
-int init( void )
-{
-	debug( "authd authentication module initializing" );
-
-	return SLURM_SUCCESS;
-}
-
-extern int fini ( void )
-{
-	return SLURM_SUCCESS;
-}
-
-slurm_auth_credential_t *
-slurm_auth_create( void *argv[], char *auth_info )
-{
-	int ttl;
-	int rc;
-	slurm_auth_credential_t *cred;
-
-	if ( argv == NULL ) {
-		plugin_errno = SLURM_AUTH_MEMORY;
-		return NULL;
-	}
-
-	cred = (slurm_auth_credential_t *)
-		xmalloc( sizeof( slurm_auth_credential_t ) );
-	cred->cr_errno = SLURM_SUCCESS;
-	cred->cred.uid = geteuid();
-	cred->cred.gid = getegid();
-
-	cred->cred.valid_from = time( NULL );
-
-	ttl = (int) argv[ARG_TIMEOUT];
-	/*
-	 * In debug mode read the time-to-live from an environment
-	 * variable.
-	 */
-#ifndef NDEBUG
-	{
-		char *env = getenv( "SLURM_AUTHD_TTL" );
-		if ( env ) {
-			ttl = atoi( env );
-			if ( ttl <= 0 )
-				ttl = AUTHD_TTL;
-		}
-	}
-#endif /*NDEBUG*/
-
-	cred->cred.valid_to = cred->cred.valid_from + ttl;
-
-	/* Sign the credential. */
-	auth_init_credentials (&cred->cred, ttl);
-	if ((rc = auth_get_signature( &cred->cred, &cred->sig )) < 0 ) {
-		plugin_errno = SLURM_AUTH_INVALID;
-		xfree( cred );
-		return NULL;
-	}
-
-	return cred;
-}
-
-int
-slurm_auth_destroy( slurm_auth_credential_t *cred )
-{
-	if ( cred == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_ERROR;
-	}
-	xfree( cred );
-	return SLURM_SUCCESS;
-}
-
-int
-slurm_auth_verify( slurm_auth_credential_t *cred, char *auth_info )
-{
-	int rc;
-	time_t now;
-
-	if ( cred == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_ERROR;
-	}
-
-	if ((rc = auth_verify_signature( &cred->cred, &cred->sig )) < 0) {
-		cred->cr_errno = SLURM_AUTH_INVALID;
-		return SLURM_ERROR;
-	}
-
-	now = time( NULL );
-	if ( ( now < cred->cred.valid_from ) || ( now > cred->cred.valid_to ) ) {
-		cred->cr_errno = SLURM_AUTH_EXPIRED;
-		return SLURM_ERROR;
-	}
-
-	/* XXX check to see if user is valid on the system. */
-
-	return SLURM_SUCCESS;
-}
-
-
-uid_t
-slurm_auth_get_uid( slurm_auth_credential_t *cred, char *auth_info )
-{
-	if ( cred == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_AUTH_NOBODY;
-	}
-	return cred->cred.uid;
-}
-
-
-gid_t
-slurm_auth_get_gid( slurm_auth_credential_t *cred, char *auth_info )
-{
-	if ( cred == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_AUTH_NOBODY;
-	}
-	return cred->cred.gid;
-}
-
-
-int
-slurm_auth_pack( slurm_auth_credential_t *cred, Buf buf )
-{
-	uint16_t sig_size = sizeof( signature );
-
-	if ( ( cred == NULL ) || ( buf == NULL ) ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_ERROR;
-	}
-
-	/*
-	 * Marshall the plugin type and version for runtime sanity check.
-	 * Add the terminating zero so we get it for free at the
-	 * other end.
-	 */
-	packmem( (char *) plugin_type, strlen( plugin_type ) + 1, buf );
-	pack32( plugin_version, buf );
-
-	pack32( (uint32_t) cred->cred.uid, buf );
-	pack32( (uint32_t) cred->cred.gid, buf );
-	pack_time( cred->cred.valid_from, buf );
-	pack_time( cred->cred.valid_to, buf );
-	packmem( cred->sig.data, sig_size, buf );
-
-	return SLURM_SUCCESS;
-}
-
-
-slurm_auth_credential_t *
-slurm_auth_unpack( Buf buf )
-{
-	slurm_auth_credential_t *cred = NULL;
-	uint16_t sig_size; /* ignored */
-	uint32_t version, tmpint;
-	char *data;
-
-	if ( buf == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return NULL;
-	}
-
-
-	/* Check the plugin type. */
-	safe_unpackmem_ptr( &data, &sig_size, buf );
-	if ( strcmp( data, plugin_type ) != 0 ) {
-		debug("slurm_auth_unpack error: packed by %s unpack by %s",
-		      data, plugin_type);
-		plugin_errno = SLURM_AUTH_MISMATCH;
-		return NULL;
-	}
-
-	safe_unpack32( &version, buf );
-
-	/* Allocate a credential. */
-	cred = (slurm_auth_credential_t *)
-		xmalloc( sizeof( slurm_auth_credential_t ) );
-	cred->cr_errno = SLURM_SUCCESS;
-
-	safe_unpack32( &tmpint, buf );
-	cred->cred.uid = tmpint;
-	safe_unpack32( &tmpint, buf );
-	cred->cred.gid = tmpint;
-	safe_unpack_time( &cred->cred.valid_from, buf );
-	safe_unpack_time( &cred->cred.valid_to, buf );
-	safe_unpackmem_ptr( &data, &sig_size, buf );
-	memcpy( cred->sig.data, data, sizeof( signature ) );
-
-	return cred;
-
- unpack_error:
-	plugin_errno = SLURM_AUTH_UNPACK;
-	xfree( cred );
-	return NULL;
-}
-
-
-int
-slurm_auth_print( slurm_auth_credential_t *cred, FILE *fp )
-{
-	if ( cred == NULL ) {
-		plugin_errno = SLURM_AUTH_BADARG;
-		return SLURM_ERROR;
-	}
-
-	verbose( "BEGIN AUTHD CREDENTIAL" );
-	verbose( "   UID: %u", cred->cred.uid );
-	verbose( "   GID: %u", cred->cred.gid );
-	verbose( "   Valid from: %s", slurm_ctime2( &cred->cred.valid_from ) );
-	verbose( "   Valid to: %s", slurm_ctime2( &cred->cred.valid_to ) );
-	verbose( "   Signature: 0x%02x%02x%02x%02x ...",
-			 cred->sig.data[ 0 ], cred->sig.data[ 1 ],
-			 cred->sig.data[ 2 ], cred->sig.data[ 3 ] );
-	verbose( "END AUTHD CREDENTIAL" );
-
-	return SLURM_SUCCESS;
-}
-
-
-int
-slurm_auth_errno( slurm_auth_credential_t *cred )
-{
-	if ( cred == NULL )
-		return plugin_errno;
-	else
-		return cred->cr_errno;
-}
-
-
-const char *
-slurm_auth_errstr( int slurm_errno )
-{
-	static struct {
-		int err;
-		char *msg;
-	} tbl[] = {
-		{ SLURM_AUTH_UNPACK, "cannot unpack authentication type" },
-		{ SLURM_AUTH_EXPIRED, "the credential has expired" },
-		{ 0, NULL }
-	};
-
-	int i;
-
-	for ( i = 0; ; ++i ) {
-		if ( tbl[ i ].msg == NULL ) return "unknown error";
-		if ( tbl[ i ].err == slurm_errno ) return tbl[ i ].msg;
-	}
-}
diff --git a/src/plugins/auth/munge/Makefile.in b/src/plugins/auth/munge/Makefile.in
index 7e25748a8..45aef8067 100644
--- a/src/plugins/auth/munge/Makefile.in
+++ b/src/plugins/auth/munge/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/auth/munge
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/auth/munge/auth_munge.c b/src/plugins/auth/munge/auth_munge.c
index 01623a3fc..7f27de5e8 100644
--- a/src/plugins/auth/munge/auth_munge.c
+++ b/src/plugins/auth/munge/auth_munge.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  auth_munge.c - SLURM auth implementation via Chris Dunlap's Munge
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -429,7 +428,7 @@ slurm_auth_unpack( Buf buf )
 	safe_unpackmem_ptr( &type, &size, buf );
 
 	if (( type == NULL ) ||
-	    ( strcmp( type, plugin_type ) != 0 )) {
+	    ( xstrcmp( type, plugin_type ) != 0 )) {
 		debug("slurm_auth_unpack error: packed by %s unpack by %s",
 		      type, plugin_type);
 		plugin_errno = SLURM_AUTH_MISMATCH;
diff --git a/src/plugins/auth/none/Makefile.in b/src/plugins/auth/none/Makefile.in
index fc30f462a..9bc2d328e 100644
--- a/src/plugins/auth/none/Makefile.in
+++ b/src/plugins/auth/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/auth/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/auth/none/auth_none.c b/src/plugins/auth/none/auth_none.c
index 304629394..4f6cb9a21 100644
--- a/src/plugins/auth/none/auth_none.c
+++ b/src/plugins/auth/none/auth_none.c
@@ -288,7 +288,7 @@ slurm_auth_unpack( Buf buf )
 	 */
 	safe_unpackmem_ptr( &tmpstr, &size, buf );
 	if (( tmpstr == NULL )
-	||  ( strcmp( tmpstr, plugin_type ) != 0 )) {
+	||  ( xstrcmp( tmpstr, plugin_type ) != 0 )) {
 		debug("slurm_auth_unpack error: packed by %s unpack by %s",
 		      tmpstr, plugin_type);
 		plugin_errno = SLURM_AUTH_MISMATCH;
diff --git a/src/plugins/burst_buffer/Makefile.in b/src/plugins/burst_buffer/Makefile.in
index 890656e84..fe551d996 100644
--- a/src/plugins/burst_buffer/Makefile.in
+++ b/src/plugins/burst_buffer/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/burst_buffer
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/burst_buffer/common/Makefile.in b/src/plugins/burst_buffer/common/Makefile.in
index 4e0b4cb37..673c3f13c 100644
--- a/src/plugins/burst_buffer/common/Makefile.in
+++ b/src/plugins/burst_buffer/common/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/burst_buffer/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -218,8 +219,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -319,6 +318,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -357,6 +360,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -400,6 +406,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -450,6 +459,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/burst_buffer/common/burst_buffer_common.c b/src/plugins/burst_buffer/common/burst_buffer_common.c
index 851fa3ec1..eb3357fc3 100644
--- a/src/plugins/burst_buffer/common/burst_buffer_common.c
+++ b/src/plugins/burst_buffer/common/burst_buffer_common.c
@@ -52,7 +52,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 #define POLLRDHUP POLLHUP
 #include <signal.h>
 #endif
@@ -77,7 +77,7 @@
 #include "burst_buffer_common.h"
 
 /* For possible future use by burst_buffer/generic */
-#define _SUPPORT_GRES 0
+#define _SUPPORT_ALT_POOL 0
 
 /* Maximum poll wait time for child processes, in milliseconds */
 #define MAX_POLL_WAIT 500
@@ -88,8 +88,6 @@ static pthread_mutex_t proc_count_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static void	_bb_job_del2(bb_job_t *bb_job);
 static uid_t *	_parse_users(char *buf);
-static int	_persist_match(void *x, void *key);
-static void	_persist_purge(void *x);
 static char *	_print_users(uid_t *buf);
 
 /* Translate comma delimitted list of users into a UID array,
@@ -223,13 +221,13 @@ extern void bb_clear_config(bb_config_t *config_ptr, bool fini)
 	xfree(config_ptr->get_sys_state);
 	config_ptr->granularity = 1;
 	if (fini) {
-		for (i = 0; i < config_ptr->gres_cnt; i++)
-			xfree(config_ptr->gres_ptr[i].name);
-		xfree(config_ptr->gres_ptr);
-		config_ptr->gres_cnt = 0;
+		for (i = 0; i < config_ptr->pool_cnt; i++)
+			xfree(config_ptr->pool_ptr[i].name);
+		xfree(config_ptr->pool_ptr);
+		config_ptr->pool_cnt = 0;
 	} else {
-		for (i = 0; i < config_ptr->gres_cnt; i++)
-			config_ptr->gres_ptr[i].avail_cnt = 0;
+		for (i = 0; i < config_ptr->pool_cnt; i++)
+			config_ptr->pool_ptr[i].total_space = 0;
 	}
 	config_ptr->other_timeout = 0;
 	config_ptr->stage_in_timeout = 0;
@@ -330,7 +328,7 @@ extern bb_user_t *bb_find_user_rec(uint32_t user_id, bb_state_t *state_ptr)
 	return user_ptr;
 }
 
-#if _SUPPORT_GRES
+#if _SUPPORT_ALT_POOL
 static uint64_t _atoi(char *tok)
 {
 	char *end_ptr = NULL;
@@ -382,13 +380,16 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 {
 	s_p_hashtbl_t *bb_hashtbl = NULL;
 	char *bb_conf, *tmp = NULL, *value;
-#if _SUPPORT_GRES
+#if _SUPPORT_ALT_POOL
 	char *colon, *save_ptr = NULL, *tok;
-	uint32_t gres_cnt;
+	uint32_t pool_cnt;
 #endif
 	int fd, i;
 	static s_p_options_t bb_options[] = {
 		{"AllowUsers", S_P_STRING},
+#if _SUPPORT_ALT_POOL
+		{"AltPool", S_P_STRING},
+#endif
 		{"CreateBuffer", S_P_STRING},
 		{"DefaultPool", S_P_STRING},
 		{"DenyUsers", S_P_STRING},
@@ -396,7 +397,6 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		{"Flags", S_P_STRING},
 		{"GetSysState", S_P_STRING},
 		{"Granularity", S_P_STRING},
-/*		{"Gres", S_P_STRING},	*/
 		{"OtherTimeout", S_P_UINT32},
 		{"StageInTimeout", S_P_UINT32},
 		{"StageOutTimeout", S_P_UINT32},
@@ -418,9 +418,15 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		state_ptr->name = xstrdup(tmp);
 	}
 
+	/* Set default configuration */
 	bb_clear_config(&state_ptr->bb_config, false);
 	if (slurm_get_debug_flags() & DEBUG_FLAG_BURST_BUF)
 		state_ptr->bb_config.debug_flag = true;
+	state_ptr->bb_config.flags |= BB_FLAG_DISABLE_PERSISTENT;
+	state_ptr->bb_config.other_timeout = DEFAULT_OTHER_TIMEOUT;
+	state_ptr->bb_config.stage_in_timeout = DEFAULT_STATE_IN_TIMEOUT;
+	state_ptr->bb_config.stage_out_timeout = DEFAULT_STATE_OUT_TIMEOUT;
+	state_ptr->bb_config.validate_timeout = DEFAULT_VALIDATE_TIMEOUT;
 
 	/* First look for "burst_buffer.conf" then with "type" field,
 	 * for example "burst_buffer_cray.conf" */
@@ -435,9 +441,13 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		bb_conf = get_extra_conf_path(new_path);
 		fd = open(bb_conf, 0);
 		if (fd < 0) {
-			fatal("%s: Unable to find configuration file %s or "
-			      "burst_buffer.conf", __func__, new_path);
+			info("%s: Unable to find configuration file %s or "
+			     "burst_buffer.conf", __func__, new_path);
+			xfree(bb_conf);
+			xfree(new_path);
+			return;
 		}
+		close(fd);
 		xfree(new_path);
 	}
 
@@ -468,8 +478,8 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		xfree(tmp);
 	}
 	/* By default, disable persistent buffer creation by normal users */
-	if ((state_ptr->bb_config.flags & BB_FLAG_ENABLE_PERSISTENT) == 0)
-		state_ptr->bb_config.flags |= BB_FLAG_DISABLE_PERSISTENT;
+	if (state_ptr->bb_config.flags & BB_FLAG_ENABLE_PERSISTENT)
+		state_ptr->bb_config.flags &= (~BB_FLAG_DISABLE_PERSISTENT);
 
 	s_p_get_string(&state_ptr->bb_config.get_sys_state, "GetSysState",
 		       bb_hashtbl);
@@ -481,47 +491,39 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 			state_ptr->bb_config.granularity = 1;
 		}
 	}
-#if _SUPPORT_GRES
-	if (s_p_get_string(&tmp, "Gres", bb_hashtbl)) {
+#if _SUPPORT_ALT_POOL
+	if (s_p_get_string(&tmp, "AltPool", bb_hashtbl)) {
 		tok = strtok_r(tmp, ",", &save_ptr);
 		while (tok) {
 			colon = strchr(tok, ':');
 			if (colon) {
 				colon[0] = '\0';
-				gres_cnt = _atoi(colon+1);
+				pool_cnt = _atoi(colon + 1);
 			} else
-				gres_cnt = 1;
-			state_ptr->bb_config.gres_ptr = xrealloc(
-				state_ptr->bb_config.gres_ptr,
-				sizeof(burst_buffer_gres_t) *
-				(state_ptr->bb_config.gres_cnt + 1));
+				pool_cnt = 1;
+			state_ptr->bb_config.pool_ptr = xrealloc(
+				state_ptr->bb_config.pool_ptr,
+				sizeof(burst_buffer_pool_t) *
+				(state_ptr->bb_config.pool_cnt + 1));
 			state_ptr->bb_config.
-				gres_ptr[state_ptr->bb_config.gres_cnt].name =
+				pool_ptr[state_ptr->bb_config.pool_cnt].name =
 				xstrdup(tok);
 			state_ptr->bb_config.
-				gres_ptr[state_ptr->bb_config.gres_cnt].
-				avail_cnt = gres_cnt;
-			state_ptr->bb_config.gres_cnt++;
+				pool_ptr[state_ptr->bb_config.pool_cnt].
+				avail_space = pool_cnt;
+			state_ptr->bb_config.pool_cnt++;
 			tok = strtok_r(NULL, ",", &save_ptr);
 		}
 		xfree(tmp);
 	}
 #endif
 
-	if (!s_p_get_uint32(&state_ptr->bb_config.other_timeout,
-			    "OtherTimeout", bb_hashtbl)) {
-		state_ptr->bb_config.other_timeout = DEFAULT_OTHER_TIMEOUT;
-	}
-	if (!s_p_get_uint32(&state_ptr->bb_config.stage_in_timeout,
-			    "StageInTimeout", bb_hashtbl)) {
-		state_ptr->bb_config.stage_in_timeout =
-			DEFAULT_STATE_IN_TIMEOUT;
-	}
-	if (!s_p_get_uint32(&state_ptr->bb_config.stage_out_timeout,
-			    "StageOutTimeout", bb_hashtbl)) {
-		state_ptr->bb_config.stage_out_timeout =
-			DEFAULT_STATE_OUT_TIMEOUT;
-	}
+	(void) s_p_get_uint32(&state_ptr->bb_config.other_timeout,
+			     "OtherTimeout", bb_hashtbl);
+	(void) s_p_get_uint32(&state_ptr->bb_config.stage_in_timeout,
+			    "StageInTimeout", bb_hashtbl);
+	(void) s_p_get_uint32(&state_ptr->bb_config.stage_out_timeout,
+			    "StageOutTimeout", bb_hashtbl);
 	s_p_get_string(&state_ptr->bb_config.start_stage_in, "StartStageIn",
 		       bb_hashtbl);
 	s_p_get_string(&state_ptr->bb_config.start_stage_out, "StartStageOut",
@@ -530,11 +532,8 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		       bb_hashtbl);
 	s_p_get_string(&state_ptr->bb_config.stop_stage_out, "StopStageOut",
 		       bb_hashtbl);
-	if (!s_p_get_uint32(&state_ptr->bb_config.validate_timeout,
-			   "ValidateTimeout", bb_hashtbl)) {
-		state_ptr->bb_config.validate_timeout =
-			DEFAULT_VALIDATE_TIMEOUT;
-	}
+	(void) s_p_get_uint32(&state_ptr->bb_config.validate_timeout,
+			     "ValidateTimeout", bb_hashtbl);
 
 	s_p_hashtbl_destroy(bb_hashtbl);
 	xfree(bb_conf);
@@ -556,10 +555,10 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 		     state_ptr->bb_config.get_sys_state);
 		info("%s: Granularity:%"PRIu64"",  __func__,
 		     state_ptr->bb_config.granularity);
-		for (i = 0; i < state_ptr->bb_config.gres_cnt; i++) {
-			info("%s: Gres[%d]:%s:%"PRIu64"", __func__, i,
-			     state_ptr->bb_config.gres_ptr[i].name,
-			     state_ptr->bb_config.gres_ptr[i].avail_cnt);
+		for (i = 0; i < state_ptr->bb_config.pool_cnt; i++) {
+			info("%s: AltPoolName[%d]:%s:%"PRIu64"", __func__, i,
+			     state_ptr->bb_config.pool_ptr[i].name,
+			     state_ptr->bb_config.pool_ptr[i].total_space);
 		}
 		info("%s: OtherTimeout:%u", __func__,
 		     state_ptr->bb_config.other_timeout);
@@ -580,11 +579,43 @@ extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type)
 	}
 }
 
+static void _pack_alloc(struct bb_alloc *bb_alloc, Buf buffer,
+			uint16_t protocol_version)
+{
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		packstr(bb_alloc->account,      buffer);
+		pack32(bb_alloc->array_job_id,  buffer);
+		pack32(bb_alloc->array_task_id, buffer);
+		pack_time(bb_alloc->create_time, buffer);
+		pack32(bb_alloc->job_id,        buffer);
+		packstr(bb_alloc->name,         buffer);
+		packstr(bb_alloc->partition,    buffer);
+		packstr(bb_alloc->pool,   	buffer);
+		packstr(bb_alloc->qos,          buffer);
+		pack64(bb_alloc->size,          buffer);
+		pack16(bb_alloc->state,         buffer);
+		pack32(bb_alloc->user_id,       buffer);
+	} else {
+		packstr(bb_alloc->account,      buffer);
+		pack32(bb_alloc->array_job_id,  buffer);
+		pack32(bb_alloc->array_task_id, buffer);
+		pack_time(bb_alloc->create_time, buffer);
+		pack32((uint32_t)0, buffer);
+		pack32(bb_alloc->job_id,        buffer);
+		packstr(bb_alloc->name,         buffer);
+		packstr(bb_alloc->partition,    buffer);
+		packstr(bb_alloc->qos,          buffer);
+		pack64(bb_alloc->size,          buffer);
+		pack16(bb_alloc->state,         buffer);
+		pack32(bb_alloc->user_id,       buffer);
+	}
+}
+
 /* Pack individual burst buffer records into a buffer */
 extern int bb_pack_bufs(uid_t uid, bb_state_t *state_ptr, Buf buffer,
 			uint16_t protocol_version)
 {
-	int i, j, rec_count = 0;
+	int i, rec_count = 0;
 	struct bb_alloc *bb_alloc;
 	int eof, offset;
 
@@ -598,24 +629,7 @@ extern int bb_pack_bufs(uid_t uid, bb_state_t *state_ptr, Buf buffer,
 		bb_alloc = state_ptr->bb_ahash[i];
 		while (bb_alloc) {
 			if ((uid == 0) || (uid == bb_alloc->user_id)) {
-				packstr(bb_alloc->account,      buffer);
-				pack32(bb_alloc->array_job_id,  buffer);
-				pack32(bb_alloc->array_task_id, buffer);
-				pack_time(bb_alloc->create_time, buffer);
-				pack32(bb_alloc->gres_cnt, buffer);
-				for (j = 0; j < bb_alloc->gres_cnt; j++) {
-					packstr(bb_alloc->gres_ptr[j].name,
-						buffer);
-					pack64(bb_alloc->gres_ptr[j].used_cnt,
-					       buffer);
-				}
-				pack32(bb_alloc->job_id,        buffer);
-				packstr(bb_alloc->name,         buffer);
-				packstr(bb_alloc->partition,    buffer);
-				packstr(bb_alloc->qos,          buffer);
-				pack64(bb_alloc->size,          buffer);
-				pack16(bb_alloc->state,         buffer);
-				pack32(bb_alloc->user_id,       buffer);
+				_pack_alloc(bb_alloc, buffer, protocol_version);
 				rec_count++;
 			}
 			bb_alloc = bb_alloc->next;
@@ -638,28 +652,56 @@ extern void bb_pack_state(bb_state_t *state_ptr, Buf buffer,
 	bb_config_t *config_ptr = &state_ptr->bb_config;
 	int i;
 
-	packstr(config_ptr->allow_users_str, buffer);
-	packstr(config_ptr->create_buffer,   buffer);
-	packstr(config_ptr->default_pool,    buffer);
-	packstr(config_ptr->deny_users_str,  buffer);
-	packstr(config_ptr->destroy_buffer,  buffer);
-	pack32(config_ptr->flags,            buffer);
-	packstr(config_ptr->get_sys_state,   buffer);
-	pack64(config_ptr->granularity,      buffer);
-	pack32(config_ptr->gres_cnt,         buffer);
-	for (i = 0; i < config_ptr->gres_cnt; i++) {
-		packstr(config_ptr->gres_ptr[i].name, buffer);
-		pack64(config_ptr->gres_ptr[i].avail_cnt, buffer);
-		pack64(config_ptr->gres_ptr[i].used_cnt, buffer);
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		packstr(config_ptr->allow_users_str, buffer);
+		packstr(config_ptr->create_buffer,   buffer);
+		packstr(config_ptr->default_pool,    buffer);
+		packstr(config_ptr->deny_users_str,  buffer);
+		packstr(config_ptr->destroy_buffer,  buffer);
+		pack32(config_ptr->flags,            buffer);
+		packstr(config_ptr->get_sys_state,   buffer);
+		pack64(config_ptr->granularity,      buffer);
+		pack32(config_ptr->pool_cnt,         buffer);
+		for (i = 0; i < config_ptr->pool_cnt; i++) {
+			packstr(config_ptr->pool_ptr[i].name, buffer);
+			pack64(config_ptr->pool_ptr[i].total_space, buffer);
+			pack64(config_ptr->pool_ptr[i].granularity, buffer);
+			pack64(config_ptr->pool_ptr[i].used_space, buffer);
+		}
+		pack32(config_ptr->other_timeout,    buffer);
+		packstr(config_ptr->start_stage_in,  buffer);
+		packstr(config_ptr->start_stage_out, buffer);
+		packstr(config_ptr->stop_stage_in,   buffer);
+		packstr(config_ptr->stop_stage_out,  buffer);
+		pack32(config_ptr->stage_in_timeout, buffer);
+		pack32(config_ptr->stage_out_timeout,buffer);
+		pack64(state_ptr->total_space,       buffer);
+		pack64(state_ptr->used_space,        buffer);
+		pack32(config_ptr->validate_timeout, buffer);
+	} else {
+		packstr(config_ptr->allow_users_str, buffer);
+		packstr(config_ptr->create_buffer,   buffer);
+		packstr(config_ptr->default_pool,    buffer);
+		packstr(config_ptr->deny_users_str,  buffer);
+		packstr(config_ptr->destroy_buffer,  buffer);
+		pack32(config_ptr->flags,            buffer);
+		packstr(config_ptr->get_sys_state,   buffer);
+		pack64(config_ptr->granularity,      buffer);
+		pack32(config_ptr->pool_cnt,         buffer);
+		for (i = 0; i < config_ptr->pool_cnt; i++) {
+			packstr(config_ptr->pool_ptr[i].name, buffer);
+			pack64(config_ptr->pool_ptr[i].total_space, buffer);
+			pack64(config_ptr->pool_ptr[i].used_space, buffer);
+		}
+		packstr(config_ptr->start_stage_in,  buffer);
+		packstr(config_ptr->start_stage_out, buffer);
+		packstr(config_ptr->stop_stage_in,   buffer);
+		packstr(config_ptr->stop_stage_out,  buffer);
+		pack32(config_ptr->stage_in_timeout, buffer);
+		pack32(config_ptr->stage_out_timeout,buffer);
+		pack64(state_ptr->total_space,       buffer);
+		pack64(state_ptr->used_space,        buffer);
 	}
-	packstr(config_ptr->start_stage_in,  buffer);
-	packstr(config_ptr->start_stage_out, buffer);
-	packstr(config_ptr->stop_stage_in,   buffer);
-	packstr(config_ptr->stop_stage_out,  buffer);
-	pack32(config_ptr->stage_in_timeout, buffer);
-	pack32(config_ptr->stage_out_timeout,buffer);
-	pack64(state_ptr->total_space,       buffer);
-	pack64(state_ptr->used_space,        buffer);
 }
 
 /* Pack individual burst buffer usage records into a buffer (used for limits) */
@@ -879,12 +921,12 @@ extern void bb_sleep(bb_state_t *state_ptr, int add_secs)
 
 	ts.tv_sec  = tv.tv_sec + add_secs;
 	ts.tv_nsec = tv.tv_usec * 1000;
-	pthread_mutex_lock(&state_ptr->term_mutex);
+	slurm_mutex_lock(&state_ptr->term_mutex);
 	if (!state_ptr->term_flag) {
 		pthread_cond_timedwait(&state_ptr->term_cond,
 				       &state_ptr->term_mutex, &ts);
 	}
-	pthread_mutex_unlock(&state_ptr->term_mutex);
+	slurm_mutex_unlock(&state_ptr->term_mutex);
 }
 
 
@@ -895,10 +937,11 @@ extern bb_alloc_t *bb_alloc_name_rec(bb_state_t *state_ptr, char *name,
 				     uint32_t user_id)
 {
 	bb_alloc_t *bb_alloc = NULL;
+	time_t now = time(NULL);
 	int i;
 
 	xassert(state_ptr->bb_ahash);
-	state_ptr->last_update_time = time(NULL);
+	state_ptr->last_update_time = now;
 	bb_alloc = xmalloc(sizeof(bb_alloc_t));
 	i = user_id % BB_HASH_SIZE;
 	xassert((bb_alloc->magic = BB_ALLOC_MAGIC));	/* Sets value */
@@ -906,8 +949,8 @@ extern bb_alloc_t *bb_alloc_name_rec(bb_state_t *state_ptr, char *name,
 	state_ptr->bb_ahash[i] = bb_alloc;
 	bb_alloc->name = xstrdup(name);
 	bb_alloc->state = BB_STATE_ALLOCATED;
-	bb_alloc->state_time = time(NULL);
-	bb_alloc->seen_time = time(NULL);
+	bb_alloc->state_time = now;
+	bb_alloc->seen_time = now;
 	bb_alloc->user_id = user_id;
 
 	return bb_alloc;
@@ -931,21 +974,13 @@ extern bb_alloc_t *bb_alloc_job_rec(bb_state_t *state_ptr,
 	bb_alloc->array_job_id = job_ptr->array_job_id;
 	bb_alloc->array_task_id = job_ptr->array_task_id;
 	bb_alloc->assoc_ptr = job_ptr->assoc_ptr;
-	bb_alloc->gres_cnt = bb_job->gres_cnt;
-	if (bb_alloc->gres_cnt) {
-		bb_alloc->gres_ptr = xmalloc(sizeof(burst_buffer_gres_t) *
-					     bb_alloc->gres_cnt);
-	}
-	for (i = 0; i < bb_alloc->gres_cnt; i++) {
-		bb_alloc->gres_ptr[i].used_cnt = bb_job->gres_ptr[i].count;
-		bb_alloc->gres_ptr[i].name = xstrdup(bb_job->gres_ptr[i].name);
-	}
 	bb_alloc->job_id = job_ptr->job_id;
 	xassert((bb_alloc->magic = BB_ALLOC_MAGIC));	/* Sets value */
 	i = job_ptr->user_id % BB_HASH_SIZE;
 	xstrfmtcat(bb_alloc->name, "%u", job_ptr->job_id);
 	bb_alloc->next = state_ptr->bb_ahash[i];
 	bb_alloc->partition = xstrdup(bb_job->partition);
+	bb_alloc->pool = xstrdup(bb_job->job_pool);
 	bb_alloc->qos = xstrdup(bb_job->qos);
 	state_ptr->bb_ahash[i] = bb_alloc;
 	bb_alloc->size = bb_job->total_size;
@@ -966,7 +1001,8 @@ extern bb_alloc_t *bb_alloc_job(bb_state_t *state_ptr,
 	bb_alloc_t *bb_alloc;
 
 	bb_alloc = bb_alloc_job_rec(state_ptr, job_ptr, bb_job);
-	bb_limit_add(bb_alloc->user_id, bb_alloc->size, state_ptr);
+	bb_limit_add(bb_alloc->user_id, bb_alloc->size, bb_alloc->pool,
+		     state_ptr);
 
 	return bb_alloc;
 }
@@ -975,18 +1011,14 @@ extern bb_alloc_t *bb_alloc_job(bb_state_t *state_ptr,
  * maintaining linked list */
 extern void bb_free_alloc_buf(bb_alloc_t *bb_alloc)
 {
-	int i;
-
 	if (bb_alloc) {
 		xassert(bb_alloc->magic == BB_ALLOC_MAGIC);
 		bb_alloc->magic = 0;
 		xfree(bb_alloc->account);
 		xfree(bb_alloc->assocs);
-		for (i = 0; i < bb_alloc->gres_cnt; i++)
-			xfree(bb_alloc->gres_ptr[i].name);
-		xfree(bb_alloc->gres_ptr);
 		xfree(bb_alloc->name);
 		xfree(bb_alloc->partition);
+		xfree(bb_alloc->pool);
 		xfree(bb_alloc->qos);
 		xfree(bb_alloc);
 	}
@@ -1046,9 +1078,9 @@ extern int bb_proc_count(void)
 {
 	int cnt;
 
-	pthread_mutex_lock(&proc_count_mutex);
+	slurm_mutex_lock(&proc_count_mutex);
 	cnt = child_proc_count;
-	pthread_mutex_unlock(&proc_count_mutex);
+	slurm_mutex_unlock(&proc_count_mutex);
 
 	return cnt;
 }
@@ -1097,9 +1129,9 @@ extern char *bb_run_script(char *script_type, char *script_path,
 			return resp;
 		}
 	}
-	pthread_mutex_lock(&proc_count_mutex);
+	slurm_mutex_lock(&proc_count_mutex);
 	child_proc_count++;
-	pthread_mutex_unlock(&proc_count_mutex);
+	slurm_mutex_unlock(&proc_count_mutex);
 	if ((cpid = fork()) == 0) {
 		int cc;
 
@@ -1134,9 +1166,9 @@ extern char *bb_run_script(char *script_type, char *script_path,
 			close(pfd[1]);
 		}
 		error("%s: fork(): %m", __func__);
-		pthread_mutex_lock(&proc_count_mutex);
+		slurm_mutex_lock(&proc_count_mutex);
 		child_proc_count--;
-		pthread_mutex_unlock(&proc_count_mutex);
+		slurm_mutex_unlock(&proc_count_mutex);
 	} else if (max_wait != -1) {
 		struct pollfd fds;
 		struct timeval tstart;
@@ -1196,91 +1228,15 @@ extern char *bb_run_script(char *script_type, char *script_path,
 		killpg(cpid, SIGKILL);
 		waitpid(cpid, status, 0);
 		close(pfd[0]);
-		pthread_mutex_lock(&proc_count_mutex);
+		slurm_mutex_lock(&proc_count_mutex);
 		child_proc_count--;
-		pthread_mutex_unlock(&proc_count_mutex);
+		slurm_mutex_unlock(&proc_count_mutex);
 	} else {
 		waitpid(cpid, status, 0);
 	}
 	return resp;
 }
 
-static void _persist_purge(void *x)
-{
-	xfree(x);
-}
-
-static int _persist_match(void *x, void *key)
-{
-	bb_pend_persist_t *bb_pers_exist = (bb_pend_persist_t *) x;
-	bb_pend_persist_t *bb_pers_test  = (bb_pend_persist_t *) key;
-	if (bb_pers_exist->job_id == bb_pers_test->job_id)
-		return 1;
-	return 0;
-}
-
-/* Add persistent burst buffer reservation for this job, tests for duplicate */
-extern void bb_add_persist(bb_state_t *state_ptr,
-			   bb_pend_persist_t *bb_persist)
-{
-	bb_pend_persist_t *bb_pers_match;
-
-	xassert(state_ptr);
-	if (!state_ptr->persist_resv_rec) {
-		state_ptr->persist_resv_rec = list_create(_persist_purge);
-	} else {
-		bb_pers_match = list_find_first(state_ptr->persist_resv_rec,
-						_persist_match, bb_persist);
-		if (bb_pers_match)
-			return;
-	}
-
-	bb_pers_match = xmalloc(sizeof(bb_pend_persist_t));
-	bb_pers_match->job_id = bb_persist->job_id;
-	bb_pers_match->persist_add = bb_persist->persist_add;
-	list_append(state_ptr->persist_resv_rec, bb_pers_match);
-	state_ptr->persist_resv_sz += bb_persist->persist_add;
-}
-
-/* Remove persistent burst buffer reservation for this job.
- * Call when job starts running or removed from pending state. */
-extern void bb_rm_persist(bb_state_t *state_ptr, uint32_t job_id)
-{
-	bb_pend_persist_t  bb_persist;
-	bb_pend_persist_t *bb_pers_match;
-
-	xassert(state_ptr);
-	if (!state_ptr->persist_resv_rec)
-		return;
-	bb_persist.job_id = job_id;
-	bb_pers_match = list_find_first(state_ptr->persist_resv_rec,
-					_persist_match, &bb_persist);
-	if (!bb_pers_match)
-		return;
-	if (state_ptr->persist_resv_sz >= bb_pers_match->persist_add) {
-		state_ptr->persist_resv_sz -= bb_pers_match->persist_add;
-	} else {
-		state_ptr->persist_resv_sz = 0;
-		error("%s: Reserved persistent storage size underflow",
-		      __func__);
-	}
-}
-
-/* Return true of the identified job has burst buffer space already reserved */
-extern bool bb_test_persist(bb_state_t *state_ptr, uint32_t job_id)
-{
-	bb_pend_persist_t bb_pers_match;
-
-	xassert(state_ptr);
-	if (!state_ptr->persist_resv_rec)
-		return false;
-	bb_pers_match.job_id = job_id;
-	if (list_find_first(state_ptr->persist_resv_rec, _persist_match,
-			    &bb_pers_match))
-		return true;
-	return false;
-}
-
 /* Allocate a bb_job_t record, hashed by job_id, delete with bb_job_del() */
 extern bb_job_t *bb_job_alloc(bb_state_t *state_ptr, uint32_t job_id)
 {
@@ -1351,12 +1307,11 @@ static void _bb_job_del2(bb_job_t *bb_job)
 		for (i = 0; i < bb_job->buf_cnt; i++) {
 			xfree(bb_job->buf_ptr[i].access);
 			xfree(bb_job->buf_ptr[i].name);
+			xfree(bb_job->buf_ptr[i].pool);
 			xfree(bb_job->buf_ptr[i].type);
 		}
 		xfree(bb_job->buf_ptr);
-		for (i = 0; i < bb_job->gres_cnt; i++)
-			xfree(bb_job->gres_ptr[i].name);
-		xfree(bb_job->gres_ptr);
+		xfree(bb_job->job_pool);
 		xfree(bb_job->partition);
 		xfree(bb_job->qos);
 		xfree(bb_job);
@@ -1373,11 +1328,6 @@ extern void bb_job_log(bb_state_t *state_ptr, bb_job_t *bb_job)
 	if (bb_job) {
 		xstrfmtcat(out_buf, "%s: Job:%u UserID:%u ",
 			   state_ptr->name, bb_job->job_id, bb_job->user_id);
-		for (i = 0; i < bb_job->gres_cnt; i++) {
-			xstrfmtcat(out_buf, "Gres[%d]:%s:%"PRIu64" ",
-				   i, bb_job->gres_ptr[i].name,
-				   bb_job->gres_ptr[i].count);
-		}
 		xstrfmtcat(out_buf, "Swap:%ux%u ", bb_job->swap_size,
 			   bb_job->swap_nodes);
 		xstrfmtcat(out_buf, "TotalSize:%"PRIu64"", bb_job->total_size);
@@ -1386,10 +1336,11 @@ extern void bb_job_log(bb_state_t *state_ptr, bb_job_t *bb_job)
 		for (i = 0, buf_ptr = bb_job->buf_ptr; i < bb_job->buf_cnt;
 		     i++, buf_ptr++) {
 			if (buf_ptr->create) {
-				info("  Create  Name:%s Size:%"PRIu64
+				info("  Create  Name:%s Pool:%s Size:%"PRIu64
 				     " Access:%s Type:%s State:%s",
-				     buf_ptr->name, buf_ptr->size,
-				     buf_ptr->access, buf_ptr->type,
+				     buf_ptr->name, buf_ptr->pool,
+				     buf_ptr->size, buf_ptr->access,
+				     buf_ptr->type,
 				     bb_state_string(buf_ptr->state));
 			} else if (buf_ptr->destroy) {
 				info("  Destroy Name:%s Hurry:%d",
@@ -1402,12 +1353,26 @@ extern void bb_job_log(bb_state_t *state_ptr, bb_job_t *bb_job)
 }
 
 /* Make claim against resource limit for a user */
-extern void bb_limit_add(
-	uint32_t user_id, uint64_t bb_size, bb_state_t *state_ptr)
+extern void bb_limit_add(uint32_t user_id, uint64_t bb_size, char *pool,
+			 bb_state_t *state_ptr)
 {
+	burst_buffer_pool_t *pool_ptr;
 	bb_user_t *bb_user;
+	int i;
 
-	state_ptr->used_space += bb_size;
+	if (!pool || !xstrcmp(pool, state_ptr->bb_config.default_pool)) {
+		state_ptr->used_space += bb_size;
+	} else {
+		pool_ptr = state_ptr->bb_config.pool_ptr;
+		for (i = 0; i < state_ptr->bb_config.pool_cnt; i++, pool_ptr++){
+			if (xstrcmp(pool, pool_ptr->name))
+				continue;
+			pool_ptr->used_space += bb_size;
+			break;
+		}
+		if (i >= state_ptr->bb_config.pool_cnt)
+			error("%s: Unable to located pool %s", __func__, pool);
+	}
 
 	bb_user = bb_find_user_rec(user_id, state_ptr);
 	xassert(bb_user);
@@ -1416,16 +1381,36 @@ extern void bb_limit_add(
 }
 
 /* Release claim against resource limit for a user */
-extern void bb_limit_rem(
-	uint32_t user_id, uint64_t bb_size, bb_state_t *state_ptr)
+extern void bb_limit_rem(uint32_t user_id, uint64_t bb_size, char *pool,
+			 bb_state_t *state_ptr)
 {
+	burst_buffer_pool_t *pool_ptr;
 	bb_user_t *bb_user;
+	int i;
 
-	if (state_ptr->used_space >= bb_size) {
-		state_ptr->used_space -= bb_size;
+	if (!pool || !xstrcmp(pool, state_ptr->bb_config.default_pool)) {
+		if (state_ptr->used_space >= bb_size) {
+			state_ptr->used_space -= bb_size;
+		} else {
+			error("%s: used_space underflow", __func__);
+			state_ptr->used_space = 0;
+		}
 	} else {
-		error("%s: used_space underflow", __func__);
-		state_ptr->used_space = 0;
+		pool_ptr = state_ptr->bb_config.pool_ptr;
+		for (i = 0; i < state_ptr->bb_config.pool_cnt; i++, pool_ptr++){
+			if (xstrcmp(pool, pool_ptr->name))
+				continue;
+			if (pool_ptr->used_space >= bb_size) {
+				pool_ptr->used_space -= bb_size;
+			} else {
+				error("%s: used_space underflow for pool %s",
+				      __func__, pool);
+				pool_ptr->used_space = 0;
+			}
+			break;
+		}
+		if (i >= state_ptr->bb_config.pool_cnt)
+			error("%s: Unable to located pool %s", __func__, pool);
 	}
 
 	bb_user = bb_find_user_rec(user_id, state_ptr);
@@ -1476,7 +1461,7 @@ extern int bb_post_persist_create(struct job_record *job_ptr,
 		while (assoc_ptr) {
 			assoc_ptr->usage->grp_used_tres[state_ptr->tres_pos] +=
 				size_mb;
-			debug2("%s: after adding persisant bb %s(%u), "
+			debug2("%s: after adding persistant bb %s(%u), "
 			       "assoc %u(%s/%s/%s) grp_used_tres(%s) "
 			       "is %"PRIu64,
 			       __func__, bb_alloc->name, bb_alloc->id,
@@ -1489,7 +1474,7 @@ extern int bb_post_persist_create(struct job_record *job_ptr,
 			/* FIXME: should grp_used_tres_run_secs be
 			 * done some how? Same for QOS below.
 			 */
-			/* debug2("%s: after adding persisant bb %s(%u), " */
+			/* debug2("%s: after adding persistant bb %s(%u), " */
 			/*        "assoc %u(%s/%s/%s) grp_used_tres_run_secs(%s) " */
 			/*        "is %"PRIu64, */
 			/*        __func__, bb_alloc->name, bb_alloc->id, */
@@ -1548,7 +1533,7 @@ extern int bb_post_persist_delete(bb_alloc_t *bb_alloc, bb_state_t *state_ptr)
 			    >= size_mb) {
 				assoc_ptr->usage->grp_used_tres[
 					state_ptr->tres_pos] -= size_mb;
-				debug2("%s: after removing persisant "
+				debug2("%s: after removing persistant "
 				       "bb %s(%u), assoc %u(%s/%s/%s) "
 				       "grp_used_tres(%s) is %"PRIu64,
 				       __func__, bb_alloc->name, bb_alloc->id,
@@ -1559,7 +1544,7 @@ extern int bb_post_persist_delete(bb_alloc_t *bb_alloc, bb_state_t *state_ptr)
 				       assoc_ptr->usage->
 				       grp_used_tres[state_ptr->tres_pos]);
 			} else {
-				error("%s: underflow removing persisant "
+				error("%s: underflow removing persistant "
 				      "bb %s(%u), assoc %u(%s/%s/%s) "
 				      "grp_used_tres(%s) had %"PRIu64
 				      " but we are trying to remove %"PRIu64,
@@ -1577,7 +1562,7 @@ extern int bb_post_persist_delete(bb_alloc_t *bb_alloc, bb_state_t *state_ptr)
 
 			/* FIXME: should grp_used_tres_run_secs be
 			 * done some how? Same for QOS below. */
-			/* debug2("%s: after removing persisant bb %s(%u), " */
+			/* debug2("%s: after removing persistant bb %s(%u), " */
 			/*        "assoc %u(%s/%s/%s) grp_used_tres_run_secs(%s) " */
 			/*        "is %"PRIu64, */
 			/*        __func__, bb_alloc->name, bb_alloc->id, */
@@ -1602,3 +1587,24 @@ extern int bb_post_persist_delete(bb_alloc_t *bb_alloc, bb_state_t *state_ptr)
 
 	return rc;
 }
+
+/* Determine if the specified pool name is valid on this system */
+extern bool bb_valid_pool_test(bb_state_t *state_ptr, char *pool_name)
+{
+	burst_buffer_pool_t *pool_ptr;
+	int i;
+
+	xassert(state_ptr);
+	if (!pool_name)
+		return true;
+	if (!xstrcmp(pool_name, state_ptr->bb_config.default_pool))
+		return true;
+	pool_ptr = state_ptr->bb_config.pool_ptr;
+	for (i = 0; i < state_ptr->bb_config.pool_cnt; i++, pool_ptr++) {
+		if (!xstrcmp(pool_name, pool_ptr->name))
+			return true;
+	}
+	info("%s: Invalid pool requested (%s)", __func__, pool_name);
+
+	return false;
+}
diff --git a/src/plugins/burst_buffer/common/burst_buffer_common.h b/src/plugins/burst_buffer/common/burst_buffer_common.h
index 845cde2c2..c0a4eb506 100644
--- a/src/plugins/burst_buffer/common/burst_buffer_common.h
+++ b/src/plugins/burst_buffer/common/burst_buffer_common.h
@@ -75,8 +75,8 @@ typedef struct bb_config {
 	char    *get_sys_state;
 	uint64_t granularity;		/* space allocation granularity,
 					 * units are GB */
-	uint32_t gres_cnt;		/* Count of records in gres_ptr */
-	burst_buffer_gres_t *gres_ptr;	/* Type is defined in slurm.h */
+	uint32_t pool_cnt;		/* Count of records in pool_ptr */
+	burst_buffer_pool_t *pool_ptr;	/* Type is defined in slurm.h */
 	uint32_t other_timeout;
 	uint32_t stage_in_timeout;
 	uint32_t stage_out_timeout;
@@ -99,8 +99,6 @@ typedef struct bb_alloc {
 	bool cancelled;
 	time_t create_time;	/* Time of creation */
 	time_t end_time;	/* Expected time when use will end */
-	uint32_t gres_cnt;	/* Count of records in gres_ptr */
-	burst_buffer_gres_t *gres_ptr;
 	uint32_t id;		/* ID for reservation/accounting */
 	uint32_t job_id;
 	uint32_t magic;
@@ -108,6 +106,7 @@ typedef struct bb_alloc {
 	struct bb_alloc *next;
 	bool orphaned;		/* Job is purged, could not stage-out data */
 	char *partition;	/* Associated partition (for limits) */
+	char *pool;		/* Resource (pool) used */
 	char *qos;		/* Associated QOS (for limits) */
 	slurmdb_qos_rec_t *qos_ptr;
 	time_t seen_time;	/* Time buffer last seen */
@@ -134,19 +133,13 @@ typedef struct {
 	bool     destroy;	/* Set if buffer destroy requested */
 	bool     hurry;		/* Fast buffer destroy */
 	char    *name;		/* Buffer name, non-numeric for persistent */
+	char    *pool;		/* Pool in which to create buffer */
 	uint64_t size;		/* Buffer size in bytes */
 	uint16_t state;		/* Buffer state, see BB_STATE_* in slurm.h.in */
 	char    *type;		/* Buffer type */
+	bool     use;		/* Set if persistent buffer use requested */
 } bb_buf_t;
 
-/* Generic burst buffer resources. Information about this is found in the Cray
- * documentation, but the logic in Slurm is untested and the functionality may
- * never be used. */
-typedef struct {
-	char *   name;		/* Generic burst buffer resource, e.g. "nodes" */
-	uint64_t count;		/* Count of required resources */
-} bb_gres_t;
-
 /* Burst buffer resources required for a job, based upon a job record's
  * burst_buffer string field */
 #define BB_JOB_MAGIC		0xDEAD3412
@@ -154,9 +147,8 @@ typedef struct bb_job {
 	char      *account;	/* Associated account (for limits) */
 	uint32_t   buf_cnt;	/* Number of records in buf_ptr */
 	bb_buf_t  *buf_ptr;	/* Buffer creation records */
-	uint32_t   gres_cnt;	/* number of records in gres_ptr */
-	bb_gres_t *gres_ptr;
 	uint32_t   job_id;
+	char      *job_pool;	/* Pool in which to create job buffers */
 	uint32_t   magic;
 	struct bb_job *next;
 	char      *partition;	/* Associated partition (for limits) */
@@ -171,12 +163,6 @@ typedef struct bb_job {
 	uint32_t   user_id;	/* user the job runs as */
 } bb_job_t;
 
-/* Persistent buffer requests which are pending */
-typedef struct {
-	uint32_t   job_id;
-	uint64_t   persist_add;	/* Persistent buffer space job adds, bytes */
-} bb_pend_persist_t;
-
 /* Used for building queue of jobs records for various purposes */
 typedef struct bb_job_queue_rec {
 	uint64_t bb_size;	/* Used by generic plugin only */
@@ -188,6 +174,7 @@ typedef struct bb_job_queue_rec {
 struct preempt_bb_recs {
 	bb_alloc_t *bb_ptr;
 	uint32_t job_id;
+	char *pool;
 	uint64_t size;
 	time_t   use_time;
 	uint32_t user_id;
@@ -216,10 +203,6 @@ typedef struct bb_state {
 	uint64_t	used_space;	/* units are bytes */
 } bb_state_t;
 
-/* Add persistent burst buffer reservation for this job, tests for duplicate */
-extern void bb_add_persist(bb_state_t *state_ptr,
-			   bb_pend_persist_t *bb_persist);
-
 /* Allocate burst buffer hash tables */
 extern void bb_alloc_cache(bb_state_t *state_ptr);
 
@@ -306,7 +289,7 @@ extern int bb_job_queue_sort(void *x, void *y);
 /* Load and process configuration parameters */
 extern void bb_load_config(bb_state_t *state_ptr, char *plugin_type);
 
-/* Pack individual burst buffer records into a  buffer */
+/* Pack individual burst buffer records into a buffer */
 extern int bb_pack_bufs(uid_t uid, bb_state_t *state_ptr, Buf buffer,
 			uint16_t protocol_version);
 
@@ -324,10 +307,6 @@ extern int bb_preempt_queue_sort(void *x, void *y);
 /* Return count of child processes */
 extern int bb_proc_count(void);
 
-/* Remove persistent burst buffer reservation for this job.
- * Call when job starts running or removed from pending state. */
-extern void bb_rm_persist(bb_state_t *state_ptr, uint32_t job_id);
-
 /* Set the bb_state's tres_pos for limit enforcement.
  * Value is set to -1 if not found. */
 extern void bb_set_tres_pos(bb_state_t *state_ptr);
@@ -342,9 +321,6 @@ extern void bb_shutdown(void);
 /* Sleep function, also handles termination signal */
 extern void bb_sleep(bb_state_t *state_ptr, int add_secs);
 
-/* Return true of the identified job has burst buffer space already reserved */
-extern bool bb_test_persist(bb_state_t *state_ptr, uint32_t job_id);
-
 /* Execute a script, wait for termination and return its stdout.
  * script_type IN - Type of program being run (e.g. "StartStageIn")
  * script_path IN - Fully qualified pathname of the program to execute
@@ -357,12 +333,12 @@ extern char *bb_run_script(char *script_type, char *script_path,
 			   char **script_argv, int max_wait, int *status);
 
 /* Make claim against resource limit for a user */
-extern void bb_limit_add(
-	uint32_t user_id, uint64_t bb_size, bb_state_t *state_ptr);
+extern void bb_limit_add(uint32_t user_id, uint64_t bb_size, char *pool,
+			 bb_state_t *state_ptr);
 
 /* Release claim against resource limit for a user */
-extern void bb_limit_rem(
-	uint32_t user_id, uint64_t bb_size, bb_state_t *state_ptr);
+extern void bb_limit_rem(uint32_t user_id, uint64_t bb_size, char *pool,
+			 bb_state_t *state_ptr);
 
 /* Log creation of a persistent burst buffer in the database
  * job_ptr IN - Point to job that created, could be NULL at startup
@@ -374,4 +350,8 @@ extern int bb_post_persist_create(struct job_record *job_ptr,
 
 /* Log deletion of a persistent burst buffer in the database */
 extern int bb_post_persist_delete(bb_alloc_t *bb_alloc, bb_state_t *state_ptr);
+
+/* Determine if the specified pool name is valid on this system */
+extern bool bb_valid_pool_test(bb_state_t *state_ptr, char *pool_name);
+
 #endif	/* __BURST_BUFFER_COMMON_H__ */
diff --git a/src/plugins/burst_buffer/cray/Makefile.in b/src/plugins/burst_buffer/cray/Makefile.in
index 8c28bc4f4..ca01fbcf2 100644
--- a/src/plugins/burst_buffer/cray/Makefile.in
+++ b/src/plugins/burst_buffer/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/burst_buffer/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -257,8 +258,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -358,6 +357,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -396,6 +399,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -439,6 +445,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -489,6 +498,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/burst_buffer/cray/burst_buffer_cray.c b/src/plugins/burst_buffer/cray/burst_buffer_cray.c
index e93324f8d..650e84ffc 100644
--- a/src/plugins/burst_buffer/cray/burst_buffer_cray.c
+++ b/src/plugins/burst_buffer/cray/burst_buffer_cray.c
@@ -57,6 +57,7 @@
 #include "src/common/assoc_mgr.h"
 #include "src/common/fd.h"
 #include "src/common/list.h"
+#include "src/common/macros.h"
 #include "src/common/pack.h"
 #include "src/common/parse_config.h"
 #include "src/common/slurm_protocol_api.h"
@@ -74,6 +75,7 @@
 #include "src/slurmctld/state_save.h"
 #include "src/plugins/burst_buffer/common/burst_buffer_common.h"
 
+#define _DEBUG 0	/* Detailed debugging information */
 #define TIME_SLOP 5	/* time allowed to synchronize operations between
 			 * threads */
 /*
@@ -169,23 +171,20 @@ typedef struct {
 typedef struct {
 	char   **args1;
 	char   **args2;
+	uint64_t bb_size;
 	uint32_t job_id;
+	char    *pool;
 	uint32_t timeout;
 	uint32_t user_id;
 } stage_args_t;
 
-typedef struct {		/* Used for scheduling */
-	char *   name;		/* BB GRES name, e.g. "nodes" */
-	uint64_t add_cnt;	/* Additional GRES required */
-	uint64_t avail_cnt;	/* Additional GRES available */
-} needed_gres_t;
-
 typedef struct create_buf_data {
 	char *access;		/* Access mode */
 	bool hurry;		/* Set to destroy in a hurry (no stage-out) */
 	uint32_t job_id;	/* Job ID to use */
 	char *job_script;	/* Path to job script */
 	char *name;		/* Name of the persistent burst buffer */
+	char *pool;		/* Name of pool in which to create the buffer */
 	uint64_t size;		/* Size in bytes */
 	char *type;		/* Access type */
 	uint32_t user_id;
@@ -415,9 +414,9 @@ static void *_bb_agent(void *args)
 		if (!bb_state.term_flag) {
 			_load_state(false);	/* Has own locking */
 			lock_slurmctld(job_write_lock);
-			pthread_mutex_lock(&bb_state.bb_mutex);
+			slurm_mutex_lock(&bb_state.bb_mutex);
 			_timeout_bb_rec();
-			pthread_mutex_unlock(&bb_state.bb_mutex);
+			slurm_mutex_unlock(&bb_state.bb_mutex);
 			unlock_slurmctld(job_write_lock);
 		}
 		_save_bb_state();	/* Has own locks excluding file write */
@@ -426,12 +425,38 @@ static void *_bb_agent(void *args)
 	return NULL;
 }
 
+/* Given a request size and a pool name (or NULL name for default pool),
+ * return the required buffer size (rounded up by granularity) */
+static uint64_t _set_granularity(uint64_t orig_size, char *bb_pool)
+{
+	burst_buffer_pool_t *pool_ptr;
+	uint64_t new_size;
+	int i;
+
+	if (!bb_pool || !xstrcmp(bb_pool, bb_state.bb_config.default_pool)) {
+		new_size = bb_granularity(orig_size,
+					  bb_state.bb_config.granularity);
+		return new_size;
+	}
+
+	for (i = 0, pool_ptr = bb_state.bb_config.pool_ptr;
+	     i < bb_state.bb_config.pool_cnt; i++, pool_ptr++) {
+		if (!xstrcmp(bb_pool, pool_ptr->name)) {
+			new_size = bb_granularity(orig_size,
+						  pool_ptr->granularity);
+			return new_size;
+		}
+	}
+	debug("Could not find pool %s", bb_pool);
+	return orig_size;
+}
+
 /* Return the burst buffer size specification of a job
  * RET size data structure or NULL of none found
  * NOTE: delete return value using _del_bb_size() */
 static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 {
-	char *bb_specs, *bb_hurry, *bb_name, *bb_type, *bb_access;
+	char *bb_specs, *bb_hurry, *bb_name, *bb_type, *bb_access, *bb_pool;
 	char *end_ptr = NULL, *save_ptr = NULL, *sub_tok, *tok;
 	bool have_bb = false;
 	uint64_t tmp_cnt;
@@ -463,10 +488,11 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 			tok += 3;
 			while (isspace(tok[0]))
 				tok++;
-			if (!strncmp(tok, "create_persistent", 17)) {
+			if (!xstrncmp(tok, "create_persistent", 17)) {
 				have_bb = true;
 				bb_access = NULL;
 				bb_name = NULL;
+				bb_pool = NULL;
 				bb_type = NULL;
 				if ((sub_tok = strstr(tok, "access_mode="))) {
 					bb_access = xstrdup(sub_tok + 12);
@@ -480,9 +506,7 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 						sub_tok[0] = '\0';
 				}
 				if ((sub_tok = strstr(tok, "capacity="))) {
-					tmp_cnt = bb_get_size_num(
-						sub_tok + 9,
-						bb_state.bb_config.granularity);
+					tmp_cnt = bb_get_size_num(sub_tok+9, 1);
 				} else {
 					tmp_cnt = 0;
 				}
@@ -492,6 +516,15 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 					if (sub_tok)
 						sub_tok[0] = '\0';
 				}
+				if ((sub_tok = strstr(tok, "pool="))) {
+					bb_pool = xstrdup(sub_tok + 5);
+					sub_tok = strchr(bb_pool, ' ');
+					if (sub_tok)
+						sub_tok[0] = '\0';
+				} else {
+					bb_pool = xstrdup(
+						bb_state.bb_config.default_pool);
+				}
 				if ((sub_tok = strstr(tok, "type="))) {
 					bb_type = xstrdup(sub_tok + 5);
 					sub_tok = strchr(bb_type, ' ');
@@ -506,12 +539,15 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 				bb_job->buf_ptr[inx].create = true;
 				//bb_job->buf_ptr[inx].hurry = false;
 				bb_job->buf_ptr[inx].name = bb_name;
+				bb_job->buf_ptr[inx].pool = bb_pool;
+				tmp_cnt = _set_granularity(tmp_cnt, bb_pool);
 				bb_job->buf_ptr[inx].size = tmp_cnt;
 				bb_job->buf_ptr[inx].state = BB_STATE_PENDING;
 				bb_job->buf_ptr[inx].type = bb_type;
+				//bb_job->buf_ptr[inx].use = false;
 				bb_job->persist_add += tmp_cnt;
-			} else if (!strncmp(tok, "destroy_persistent", 17) ||
-				   !strncmp(tok, "delete_persistent", 16)) {
+			} else if (!xstrncmp(tok, "destroy_persistent", 17) ||
+				   !xstrncmp(tok, "delete_persistent", 16)) {
 				have_bb = true;
 				bb_name = NULL;
 				if ((sub_tok = strstr(tok, "name="))) {
@@ -536,9 +572,11 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 				bb_job->buf_ptr[inx].destroy = true;
 				bb_job->buf_ptr[inx].hurry = (bb_hurry != NULL);
 				bb_job->buf_ptr[inx].name = xstrdup(bb_name);
+				//bb_job->buf_ptr[inx].pool = NULL;
 				//bb_job->buf_ptr[inx].size = 0;
 				bb_job->buf_ptr[inx].state = BB_STATE_PENDING;
 				//bb_job->buf_ptr[inx].type = NULL;
+				//bb_job->buf_ptr[inx].use = false;
 			} else {
 				/* Ignore other (future) options */
 			}
@@ -546,17 +584,28 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 			tok += 3;
 			while (isspace(tok[0]))
 				tok++;
-			if (!strncmp(tok, "jobdw", 5)) {
+			if (!xstrncmp(tok, "jobdw", 5)) {
 				have_bb = true;
 				if ((sub_tok = strstr(tok, "capacity="))) {
-					tmp_cnt = bb_get_size_num(
-						sub_tok + 9,
-						bb_state.bb_config.granularity);
+					tmp_cnt = bb_get_size_num(sub_tok+9, 1);
 				} else {
 					tmp_cnt = 0;
 				}
+				if ((sub_tok = strstr(tok, "pool="))) {
+					xfree(bb_job->job_pool);
+					bb_job->job_pool = xstrdup(sub_tok + 5);
+					sub_tok = strchr(bb_job->job_pool, ' ');
+					if (sub_tok)
+						sub_tok[0] = '\0';
+				} else {
+					bb_job->job_pool = xstrdup(
+						bb_state.bb_config.default_pool);
+				}
+				tmp_cnt = _set_granularity(tmp_cnt,
+							   bb_job->job_pool);
 				bb_job->total_size += tmp_cnt;
-			} else if (!strncmp(tok, "persistentdw", 12)) {
+			} else if (!xstrncmp(tok, "persistentdw", 12)) {
+				/* Persistent buffer use */
 				have_bb = true;
 				bb_name = NULL;
 				if ((sub_tok = strstr(tok, "name="))) {
@@ -577,7 +626,8 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 				//bb_job->buf_ptr[inx].size = 0;
 				bb_job->buf_ptr[inx].state = BB_STATE_PENDING;
 				//bb_job->buf_ptr[inx].type = NULL;
-			} else if (!strncmp(tok, "swap", 4)) {
+				bb_job->buf_ptr[inx].use = true;
+			} else if (!xstrncmp(tok, "swap", 4)) {
 				have_bb = true;
 				tok += 4;
 				while (isspace(tok[0]))
@@ -595,8 +645,19 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 				}
 				tmp_cnt = bb_job->swap_size *
 					  bb_job->swap_nodes;
-				bb_job->total_size += bb_granularity(tmp_cnt,
-					 bb_state.bb_config.granularity);
+				if ((sub_tok = strstr(tok, "pool="))) {
+					xfree(bb_job->job_pool);
+					bb_job->job_pool = xstrdup(sub_tok + 5);
+					sub_tok = strchr(bb_job->job_pool, ' ');
+					if (sub_tok)
+						sub_tok[0] = '\0';
+				} else {
+					bb_job->job_pool = xstrdup(
+						bb_state.bb_config.default_pool);
+				}
+				tmp_cnt = _set_granularity(tmp_cnt,
+							   bb_job->job_pool);
+				bb_job->total_size += tmp_cnt;
 			} else {
 				/* Ignore stage-in, stage-out, etc. */
 			}
@@ -617,6 +678,8 @@ static bb_job_t *_get_bb_job(struct job_record *job_ptr)
 		bb_job_del(&bb_state, job_ptr->job_id);
 		return NULL;
 	}
+	if (!bb_job->job_pool)
+		bb_job->job_pool = xstrdup(bb_state.bb_config.default_pool);
 	if (bb_state.bb_config.debug_flag)
 		bb_job_log(&bb_state, bb_job);
 	return bb_job;
@@ -633,8 +696,8 @@ static void _apply_limits(void)
 		bb_alloc = bb_state.bb_ahash[i];
 		while (bb_alloc) {
 			_set_assoc_mgr_ptrs(bb_alloc);
-			bb_limit_add(bb_alloc->user_id,
-				     bb_alloc->size, &bb_state);
+			bb_limit_add(bb_alloc->user_id, bb_alloc->size,
+				     bb_alloc->pool, &bb_state);
 			bb_alloc = bb_alloc->next;
 		}
 	}
@@ -654,7 +717,7 @@ static void _save_bb_state(void)
 	char *old_file = NULL, *new_file = NULL, *reg_file = NULL;
 	int i, count_offset, offset, state_fd;
 	int error_code = 0;
-	uint16_t protocol_version = SLURM_15_08_PROTOCOL_VERSION;
+	uint16_t protocol_version = SLURM_PROTOCOL_VERSION;
 
 	if ((bb_state.last_update_time <= last_save_time) &&
 	    !bb_state.term_flag)
@@ -667,7 +730,7 @@ static void _save_bb_state(void)
 	count_offset = get_buf_offset(buffer);
 	pack32(rec_count, buffer);
 	if (bb_state.bb_ahash) {
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		for (i = 0; i < BB_HASH_SIZE; i++) {
 			bb_alloc = bb_state.bb_ahash[i];
 			while (bb_alloc) {
@@ -677,6 +740,7 @@ static void _save_bb_state(void)
 					pack32(bb_alloc->id,		buffer);
 					packstr(bb_alloc->name,		buffer);
 					packstr(bb_alloc->partition,	buffer);
+					packstr(bb_alloc->pool,		buffer);
 					packstr(bb_alloc->qos,		buffer);
 					pack32(bb_alloc->user_id,	buffer);
 					if (bb_state.bb_config.flags &
@@ -688,7 +752,7 @@ static void _save_bb_state(void)
 			}
 		}
 		save_time = time(NULL);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		offset = get_buf_offset(buffer);
 		set_buf_offset(buffer, count_offset);
 		pack32(rec_count, buffer);
@@ -790,7 +854,8 @@ static void _recover_bb_state(void)
 	uint32_t id = 0, user_id = 0;
 	uint64_t size = 0;
 	int i, state_fd;
-	char *account = NULL, *name = NULL, *partition = NULL, *qos = NULL;
+	char *account = NULL, *name = NULL;
+	char *partition = NULL, *pool = NULL, *qos = NULL;
 	char *end_ptr = NULL;
 	time_t create_time = 0;
 	bb_alloc_t *bb_alloc;
@@ -834,15 +899,29 @@ static void _recover_bb_state(void)
 
 	safe_unpack32(&rec_count, buffer);
 	for (i = 0; i < rec_count; i++) {
-		safe_unpackstr_xmalloc(&account,   &name_len, buffer);
-		safe_unpack_time(&create_time, buffer);
-		safe_unpack32(&id, buffer);
-		safe_unpackstr_xmalloc(&name,      &name_len, buffer);
-		safe_unpackstr_xmalloc(&partition, &name_len, buffer);
-		safe_unpackstr_xmalloc(&qos,       &name_len, buffer);
-		safe_unpack32(&user_id, buffer);
-		if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
-			safe_unpack64(&size, buffer);
+		if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+			safe_unpackstr_xmalloc(&account,   &name_len, buffer);
+			safe_unpack_time(&create_time, buffer);
+			safe_unpack32(&id, buffer);
+			safe_unpackstr_xmalloc(&name,      &name_len, buffer);
+			safe_unpackstr_xmalloc(&partition, &name_len, buffer);
+			safe_unpackstr_xmalloc(&pool,      &name_len, buffer);
+			safe_unpackstr_xmalloc(&qos,       &name_len, buffer);
+			safe_unpack32(&user_id, buffer);
+			if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
+				safe_unpack64(&size, buffer);
+		} else {
+			safe_unpackstr_xmalloc(&account,   &name_len, buffer);
+			safe_unpack_time(&create_time, buffer);
+			safe_unpack32(&id, buffer);
+			safe_unpackstr_xmalloc(&name,      &name_len, buffer);
+			safe_unpackstr_xmalloc(&partition, &name_len, buffer);
+			safe_unpackstr_xmalloc(&qos,       &name_len, buffer);
+			safe_unpack32(&user_id, buffer);
+			if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
+				safe_unpack64(&size, buffer);
+			pool = xstrdup(bb_state.bb_config.default_pool);
+		}
 
 		if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY) {
 			bb_alloc = bb_alloc_name_rec(&bb_state, name, user_id);
@@ -870,6 +949,9 @@ static void _recover_bb_state(void)
 			xfree(bb_alloc->partition);
 			bb_alloc->partition = partition;
 			partition = NULL;
+			xfree(bb_alloc->pool);
+			bb_alloc->pool = pool;
+			pool = NULL;
 			xfree(bb_alloc->qos);
 			bb_alloc->qos = qos;
 			qos = NULL;
@@ -877,6 +959,7 @@ static void _recover_bb_state(void)
 		xfree(account);
 		xfree(name);
 		xfree(partition);
+		xfree(pool);
 		xfree(qos);
 	}
 
@@ -998,7 +1081,7 @@ static void _set_assoc_mgr_ptrs(bb_alloc_t *bb_alloc)
  */
 static void _load_state(bool init_config)
 {
-	burst_buffer_gres_t *gres_ptr;
+	burst_buffer_pool_t *pool_ptr;
 	bb_configs_t *configs;
 	bb_instances_t *instances;
 	bb_pools_t *pools;
@@ -1012,13 +1095,14 @@ static void _load_state(bool init_config)
 	uint64_t used_space;
 	assoc_mgr_lock_t assoc_locks = { READ_LOCK, NO_LOCK, READ_LOCK, NO_LOCK,
 					 NO_LOCK, NO_LOCK, NO_LOCK };
+	bool found_pool;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.other_timeout)
 		timeout = bb_state.bb_config.other_timeout * 1000;
 	else
 		timeout = DEFAULT_OTHER_TIMEOUT * 1000;
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	/*
 	 * Load the pools information
@@ -1030,7 +1114,7 @@ static void _load_state(bool init_config)
 		return;
 	}
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (!bb_state.bb_config.default_pool && (num_pools > 0)) {
 		info("%s: Setting DefaultPool to %s", __func__, pools[0].id);
 		bb_state.bb_config.default_pool = xstrdup(pools[0].id);
@@ -1038,11 +1122,11 @@ static void _load_state(bool init_config)
 
 	for (i = 0; i < num_pools; i++) {
 		/* ID: "bytes" */
-		if (strcmp(pools[i].id, bb_state.bb_config.default_pool) == 0) {
-			bb_state.bb_config.granularity
-				= pools[i].granularity;
-			bb_state.total_space
-				= pools[i].quantity * pools[i].granularity;
+		if (xstrcmp(pools[i].id,
+			    bb_state.bb_config.default_pool) == 0) {
+			bb_state.bb_config.granularity = pools[i].granularity;
+			bb_state.total_space = pools[i].quantity *
+					       pools[i].granularity;
 			if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
 				continue;
 			/* Don't decrease used_space in case buffer allocation
@@ -1053,29 +1137,41 @@ static void _load_state(bool init_config)
 						  used_space);
 
 			/* Everything else is an alternate pool */
-			bb_state.bb_config.gres_cnt = 0;
-		} else {
-			bb_state.bb_config.gres_ptr
-				= xrealloc(bb_state.bb_config.gres_ptr,
-					   sizeof(burst_buffer_gres_t) *
-					   (bb_state.bb_config.gres_cnt + 1));
-			gres_ptr = bb_state.bb_config.gres_ptr +
-				bb_state.bb_config.gres_cnt;
-			bb_state.bb_config.gres_cnt++;
-			gres_ptr->avail_cnt =
-				pools[i].quantity * pools[i].granularity;
-			gres_ptr->granularity = pools[i].granularity;
-			gres_ptr->name = xstrdup(pools[i].id);
-			if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
-				continue;
-			/* Don't decrease used_space in case buffer allocation
-			 * in progress */
-			used_space = pools[i].quantity - pools[i].free;
-			used_space *= pools[i].granularity;
-			gres_ptr->used_cnt = MAX(gres_ptr->used_cnt, used_space);
+			bb_state.bb_config.pool_cnt = 0;
+			continue;
+		}
+
+		found_pool = false;
+		pool_ptr = bb_state.bb_config.pool_ptr;
+		for (j = 0; j < bb_state.bb_config.pool_cnt; j++, pool_ptr++) {
+			if (!xstrcmp(pool_ptr->name, pools[i].id)) {
+				found_pool = true;
+				break;
+			}
+		}
+		if (!found_pool) {
+			bb_state.bb_config.pool_ptr
+				= xrealloc(bb_state.bb_config.pool_ptr,
+					   sizeof(burst_buffer_pool_t) *
+					   (bb_state.bb_config.pool_cnt + 1));
+			pool_ptr = bb_state.bb_config.pool_ptr +
+				   bb_state.bb_config.pool_cnt;
+			pool_ptr->name = xstrdup(pools[i].id);
+			bb_state.bb_config.pool_cnt++;
 		}
+
+		pool_ptr->total_space = pools[i].quantity *
+				        pools[i].granularity;
+		pool_ptr->granularity = pools[i].granularity;
+		if (bb_state.bb_config.flags & BB_FLAG_EMULATE_CRAY)
+			continue;
+		/* Don't decrease used_space in case buffer allocation
+		 * in progress */
+		used_space = pools[i].quantity - pools[i].free;
+		used_space *= pools[i].granularity;
+		pool_ptr->used_space = MAX(pool_ptr->used_space, used_space);
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	_bb_free_pools(pools, num_pools);
 
 	/*
@@ -1087,7 +1183,7 @@ static void _load_state(bool init_config)
 		num_instances = 0;	/* Redundant, but fixes CLANG bug */
 	}
 	sessions = _bb_get_sessions(&num_sessions, &bb_state, timeout);
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	assoc_mgr_lock(&assoc_locks);
 	bb_state.last_load_time = time(NULL);
 	for (i = 0; i < num_sessions; i++) {
@@ -1127,14 +1223,14 @@ static void _load_state(bool init_config)
 
 		if (!init_config) {	/* Newly found buffer */
 			_pick_alloc_account(bb_alloc);
-			bb_limit_add(bb_alloc->user_id,
-				     bb_alloc->size, &bb_state);
+			bb_limit_add(bb_alloc->user_id, bb_alloc->size,
+				     bb_alloc->pool, &bb_state);
 		}
 		if (bb_alloc->job_id == 0)
 			bb_post_persist_create(NULL, bb_alloc, &bb_state);
 	}
 	assoc_mgr_unlock(&assoc_locks);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	_bb_free_sessions(sessions, num_sessions);
 	_bb_free_instances(instances, num_instances);
 
@@ -1256,7 +1352,7 @@ static int _write_file(char *file_name, char *buf)
 
 static int _queue_stage_in(struct job_record *job_ptr, bb_job_t *bb_job)
 {
-	char *hash_dir = NULL, *job_dir = NULL;
+	char *hash_dir = NULL, *job_dir = NULL, *job_pool;
 	char *client_nodes_file_nid = NULL;
 	char **setup_argv, **data_in_argv;
 	stage_args_t *stage_args;
@@ -1285,9 +1381,12 @@ static int _queue_stage_in(struct job_record *job_ptr, bb_job_t *bb_job)
 	setup_argv[7] = xstrdup("--user");
 	xstrfmtcat(setup_argv[8], "%d", job_ptr->user_id);
 	setup_argv[9] = xstrdup("--capacity");
+	if (bb_job->job_pool)
+		job_pool = bb_job->job_pool;
+	else
+		job_pool = bb_state.bb_config.default_pool;
 	xstrfmtcat(setup_argv[10], "%s:%s",
-		   bb_state.bb_config.default_pool,
-		   bb_get_size_str(bb_job->total_size));
+		   job_pool, bb_get_size_str(bb_job->total_size));
 	setup_argv[11] = xstrdup("--job");
 	xstrfmtcat(setup_argv[12], "%s/script", job_dir);
 	if (client_nodes_file_nid) {
@@ -1298,6 +1397,7 @@ static int _queue_stage_in(struct job_record *job_ptr, bb_job_t *bb_job)
 #endif
 		setup_argv[14] = xstrdup(client_nodes_file_nid);
 	}
+	bb_limit_add(job_ptr->user_id, bb_job->total_size, job_pool, &bb_state);
 
 	data_in_argv = xmalloc(sizeof(char *) * 10);	/* NULL terminated */
 	data_in_argv[0] = xstrdup("dw_wlm_cli");
@@ -1309,8 +1409,11 @@ static int _queue_stage_in(struct job_record *job_ptr, bb_job_t *bb_job)
 	xstrfmtcat(data_in_argv[6], "%s/script", job_dir);
 
 	stage_args = xmalloc(sizeof(stage_args_t));
+	stage_args->bb_size = bb_job->total_size;
 	stage_args->job_id  = job_ptr->job_id;
+	stage_args->pool    = xstrdup(job_pool);
 	stage_args->timeout = bb_state.bb_config.stage_in_timeout;
+	stage_args->user_id = job_ptr->user_id;
 	stage_args->args1   = setup_argv;
 	stage_args->args2   = data_in_argv;
 
@@ -1365,13 +1468,15 @@ static void *_start_stage_in(void *x)
 	info("%s: setup for job %u ran for %s",
 	     __func__, stage_args->job_id, TIME_STR);
 	_log_script_argv(setup_argv, resp_msg);
+	lock_slurmctld(job_read_lock);
+	slurm_mutex_lock(&bb_state.bb_mutex);
+	bb_limit_rem(stage_args->user_id, stage_args->bb_size, stage_args->pool,
+		     &bb_state);
 	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
 		error("%s: setup for job %u status:%u response:%s",
 		      __func__, stage_args->job_id, status, resp_msg);
 		rc = SLURM_ERROR;
 	} else {
-		lock_slurmctld(job_read_lock);
-		pthread_mutex_lock(&bb_state.bb_mutex);
 		job_ptr = find_job_record(stage_args->job_id);
 		bb_job = bb_job_find(&bb_state, stage_args->job_id);
 		if (!job_ptr) {
@@ -1388,9 +1493,9 @@ static void *_start_stage_in(void *x)
 		} else {
 			bb_job->state = BB_STATE_STAGING_IN;
 		}
-		pthread_mutex_unlock(&bb_state.bb_mutex);
-		unlock_slurmctld(job_read_lock);
 	}
+	slurm_mutex_unlock(&bb_state.bb_mutex);
+	unlock_slurmctld(job_read_lock);
 
 	if (rc == SLURM_SUCCESS) {
 		if (stage_args->timeout)
@@ -1421,7 +1526,7 @@ static void *_start_stage_in(void *x)
 		error("%s: unable to find job record for job %u",
 		      __func__, stage_args->job_id);
 	} else if (rc == SLURM_SUCCESS) {
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		bb_job = bb_job_find(&bb_state, stage_args->job_id);
 		if (bb_job)
 			bb_job->state = BB_STATE_STAGED_IN;
@@ -1443,7 +1548,7 @@ static void *_start_stage_in(void *x)
 				      __func__, stage_args->job_id);
 			}
 		}
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 	} else {
 		xfree(job_ptr->state_desc);
 		job_ptr->state_reason = FAIL_BURST_BUFFER_OP;
@@ -1471,6 +1576,7 @@ static void *_start_stage_in(void *x)
 	xfree(resp_msg);
 	_free_script_argv(setup_argv);
 	_free_script_argv(data_in_argv);
+	xfree(stage_args->pool);
 	xfree(stage_args);
 	return NULL;
 }
@@ -1574,11 +1680,11 @@ static void *_start_stage_out(void *x)
 		error("%s: unable to find job record for job %u",
 		      __func__, stage_args->job_id);
 	} else {
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		bb_job = _get_bb_job(job_ptr);
 		if (bb_job)
 			bb_job->state = BB_STATE_STAGING_OUT;
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 	}
 	unlock_slurmctld(job_write_lock);
 
@@ -1620,7 +1726,7 @@ static void *_start_stage_out(void *x)
 			xstrfmtcat(job_ptr->state_desc, "%s: %s: %s",
 				   plugin_type, op, resp_msg);
 		}
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		bb_job = _get_bb_job(job_ptr);
 		if (bb_job)
 			bb_job->state = BB_STATE_TEARDOWN;
@@ -1658,7 +1764,7 @@ static void *_start_stage_out(void *x)
 			_queue_teardown(stage_args->job_id, stage_args->user_id,
 					false);
 		}
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 	}
 	unlock_slurmctld(job_write_lock);
 
@@ -1778,13 +1884,13 @@ static void *_start_teardown(void *x)
 				hurry);
 	} else {
 		lock_slurmctld(job_write_lock);
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		job_ptr = find_job_record(teardown_args->job_id);
 		_purge_bb_files(teardown_args->job_id, job_ptr);
 		if (job_ptr) {
 			if ((bb_alloc = bb_find_alloc_rec(&bb_state, job_ptr))){
-				bb_limit_rem(bb_alloc->user_id,
-					     bb_alloc->size, &bb_state);
+				bb_limit_rem(bb_alloc->user_id, bb_alloc->size,
+					     bb_alloc->pool, &bb_state);
 				(void) bb_free_alloc_rec(&bb_state, bb_alloc);
 			}
 			if ((bb_job = _get_bb_job(job_ptr)))
@@ -1807,13 +1913,13 @@ static void *_start_teardown(void *x)
 						    teardown_args->user_id,
 						    &bb_state);
 			if (bb_alloc) {
-				bb_limit_rem(bb_alloc->user_id,
-					     bb_alloc->size, &bb_state);
+				bb_limit_rem(bb_alloc->user_id, bb_alloc->size,
+					     bb_alloc->pool, &bb_state);
 				(void) bb_free_alloc_rec(&bb_state, bb_alloc);
 			}
 
 		}
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		unlock_slurmctld(job_write_lock);
 	}
 
@@ -1823,40 +1929,37 @@ static void *_start_teardown(void *x)
 	return NULL;
 }
 
-static void _free_needed_gres_struct(needed_gres_t *needed_gres_ptr,
-				     int gres_cnt)
+/* Reduced burst buffer space in advanced reservation for resources already
+ * allocated to jobs. What's left is space reserved for future jobs */
+static void _rm_active_job_bb(char *resv_name, char **pool_name,
+			      int64_t *resv_space, int ds_len)
 {
+	ListIterator job_iterator;
+	struct job_record  *job_ptr;
+	bb_job_t *bb_job;
 	int i;
-	if (needed_gres_ptr == NULL)
-		return;
-
-	for (i = 0; i < gres_cnt; i++)
-		xfree(needed_gres_ptr->name);
-	xfree(needed_gres_ptr);
-}
 
-static uint64_t _get_bb_resv(char *gres_name, burst_buffer_info_msg_t *resv_bb)
-{
-	burst_buffer_info_t *bb_array;
-	burst_buffer_gres_t *gres_ptr;
-	uint64_t resv_gres = 0;
-	int i, j;
-
-	if (!resv_bb)
-		return resv_gres;
-
-	for (i = 0, bb_array = resv_bb->burst_buffer_array;
-	     i < resv_bb->record_count; i++, bb_array++) {
-		if (bb_array->name && xstrcmp(bb_array->name, bb_state.name))
+	job_iterator = list_iterator_create(job_list);
+	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
+		if ((job_ptr->burst_buffer == NULL) ||
+		    (job_ptr->burst_buffer[0] == '\0') ||
+		    (xstrcmp(job_ptr->resv_name, resv_name) == 0))
+			continue;
+		bb_job = bb_job_find(&bb_state,job_ptr->job_id);
+		if (!bb_job || (bb_job->state <= BB_STATE_PENDING) ||
+		    (bb_job->state >= BB_STATE_COMPLETE))
 			continue;
-		for (j = 0, gres_ptr = bb_array->gres_ptr;
-		     j < bb_array->gres_cnt; j++, gres_ptr++) {
-			if (!xstrcmp(gres_name, gres_ptr->name))
-				resv_gres += gres_ptr->used_cnt;
+		for (i = 0; i < ds_len; i++) {
+			if (xstrcmp(bb_job->job_pool, pool_name[i]))
+				continue;
+			if (resv_space[i] >= bb_job->total_size)
+				resv_space[i] -= bb_job->total_size;
+			else
+				resv_space[i] = 0;
+			break;
 		}
 	}
-
-	return resv_gres;
+	list_iterator_destroy(job_iterator);
 }
 
 /* Test if a job can be allocated a burst buffer.
@@ -1869,98 +1972,141 @@ static uint64_t _get_bb_resv(char *gres_name, burst_buffer_info_msg_t *resv_bb)
  */
 static int _test_size_limit(struct job_record *job_ptr, bb_job_t *bb_job)
 {
-	burst_buffer_info_msg_t *resv_bb;
-	needed_gres_t *needed_gres_ptr = NULL;
+	int64_t *add_space = NULL, *avail_space = NULL, *granularity = NULL;
+	int64_t *preempt_space = NULL, *resv_space = NULL, *total_space = NULL;
+	burst_buffer_info_msg_t *resv_bb = NULL;
 	struct preempt_bb_recs *preempt_ptr = NULL;
-	List preempt_list;
-	ListIterator preempt_iter;
-	int64_t tmp_g, tmp_r;
-	int64_t add_space, resv_space = 0;
-	int64_t tmp_f;	/* Could go negative due to reservations */
-	int64_t add_total_space_needed = 0, add_user_space_needed = 0;
-	int64_t add_total_space_avail  = 0, add_user_space_avail  = 0;
-	int64_t add_total_gres_needed  = 0, add_total_gres_avail  = 0;
-	time_t now = time(NULL);
+	char **pool_name, *my_pool;
+	int ds_len;
+	burst_buffer_pool_t *pool_ptr;
+	bb_buf_t *buf_ptr;
 	bb_alloc_t *bb_ptr = NULL;
-	int d, i, j, k;
+	int i, j, k, rc = 0;
+	bool avail_ok, do_preempt, preempt_ok;
+	time_t now = time(NULL);
+	List preempt_list = NULL;
+	ListIterator preempt_iter;
 	char jobid_buf[32];
 
 	xassert(bb_job);
-	add_space = bb_job->total_size + bb_job->persist_add;
-	if (add_space > bb_state.total_space)
-		return 1;
 
+	/* Initialize data structure */
+	ds_len = bb_state.bb_config.pool_cnt + 1;
+	add_space = xmalloc(sizeof(int64_t) * ds_len);
+	avail_space = xmalloc(sizeof(int64_t) * ds_len);
+	granularity = xmalloc(sizeof(int64_t) * ds_len);
+	pool_name = xmalloc(sizeof(char *)  * ds_len);
+	preempt_space = xmalloc(sizeof(int64_t) * ds_len);
+	resv_space = xmalloc(sizeof(int64_t) * ds_len);
+	total_space = xmalloc(sizeof(int64_t) * ds_len);
+	for (i = 0, pool_ptr = bb_state.bb_config.pool_ptr;
+	     i < bb_state.bb_config.pool_cnt; i++, pool_ptr++) {
+		if (pool_ptr->total_space >= pool_ptr->used_space)
+			avail_space[i] = pool_ptr->total_space -
+					 pool_ptr->used_space;
+		granularity[i] = pool_ptr->granularity;
+		pool_name[i] = pool_ptr->name;
+		total_space[i] = pool_ptr->total_space;
+	}
+	if (bb_state.total_space - bb_state.used_space)
+		avail_space[i] = bb_state.total_space - bb_state.used_space;
+	granularity[i] = bb_state.bb_config.granularity;
+	pool_name[i] = bb_state.bb_config.default_pool;
+	total_space[i] = bb_state.total_space;
+
+	/* Determine job size requirements by pool */
+	if (bb_job->total_size) {
+		for (j = 0; j < ds_len; j++) {
+			if (!xstrcmp(bb_job->job_pool, pool_name[j])) {
+				add_space[j] += bb_granularity(
+							bb_job->total_size,
+							granularity[j]);
+				break;
+			}
+		}
+	}
+	for (i = 0, buf_ptr = bb_job->buf_ptr; i < bb_job->buf_cnt;
+	     i++, buf_ptr++) {
+		if (!buf_ptr->create || (buf_ptr->state >= BB_STATE_ALLOCATING))
+			continue;
+		for (j = 0; j < ds_len; j++) {
+			if (!xstrcmp(buf_ptr->pool, pool_name[j])) {
+				add_space[j] += bb_granularity(buf_ptr->size,
+							       granularity[j]);
+				break;
+			}
+		}
+	}
+
+	/* Account for reserved resources. Reduce reservation size for
+	 * resources already claimed from the reservation. */
 	resv_bb = job_test_bb_resv(job_ptr, now);
 	if (resv_bb) {
 		burst_buffer_info_t *resv_bb_ptr;
 		for (i = 0, resv_bb_ptr = resv_bb->burst_buffer_array;
 		     i < resv_bb->record_count; i++, resv_bb_ptr++) {
-			if (resv_bb_ptr->name &&
-			    xstrcmp(resv_bb_ptr->name, bb_state.name))
+			if (xstrcmp(resv_bb_ptr->name, bb_state.name))
 				continue;
-			resv_bb_ptr->used_space =
-				bb_granularity(resv_bb_ptr->used_space,
-					       bb_state.bb_config.granularity);
-			resv_space += resv_bb_ptr->used_space;
-		}
-	}
-	if ((add_space + resv_space) > bb_state.total_space)
-		return 1;
-
-	add_total_space_needed = bb_state.used_space + add_space + resv_space -
-				 bb_state.total_space;
-	needed_gres_ptr = xmalloc(sizeof(needed_gres_t) * bb_job->gres_cnt);
-	for (i = 0; i < bb_job->gres_cnt; i++) {
-		needed_gres_ptr[i].name = xstrdup(bb_job->gres_ptr[i].name);
-		for (j = 0; j < bb_state.bb_config.gres_cnt; j++) {
-			if (strcmp(bb_job->gres_ptr[i].name,
-				   bb_state.bb_config.gres_ptr[j].name))
-				continue;
-			tmp_g = bb_granularity(bb_job->gres_ptr[i].count,
-					       bb_state.bb_config.gres_ptr[j].
-					       granularity);
-			bb_job->gres_ptr[i].count = tmp_g;
-			if (tmp_g > bb_state.bb_config.gres_ptr[j].avail_cnt) {
-				debug("%s: %s requests more %s GRES than"
-				      "configured", __func__,
-				      jobid2fmt(job_ptr, jobid_buf,
-						sizeof(jobid_buf)),
-				      bb_job->gres_ptr[i].name);
-				_free_needed_gres_struct(needed_gres_ptr,
-							 bb_job->gres_cnt);
-				if (resv_bb)
-					slurm_free_burst_buffer_info_msg(
-						resv_bb);
-				return 1;
+			for (j = 0, pool_ptr = resv_bb_ptr->pool_ptr;
+			     j < resv_bb_ptr->pool_cnt; j++, pool_ptr++) {
+				if (pool_ptr->name) {
+					my_pool = pool_ptr->name;
+				} else {
+					my_pool =
+						bb_state.bb_config.default_pool;
+				}
+				for (k = 0; k < ds_len; k++) {
+					if (xstrcmp(my_pool, pool_name[k]))
+						continue;
+					resv_space[k] += bb_granularity(
+							pool_ptr->used_space,
+							granularity[k]);
+					break;
+				}
 			}
-			tmp_r = _get_bb_resv(bb_job->gres_ptr[i].name,resv_bb);
-			tmp_f = bb_state.bb_config.gres_ptr[j].avail_cnt -
-				bb_state.bb_config.gres_ptr[j].used_cnt - tmp_r;
-			if (tmp_g > tmp_f)
-				needed_gres_ptr[i].add_cnt = tmp_g - tmp_f;
-			add_total_gres_needed += needed_gres_ptr[i].add_cnt;
-			break;
-		}
-		if (j >= bb_state.bb_config.gres_cnt) {
-			debug("%s: %s requests %s GRES which are undefined",
-			      __func__,
-			      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)),
-			      bb_job->gres_ptr[i].name);
-			_free_needed_gres_struct(needed_gres_ptr,
-						 bb_job->gres_cnt);
-			if (resv_bb)
-				slurm_free_burst_buffer_info_msg(resv_bb);
-			return 1;
+			if (resv_bb_ptr->used_space) {
+				/* Pool not specified, use default */
+				my_pool = bb_state.bb_config.default_pool;
+				for (k = 0; k < ds_len; k++) {
+					if (xstrcmp(my_pool, pool_name[k]))
+						continue;
+					resv_space[k] += bb_granularity(
+							resv_bb_ptr->used_space,
+							granularity[k]);
+					break;
+				}
+			}
+#if 1
+			/* Is any of this reserved space already taken? */
+			_rm_active_job_bb(job_ptr->resv_name,
+					  pool_name, resv_space, ds_len);
+#endif
 		}
 	}
 
-	if (resv_bb)
-		slurm_free_burst_buffer_info_msg(resv_bb);
+#if _DEBUG
+	info("TEST_SIZE_LIMIT for job %u", job_ptr->job_id);
+	for (j = 0; j < ds_len; j++) {
+		info("POOL:%s ADD:%"PRIu64" AVAIL:%"PRIu64
+		     " GRANULARITY:%"PRIu64" RESV:%"PRIu64" TOTAL:%"PRIu64,
+		     pool_name[j], add_space[j], avail_space[j], granularity[j],
+		     resv_space[j], total_space[j]);
+	}
+#endif
 
-	if ((add_total_space_needed <= 0) &&
-	    (add_user_space_needed  <= 0) && (add_total_gres_needed <= 0)) {
-		_free_needed_gres_struct(needed_gres_ptr, bb_job->gres_cnt);
-		return 0;
+	/* Determine if resources currently are available for the job */
+	avail_ok = true;
+	for (j = 0; j < ds_len; j++) {
+		if (add_space[j] > total_space[j]) {
+			rc = 1;
+			goto fini;
+		}
+		if ((add_space[j] + resv_space[j]) > avail_space[j])
+			avail_ok = false;
+	}
+	if (avail_ok) {
+		rc = 0;
+		goto fini;
 	}
 
 	/* Identify candidate burst buffers to revoke for higher priority job */
@@ -1968,117 +2114,108 @@ static int _test_size_limit(struct job_record *job_ptr, bb_job_t *bb_job)
 	for (i = 0; i < BB_HASH_SIZE; i++) {
 		bb_ptr = bb_state.bb_ahash[i];
 		while (bb_ptr) {
-			if (bb_ptr->job_id &&
+			if ((bb_ptr->job_id != 0) &&
+			    ((bb_ptr->name == NULL) ||
+			     ((bb_ptr->name[0] >= '0') &&
+			      (bb_ptr->name[0] <= '9'))) &&
 			    (bb_ptr->use_time > now) &&
 			    (bb_ptr->use_time > job_ptr->start_time)) {
-				preempt_ptr = xmalloc(
-					sizeof(struct preempt_bb_recs));
+				if (!bb_ptr->pool) {
+					bb_ptr->name = xstrdup(
+						bb_state.bb_config.default_pool);
+				}
+				preempt_ptr = xmalloc(sizeof(
+						struct preempt_bb_recs));
 				preempt_ptr->bb_ptr = bb_ptr;
 				preempt_ptr->job_id = bb_ptr->job_id;
+				preempt_ptr->pool = bb_ptr->name;
 				preempt_ptr->size = bb_ptr->size;
 				preempt_ptr->use_time = bb_ptr->use_time;
 				preempt_ptr->user_id = bb_ptr->user_id;
 				list_push(preempt_list, preempt_ptr);
-				add_total_space_avail += bb_ptr->size;
-				if (bb_ptr->user_id == job_ptr->user_id)
-					add_user_space_avail += bb_ptr->size;
-				if (add_total_gres_needed<add_total_gres_avail)
-					j = bb_ptr->gres_cnt;
-				else
-					j = 0;
-				for ( ; j < bb_ptr->gres_cnt; j++) {
-					d = needed_gres_ptr[j].add_cnt -
-						needed_gres_ptr[j].avail_cnt;
-					if (d <= 0)
+
+				for (j = 0; j < ds_len; j++) {
+					if (xstrcmp(bb_ptr->name, pool_name[j]))
 						continue;
-					for (k = 0; k < bb_job->gres_cnt; k++){
-						if (strcmp(needed_gres_ptr[j].
-							   name,
-							   bb_job->gres_ptr[k].
-							   name))
-							continue;
-						if (bb_job->gres_ptr[k].count <
-						    d) {
-							d = bb_job->gres_ptr[k].
-								count;
-						}
-						add_total_gres_avail += d;
-						needed_gres_ptr[j].avail_cnt+=d;
-					}
+					preempt_ptr->size = bb_granularity(
+								bb_ptr->size,
+								granularity[j]);
+					preempt_space[j] += preempt_ptr->size;
+					break;
 				}
 			}
 			bb_ptr = bb_ptr->next;
 		}
 	}
 
-	if ((add_total_space_avail >= add_total_space_needed) &&
-	    (add_user_space_avail  >= add_user_space_needed)  &&
-	    (add_total_gres_avail  >= add_total_gres_needed)) {
-		list_sort(preempt_list, bb_preempt_queue_sort);
-		preempt_iter = list_iterator_create(preempt_list);
-		while ((preempt_ptr = list_next(preempt_iter)) &&
-		       (add_total_space_needed || add_user_space_needed ||
-			add_total_gres_needed)) {
-			bool do_preempt = false;
-			if (add_user_space_needed &&
-			    (preempt_ptr->user_id == job_ptr->user_id)) {
-				do_preempt = true;
-				add_user_space_needed  -= preempt_ptr->size;
-				add_total_space_needed -= preempt_ptr->size;
-			}
-			if ((add_total_space_needed > add_user_space_needed) &&
-			    (preempt_ptr->user_id != job_ptr->user_id)) {
+#if _DEBUG
+	for (j = 0; j < ds_len; j++) {
+		info("POOL:%s ADD:%"PRIu64" AVAIL:%"PRIu64
+		     " GRANULARITY:%"PRIu64" PREEMPT:%"PRIu64
+		     " RESV:%"PRIu64" TOTAL:%"PRIu64,
+		     pool_name[j], add_space[j], avail_space[j], granularity[j],
+		     preempt_space[j], resv_space[j], total_space[j]);
+	}
+#endif
+
+	/* Determine if sufficient resources available after preemption */
+	rc = 2;
+	preempt_ok = true;
+	for (j = 0; j < ds_len; j++) {
+		if ((add_space[j] + resv_space[j]) >
+		    (avail_space[j] + preempt_space[j])) {
+			preempt_ok = false;
+			break;
+		}
+	}
+	if (!preempt_ok)
+		goto fini;
+
+	/* Now preempt/teardown the most appropriate buffers */
+	list_sort(preempt_list, bb_preempt_queue_sort);
+	preempt_iter = list_iterator_create(preempt_list);
+	while ((preempt_ptr = list_next(preempt_iter))) {
+		do_preempt = false;
+		for (j = 0; j < ds_len; j++) {
+			if (xstrcmp(preempt_ptr->pool, pool_name[j]))
+				continue;
+			if ((add_space[j] + resv_space[j]) > avail_space[j]) {
+				avail_space[j] += preempt_ptr->size;
+				preempt_space[j] -= preempt_ptr->size;
 				do_preempt = true;
-				add_total_space_needed -= preempt_ptr->size;
 			}
-			if (add_total_gres_needed) {
-				for (j = 0; j < bb_job->gres_cnt; j++) {
-					d = needed_gres_ptr[j].add_cnt;
-					if (d <= 0)
-						continue;
-					for (k = 0;
-					     k < preempt_ptr->bb_ptr->gres_cnt;
-					     k++) {
-						if (strcmp(needed_gres_ptr[j].
-							   name,
-							   preempt_ptr->bb_ptr->
-							   gres_ptr[k].name))
-							continue;
-						if (preempt_ptr->bb_ptr->
-						    gres_ptr[k].used_cnt < d) {
-							d = preempt_ptr->
-								bb_ptr->
-								gres_ptr[k].
-								used_cnt;
-						}
-						add_total_gres_needed -= d;
-						needed_gres_ptr[j].add_cnt -= d;
-						do_preempt = true;
-					}
-				}
-			}
-			if (do_preempt) {
-				preempt_ptr->bb_ptr->cancelled = true;
-				preempt_ptr->bb_ptr->end_time = 0;
-				preempt_ptr->bb_ptr->state = BB_STATE_TEARDOWN;
-				preempt_ptr->bb_ptr->state_time = time(NULL);
-				_queue_teardown(preempt_ptr->job_id,
-						preempt_ptr->user_id, true);
-				if (bb_state.bb_config.debug_flag) {
-					info("%s: %s: Preempting stage-in of "
-					     "job %u for %s", plugin_type,
-					     __func__, preempt_ptr->job_id,
-					     jobid2fmt(job_ptr, jobid_buf,
-						       sizeof(jobid_buf)));
-				}
+			break;
+		}
+		if (do_preempt) {
+			preempt_ptr->bb_ptr->cancelled = true;
+			preempt_ptr->bb_ptr->end_time = 0;
+			preempt_ptr->bb_ptr->state = BB_STATE_TEARDOWN;
+			preempt_ptr->bb_ptr->state_time = time(NULL);
+			_queue_teardown(preempt_ptr->job_id,
+					preempt_ptr->user_id, true);
+			if (bb_state.bb_config.debug_flag) {
+				info("%s: %s: Preempting stage-in of job %u "
+				     "for %s", plugin_type,
+				     __func__, preempt_ptr->job_id,
+				     jobid2fmt(job_ptr, jobid_buf,
+					       sizeof(jobid_buf)));
 			}
 		}
-		list_iterator_destroy(preempt_iter);
+
 	}
+	list_iterator_destroy(preempt_iter);
+	
+fini:	xfree(add_space);
+	xfree(avail_space);
+	xfree(granularity);
+	xfree(pool_name);
+	xfree(preempt_space);
+	xfree(resv_space);
+	xfree(total_space);
+	if (resv_bb)
+		slurm_free_burst_buffer_info_msg(resv_bb);
 	FREE_NULL_LIST(preempt_list);
-	_free_needed_gres_struct(needed_gres_ptr, bb_job->gres_cnt);
-
-	return 2;
+	return rc;
 }
 
 /* Handle timeout of burst buffer events:
@@ -2116,8 +2253,8 @@ static void _timeout_bb_rec(void)
 					     "purged",
 					     __func__, bb_alloc->job_id);
 				}
-				bb_limit_rem(bb_alloc->user_id,
-					     bb_alloc->size, &bb_state);
+				bb_limit_rem(bb_alloc->user_id, bb_alloc->size,
+					     bb_alloc->pool, &bb_state);
 				bb_post_persist_delete(bb_alloc, &bb_state);
 				*bb_pptr = bb_alloc->next;
 				bb_free_alloc_buf(bb_alloc);
@@ -2142,11 +2279,11 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 			  uid_t submit_uid)
 {
 	char *bb_script, *save_ptr = NULL;
-	char *bb_name = NULL, *capacity;
+	char *bb_name = NULL, *bb_pool, *capacity;
 	char *end_ptr = NULL, *sub_tok, *tok;
 	uint64_t tmp_cnt;
 	int rc = SLURM_SUCCESS, swap_cnt = 0;
-	bool enable_persist = false, have_bb = false;
+	bool enable_persist = false, have_bb = false, have_stage_out = false;
 
 	xassert(bb_size);
 	*bb_size = 0;
@@ -2172,21 +2309,19 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 			tok += 3;
 			while (isspace(tok[0]))
 				tok++;
-			if (!strncmp(tok, "create_persistent", 17) &&
+			if (!xstrncmp(tok, "create_persistent", 17) &&
 			    !enable_persist) {
 				info("%s: User %d disabled from creating "
 				     "persistent burst buffer",
 				     __func__, submit_uid);
 				rc = ESLURM_BURST_BUFFER_PERMISSION;
 				break;
-			} else if (!strncmp(tok, "create_persistent", 17)) {
+			} else if (!xstrncmp(tok, "create_persistent", 17)) {
 				have_bb = true;
 				bb_name = NULL;
+				bb_pool = NULL;
 				if ((sub_tok = strstr(tok, "capacity="))) {
-					tmp_cnt = bb_get_size_num(
-						sub_tok + 9,
-						bb_state.bb_config.granularity);
-					*bb_size += tmp_cnt;
+					tmp_cnt = bb_get_size_num(sub_tok+9, 1);
 				}
 				if (tmp_cnt == 0)
 					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
@@ -2202,16 +2337,25 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 				     (bb_name[0] <= '9')))
 					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
 				xfree(bb_name);
+				if ((sub_tok = strstr(tok, "pool="))) {
+					bb_pool = xstrdup(sub_tok + 5);
+					if ((sub_tok = strchr(bb_pool, ' ')))
+						sub_tok[0] = '\0';
+				}
+				if (!bb_valid_pool_test(&bb_state, bb_pool))
+					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
+				*bb_size += _set_granularity(tmp_cnt, bb_pool);
+				xfree(bb_pool);
 				if (rc != SLURM_SUCCESS)
 					break;
-			} else if (!strncmp(tok, "destroy_persistent", 17) &&
+			} else if (!xstrncmp(tok, "destroy_persistent", 17) &&
 				   !enable_persist) {
 				info("%s: User %d disabled from destroying "
 				     "persistent burst buffer",
 				     __func__, submit_uid);
 				rc = ESLURM_BURST_BUFFER_PERMISSION;
 				break;
-			} else if (!strncmp(tok, "destroy_persistent", 17)) {
+			} else if (!xstrncmp(tok, "destroy_persistent", 17)) {
 				have_bb = true;
 				if (!(sub_tok = strstr(tok, "name="))) {
 					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
@@ -2224,20 +2368,28 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 			tok += 3;
 			while (isspace(tok[0]) && (tok[0] != '\0'))
 				tok++;
-			if (!strncmp(tok, "jobdw", 5) &&
+			if (!xstrncmp(tok, "jobdw", 5) &&
 			    (capacity = strstr(tok, "capacity="))) {
+				bb_pool = NULL;
 				have_bb = true;
-				tmp_cnt = bb_get_size_num(
-					capacity + 9,
-					bb_state.bb_config.granularity);
+				tmp_cnt = bb_get_size_num(capacity + 9, 1);
 				if (tmp_cnt == 0) {
 					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
 					break;
 				}
-				*bb_size += tmp_cnt;
-			} else if (!strncmp(tok, "persistentdw", 12)) {
+				if ((sub_tok = strstr(tok, "pool="))) {
+					bb_pool = xstrdup(sub_tok + 5);
+					if ((sub_tok = strchr(bb_pool, ' ')))
+						sub_tok[0] = '\0';
+				}
+				if (!bb_valid_pool_test(&bb_state, bb_pool))
+					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
+				*bb_size += _set_granularity(tmp_cnt, bb_pool);
+				xfree(bb_pool);
+			} else if (!xstrncmp(tok, "persistentdw", 12)) {
 				have_bb = true;
-			} else if (!strncmp(tok, "swap", 4)) {
+			} else if (!xstrncmp(tok, "swap", 4)) {
+				bb_pool = NULL;
 				have_bb = true;
 				tok += 4;
 				while (isspace(tok[0]) && (tok[0] != '\0'))
@@ -2255,8 +2407,17 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 						job_desc->min_nodes;
 				}
 				tmp_cnt = swap_cnt * job_desc->max_nodes;
-				*bb_size += bb_granularity(tmp_cnt,
-					    bb_state.bb_config.granularity);
+				if ((sub_tok = strstr(tok, "pool="))) {
+					bb_pool = xstrdup(sub_tok + 5);
+					if ((sub_tok = strchr(bb_pool, ' ')))
+						sub_tok[0] = '\0';
+				}
+				if (!bb_valid_pool_test(&bb_state, bb_pool))
+					rc =ESLURM_INVALID_BURST_BUFFER_REQUEST;
+				*bb_size += _set_granularity(tmp_cnt, bb_pool);
+				xfree(bb_pool);
+			} else if (!xstrncmp(tok, "stage_out", 9)) {
+				have_stage_out = true;
 			}
 		}
 		tok = strtok_r(NULL, "\n", &save_ptr);
@@ -2266,6 +2427,11 @@ static int _parse_bb_opts(struct job_descriptor *job_desc, uint64_t *bb_size,
 	if (!have_bb)
 		rc = ESLURM_INVALID_BURST_BUFFER_REQUEST;
 
+	if (!have_stage_out) {
+		/* prevent sending stage out email */
+		job_desc->mail_type &= (~MAIL_JOB_STAGE_OUT);
+	}
+
 	return rc;
 }
 
@@ -2296,7 +2462,7 @@ static int _xlate_batch(struct job_descriptor *job_desc)
  * burst_buffer options in a batch script file */
 static int _xlate_interactive(struct job_descriptor *job_desc)
 {
-	char *access = NULL, *type = NULL;
+	char *access = NULL, *pool = NULL, *type = NULL;
 	char *end_ptr = NULL, *tok;
 	uint64_t buf_size = 0, swap_cnt = 0;
 	int rc = SLURM_SUCCESS;
@@ -2322,6 +2488,17 @@ static int _xlate_interactive(struct job_descriptor *job_desc)
 		}
 	}
 
+
+	if ((tok = strstr(job_desc->burst_buffer, "pool="))) {
+		pool = xstrdup(tok + 5);
+		tok = strchr(pool, ',');
+		if (tok)
+			tok[0] = '\0';
+		tok = strchr(pool, ' ');
+		if (tok)
+			tok[0] = '\0';
+	}
+
 	if ((tok = strstr(job_desc->burst_buffer, "swap=")))
 		swap_cnt = strtol(tok + 5, &end_ptr, 10);
 
@@ -2340,9 +2517,15 @@ static int _xlate_interactive(struct job_descriptor *job_desc)
 	if ((rc == SLURM_SUCCESS) && (swap_cnt || buf_size)) {
 		if (swap_cnt) {
 			xstrfmtcat(job_desc->burst_buffer,
-				   "#DW swap %"PRIu64"GiB\n", swap_cnt);
+				   "#DW swap %"PRIu64"GiB", swap_cnt);
+			if (pool) {
+				xstrfmtcat(job_desc->burst_buffer,
+					   " pool=%s", pool);
+			}
 		}
 		if (buf_size) {
+			if (job_desc->burst_buffer)
+				xstrfmtcat(job_desc->burst_buffer, "\n");
 			xstrfmtcat(job_desc->burst_buffer,
 				   "#DW jobdw capacity=%s",
 				   bb_get_size_str(buf_size));
@@ -2350,15 +2533,19 @@ static int _xlate_interactive(struct job_descriptor *job_desc)
 				xstrfmtcat(job_desc->burst_buffer,
 					   " access_mode=%s", access);
 			}
+			if (pool) {
+				xstrfmtcat(job_desc->burst_buffer,
+					   " pool=%s", pool);
+			}
 			if (type) {
 				xstrfmtcat(job_desc->burst_buffer,
 					   " type=%s", type);
 			}
-			xstrfmtcat(job_desc->burst_buffer, "\n");
 		}
 	}
 
 fini:	xfree(access);
+	xfree(pool);
 	xfree(type);
 	return rc;
 }
@@ -2388,11 +2575,13 @@ extern int init(void)
 	pthread_attr_t attr;
 
 	pthread_mutex_init(&bb_state.bb_mutex, NULL);
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	bb_load_config(&bb_state, (char *)plugin_type); /* Removes "const" */
 	_test_config();
 	if (bb_state.bb_config.debug_flag)
 		info("%s: %s", plugin_type,  __func__);
+	if (!state_save_loc)
+		state_save_loc = slurm_get_state_save_location();
 	bb_alloc_cache(&bb_state);
 	slurm_attr_init(&attr);
 	while (pthread_create(&bb_state.bb_thread, &attr, _bb_agent, NULL)) {
@@ -2403,9 +2592,7 @@ extern int init(void)
 		usleep(100000);
 	}
 	slurm_attr_destroy(&attr);
-	if (!state_save_loc)
-		state_save_loc = slurm_get_state_save_location();
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -2428,25 +2615,25 @@ extern int fini(void)
 		usleep(100000);
 	}
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag)
 		info("%s: %s", plugin_type,  __func__);
 
-	pthread_mutex_lock(&bb_state.term_mutex);
+	slurm_mutex_lock(&bb_state.term_mutex);
 	bb_state.term_flag = true;
 	pthread_cond_signal(&bb_state.term_cond);
-	pthread_mutex_unlock(&bb_state.term_mutex);
+	slurm_mutex_unlock(&bb_state.term_mutex);
 
 	if (bb_state.bb_thread) {
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		pthread_join(bb_state.bb_thread, NULL);
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		bb_state.bb_thread = 0;
 	}
 	bb_clear_config(&bb_state.bb_config, true);
 	bb_clear_cache(&bb_state);
 	xfree(state_save_loc);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -2480,9 +2667,9 @@ extern uint64_t bb_p_get_system_size(void)
 {
 	uint64_t size = 0;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	size = bb_state.total_space / (1024 * 1024);	/* bytes to MB */
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	return size;
 }
 
@@ -2505,10 +2692,10 @@ extern int bb_p_load_state(bool init_config)
 	if (bb_state.bb_config.debug_flag)
 		debug("%s: %s", plugin_type,  __func__);
 	_load_state(init_config);	/* Has own locking */
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	bb_set_tres_pos(&bb_state);
 	_purge_vestigial_bufs();
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	_save_bb_state();	/* Has own locks excluding file write */
 
@@ -2525,7 +2712,7 @@ extern int bb_p_reconfig(void)
 	char *old_default_pool;
 	int i;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag)
 		info("%s: %s", plugin_type,  __func__);
 	old_default_pool = bb_state.bb_config.default_pool;
@@ -2536,7 +2723,7 @@ extern int bb_p_reconfig(void)
 	else
 		xfree(old_default_pool);
 	_test_config();
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	/* reconfig is the place we make sure the pointers are correct */
 	for (i = 0; i < BB_HASH_SIZE; i++) {
@@ -2560,7 +2747,7 @@ extern int bb_p_state_pack(uid_t uid, Buf buffer, uint16_t protocol_version)
 {
 	uint32_t rec_count = 0;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	packstr(bb_state.name, buffer);
 	bb_pack_state(&bb_state, buffer, protocol_version);
 
@@ -2573,7 +2760,7 @@ extern int bb_p_state_pack(uid_t uid, Buf buffer, uint16_t protocol_version)
 		debug("%s: %s: record_count:%u",
 		      plugin_type,  __func__, rec_count);
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -2616,7 +2803,7 @@ extern int bb_p_job_validate(struct job_descriptor *job_desc,
 		return ESLURM_BURST_BUFFER_PERMISSION;
 	}
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.allow_users) {
 		bool found_user = false;
 		for (i = 0; bb_state.bb_config.allow_users[i]; i++) {
@@ -2651,7 +2838,7 @@ extern int bb_p_job_validate(struct job_descriptor *job_desc,
 		job_desc->tres_req_cnt[bb_state.tres_pos]
 			= bb_size / (1024 * 1024);
 
-fini:	pthread_mutex_unlock(&bb_state.bb_mutex);
+fini:	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return rc;
 }
@@ -2739,7 +2926,7 @@ static bool _have_dw_cmd_opts(bb_job_t *bb_job)
 
 	for (i = 0, bb_buf = bb_job->buf_ptr; i < bb_job->buf_cnt;
 	     i++, bb_buf++) {
-		if (!bb_buf->create && !bb_buf->destroy)
+		if (bb_buf->use)
 			return true;
 	}
 
@@ -2787,15 +2974,15 @@ extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg)
 	}
 
 	/* Initialization */
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	bb_job = _get_bb_job(job_ptr);
 	if (bb_job == NULL) {
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		return rc;
 	}
 
 	if (!_have_dw_cmd_opts(bb_job)) {
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		return rc;
 	}
 
@@ -2808,7 +2995,7 @@ extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg)
 	else
 		timeout = DEFAULT_VALIDATE_TIMEOUT * 1000;
 	dw_cli_path = xstrdup(bb_state.bb_config.get_sys_state);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	hash_inx = job_ptr->job_id % 10;
 	xstrfmtcat(hash_dir, "%s/hash.%d", state_save_loc, hash_inx);
@@ -2849,9 +3036,9 @@ extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg)
 
 	/* Clean-up */
 	if (rc != SLURM_SUCCESS) {
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		bb_job_del(&bb_state, job_ptr->job_id);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 	}
 
 	xfree(hash_dir);
@@ -2885,12 +3072,12 @@ extern void bb_p_job_set_tres_cnt(struct job_record *job_ptr,
 		return;
 	}
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if ((bb_job = _get_bb_job(job_ptr))) {
 		tres_cnt[bb_state.tres_pos] =
 			bb_job->total_size / (1024 * 1024);
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 }
 
 /*
@@ -2910,9 +3097,9 @@ extern time_t bb_p_job_get_est_start(struct job_record *job_ptr)
 	if (job_ptr->array_recs && (job_ptr->array_task_id == NO_VAL))
 		return est_start;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if ((bb_job = _get_bb_job(job_ptr)) == NULL) {
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		return est_start;
 	}
 
@@ -2939,7 +3126,7 @@ extern time_t bb_p_job_get_est_start(struct job_record *job_ptr)
 	} else {	/* Allocation or staging in progress */
 		est_start++;
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return est_start;
 }
@@ -2956,7 +3143,7 @@ extern int bb_p_job_try_stage_in(List job_queue)
 	bb_job_t *bb_job;
 	int rc;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag)
 		info("%s: %s", plugin_type,  __func__);
 
@@ -3005,7 +3192,7 @@ extern int bb_p_job_try_stage_in(List job_queue)
 			break;
 	}
 	list_iterator_destroy(job_iter);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	FREE_NULL_LIST(job_candidates);
 
 	return SLURM_SUCCESS;
@@ -3033,7 +3220,7 @@ extern int bb_p_job_test_stage_in(struct job_record *job_ptr, bool test_only)
 	if (job_ptr->array_recs && (job_ptr->array_task_id == NO_VAL))
 		return -1;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s test_only:%d",
 		     plugin_type, __func__,
@@ -3061,7 +3248,7 @@ extern int bb_p_job_test_stage_in(struct job_record *job_ptr, bool test_only)
 		rc = -1;	/* Requeued job still staging out */
 	}
 
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return rc;
 }
@@ -3096,7 +3283,7 @@ extern int bb_p_job_begin(struct job_record *job_ptr)
 		return SLURM_ERROR;
 	}
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s",
 		     plugin_type, __func__,
@@ -3111,7 +3298,7 @@ extern int bb_p_job_begin(struct job_record *job_ptr)
 			xstrdup("Could not find burst buffer record");
 		job_ptr->state_reason = FAIL_BURST_BUFFER_OP;
 		_queue_teardown(job_ptr->job_id, job_ptr->user_id, true);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -3122,7 +3309,7 @@ extern int bb_p_job_begin(struct job_record *job_ptr)
 			xstrdup("Error managing persistent burst buffers");
 		job_ptr->state_reason = FAIL_BURST_BUFFER_OP;
 		_queue_teardown(job_ptr->job_id, job_ptr->user_id, true);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -3131,7 +3318,7 @@ extern int bb_p_job_begin(struct job_record *job_ptr)
 		   job_ptr->job_id);
 	xstrfmtcat(client_nodes_file_nid, "%s/client_nids", job_dir);
 	bb_job->state = BB_STATE_RUNNING;
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	if (_write_nid_file(client_nodes_file_nid, job_ptr->job_resrcs->nodes,
 			    job_ptr->job_id)) {
@@ -3267,7 +3454,7 @@ static void *_start_pre_run(void *x)
 	END_TIMER;
 
 	lock_slurmctld(job_write_lock);
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	job_ptr = find_job_record(pre_run_args->job_id);
 	if (job_ptr) {
 		jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf));
@@ -3298,7 +3485,7 @@ static void *_start_pre_run(void *x)
 	}
 	if (job_ptr)
 		prolog_running_decr(job_ptr);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	if (run_kill_job)
 		_kill_job(job_ptr);
 	unlock_slurmctld(job_write_lock);
@@ -3323,7 +3510,7 @@ extern int bb_p_job_start_stage_out(struct job_record *job_ptr)
 	    (job_ptr->burst_buffer[0] == '\0'))
 		return SLURM_SUCCESS;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s", plugin_type, __func__,
 		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
@@ -3337,7 +3524,7 @@ extern int bb_p_job_start_stage_out(struct job_record *job_ptr)
 		bb_job->state = BB_STATE_POST_RUN;
 		_queue_stage_out(bb_job);
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -3359,7 +3546,7 @@ extern int bb_p_job_test_post_run(struct job_record *job_ptr)
 	    (job_ptr->burst_buffer[0] == '\0'))
 		return 1;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s", plugin_type, __func__,
 		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
@@ -3379,7 +3566,7 @@ extern int bb_p_job_test_post_run(struct job_record *job_ptr)
 			rc =  0;
 		}
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return rc;
 }
@@ -3401,7 +3588,7 @@ extern int bb_p_job_test_stage_out(struct job_record *job_ptr)
 	    (job_ptr->burst_buffer[0] == '\0'))
 		return 1;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s", plugin_type, __func__,
 		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
@@ -3421,7 +3608,7 @@ extern int bb_p_job_test_stage_out(struct job_record *job_ptr)
 			rc =  0;
 		}
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return rc;
 }
@@ -3437,7 +3624,7 @@ extern int bb_p_job_cancel(struct job_record *job_ptr)
 	bb_alloc_t *bb_alloc;
 	char jobid_buf[32];
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.debug_flag) {
 		info("%s: %s: %s", plugin_type, __func__,
 		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
@@ -3461,7 +3648,7 @@ extern int bb_p_job_cancel(struct job_record *job_ptr)
 		}
 		_queue_teardown(job_ptr->job_id, job_ptr->user_id, true);
 	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -3472,6 +3659,7 @@ static void _free_create_args(create_buf_data_t *create_args)
 		xfree(create_args->access);
 		xfree(create_args->job_script);
 		xfree(create_args->name);
+		xfree(create_args->pool);
 		xfree(create_args->type);
 		xfree(create_args);
 	}
@@ -3509,24 +3697,31 @@ static int _create_bufs(struct job_record *job_ptr, bb_job_t *bb_job,
 				info("Attempt by job %u to create duplicate "
 				     "persistent burst buffer named %s",
 				     job_ptr->job_id, buf_ptr->name);
+				buf_ptr->create = false; /* Creation complete */
 				if (bb_job->persist_add >= bb_alloc->size) {
 					bb_job->persist_add -= bb_alloc->size;
 				} else {
-					error("%s: Persistent buffer size underflow for job %u",
+					error("%s: Persistent buffer size "
+					      "underflow for job %u",
 					      __func__, job_ptr->job_id);
 					bb_job->persist_add = 0;
 				}
 				continue;
 			}
 			rc++;
-			bb_limit_add(job_ptr->user_id,
-				     buf_ptr->size, &bb_state);
+			if (!buf_ptr->pool) {
+				buf_ptr->pool =
+					xstrdup(bb_state.bb_config.default_pool);
+			}
+			bb_limit_add(job_ptr->user_id, buf_ptr->size,
+				     buf_ptr->pool, &bb_state);
 			bb_job->state = BB_STATE_ALLOCATING;
 			buf_ptr->state = BB_STATE_ALLOCATING;
 			create_args = xmalloc(sizeof(create_buf_data_t));
 			create_args->access = xstrdup(buf_ptr->access);
 			create_args->job_id = job_ptr->job_id;
 			create_args->name = xstrdup(buf_ptr->name);
+			create_args->pool = xstrdup(buf_ptr->pool);
 			create_args->size = buf_ptr->size;
 			create_args->type = xstrdup(buf_ptr->type);
 			create_args->user_id = job_ptr->user_id;
@@ -3675,23 +3870,29 @@ static void _reset_buf_state(uint32_t user_id, uint32_t job_id, char *name,
 	/* Update the buffer's state in job record */
 	for (i = 0, buf_ptr = bb_job->buf_ptr; i < bb_job->buf_cnt;
 	     i++, buf_ptr++) {
-		if (strcmp(name, buf_ptr->name))
+		if (xstrcmp(name, buf_ptr->name))
 			continue;
 		old_state = buf_ptr->state;
 		buf_ptr->state = new_state;
 		if ((old_state == BB_STATE_ALLOCATING) &&
-		    (new_state == BB_STATE_PENDING))
-			bb_limit_rem(user_id, buf_ptr->size, &bb_state);
+		    (new_state == BB_STATE_PENDING)) {
+			bb_limit_rem(user_id, buf_ptr->size, buf_ptr->pool,
+				     &bb_state);
+		}
 		if ((old_state == BB_STATE_DELETING) &&
-		    (new_state == BB_STATE_PENDING))
-			bb_limit_rem(user_id, buf_ptr->size, &bb_state);
+		    (new_state == BB_STATE_PENDING)) {
+			bb_limit_rem(user_id, buf_ptr->size, buf_ptr->pool,
+				     &bb_state);
+		}
 		if ((old_state == BB_STATE_ALLOCATING) &&
 		    (new_state == BB_STATE_ALLOCATED)  &&
 		    ((name[0] < '0') || (name[0] > '9'))) {
+			buf_ptr->create = false;  /* Buffer creation complete */
 			if (bb_job->persist_add >= buf_size) {
 				bb_job->persist_add -= buf_size;
 			} else {
-				error("%s: Persistent buffer size underflow for job %u",
+				error("%s: Persistent buffer size underflow "
+				      "for job %u",
 				      __func__, job_id);
 				bb_job->persist_add = 0;
 			}
@@ -3742,14 +3943,14 @@ static void *_create_persistent(void *x)
 	script_argv[7] = xstrdup("-u");		/* user iD */
 	xstrfmtcat(script_argv[8], "%u", create_args->user_id);
 	script_argv[9] = xstrdup("-C");		/* configuration */
-	pthread_mutex_lock(&bb_state.bb_mutex);
 	xstrfmtcat(script_argv[10], "%s:%"PRIu64"",
-		   bb_state.bb_config.default_pool, create_args->size);
+		   create_args->pool, create_args->size);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	if (bb_state.bb_config.other_timeout)
 		timeout = bb_state.bb_config.other_timeout * 1000;
 	else
 		timeout = DEFAULT_OTHER_TIMEOUT * 1000;
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 	i = 11;
 	if (create_args->access) {
 		script_argv[i++] = xstrdup("-a");
@@ -3788,11 +3989,11 @@ static void *_create_persistent(void *x)
 				   plugin_type, __func__, resp_msg);
 			resp_msg = NULL;
 		}
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		_reset_buf_state(create_args->user_id, create_args->job_id,
 				 create_args->name, BB_STATE_PENDING, 0);
 		bb_state.last_update_time = time(NULL);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		unlock_slurmctld(job_write_lock);
 	} else if (resp_msg && strstr(resp_msg, "created")) {
 		assoc_mgr_lock_t assoc_locks =
@@ -3804,13 +4005,14 @@ static void *_create_persistent(void *x)
 			error("%s: unable to find job record for job %u",
 			      __func__, create_args->job_id);
 		}
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		_reset_buf_state(create_args->user_id, create_args->job_id,
 				 create_args->name, BB_STATE_ALLOCATED,
 				 create_args->size);
 		bb_alloc = bb_alloc_name_rec(&bb_state, create_args->name,
 					     create_args->user_id);
 		bb_alloc->size = create_args->size;
+		bb_alloc->pool = xstrdup(create_args->pool);
 		assoc_mgr_lock(&assoc_locks);
 		if (job_ptr) {
 			bb_alloc->account   = xstrdup(job_ptr->account);
@@ -3858,7 +4060,7 @@ static void *_create_persistent(void *x)
 		(void) bb_post_persist_create(job_ptr, bb_alloc, &bb_state);
 		bb_state.last_update_time = time(NULL);
 		assoc_mgr_unlock(&assoc_locks);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		unlock_slurmctld(job_write_lock);
 	}
 	xfree(resp_msg);
@@ -3879,7 +4081,7 @@ static void *_destroy_persistent(void *x)
 	uint32_t timeout;
 	DEF_TIMERS;
 
-	pthread_mutex_lock(&bb_state.bb_mutex);
+	slurm_mutex_lock(&bb_state.bb_mutex);
 	bb_alloc = bb_find_name_rec(destroy_args->name, destroy_args->user_id,
 				    &bb_state);
 	if (!bb_alloc) {
@@ -3891,7 +4093,7 @@ static void *_destroy_persistent(void *x)
 		timeout = bb_state.bb_config.other_timeout * 1000;
 	else
 		timeout = DEFAULT_OTHER_TIMEOUT * 1000;
-	pthread_mutex_unlock(&bb_state.bb_mutex);
+	slurm_mutex_unlock(&bb_state.bb_mutex);
 
 	script_argv = xmalloc(sizeof(char *) * 10);	/* NULL terminated */
 	script_argv[0] = xstrdup("dw_wlm_cli");
@@ -3931,17 +4133,17 @@ static void *_destroy_persistent(void *x)
 			xstrfmtcat(job_ptr->state_desc, "%s: %s: %s",
 				   plugin_type, __func__, resp_msg);
 		}
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		_reset_buf_state(destroy_args->user_id, destroy_args->job_id,
 				 destroy_args->name, BB_STATE_PENDING, 0);
 		bb_state.last_update_time = time(NULL);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 		unlock_slurmctld(job_write_lock);
 	} else {
 		assoc_mgr_lock_t assoc_locks =
 			{ READ_LOCK, NO_LOCK, READ_LOCK, NO_LOCK,
 			  NO_LOCK, NO_LOCK, NO_LOCK };
-		pthread_mutex_lock(&bb_state.bb_mutex);
+		slurm_mutex_lock(&bb_state.bb_mutex);
 		_reset_buf_state(destroy_args->user_id, destroy_args->job_id,
 				 destroy_args->name, BB_STATE_DELETED, 0);
 
@@ -3950,8 +4152,8 @@ static void *_destroy_persistent(void *x)
 			bb_alloc->state = BB_STATE_COMPLETE;
 			bb_alloc->job_id = destroy_args->job_id;
 			bb_alloc->state_time = time(NULL);
-			bb_limit_rem(bb_alloc->user_id,
-				     bb_alloc->size, &bb_state);
+			bb_limit_rem(bb_alloc->user_id, bb_alloc->size,
+				     bb_alloc->pool, &bb_state);
 
 			assoc_mgr_lock(&assoc_locks);
 			(void) bb_post_persist_delete(bb_alloc, &bb_state);
@@ -3960,7 +4162,7 @@ static void *_destroy_persistent(void *x)
 			(void) bb_free_alloc_rec(&bb_state, bb_alloc);
 		}
 		bb_state.last_update_time = time(NULL);
-		pthread_mutex_unlock(&bb_state.bb_mutex);
+		slurm_mutex_unlock(&bb_state.bb_mutex);
 	}
 	xfree(resp_msg);
 	_free_create_args(destroy_args);
@@ -4375,7 +4577,7 @@ _parse_config_links(json_object *instance, bb_configs_t *ent)
 		switch (type) {
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (!strcmp(iter.key, "instance"))
+			if (!xstrcmp(iter.key, "instance"))
 				ent->instance = x;
 			break;
 		default:
@@ -4397,12 +4599,12 @@ _json_parse_configs_object(json_object *jobj, bb_configs_t *ent)
 		type = json_object_get_type(iter.val);
 		switch (type) {
 		case json_type_object:
-			if (strcmp(iter.key, "links") == 0)
+			if (xstrcmp(iter.key, "links") == 0)
 				_parse_config_links(iter.val, ent);
 			break;
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (strcmp(iter.key, "id") == 0) {
+			if (xstrcmp(iter.key, "id") == 0) {
 				ent->id = x;
 			}
 			break;
@@ -4425,7 +4627,7 @@ _parse_instance_capacity(json_object *instance, bb_instances_t *ent)
 		switch (type) {
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (!strcmp(iter.key, "bytes"))
+			if (!xstrcmp(iter.key, "bytes"))
 				ent->bytes = x;
 			break;
 		default:
@@ -4448,18 +4650,18 @@ _json_parse_instances_object(json_object *jobj, bb_instances_t *ent)
 		type = json_object_get_type(iter.val);
 		switch (type) {
 		case json_type_object:
-			if (strcmp(iter.key, "capacity") == 0)
+			if (xstrcmp(iter.key, "capacity") == 0)
 				_parse_instance_capacity(iter.val, ent);
 			break;
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (strcmp(iter.key, "id") == 0) {
+			if (xstrcmp(iter.key, "id") == 0) {
 				ent->id = x;
 			}
 			break;
 		case json_type_string:
 			p = json_object_get_string(iter.val);
-			if (strcmp(iter.key, "label") == 0) {
+			if (xstrcmp(iter.key, "label") == 0) {
 				ent->label = xstrdup(p);
 			}
 			break;
@@ -4484,19 +4686,19 @@ _json_parse_pools_object(json_object *jobj, bb_pools_t *ent)
 		switch (type) {
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (strcmp(iter.key, "granularity") == 0) {
+			if (xstrcmp(iter.key, "granularity") == 0) {
 				ent->granularity = x;
-			} else if (strcmp(iter.key, "quantity") == 0) {
+			} else if (xstrcmp(iter.key, "quantity") == 0) {
 				ent->quantity = x;
-			} else if (strcmp(iter.key, "free") == 0) {
+			} else if (xstrcmp(iter.key, "free") == 0) {
 				ent->free = x;
 			}
 			break;
 		case json_type_string:
 			p = json_object_get_string(iter.val);
-			if (strcmp(iter.key, "id") == 0) {
+			if (xstrcmp(iter.key, "id") == 0) {
 				ent->id = xstrdup(p);
-			} else if (strcmp(iter.key, "units") == 0) {
+			} else if (xstrcmp(iter.key, "units") == 0) {
 				ent->units = xstrdup(p);
 			}
 			break;
@@ -4521,17 +4723,17 @@ _json_parse_sessions_object(json_object *jobj, bb_sessions_t *ent)
 		switch (type) {
 		case json_type_int:
 			x = json_object_get_int64(iter.val);
-			if (strcmp(iter.key, "created") == 0) {
+			if (xstrcmp(iter.key, "created") == 0) {
 				ent->created = x;
-			} else if (strcmp(iter.key, "id") == 0) {
+			} else if (xstrcmp(iter.key, "id") == 0) {
 				ent->id = x;
-			} else if (strcmp(iter.key, "owner") == 0) {
+			} else if (xstrcmp(iter.key, "owner") == 0) {
 				ent->user_id = x;
 			}
 			break;
 		case json_type_string:
 			p = json_object_get_string(iter.val);
-			if (strcmp(iter.key, "token") == 0) {
+			if (xstrcmp(iter.key, "token") == 0) {
 				ent->token = xstrdup(p);
 			}
 		default:
@@ -4559,7 +4761,7 @@ extern char *bb_p_xlate_bb_2_tres_str(char *burst_buffer)
 	while (tok) {
 		sep = strchr(tok, ':');
 		if (sep) {
-			if (!strncmp(tok, "cray:", 5))
+			if (!xstrncmp(tok, "cray:", 5))
 				tok += 5;
 			else
 				tok = NULL;
diff --git a/src/plugins/burst_buffer/generic/Makefile.in b/src/plugins/burst_buffer/generic/Makefile.in
index 972a0f8fe..16bfc7193 100644
--- a/src/plugins/burst_buffer/generic/Makefile.in
+++ b/src/plugins/burst_buffer/generic/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/burst_buffer/generic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/burst_buffer/generic/burst_buffer_generic.c b/src/plugins/burst_buffer/generic/burst_buffer_generic.c
index ce155f366..a2d7de216 100644
--- a/src/plugins/burst_buffer/generic/burst_buffer_generic.c
+++ b/src/plugins/burst_buffer/generic/burst_buffer_generic.c
@@ -86,675 +86,12 @@ const char plugin_name[]        = "burst_buffer generic plugin";
 const char plugin_type[]        = "burst_buffer/generic";
 const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
 
-/* Most state information is in a common structure so that we can more
- * easily use common functions from multiple burst buffer plugins */
-static bb_state_t 	bb_state;
-
-/* Local function defintions */
-static void	_alloc_job_bb(struct job_record *job_ptr, uint64_t bb_size);
-static void *	_bb_agent(void *args);
-static char **	_build_stage_args(char *cmd, char *opt,
-				  struct job_record *job_ptr,
-				  uint64_t bb_size);
-static void	_destroy_job_info(void *data);
-static bb_alloc_t *_find_bb_name_rec(char *name, uint32_t user_id);
-static uint64_t	_get_bb_size(struct job_record *job_ptr);
-static void	_load_state(uint32_t job_id);
-static int	_parse_job_info(void **dest, slurm_parser_enum_t type,
-				const char *key, const char *value,
-				const char *line, char **leftover);
-static void	_stop_stage_in(uint32_t job_id);
-static void	_stop_stage_out(uint32_t job_id);
-static void	_test_config(void);
-static int	_test_size_limit(struct job_record *job_ptr,uint64_t add_space);
-static void	_timeout_bb_rec(void);
-
-/* Validate that our configuration is valid for this plugin type */
-static void _test_config(void)
-{
-	if (!bb_state.bb_config.get_sys_state)
-		fatal("%s: GetSysState is NULL", __func__);
-	if (!bb_state.bb_config.start_stage_in)
-		fatal("%s: StartStageIn is NULL", __func__);
-	if (!bb_state.bb_config.start_stage_out)
-		fatal("%s: StartStageOUT is NULL", __func__);
-	if (!bb_state.bb_config.stop_stage_in)
-		fatal("%s: StopStageIn is NULL", __func__);
-	if (!bb_state.bb_config.stop_stage_out)
-		fatal("%s: StopStageOUT is NULL", __func__);
-}
-
-/* Return the burst buffer size requested by a job */
-static uint64_t _get_bb_size(struct job_record *job_ptr)
-{
-	char *tok;
-	uint64_t bb_size_u = 0;
-
-	if (job_ptr->burst_buffer) {
-		tok = strstr(job_ptr->burst_buffer, "size=");
-		if (tok)
-			bb_size_u = bb_get_size_num(tok + 5,
-						bb_state.bb_config.granularity);
-	}
-
-	return bb_size_u;
-}
-
-static char **_build_stage_args(char *cmd, char *opt,
-				struct job_record *job_ptr, uint64_t bb_size)
-{
-	char **script_argv = NULL;
-	char *save_ptr = NULL, *script, *tok;
-	int script_argc = 0, size;
-	char jobid_buf[32];
-
-	if (job_ptr->batch_flag == 0)
-		return script_argv;
-
-	script = get_job_script(job_ptr);
-	if (!script) {
-		error("%s: failed to get script for %s", __func__,
-		      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-		return script_argv;
-	}
-
-	size = 20;
-	script_argv = xmalloc(sizeof(char *) * size);
-	tok = strrchr(cmd, '/');
-	if (tok)
-		xstrfmtcat(script_argv[0], "%s", tok + 1);
-	else
-		xstrfmtcat(script_argv[0], "%s", cmd);
-	xstrfmtcat(script_argv[1], "%s", opt);
-	xstrfmtcat(script_argv[2], "%u", job_ptr->job_id);
-	xstrfmtcat(script_argv[3], "%u", job_ptr->user_id);
-	xstrfmtcat(script_argv[4], "%"PRIu64"", bb_size);
-	script_argc += 5;
-	tok = strtok_r(script, "\n", &save_ptr);
-	while (tok) {
-		if (tok[0] != '#')
-			break;
-		if (tok[1] != '!') {
-			if ((script_argc + 1) >= size) {
-				size *= 2;
-				script_argv = xrealloc(script_argv,
-						       sizeof(char *) * size);
-			}
-			script_argv[script_argc++] = xstrdup(tok);
-		}
-		tok = strtok_r(NULL, "\n", &save_ptr);
-	}
-	xfree(script);
-
-	return script_argv;
-}
-
-static void _stop_stage_in(uint32_t job_id)
-{
-	char **script_argv = NULL;
-	char *resp, *tok;
-	int i, status = 0;
-
-	if (!bb_state.bb_config.stop_stage_in)
-		return;
-
-	script_argv = xmalloc(sizeof(char *) * 4);
-	tok = strrchr(bb_state.bb_config.stop_stage_in, '/');
-	if (tok) {
-		xstrfmtcat(script_argv[0], "%s", tok + 1);
-	} else {
-		xstrfmtcat(script_argv[0], "%s",
-			   bb_state.bb_config.stop_stage_in);
-	}
-	xstrfmtcat(script_argv[1], "%s", "stop_stage_in");
-	xstrfmtcat(script_argv[2], "%u", job_id);
-
-	resp = bb_run_script("StopStageIn",
-			     bb_state.bb_config.stop_stage_in,
-			     script_argv, -1, &status);
-	if (resp) {
-		error("%s: StopStageIn: %s", __func__, resp);
-		xfree(resp);
-	}
-	for (i = 0; script_argv[i]; i++)
-		xfree(script_argv[i]);
-	xfree(script_argv);
-}
-
-static void _stop_stage_out(uint32_t job_id)
-{
-	char **script_argv = NULL;
-	char *resp, *tok;
-	int i, status = 0;
-
-	if (!bb_state.bb_config.stop_stage_out)
-		return;
-
-	script_argv = xmalloc(sizeof(char *) * 4);
-	tok = strrchr(bb_state.bb_config.stop_stage_out, '/');
-	if (tok)
-		xstrfmtcat(script_argv[0], "%s", tok + 1);
-	else
-		xstrfmtcat(script_argv[0], "%s",
-			   bb_state.bb_config.stop_stage_out);
-	xstrfmtcat(script_argv[1], "%s", "stop_stage_out");
-	xstrfmtcat(script_argv[2], "%u", job_id);
-
-	resp = bb_run_script("StopStageOut", bb_state.bb_config.stop_stage_out,
-			     script_argv, -1, &status);
-	if (resp) {
-		error("%s: StopStageOut: %s", __func__, resp);
-		xfree(resp);
-	}
-	for (i = 0; script_argv[i]; i++)
-		xfree(script_argv[i]);
-	xfree(script_argv);
-}
-
-/* Find a per-job burst buffer record with a specific name.
- * If not found, return NULL. */
-static bb_alloc_t * _find_bb_name_rec(char *name, uint32_t user_id)
-{
-	bb_alloc_t *bb_ptr = NULL;
-
-	xassert(bb_state.bb_ahash);
-	bb_ptr = bb_state.bb_ahash[user_id % BB_HASH_SIZE];
-	while (bb_ptr) {
-		if (!xstrcmp(bb_ptr->name, name))
-			return bb_ptr;
-		bb_ptr = bb_ptr->next;
-	}
-	return bb_ptr;
-}
-
-/* Handle timeout of burst buffer events:
- * 1. Purge per-job burst buffer records when the stage-out has completed and
- *    the job has been purged from Slurm
- * 2. Test for StageInTimeout events
- * 3. Test for StageOutTimeout events
- */
-static void _timeout_bb_rec(void)
-{
-	struct job_record *job_ptr;
-	bb_alloc_t **bb_pptr, *bb_ptr = NULL;
-	uint32_t age;
-	time_t now = time(NULL);
-	int i;
-
-	for (i = 0; i < BB_HASH_SIZE; i++) {
-		bb_pptr = &bb_state.bb_ahash[i];
-		bb_ptr = bb_state.bb_ahash[i];
-		while (bb_ptr) {
-			if (bb_ptr->seen_time < bb_state.last_load_time) {
-				if (bb_ptr->job_id == 0) {
-					info("%s: Persistent burst buffer %s "
-					     "purged",
-					     __func__, bb_ptr->name);
-				} else if (bb_state.bb_config.debug_flag) {
-					info("%s: burst buffer for job %u "
-					     "purged",
-					     __func__, bb_ptr->job_id);
-				}
-//FIXME: VESTIGIAL: Use bb_limit_rem
-//				bb_remove_user_load(bb_ptr, &bb_state);
-				*bb_pptr = bb_ptr->next;
-				bb_free_alloc_buf(bb_ptr);
-				break;
-			}
-			if ((bb_ptr->job_id != 0) &&
-			    (bb_ptr->state >= BB_STATE_STAGED_OUT) &&
-			    !find_job_record(bb_ptr->job_id)) {
-				_stop_stage_out(bb_ptr->job_id);
-				bb_ptr->cancelled = true;
-				bb_ptr->end_time = 0;
-				*bb_pptr = bb_ptr->next;
-				bb_free_alloc_buf(bb_ptr);
-				break;
-			}
-			age = difftime(now, bb_ptr->state_time);
-			if ((bb_ptr->job_id != 0) &&
-			    bb_state.bb_config.stop_stage_in &&
-			    (bb_ptr->state == BB_STATE_STAGING_IN) &&
-			    (bb_state.bb_config.stage_in_timeout != 0) &&
-			    (!bb_ptr->cancelled) &&
-			    (age >= bb_state.bb_config.stage_in_timeout)) {
-				_stop_stage_in(bb_ptr->job_id);
-				bb_ptr->cancelled = true;
-				bb_ptr->end_time = 0;
-				job_ptr = find_job_record(bb_ptr->job_id);
-				if (job_ptr) {
-					error("%s: StageIn timed out, holding "
-					      "job %u",
-					      __func__, bb_ptr->job_id);
-					job_ptr->priority = 0;
-					job_ptr->direct_set_prio = 1;
-					job_ptr->state_reason = WAIT_HELD;
-					xfree(job_ptr->state_desc);
-					job_ptr->state_desc = xstrdup(
-						"Burst buffer stage-in timeout");
-					last_job_update = now;
-				} else {
-					error("%s: StageIn timed out for "
-					      "vestigial job %u ",
-					      __func__, bb_ptr->job_id);
-				}
-			}
-			if ((bb_ptr->job_id != 0) &&
-			    bb_state.bb_config.stop_stage_out &&
-			    (bb_ptr->state == BB_STATE_STAGING_OUT) &&
-			    (bb_state.bb_config.stage_out_timeout != 0) &&
-			    (!bb_ptr->cancelled) &&
-			    (age >= bb_state.bb_config.stage_out_timeout)) {
-				error("%s: StageOut for job %u timed out",
-				      __func__, bb_ptr->job_id);
-				_stop_stage_out(bb_ptr->job_id);
-				bb_ptr->cancelled = true;
-				bb_ptr->end_time = 0;
-			}
-			bb_pptr = &bb_ptr->next;
-			bb_ptr = bb_ptr->next;
-		}
-	}
-}
-
-/* Test if a job can be allocated a burst buffer.
- * This may preempt currently active stage-in for higher priority jobs.
- *
- * RET 0: Job can be started now
- *     1: Job exceeds configured limits, continue testing with next job
- *     2: Job needs more resources than currently available can not start,
- *        skip all remaining jobs
- */
-static int _test_size_limit(struct job_record *job_ptr, uint64_t add_space)
-{
-	burst_buffer_info_msg_t *resv_bb;
-	struct preempt_bb_recs *preempt_ptr = NULL;
-	List preempt_list;
-	ListIterator preempt_iter;
-	uint64_t resv_space = 0;
-	int add_total_space_needed = 0, add_user_space_needed = 0;
-	int add_total_space_avail  = 0, add_user_space_avail  = 0;
-	time_t now = time(NULL), when;
-	bb_alloc_t *bb_ptr = NULL;
-	int i;
-	char jobid_buf[32];
-
-	if (job_ptr->start_time <= now)
-		when = now;
-	else
-		when = job_ptr->start_time;
-	resv_bb = job_test_bb_resv(job_ptr, when);
-	if (resv_bb) {
-		burst_buffer_info_t *resv_bb_ptr;
-		for (i = 0, resv_bb_ptr = resv_bb->burst_buffer_array;
-		     i < resv_bb->record_count; i++, resv_bb_ptr++) {
-			if (resv_bb_ptr->name &&
-			    strcmp(resv_bb_ptr->name, bb_state.name))
-				continue;
-			resv_bb_ptr->used_space =
-				bb_granularity(resv_bb_ptr->used_space,
-					       bb_state.bb_config.granularity);
-			resv_space += resv_bb_ptr->used_space;
-		}
-		slurm_free_burst_buffer_info_msg(resv_bb);
-	}
-
-	add_total_space_needed = bb_state.used_space + add_space + resv_space -
-				 bb_state.total_space;
-
-	if ((add_total_space_needed <= 0) &&
-	    (add_user_space_needed  <= 0))
-		return 0;
-
-	/* Identify candidate burst buffers to revoke for higher priority job */
-	preempt_list = list_create(bb_job_queue_del);
-	for (i = 0; i < BB_HASH_SIZE; i++) {
-		bb_ptr = bb_state.bb_ahash[i];
-		while (bb_ptr) {
-			if (bb_ptr->job_id &&
-			    (bb_ptr->use_time > now) &&
-			    (bb_ptr->use_time > job_ptr->start_time)) {
-				preempt_ptr = xmalloc(sizeof(
-						struct preempt_bb_recs));
-				preempt_ptr->bb_ptr = bb_ptr;
-				preempt_ptr->job_id = bb_ptr->job_id;
-				preempt_ptr->size = bb_ptr->size;
-				preempt_ptr->use_time = bb_ptr->use_time;
-				preempt_ptr->user_id = bb_ptr->user_id;
-				list_push(preempt_list, preempt_ptr);
-
-				add_total_space_avail += bb_ptr->size;
-				if (bb_ptr->user_id == job_ptr->user_id)
-					add_user_space_avail += bb_ptr->size;
-			}
-			bb_ptr = bb_ptr->next;
-		}
-	}
-
-	if ((add_total_space_avail >= add_total_space_needed) &&
-	    (add_user_space_avail  >= add_user_space_needed)) {
-		list_sort(preempt_list, bb_preempt_queue_sort);
-		preempt_iter = list_iterator_create(preempt_list);
-		while ((preempt_ptr = list_next(preempt_iter)) &&
-		       (add_total_space_needed || add_user_space_needed)) {
-			if (add_user_space_needed &&
-			    (preempt_ptr->user_id == job_ptr->user_id)) {
-				_stop_stage_in(preempt_ptr->job_id);
-				preempt_ptr->bb_ptr->cancelled = true;
-				preempt_ptr->bb_ptr->end_time = 0;
-				if (bb_state.bb_config.debug_flag) {
-					info("%s: %s: Preempting stage-in of "
-					     "job %u for %s", plugin_type,
-					     __func__, preempt_ptr->job_id,
-					     jobid2fmt(job_ptr, jobid_buf,
-						       sizeof(jobid_buf)));
-				}
-				add_user_space_needed  -= preempt_ptr->size;
-				add_total_space_needed -= preempt_ptr->size;
-			}
-			if ((add_total_space_needed > add_user_space_needed) &&
-			    (preempt_ptr->user_id != job_ptr->user_id)) {
-				_stop_stage_in(preempt_ptr->job_id);
-				preempt_ptr->bb_ptr->cancelled = true;
-				preempt_ptr->bb_ptr->end_time = 0;
-				if (bb_state.bb_config.debug_flag) {
-					info("%s: %s: Preempting stage-in of "
-					     "job %u for %s", plugin_type,
-					     __func__, preempt_ptr->job_id,
-					     jobid2fmt(job_ptr, jobid_buf,
-						       sizeof(jobid_buf)));
-				}
-				add_total_space_needed -= preempt_ptr->size;
-			}
-		}
-		list_iterator_destroy(preempt_iter);
-	}
-	FREE_NULL_LIST(preempt_list);
-
-	return 2;
-}
-
-static int _parse_job_info(void **dest, slurm_parser_enum_t type,
-			   const char *key, const char *value,
-			   const char *line, char **leftover)
-{
-	s_p_hashtbl_t *job_tbl;
-	char *name = NULL, *tmp = NULL, local_name[64] = "";
-	uint64_t size = 0;
-	uint32_t job_id = 0, user_id = 0;
-	uint16_t state = 0;
-	bb_alloc_t *bb_ptr;
-	struct job_record *job_ptr = NULL;
-	bb_job_t *bb_spec;
-	static s_p_options_t _job_options[] = {
-		{"JobID",S_P_STRING},
-		{"Name", S_P_STRING},
-		{"Size", S_P_STRING},
-		{"State", S_P_STRING},
-		{NULL}
-	};
-
-	*dest = NULL;
-	user_id = strtol(value, NULL, 10);
-	job_tbl = s_p_hashtbl_create(_job_options);
-	s_p_parse_line(job_tbl, *leftover, leftover);
-	if (s_p_get_string(&tmp, "JobID", job_tbl)) {
-		job_id = strtol(tmp, NULL, 10);
-		xfree(tmp);
-	}
-	if (s_p_get_string(&name, "Name", job_tbl)) {
-		snprintf(local_name, sizeof(local_name), "%s", name);
-		xfree(name);
-	}
-	if (s_p_get_string(&tmp, "Size", job_tbl)) {
-		size =  bb_get_size_num(tmp, bb_state.bb_config.granularity);
-		xfree(tmp);
-	}
-	if (s_p_get_string(&tmp, "State", job_tbl)) {
-		state = bb_state_num(tmp);
-		xfree(tmp);
-	}
-	s_p_hashtbl_destroy(job_tbl);
-
-#if 0
-	info("%s: JobID:%u Name:%s Size:%"PRIu64" State:%u UserID:%u",
-	     __func__, job_id, local_name, size, state, user_id);
-#endif
-	if (job_id) {
-		job_ptr = find_job_record(job_id);
-		if (!job_ptr && (state == BB_STATE_STAGED_OUT)) {
-			struct job_record job_rec;
-			job_rec.job_id  = job_id;
-			job_rec.user_id = user_id;
-			bb_ptr = bb_find_alloc_rec(&bb_state, &job_rec);
-			_stop_stage_out(job_id);	/* Purge buffer */
-			if (bb_ptr) {
-				bb_ptr->cancelled = true;
-				bb_ptr->end_time = 0;
-			} else {
-				/* Slurm knows nothing about this job,
-				 * may be result of slurmctld cold start */
-				error("%s: Vestigial buffer for purged job %u",
-				      plugin_type, job_id);
-			}
-			return SLURM_SUCCESS;
-		} else if (!job_ptr &&
-			   ((state == BB_STATE_STAGING_IN) ||
-			    (state == BB_STATE_STAGED_IN))) {
-			struct job_record job_rec;
-			job_rec.job_id  = job_id;
-			job_rec.user_id = user_id;
-			bb_ptr = bb_find_alloc_rec(&bb_state, &job_rec);
-			_stop_stage_in(job_id);		/* Purge buffer */
-			if (bb_ptr) {
-				bb_ptr->cancelled = true;
-				bb_ptr->end_time = 0;
-			} else {
-				/* Slurm knows nothing about this job,
-				 * may be result of slurmctld cold start */
-				error("%s: Vestigial buffer for purged job %u",
-				      plugin_type, job_id);
-			}
-			return SLURM_SUCCESS;
-		} else if (!job_ptr) {
-			error("%s: Vestigial buffer for job ID %u. "
-			      "Clear manually",
-			      plugin_type, job_id);
-		}
-		snprintf(local_name, sizeof(local_name), "VestigialJob%u",
-			 job_id);
-	}
-	if (job_ptr) {
-		bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-		if (bb_ptr == NULL) {
-			bb_spec = xmalloc(sizeof(bb_job_t));
-			bb_spec->total_size = _get_bb_size(job_ptr);
-			bb_ptr = bb_alloc_job_rec(&bb_state, job_ptr, bb_spec);
-			xfree(bb_spec);
-			bb_ptr->state = state;
-			/* bb_ptr->state_time set in bb_alloc_job_rec() */
-		}
-	} else {
-		if ((bb_ptr = _find_bb_name_rec(local_name, user_id)) == NULL) {
-			bb_ptr = bb_alloc_name_rec(&bb_state, local_name,
-						   user_id);
-			bb_ptr->size = size;
-			bb_ptr->state = state;
-//FIXME: VESTIGIAL: Use bb_limit_add
-//			bb_add_user_load(bb_ptr, &bb_state);
-			return SLURM_SUCCESS;
-		}
-	}
-	bb_ptr->seen_time = time(NULL); /* used to purge defunct recs */
-
-	/* UserID set to 0 on some failure modes */
-	if ((bb_ptr->user_id != user_id) && (user_id != 0)) {
-		error("%s: User ID mismatch (%u != %u). "
-		      "BB UserID=%u JobID=%u Name=%s",
-		      plugin_type, bb_ptr->user_id, user_id,
-		      bb_ptr->user_id, bb_ptr->job_id, bb_ptr->name);
-	}
-	if ((bb_ptr->state == BB_STATE_RUNNING) &&
-	    (state == BB_STATE_STAGED_IN))
-		state = BB_STATE_RUNNING;	/* More precise state info */
-	if (bb_ptr->state != state) {
-		/* State is subject to real-time changes */
-		debug("%s: State changed (%s to %s). "
-		      "BB UserID=%u JobID=%u Name=%s",
-		      plugin_type, bb_state_string(bb_ptr->state),
-		      bb_state_string(state),
-		      bb_ptr->user_id, bb_ptr->job_id, bb_ptr->name);
-		bb_ptr->state = state;
-		bb_ptr->state_time = time(NULL);
-		if (bb_ptr->state == BB_STATE_STAGED_OUT) {
-			if (bb_ptr->size != 0) {
-//FIXME: VESTIGIAL: Use bb_limit_rem
-//				bb_remove_user_load(bb_ptr, &bb_state);
-				bb_ptr->size = 0;
-			}
-		}
-		if (bb_ptr->state == BB_STATE_STAGED_IN)
-			queue_job_scheduler();
-	}
-	if ((bb_ptr->state != BB_STATE_STAGED_OUT) && (bb_ptr->size != size)) {
-//FIXME: VESTIGIAL: Use bb_limit_rem
-//		bb_remove_user_load(bb_ptr, &bb_state);
-		if (size != 0) {
-			error("%s: Size mismatch (%"PRIu64" != %"PRIu64"). "
-			      "BB UserID=%u JobID=%u Name=%s",
-			      plugin_type, bb_ptr->size, size,
-			      bb_ptr->user_id, bb_ptr->job_id, bb_ptr->name);
-		}
-		bb_ptr->size = MAX(bb_ptr->size, size);
-//FIXME: VESTIGIAL: Use bb_limit_add
-//		bb_add_user_load(bb_ptr, &bb_state);
-	}
-
-	return SLURM_SUCCESS;
-}
-
-/* Destroy any records created by _parse_job_info(), currently none */
-static void _destroy_job_info(void *data)
-{
-}
-
-/*
- * Determine the current actual burst buffer state.
- * Run the program "get_sys_state" and parse stdout for details.
- * job_id IN - specific job to get information about, or 0 for all jobs
- */
-static void _load_state(uint32_t job_id)
-{
-	static uint64_t last_total_space = 0;
-	char *save_ptr = NULL, *tok, *leftover = NULL, *resp, *tmp = NULL;
-	char *script_args[4], job_id_str[32];
-	s_p_hashtbl_t *state_hashtbl = NULL;
-	static s_p_options_t state_options[] = {
-		{"ENOENT", S_P_STRING},
-		{"UserID", S_P_ARRAY, _parse_job_info, _destroy_job_info},
-		{"TotalSize", S_P_STRING},
-		{NULL}
-	};
-	int status = 0;
-	DEF_TIMERS;
-
-	if (!bb_state.bb_config.get_sys_state)
-		return;
-
-	bb_state.last_load_time = time(NULL);
-
-	tok = strrchr(bb_state.bb_config.get_sys_state, '/');
-	if (tok)
-		script_args[0] = tok + 1;
-	else
-		script_args[0] = bb_state.bb_config.get_sys_state;
-	if (job_id) {
-		script_args[1] = "get_job";
-		snprintf(job_id_str, sizeof(job_id_str), "%u", job_id);
-		script_args[3] = NULL;
-	} else {
-		script_args[1] = "get_sys";
-		script_args[2] = NULL;
-	}
-	START_TIMER;
-	resp = bb_run_script("GetSysState", bb_state.bb_config.get_sys_state,
-			     script_args, 2000, &status);
-	if (resp == NULL)
-		return;
-	END_TIMER;
-	if (DELTA_TIMER > 200000)	/* 0.2 secs */
-		info("%s: GetSysState ran for %s", __func__, TIME_STR);
-	else if (bb_state.bb_config.debug_flag)
-		debug("%s: GetSysState ran for %s", __func__, TIME_STR);
-
-	state_hashtbl = s_p_hashtbl_create(state_options);
-	tok = strtok_r(resp, "\n", &save_ptr);
-	while (tok) {
-		s_p_parse_line(state_hashtbl, tok, &leftover);
-		tok = strtok_r(NULL, "\n", &save_ptr);
-	}
-	if (s_p_get_string(&tmp, "TotalSize", state_hashtbl)) {
-		bb_state.total_space = bb_get_size_num(tmp,
-						bb_state.bb_config.granularity);
-		xfree(tmp);
-		if (bb_state.bb_config.debug_flag &&
-		    (bb_state.total_space != last_total_space)) {
-			info("%s: total_space:%"PRIu64"",  __func__,
-			     bb_state.total_space);
-		}
-		last_total_space = bb_state.total_space;
-	} else if (job_id == 0) {
-		error("%s: GetSysState failed to respond with TotalSize",
-		      plugin_type);
-	}
-	s_p_hashtbl_destroy(state_hashtbl);
-	xfree(resp);
-}
-
-/* Perform periodic background activities */
-static void *_bb_agent(void *args)
-{
-	/* Locks: write job */
-	slurmctld_lock_t job_write_lock = {
-		NO_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK };
-
-	while (!bb_state.term_flag) {
-		bb_sleep(&bb_state, AGENT_INTERVAL);
-		if (bb_state.term_flag)
-			break;
-		lock_slurmctld(job_write_lock);
-		pthread_mutex_lock(&bb_state.bb_mutex);
-		_load_state(0);
-		_timeout_bb_rec();
-		pthread_mutex_unlock(&bb_state.bb_mutex);
-		unlock_slurmctld(job_write_lock);
-	}
-	return NULL;
-}
-
 /*
  * init() is called when the plugin is loaded, before any other functions
  * are called.  Put global initialization here.
  */
 extern int init(void)
 {
-	pthread_attr_t attr;
-
-	pthread_mutex_init(&bb_state.bb_mutex, NULL);
-	pthread_cond_init(&bb_state.term_cond, NULL);
-	pthread_mutex_init(&bb_state.term_mutex, NULL);
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_load_config(&bb_state, (char *)plugin_type); /* Remove "const" */
-	_test_config();
-	if (bb_state.bb_config.debug_flag)
-		info("%s: %s", plugin_type,  __func__);
-	bb_alloc_cache(&bb_state);
-	slurm_attr_init(&attr);
-	if (pthread_create(&bb_state.bb_thread, &attr, _bb_agent, NULL))
-		error("Unable to start backfill thread: %m");
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -763,23 +100,6 @@ extern int init(void)
  */
 extern int fini(void)
 {
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.bb_config.debug_flag)
-		info("%s: %s", plugin_type,  __func__);
-
-	pthread_mutex_lock(&bb_state.term_mutex);
-	bb_state.term_flag = true;
-	pthread_cond_signal(&bb_state.term_cond);
-	pthread_mutex_unlock(&bb_state.term_mutex);
-
-	if (bb_state.bb_thread) {
-		pthread_join(bb_state.bb_thread, NULL);
-		bb_state.bb_thread = 0;
-	}
-	bb_clear_config(&bb_state.bb_config, true);
-	bb_clear_cache(&bb_state);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -789,10 +109,6 @@ extern int fini(void)
 extern uint64_t bb_p_get_system_size(void)
 {
 	uint64_t size = 0;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	size = bb_state.total_space / (1024 * 1024);	/* bytes to MB */
-	pthread_mutex_unlock(&bb_state.bb_mutex);
 	return size;
 }
 
@@ -807,14 +123,6 @@ extern uint64_t bb_p_get_system_size(void)
  */
 extern int bb_p_load_state(bool init_config)
 {
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.bb_config.debug_flag)
-		info("%s: %s", plugin_type,  __func__);
-	_load_state(0);
-	if (init_config)
-		bb_set_tres_pos(&bb_state);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -825,13 +133,6 @@ extern int bb_p_load_state(bool init_config)
  */
 extern int bb_p_reconfig(void)
 {
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.bb_config.debug_flag)
-		info("%s: %s", plugin_type,  __func__);
-	bb_load_config(&bb_state, (char *)plugin_type); /* Remove "const" */
-	_test_config();
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -843,21 +144,6 @@ extern int bb_p_reconfig(void)
  */
 extern int bb_p_state_pack(uid_t uid, Buf buffer, uint16_t protocol_version)
 {
-	uint32_t rec_count = 0;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	packstr(bb_state.name, buffer);
-	bb_pack_state(&bb_state, buffer, protocol_version);
-	if ((bb_state.bb_config.flags & BB_FLAG_PRIVATE_DATA) == 0)
-		uid = 0;	/* User can see all data */
-	rec_count = bb_pack_bufs(uid, &bb_state, buffer, protocol_version);
-	(void) bb_pack_usage(uid, &bb_state, buffer, protocol_version);
-	if (bb_state.bb_config.debug_flag) {
-		debug("%s: %s: record_count:%u",
-		      plugin_type,  __func__, rec_count);
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -871,69 +157,6 @@ extern int bb_p_state_pack(uid_t uid, Buf buffer, uint16_t protocol_version)
 extern int bb_p_job_validate(struct job_descriptor *job_desc,
 			     uid_t submit_uid)
 {
-	int64_t bb_size = 0;
-	char *key;
-	int i;
-
-	xassert(job_desc);
-	xassert(job_desc->tres_req_cnt);
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: job_user_id:%u, submit_uid:%d",
-		     plugin_type, __func__, job_desc->user_id, submit_uid);
-		info("%s: burst_buffer:%s", __func__, job_desc->burst_buffer);
-		info("%s: script:%s", __func__, job_desc->script);
-	}
-
-	if (job_desc->burst_buffer) {
-		key = strstr(job_desc->burst_buffer, "size=");
-		if (key) {
-			bb_size = bb_get_size_num(key + 5,
-					bb_state.bb_config.granularity);
-		}
-	}
-	if (bb_size == 0)
-		return SLURM_SUCCESS;
-	if (bb_size < 0)
-		return ESLURM_BURST_BUFFER_LIMIT;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.bb_config.allow_users) {
-		for (i = 0; bb_state.bb_config.allow_users[i]; i++) {
-			if (job_desc->user_id ==
-			    bb_state.bb_config.allow_users[i])
-				break;
-		}
-		if (bb_state.bb_config.allow_users[i] == 0) {
-			pthread_mutex_unlock(&bb_state.bb_mutex);
-			return ESLURM_BURST_BUFFER_PERMISSION;
-		}
-	}
-
-	if (bb_state.bb_config.deny_users) {
-		for (i = 0; bb_state.bb_config.deny_users[i]; i++) {
-			if (job_desc->user_id ==
-			    bb_state.bb_config.deny_users[i])
-				break;
-		}
-		if (bb_state.bb_config.deny_users[i] != 0) {
-			pthread_mutex_unlock(&bb_state.bb_mutex);
-			return ESLURM_BURST_BUFFER_PERMISSION;
-		}
-	}
-
-	if (bb_size > bb_state.total_space) {
-		info("Job from user %u requested burst buffer size of "
-		     "%"PRIu64", but total space is only %"PRIu64"",
-		     job_desc->user_id, bb_size, bb_state.total_space);
-	}
-
-	if (bb_state.tres_pos > 0)
-		job_desc->tres_req_cnt[bb_state.tres_pos]
-			= bb_size / (1024 * 1024);
-
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -945,7 +168,6 @@ extern int bb_p_job_validate(struct job_descriptor *job_desc,
  */
 extern int bb_p_job_validate2(struct job_record *job_ptr, char **err_msg)
 {
-	/* This function is unused by this plugin type */
 	return SLURM_SUCCESS;
 }
 
@@ -960,16 +182,6 @@ extern void bb_p_job_set_tres_cnt(struct job_record *job_ptr,
 				  uint64_t *tres_cnt,
 				  bool locked)
 {
-	if (!tres_cnt) {
-		error("%s: No tres_cnt given when looking at job %u",
-		      __func__, job_ptr->job_id);
-	}
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.tres_pos > 0)
-		tres_cnt[bb_state.tres_pos]
-			= _get_bb_size(job_ptr) / (1024 * 1024);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
 }
 
 /*
@@ -977,143 +189,15 @@ extern void bb_p_job_set_tres_cnt(struct job_record *job_ptr,
  */
 extern time_t bb_p_job_get_est_start(struct job_record *job_ptr)
 {
-	bb_alloc_t *bb_ptr;
 	time_t est_start = time(NULL);
-	uint64_t bb_size;
-	int rc;
-	char jobid_buf[32];
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    ((bb_size = _get_bb_size(job_ptr)) == 0))
-		return est_start;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (!bb_ptr) {
-		rc = _test_size_limit(job_ptr, bb_size);
-		if (rc == 0) {		/* Could start now */
-			;
-		} else if (rc == 1) {	/* Exceeds configured limits */
-			est_start += 365 * 24 * 60 * 60;
-		} else {		/* No space currently available */
-			est_start = MAX(est_start, bb_state.next_end_time);
-		}
-	} else if (bb_ptr->state < BB_STATE_STAGED_IN) {
-		est_start++;
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return est_start;
 }
 
-static void _alloc_job_bb(struct job_record *job_ptr, uint64_t bb_size)
-{
-	char **script_argv, *resp;
-	bb_alloc_t *bb_ptr;
-	int i, status = 0;
-	bb_job_t *bb_spec;
-	char jobid_buf[32];
-
-	bb_spec = xmalloc(sizeof(bb_job_t));
-	bb_spec->total_size = bb_size;
-	bb_ptr = bb_alloc_job(&bb_state, job_ptr, bb_spec);
-	xfree(bb_spec);
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: start stage-in %s", __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-	script_argv = _build_stage_args(bb_state.bb_config.start_stage_in,
-					"start_stage_in", job_ptr, bb_size);
-	if (script_argv) {
-		bb_ptr->state = BB_STATE_STAGING_IN;
-		bb_ptr->state_time = time(NULL);
-		resp = bb_run_script("StartStageIn",
-				     bb_state.bb_config.start_stage_in,
-				     script_argv, -1, &status);
-		if (resp) {
-			error("%s: StartStageIn: %s", __func__, resp);
-			xfree(resp);
-		}
-		for (i = 0; script_argv[i]; i++)
-			xfree(script_argv[i]);
-		xfree(script_argv);
-	} else {
-		bb_ptr->state = BB_STATE_STAGED_IN;
-		bb_ptr->state_time = time(NULL);
-	}
-}
-
 /*
  * Attempt to allocate resources and begin file staging for pending jobs.
  */
 extern int bb_p_job_try_stage_in(List job_queue)
 {
-	bb_job_queue_rec_t *job_rec;
-	List job_candidates;
-	ListIterator job_iter;
-	struct job_record *job_ptr;
-	uint64_t bb_size;
-	int rc;
-
-	if (bb_state.bb_config.debug_flag)
-		info("%s: %s", plugin_type,  __func__);
-
-	if (!bb_state.bb_config.start_stage_in)
-		return SLURM_ERROR;
-
-	/* Identify candidates to be allocated burst buffers */
-	job_candidates = list_create(bb_job_queue_del);
-	job_iter = list_iterator_create(job_queue);
-	while ((job_ptr = list_next(job_iter))) {
-		if (!IS_JOB_PENDING(job_ptr) ||
-		    (job_ptr->start_time == 0) ||
-		    (job_ptr->burst_buffer == NULL) ||
-		    (job_ptr->burst_buffer[0] == '\0'))
-			continue;
-		if (job_ptr->array_recs && (job_ptr->array_task_id == NO_VAL))
-			continue;
-		bb_size = _get_bb_size(job_ptr);
-		if (bb_size == 0)
-			continue;
-		job_rec = xmalloc(sizeof(bb_job_queue_rec_t));
-		job_rec->job_ptr = job_ptr;
-		job_rec->bb_size = bb_size;
-		list_push(job_candidates, job_rec);
-	}
-	list_iterator_destroy(job_iter);
-
-	/* Sort in order of expected start time */
-	list_sort(job_candidates, bb_job_queue_sort);
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_set_use_time(&bb_state);
-	job_iter = list_iterator_create(job_candidates);
-	while ((job_rec = list_next(job_iter))) {
-		job_ptr = job_rec->job_ptr;
-		bb_size = job_rec->bb_size;
-
-		if (bb_find_alloc_rec(&bb_state, job_ptr))
-			continue;
-
-		rc = _test_size_limit(job_ptr, bb_size);
-		if (rc == 1)
-			continue;
-		else if (rc == 2)
-			break;
-
-		_alloc_job_bb(job_ptr, bb_size);
-	}
-	list_iterator_destroy(job_iter);
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-	FREE_NULL_LIST(job_candidates);
-
 	return SLURM_SUCCESS;
 }
 
@@ -1128,46 +212,7 @@ extern int bb_p_job_try_stage_in(List job_queue)
  */
 extern int bb_p_job_test_stage_in(struct job_record *job_ptr, bool test_only)
 {
-	bb_alloc_t *bb_ptr;
-	uint64_t bb_size = 0;
-	int rc = 1;
-	char jobid_buf[32];
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    ((bb_size = _get_bb_size(job_ptr)) == 0))
-		return rc;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (!bb_ptr) {
-		debug("%s: %s bb_rec not found", __func__,
-		      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-		rc = -1;
-		if ((test_only == false) &&
-		    (_test_size_limit(job_ptr, bb_size) == 0))
-			_alloc_job_bb(job_ptr, bb_size);
-	} else {
-		if (bb_ptr->state < BB_STATE_STAGED_IN)
-			_load_state(job_ptr->job_id);
-		if (bb_ptr->state < BB_STATE_STAGED_IN) {
-			rc = 0;
-		} else if (bb_ptr->state == BB_STATE_STAGED_IN) {
-			rc = 1;
-		} else {
-			error("%s: %s bb_state:%u", __func__,
-			      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)),
-			      bb_ptr->state);
-			rc = -1;
-		}
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-	return rc;
+	return 1;
 }
 
 /* Attempt to claim burst buffer resources.
@@ -1178,19 +223,6 @@ extern int bb_p_job_test_stage_in(struct job_record *job_ptr, bool test_only)
  */
 extern int bb_p_job_begin(struct job_record *job_ptr)
 {
-	bb_alloc_t *bb_ptr;
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    (_get_bb_size(job_ptr) == 0))
-		return SLURM_SUCCESS;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (bb_ptr)
-		bb_ptr->state = BB_STATE_RUNNING;
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -1201,56 +233,6 @@ extern int bb_p_job_begin(struct job_record *job_ptr)
  */
 extern int bb_p_job_start_stage_out(struct job_record *job_ptr)
 {
-//FIXME: How to handle various job terminate states (e.g. requeue, failure), user script controlled?
-//FIXME: Test for memory leaks
-	bb_alloc_t *bb_ptr;
-	char **script_argv, *resp;
-	int i, status = 0;
-	char jobid_buf[32];
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-
-	if (!bb_state.bb_config.start_stage_out)
-		return SLURM_ERROR;
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    (_get_bb_size(job_ptr) == 0))
-		return SLURM_SUCCESS;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (!bb_ptr) {
-		/* No job buffers. Assuming use of persistent buffers only */
-		debug("%s: %s bb_rec not found", __func__,
-		      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	} else {
-		script_argv = _build_stage_args(bb_state.bb_config.start_stage_out,
-						"start_stage_out", job_ptr,
-						bb_ptr->size);
-		if (script_argv) {
-			bb_ptr->state = BB_STATE_STAGING_OUT;
-			bb_ptr->state_time = time(NULL);
-			resp = bb_run_script("StartStageOut",
-					     bb_state.bb_config.start_stage_out,
-					     script_argv, -1, &status);
-			if (resp) {
-				error("%s: StartStageOut: %s", __func__, resp);
-				xfree(resp);
-			}
-			for (i = 0; script_argv[i]; i++)
-				xfree(script_argv[i]);
-			xfree(script_argv);
-		} else {
-			bb_ptr->state = BB_STATE_STAGED_OUT;
-			bb_ptr->state_time = time(NULL);
-		}
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
@@ -1263,37 +245,7 @@ extern int bb_p_job_start_stage_out(struct job_record *job_ptr)
  */
 extern int bb_p_job_test_post_run(struct job_record *job_ptr)
 {
-	bb_job_t *bb_job;
-	int rc = -1;
-	char jobid_buf[32];
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0'))
-		return 1;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-	bb_job = bb_job_find(&bb_state, job_ptr->job_id);
-	if (!bb_job) {
-		/* No job buffers. Assuming use of persistent buffers only */
-		verbose("%s: %s bb job record not found", __func__,
-			jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-		rc =  1;
-	} else {
-		if (bb_job->state < BB_STATE_POST_RUN) {
-			rc = -1;
-		} else if (bb_job->state > BB_STATE_POST_RUN) {
-			rc =  1;
-		} else {
-			rc =  0;
-		}
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
-	return rc;
+	return 1;
 }
 
 /*
@@ -1305,49 +257,7 @@ extern int bb_p_job_test_post_run(struct job_record *job_ptr)
  */
 extern int bb_p_job_test_stage_out(struct job_record *job_ptr)
 {
-	bb_alloc_t *bb_ptr;
-	int rc = -1;
-	char jobid_buf[32];
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    (_get_bb_size(job_ptr) == 0))
-		return 1;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (!bb_ptr) {
-		/* No job buffers. Assuming use of persistent buffers only */
-		debug("%s: %s bb_rec not found", __func__,
-		      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-		rc =  1;
-	} else {
-		if (bb_ptr->state < BB_STATE_STAGED_OUT)
-			_load_state(job_ptr->job_id);
-		if (bb_ptr->state == BB_STATE_STAGING_OUT) {
-			rc =  0;
-		} else if (bb_ptr->state == BB_STATE_STAGED_OUT) {
-			if (bb_ptr->size != 0) {
-//FIXME: VESTIGIAL: Use bb_limit_rem
-//				bb_remove_user_load(bb_ptr, &bb_state);
-				bb_ptr->size = 0;
-			}
-			rc =  1;
-		} else {
-			error("%s: %s bb_state:%u", __func__,
-			      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)),
-			      bb_ptr->state);
-			rc = -1;
-		}
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
-	return rc;
+	return 1;
 }
 
 /*
@@ -1357,54 +267,6 @@ extern int bb_p_job_test_stage_out(struct job_record *job_ptr)
  */
 extern int bb_p_job_cancel(struct job_record *job_ptr)
 {
-	bb_alloc_t *bb_ptr;
-	char **script_argv, *resp;
-	int i, status = 0;
-	char jobid_buf[32];
-
-	if (bb_state.bb_config.debug_flag) {
-		info("%s: %s: %s", plugin_type, __func__,
-		     jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
-	}
-
-	if (!bb_state.bb_config.stop_stage_out)
-		return SLURM_ERROR;
-
-	if ((job_ptr->burst_buffer == NULL) ||
-	    (job_ptr->burst_buffer[0] == '\0') ||
-	    (_get_bb_size(job_ptr) == 0))
-		return SLURM_SUCCESS;
-
-	pthread_mutex_lock(&bb_state.bb_mutex);
-	bb_ptr = bb_find_alloc_rec(&bb_state, job_ptr);
-	if (!bb_ptr) {
-		_stop_stage_out(job_ptr->job_id);
-	} else {
-		script_argv = _build_stage_args(bb_state.bb_config.stop_stage_out,
-						"stop_stage_out", job_ptr, 0);
-		if (script_argv) {
-			bb_ptr->state = BB_STATE_STAGED_OUT;
-			bb_ptr->state_time = time(NULL);
-			resp = bb_run_script("StopStageOut",
-					     bb_state.bb_config.stop_stage_out,
-					     script_argv, -1, &status);
-			if (resp) {
-				error("%s: StopStageOut: %s", __func__, resp);
-				xfree(resp);
-			}
-			for (i = 0; script_argv[i]; i++)
-				xfree(script_argv[i]);
-			xfree(script_argv);
-		} else {
-			_stop_stage_out(job_ptr->job_id);
-			bb_ptr->cancelled = true;
-			bb_ptr->end_time = 0;
-			bb_ptr->state = BB_STATE_STAGED_OUT;
-			bb_ptr->state_time = time(NULL);
-		}
-	}
-	pthread_mutex_unlock(&bb_state.bb_mutex);
-
 	return SLURM_SUCCESS;
 }
 
diff --git a/src/plugins/checkpoint/Makefile.in b/src/plugins/checkpoint/Makefile.in
index 92e1e4fd1..3dc866744 100644
--- a/src/plugins/checkpoint/Makefile.in
+++ b/src/plugins/checkpoint/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/aix/Makefile.in b/src/plugins/checkpoint/aix/Makefile.in
index 5308b315d..cabf78227 100644
--- a/src/plugins/checkpoint/aix/Makefile.in
+++ b/src/plugins/checkpoint/aix/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint/aix
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +255,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +354,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +396,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +442,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +495,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/aix/checkpoint_aix.c b/src/plugins/checkpoint/aix/checkpoint_aix.c
index f36cb8379..307e8d725 100644
--- a/src/plugins/checkpoint/aix/checkpoint_aix.c
+++ b/src/plugins/checkpoint/aix/checkpoint_aix.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  checkpoint_aix.c - AIX slurm checkpoint plugin.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -316,7 +315,7 @@ extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint32_t x;
 		uint32_t y;
 		uint32_t z;
@@ -352,7 +351,7 @@ extern int slurm_ckpt_unpack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint16_t id;
 		uint32_t size;
 
diff --git a/src/plugins/checkpoint/blcr/Makefile.in b/src/plugins/checkpoint/blcr/Makefile.in
index 267475989..0e7b79b7a 100644
--- a/src/plugins/checkpoint/blcr/Makefile.in
+++ b/src/plugins/checkpoint/blcr/Makefile.in
@@ -94,7 +94,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint/blcr
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -260,8 +261,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -361,6 +360,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -399,6 +402,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -442,6 +448,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -492,6 +501,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/blcr/checkpoint_blcr.c b/src/plugins/checkpoint/blcr/checkpoint_blcr.c
index 59afe0068..ed70858ed 100644
--- a/src/plugins/checkpoint/blcr/checkpoint_blcr.c
+++ b/src/plugins/checkpoint/blcr/checkpoint_blcr.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  checkpoint_blcr.c - BLCR slurm checkpoint plugin.
- *  $Id: checkpoint_blcr.c 0001 2008-12-29 16:50:11Z hjcao $
  *****************************************************************************
  *  Derived from checkpoint_aix.c
  *  Copyright (C) 2007-2009 National University of Defense Technology, China.
@@ -57,6 +56,7 @@
 #include <unistd.h>
 #include <libgen.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/stat.h>
 
 #include "slurm/slurm.h"
@@ -85,8 +85,6 @@ void acct_policy_add_job_submit(struct job_record *job_ptr)
 void acct_policy_add_job_submit(struct job_record *job_ptr);
 #endif
 
-#define MAX_PATH_LEN 1024
-
 struct check_job_info {
 	uint16_t disabled;	/* counter, checkpointable only if zero */
 	time_t   time_stamp;	/* begin or end checkpoint time */
@@ -343,7 +341,7 @@ extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint32_t x;
 		uint32_t y;
 		uint32_t z;
@@ -376,7 +374,7 @@ extern int slurm_ckpt_unpack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint16_t id;
 		uint32_t size;
 
@@ -434,8 +432,8 @@ extern int slurm_ckpt_stepd_prefork(stepd_step_rec_t *job)
 				old_env = NULL;
 				if (!ptr)
 					break;
-				if (!strncmp(ptr, "libcr_run.so", 12) ||
-				    !strncmp(ptr, "libcr_omit.so", 13))
+				if (!xstrncmp(ptr, "libcr_run.so", 12) ||
+				    !xstrncmp(ptr, "libcr_omit.so", 13))
 					continue;
 				xstrcat(new_env, ptr);
 				xstrcat(new_env, ":");
@@ -454,7 +452,7 @@ extern int slurm_ckpt_stepd_prefork(stepd_step_rec_t *job)
 extern int slurm_ckpt_signal_tasks(stepd_step_rec_t *job, char *image_dir)
 {
 	char *argv[4];
-	char context_file[MAX_PATH_LEN];
+	char context_file[MAXPATHLEN];
 	char pid[16];
 	int status;
 	pid_t *children = NULL;
@@ -564,7 +562,7 @@ extern int slurm_ckpt_restart_task(stepd_step_rec_t *job,
 				   char *image_dir, int gtid)
 {
 	char *argv[3];
-	char context_file[MAX_PATH_LEN];
+	char context_file[MAXPATHLEN];
 
 	/* jobid and stepid must NOT be spelled here,
 	 * since it is a new job/step */
diff --git a/src/plugins/checkpoint/none/Makefile.in b/src/plugins/checkpoint/none/Makefile.in
index 22749ad4c..4a17fcb61 100644
--- a/src/plugins/checkpoint/none/Makefile.in
+++ b/src/plugins/checkpoint/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/none/checkpoint_none.c b/src/plugins/checkpoint/none/checkpoint_none.c
index d9e9c006a..469d668b2 100644
--- a/src/plugins/checkpoint/none/checkpoint_none.c
+++ b/src/plugins/checkpoint/none/checkpoint_none.c
@@ -132,7 +132,7 @@ extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
 	uint32_t size;
 
 	size = 0;
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		pack16(CHECK_NONE, buffer);
 		pack32(size, buffer);
 	}
@@ -146,7 +146,7 @@ extern int slurm_ckpt_unpack_job(check_jobinfo_t jobinfo, Buf buffer,
 	uint32_t x;
 	uint32_t size;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack16(&id, buffer);
 		safe_unpack32(&size, buffer);
 		if (id != CHECK_NONE) {
diff --git a/src/plugins/checkpoint/ompi/Makefile.in b/src/plugins/checkpoint/ompi/Makefile.in
index 782c27ed4..f79b1799e 100644
--- a/src/plugins/checkpoint/ompi/Makefile.in
+++ b/src/plugins/checkpoint/ompi/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint/ompi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/ompi/checkpoint_ompi.c b/src/plugins/checkpoint/ompi/checkpoint_ompi.c
index 0b2d346ff..6def4764d 100644
--- a/src/plugins/checkpoint/ompi/checkpoint_ompi.c
+++ b/src/plugins/checkpoint/ompi/checkpoint_ompi.c
@@ -248,7 +248,7 @@ extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint32_t x;
 		uint32_t y;
 		uint32_t z;
@@ -284,7 +284,7 @@ extern int slurm_ckpt_unpack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint16_t id;
 		uint32_t size;
 
diff --git a/src/plugins/checkpoint/poe/Makefile.in b/src/plugins/checkpoint/poe/Makefile.in
index b7ebd9401..507010d2e 100644
--- a/src/plugins/checkpoint/poe/Makefile.in
+++ b/src/plugins/checkpoint/poe/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/checkpoint/poe
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +255,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +354,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +396,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +442,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +495,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/checkpoint/poe/checkpoint_poe.c b/src/plugins/checkpoint/poe/checkpoint_poe.c
index 718a96750..192656902 100644
--- a/src/plugins/checkpoint/poe/checkpoint_poe.c
+++ b/src/plugins/checkpoint/poe/checkpoint_poe.c
@@ -172,10 +172,10 @@ extern int init ( void )
 
 extern int fini ( void )
 {
-	pthread_mutex_lock(&ckpt_agent_mutex);
+	slurm_mutex_lock(&ckpt_agent_mutex);
 	ckpt_agent_stop = true;
 	pthread_cond_signal(&ckpt_agent_cond);
-	pthread_mutex_unlock(&ckpt_agent_mutex);
+	slurm_mutex_unlock(&ckpt_agent_mutex);
 
 	if (ckpt_agent_tid && pthread_join(ckpt_agent_tid, NULL)) {
 		error("Could not kill checkpoint pthread");
@@ -321,7 +321,7 @@ extern int slurm_ckpt_pack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint32_t x;
 		uint32_t y;
 		uint32_t z;
@@ -358,7 +358,7 @@ extern int slurm_ckpt_unpack_job(check_jobinfo_t jobinfo, Buf buffer,
 	struct check_job_info *check_ptr =
 		(struct check_job_info *)jobinfo;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		uint16_t id;
 		uint32_t size;
 
@@ -483,10 +483,10 @@ static void _my_sleep(int secs)
 	gettimeofday(&now, NULL);
 	ts.tv_sec = now.tv_sec + secs;
 	ts.tv_nsec = now.tv_usec * 1000;
-	pthread_mutex_lock(&ckpt_agent_mutex);
+	slurm_mutex_lock(&ckpt_agent_mutex);
 	if (!ckpt_agent_stop)
 		pthread_cond_timedwait(&ckpt_agent_cond,&ckpt_agent_mutex,&ts);
-	pthread_mutex_unlock(&ckpt_agent_mutex);
+	slurm_mutex_unlock(&ckpt_agent_mutex);
 }
 
 /* Checkpoint processing pthread
diff --git a/src/plugins/core_spec/Makefile.in b/src/plugins/core_spec/Makefile.in
index 70fa20d3d..318bac2f2 100644
--- a/src/plugins/core_spec/Makefile.in
+++ b/src/plugins/core_spec/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/core_spec
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/core_spec/cray/Makefile.in b/src/plugins/core_spec/cray/Makefile.in
index 82ceb63a3..114e23d72 100644
--- a/src/plugins/core_spec/cray/Makefile.in
+++ b/src/plugins/core_spec/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/core_spec/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/core_spec/cray/core_spec_cray.c b/src/plugins/core_spec/cray/core_spec_cray.c
index 70990e9a7..2713f94e8 100644
--- a/src/plugins/core_spec/cray/core_spec_cray.c
+++ b/src/plugins/core_spec/cray/core_spec_cray.c
@@ -101,6 +101,7 @@
 const char plugin_name[]       	= "Cray core specialization plugin";
 const char plugin_type[]       	= "core_spec/cray";
 const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
+static uint64_t debug_flags = 0;
 
 // If job_set_corespec fails, retry this many times to wait
 // for suspends to complete.
@@ -108,6 +109,7 @@ const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
 
 extern int init(void)
 {
+	debug_flags = slurm_get_debug_flags();
 	info("%s: init", plugin_type);
 	return SLURM_SUCCESS;
 }
@@ -125,6 +127,8 @@ extern int fini(void)
  */
 extern int core_spec_p_set(uint64_t cont_id, uint16_t core_count)
 {
+	DEF_TIMERS;
+	START_TIMER;
 #if _DEBUG
 	char *spec_type;
 	int spec_count;
@@ -210,6 +214,10 @@ extern int core_spec_p_set(uint64_t cont_id, uint16_t core_count)
 	}
 	job_detachpid(pid);
 #endif
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	// The code that was here is now performed by
 	// switch_p_job_step_{pre,post}_suspend()
 	return SLURM_SUCCESS;
diff --git a/src/plugins/core_spec/none/Makefile.in b/src/plugins/core_spec/none/Makefile.in
index 0db05cd50..0244c3ffb 100644
--- a/src/plugins/core_spec/none/Makefile.in
+++ b/src/plugins/core_spec/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/core_spec/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/crypto/Makefile.in b/src/plugins/crypto/Makefile.in
index 0003badca..65b41b288 100644
--- a/src/plugins/crypto/Makefile.in
+++ b/src/plugins/crypto/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/crypto
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/crypto/munge/Makefile.in b/src/plugins/crypto/munge/Makefile.in
index 63bfc421f..51cf1c449 100644
--- a/src/plugins/crypto/munge/Makefile.in
+++ b/src/plugins/crypto/munge/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/crypto/munge
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/crypto/openssl/Makefile.in b/src/plugins/crypto/openssl/Makefile.in
index 8624fd4cc..be0feac26 100644
--- a/src/plugins/crypto/openssl/Makefile.in
+++ b/src/plugins/crypto/openssl/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/crypto/openssl
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -256,8 +257,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -357,6 +356,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -395,6 +398,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -438,6 +444,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -488,6 +497,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/ext_sensors/Makefile.in b/src/plugins/ext_sensors/Makefile.in
index 28c2538d3..00ad2a1fc 100644
--- a/src/plugins/ext_sensors/Makefile.in
+++ b/src/plugins/ext_sensors/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/ext_sensors
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/ext_sensors/none/Makefile.in b/src/plugins/ext_sensors/none/Makefile.in
index b00b8622e..a7d89cccf 100644
--- a/src/plugins/ext_sensors/none/Makefile.in
+++ b/src/plugins/ext_sensors/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/ext_sensors/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/ext_sensors/rrd/Makefile.in b/src/plugins/ext_sensors/rrd/Makefile.in
index c4dedff69..54652e202 100644
--- a/src/plugins/ext_sensors/rrd/Makefile.in
+++ b/src/plugins/ext_sensors/rrd/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/ext_sensors/rrd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -258,8 +259,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -359,6 +358,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -397,6 +400,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -440,6 +446,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -490,6 +499,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/ext_sensors/rrd/ext_sensors_rrd.c b/src/plugins/ext_sensors/rrd/ext_sensors_rrd.c
index d6aa23467..a56771dae 100644
--- a/src/plugins/ext_sensors/rrd/ext_sensors_rrd.c
+++ b/src/plugins/ext_sensors/rrd/ext_sensors_rrd.c
@@ -167,7 +167,7 @@ static char* _get_node_rrd_path(char* component_name,
 	p = xstrdup(rrd_file);
 	xstrsubstitute(p, "%n", component_name);
 
-	if (!strcmp(p, rrd_file)) {
+	if (!xstrcmp(p, rrd_file)) {
 		xfree(p);
 		return NULL;
 	}
@@ -203,7 +203,7 @@ static uint32_t _rrd_get_last_one(char* filename, char* rra_name)
 
 	if (rra_name == NULL) {
 		while (data_p) {
-			if (!strncmp(line, data_p->key, 3)) {
+			if (!xstrncmp(line, data_p->key, 3)) {
 				rra = xstrdup(data_p->key + 3);
 				xstrsubstitute(rra, strchr(rra, ']'), "");
 				break;
@@ -217,7 +217,7 @@ static uint32_t _rrd_get_last_one(char* filename, char* rra_name)
 		xstrsubstitute(p, "%s", rra_name);
 		if (rra_name == NULL)
 			xfree(rra);
-		if (strcmp(p,line) == 0) {
+		if (xstrcmp(p,line) == 0) {
 			xfree(p);
 			rrd_info_free(data);
 			return temperature;
@@ -229,7 +229,7 @@ static uint32_t _rrd_get_last_one(char* filename, char* rra_name)
 	}
 
 	while (data_p) {
-		if (!strcmp(p, data_p->key)) {
+		if (!xstrcmp(p, data_p->key)) {
 			if (!sscanf(data_p->value.u_str, "%d", &temperature))
 				temperature = 1;
 			break;
@@ -288,7 +288,7 @@ static uint64_t _rrd_consolidate_one(time_t t0, time_t t1,
 			rra_nb = 0;
 		else {
 			for (ii = 0; ii < ds_count; ii++){
-				if (!strcmp(ds_names[ii],rra_name)) {
+				if (!xstrcmp(ds_names[ii],rra_name)) {
 					rra_nb = ii;
 					break;
 				}
diff --git a/src/plugins/gres/Makefile.in b/src/plugins/gres/Makefile.in
index fe460d9c1..aa0c69374 100644
--- a/src/plugins/gres/Makefile.in
+++ b/src/plugins/gres/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/gres
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/gres/gpu/Makefile.in b/src/plugins/gres/gpu/Makefile.in
index ce1694438..bdf8ecfcf 100644
--- a/src/plugins/gres/gpu/Makefile.in
+++ b/src/plugins/gres/gpu/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/gres/gpu
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/gres/gpu/gres_gpu.c b/src/plugins/gres/gpu/gres_gpu.c
index 5afbf7006..d5a1bd66e 100644
--- a/src/plugins/gres/gpu/gres_gpu.c
+++ b/src/plugins/gres/gpu/gres_gpu.c
@@ -143,7 +143,7 @@ extern int node_config_load(List gres_conf_list)
 	xassert(gres_conf_list);
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if (strcmp(gres_slurmd_conf->name, gres_name))
+		if (xstrcmp(gres_slurmd_conf->name, gres_name))
 			continue;
 		if (gres_slurmd_conf->file)
 			nb_gpu++;
@@ -161,7 +161,7 @@ extern int node_config_load(List gres_conf_list)
 
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
+		if ((xstrcmp(gres_slurmd_conf->name, gres_name) == 0) &&
 		    gres_slurmd_conf->file) {
 			/* Populate gpu_devices array with number
 			 * at end of the file name */
diff --git a/src/plugins/gres/mic/Makefile.in b/src/plugins/gres/mic/Makefile.in
index 141db5ada..ec14eecc8 100644
--- a/src/plugins/gres/mic/Makefile.in
+++ b/src/plugins/gres/mic/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/gres/mic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/gres/mic/gres_mic.c b/src/plugins/gres/mic/gres_mic.c
index 5c418e3ab..f91d75d17 100644
--- a/src/plugins/gres/mic/gres_mic.c
+++ b/src/plugins/gres/mic/gres_mic.c
@@ -127,7 +127,7 @@ extern int node_config_load(List gres_conf_list)
 	xassert(gres_conf_list);
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if (strcmp(gres_slurmd_conf->name, gres_name))
+		if (xstrcmp(gres_slurmd_conf->name, gres_name))
 			continue;
 		if (gres_slurmd_conf->file)
 			nb_mic++;
@@ -147,7 +147,7 @@ extern int node_config_load(List gres_conf_list)
 
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
+		if ((xstrcmp(gres_slurmd_conf->name, gres_name) == 0) &&
 		    gres_slurmd_conf->file) {
 			/* Populate mic_devices array with number
 			 * at end of the file name */
diff --git a/src/plugins/gres/nic/Makefile.in b/src/plugins/gres/nic/Makefile.in
index c4e02b884..f462dbbbd 100644
--- a/src/plugins/gres/nic/Makefile.in
+++ b/src/plugins/gres/nic/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/gres/nic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/gres/nic/gres_nic.c b/src/plugins/gres/nic/gres_nic.c
index 1fa13a8b4..f53d45c23 100644
--- a/src/plugins/gres/nic/gres_nic.c
+++ b/src/plugins/gres/nic/gres_nic.c
@@ -141,7 +141,7 @@ extern int node_config_load(List gres_conf_list)
 	xassert(gres_conf_list);
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if (strcmp(gres_slurmd_conf->name, gres_name))
+		if (xstrcmp(gres_slurmd_conf->name, gres_name))
 			continue;
 		if (gres_slurmd_conf->file)
 			nb_nic++;
@@ -159,7 +159,7 @@ extern int node_config_load(List gres_conf_list)
 
 	iter = list_iterator_create(gres_conf_list);
 	while ((gres_slurmd_conf = list_next(iter))) {
-		if ((strcmp(gres_slurmd_conf->name, gres_name) == 0) &&
+		if ((xstrcmp(gres_slurmd_conf->name, gres_name) == 0) &&
 		    gres_slurmd_conf->file) {
 			/* Populate nic_devices array with number
 			 * at end of the file name */
diff --git a/src/plugins/job_container/Makefile.in b/src/plugins/job_container/Makefile.in
index cbb83e59c..30a02f351 100644
--- a/src/plugins/job_container/Makefile.in
+++ b/src/plugins/job_container/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_container
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_container/cncu/Makefile.in b/src/plugins/job_container/cncu/Makefile.in
index 2482f9925..65e094756 100644
--- a/src/plugins/job_container/cncu/Makefile.in
+++ b/src/plugins/job_container/cncu/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_container/cncu
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_container/cncu/job_container_cncu.c b/src/plugins/job_container/cncu/job_container_cncu.c
index 4f5b74750..ea39c5313 100644
--- a/src/plugins/job_container/cncu/job_container_cncu.c
+++ b/src/plugins/job_container/cncu/job_container_cncu.c
@@ -89,7 +89,7 @@ static uint32_t *job_id_array = NULL;
 static uint32_t  job_id_count = 0;
 static pthread_mutex_t context_lock = PTHREAD_MUTEX_INITIALIZER;
 static char *state_dir = NULL;
-static bool enable_debug = false;
+static uint64_t debug_flags = 0;
 
 static int _save_state(char *dir_name)
 {
@@ -185,6 +185,9 @@ static int _restore_state(char *dir_name)
 static void _stat_reservation(char *type, rid_t resv_id)
 {
 	struct job_resv_stat buf;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (job_stat_reservation(resv_id, &buf)) {
 		error("%s: stat(%"PRIu64"): %m", plugin_type, resv_id);
@@ -194,25 +197,15 @@ static void _stat_reservation(char *type, rid_t resv_id)
 		     plugin_type, type, resv_id, buf.flags, buf.num_jobs,
 		     buf.num_files, buf.num_ipc_objs);
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 }
 #endif
 
-static bool _get_debug_flag(void)
-{
-	if (slurm_get_debug_flags() & DEBUG_FLAG_JOB_CONT)
-		return true;
-	return false;
-}
-
 extern void container_p_reconfig(void)
 {
-	bool new_debug_flag = _get_debug_flag();
-
-	if (enable_debug != new_debug_flag) {
-		debug("%s: JobContainer DebugFlag changed to %d",
-		      plugin_name, (int) new_debug_flag);
-	}
-	enable_debug = new_debug_flag;
+	debug_flags = slurm_get_debug_flags();
 }
 
 /*
@@ -221,8 +214,8 @@ extern void container_p_reconfig(void)
  */
 extern int init(void)
 {
-	enable_debug = _get_debug_flag();
-	if (enable_debug)
+	debug_flags = slurm_get_debug_flags();
+	if (debug_flags & DEBUG_FLAG_JOB_CONT)
 		info("%s loaded", plugin_name);
 	else
 		debug("%s loaded", plugin_name);
@@ -256,7 +249,7 @@ extern int container_p_restore(char *dir_name, bool recover)
 	for (i = 0; i < job_id_count; i++) {
 		if (job_id_array[i] == 0)
 			continue;
-		if (enable_debug)
+		if (debug_flags & DEBUG_FLAG_JOB_CONT)
 			info("%s: %s job(%u)",
 			     plugin_type,
 			     recover ? "recovered" : "purging",
@@ -279,7 +272,7 @@ extern int container_p_create(uint32_t job_id)
 	DEF_TIMERS;
 
 	START_TIMER;
-	if (enable_debug)
+	if (debug_flags & DEBUG_FLAG_JOB_CONT)
 		info("%s: creating(%u)", plugin_type, job_id);
 	slurm_mutex_lock(&context_lock);
 	for (i = 0; i < job_id_count; i++) {
@@ -301,17 +294,27 @@ extern int container_p_create(uint32_t job_id)
 		_save_state(state_dir);
 	}
 	slurm_mutex_unlock(&context_lock);
-	END_TIMER3("container_p_create: saving state took", 3000000);
+
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		END_TIMER;
+		INFO_LINE("call took: %s", TIME_STR);
+	} else
+		END_TIMER3("container_p_create: saving state took", 3000000);
 #ifdef HAVE_NATIVE_CRAY
 	START_TIMER;
 	rc = job_create_reservation(resv_id, CREATE_FLAGS);
-	END_TIMER3("container_p_create: job_create_reservation took", 3000000);
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		END_TIMER;
+		INFO_LINE("call took: %s", TIME_STR);
+	} else
+		END_TIMER3("container_p_create: job_create_reservation took",
+			   3000000);
 	if ((rc == 0) || (errno == EEXIST)) {
 		if ((found == -1) && (rc != 0) && (errno == EEXIST)) {
 			error("%s: create(%u): Reservation already exists",
 			      plugin_type, job_id);
 		}
-		if (enable_debug)
+		if (debug_flags & DEBUG_FLAG_JOB_CONT)
 			_stat_reservation("create", resv_id);
 		return SLURM_SUCCESS;
 	}
@@ -332,7 +335,7 @@ extern int container_p_add_cont(uint32_t job_id, uint64_t cont_id)
 	DEF_TIMERS;
 #endif
 
-	if (enable_debug) {
+	if (debug_flags & DEBUG_FLAG_JOB_CONT) {
 		info("%s: adding cont(%u.%"PRIu64")",
 		     plugin_type, job_id, cont_id);
 	}
@@ -340,10 +343,14 @@ extern int container_p_add_cont(uint32_t job_id, uint64_t cont_id)
 #ifdef HAVE_NATIVE_CRAY
 	START_TIMER;
 	rc = job_attach_reservation(cjob_id, resv_id, ADD_FLAGS);
-	END_TIMER3("container_p_add_cont: job_attach_reservation took",
-		   3000000);
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		END_TIMER;
+		INFO_LINE("call took: %s", TIME_STR);
+	} else
+		END_TIMER3("container_p_add_cont: job_attach_reservation took",
+			   3000000);
 	if ((rc != 0) && (errno == ENOENT)) {	/* Log and retry */
-		if (enable_debug)
+		if (debug_flags & DEBUG_FLAG_JOB_CONT)
 			info("%s: add(%u.%"PRIu64"): No reservation found, "
 			     "no big deal, this is probably the first time "
 			     "this was called.  We will just create a new one.",
@@ -351,9 +358,13 @@ extern int container_p_add_cont(uint32_t job_id, uint64_t cont_id)
 		START_TIMER;
 		rc = job_create_reservation(resv_id, CREATE_FLAGS);
 		rc = job_attach_reservation(cjob_id, resv_id, ADD_FLAGS);
-		END_TIMER3("container_p_add_cont: "
-			   "job_(create&attach)_reservation took",
-			   3000000);
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+			END_TIMER;
+			INFO_LINE("call took: %s", TIME_STR);
+		} else
+			END_TIMER3("container_p_add_cont: "
+				   "job_(create&attach)_reservation took",
+				   3000000);
 	}
 
 	if ((rc == 0) || (errno == EBUSY)) {
@@ -362,7 +373,7 @@ extern int container_p_add_cont(uint32_t job_id, uint64_t cont_id)
 			 * Duplicate adds can be generated by prolog/epilog */
 			debug2("%s: add(%u.%"PRIu64"): %m",
 			       plugin_type, job_id, cont_id);
-		} else if (enable_debug)
+		} else if (debug_flags & DEBUG_FLAG_JOB_CONT)
 			_stat_reservation("add", resv_id);
 		return SLURM_SUCCESS;
 	}
@@ -377,8 +388,12 @@ extern int container_p_add_cont(uint32_t job_id, uint64_t cont_id)
 extern int container_p_add_pid(uint32_t job_id, pid_t pid, uid_t uid)
 {
 	stepd_step_rec_t job;
+	int rc;
+	DEF_TIMERS;
+
+	START_TIMER;
 
-	if (enable_debug) {
+	if (debug_flags & DEBUG_FLAG_JOB_CONT) {
 		info("%s: adding pid(%u.%u)",
 		     plugin_type, job_id, (uint32_t) pid);
 	}
@@ -392,7 +407,14 @@ extern int container_p_add_pid(uint32_t job_id, pid_t pid, uid_t uid)
 
 	proctrack_g_add(&job, pid);
 
-	return container_p_add_cont(job_id, job.cont_id);
+	rc = container_p_add_cont(job_id, job.cont_id);
+
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		END_TIMER;
+		INFO_LINE("call took: %s", TIME_STR);
+	}
+
+	return rc;
 }
 
 extern int container_p_delete(uint32_t job_id)
@@ -405,7 +427,7 @@ extern int container_p_delete(uint32_t job_id)
 	int i, found = -1;
 	bool job_id_change = false;
 
-	if (enable_debug)
+	if (debug_flags & DEBUG_FLAG_JOB_CONT)
 		info("%s: deleting(%u)", plugin_type, job_id);
 	slurm_mutex_lock(&context_lock);
 	for (i = 0; i < job_id_count; i++) {
@@ -423,8 +445,12 @@ extern int container_p_delete(uint32_t job_id)
 #ifdef HAVE_NATIVE_CRAY
 	START_TIMER;
 	rc = job_end_reservation(resv_id, DELETE_FLAGS);
-	END_TIMER3("container_p_delete: job_end_reservation took",
-		   3000000);
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY) {
+		END_TIMER;
+		INFO_LINE("call took: %s", TIME_STR);
+	} else
+		END_TIMER3("container_p_delete: job_end_reservation took",
+			   3000000);
 #endif
 	if (rc == 0)
 		return SLURM_SUCCESS;
diff --git a/src/plugins/job_container/none/Makefile.in b/src/plugins/job_container/none/Makefile.in
index 768a5f022..a11d50e08 100644
--- a/src/plugins/job_container/none/Makefile.in
+++ b/src/plugins/job_container/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_container/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/Makefile.am b/src/plugins/job_submit/Makefile.am
index 9b3d9704e..3376e2fe2 100644
--- a/src/plugins/job_submit/Makefile.am
+++ b/src/plugins/job_submit/Makefile.am
@@ -2,7 +2,6 @@
 
 SUBDIRS = \
 	all_partitions \
-	cnode \
 	cray \
 	defaults \
 	logging \
diff --git a/src/plugins/job_submit/Makefile.in b/src/plugins/job_submit/Makefile.in
index 7042c5b63..0150f42f7 100644
--- a/src/plugins/job_submit/Makefile.in
+++ b/src/plugins/job_submit/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -474,7 +484,6 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 SUBDIRS = \
 	all_partitions \
-	cnode \
 	cray \
 	defaults \
 	logging \
diff --git a/src/plugins/job_submit/all_partitions/Makefile.in b/src/plugins/job_submit/all_partitions/Makefile.in
index 87dd4527a..3dee902fe 100644
--- a/src/plugins/job_submit/all_partitions/Makefile.in
+++ b/src/plugins/job_submit/all_partitions/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/all_partitions
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/cnode/Makefile.am b/src/plugins/job_submit/cnode/Makefile.am
deleted file mode 100644
index 0a0e897a9..000000000
--- a/src/plugins/job_submit/cnode/Makefile.am
+++ /dev/null
@@ -1,13 +0,0 @@
-# Makefile for job_submit/cnode plugin
-
-AUTOMAKE_OPTIONS = foreign
-
-PLUGIN_FLAGS = -module -avoid-version --export-dynamic
-
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
-
-pkglib_LTLIBRARIES = job_submit_cnode.la
-
-# Job submit cnode plugin.
-job_submit_cnode_la_SOURCES = job_submit_cnode.c
-job_submit_cnode_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
diff --git a/src/plugins/job_submit/cnode/job_submit_cnode.c b/src/plugins/job_submit/cnode/job_submit_cnode.c
deleted file mode 100644
index eddb98f61..000000000
--- a/src/plugins/job_submit/cnode/job_submit_cnode.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/*****************************************************************************\
- *  job_submit_cnode.c - Set a job's cnode license count equal to the number
- *  of cnode required (BlueGene compute nodes). This mechanism can be used to
- *  manage resource reservations of less than a full midplane.
- *
- *  NOTE: In order to use this, configure licenses on the computer named
- *  "cnode" and having a count equal to all cnodes on the system.
- *****************************************************************************
- *  Copyright (C) 2011 Lawrence Livermore National Security.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Morris Jette <jette1@llnl.gov>
- *  CODE-OCEC-09-009. All rights reserved.
- *
- *  This file is part of SLURM, a resource management program.
- *  For details, see <http://slurm.schedmd.com/>.
- *  Please also read the included file: DISCLAIMER.
- *
- *  SLURM is free software; you can redistribute it and/or modify it under
- *  the terms of the GNU General Public License as published by the Free
- *  Software Foundation; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  In addition, as a special exception, the copyright holders give permission
- *  to link the code of portions of this program with the OpenSSL library under
- *  certain conditions as described in each individual source file, and
- *  distribute linked combinations including the two. You must obey the GNU
- *  General Public License in all respects for all of the code used other than
- *  OpenSSL. If you modify file(s) with this exception, you may extend this
- *  exception to your version of the file(s), but you are not obligated to do
- *  so. If you do not wish to do so, delete this exception statement from your
- *  version.  If you delete this exception statement from all source files in
- *  the program, then also delete it here.
- *
- *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
- *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- *  details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with SLURM; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
-
-#if HAVE_CONFIG_H
-#  include "config.h"
-#  if STDC_HEADERS
-#    include <string.h>
-#  endif
-#  if HAVE_SYS_TYPES_H
-#    include <sys/types.h>
-#  endif /* HAVE_SYS_TYPES_H */
-#  if HAVE_UNISTD_H
-#    include <unistd.h>
-#  endif
-#  if HAVE_INTTYPES_H
-#    include <inttypes.h>
-#  else /* ! HAVE_INTTYPES_H */
-#    if HAVE_STDINT_H
-#      include <stdint.h>
-#    endif
-#  endif /* HAVE_INTTYPES_H */
-#else /* ! HAVE_CONFIG_H */
-#  include <sys/types.h>
-#  include <unistd.h>
-#  include <stdint.h>
-#  include <string.h>
-#endif /* HAVE_CONFIG_H */
-
-#include <stdio.h>
-
-#include "slurm/slurm_errno.h"
-#include "src/common/slurm_xlator.h"
-#include "src/slurmctld/slurmctld.h"
-
-/* Define the minimum number of cnodes which can be allocated on a system.
- * This is hardware and configuration dependent. More work is needed here. */
-#ifndef MIN_CNODES
-#define MIN_CNODES 32
-#endif
-
-/*
- * These variables are required by the generic plugin interface.  If they
- * are not found in the plugin, the plugin loader will ignore it.
- *
- * plugin_name - a string giving a human-readable description of the
- * plugin.  There is no maximum length, but the symbol must refer to
- * a valid string.
- *
- * plugin_type - a string suggesting the type of the plugin or its
- * applicability to a particular form of data or method of data handling.
- * If the low-level plugin API is used, the contents of this string are
- * unimportant and may be anything.  SLURM uses the higher-level plugin
- * interface which requires this string to be of the form
- *
- *	<application>/<method>
- *
- * where <application> is a description of the intended application of
- * the plugin (e.g., "auth" for SLURM authentication) and <method> is a
- * description of how this plugin satisfies that application.  SLURM will
- * only load authentication plugins if the plugin_type string has a prefix
- * of "auth/".
- *
- * plugin_version - an unsigned 32-bit integer containing the Slurm version
- * (major.minor.micro combined into a single number).
- */
-const char plugin_name[]       	= "Job submit cnode plugin";
-const char plugin_type[]       	= "job_submit/cnode";
-const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
-
-static void _rebuild_licenses(char **license_ptr, uint32_t cnode_cnt)
-{
-	char *sep = "", *save_ptr, *tok;
-	char *orig_licenses, *new_licenses = NULL;
-	int i;
-	bool put_cnode = false;
-
-	/* Reset job cnode count to a value supported on this hardware
-	 * with this SLURM configuration. The job specification might
-	 * also have a CPU count or geometry that might alter the cnode
-	 * count specified in the job request. */
-	for (i = 1; i < (1024 * 1024); i *= 2) {
-		if (cnode_cnt <= (MIN_CNODES * i)) {
-			cnode_cnt = (MIN_CNODES * i);
-			break;
-		}
-	}
-
-	if (*license_ptr == NULL) {
-		xstrfmtcat(*license_ptr, "cnode*%u", cnode_cnt);
-		return;
-	}
-
-	orig_licenses = *license_ptr;
-	tok = strtok_r(orig_licenses, ",", &save_ptr);
-	while (tok) {
-		if (!strcmp(tok, "cnode") || !strncmp(tok, "cnode*", 6)) {
-			xstrfmtcat(new_licenses, "%scnode*%u", sep, cnode_cnt);
-			put_cnode = true;
-		} else {
-			xstrfmtcat(new_licenses, "%s%s", sep, tok);
-		}
-		tok = strtok_r(NULL, ",", &save_ptr);
-		sep = ",";
-	}
-	if (!put_cnode)
-		xstrfmtcat(new_licenses, "%scnode*%u", sep, cnode_cnt);
-	xfree(orig_licenses);
-	*license_ptr = new_licenses;
-}
-
-/* Set the job's license specification to include its cnodes requirement */
-extern int job_submit(struct job_descriptor *job_desc, uint32_t submit_uid,
-		      char **err_msg)
-{
-	uint32_t cnode_cnt = job_desc->min_nodes;
-	static bool printed = false;
-
-	xassert(job_desc);
-	if (cnode_cnt == NO_VAL)
-		cnode_cnt = MIN_CNODES;
-
-	if (!printed) {
-		error("job_submit/cnode is deprecated.  Reservations can now "
-		      "be done on a cnode level.  Please start doing it "
-		      "this way instead of using licenses as this plugin "
-		      "will go away in the next version of the code.");
-		printed = true;
-	}
-	_rebuild_licenses(&job_desc->licenses, cnode_cnt);
-	return SLURM_SUCCESS;
-}
-
-extern int job_modify(struct job_descriptor *job_desc,
-		      struct job_record *job_ptr, uint32_t submit_uid)
-{
-	char **license_ptr;
-	uint32_t cnode_cnt = job_desc->min_nodes;
-
-	xassert(job_desc);
-	xassert(job_ptr);
-	if ((job_desc->licenses == NULL) && job_ptr->licenses)
-		job_desc->licenses = xstrdup(job_ptr->licenses);
-	license_ptr = &job_desc->licenses;
-
-	if ((cnode_cnt == NO_VAL) && job_ptr->details)
-		cnode_cnt = job_ptr->details->min_nodes;
-
-	_rebuild_licenses(license_ptr, cnode_cnt);
-
-	return SLURM_SUCCESS;
-}
diff --git a/src/plugins/job_submit/cray/Makefile.in b/src/plugins/job_submit/cray/Makefile.in
index 5850d3dd8..072b71d0e 100644
--- a/src/plugins/job_submit/cray/Makefile.in
+++ b/src/plugins/job_submit/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/defaults/Makefile.in b/src/plugins/job_submit/defaults/Makefile.in
index 2caae32e8..3c1dfdd3b 100644
--- a/src/plugins/job_submit/defaults/Makefile.in
+++ b/src/plugins/job_submit/defaults/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/defaults
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/logging/Makefile.in b/src/plugins/job_submit/logging/Makefile.in
index 6d2eab2ec..cd951559a 100644
--- a/src/plugins/job_submit/logging/Makefile.in
+++ b/src/plugins/job_submit/logging/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/logging
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/lua/Makefile.in b/src/plugins/job_submit/lua/Makefile.in
index 324184565..d761486ef 100644
--- a/src/plugins/job_submit/lua/Makefile.in
+++ b/src/plugins/job_submit/lua/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/lua
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +255,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +354,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +396,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +442,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +495,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/lua/job_submit_lua.c b/src/plugins/job_submit/lua/job_submit_lua.c
index 087aefad9..7728675fb 100644
--- a/src/plugins/job_submit/lua/job_submit_lua.c
+++ b/src/plugins/job_submit/lua/job_submit_lua.c
@@ -295,52 +295,52 @@ static int _job_rec_field(const struct job_record *job_ptr,
 	if (job_ptr == NULL) {
 		error("_job_rec_field: job_ptr is NULL");
 		lua_pushnil (L);
-	} else if (!strcmp(name, "account")) {
+	} else if (!xstrcmp(name, "account")) {
 		lua_pushstring (L, job_ptr->account);
-	} else if (!strcmp(name, "burst_buffer")) {
+	} else if (!xstrcmp(name, "burst_buffer")) {
 		lua_pushstring (L, job_ptr->burst_buffer);
-	} else if (!strcmp(name, "comment")) {
+	} else if (!xstrcmp(name, "comment")) {
 		lua_pushstring (L, job_ptr->comment);
-	} else if (!strcmp(name, "direct_set_prio")) {
+	} else if (!xstrcmp(name, "direct_set_prio")) {
 		lua_pushnumber (L, job_ptr->direct_set_prio);
-	} else if (!strcmp(name, "gres")) {
+	} else if (!xstrcmp(name, "gres")) {
 		lua_pushstring (L, job_ptr->gres);
-	} else if (!strcmp(name, "job_id")) {
+	} else if (!xstrcmp(name, "job_id")) {
 		lua_pushnumber (L, job_ptr->job_id);
-	} else if (!strcmp(name, "job_state")) {
+	} else if (!xstrcmp(name, "job_state")) {
 		lua_pushnumber (L, job_ptr->job_state);
-	} else if (!strcmp(name, "licenses")) {
+	} else if (!xstrcmp(name, "licenses")) {
 		lua_pushstring (L, job_ptr->licenses);
-	} else if (!strcmp(name, "max_cpus")) {
+	} else if (!xstrcmp(name, "max_cpus")) {
 		if (job_ptr->details)
 			lua_pushnumber (L, job_ptr->details->max_cpus);
 		else
 			lua_pushnumber (L, 0);
-	} else if (!strcmp(name, "max_nodes")) {
+	} else if (!xstrcmp(name, "max_nodes")) {
 		if (job_ptr->details)
 			lua_pushnumber (L, job_ptr->details->max_nodes);
 		else
 			lua_pushnumber (L, 0);
-	} else if (!strcmp(name, "min_cpus")) {
+	} else if (!xstrcmp(name, "min_cpus")) {
 		if (job_ptr->details)
 			lua_pushnumber (L, job_ptr->details->min_cpus);
 		else
 			lua_pushnumber (L, 0);
-	} else if (!strcmp(name, "min_nodes")) {
+	} else if (!xstrcmp(name, "min_nodes")) {
 		if (job_ptr->details)
 			lua_pushnumber (L, job_ptr->details->min_nodes);
 		else
 			lua_pushnumber (L, 0);
-	} else if (!strcmp(name, "nice")) {
+	} else if (!xstrcmp(name, "nice")) {
 		if (job_ptr->details)
 			lua_pushnumber (L, job_ptr->details->nice);
 		else
 			lua_pushnumber (L, (uint16_t)NO_VAL);
-	} else if (!strcmp(name, "partition")) {
+	} else if (!xstrcmp(name, "partition")) {
 		lua_pushstring (L, job_ptr->partition);
-	} else if (!strcmp(name, "priority")) {
+	} else if (!xstrcmp(name, "priority")) {
 		lua_pushnumber (L, job_ptr->priority);
-	} else if (!strcmp(name, "qos")) {
+	} else if (!xstrcmp(name, "qos")) {
 		if (job_ptr->qos_ptr) {
 			slurmdb_qos_rec_t *qos_ptr =
 				(slurmdb_qos_rec_t *)job_ptr->qos_ptr;
@@ -348,9 +348,9 @@ static int _job_rec_field(const struct job_record *job_ptr,
 		} else {
 			lua_pushnil (L);
 		}
-	} else if (!strcmp(name, "req_switch")) {
+	} else if (!xstrcmp(name, "req_switch")) {
 		lua_pushnumber (L, job_ptr->req_switch);
-	} else if (!strcmp(name, "spank_job_env")) {
+	} else if (!xstrcmp(name, "spank_job_env")) {
 		if ((job_ptr->spank_job_env_size == 0) ||
 		    (job_ptr->spank_job_env == NULL)) {
 			lua_pushnil (L);
@@ -365,15 +365,15 @@ static int _job_rec_field(const struct job_record *job_ptr,
 				}
 			}
 		}
-	} else if (!strcmp(name, "spank_job_env_size")) {
+	} else if (!xstrcmp(name, "spank_job_env_size")) {
 		lua_pushnumber (L, job_ptr->spank_job_env_size);
-	} else if (!strcmp(name, "time_limit")) {
+	} else if (!xstrcmp(name, "time_limit")) {
 		lua_pushnumber (L, job_ptr->time_limit);
-	} else if (!strcmp(name, "time_min")) {
+	} else if (!xstrcmp(name, "time_min")) {
 		lua_pushnumber (L, job_ptr->time_min);
-	} else if (!strcmp(name, "wait4switch")) {
+	} else if (!xstrcmp(name, "wait4switch")) {
 		lua_pushnumber (L, job_ptr->wait4switch);
-	} else if (!strcmp(name, "wckey")) {
+	} else if (!xstrcmp(name, "wckey")) {
 		lua_pushstring (L, job_ptr->wckey);
 	} else {
 		lua_pushnil (L);
@@ -444,37 +444,37 @@ static int _resv_field(const slurmctld_resv_t *resv_ptr,
 	if (resv_ptr == NULL) {
 		error("_resv_field: resv_ptr is NULL");
 		lua_pushnil(L);
-	} else if (!strcmp(name, "accounts")) {
+	} else if (!xstrcmp(name, "accounts")) {
 		lua_pushstring(L, resv_ptr->accounts);
-	} else if (!strcmp(name, "assoc_list")) {
+	} else if (!xstrcmp(name, "assoc_list")) {
 		lua_pushstring(L, resv_ptr->assoc_list);
-	} else if (!strcmp(name, "duration")) {
+	} else if (!xstrcmp(name, "duration")) {
 		lua_pushnumber(L, resv_ptr->duration);
-	} else if (!strcmp(name, "end_time")) {
+	} else if (!xstrcmp(name, "end_time")) {
 		lua_pushnumber(L, resv_ptr->end_time);
-	} else if (!strcmp(name, "features")) {
+	} else if (!xstrcmp(name, "features")) {
 		lua_pushstring(L, resv_ptr->features);
-	} else if (!strcmp(name, "flags")) {
+	} else if (!xstrcmp(name, "flags")) {
 		lua_pushnumber(L, resv_ptr->flags);
-	} else if (!strcmp(name, "full_nodes")) {
+	} else if (!xstrcmp(name, "full_nodes")) {
 		lua_pushboolean(L, resv_ptr->full_nodes);
-	} else if (!strcmp(name, "flags_set_node")) {
+	} else if (!xstrcmp(name, "flags_set_node")) {
 		lua_pushboolean(L, resv_ptr->flags_set_node);
-	} else if (!strcmp(name, "job_pend_cnt")) {
+	} else if (!xstrcmp(name, "job_pend_cnt")) {
 		lua_pushnumber(L, resv_ptr->job_pend_cnt);
-	} else if (!strcmp(name, "job_run_cnt")) {
+	} else if (!xstrcmp(name, "job_run_cnt")) {
 		lua_pushnumber(L, resv_ptr->job_run_cnt);
-	} else if (!strcmp(name, "licenses")) {
+	} else if (!xstrcmp(name, "licenses")) {
 		lua_pushstring(L, resv_ptr->licenses);
-	} else if (!strcmp(name, "node_cnt")) {
+	} else if (!xstrcmp(name, "node_cnt")) {
 		lua_pushnumber(L, resv_ptr->node_cnt);
-	} else if (!strcmp(name, "node_list")) {
+	} else if (!xstrcmp(name, "node_list")) {
 		lua_pushstring(L, resv_ptr->node_list);
-	} else if (!strcmp(name, "partition")) {
+	} else if (!xstrcmp(name, "partition")) {
 		lua_pushstring(L, resv_ptr->partition);
-	} else if (!strcmp(name, "start_time")) {
+	} else if (!xstrcmp(name, "start_time")) {
 		lua_pushnumber(L, resv_ptr->start_time);
-	} else if (!strcmp(name, "users")) {
+	} else if (!xstrcmp(name, "users")) {
 		lua_pushstring(L, resv_ptr->users);
 	} else {
 		lua_pushnil(L);
@@ -555,8 +555,8 @@ static int _set_job_env_field(lua_State *L)
 	} else {
 		value_str = luaL_checkstring(L, 3);
 		for (i = 0; job_desc->environment[i]; i++) {
-			if (!strncmp(job_desc->environment[i], name_eq,
-				     name_len)) {
+			if (!xstrncmp(job_desc->environment[i], name_eq,
+				      name_len)) {
 				job_desc->environment[i][name_len] = '\0';
 				xstrcat(job_desc->environment[i], value_str);
 				break;
@@ -595,8 +595,8 @@ static int _job_env_field(const struct job_descriptor *job_desc,
 		lua_pushnil (L);
 	} else {
 		for (i = 0; job_desc->environment[i]; i++) {
-			if (!strncmp(job_desc->environment[i], name_eq,
-				     name_len)) {
+			if (!xstrncmp(job_desc->environment[i], name_eq,
+				      name_len)) {
 				lua_pushstring (L, job_desc->environment[i] +
 						   name_len);
 				break;
@@ -656,115 +656,115 @@ static int _get_job_req_field(const struct job_descriptor *job_desc,
 	if (job_desc == NULL) {
 		error("%s: job_desc is NULL", __func__);
 		lua_pushnil (L);
-	} else if (!strcmp(name, "account")) {
+	} else if (!xstrcmp(name, "account")) {
 		lua_pushstring (L, job_desc->account);
-	} else if (!strcmp(name, "acctg_freq")) {
+	} else if (!xstrcmp(name, "acctg_freq")) {
 		lua_pushstring (L, job_desc->acctg_freq);
-	} else if (!strcmp(name, "alloc_node")) {
+	} else if (!xstrcmp(name, "alloc_node")) {
 		lua_pushstring (L, job_desc->alloc_node);
-	} else if (!strcmp(name, "begin_time")) {
+	} else if (!xstrcmp(name, "array_inx")) {
+		lua_pushstring (L, job_desc->array_inx);
+	} else if (!xstrcmp(name, "begin_time")) {
 		lua_pushnumber (L, job_desc->begin_time);
-	} else if (!strcmp(name, "boards_per_node")) {
+	} else if (!xstrcmp(name, "boards_per_node")) {
 		lua_pushnumber (L, job_desc->boards_per_node);
-	} else if (!strcmp(name, "burst_buffer")) {
+	} else if (!xstrcmp(name, "burst_buffer")) {
 		lua_pushstring (L, job_desc->burst_buffer);
-	} else if (!strcmp(name, "clusters")) {
+	} else if (!xstrcmp(name, "clusters")) {
 		lua_pushstring (L, job_desc->clusters);
-	} else if (!strcmp(name, "comment")) {
+	} else if (!xstrcmp(name, "comment")) {
 		lua_pushstring (L, job_desc->comment);
-	} else if (!strcmp(name, "contiguous")) {
+	} else if (!xstrcmp(name, "contiguous")) {
 		lua_pushnumber (L, job_desc->contiguous);
-	} else if (!strcmp(name, "cores_per_socket")) {
+	} else if (!xstrcmp(name, "cores_per_socket")) {
 		lua_pushnumber (L, job_desc->cores_per_socket);
-	} else if (!strcmp(name, "cpu_freq_min")) {
+	} else if (!xstrcmp(name, "cpu_freq_min")) {
 		lua_pushnumber (L, job_desc->cpu_freq_min);
-	} else if (!strcmp(name, "cpu_freq_max")) {
+	} else if (!xstrcmp(name, "cpu_freq_max")) {
 		lua_pushnumber (L, job_desc->cpu_freq_max);
-	} else if (!strcmp(name, "cpu_freq_gov")) {
+	} else if (!xstrcmp(name, "cpu_freq_gov")) {
 		lua_pushnumber (L, job_desc->cpu_freq_gov);
-	} else if (!strcmp(name, "cpus_per_task")) {
+	} else if (!xstrcmp(name, "cpus_per_task")) {
 		lua_pushnumber (L, job_desc->cpus_per_task);
-	} else if (!strcmp(name, "default_account")) {
+	} else if (!xstrcmp(name, "default_account")) {
 		lua_pushstring (L, _get_default_account(job_desc->user_id));
-	} else if (!strcmp(name, "default_qos")) {
+	} else if (!xstrcmp(name, "default_qos")) {
 		lua_pushstring (L, _get_default_qos(job_desc->user_id,
 						    job_desc->account,
 						    job_desc->partition));
-	} else if (!strcmp(name, "dependency")) {
+	} else if (!xstrcmp(name, "dependency")) {
 		lua_pushstring (L, job_desc->dependency);
-	} else if (!strcmp(name, "end_time")) {
+	} else if (!xstrcmp(name, "end_time")) {
 		lua_pushnumber (L, job_desc->end_time);
-	} else if (!strcmp(name, "environment")) {
+	} else if (!xstrcmp(name, "environment")) {
 		_push_job_env ((struct job_descriptor *)job_desc); // No const
-	} else if (!strcmp(name, "exc_nodes")) {
+	} else if (!xstrcmp(name, "exc_nodes")) {
 		lua_pushstring (L, job_desc->exc_nodes);
-	} else if (!strcmp(name, "features")) {
+	} else if (!xstrcmp(name, "features")) {
 		lua_pushstring (L, job_desc->features);
-	} else if (!strcmp(name, "gres")) {
+	} else if (!xstrcmp(name, "gres")) {
 		lua_pushstring (L, job_desc->gres);
-	} else if (!strcmp(name, "group_id")) {
+	} else if (!xstrcmp(name, "group_id")) {
 		lua_pushnumber (L, job_desc->group_id);
-	} else if (!strcmp(name, "licenses")) {
+	} else if (!xstrcmp(name, "licenses")) {
 		lua_pushstring (L, job_desc->licenses);
-	} else if (!strcmp(name, "mail_type")) {
+	} else if (!xstrcmp(name, "mail_type")) {
 		lua_pushnumber (L, job_desc->mail_type);
-	} else if (!strcmp(name, "mail_user")) {
+	} else if (!xstrcmp(name, "mail_user")) {
 		lua_pushstring (L, job_desc->mail_user);
-	} else if (!strcmp(name, "max_cpus")) {
+	} else if (!xstrcmp(name, "max_cpus")) {
 		lua_pushnumber (L, job_desc->max_cpus);
-	} else if (!strcmp(name, "max_nodes")) {
+	} else if (!xstrcmp(name, "max_nodes")) {
 		lua_pushnumber (L, job_desc->max_nodes);
-	} else if (!strcmp(name, "min_cpus")) {
+	} else if (!xstrcmp(name, "min_cpus")) {
 		lua_pushnumber (L, job_desc->min_cpus);
-	} else if (!strcmp(name, "min_nodes")) {
+	} else if (!xstrcmp(name, "min_nodes")) {
 		lua_pushnumber (L, job_desc->min_nodes);
-	} else if (!strcmp(name, "name")) {
+	} else if (!xstrcmp(name, "name")) {
 		lua_pushstring (L, job_desc->name);
-	} else if (!strcmp(name, "nice")) {
+	} else if (!xstrcmp(name, "nice")) {
 		lua_pushnumber (L, job_desc->nice);
-	} else if (!strcmp(name, "ntasks_per_board")) {
+	} else if (!xstrcmp(name, "ntasks_per_board")) {
 		lua_pushnumber (L, job_desc->ntasks_per_board);
-	} else if (!strcmp(name, "ntasks_per_core")) {
+	} else if (!xstrcmp(name, "ntasks_per_core")) {
 		lua_pushnumber (L, job_desc->ntasks_per_core);
-	} else if (!strcmp(name, "ntasks_per_node")) {
+	} else if (!xstrcmp(name, "ntasks_per_node")) {
 		lua_pushnumber (L, job_desc->ntasks_per_node);
-	} else if (!strcmp(name, "ntasks_per_socket")) {
+	} else if (!xstrcmp(name, "ntasks_per_socket")) {
 		lua_pushnumber (L, job_desc->ntasks_per_socket);
-	} else if (!strcmp(name, "num_tasks")) {
+	} else if (!xstrcmp(name, "num_tasks")) {
 		lua_pushnumber (L, job_desc->num_tasks);
-	} else if (!strcmp(name, "partition")) {
+	} else if (!xstrcmp(name, "partition")) {
 		lua_pushstring (L, job_desc->partition);
-	} else if (!strcmp(name, "power_flags")) {
+	} else if (!xstrcmp(name, "power_flags")) {
 		lua_pushnumber (L, job_desc->power_flags);
-	} else if (!strcmp(name, "pn_min_cpus")) {
+	} else if (!xstrcmp(name, "pn_min_cpus")) {
 		lua_pushnumber (L, job_desc->pn_min_cpus);
-	} else if (!strcmp(name, "pn_min_memory")) {
+	} else if (!xstrcmp(name, "pn_min_memory")) {
 		lua_pushnumber (L, job_desc->pn_min_memory);
-	} else if (!strcmp(name, "pn_min_tmp_disk")) {
+	} else if (!xstrcmp(name, "pn_min_tmp_disk")) {
 		lua_pushnumber (L, job_desc->pn_min_tmp_disk);
-	} else if (!strcmp(name, "priority")) {
+	} else if (!xstrcmp(name, "priority")) {
 		lua_pushnumber (L, job_desc->priority);
-	} else if (!strcmp(name, "qos")) {
+	} else if (!xstrcmp(name, "qos")) {
 		lua_pushstring (L, job_desc->qos);
-	} else if (!strcmp(name, "req_nodes")) {
+	} else if (!xstrcmp(name, "req_nodes")) {
 		lua_pushstring (L, job_desc->req_nodes);
-	} else if (!strcmp(name, "req_switch")) {
+	} else if (!xstrcmp(name, "req_switch")) {
 		lua_pushnumber (L, job_desc->req_switch);
-	} else if (!strcmp(name, "requeue")) {
+	} else if (!xstrcmp(name, "requeue")) {
 		lua_pushnumber (L, job_desc->requeue);
-	} else if (!strcmp(name, "reservation")) {
+	} else if (!xstrcmp(name, "reservation")) {
 		lua_pushstring (L, job_desc->reservation);
-	} else if (!strcmp(name, "script")) {
+	} else if (!xstrcmp(name, "script")) {
 		lua_pushstring (L, job_desc->script);
-	} else if (!strcmp(name, "shared")) {
+	} else if (!xstrcmp(name, "shared")) {
 		lua_pushnumber (L, job_desc->shared);
-	} else if (!strcmp(name, "sicp_mode")) {
-		lua_pushnumber (L, job_desc->sicp_mode);
-	} else if (!strcmp(name, "sockets_per_board")) {
+	} else if (!xstrcmp(name, "sockets_per_board")) {
 		lua_pushnumber (L, job_desc->sockets_per_board);
-	} else if (!strcmp(name, "sockets_per_node")) {
+	} else if (!xstrcmp(name, "sockets_per_node")) {
 		lua_pushnumber (L, job_desc->sockets_per_node);
-	} else if (!strcmp(name, "spank_job_env")) {
+	} else if (!xstrcmp(name, "spank_job_env")) {
 		if ((job_desc->spank_job_env_size == 0) ||
 		    (job_desc->spank_job_env == NULL)) {
 			lua_pushnil (L);
@@ -779,27 +779,27 @@ static int _get_job_req_field(const struct job_descriptor *job_desc,
 				}
 			}
 		}
-	} else if (!strcmp(name, "spank_job_env_size")) {
+	} else if (!xstrcmp(name, "spank_job_env_size")) {
 		lua_pushnumber (L, job_desc->spank_job_env_size);
-	} else if (!strcmp(name, "std_err")) {
+	} else if (!xstrcmp(name, "std_err")) {
 		lua_pushstring (L, job_desc->std_err);
-	} else if (!strcmp(name, "std_in")) {
+	} else if (!xstrcmp(name, "std_in")) {
 		lua_pushstring (L, job_desc->std_in);
-	} else if (!strcmp(name, "std_out")) {
+	} else if (!xstrcmp(name, "std_out")) {
 		lua_pushstring (L, job_desc->std_out);
-	} else if (!strcmp(name, "threads_per_core")) {
+	} else if (!xstrcmp(name, "threads_per_core")) {
 		lua_pushnumber (L, job_desc->threads_per_core);
-	} else if (!strcmp(name, "time_limit")) {
+	} else if (!xstrcmp(name, "time_limit")) {
 		lua_pushnumber (L, job_desc->time_limit);
-	} else if (!strcmp(name, "time_min")) {
+	} else if (!xstrcmp(name, "time_min")) {
 		lua_pushnumber (L, job_desc->time_min);
-	} else if (!strcmp(name, "user_id")) {
+	} else if (!xstrcmp(name, "user_id")) {
 		lua_pushnumber (L, job_desc->user_id);
-	} else if (!strcmp(name, "wait4switch")) {
+	} else if (!xstrcmp(name, "wait4switch")) {
 		lua_pushnumber (L, job_desc->wait4switch);
-	} else if (!strcmp(name, "work_dir")) {
+	} else if (!xstrcmp(name, "work_dir")) {
 		lua_pushstring (L, job_desc->work_dir);
-	} else if (!strcmp(name, "wckey")) {
+	} else if (!xstrcmp(name, "wckey")) {
 		lua_pushstring (L, job_desc->wckey);
 	} else {
 		lua_pushnil (L);
@@ -843,167 +843,170 @@ static int _set_job_req_field(lua_State *L)
 	job_desc = lua_touserdata(L, -1);
 	if (job_desc == NULL) {
 		error("%s: job_desc is NULL", __func__);
-	} else if (!strcmp(name, "account")) {
+	} else if (!xstrcmp(name, "account")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->account);
 		if (strlen(value_str))
 			job_desc->account = xstrdup(value_str);
-	} else if (!strcmp(name, "acctg_freq")) {
+	} else if (!xstrcmp(name, "acctg_freq")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->acctg_freq);
 		if (strlen(value_str))
 			job_desc->acctg_freq = xstrdup(value_str);
-	} else if (!strcmp(name, "begin_time")) {
+	} else if (!xstrcmp(name, "array_inx")) {
+		value_str = luaL_checkstring(L, 3);
+		xfree(job_desc->array_inx);
+		if (strlen(value_str))
+			job_desc->array_inx = xstrdup(value_str);
+	} else if (!xstrcmp(name, "begin_time")) {
 		job_desc->begin_time = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "burst_buffer")) {
+	} else if (!xstrcmp(name, "burst_buffer")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->burst_buffer);
 		if (strlen(value_str))
 			job_desc->burst_buffer = xstrdup(value_str);
-	} else if (!strcmp(name, "clusters")) {
+	} else if (!xstrcmp(name, "clusters")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->clusters);
 		if (strlen(value_str))
 			job_desc->clusters = xstrdup(value_str);
-	} else if (!strcmp(name, "comment")) {
+	} else if (!xstrcmp(name, "comment")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->comment);
 		if (strlen(value_str))
 			job_desc->comment = xstrdup(value_str);
-	} else if (!strcmp(name, "contiguous")) {
+	} else if (!xstrcmp(name, "contiguous")) {
 		job_desc->contiguous = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "cores_per_socket")) {
+	} else if (!xstrcmp(name, "cores_per_socket")) {
 		job_desc->cores_per_socket = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "cpus_per_task")) {
+	} else if (!xstrcmp(name, "cpus_per_task")) {
 		job_desc->cpus_per_task = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "cpu_freq_min")) {
+	} else if (!xstrcmp(name, "cpu_freq_min")) {
 		job_desc->cpu_freq_min = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "cpu_freq_max")) {
+	} else if (!xstrcmp(name, "cpu_freq_max")) {
 		job_desc->cpu_freq_max = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "cpu_freq_gov")) {
+	} else if (!xstrcmp(name, "cpu_freq_gov")) {
 		job_desc->cpu_freq_gov = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "dependency")) {
+	} else if (!xstrcmp(name, "dependency")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->dependency);
 		if (strlen(value_str))
 			job_desc->dependency = xstrdup(value_str);
-	} else if (!strcmp(name, "end_time")) {
+	} else if (!xstrcmp(name, "end_time")) {
 		job_desc->end_time = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "exc_nodes")) {
+	} else if (!xstrcmp(name, "exc_nodes")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->exc_nodes);
 		if (strlen(value_str))
 			job_desc->exc_nodes = xstrdup(value_str);
-	} else if (!strcmp(name, "features")) {
+	} else if (!xstrcmp(name, "features")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->features);
 		if (strlen(value_str))
 			job_desc->features = xstrdup(value_str);
-	} else if (!strcmp(name, "gres")) {
+	} else if (!xstrcmp(name, "gres")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->gres);
 		if (strlen(value_str))
 			job_desc->gres = xstrdup(value_str);
-	} else if (!strcmp(name, "licenses")) {
+	} else if (!xstrcmp(name, "licenses")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->licenses);
 		if (strlen(value_str))
 			job_desc->licenses = xstrdup(value_str);
-	} else if (!strcmp(name, "max_cpus")) {
+	} else if (!xstrcmp(name, "max_cpus")) {
 		job_desc->max_cpus = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "max_nodes")) {
+	} else if (!xstrcmp(name, "max_nodes")) {
 		job_desc->max_nodes = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "min_cpus")) {
+	} else if (!xstrcmp(name, "min_cpus")) {
 		job_desc->min_cpus = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "min_nodes")) {
+	} else if (!xstrcmp(name, "min_nodes")) {
 		job_desc->min_nodes = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "name")) {
+	} else if (!xstrcmp(name, "name")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->name);
 		if (strlen(value_str))
 			job_desc->name = xstrdup(value_str);
-	} else if (!strcmp(name, "nice")) {
+	} else if (!xstrcmp(name, "nice")) {
 		job_desc->nice = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "ntasks_per_node")) {
+	} else if (!xstrcmp(name, "ntasks_per_node")) {
 		job_desc->ntasks_per_node = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "ntasks_per_socket")) {
+	} else if (!xstrcmp(name, "ntasks_per_socket")) {
 		job_desc->ntasks_per_socket = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "num_tasks")) {
+	} else if (!xstrcmp(name, "num_tasks")) {
 		job_desc->num_tasks = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "partition")) {
+	} else if (!xstrcmp(name, "partition")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->partition);
 		if (strlen(value_str))
 			job_desc->partition = xstrdup(value_str);
-	} else if (!strcmp(name, "power_flags")) {
+	} else if (!xstrcmp(name, "power_flags")) {
 		job_desc->power_flags = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "pn_min_cpus")) {
+	} else if (!xstrcmp(name, "pn_min_cpus")) {
 		job_desc->pn_min_cpus = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "pn_min_memory")) {
+	} else if (!xstrcmp(name, "pn_min_memory")) {
 		job_desc->pn_min_memory = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "pn_min_tmp_disk")) {
+	} else if (!xstrcmp(name, "pn_min_tmp_disk")) {
 		job_desc->pn_min_tmp_disk = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "priority")) {
+	} else if (!xstrcmp(name, "priority")) {
 		job_desc->priority = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "qos")) {
+	} else if (!xstrcmp(name, "qos")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->qos);
 		if (strlen(value_str))
 			job_desc->qos = xstrdup(value_str);
-	} else if (!strcmp(name, "req_nodes")) {
+	} else if (!xstrcmp(name, "req_nodes")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->req_nodes);
 		if (strlen(value_str))
 			job_desc->req_nodes = xstrdup(value_str);
-	} else if (!strcmp(name, "req_switch")) {
+	} else if (!xstrcmp(name, "req_switch")) {
 		job_desc->req_switch = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "requeue")) {
+	} else if (!xstrcmp(name, "requeue")) {
 		job_desc->requeue = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "reservation")) {
+	} else if (!xstrcmp(name, "reservation")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->reservation);
 		if (strlen(value_str))
 			job_desc->reservation = xstrdup(value_str);
-	} else if (!strcmp(name, "script")) {
+	} else if (!xstrcmp(name, "script")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->script);
 		if (strlen(value_str))
 			job_desc->script = xstrdup(value_str);
-	} else if (!strcmp(name, "shared")) {
+	} else if (!xstrcmp(name, "shared")) {
 		job_desc->shared = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "sicp_mode")) {
-		job_desc->sicp_mode = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "sockets_per_node")) {
+	} else if (!xstrcmp(name, "sockets_per_node")) {
 		job_desc->sockets_per_node = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "std_err")) {
+	} else if (!xstrcmp(name, "std_err")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->std_err);
 		if (strlen(value_str))
 			job_desc->std_err = xstrdup(value_str);
-	} else if (!strcmp(name, "std_in")) {
+	} else if (!xstrcmp(name, "std_in")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->std_in);
 		if (strlen(value_str))
 			job_desc->std_in = xstrdup(value_str);
-	} else if (!strcmp(name, "std_out")) {
+	} else if (!xstrcmp(name, "std_out")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->std_out);
 		if (strlen(value_str))
 			job_desc->std_out = xstrdup(value_str);
-	} else if (!strcmp(name, "threads_per_core")) {
+	} else if (!xstrcmp(name, "threads_per_core")) {
 		job_desc->threads_per_core = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "time_limit")) {
+	} else if (!xstrcmp(name, "time_limit")) {
 		job_desc->time_limit = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "time_min")) {
+	} else if (!xstrcmp(name, "time_min")) {
 		job_desc->time_min = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "wait4switch")) {
+	} else if (!xstrcmp(name, "wait4switch")) {
 		job_desc->wait4switch = luaL_checknumber(L, 3);
-	} else if (!strcmp(name, "wckey")) {
+	} else if (!xstrcmp(name, "wckey")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->wckey);
 		if (strlen(value_str))
 			job_desc->wckey = xstrdup(value_str);
-	} else if (!strcmp(name, "work_dir")) {
+	} else if (!xstrcmp(name, "work_dir")) {
 		value_str = luaL_checkstring(L, 3);
 		xfree(job_desc->work_dir);
 		if (strlen(value_str))
@@ -1058,36 +1061,38 @@ static int _part_rec_field(const struct part_record *part_ptr,
 	if (part_ptr == NULL) {
 		error("_get_part_field: part_ptr is NULL");
 		lua_pushnil (L);
-	} else if (!strcmp(name, "allow_qos")) {
+	} else if (!xstrcmp(name, "allow_qos")) {
 		lua_pushstring (L, part_ptr->allow_qos);
-	} else if (!strcmp(name, "default_time")) {
+	} else if (!xstrcmp(name, "default_time")) {
 		lua_pushnumber (L, part_ptr->default_time);
-	} else if (!strcmp(name, "flag_default")) {
+	} else if (!xstrcmp(name, "flag_default")) {
 		int is_default = 0;
 		if (part_ptr->flags & PART_FLAG_DEFAULT)
 			is_default = 1;
 		lua_pushnumber (L, is_default);
-	} else if (!strcmp(name, "flags")) {
+	} else if (!xstrcmp(name, "flags")) {
 		lua_pushnumber (L, part_ptr->flags);
-	} else if (!strcmp(name, "max_nodes")) {
+	} else if (!xstrcmp(name, "max_nodes")) {
 		lua_pushnumber (L, part_ptr->max_nodes);
-	} else if (!strcmp(name, "max_nodes_orig")) {
+	} else if (!xstrcmp(name, "max_nodes_orig")) {
 		lua_pushnumber (L, part_ptr->max_nodes_orig);
-	} else if (!strcmp(name, "max_time")) {
+	} else if (!xstrcmp(name, "max_time")) {
 		lua_pushnumber (L, part_ptr->max_time);
-	} else if (!strcmp(name, "min_nodes")) {
+	} else if (!xstrcmp(name, "min_nodes")) {
 		lua_pushnumber (L, part_ptr->min_nodes);
-	} else if (!strcmp(name, "min_nodes_orig")) {
+	} else if (!xstrcmp(name, "min_nodes_orig")) {
 		lua_pushnumber (L, part_ptr->min_nodes_orig);
-	} else if (!strcmp(name, "name")) {
+	} else if (!xstrcmp(name, "name")) {
 		lua_pushstring (L, part_ptr->name);
-	} else if (!strcmp(name, "nodes")) {
+	} else if (!xstrcmp(name, "nodes")) {
 		lua_pushstring (L, part_ptr->nodes);
-	} else if (!strcmp(name, "priority")) {
-		lua_pushnumber (L, part_ptr->priority);
-	} else if (!strcmp(name, "qos")) {
+	} else if (!xstrcmp(name, "priority_job_factor")) {
+		lua_pushnumber (L, part_ptr->priority_job_factor);
+	} else if (!xstrcmp(name, "priority_tier")) {
+		lua_pushnumber (L, part_ptr->priority_tier);
+	} else if (!xstrcmp(name, "qos")) {
 		lua_pushstring (L, part_ptr->qos_char);
-	} else if (!strcmp(name, "state_up")) {
+	} else if (!xstrcmp(name, "state_up")) {
 		lua_pushnumber (L, part_ptr->state_up);
 	} else {
 		lua_pushnil (L);
diff --git a/src/plugins/job_submit/partition/Makefile.in b/src/plugins/job_submit/partition/Makefile.in
index 74a580365..1bfab7b8f 100644
--- a/src/plugins/job_submit/partition/Makefile.in
+++ b/src/plugins/job_submit/partition/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/partition
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/partition/job_submit_partition.c b/src/plugins/job_submit/partition/job_submit_partition.c
index 936e17866..b373b77dc 100644
--- a/src/plugins/job_submit/partition/job_submit_partition.c
+++ b/src/plugins/job_submit/partition/job_submit_partition.c
@@ -170,9 +170,9 @@ static bool _valid_memory(struct part_record *part_ptr,
 	return true;
 }
 
-/* This example code will set a job's default partition to the highest
- * priority partition that is available to this user. This is only an
- * example and tremendous flexibility is available. */
+/* This example code will set a job's default partition to the partition with
+ * highest priority_tier is available to this user. This is only an example
+ * and tremendous flexibility is available. */
 extern int job_submit(struct job_descriptor *job_desc, uint32_t submit_uid,
 		      char **err_msg)
 {
@@ -191,7 +191,7 @@ extern int job_submit(struct job_descriptor *job_desc, uint32_t submit_uid,
 			continue;	/* AllowGroups prevents use */
 
 		if (!top_prio_part ||
-		    (top_prio_part->priority < part_ptr->priority)) {
+		    (top_prio_part->priority_tier < part_ptr->priority_tier)) {
 			/* Test job specification elements here */
 			if (!_valid_memory(part_ptr, job_desc))
 				continue;
diff --git a/src/plugins/job_submit/pbs/Makefile.in b/src/plugins/job_submit/pbs/Makefile.in
index f46a99e98..a718ad414 100644
--- a/src/plugins/job_submit/pbs/Makefile.in
+++ b/src/plugins/job_submit/pbs/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/pbs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -255,8 +256,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -356,6 +355,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -394,6 +397,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -437,6 +443,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -487,6 +496,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/pbs/job_submit_pbs.c b/src/plugins/job_submit/pbs/job_submit_pbs.c
index 69f186a6a..7b3264c7a 100644
--- a/src/plugins/job_submit/pbs/job_submit_pbs.c
+++ b/src/plugins/job_submit/pbs/job_submit_pbs.c
@@ -188,13 +188,13 @@ static void _xlate_before(char *depend, uint32_t submit_uid, uint32_t my_job_id)
 
 
 	tok = strtok_r(depend, ":", &last_ptr);
-	if (!strcmp(tok, "before"))
+	if (!xstrcmp(tok, "before"))
 		type = "after";
-	else if (!strcmp(tok, "beforeany"))
+	else if (!xstrcmp(tok, "beforeany"))
 		type = "afterany";
-	else if (!strcmp(tok, "beforenotok"))
+	else if (!xstrcmp(tok, "beforenotok"))
 		type = "afternotok";
-	else if (!strcmp(tok, "beforeok"))
+	else if (!xstrcmp(tok, "beforeok"))
 		type = "afterok";
 	else {
 		info("%s: discarding invalid job dependency option %s",
@@ -283,18 +283,18 @@ static void _xlate_dependency(struct job_descriptor *job_desc,
 
 	tok = strtok_r(job_desc->dependency, ",", &last_ptr);
 	while (tok) {
-		if (!strncmp(tok, "after", 5)  ||
-		    !strncmp(tok, "expand", 6) ||
-		    !strncmp(tok, "singleton", 9)) {
+		if (!xstrncmp(tok, "after", 5)  ||
+		    !xstrncmp(tok, "expand", 6) ||
+		    !xstrncmp(tok, "singleton", 9)) {
 			if (result)
 				xstrcat(result, ",");
 			xstrcat(result, tok);
-		} else if (!strncmp(tok, "on:", 3)) {
+		} else if (!xstrncmp(tok, "on:", 3)) {
 			job_desc->priority = 0;	/* Job is held */
 			if (job_desc->comment)
 				xstrcat(job_desc->comment, ",");
 			xstrcat(job_desc->comment, tok);
-		} else if (!strncmp(tok, "before", 6)) {
+		} else if (!xstrncmp(tok, "before", 6)) {
 			_xlate_before(tok, submit_uid, my_job_id);
 		} else {
 			info("%s: discarding unknown job dependency option %s",
diff --git a/src/plugins/job_submit/require_timelimit/Makefile.in b/src/plugins/job_submit/require_timelimit/Makefile.in
index d1fc5d1f4..a6f9d7874 100644
--- a/src/plugins/job_submit/require_timelimit/Makefile.in
+++ b/src/plugins/job_submit/require_timelimit/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/require_timelimit
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/job_submit/throttle/Makefile.in b/src/plugins/job_submit/throttle/Makefile.in
index 7574d348a..d2b7e8441 100644
--- a/src/plugins/job_submit/throttle/Makefile.in
+++ b/src/plugins/job_submit/throttle/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/job_submit/throttle
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/Makefile.in b/src/plugins/jobacct_gather/Makefile.in
index b82f72f2e..e5aef2cdc 100644
--- a/src/plugins/jobacct_gather/Makefile.in
+++ b/src/plugins/jobacct_gather/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/aix/Makefile.in b/src/plugins/jobacct_gather/aix/Makefile.in
index c78964f33..b52c94383 100644
--- a/src/plugins/jobacct_gather/aix/Makefile.in
+++ b/src/plugins/jobacct_gather/aix/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather/aix
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/cgroup/Makefile.in b/src/plugins/jobacct_gather/cgroup/Makefile.in
index f60bd9367..f0bb803d5 100644
--- a/src/plugins/jobacct_gather/cgroup/Makefile.in
+++ b/src/plugins/jobacct_gather/cgroup/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather/cgroup
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -253,8 +254,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -354,6 +353,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -392,6 +395,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -435,6 +441,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -485,6 +494,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c
index 61efb0505..3725ac1be 100644
--- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c
+++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.c
@@ -329,29 +329,30 @@ extern char* jobacct_cgroup_create_slurm_cg(xcgroup_ns_t* ns)
 	/* in libslurm (src/common/xcgroup.c) */
 	xcgroup_t slurm_cg;
 	char* pre = (char*) xstrdup(slurm_cgroup_conf.cgroup_prepend);
+
 #ifdef MULTIPLE_SLURMD
-	if (conf->node_name != NULL)
-		xstrsubstitute(pre,"%n", conf->node_name);
-	else {
+	if (conf->node_name != NULL) {
+		xstrsubstitute(pre, "%n", conf->node_name);
+	} else {
 		xfree(pre);
 		pre = (char*) xstrdup("/slurm");
 	}
 #endif
 
 	/* create slurm cgroup in the ns (it could already exist) */
-	if (xcgroup_create(ns,&slurm_cg,pre,
+	if (xcgroup_create(ns, &slurm_cg, pre,
 			   getuid(), getgid()) != XCGROUP_SUCCESS) {
 		return pre;
 	}
 
-	if (xcgroup_instanciate(&slurm_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&slurm_cg) != XCGROUP_SUCCESS) {
 		error("unable to build slurm cgroup for ns %s: %m",
 		      ns->subsystems);
 		xcgroup_destroy(&slurm_cg);
 		return pre;
 	} else {
 		debug3("slurm cgroup %s successfully created for ns %s: %m",
-		       pre,ns->subsystems);
+		       pre, ns->subsystems);
 		xcgroup_destroy(&slurm_cg);
 	}
 
diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c
index badbb4c55..6b04680a4 100644
--- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c
+++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_blkio.c
@@ -1,325 +1,325 @@
-/*****************************************************************************\
- *  jobacct_gather_cgroup_blkio.c - blkio cgroup subsystem for
- *  jobacct_gather/cgroup
- *****************************************************************************
- *  Copyright (C) 2013 Bull
- *  Written by Martin Perry (martin.perry@bull.com) based on code from
- *  Matthieu Hautreux
- *
- *  This file is part of SLURM, a resource management program.
- *  For details, see <http://slurm.schedmd.com/>.
- *  Please also read the included file: DISCLAIMER.
- *
- *  SLURM is free software; you can redistribute it and/or modify it under
- *  the terms of the GNU General Public License as published by the Free
- *  Software Foundation; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  In addition, as a special exception, the copyright holders give permission
- *  to link the code of portions of this program with the OpenSSL library under
- *  certain conditions as described in each individual source file, and
- *  distribute linked combinations including the two. You must obey the GNU
- *  General Public License in all respects for all of the code used other than
- *  OpenSSL. If you modify file(s) with this exception, you may extend this
- *  exception to your version of the file(s), but you are not obligated to do
- *  so. If you do not wish to do so, delete this exception statement from your
- *  version.  If you delete this exception statement from all source files in
- *  the program, then also delete it here.
- *
- *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
- *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- *  details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with SLURM; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
-
-/* FIXME: Enable when kernel support is ready. */
-
-/* #if HAVE_CONFIG_H */
-/* #include "config.h" */
-/* #endif */
-
-/* #include <sys/types.h> */
-/* #include <stdlib.h>		/\* getenv   *\/ */
-
-/* #include "slurm/slurm_errno.h" */
-/* #include "slurm/slurm.h" */
-/* #include "src/common/xstring.h" */
-/* #include "src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h" */
-/* #include "src/slurmd/slurmstepd/slurmstepd_job.h" */
-/* #include "src/slurmd/slurmd/slurmd.h" */
-
-/* #ifndef PATH_MAX */
-/* #define PATH_MAX 256 */
-/* #endif */
-
-/* static char user_cgroup_path[PATH_MAX]; */
-/* static char job_cgroup_path[PATH_MAX]; */
-/* static char jobstep_cgroup_path[PATH_MAX]; */
-/* static char task_cgroup_path[PATH_MAX]; */
-
-/* static xcgroup_ns_t blkio_ns; */
-
-/* static xcgroup_t user_blkio_cg; */
-/* static xcgroup_t job_blkio_cg; */
-/* static xcgroup_t step_blkio_cg; */
-/* xcgroup_t task_blkio_cg; */
-
-
-/* extern int jobacct_gather_cgroup_blkio_init( */
-/* 	slurm_cgroup_conf_t *slurm_cgroup_conf) */
-/* { */
-/* 	/\* initialize user/job/jobstep cgroup relative paths *\/ */
-/* 	user_cgroup_path[0]='\0'; */
-/* 	job_cgroup_path[0]='\0'; */
-/* 	jobstep_cgroup_path[0]='\0'; */
-
-/* 	/\* initialize blkio cgroup namespace *\/ */
-/* 	if (xcgroup_ns_create(slurm_cgroup_conf, &blkio_ns, "", "blkio") */
-/* 	    != XCGROUP_SUCCESS) { */
-/* 		error("jobacct_gather/cgroup: unable to create blkio " */
-/* 		      "namespace"); */
-/* 		return SLURM_ERROR; */
-/* 	} */
-/* 	return SLURM_SUCCESS; */
-/* } */
-
-/* extern int jobacct_gather_cgroup_blkio_fini( */
-/* 	slurm_cgroup_conf_t *slurm_cgroup_conf) */
-/* { */
-/* 	if (user_cgroup_path[0] == '\0' || */
-/* 	    job_cgroup_path[0] == '\0' || */
-/* 	    jobstep_cgroup_path[0] == '\0') */
-/* 		return SLURM_SUCCESS; */
-
-/* 	xcgroup_destroy(&user_blkio_cg); */
-/* 	xcgroup_destroy(&job_blkio_cg); */
-/* 	xcgroup_destroy(&step_blkio_cg); */
-
-/* 	user_cgroup_path[0]='\0'; */
-/* 	job_cgroup_path[0]='\0'; */
-/* 	jobstep_cgroup_path[0]='\0'; */
-
-/* 	xcgroup_ns_destroy(&blkio_ns); */
-
-/* 	return SLURM_SUCCESS; */
-/* } */
-
-/* extern int jobacct_gather_cgroup_blkio_attach_task( */
-/* 	pid_t pid, jobacct_id_t *jobacct_id) */
-/* { */
-/* 	xcgroup_t blkio_cg; */
-/* 	stepd_step_rec_t *job; */
-/* 	uid_t uid; */
-/* 	gid_t gid; */
-/* 	uint32_t jobid; */
-/* 	uint32_t stepid; */
-/* 	uint32_t taskid; */
-/* 	int fstatus = SLURM_SUCCESS; */
-/* 	int rc; */
-/* 	char* slurm_cgpath; */
-
-/* 	job = jobacct_id->job; */
-/* 	uid = job->uid; */
-/* 	gid = job->gid; */
-/* 	jobid = job->jobid; */
-/* 	stepid = job->stepid; */
-/* 	taskid = jobacct_id->taskid; */
-
-/* 	/\* create slurm root cg in this cg namespace *\/ */
-/* 	slurm_cgpath = jobacct_cgroup_create_slurm_cg(&blkio_ns); */
-/* 	if (!slurm_cgpath) { */
-/* 		return SLURM_ERROR; */
-/* 	} */
-
-/* 	/\* build user cgroup relative path if not set (should not be) *\/ */
-/* 	if (*user_cgroup_path == '\0') { */
-/* 		if (snprintf(user_cgroup_path, PATH_MAX, */
-/* 			     "%s/uid_%u", slurm_cgpath, uid) >= PATH_MAX) { */
-/* 			error("unable to build uid %u cgroup relative " */
-/* 			      "path : %m", uid); */
-/* 			xfree(slurm_cgpath); */
-/* 			return SLURM_ERROR; */
-/* 		} */
-/* 	} */
-
-/* 	/\* build job cgroup relative path if not set (may not be) *\/ */
-/* 	if (*job_cgroup_path == '\0') { */
-/* 		if (snprintf(job_cgroup_path, PATH_MAX, "%s/job_%u", */
-/* 			     user_cgroup_path, jobid) >= PATH_MAX) { */
-/* 			error("jobacct_gather/cgroup: unable to build job %u " */
-/* 			      "blkio cg relative path : %m", jobid); */
-/* 			return SLURM_ERROR; */
-/* 		} */
-/* 	} */
-
-/* 	/\* build job step cgroup relative path if not set (may not be) *\/ */
-/* 	if (*jobstep_cgroup_path == '\0') { */
-/*		int len; */
-/*		if (stepid == SLURM_BATCH_SCRIPT) { */
-/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
-/*				       "%s/step_batch", job_cgroup_path); */
-/*		} else if (stepid == SLURM_EXTERN_CONT) { */
-/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
-/*				       "%s/step_extern", job_cgroup_path); */
-/*		} else { */
-/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
-/*				       "%s/step_%u", */
-/*				       job_cgroup_path, stepid); */
-/*		} */
-/*		if (len >= PATH_MAX) { */
-/* 			error("jobacct_gather/cgroup: unable to build job step " */
-/* 			      "%u.%u blkio cg relative path : %m", */
-/*			      jobid, stepid); */
-/* 			return SLURM_ERROR; */
-/* 		} */
-/* 	} */
-
-/* 	/\* build task cgroup relative path *\/ */
-/* 	if (snprintf(task_cgroup_path, PATH_MAX, "%s/task_%u", */
-/* 		     jobstep_cgroup_path, taskid) >= PATH_MAX) { */
-/* 		error("jobacct_gather/cgroup: unable to build task %u " */
-/* 		      "blkio cg relative path : %m", taskid); */
-/* 		return SLURM_ERROR; */
-/* 	} */
-
-/* 	fstatus = SLURM_SUCCESS; */
-
-/* 	/\* */
-/* 	 * create blkio root cg and lock it */
-/* 	 * */
-/* 	 * we will keep the lock until the end to avoid the effect of a release */
-/* 	 * agent that would remove an existing cgroup hierarchy while we are */
-/* 	 * setting it up. As soon as the step cgroup is created, we can release */
-/* 	 * the lock. */
-/* 	 * Indeed, consecutive slurm steps could result in cg being removed */
-/* 	 * between the next EEXIST instanciation and the first addition of */
-/* 	 * a task. The release_agent will have to lock the root blkio cgroup */
-/* 	 * to avoid this scenario. */
-/* 	 *\/ */
-
-/* 	if (xcgroup_create(&blkio_ns, &blkio_cg, "", 0, 0) */
-/* 	    != XCGROUP_SUCCESS) { */
-/* 		error("jobacct_gather/cgroup: unable to create root blkio " */
-/* 		      "xcgroup"); */
-/* 		return SLURM_ERROR; */
-/* 	} */
-/* 	if (xcgroup_lock(&blkio_cg) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to lock root blkio cg"); */
-/* 		return SLURM_ERROR; */
-/* 	} */
-
-/* 	/\* */
-/* 	 * Create user cgroup in the blkio ns (it could already exist) */
-/* 	 *\/ */
-/* 	if (xcgroup_create(&blkio_ns, &user_blkio_cg, */
-/* 			   user_cgroup_path, */
-/* 			   uid, gid) != XCGROUP_SUCCESS) { */
-/* 		error("jobacct_gather/cgroup: unable to create user %u blkio " */
-/* 		      "cgroup", uid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	if (xcgroup_instanciate(&user_blkio_cg) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to instanciate user %u " */
-/* 		      "blkio cgroup", uid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	/\* */
-/* 	 * Create job cgroup in the blkio ns (it could already exist) */
-/* 	 *\/ */
-/* 	if (xcgroup_create(&blkio_ns, &job_blkio_cg, */
-/* 			   job_cgroup_path, */
-/* 			   uid, gid) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to create job %u blkio " */
-/* 		      "cgroup", jobid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	if (xcgroup_instanciate(&job_blkio_cg) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		xcgroup_destroy(&job_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to instanciate job %u " */
-/* 		      "blkio cgroup", jobid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	/\* */
-/* 	 * Create step cgroup in the blkio ns (it could already exist) */
-/* 	 *\/ */
-/* 	if (xcgroup_create(&blkio_ns, &step_blkio_cg, */
-/* 			   jobstep_cgroup_path, */
-/* 			   uid, gid) != XCGROUP_SUCCESS) { */
-/* 		/\* do not delete user/job cgroup as they can exist for other */
-/* 		 * steps, but release cgroup structures *\/ */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		xcgroup_destroy(&job_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */
-/* 		      "blkio cgroup", jobid, stepid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	if (xcgroup_instanciate(&step_blkio_cg) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		xcgroup_destroy(&job_blkio_cg); */
-/* 		xcgroup_destroy(&step_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to instantiate jobstep " */
-/* 		      "%u.%u blkio cgroup", jobid, stepid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	/\* */
-/* 	 * Create task cgroup in the blkio ns */
-/* 	 *\/ */
-/* 	if (xcgroup_create(&blkio_ns, &task_blkio_cg, */
-/* 			   task_cgroup_path, */
-/* 			   uid, gid) != XCGROUP_SUCCESS) { */
-/* 		/\* do not delete user/job cgroup as they can exist for other */
-/* 		 * steps, but release cgroup structures *\/ */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		xcgroup_destroy(&job_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */
-/* 		      "task %u blkio cgroup", jobid, stepid, taskid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	if (xcgroup_instanciate(&task_blkio_cg) != XCGROUP_SUCCESS) { */
-/* 		xcgroup_destroy(&user_blkio_cg); */
-/* 		xcgroup_destroy(&job_blkio_cg); */
-/* 		xcgroup_destroy(&step_blkio_cg); */
-/* 		error("jobacct_gather/cgroup: unable to instantiate jobstep " */
-/* 		      "%u.%u task %u blkio cgroup", jobid, stepid, taskid); */
-/* 		fstatus = SLURM_ERROR; */
-/* 		goto error; */
-/* 	} */
-
-/* 	/\* */
-/* 	 * Attach the slurmstepd to the task blkio cgroup */
-/* 	 *\/ */
-/* 	rc = xcgroup_add_pids(&task_blkio_cg, &pid, 1); */
-/* 	if (rc != XCGROUP_SUCCESS) { */
-/* 		error("jobacct_gather/cgroup: unable to add slurmstepd to " */
-/* 		      "blkio cg '%s'", task_blkio_cg.path); */
-/* 		fstatus = SLURM_ERROR; */
-/* 	} else */
-/* 		fstatus = SLURM_SUCCESS; */
-
-/* error: */
-/* 	xcgroup_unlock(&blkio_cg); */
-/* 	xcgroup_destroy(&blkio_cg); */
-/* 	return fstatus; */
-/* } */
+/*****************************************************************************\
+ *  jobacct_gather_cgroup_blkio.c - blkio cgroup subsystem for
+ *  jobacct_gather/cgroup
+ *****************************************************************************
+ *  Copyright (C) 2013 Bull
+ *  Written by Martin Perry (martin.perry@bull.com) based on code from
+ *  Matthieu Hautreux
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+/* FIXME: Enable when kernel support is ready. */
+
+/* #if HAVE_CONFIG_H */
+/* #include "config.h" */
+/* #endif */
+
+/* #include <sys/types.h> */
+/* #include <stdlib.h>		/\* getenv   *\/ */
+
+/* #include "slurm/slurm_errno.h" */
+/* #include "slurm/slurm.h" */
+/* #include "src/common/xstring.h" */
+/* #include "src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup.h" */
+/* #include "src/slurmd/slurmstepd/slurmstepd_job.h" */
+/* #include "src/slurmd/slurmd/slurmd.h" */
+
+/* #ifndef PATH_MAX */
+/* #define PATH_MAX 256 */
+/* #endif */
+
+/* static char user_cgroup_path[PATH_MAX]; */
+/* static char job_cgroup_path[PATH_MAX]; */
+/* static char jobstep_cgroup_path[PATH_MAX]; */
+/* static char task_cgroup_path[PATH_MAX]; */
+
+/* static xcgroup_ns_t blkio_ns; */
+
+/* static xcgroup_t user_blkio_cg; */
+/* static xcgroup_t job_blkio_cg; */
+/* static xcgroup_t step_blkio_cg; */
+/* xcgroup_t task_blkio_cg; */
+
+
+/* extern int jobacct_gather_cgroup_blkio_init( */
+/* 	slurm_cgroup_conf_t *slurm_cgroup_conf) */
+/* { */
+/* 	/\* initialize user/job/jobstep cgroup relative paths *\/ */
+/* 	user_cgroup_path[0]='\0'; */
+/* 	job_cgroup_path[0]='\0'; */
+/* 	jobstep_cgroup_path[0]='\0'; */
+
+/* 	/\* initialize blkio cgroup namespace *\/ */
+/* 	if (xcgroup_ns_create(slurm_cgroup_conf, &blkio_ns, "", "blkio") */
+/* 	    != XCGROUP_SUCCESS) { */
+/* 		error("jobacct_gather/cgroup: unable to create blkio " */
+/* 		      "namespace"); */
+/* 		return SLURM_ERROR; */
+/* 	} */
+/* 	return SLURM_SUCCESS; */
+/* } */
+
+/* extern int jobacct_gather_cgroup_blkio_fini( */
+/* 	slurm_cgroup_conf_t *slurm_cgroup_conf) */
+/* { */
+/* 	if (user_cgroup_path[0] == '\0' || */
+/* 	    job_cgroup_path[0] == '\0' || */
+/* 	    jobstep_cgroup_path[0] == '\0') */
+/* 		return SLURM_SUCCESS; */
+
+/* 	xcgroup_destroy(&user_blkio_cg); */
+/* 	xcgroup_destroy(&job_blkio_cg); */
+/* 	xcgroup_destroy(&step_blkio_cg); */
+
+/* 	user_cgroup_path[0]='\0'; */
+/* 	job_cgroup_path[0]='\0'; */
+/* 	jobstep_cgroup_path[0]='\0'; */
+
+/* 	xcgroup_ns_destroy(&blkio_ns); */
+
+/* 	return SLURM_SUCCESS; */
+/* } */
+
+/* extern int jobacct_gather_cgroup_blkio_attach_task( */
+/* 	pid_t pid, jobacct_id_t *jobacct_id) */
+/* { */
+/* 	xcgroup_t blkio_cg; */
+/* 	stepd_step_rec_t *job; */
+/* 	uid_t uid; */
+/* 	gid_t gid; */
+/* 	uint32_t jobid; */
+/* 	uint32_t stepid; */
+/* 	uint32_t taskid; */
+/* 	int fstatus = SLURM_SUCCESS; */
+/* 	int rc; */
+/* 	char* slurm_cgpath; */
+
+/* 	job = jobacct_id->job; */
+/* 	uid = job->uid; */
+/* 	gid = job->gid; */
+/* 	jobid = job->jobid; */
+/* 	stepid = job->stepid; */
+/* 	taskid = jobacct_id->taskid; */
+
+/* 	/\* create slurm root cg in this cg namespace *\/ */
+/* 	slurm_cgpath = jobacct_cgroup_create_slurm_cg(&blkio_ns); */
+/* 	if (!slurm_cgpath) { */
+/* 		return SLURM_ERROR; */
+/* 	} */
+
+/* 	/\* build user cgroup relative path if not set (should not be) *\/ */
+/* 	if (*user_cgroup_path == '\0') { */
+/* 		if (snprintf(user_cgroup_path, PATH_MAX, */
+/* 			     "%s/uid_%u", slurm_cgpath, uid) >= PATH_MAX) { */
+/* 			error("unable to build uid %u cgroup relative " */
+/* 			      "path : %m", uid); */
+/* 			xfree(slurm_cgpath); */
+/* 			return SLURM_ERROR; */
+/* 		} */
+/* 	} */
+
+/* 	/\* build job cgroup relative path if not set (may not be) *\/ */
+/* 	if (*job_cgroup_path == '\0') { */
+/* 		if (snprintf(job_cgroup_path, PATH_MAX, "%s/job_%u", */
+/* 			     user_cgroup_path, jobid) >= PATH_MAX) { */
+/* 			error("jobacct_gather/cgroup: unable to build job %u " */
+/* 			      "blkio cg relative path : %m", jobid); */
+/* 			return SLURM_ERROR; */
+/* 		} */
+/* 	} */
+
+/* 	/\* build job step cgroup relative path if not set (may not be) *\/ */
+/* 	if (*jobstep_cgroup_path == '\0') { */
+/*		int len; */
+/*		if (stepid == SLURM_BATCH_SCRIPT) { */
+/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
+/*				       "%s/step_batch", job_cgroup_path); */
+/*		} else if (stepid == SLURM_EXTERN_CONT) { */
+/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
+/*				       "%s/step_extern", job_cgroup_path); */
+/*		} else { */
+/*			len = snprintf(jobstep_cgroup_path, PATH_MAX, */
+/*				       "%s/step_%u", */
+/*				       job_cgroup_path, stepid); */
+/*		} */
+/*		if (len >= PATH_MAX) { */
+/* 			error("jobacct_gather/cgroup: unable to build job step " */
+/* 			      "%u.%u blkio cg relative path : %m", */
+/*			      jobid, stepid); */
+/* 			return SLURM_ERROR; */
+/* 		} */
+/* 	} */
+
+/* 	/\* build task cgroup relative path *\/ */
+/* 	if (snprintf(task_cgroup_path, PATH_MAX, "%s/task_%u", */
+/* 		     jobstep_cgroup_path, taskid) >= PATH_MAX) { */
+/* 		error("jobacct_gather/cgroup: unable to build task %u " */
+/* 		      "blkio cg relative path : %m", taskid); */
+/* 		return SLURM_ERROR; */
+/* 	} */
+
+/* 	fstatus = SLURM_SUCCESS; */
+
+/* 	/\* */
+/* 	 * create blkio root cg and lock it */
+/* 	 * */
+/* 	 * we will keep the lock until the end to avoid the effect of a release */
+/* 	 * agent that would remove an existing cgroup hierarchy while we are */
+/* 	 * setting it up. As soon as the step cgroup is created, we can release */
+/* 	 * the lock. */
+/* 	 * Indeed, consecutive slurm steps could result in cg being removed */
+/* 	 * between the next EEXIST instanciation and the first addition of */
+/* 	 * a task. The release_agent will have to lock the root blkio cgroup */
+/* 	 * to avoid this scenario. */
+/* 	 *\/ */
+
+/* 	if (xcgroup_create(&blkio_ns, &blkio_cg, "", 0, 0) */
+/* 	    != XCGROUP_SUCCESS) { */
+/* 		error("jobacct_gather/cgroup: unable to create root blkio " */
+/* 		      "xcgroup"); */
+/* 		return SLURM_ERROR; */
+/* 	} */
+/* 	if (xcgroup_lock(&blkio_cg) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to lock root blkio cg"); */
+/* 		return SLURM_ERROR; */
+/* 	} */
+
+/* 	/\* */
+/* 	 * Create user cgroup in the blkio ns (it could already exist) */
+/* 	 *\/ */
+/* 	if (xcgroup_create(&blkio_ns, &user_blkio_cg, */
+/* 			   user_cgroup_path, */
+/* 			   uid, gid) != XCGROUP_SUCCESS) { */
+/* 		error("jobacct_gather/cgroup: unable to create user %u blkio " */
+/* 		      "cgroup", uid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	if (xcgroup_instantiate(&user_blkio_cg) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to instanciate user %u " */
+/* 		      "blkio cgroup", uid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	/\* */
+/* 	 * Create job cgroup in the blkio ns (it could already exist) */
+/* 	 *\/ */
+/* 	if (xcgroup_create(&blkio_ns, &job_blkio_cg, */
+/* 			   job_cgroup_path, */
+/* 			   uid, gid) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to create job %u blkio " */
+/* 		      "cgroup", jobid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	if (xcgroup_instantiate(&job_blkio_cg) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		xcgroup_destroy(&job_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to instanciate job %u " */
+/* 		      "blkio cgroup", jobid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	/\* */
+/* 	 * Create step cgroup in the blkio ns (it could already exist) */
+/* 	 *\/ */
+/* 	if (xcgroup_create(&blkio_ns, &step_blkio_cg, */
+/* 			   jobstep_cgroup_path, */
+/* 			   uid, gid) != XCGROUP_SUCCESS) { */
+/* 		/\* do not delete user/job cgroup as they can exist for other */
+/* 		 * steps, but release cgroup structures *\/ */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		xcgroup_destroy(&job_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */
+/* 		      "blkio cgroup", jobid, stepid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	if (xcgroup_instantiate(&step_blkio_cg) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		xcgroup_destroy(&job_blkio_cg); */
+/* 		xcgroup_destroy(&step_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to instantiate jobstep " */
+/* 		      "%u.%u blkio cgroup", jobid, stepid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	/\* */
+/* 	 * Create task cgroup in the blkio ns */
+/* 	 *\/ */
+/* 	if (xcgroup_create(&blkio_ns, &task_blkio_cg, */
+/* 			   task_cgroup_path, */
+/* 			   uid, gid) != XCGROUP_SUCCESS) { */
+/* 		/\* do not delete user/job cgroup as they can exist for other */
+/* 		 * steps, but release cgroup structures *\/ */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		xcgroup_destroy(&job_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to create jobstep %u.%u " */
+/* 		      "task %u blkio cgroup", jobid, stepid, taskid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	if (xcgroup_instantiate(&task_blkio_cg) != XCGROUP_SUCCESS) { */
+/* 		xcgroup_destroy(&user_blkio_cg); */
+/* 		xcgroup_destroy(&job_blkio_cg); */
+/* 		xcgroup_destroy(&step_blkio_cg); */
+/* 		error("jobacct_gather/cgroup: unable to instantiate jobstep " */
+/* 		      "%u.%u task %u blkio cgroup", jobid, stepid, taskid); */
+/* 		fstatus = SLURM_ERROR; */
+/* 		goto error; */
+/* 	} */
+
+/* 	/\* */
+/* 	 * Attach the slurmstepd to the task blkio cgroup */
+/* 	 *\/ */
+/* 	rc = xcgroup_add_pids(&task_blkio_cg, &pid, 1); */
+/* 	if (rc != XCGROUP_SUCCESS) { */
+/* 		error("jobacct_gather/cgroup: unable to add slurmstepd to " */
+/* 		      "blkio cg '%s'", task_blkio_cg.path); */
+/* 		fstatus = SLURM_ERROR; */
+/* 	} else */
+/* 		fstatus = SLURM_SUCCESS; */
+
+/* error: */
+/* 	xcgroup_unlock(&blkio_cg); */
+/* 	xcgroup_destroy(&blkio_cg); */
+/* 	return fstatus; */
+/* } */
diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c
index fadf69d73..c43bea7f1 100644
--- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c
+++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_cpuacct.c
@@ -293,7 +293,7 @@ jobacct_gather_cgroup_cpuacct_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&user_cpuacct_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&user_cpuacct_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuacct_cg);
 		error("jobacct_gather/cgroup: unable to instanciate user %u "
 		      "cpuacct cgroup", uid);
@@ -314,7 +314,7 @@ jobacct_gather_cgroup_cpuacct_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&job_cpuacct_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&job_cpuacct_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuacct_cg);
 		xcgroup_destroy(&job_cpuacct_cg);
 		error("jobacct_gather/cgroup: unable to instanciate job %u "
@@ -339,7 +339,7 @@ jobacct_gather_cgroup_cpuacct_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&step_cpuacct_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&step_cpuacct_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuacct_cg);
 		xcgroup_destroy(&job_cpuacct_cg);
 		xcgroup_destroy(&step_cpuacct_cg);
@@ -365,7 +365,7 @@ jobacct_gather_cgroup_cpuacct_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&task_cpuacct_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&task_cpuacct_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuacct_cg);
 		xcgroup_destroy(&job_cpuacct_cg);
 		xcgroup_destroy(&step_cpuacct_cg);
diff --git a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c
index b4b884d44..9de42bab3 100644
--- a/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c
+++ b/src/plugins/jobacct_gather/cgroup/jobacct_gather_cgroup_memory.c
@@ -307,7 +307,7 @@ jobacct_gather_cgroup_memory_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&user_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&user_memory_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_memory_cg);
 		error("jobacct_gather/cgroup: unable to instanciate user %u "
 		      "memory cgroup", uid);
@@ -328,7 +328,7 @@ jobacct_gather_cgroup_memory_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&job_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&job_memory_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_memory_cg);
 		xcgroup_destroy(&job_memory_cg);
 		error("jobacct_gather/cgroup: unable to instanciate job %u "
@@ -353,7 +353,7 @@ jobacct_gather_cgroup_memory_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&step_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&step_memory_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_memory_cg);
 		xcgroup_destroy(&job_memory_cg);
 		xcgroup_destroy(&step_memory_cg);
@@ -379,7 +379,7 @@ jobacct_gather_cgroup_memory_attach_task(pid_t pid, jobacct_id_t *jobacct_id)
 		goto error;
 	}
 
-	if (xcgroup_instanciate(&task_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&task_memory_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_memory_cg);
 		xcgroup_destroy(&job_memory_cg);
 		xcgroup_destroy(&step_memory_cg);
diff --git a/src/plugins/jobacct_gather/common/Makefile.in b/src/plugins/jobacct_gather/common/Makefile.in
index 5ca3452bf..aa2a3e357 100644
--- a/src/plugins/jobacct_gather/common/Makefile.in
+++ b/src/plugins/jobacct_gather/common/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -218,8 +219,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -319,6 +318,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -357,6 +360,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -400,6 +406,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -450,6 +459,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/common/common_jag.c b/src/plugins/jobacct_gather/common/common_jag.c
index da0b12445..76a2287b5 100644
--- a/src/plugins/jobacct_gather/common/common_jag.c
+++ b/src/plugins/jobacct_gather/common/common_jag.c
@@ -146,7 +146,7 @@ static int _get_pss(char *proc_smaps_file, jag_prec_t *prec)
 
         while (fgets(line,sizeof(line),fp)) {
 
-                if (strncmp(line, "Pss:", 4) != 0) {
+                if (xstrncmp(line, "Pss:", 4) != 0) {
                         continue;
                 }
 
diff --git a/src/plugins/jobacct_gather/linux/Makefile.in b/src/plugins/jobacct_gather/linux/Makefile.in
index 0bdc5674f..c8b612503 100644
--- a/src/plugins/jobacct_gather/linux/Makefile.in
+++ b/src/plugins/jobacct_gather/linux/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather/linux
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobacct_gather/none/Makefile.in b/src/plugins/jobacct_gather/none/Makefile.in
index 81941c53e..170a86f23 100644
--- a/src/plugins/jobacct_gather/none/Makefile.in
+++ b/src/plugins/jobacct_gather/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobacct_gather/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/Makefile.in b/src/plugins/jobcomp/Makefile.in
index af2d54ab4..5e912cb80 100644
--- a/src/plugins/jobcomp/Makefile.in
+++ b/src/plugins/jobcomp/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/elasticsearch/Makefile.am b/src/plugins/jobcomp/elasticsearch/Makefile.am
index e20ec18b6..3c28c4eda 100644
--- a/src/plugins/jobcomp/elasticsearch/Makefile.am
+++ b/src/plugins/jobcomp/elasticsearch/Makefile.am
@@ -4,7 +4,7 @@ AUTOMAKE_OPTIONS = foreign
 
 PLUGIN_FLAGS = -module -avoid-version --export-dynamic
 
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(LIBCURL_CPPFLAGS)
 
 AS_ELASTICSEARCH_SOURCES = jobcomp_elasticsearch.c
 
diff --git a/src/plugins/jobcomp/elasticsearch/Makefile.in b/src/plugins/jobcomp/elasticsearch/Makefile.in
index a494bd7f1..963d1a9e1 100644
--- a/src/plugins/jobcomp/elasticsearch/Makefile.in
+++ b/src/plugins/jobcomp/elasticsearch/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp/elasticsearch
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -261,8 +262,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -362,6 +361,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -400,6 +403,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -443,6 +449,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -493,6 +502,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -507,7 +517,7 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 PLUGIN_FLAGS = -module -avoid-version --export-dynamic
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(LIBCURL_CPPFLAGS)
 AS_ELASTICSEARCH_SOURCES = jobcomp_elasticsearch.c
 @WITH_CURL_TRUE@pkglib_LTLIBRARIES = jobcomp_elasticsearch.la
 @WITH_CURL_TRUE@jobcomp_elasticsearch_la_SOURCES = $(AS_ELASTICSEARCH_SOURCES)
diff --git a/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c b/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c
index 8ff42010d..0198f3d76 100644
--- a/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c
+++ b/src/plugins/jobcomp/elasticsearch/jobcomp_elasticsearch.c
@@ -107,11 +107,11 @@ const char plugin_type[] = "jobcomp/elasticsearch";
 const uint32_t plugin_version = SLURM_VERSION_NUMBER;
 
 #define INDEX_RETRY_INTERVAL 30
-#define JOBCOMP_DATA_FORMAT "{\"jobid\":%lu,\"username\":\"%s\","\
-	"\"user_id\":%lu,\"groupname\":\"%s\",\"group_id\":%lu,"\
-	"\"@start\":\"%s\",\"@end\":\"%s\",\"elapsed\":%ld,"\
-	"\"partition\":\"%s\",\"alloc_node\":\"%s\","\
-	"\"nodes\":\"%s\",\"total_cpus\":%lu,\"total_nodes\":%lu,"\
+#define JOBCOMP_DATA_FORMAT "{\"jobid\":%lu,\"username\":\"%s\","	\
+	"\"user_id\":%lu,\"groupname\":\"%s\",\"group_id\":%lu,"	\
+	"\"@start\":\"%s\",\"@end\":\"%s\",\"elapsed\":%ld,"		\
+	"\"partition\":\"%s\",\"alloc_node\":\"%s\","			\
+	"\"nodes\":\"%s\",\"total_cpus\":%lu,\"total_nodes\":%lu,"	\
 	"\"derived_exitcode\":%lu,\"exitcode\":%lu,\"state\":\"%s\""
 
 /* These are defined here so when we link with something other than
@@ -306,7 +306,7 @@ static int _load_pending_jobs(void)
 
 	return rc;
 
-      unpack_error:
+unpack_error:
 	error("%s: Error unpacking file %s", plugin_type, state_file);
 	free_buf(buffer);
 	xfree(state_file);
@@ -762,7 +762,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr)
 
 	if (job_ptr->qos_ptr != NULL) {
 		slurmdb_qos_rec_t *assoc =
-		    (slurmdb_qos_rec_t *) job_ptr->qos_ptr;
+			(slurmdb_qos_rec_t *) job_ptr->qos_ptr;
 		qos = assoc->name;
 		xstrfmtcat(buffer, ",\"qos\":\"%s\"", qos);
 	}
@@ -772,12 +772,14 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr)
 			   job_ptr->details->num_tasks);
 	}
 
-	if (job_ptr->details && (job_ptr->details->ntasks_per_node != NO_VAL)) {
+	if (job_ptr->details
+	    && (job_ptr->details->ntasks_per_node != (uint16_t) NO_VAL)) {
 		ntasks_per_node = job_ptr->details->ntasks_per_node;
 		xstrfmtcat(buffer, ",\"ntasks_per_node\":%hu", ntasks_per_node);
 	}
 
-	if (job_ptr->details && (job_ptr->details->cpus_per_task != NO_VAL)) {
+	if (job_ptr->details
+	    && (job_ptr->details->cpus_per_task != (uint16_t) NO_VAL)) {
 		xstrfmtcat(buffer, ",\"cpus_per_task\":%hu",
 			   job_ptr->details->cpus_per_task);
 	}
@@ -798,7 +800,7 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr)
 
 	if (time_limit != INFINITE) {
 		xstrfmtcat(buffer, ",\"time_limit\":%lu",
-			(unsigned long) time_limit * 60);
+			   (unsigned long) time_limit * 60);
 	}
 
 	if (job_ptr->resv_name && job_ptr->resv_name[0]) {
@@ -810,7 +812,6 @@ extern int slurm_jobcomp_log_record(struct job_record *job_ptr)
 		xstrfmtcat(buffer, ",\"gres_req\":\"%s\"", job_ptr->gres_req);
 	}
 
-
 	if (job_ptr->gres_alloc && job_ptr->gres_alloc[0]) {
 		xstrfmtcat(buffer, ",\"gres_alloc\":\"%s\"",
 			   job_ptr->gres_alloc);
diff --git a/src/plugins/jobcomp/filetxt/Makefile.in b/src/plugins/jobcomp/filetxt/Makefile.in
index fe0d410e1..ee3041a93 100644
--- a/src/plugins/jobcomp/filetxt/Makefile.in
+++ b/src/plugins/jobcomp/filetxt/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp/filetxt
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c
index 05dee5b9c..6038ce6b8 100644
--- a/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c
+++ b/src/plugins/jobcomp/filetxt/filetxt_jobcomp_process.c
@@ -98,17 +98,17 @@ static jobcomp_job_rec_t *_parse_line(List job_info_list)
 
 	itr = list_iterator_create(job_info_list);
 	while((jobcomp_info = list_next(itr))) {
-		if (!strcasecmp("JobID", jobcomp_info->name)) {
+		if (!xstrcasecmp("JobID", jobcomp_info->name)) {
 			job->jobid = atoi(jobcomp_info->val);
-		} else if (!strcasecmp("Partition", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Partition", jobcomp_info->name)) {
 			job->partition = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("StartTime", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("StartTime", jobcomp_info->name)) {
 			job->start_time = xstrdup(jobcomp_info->val);
 			start_time = parse_time(job->start_time, 1);
-		} else if (!strcasecmp("EndTime", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("EndTime", jobcomp_info->name)) {
 			job->end_time = xstrdup(jobcomp_info->val);
 			end_time = parse_time(job->end_time, 1);
-		} else if (!strcasecmp("Userid", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Userid", jobcomp_info->name)) {
 			temp = strstr(jobcomp_info->val, "(");
 			if (!temp) {
 				job->uid = atoi(jobcomp_info->val);
@@ -118,7 +118,7 @@ static jobcomp_job_rec_t *_parse_line(List job_info_list)
 				job->uid = atoi(temp + 1);
 				job->uid_name = xstrdup(jobcomp_info->val);
 			}
-		} else if (!strcasecmp("GroupId", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("GroupId", jobcomp_info->name)) {
 			temp = strstr(jobcomp_info->val, "(");
 			if (!temp) {
 				job->gid = atoi(jobcomp_info->val);
@@ -128,35 +128,35 @@ static jobcomp_job_rec_t *_parse_line(List job_info_list)
 				job->gid = atoi(temp + 1);
 				job->gid_name = xstrdup(jobcomp_info->val);
 			}
-		} else if (!strcasecmp("Name", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Name", jobcomp_info->name)) {
 			job->jobname = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("NodeList", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("NodeList", jobcomp_info->name)) {
 			job->nodelist = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("NodeCnt", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("NodeCnt", jobcomp_info->name)) {
 			job->node_cnt = atoi(jobcomp_info->val);
-		} else if (!strcasecmp("ProcCnt", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("ProcCnt", jobcomp_info->name)) {
 			job->proc_cnt = atoi(jobcomp_info->val);
-		} else if (!strcasecmp("JobState", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("JobState", jobcomp_info->name)) {
 			job->state = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("Timelimit", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Timelimit", jobcomp_info->name)) {
 			job->timelimit = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("Workdir", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Workdir", jobcomp_info->name)) {
 			job->work_dir = xstrdup(jobcomp_info->val);
 		}
 #ifdef HAVE_BG
-		else if (!strcasecmp("MaxProcs", jobcomp_info->name)) {
+		else if (!xstrcasecmp("MaxProcs", jobcomp_info->name)) {
 			job->max_procs = atoi(jobcomp_info->val);
-		} else if (!strcasecmp("Block_Id", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Block_Id", jobcomp_info->name)) {
 			job->blockid = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("Connection", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("Connection", jobcomp_info->name)) {
 			job->connection = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("reboot", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("reboot", jobcomp_info->name)) {
 			job->reboot = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("rotate", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("rotate", jobcomp_info->name)) {
 			job->rotate = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("geometry", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("geometry", jobcomp_info->name)) {
 			job->geo = xstrdup(jobcomp_info->val);
-		} else if (!strcasecmp("start", jobcomp_info->name)) {
+		} else if (!xstrcasecmp("start", jobcomp_info->name)) {
 			job->bg_start_point = xstrdup(jobcomp_info->val);
 		}
 #endif
@@ -209,10 +209,9 @@ extern List filetxt_jobcomp_process_get_jobs(slurmdb_job_cond_t *job_cond)
 			*fptr++ = 0;
 			jobcomp_info->val = fptr;
 			fptr = strstr(fptr, " ");
-			if (!strcasecmp("JobId", jobcomp_info->name))
+			if (!xstrcasecmp("JobId", jobcomp_info->name))
 				jobid = atoi(jobcomp_info->val);
-			else if (!strcasecmp("Partition",
-					    jobcomp_info->name))
+			else if (!xstrcasecmp("Partition", jobcomp_info->name))
 				partition = jobcomp_info->val;
 
 
@@ -252,7 +251,7 @@ extern List filetxt_jobcomp_process_get_jobs(slurmdb_job_cond_t *job_cond)
 				continue;
 			itr = list_iterator_create(job_cond->partition_list);
 			while((selected_part = list_next(itr)))
-				if (!strcasecmp(selected_part, partition)) {
+				if (!xstrcasecmp(selected_part, partition)) {
 					list_iterator_destroy(itr);
 					goto foundp;
 				}
diff --git a/src/plugins/jobcomp/mysql/Makefile.in b/src/plugins/jobcomp/mysql/Makefile.in
index e288c2043..e8de0e245 100644
--- a/src/plugins/jobcomp/mysql/Makefile.in
+++ b/src/plugins/jobcomp/mysql/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp/mysql
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -260,8 +261,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -361,6 +360,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -399,6 +402,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -442,6 +448,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -492,6 +501,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/mysql/jobcomp_mysql.c b/src/plugins/jobcomp/mysql/jobcomp_mysql.c
index 17a55f83d..7f040d9cc 100644
--- a/src/plugins/jobcomp/mysql/jobcomp_mysql.c
+++ b/src/plugins/jobcomp/mysql/jobcomp_mysql.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  jobcomp_mysql.c - Store/Get all information in a mysql storage.
- *
- *  $Id: storage_mysql.c 10893 2007-01-29 21:53:48Z da $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/plugins/jobcomp/none/Makefile.in b/src/plugins/jobcomp/none/Makefile.in
index 96e5ca78e..761f36a4b 100644
--- a/src/plugins/jobcomp/none/Makefile.in
+++ b/src/plugins/jobcomp/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/script/Makefile.in b/src/plugins/jobcomp/script/Makefile.in
index a2acb9d26..7c8bafac6 100644
--- a/src/plugins/jobcomp/script/Makefile.in
+++ b/src/plugins/jobcomp/script/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/jobcomp/script
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/jobcomp/script/jobcomp_script.c b/src/plugins/jobcomp/script/jobcomp_script.c
index 0687ed271..7af271623 100644
--- a/src/plugins/jobcomp/script/jobcomp_script.c
+++ b/src/plugins/jobcomp/script/jobcomp_script.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  jobcomp_script.c - Script running slurm job completion logging plugin.
- *  $Id$
  *****************************************************************************
  *  Produced at Center for High Performance Computing, North Dakota State
  *  University
@@ -523,7 +522,7 @@ static void * _script_agent (void *args)
 	while (1) {
 		struct jobcomp_info *job;
 
-		pthread_mutex_lock(&comp_list_mutex);
+		slurm_mutex_lock(&comp_list_mutex);
 
 		if (list_is_empty(comp_list) && !agent_exit)
 			pthread_cond_wait(&comp_list_cond, &comp_list_mutex);
@@ -532,7 +531,7 @@ static void * _script_agent (void *args)
 		 * It is safe to unlock list mutex here. List has its
 		 *  own internal mutex that protects the comp_list itself
 		 */
-		pthread_mutex_unlock(&comp_list_mutex);
+		slurm_mutex_unlock(&comp_list_mutex);
 
 		if ((job = list_pop(comp_list))) {
 			_jobcomp_exec_child (script, job);
@@ -559,18 +558,18 @@ extern int init (void)
 
 	verbose("jobcomp/script plugin loaded init");
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 
 	if (comp_list)
 		error("Creating duplicate comp_list, possible memory leak");
 	if (!(comp_list = list_create((ListDelF) _jobcomp_info_destroy))) {
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
 	if (script_thread) {
 		debug2( "Script thread already running, not starting another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -578,7 +577,7 @@ extern int init (void)
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 	pthread_create(&script_thread, &attr, _script_agent, NULL);
 
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 	slurm_attr_destroy(&attr);
 
 	return SLURM_SUCCESS;
@@ -610,10 +609,10 @@ int slurm_jobcomp_log_record (struct job_record *record)
 	if (!(job = _jobcomp_info_create (record)))
 		return error ("jobcomp/script: Failed to create job info!");
 
-	pthread_mutex_lock(&comp_list_mutex);
+	slurm_mutex_lock(&comp_list_mutex);
 	list_append(comp_list, job);
 	pthread_cond_broadcast(&comp_list_cond);
-	pthread_mutex_unlock(&comp_list_mutex);
+	slurm_mutex_unlock(&comp_list_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -650,20 +649,20 @@ extern int fini ( void )
 {
 	int rc = SLURM_SUCCESS;
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (script_thread) {
 		verbose("Script Job Completion plugin shutting down");
 		agent_exit = 1;
 		rc = _wait_for_thread(script_thread);
 		script_thread = 0;
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	xfree(script);
 	if (rc == SLURM_SUCCESS) {
-		pthread_mutex_lock(&comp_list_mutex);
+		slurm_mutex_lock(&comp_list_mutex);
 		FREE_NULL_LIST(comp_list);
-		pthread_mutex_unlock(&comp_list_mutex);
+		slurm_mutex_unlock(&comp_list_mutex);
 	}
 
 	return rc;
diff --git a/src/plugins/launch/Makefile.in b/src/plugins/launch/Makefile.in
index 121cb5545..bade83118 100644
--- a/src/plugins/launch/Makefile.in
+++ b/src/plugins/launch/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 @HAVE_ALPS_CRAY_TRUE@@REAL_BGQ_LOADED_FALSE@am__append_2 = aprun
 subdir = src/plugins/launch
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -230,8 +231,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -331,6 +330,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -369,6 +372,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -412,6 +418,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -462,6 +471,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/launch/aprun/Makefile.in b/src/plugins/launch/aprun/Makefile.in
index c56dda6ae..32217157d 100644
--- a/src/plugins/launch/aprun/Makefile.in
+++ b/src/plugins/launch/aprun/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/launch/aprun
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/launch/aprun/launch_aprun.c b/src/plugins/launch/aprun/launch_aprun.c
index 4187961cc..cb9a9b2ce 100644
--- a/src/plugins/launch/aprun/launch_aprun.c
+++ b/src/plugins/launch/aprun/launch_aprun.c
@@ -334,29 +334,24 @@ static void _handle_msg(slurm_msg_t *msg)
 	case SRUN_PING:
 		debug3("slurmctld ping received");
 		slurm_send_rc_msg(msg, SLURM_SUCCESS);
-		slurm_free_srun_ping_msg(msg->data);
 		break;
 	case SRUN_JOB_COMPLETE:
 		debug("received job step complete message");
 		_handle_step_complete(msg->data);
-		slurm_free_srun_job_complete_msg(msg->data);
 		break;
 	case SRUN_USER_MSG:
 		um = msg->data;
 		info("%s", um->msg);
-		slurm_free_srun_user_msg(msg->data);
 		break;
 	case SRUN_TIMEOUT:
 		debug2("received job step timeout message");
 		_handle_timeout(msg->data);
-		slurm_free_srun_timeout_msg(msg->data);
 		break;
 	case SRUN_STEP_SIGNAL:
 		ss = msg->data;
 		debug("received step signal %u RPC", ss->signal);
 		if (ss->signal)
 			launch_p_fwd_signal(ss->signal);
-		slurm_free_job_step_kill_msg(msg->data);
 		break;
 	default:
 		debug("received spurious message type: %u",
diff --git a/src/plugins/launch/poe/Makefile.in b/src/plugins/launch/poe/Makefile.in
index 93d112b2f..b241c8c26 100644
--- a/src/plugins/launch/poe/Makefile.in
+++ b/src/plugins/launch/poe/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/launch/poe
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/launch/poe/launch_poe.c b/src/plugins/launch/poe/launch_poe.c
index 31fe13216..43afd328e 100644
--- a/src/plugins/launch/poe/launch_poe.c
+++ b/src/plugins/launch/poe/launch_poe.c
@@ -483,13 +483,13 @@ extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus,
 			/* device type options */
 			} else if (!strncasecmp(token, "devtype=", 8)) {
 				type_ptr = token + 8;
-				if (!strcasecmp(type_ptr, "ib")) {
+				if (!xstrcasecmp(type_ptr, "ib")) {
 					setenv("MP_DEVTYPE", type_ptr, 1);
 					if (opt.launch_cmd)
 						xstrfmtcat(poe_cmd_line,
 							   " -devtype %s",
 							   type_ptr);
-				} else if (!strcasecmp(type_ptr, "hfi")) {
+				} else if (!xstrcasecmp(type_ptr, "hfi")) {
 					setenv("MP_DEVTYPE", type_ptr, 1);
 					if (opt.launch_cmd)
 						xstrfmtcat(poe_cmd_line,
@@ -510,14 +510,14 @@ extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus,
 				}
 
 			/* network options */
-			} else if (!strcasecmp(token, "ip")   ||
-				  !strcasecmp(token, "ipv4")  ||
-				  !strcasecmp(token, "ipv6")) {
+			} else if (!xstrcasecmp(token, "ip")   ||
+				  !xstrcasecmp(token, "ipv4")  ||
+				  !xstrcasecmp(token, "ipv6")) {
 				setenv("MP_EUILIB", "ip", 1);
 				if (opt.launch_cmd)
 					xstrfmtcat(poe_cmd_line,
 						   " -euilib ip");
-			} else if (!strcasecmp(token, "us")) {
+			} else if (!xstrcasecmp(token, "us")) {
 				setenv("MP_EUILIB", "us", 1);
 				if (opt.launch_cmd)
 					xstrfmtcat(poe_cmd_line,
@@ -537,12 +537,12 @@ extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus,
 				xstrcat(protocol, token);
 				setenv("MP_MSG_API", protocol, 0);
 			/* adapter options */
-			} else if (!strcasecmp(token, "sn_all")) {
+			} else if (!xstrcasecmp(token, "sn_all")) {
 				setenv("MP_EUIDEVICE", "sn_all", 1);
 				if (opt.launch_cmd)
 					xstrfmtcat(poe_cmd_line,
 						   " -euidevice sn_all");
-			} else if (!strcasecmp(token, "sn_single")) {
+			} else if (!xstrcasecmp(token, "sn_single")) {
 				setenv("MP_EUIDEVICE", "sn_single", 1);
 				if (opt.launch_cmd)
 					xstrfmtcat(poe_cmd_line,
@@ -589,7 +589,7 @@ extern int launch_p_create_job_step(srun_job_t *job, bool use_all_cpus,
 		else
 			setenv("MP_MSG_API", protocol, 0);
 	} else {
-		if (strcmp(protocol, "multi")) {
+		if (xstrcmp(protocol, "multi")) {
 			setenv("MP_MSG_API", protocol, 0);
 			if (opt.launch_cmd)
 				xstrfmtcat(poe_cmd_line,
@@ -761,7 +761,7 @@ static void _build_user_env(void)
 	tmp_env = xstrdup(opt.export_env);
 	tok = strtok_r(tmp_env, ",", &save_ptr);
 	while (tok) {
-		if (!strcasecmp(tok, "NONE"))
+		if (!xstrcasecmp(tok, "NONE"))
 			break;
 		eq_ptr = strchr(tok, '=');
 		if (eq_ptr) {
diff --git a/src/plugins/launch/runjob/Makefile.in b/src/plugins/launch/runjob/Makefile.in
index 6b58b3b53..9758469a8 100644
--- a/src/plugins/launch/runjob/Makefile.in
+++ b/src/plugins/launch/runjob/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 @BGQ_LOADED_TRUE@am__append_1 = runjob_interface.cc
 subdir = src/plugins/launch/runjob
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -271,8 +272,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -372,6 +371,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -410,6 +413,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -453,6 +459,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -503,6 +512,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/launch/runjob/launch_runjob.c b/src/plugins/launch/runjob/launch_runjob.c
index d7a4a59da..6778c25f6 100644
--- a/src/plugins/launch/runjob/launch_runjob.c
+++ b/src/plugins/launch/runjob/launch_runjob.c
@@ -153,29 +153,24 @@ _handle_msg(slurm_msg_t *msg)
 	case SRUN_PING:
 		debug3("slurmctld ping received");
 		slurm_send_rc_msg(msg, SLURM_SUCCESS);
-		slurm_free_srun_ping_msg(msg->data);
 		break;
 	case SRUN_JOB_COMPLETE:
 		debug("received job step complete message");
 		runjob_signal(SIGKILL);
-		slurm_free_srun_job_complete_msg(msg->data);
 		break;
 	case SRUN_USER_MSG:
 		um = msg->data;
 		info("%s", um->msg);
-		slurm_free_srun_user_msg(msg->data);
 		break;
 	case SRUN_TIMEOUT:
 		debug("received job step timeout message");
 		_handle_timeout(msg->data);
-		slurm_free_srun_timeout_msg(msg->data);
 		break;
 	case SRUN_STEP_SIGNAL:
 		ss = msg->data;
 		debug("received step signal %u RPC", ss->signal);
 		if (ss->signal)
 			runjob_signal(ss->signal);
-		slurm_free_job_step_kill_msg(msg->data);
 		break;
 	default:
 		debug("received spurious message type: %u",
@@ -391,7 +386,7 @@ extern int launch_p_setup_srun_opt(char **rest)
 			tmp_env = xstrdup(opt.export_env);
 			tok = strtok_r(tmp_env, ",", &save_ptr);
 			while (tok) {
-				if (!strcasecmp(tok, "NONE"))
+				if (!xstrcasecmp(tok, "NONE"))
 					break;
 				eq_ptr = strchr(tok, '=');
 				if (eq_ptr)
diff --git a/src/plugins/launch/slurm/Makefile.in b/src/plugins/launch/slurm/Makefile.in
index 0ee547a10..7f0a36925 100644
--- a/src/plugins/launch/slurm/Makefile.in
+++ b/src/plugins/launch/slurm/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/launch/slurm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/launch/slurm/launch_slurm.c b/src/plugins/launch/slurm/launch_slurm.c
index dc5731be5..5628393c9 100644
--- a/src/plugins/launch/slurm/launch_slurm.c
+++ b/src/plugins/launch/slurm/launch_slurm.c
@@ -487,10 +487,10 @@ static char **_build_user_env(void)
 	tok = strtok_r(tmp_env, ",", &save_ptr);
 	while (tok) {
 
-		if (strcasecmp(tok, "ALL") == 0)
+		if (xstrcasecmp(tok, "ALL") == 0)
 			all = true;
 
-		if (!strcasecmp(tok, "NONE"))
+		if (!xstrcasecmp(tok, "NONE"))
 			break;
 		eq_ptr = strchr(tok, '=');
 		if (eq_ptr) {
@@ -574,6 +574,9 @@ extern int launch_p_step_launch(
 	launch_params.spank_job_env     = opt.spank_job_env;
 	launch_params.spank_job_env_size = opt.spank_job_env_size;
 	launch_params.user_managed_io   = opt.user_managed_io;
+	launch_params.ntasks_per_board  = job->ntasks_per_board;
+	launch_params.ntasks_per_core   = job->ntasks_per_core;
+	launch_params.ntasks_per_socket = job->ntasks_per_socket;
 
 	if (opt.export_env)
 		launch_params.env = _build_user_env();
diff --git a/src/plugins/launch/slurm/task_state.c b/src/plugins/launch/slurm/task_state.c
index 00b463a41..6a3413ba9 100644
--- a/src/plugins/launch/slurm/task_state.c
+++ b/src/plugins/launch/slurm/task_state.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/srun/task_state.c - task state container
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/launch/slurm/task_state.h b/src/plugins/launch/slurm/task_state.h
index 5256d7bfa..735b5525e 100644
--- a/src/plugins/launch/slurm/task_state.h
+++ b/src/plugins/launch/slurm/task_state.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/srun/task_state.h - task state container for srun
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mcs/Makefile.am b/src/plugins/mcs/Makefile.am
new file mode 100644
index 000000000..235cf903e
--- /dev/null
+++ b/src/plugins/mcs/Makefile.am
@@ -0,0 +1,3 @@
+# Makefile for job_container plugins
+
+SUBDIRS = group none user
diff --git a/src/plugins/mcs/Makefile.in b/src/plugins/mcs/Makefile.in
new file mode 100644
index 000000000..d60a581b0
--- /dev/null
+++ b/src/plugins/mcs/Makefile.in
@@ -0,0 +1,800 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for job_container plugins
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/mcs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = group none user
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/mcs/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/plugins/mcs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/mcs/group/Makefile.am b/src/plugins/mcs/group/Makefile.am
new file mode 100644
index 000000000..d2b671991
--- /dev/null
+++ b/src/plugins/mcs/group/Makefile.am
@@ -0,0 +1,13 @@
+# Makefile for mcs/group plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+
+pkglib_LTLIBRARIES = mcs_group.la
+
+# mcs/group plugin.
+mcs_group_la_SOURCES = mcs_group.c
+mcs_group_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
diff --git a/src/plugins/mcs/group/Makefile.in b/src/plugins/mcs/group/Makefile.in
new file mode 100644
index 000000000..d75c28349
--- /dev/null
+++ b/src/plugins/mcs/group/Makefile.in
@@ -0,0 +1,832 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for mcs/group plugin
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/mcs/group
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+mcs_group_la_LIBADD =
+am_mcs_group_la_OBJECTS = mcs_group.lo
+mcs_group_la_OBJECTS = $(am_mcs_group_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+mcs_group_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(mcs_group_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(mcs_group_la_SOURCES)
+DIST_SOURCES = $(mcs_group_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/auxdir/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+pkglib_LTLIBRARIES = mcs_group.la
+
+# mcs/group plugin.
+mcs_group_la_SOURCES = mcs_group.c
+mcs_group_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/mcs/group/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/plugins/mcs/group/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+mcs_group.la: $(mcs_group_la_OBJECTS) $(mcs_group_la_DEPENDENCIES) $(EXTRA_mcs_group_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(mcs_group_la_LINK) -rpath $(pkglibdir) $(mcs_group_la_OBJECTS) $(mcs_group_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcs_group.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+.PRECIOUS: Makefile
+
+
+# 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/mcs/group/mcs_group.c b/src/plugins/mcs/group/mcs_group.c
new file mode 100644
index 000000000..442ec73ac
--- /dev/null
+++ b/src/plugins/mcs/group/mcs_group.c
@@ -0,0 +1,380 @@
+/*****************************************************************************\
+ *  mcs_group.c - Define mcs management functions for groups
+ *****************************************************************************
+ *  Copyright (C) 2015 CEA/DAM/DIF
+ *  Written by Aline Roy <aline.roy@cea.fr>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <grp.h>
+#include <string.h>
+
+#include "slurm/slurm_errno.h"
+#include "src/common/slurm_mcs.h"
+#include "src/common/uid.h"
+#include "src/common/xstring.h"
+
+#define MAX_GROUPS 128
+
+/*
+ * These variables are required by the generic plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *      <application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "task" for task control) and <method> is a description
+ * of how this plugin satisfies that application.  SLURM will only load
+ * a task plugin if the plugin_type string has a prefix of "task/".
+ *
+ * plugin_version - an unsigned 32-bit integer containing the Slurm version
+ * (major.minor.micro combined into a single number).
+ */
+const char plugin_name[]	= "mcs group plugin";
+const char plugin_type[]	= "mcs/group";
+const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
+
+/*********************** local variables *********************/
+
+static uint32_t *array_mcs_parameter = NULL;
+static uint32_t nb_mcs_groups = 0;
+static char *mcs_params_specific = NULL;
+
+static int _get_user_groups(uint32_t user_id, uint32_t group_id,
+			    gid_t *groups, int max_groups, int *ngroups);
+static int _check_and_load_params();
+static int _find_mcs_label(gid_t *groups, int ngroups, char **result);
+static int _check_mcs_label (struct job_record *job_ptr, char *label);
+
+/*
+ * init() is called when the plugin is loaded, before any other functions
+ *	are called.  Put global initialization here.
+ */
+extern int init(void)
+{
+	debug("%s loaded", plugin_name);
+	mcs_params_specific = slurm_mcs_get_params_specific();
+	if (_check_and_load_params() != 0) {
+		info("mcs: plugin warning : no group in %s", mcs_params_specific);
+		xfree(mcs_params_specific);
+		/* no need to check others options : default values used */
+		return SLURM_SUCCESS;
+	}
+	xfree(mcs_params_specific);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * fini() is called when the plugin is removed. Clear any allocated
+ *	storage here.
+ */
+extern int fini(void)
+{
+	xfree(array_mcs_parameter);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * Get a list of groups associated with a specific user_id
+ * Return 0 on success, -1 on failure
+ */
+static int _get_user_groups(uint32_t user_id, uint32_t group_id,
+			    gid_t *groups, int max_groups, int *ngroups)
+{
+	int rc = SLURM_ERROR;
+	char *user_name;
+
+	user_name = uid_to_string((uid_t) user_id);
+	*ngroups = max_groups;
+	rc = getgrouplist(user_name, (gid_t) group_id, groups, ngroups);
+	if (rc < 0) {
+		error("getgrouplist(%s): %m", user_name);
+		rc = SLURM_ERROR;
+	} else {
+		*ngroups = rc;
+		rc = SLURM_SUCCESS;
+	}
+	xfree(user_name);
+	return rc;
+}
+
+/*
+ * Check params format
+ */
+static int _check_and_load_params(void)
+{
+	int i, n;
+	int nb_valid_group = 0;
+	char *tmp_params = NULL, *name_ptr = NULL, *groups_names = NULL;
+	char *name_ptr2 = NULL;
+	gid_t gid;
+
+	if (mcs_params_specific == NULL) {
+		nb_mcs_groups = 0;
+		info("mcs: no group");
+		array_mcs_parameter = xmalloc(nb_mcs_groups * sizeof(uint32_t));
+		slurm_mcs_reset_params();
+		return SLURM_ERROR;
+	}
+	n = strlen(mcs_params_specific);
+	for (i = 0 ; i < n ; i++) {
+		if (mcs_params_specific[i] == '|')
+			nb_mcs_groups = nb_mcs_groups + 1;
+	}
+	if (nb_mcs_groups == 0) {
+		/* no | in param : just one group */
+		if (mcs_params_specific != NULL) {
+			if ( gid_from_string(mcs_params_specific, &gid ) != 0 ) {
+				info("mcs: Only one invalid group : %s. "
+				"ondemand, ondemandselect set", groups_names);
+				nb_mcs_groups = 0;
+				array_mcs_parameter = xmalloc(nb_mcs_groups *
+							      sizeof(uint32_t));
+				slurm_mcs_reset_params();
+				return SLURM_ERROR;
+			} else {
+				nb_mcs_groups = 1;
+				array_mcs_parameter = xmalloc(nb_mcs_groups *
+							      sizeof(uint32_t));
+				array_mcs_parameter[0] = gid;
+				return SLURM_SUCCESS;
+			}
+		} else {
+			/* no group */
+			info("mcs: no group in MCSParameters : %s. "
+			     "ondemand, ondemandselect set",
+			     mcs_params_specific);
+			nb_mcs_groups = 0;
+			array_mcs_parameter = xmalloc(nb_mcs_groups *
+						      sizeof(uint32_t));
+			slurm_mcs_reset_params();
+			return SLURM_ERROR;
+		}
+		return SLURM_SUCCESS;
+	}
+	nb_mcs_groups = nb_mcs_groups + 1;
+	array_mcs_parameter = xmalloc(nb_mcs_groups * sizeof(uint32_t));
+	tmp_params = xstrdup(mcs_params_specific);
+	groups_names = strtok_r(tmp_params, "|", &name_ptr);
+	i = 0;
+	while (groups_names) {
+		if (i == (nb_mcs_groups - 1)) {
+			/* last group, test : */
+			if (strstr(groups_names, ":")) {
+				groups_names = strtok_r(groups_names, ":",
+							&name_ptr2);
+			}
+		}
+		if ( gid_from_string( groups_names, &gid ) != 0 ) {
+			info("mcs: Invalid group : %s", groups_names);
+			array_mcs_parameter[i] = -1;
+		} else {
+			array_mcs_parameter[i] = gid;
+			nb_valid_group = nb_valid_group + 1;
+		}
+		i = i + 1;
+		groups_names = strtok_r(NULL, "|", &name_ptr);
+	}
+	/* if no valid group : deselect all params */
+	if (nb_valid_group == 0) {
+		slurm_mcs_reset_params();
+		info ("mcs: No valid groups : ondemand, ondemandselect set");
+		xfree(tmp_params);
+		return SLURM_ERROR;
+	}
+	xfree(tmp_params);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * _find_mcs_label() is called to check mcs_label in the parameter's list.
+ */
+static int _find_mcs_label(gid_t *groups, int ngroups, char **result)
+{
+	int rc = SLURM_SUCCESS;
+	int i = 0;
+	int j = 0;
+	uint32_t tmp_group ;
+	struct group *gr;
+
+	if (ngroups == 0)
+		rc = SLURM_ERROR;
+	else {
+		for( i = 0 ; i < nb_mcs_groups ; i++) {
+			for ( j = 0 ; j < ngroups ; j++) {
+				tmp_group = (uint32_t) groups[j];
+				if (array_mcs_parameter[i] == tmp_group ) {
+					gr = getgrgid(groups[j]);
+					*result = gr->gr_name;
+					return rc;
+				}
+			}
+		}
+		rc = SLURM_ERROR;
+	}
+	return rc;
+}
+
+/*
+ * _check_mcs_label() is called to check a mcs_label of a job
+ */
+static int _check_mcs_label (struct job_record *job_ptr, char *label)
+{
+	int rc = SLURM_ERROR;
+	int i = 0;
+	gid_t gid;
+	uint32_t tmp_group ;
+	gid_t groups[MAX_GROUPS];
+	int ngroups = -1;
+
+	/* test if real unix group */
+	if ( gid_from_string(label, &gid ) != 0 )
+		return rc;
+
+	/* test if this group is owned by the user */
+	rc = _get_user_groups(job_ptr->user_id, job_ptr->group_id,
+			      groups, MAX_GROUPS, &ngroups);
+	if (rc)	 /* Failed to get groups */
+		return rc;
+	rc = SLURM_ERROR;
+	for (i = 0; i < ngroups; i++) {
+		tmp_group = (uint32_t) groups[i];
+		if (gid == tmp_group) {
+			rc = SLURM_SUCCESS;
+			break;
+		}
+	}
+	if (rc == SLURM_ERROR)
+		return rc;
+	rc = SLURM_ERROR;
+	/* test if mcs_label is in list of possible mcs_label */
+	for( i = 0 ; i < nb_mcs_groups ; i++) {
+		if (array_mcs_parameter[i] == gid ) {
+			rc = SLURM_SUCCESS;
+			return rc;
+		}
+	}
+	return rc;
+}
+
+
+/*
+ * mcs_p_set_mcs_label() is called to obtain/check mcs_label.
+ * Return job_ptr->mcs_label value must be xfreed
+ */
+extern int mcs_p_set_mcs_label (struct job_record *job_ptr, char *label)
+{
+	char *result = NULL;
+	gid_t groups[MAX_GROUPS];
+	int ngroups = -1;
+	int rc;
+
+	if (label == NULL) {
+		if ((slurm_mcs_get_enforced() == 0) &&
+		   job_ptr->details && (job_ptr->details->whole_node != 3))
+			return SLURM_SUCCESS;
+		rc = _get_user_groups(job_ptr->user_id,job_ptr->group_id,
+			groups, MAX_GROUPS, &ngroups);
+		if (rc) {	/* Failed to get groups */
+			if (slurm_mcs_get_enforced() == 0)
+				return SLURM_SUCCESS;
+			else
+				return SLURM_ERROR;
+		}
+		rc = _find_mcs_label(groups, ngroups, &result);
+		if (rc) {
+			return SLURM_ERROR;
+		} else {
+			xfree(job_ptr->mcs_label);
+			job_ptr->mcs_label = xstrdup(result);
+			return SLURM_SUCCESS;
+		}
+	} else {
+		if (_check_mcs_label(job_ptr, label) == 0 )
+			return SLURM_SUCCESS;
+		else
+			return SLURM_ERROR;
+	}
+}
+
+/*
+ * mcs_p_check_mcs_label() is called to check mcs_label.
+ */
+extern int mcs_p_check_mcs_label (uint32_t user_id, char *mcs_label)
+{
+	int rc = SLURM_ERROR;
+	int i = 0;
+	gid_t gid;
+	gid_t slurm_user_gid;
+	uint32_t tmp_group ;
+	gid_t groups[MAX_GROUPS];
+	uint32_t group_id;
+	int ngroups = -1;
+
+	if (mcs_label != NULL) {
+		/* test if real unix group */
+		if ( gid_from_string(mcs_label, &gid ) != 0 ) {
+			return rc;
+		}
+		/* test if this group is owned by the user */
+		slurm_user_gid = gid_from_uid(user_id);
+		group_id = (uint32_t) slurm_user_gid;
+		rc = _get_user_groups(user_id, group_id, groups, MAX_GROUPS,
+				      &ngroups);
+		if (rc)	/* Failed to get groups */
+			return rc;
+		rc = SLURM_ERROR;
+		for (i = 0; i < ngroups; i++) {
+			tmp_group = (uint32_t) groups[i];
+			if (gid == tmp_group) {
+				rc = SLURM_SUCCESS;
+				break;
+			}
+		}
+	} else {
+		rc = SLURM_SUCCESS;
+	}
+	return rc;
+}
diff --git a/src/plugins/mcs/none/Makefile.am b/src/plugins/mcs/none/Makefile.am
new file mode 100644
index 000000000..35d419961
--- /dev/null
+++ b/src/plugins/mcs/none/Makefile.am
@@ -0,0 +1,13 @@
+# Makefile for mcs/none plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+
+pkglib_LTLIBRARIES = mcs_none.la
+
+# mcs/none plugin.
+mcs_none_la_SOURCES = mcs_none.c
+mcs_none_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
diff --git a/src/plugins/auth/authd/Makefile.in b/src/plugins/mcs/none/Makefile.in
similarity index 94%
rename from src/plugins/auth/authd/Makefile.in
rename to src/plugins/mcs/none/Makefile.in
index 42a3420f5..2603d1ed4 100644
--- a/src/plugins/auth/authd/Makefile.in
+++ b/src/plugins/mcs/none/Makefile.in
@@ -14,7 +14,7 @@
 
 @SET_MAKE@
 
-# Makefile for auth/authd plugin
+# Makefile for mcs/none plugin
 
 VPATH = @srcdir@
 am__is_gnu_make = { \
@@ -91,9 +91,10 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-subdir = src/plugins/auth/authd
+subdir = src/plugins/mcs/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -172,17 +173,16 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
-auth_authd_la_DEPENDENCIES =
-am_auth_authd_la_OBJECTS = auth_authd.lo
-auth_authd_la_OBJECTS = $(am_auth_authd_la_OBJECTS)
+mcs_none_la_LIBADD =
+am_mcs_none_la_OBJECTS = mcs_none.lo
+mcs_none_la_OBJECTS = $(am_mcs_none_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-auth_authd_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+mcs_none_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
-	$(auth_authd_la_LDFLAGS) $(LDFLAGS) -o $@
-@WITH_AUTHD_TRUE@am_auth_authd_la_rpath = -rpath $(pkglibdir)
+	$(mcs_none_la_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -217,8 +217,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(auth_authd_la_SOURCES)
-DIST_SOURCES = $(auth_authd_la_SOURCES)
+SOURCES = $(mcs_none_la_SOURCES)
+DIST_SOURCES = $(mcs_none_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -249,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -496,15 +505,11 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 PLUGIN_FLAGS = -module -avoid-version --export-dynamic
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+pkglib_LTLIBRARIES = mcs_none.la
 
-# Add your plugin to this line, following the naming conventions.
-@WITH_AUTHD_TRUE@AUTHD = auth_authd.la
-pkglib_LTLIBRARIES = $(AUTHD)
-
-# Authd authentication plugin -- requires libauth
-auth_authd_la_SOURCES = auth_authd.c
-auth_authd_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
-auth_authd_la_LIBADD = -lauth -le
+# mcs/none plugin.
+mcs_none_la_SOURCES = mcs_none.c
+mcs_none_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
 all: all-am
 
 .SUFFIXES:
@@ -518,9 +523,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/auth/authd/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/mcs/none/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/plugins/auth/authd/Makefile
+	  $(AUTOMAKE) --foreign src/plugins/mcs/none/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -574,8 +579,8 @@ clean-pkglibLTLIBRARIES:
 	  rm -f $${locs}; \
 	}
 
-auth_authd.la: $(auth_authd_la_OBJECTS) $(auth_authd_la_DEPENDENCIES) $(EXTRA_auth_authd_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(auth_authd_la_LINK) $(am_auth_authd_la_rpath) $(auth_authd_la_OBJECTS) $(auth_authd_la_LIBADD) $(LIBS)
+mcs_none.la: $(mcs_none_la_OBJECTS) $(mcs_none_la_DEPENDENCIES) $(EXTRA_mcs_none_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(mcs_none_la_LINK) -rpath $(pkglibdir) $(mcs_none_la_OBJECTS) $(mcs_none_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -583,7 +588,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/auth_authd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcs_none.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/src/plugins/mcs/none/mcs_none.c b/src/plugins/mcs/none/mcs_none.c
new file mode 100644
index 000000000..c540a03f6
--- /dev/null
+++ b/src/plugins/mcs/none/mcs_none.c
@@ -0,0 +1,107 @@
+/*****************************************************************************\
+ *  mcs_none.c - Define management functions with no functionality (stubs)
+ *****************************************************************************
+ *  Copyright (C) 2015 CEA/DAM/DIF
+ *  Written by Aline Roy <aline.roy@cea.fr>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "src/common/slurm_mcs.h"
+#include "slurm/slurm_errno.h"
+
+/*
+ * These variables are required by the generic plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *      <application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "task" for task control) and <method> is a description
+ * of how this plugin satisfies that application.  SLURM will only load
+ * a task plugin if the plugin_type string has a prefix of "task/".
+ *
+ * plugin_version - an unsigned 32-bit integer containing the Slurm version
+ * (major.minor.micro combined into a single number).
+ */
+const char plugin_name[]        = "mcs none plugin";
+const char plugin_type[]        = "mcs/none";
+const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
+
+/*
+ * init() is called when the plugin is loaded, before any other functions
+ *	are called.  Put global initialization here.
+ */
+extern int init(void)
+{
+	debug("%s loaded", plugin_name);
+
+	return SLURM_SUCCESS;
+}
+
+/*
+ * fini() is called when the plugin is removed. Clear any allocated
+ *	storage here.
+ */
+extern int fini(void)
+{
+	debug("%s fini", plugin_name);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * mcs_p_set_mcs_label() is called to obtain mcs_label.
+ */
+extern int mcs_p_set_mcs_label (struct job_record *job_ptr, char *label)
+{
+	return SLURM_SUCCESS;
+}
+
+/*
+ * mcs_p_check_mcs_label() is called to obtain mcs_label.
+ */
+extern int mcs_p_check_mcs_label (uint32_t user_id, char *mcs_label)
+{
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/mcs/user/Makefile.am b/src/plugins/mcs/user/Makefile.am
new file mode 100644
index 000000000..ec65f46ae
--- /dev/null
+++ b/src/plugins/mcs/user/Makefile.am
@@ -0,0 +1,13 @@
+# Makefile for mcs/user plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
+
+pkglib_LTLIBRARIES = mcs_user.la
+
+# mcs/user plugin.
+mcs_user_la_SOURCES = mcs_user.c
+mcs_user_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
diff --git a/src/plugins/job_submit/cnode/Makefile.in b/src/plugins/mcs/user/Makefile.in
similarity index 94%
rename from src/plugins/job_submit/cnode/Makefile.in
rename to src/plugins/mcs/user/Makefile.in
index 63978e563..1ae37cb1f 100644
--- a/src/plugins/job_submit/cnode/Makefile.in
+++ b/src/plugins/mcs/user/Makefile.in
@@ -14,7 +14,7 @@
 
 @SET_MAKE@
 
-# Makefile for job_submit/cnode plugin
+# Makefile for mcs/user plugin
 
 VPATH = @srcdir@
 am__is_gnu_make = { \
@@ -91,9 +91,10 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
-subdir = src/plugins/job_submit/cnode
+subdir = src/plugins/mcs/user
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -172,17 +173,16 @@ am__uninstall_files_from_dir = { \
   }
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
-job_submit_cnode_la_LIBADD =
-am_job_submit_cnode_la_OBJECTS = job_submit_cnode.lo
-job_submit_cnode_la_OBJECTS = $(am_job_submit_cnode_la_OBJECTS)
+mcs_user_la_LIBADD =
+am_mcs_user_la_OBJECTS = mcs_user.lo
+mcs_user_la_OBJECTS = $(am_mcs_user_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
-job_submit_cnode_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
-	$(AM_CFLAGS) $(CFLAGS) $(job_submit_cnode_la_LDFLAGS) \
-	$(LDFLAGS) -o $@
+mcs_user_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(mcs_user_la_LDFLAGS) $(LDFLAGS) -o $@
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
 am__v_P_0 = false
@@ -217,8 +217,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
 am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
-SOURCES = $(job_submit_cnode_la_SOURCES)
-DIST_SOURCES = $(job_submit_cnode_la_SOURCES)
+SOURCES = $(mcs_user_la_SOURCES)
+DIST_SOURCES = $(mcs_user_la_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
@@ -249,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -496,11 +505,11 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 PLUGIN_FLAGS = -module -avoid-version --export-dynamic
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common
-pkglib_LTLIBRARIES = job_submit_cnode.la
+pkglib_LTLIBRARIES = mcs_user.la
 
-# Job submit cnode plugin.
-job_submit_cnode_la_SOURCES = job_submit_cnode.c
-job_submit_cnode_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+# mcs/user plugin.
+mcs_user_la_SOURCES = mcs_user.c
+mcs_user_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
 all: all-am
 
 .SUFFIXES:
@@ -514,9 +523,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
 	      exit 1;; \
 	  esac; \
 	done; \
-	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/job_submit/cnode/Makefile'; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/mcs/user/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
-	  $(AUTOMAKE) --foreign src/plugins/job_submit/cnode/Makefile
+	  $(AUTOMAKE) --foreign src/plugins/mcs/user/Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -570,8 +579,8 @@ clean-pkglibLTLIBRARIES:
 	  rm -f $${locs}; \
 	}
 
-job_submit_cnode.la: $(job_submit_cnode_la_OBJECTS) $(job_submit_cnode_la_DEPENDENCIES) $(EXTRA_job_submit_cnode_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(job_submit_cnode_la_LINK) -rpath $(pkglibdir) $(job_submit_cnode_la_OBJECTS) $(job_submit_cnode_la_LIBADD) $(LIBS)
+mcs_user.la: $(mcs_user_la_OBJECTS) $(mcs_user_la_DEPENDENCIES) $(EXTRA_mcs_user_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(mcs_user_la_LINK) -rpath $(pkglibdir) $(mcs_user_la_OBJECTS) $(mcs_user_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
@@ -579,7 +588,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_submit_cnode.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mcs_user.Plo@am__quote@
 
 .c.o:
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
diff --git a/src/plugins/mcs/user/mcs_user.c b/src/plugins/mcs/user/mcs_user.c
new file mode 100644
index 000000000..1f5ed9d62
--- /dev/null
+++ b/src/plugins/mcs/user/mcs_user.c
@@ -0,0 +1,142 @@
+/*****************************************************************************\
+ *  mcs_user.c - Define mcs management functions for users
+ *****************************************************************************
+ *  Copyright (C) 2015 CEA/DAM/DIF
+ *  Written by Aline Roy <aline.roy@cea.fr>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include "slurm/slurm_errno.h"
+#include "src/common/slurm_mcs.h"
+#include "src/common/uid.h"
+#include "src/common/xstring.h"
+
+/*
+ * These variables are required by the generic plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *      <application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "task" for task control) and <method> is a description
+ * of how this plugin satisfies that application.  SLURM will only load
+ * a task plugin if the plugin_type string has a prefix of "task/".
+ *
+ * plugin_version - an unsigned 32-bit integer containing the Slurm version
+ * (major.minor.micro combined into a single number).
+ */
+const char plugin_name[]        = "mcs user plugin";
+const char plugin_type[]        = "mcs/user";
+const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
+
+/*********************** local variables *********************/
+
+/*
+ * init() is called when the plugin is loaded, before any other functions
+ *	are called.  Put global initialization here.
+ */
+extern int init(void)
+{
+	debug("%s loaded", plugin_name);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * fini() is called when the plugin is removed. Clear any allocated
+ *	storage here.
+ */
+extern int fini(void)
+{
+	return SLURM_SUCCESS;
+}
+
+/*
+ * mcs_p_set_mcs_label() is called to obtain mcs_label.
+ */
+extern int mcs_p_set_mcs_label (struct job_record *job_ptr, char *label)
+{
+	char *user = NULL;
+	int rc = SLURM_SUCCESS;
+	user = uid_to_string((uid_t) job_ptr->user_id);
+	xfree(job_ptr->mcs_label);
+	if (label != NULL) {
+		/* test label param */
+		if (xstrcmp(label, user) == 0) {
+			job_ptr->mcs_label = xstrdup(user);
+		} else {
+			rc = SLURM_ERROR;
+		}
+	} else {
+		if ((slurm_mcs_get_enforced() == 0) &&
+		   job_ptr->details && (job_ptr->details->whole_node != 3)) {
+			;
+		} else {
+			job_ptr->mcs_label = xstrdup(user);
+		}
+	}
+	xfree(user);
+	return rc;
+}
+
+/*
+ * mcs_p_check_mcs_label() is called to check mcs_label.
+ */
+extern int mcs_p_check_mcs_label (uint32_t user_id, char *mcs_label)
+{
+	char *user = NULL;
+	int rc = SLURM_SUCCESS;
+	user = uid_to_string((uid_t) user_id);
+	if (mcs_label != NULL) {
+		if (xstrcmp(mcs_label, user) == 0) {
+			rc = SLURM_SUCCESS;
+		} else {
+			rc = SLURM_ERROR;
+		}
+	} else {
+		rc = SLURM_SUCCESS;
+	}
+	xfree(user);
+	return rc;
+}
diff --git a/src/plugins/mpi/Makefile.am b/src/plugins/mpi/Makefile.am
index ea65f7e2a..6f7912729 100644
--- a/src/plugins/mpi/Makefile.am
+++ b/src/plugins/mpi/Makefile.am
@@ -5,4 +5,7 @@ if REAL_BGQ_LOADED
 SUBDIRS = none
 else
 SUBDIRS = mpich1_p4 mpich1_shmem mpichgm mpichmx mvapich none lam openmpi pmi2
+if HAVE_PMIX
+SUBDIRS += pmix
+endif
 endif
diff --git a/src/plugins/mpi/Makefile.in b/src/plugins/mpi/Makefile.in
index a6453f010..f61e986ce 100644
--- a/src/plugins/mpi/Makefile.in
+++ b/src/plugins/mpi/Makefile.in
@@ -90,9 +90,11 @@ POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
+@HAVE_PMIX_TRUE@@REAL_BGQ_LOADED_FALSE@am__append_1 = pmix
 subdir = src/plugins/mpi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -197,7 +199,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = mpich1_p4 mpich1_shmem mpichgm mpichmx mvapich none lam \
-	openmpi pmi2
+	openmpi pmi2 pmix
 am__DIST_COMMON = $(srcdir)/Makefile.in
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
@@ -229,8 +231,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +330,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +372,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +418,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +471,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -473,10 +484,12 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-@REAL_BGQ_LOADED_FALSE@SUBDIRS = mpich1_p4 mpich1_shmem mpichgm mpichmx mvapich none lam openmpi pmi2
+@REAL_BGQ_LOADED_FALSE@SUBDIRS = mpich1_p4 mpich1_shmem mpichgm \
+@REAL_BGQ_LOADED_FALSE@	mpichmx mvapich none lam openmpi pmi2 \
+@REAL_BGQ_LOADED_FALSE@	$(am__append_1)
 
 #on a real BGQ do not compile any mpi plugins
-@REAL_BGQ_LOADED_TRUE@SUBDIRS = none
+@REAL_BGQ_LOADED_TRUE@SUBDIRS = none $(am__append_1)
 all: all-recursive
 
 .SUFFIXES:
diff --git a/src/plugins/mpi/lam/Makefile.in b/src/plugins/mpi/lam/Makefile.in
index 90b3ccbd9..bc1f6dd3f 100644
--- a/src/plugins/mpi/lam/Makefile.in
+++ b/src/plugins/mpi/lam/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/lam
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/lam/lam.h b/src/plugins/mpi/lam/lam.h
index a052a89c8..790ebef43 100644
--- a/src/plugins/mpi/lam/lam.h
+++ b/src/plugins/mpi/lam/lam.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  **  lam.h - Library routines for initiating jobs on with lam type mpi
- **  $Id: mpi_gmpi.c,v 1.7 2005/06/07 18:25:32 morrone Exp $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/lam/mpi_lam.c b/src/plugins/mpi/lam/mpi_lam.c
index 0aa60a21d..828bbe77c 100644
--- a/src/plugins/mpi/lam/mpi_lam.c
+++ b/src/plugins/mpi/lam/mpi_lam.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  **  mpi_lam.c - Library routines for initiating jobs on with lam type mpi
- **  $Id: mpi_gmpi.c,v 1.7 2005/06/07 18:25:32 morrone Exp $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/mpich1_p4/Makefile.in b/src/plugins/mpi/mpich1_p4/Makefile.in
index f63ff2f6b..5915456e8 100644
--- a/src/plugins/mpi/mpich1_p4/Makefile.in
+++ b/src/plugins/mpi/mpich1_p4/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/mpich1_p4
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/mpich1_p4/mpich1_p4.c b/src/plugins/mpi/mpich1_p4/mpich1_p4.c
index 1d1e3c73c..ce24ca26f 100644
--- a/src/plugins/mpi/mpich1_p4/mpich1_p4.c
+++ b/src/plugins/mpi/mpich1_p4/mpich1_p4.c
@@ -242,10 +242,10 @@ static void *mpich1_thr(void *arg)
 	}
 
 done:
-	pthread_mutex_lock(&shutdown_lock);
+	slurm_mutex_lock(&shutdown_lock);
 	shutdown_complete = true;
 	pthread_cond_signal(&shutdown_cond);
-	pthread_mutex_unlock(&shutdown_lock);
+	slurm_mutex_unlock(&shutdown_lock);
 	return NULL;
 }
 
diff --git a/src/plugins/mpi/mpich1_shmem/Makefile.in b/src/plugins/mpi/mpich1_shmem/Makefile.in
index 3690e9e97..61c0f5079 100644
--- a/src/plugins/mpi/mpich1_shmem/Makefile.in
+++ b/src/plugins/mpi/mpich1_shmem/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/mpich1_shmem
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/mpichgm/Makefile.in b/src/plugins/mpi/mpichgm/Makefile.in
index b99ee2dbd..a512666bd 100644
--- a/src/plugins/mpi/mpichgm/Makefile.in
+++ b/src/plugins/mpi/mpichgm/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/mpichgm
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/mpichgm/mpi_mpichgm.c b/src/plugins/mpi/mpichgm/mpi_mpichgm.c
index 003d6c5f1..dbcc3d5d3 100644
--- a/src/plugins/mpi/mpichgm/mpi_mpichgm.c
+++ b/src/plugins/mpi/mpichgm/mpi_mpichgm.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  **  mpi_mpichgm.c - Library routines for initiating jobs on with gmpi type mpi
- **  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/mpichgm/mpichgm.c b/src/plugins/mpi/mpichgm/mpichgm.c
index fe493a6af..2365b3302 100644
--- a/src/plugins/mpi/mpichgm/mpichgm.c
+++ b/src/plugins/mpi/mpichgm/mpichgm.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
- ** mpichgm.c - srun support for MPICH-GM (GMPI)
- ** $Id$
+ *  mpichgm.c - srun support for MPICH-GM (GMPI)
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/mpichgm/mpichgm.h b/src/plugins/mpi/mpichgm/mpichgm.h
index 3aad40339..c6c401ac9 100644
--- a/src/plugins/mpi/mpichgm/mpichgm.h
+++ b/src/plugins/mpi/mpichgm/mpichgm.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
- **  mpichgm.h - Library routines for initiating jobs on with gmpi type mpi
- **  $Id$
+ *  mpichgm.h - Library routines for initiating jobs on with gmpi type mpi
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/mpichmx/Makefile.in b/src/plugins/mpi/mpichmx/Makefile.in
index 26a446721..0b4e92d4b 100644
--- a/src/plugins/mpi/mpichmx/Makefile.in
+++ b/src/plugins/mpi/mpichmx/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/mpichmx
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/mvapich/Makefile.in b/src/plugins/mpi/mvapich/Makefile.in
index 5a7fb4795..4a5359bcf 100644
--- a/src/plugins/mpi/mvapich/Makefile.in
+++ b/src/plugins/mpi/mvapich/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/mvapich
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/mvapich/mvapich.c b/src/plugins/mpi/mvapich/mvapich.c
index af0acdca9..02f416fa8 100644
--- a/src/plugins/mpi/mvapich/mvapich.c
+++ b/src/plugins/mpi/mvapich/mvapich.c
@@ -1750,7 +1750,7 @@ static int mvapich_authenticate_munge(mvapich_state_t *st, struct mvapich_info *
 		}
 
 		/* check that the payload is valid */
-		if (!failed && strcmp (payload, payload_remote) != 0) {
+		if (!failed && xstrcmp (payload, payload_remote) != 0) {
 			pmgr_munge_failure (st, fd, "Got credential with bad payload");
 			error ("Got credential with bad payload");
 			failed = 1;
@@ -2562,12 +2562,12 @@ extern int mvapich_thr_destroy(mvapich_state_t *st)
 
 void mvapich_thr_exit(mvapich_state_t *st)
 {
-	pthread_mutex_lock(&st->shutdown_lock);
+	slurm_mutex_lock(&st->shutdown_lock);
 
 	st->shutdown_complete = true;
 
 	pthread_cond_signal(&st->shutdown_cond);
-	pthread_mutex_unlock(&st->shutdown_lock);
+	slurm_mutex_unlock(&st->shutdown_lock);
 
 	pthread_exit(NULL);
 }
diff --git a/src/plugins/mpi/none/Makefile.in b/src/plugins/mpi/none/Makefile.in
index 2d3734e0a..cec528c0d 100644
--- a/src/plugins/mpi/none/Makefile.in
+++ b/src/plugins/mpi/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/none/mpi_none.c b/src/plugins/mpi/none/mpi_none.c
index c340799ae..3df5bc079 100644
--- a/src/plugins/mpi/none/mpi_none.c
+++ b/src/plugins/mpi/none/mpi_none.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
- **  mpi_none.c - Library routines for initiating jobs on without mpi support
- **  $Id$
+ *  mpi_none.c - Library routines for initiating jobs on without mpi support
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/openmpi/Makefile.in b/src/plugins/mpi/openmpi/Makefile.in
index 066765c56..1fe89b45c 100644
--- a/src/plugins/mpi/openmpi/Makefile.in
+++ b/src/plugins/mpi/openmpi/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/openmpi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/openmpi/mpi_openmpi.c b/src/plugins/mpi/openmpi/mpi_openmpi.c
index 86f386aa7..37b7ecd34 100644
--- a/src/plugins/mpi/openmpi/mpi_openmpi.c
+++ b/src/plugins/mpi/openmpi/mpi_openmpi.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  **  mpi_openmpi.c - Library routines for initiating openmpi jobs
- **  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/mpi/pmi2/Makefile.in b/src/plugins/mpi/pmi2/Makefile.in
index d9943ecf8..30f1d2697 100644
--- a/src/plugins/mpi/pmi2/Makefile.in
+++ b/src/plugins/mpi/pmi2/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/mpi/pmi2
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/mpi/pmi2/client.c b/src/plugins/mpi/pmi2/client.c
index f4ba6fead..0e3a1e660 100644
--- a/src/plugins/mpi/pmi2/client.c
+++ b/src/plugins/mpi/pmi2/client.c
@@ -116,7 +116,7 @@ _parse_cmd(client_req_t *req)
 	int i = 0, len = 0;
 
 	len = strlen (MCMD_KEY"=");
-	if (! strncmp(req->buf, MCMD_KEY"=", len)) {
+	if (! xstrncmp(req->buf, MCMD_KEY"=", len)) {
 		req->cmd = MCMD_KEY; /* XXX: mcmd=spawn */
 		req->sep = '\n';
 		req->term = '\n';
@@ -124,7 +124,7 @@ _parse_cmd(client_req_t *req)
 	}
 
 	len = strlen (CMD_KEY"=");
-	if (strncmp(req->buf, CMD_KEY"=", len)) {
+	if (xstrncmp(req->buf, CMD_KEY"=", len)) {
 		error("mpi/pmi2: request not begin with '" CMD_KEY "='");
 		error("mpi/pmi2: full request is: %s", req->buf);
 		return SLURM_ERROR;
@@ -186,6 +186,7 @@ client_req_free(client_req_t *req)
 {
 	if (req) {
 		xfree(req->buf);
+		xfree(req->pairs);
 		xfree(req);
 	}
 }
@@ -274,7 +275,7 @@ client_req_parse_spawn_req(client_req_t *req)
 	spawn_req = spawn_req_new();
 
 	/* ncmds */
-	if (strcmp(MP_KEY(req, pi), NCMDS_KEY)) {
+	if (xstrcmp(MP_KEY(req, pi), NCMDS_KEY)) {
 		error("mpi/pmi2: '" NCMDS_KEY "' expected in spawn cmd");
 		goto req_err;
 	}
@@ -283,7 +284,7 @@ client_req_parse_spawn_req(client_req_t *req)
 				     sizeof(spawn_subcmd_t *));
 	pi ++;
 	/* preputcount */
-	if (strcmp(MP_KEY(req, pi), PREPUTCOUNT_KEY)) {
+	if (xstrcmp(MP_KEY(req, pi), PREPUTCOUNT_KEY)) {
 		error("mpi/pmi2: '" PREPUTCOUNT_KEY "' expected in spawn cmd");
 		goto req_err;
 	}
@@ -300,7 +301,7 @@ client_req_parse_spawn_req(client_req_t *req)
 	/* ppkey,ppval */
 	for (i = 0; i < spawn_req->preput_cnt; i ++) {
 		/* ppkey */
-		if (strncmp(MP_KEY(req, pi), PPKEY_KEY, strlen(PPKEY_KEY)) ||
+		if (xstrncmp(MP_KEY(req, pi), PPKEY_KEY, strlen(PPKEY_KEY)) ||
 		    atoi((MP_KEY(req, pi) + strlen(PPKEY_KEY))) != i) {
 			error("mpi/pmi2: '" PPKEY_KEY
 			      "%d' expected in spawn cmd", i);
@@ -309,7 +310,7 @@ client_req_parse_spawn_req(client_req_t *req)
 		spawn_req->pp_keys[i] = xstrdup(MP_VAL(req, pi));
 		pi ++;
 		/* ppval */
-		if (strncmp(MP_KEY(req, pi), PPVAL_KEY, strlen(PPVAL_KEY)) ||
+		if (xstrncmp(MP_KEY(req, pi), PPVAL_KEY, strlen(PPVAL_KEY)) ||
 		    atoi((MP_KEY(req, pi) + strlen(PPVAL_KEY))) != i) {
 			error("mpi/pmi2: '" PPVAL_KEY
 			      "%d' expected in spawn cmd", i);
@@ -323,7 +324,7 @@ client_req_parse_spawn_req(client_req_t *req)
 		spawn_req->subcmds[i] = spawn_subcmd_new();
 		subcmd = spawn_req->subcmds[i];
 		/* subcmd */
-		if (strcmp(MP_KEY(req, pi), SUBCMD_KEY)) {
+		if (xstrcmp(MP_KEY(req, pi), SUBCMD_KEY)) {
 			error("mpi/pmi2: '" SUBCMD_KEY
 			      "' expected in spawn cmd");
 			goto req_err;
@@ -331,7 +332,7 @@ client_req_parse_spawn_req(client_req_t *req)
 		subcmd->cmd = xstrdup(MP_VAL(req, pi));
 		pi ++;
 		/* maxprocs */
-		if (strcmp(MP_KEY(req, pi), MAXPROCS_KEY)) {
+		if (xstrcmp(MP_KEY(req, pi), MAXPROCS_KEY)) {
 			error("mpi/pmi2: '" MAXPROCS_KEY
 			      "' expected in spawn cmd");
 			goto req_err;
@@ -340,7 +341,7 @@ client_req_parse_spawn_req(client_req_t *req)
 		subcmd->max_procs = atoi(MP_VAL(req, pi));
 		pi ++;
 		/* argc */
-		if (strcmp(MP_KEY(req, pi), ARGC_KEY)) {
+		if (xstrcmp(MP_KEY(req, pi), ARGC_KEY)) {
 			error("mpi/pmi2: '" ARGC_KEY
 			      "' expected in spawn cmd");
 			goto req_err;
@@ -361,8 +362,8 @@ client_req_parse_spawn_req(client_req_t *req)
 		}
 		/* argv */
 		for (j = 0; j < subcmd->argc; j ++) {
-			if (strncmp(MP_KEY(req, pi), ARGV_KEY,
-				    strlen(ARGV_KEY)) ||
+			if (xstrncmp(MP_KEY(req, pi), ARGV_KEY,
+				     strlen(ARGV_KEY)) ||
 			    atoi((MP_KEY(req, pi) + strlen(ARGV_KEY))) != j) {
 				error("mpi/pmi2: '" ARGV_KEY
 				      "%d' expected in spawn cmd", j);
@@ -380,7 +381,7 @@ client_req_parse_spawn_req(client_req_t *req)
 				goto req_err;
 			}
 			break;
-		} else if (strcmp(MP_KEY(req, pi), INFOKEYCOUNT_KEY)) {
+		} else if (xstrcmp(MP_KEY(req, pi), INFOKEYCOUNT_KEY)) {
 			subcmd->info_cnt = 0;
 			continue;
 		}
@@ -403,8 +404,8 @@ client_req_parse_spawn_req(client_req_t *req)
 		/* infokey,infoval */
 		for (j = 0; j < subcmd->info_cnt; j ++) {
 			/* infokey */
-			if (strncmp(MP_KEY(req, pi), INFOKEY_KEY,
-				    strlen(INFOKEY_KEY)) ||
+			if (xstrncmp(MP_KEY(req, pi), INFOKEY_KEY,
+				     strlen(INFOKEY_KEY)) ||
 			    atoi((MP_KEY(req, pi) +
 				  strlen(INFOKEY_KEY))) != j) {
 				error("mpi/pmi2: '" INFOKEY_KEY
@@ -414,8 +415,8 @@ client_req_parse_spawn_req(client_req_t *req)
 			subcmd->info_keys[j] = xstrdup(MP_VAL(req, pi));
 			pi ++;
 			/* infoval */
-			if (strncmp(MP_KEY(req, pi), INFOVAL_KEY,
-				    strlen(INFOVAL_KEY)) ||
+			if (xstrncmp(MP_KEY(req, pi), INFOVAL_KEY,
+				     strlen(INFOVAL_KEY)) ||
 			    atoi((MP_KEY(req, pi) +
 				  strlen(INFOVAL_KEY))) != j) {
 				error("mpi/pmi2: '" INFOVAL_KEY
@@ -473,7 +474,7 @@ _client_req_get_val(client_req_t *req, const char *key)
 	int i;
 
 	for (i = 0; i < req->pairs_cnt; i ++) {
-		if (! strcmp(key, req->pairs[KEY_INDEX(i)]))
+		if (! xstrcmp(key, req->pairs[KEY_INDEX(i)]))
 			return req->pairs[VAL_INDEX(i)];
 	}
 	return NULL;
@@ -515,7 +516,7 @@ client_req_get_bool(client_req_t *req, const char *key, bool *pval)
 	if (val == NULL)
 		return false;
 
-	if (!strcasecmp(val, TRUE_VAL))
+	if (!xstrcasecmp(val, TRUE_VAL))
 		*pval = true;
 	else
 		*pval = false;
diff --git a/src/plugins/mpi/pmi2/info.c b/src/plugins/mpi/pmi2/info.c
index 10510978e..8c9dbfef2 100644
--- a/src/plugins/mpi/pmi2/info.c
+++ b/src/plugins/mpi/pmi2/info.c
@@ -76,12 +76,6 @@ static char **node_attr = NULL;
 
 static char *ifconfig(void);
 
-static void inline
-_free_nag_req(nag_req_t *req)
-{
-	xfree (req);
-}
-
 extern int
 enqueue_nag_req(int fd, int rank, char *key)
 {
@@ -119,7 +113,7 @@ node_attr_put(char *key, char *val)
 	pprev = &nag_req_list;
 	req = *pprev;
 	while (req != NULL) {
-		if (strncmp(key, req->key, PMI2_MAX_KEYLEN)) {
+		if (xstrncmp(key, req->key, PMI2_MAX_KEYLEN)) {
 			pprev = &req->next;
 			req = *pprev;
 		} else {
@@ -144,7 +138,7 @@ node_attr_put(char *key, char *val)
 			}
 			/* remove the request */
 			*pprev = req->next;
-			_free_nag_req(req);
+			xfree(req);
 			req = *pprev;
 		}
 	}
@@ -165,7 +159,7 @@ node_attr_get(char *key)
 	debug3("mpi/pmi2: node_attr_get: key=%s", key);
 
 	for (i = 0; i < na_cnt; i ++) {
-		if (! strcmp(key, node_attr[KEY_INDEX(i)])) {
+		if (! xstrcmp(key, node_attr[KEY_INDEX(i)])) {
 			val = node_attr[VAL_INDEX(i)];
 			break;
 		}
@@ -200,16 +194,16 @@ job_attr_get(char *key)
 {
 	static char attr[PMI2_MAX_VALLEN];
 
-	if (!strcmp(key, JOB_ATTR_PROC_MAP)) {
+	if (!xstrcmp(key, JOB_ATTR_PROC_MAP)) {
 		return job_info.proc_mapping;
 	}
 
-	if (!strcmp(key, JOB_ATTR_UNIV_SIZE)) {
+	if (!xstrcmp(key, JOB_ATTR_UNIV_SIZE)) {
 		snprintf(attr, PMI2_MAX_VALLEN, "%d", job_info.ntasks);
 		return attr;
 	}
 
-	if (!strcmp(key, JOB_ATTR_RESV_PORTS)) {
+	if (!xstrcmp(key, JOB_ATTR_RESV_PORTS)) {
 
 		if (! job_info.resv_ports)
 			return NULL;
@@ -219,7 +213,7 @@ job_attr_get(char *key)
 		return attr;
 	}
 
-	if (strcmp(key, JOB_ATTR_NETINFO) >= 0) {
+	if (xstrcmp(key, JOB_ATTR_NETINFO) >= 0) {
 		if (job_attr_get_netinfo(key, attr) == NULL) {
 			return NULL;
 		}
diff --git a/src/plugins/mpi/pmi2/kvs.c b/src/plugins/mpi/pmi2/kvs.c
index 0a0950cd1..061f9d188 100644
--- a/src/plugins/mpi/pmi2/kvs.c
+++ b/src/plugins/mpi/pmi2/kvs.c
@@ -190,51 +190,42 @@ temp_kvs_send(void)
 {
 	int rc = SLURM_ERROR, retry = 0;
 	unsigned int delay = 1;
-	hostlist_t hl = NULL;
-	char free_hl = 0;
-
-	if (! in_stepd()) {	/* srun */
-		hl = hostlist_create(job_info.step_nodelist);
-		free_hl = 1;
-	} else if (tree_info.parent_node != NULL) {
-		hl = hostlist_create(tree_info.parent_node);
-		free_hl = 1;
-	}
+	char *nodelist = NULL;
+
+	if (!in_stepd())	/* srun */
+		nodelist = xstrdup(job_info.step_nodelist);
+	else if (tree_info.parent_node)
+		nodelist = xstrdup(tree_info.parent_node);
 
 	/* cmd included in temp_kvs_buf */
-	kvs_seq ++; /* expecting new kvs after now */
+	kvs_seq++; /* expecting new kvs after now */
 
 	while (1) {
-		if (retry == 1) {
+		if (retry == 1)
 			verbose("failed to send temp kvs, rc=%d, retrying", rc);
-		}
 
-		if (! in_stepd()) {	/* srun */
-			rc = tree_msg_to_stepds(hl,
-						temp_kvs_cnt,
-						temp_kvs_buf);
-		} else if (tree_info.parent_node != NULL) {
-			/* non-first-level stepds */
-			rc = tree_msg_to_stepds(hl,
+		if (nodelist)
+			/* srun or non-first-level stepds */
+			rc = slurm_forward_data(&nodelist,
+						tree_sock_addr,
 						temp_kvs_cnt,
 						temp_kvs_buf);
-		} else {		/* first level stepds */
+		else		/* first level stepds */
 			rc = tree_msg_to_srun(temp_kvs_cnt, temp_kvs_buf);
-		}
+
 		if (rc == SLURM_SUCCESS)
 			break;
 
-		retry ++;
-		if (retry >= MAX_RETRIES)
+		if (++retry >= MAX_RETRIES)
 			break;
 		/* wait, in case parent stepd / srun not ready */
 		sleep(delay);
 		delay *= 2;
 	}
 	temp_kvs_init();	/* clear old temp kvs */
-	if( free_hl ){
-		hostlist_destroy(hl);
-	}
+
+	xfree(nodelist);
+
 	return rc;
 }
 
@@ -270,7 +261,7 @@ kvs_get(char *key)
 	bucket = &kvs_hash[HASH(key)];
 	if (bucket->count > 0) {
 		for(i = 0; i < bucket->count; i ++) {
-			if (! strcmp(key, bucket->pairs[KEY_INDEX(i)])) {
+			if (! xstrcmp(key, bucket->pairs[KEY_INDEX(i)])) {
 				val = bucket->pairs[VAL_INDEX(i)];
 				break;
 			}
@@ -294,7 +285,7 @@ kvs_put(char *key, char *val)
 
 	if (! no_dup_keys) {
 		for (i = 0; i < bucket->count; i ++) {
-			if (! strcmp(key, bucket->pairs[KEY_INDEX(i)])) {
+			if (! xstrcmp(key, bucket->pairs[KEY_INDEX(i)])) {
 				/* replace the k-v pair */
 				xfree(bucket->pairs[VAL_INDEX(i)]);
 				bucket->pairs[VAL_INDEX(i)] = xstrdup(val);
diff --git a/src/plugins/mpi/pmi2/nameserv.c b/src/plugins/mpi/pmi2/nameserv.c
index afe70dc99..a4f828278 100644
--- a/src/plugins/mpi/pmi2/nameserv.c
+++ b/src/plugins/mpi/pmi2/nameserv.c
@@ -59,7 +59,7 @@ name_lookup_local (char *name)
 	name_port_t *np;
 
 	np = local_name_list;
-	while (np && strcmp(np->name, name))
+	while (np && xstrcmp(np->name, name))
 		np = np->next;
 
 	return np ? xstrdup(np->port) : NULL;
@@ -71,7 +71,7 @@ name_publish_local (char *name, char *port)
 	name_port_t *np;
 
 	np = local_name_list;
-	while (np && strcmp(np->name, name))
+	while (np && xstrcmp(np->name, name))
 		np = np->next;
 	if (np) {
 		xfree(np->port);
@@ -94,7 +94,7 @@ name_unpublish_local (char *name)
 	pprev = &local_name_list;
 	np = *pprev;
 	while (np) {
-		if (strcmp(np->name, name)) {
+		if (xstrcmp(np->name, name)) {
 			pprev = &np->next;
 			np = np->next;
 		} else {
diff --git a/src/plugins/mpi/pmi2/pmi1.c b/src/plugins/mpi/pmi2/pmi1.c
index 721903f45..70d3869c7 100644
--- a/src/plugins/mpi/pmi2/pmi1.c
+++ b/src/plugins/mpi/pmi2/pmi1.c
@@ -527,7 +527,7 @@ _handle_pmi1_cmd_buf(int fd, int lrank, int buf_len, char *buf)
 
 	i = 0;
 	while (pmi1_cmd_handlers[i].cmd != NULL) {
-		if (!strcmp(req->cmd, pmi1_cmd_handlers[i].cmd))
+		if (!xstrcmp(req->cmd, pmi1_cmd_handlers[i].cmd))
 			break;
 		i ++;
 	}
@@ -554,7 +554,7 @@ _handle_pmi1_mcmd_buf(int fd, int lrank, int buf_size, int buf_len, char **pbuf)
 	buf = *pbuf;
 	n = buf_len;
 	endcmd_len = strlen(ENDCMD_KEY"\n");
-	not_end = strncmp(&buf[n - endcmd_len], ENDCMD_KEY"\n", endcmd_len);
+	not_end = xstrncmp(&buf[n - endcmd_len], ENDCMD_KEY"\n", endcmd_len);
 	while(not_end) {
 		if (n == buf_size) {
 			buf_size += MAX_READLINE;
@@ -571,8 +571,8 @@ _handle_pmi1_mcmd_buf(int fd, int lrank, int buf_size, int buf_len, char **pbuf)
 			usleep(100);
 		} else {
 			n += len;
-			not_end = strncmp(&buf[n - endcmd_len],
-					  ENDCMD_KEY"\n", endcmd_len);
+			not_end = xstrncmp(&buf[n - endcmd_len],
+					   ENDCMD_KEY"\n", endcmd_len);
 		}
 	}
 	buf[n] = '\0';
@@ -622,7 +622,7 @@ handle_pmi1_cmd(int fd, int lrank)
 	}
 
 	len = strlen(MCMD_KEY"=");
-	if (! strncmp(buf, MCMD_KEY"=", len)) {
+	if (! xstrncmp(buf, MCMD_KEY"=", len)) {
 		rc = _handle_pmi1_mcmd_buf(fd, lrank, size, n, &buf);
 		xfree(buf);
 	} else {
diff --git a/src/plugins/mpi/pmi2/pmi2.c b/src/plugins/mpi/pmi2/pmi2.c
index 84234507b..71ac79289 100644
--- a/src/plugins/mpi/pmi2/pmi2.c
+++ b/src/plugins/mpi/pmi2/pmi2.c
@@ -252,6 +252,9 @@ _handle_ring(int fd, int lrank, client_req_t *req)
 
         rc = pmix_ring_in(ring_id, count, left, right);
 
+	xfree(left);
+	xfree(right);
+
         /* the repsonse is sent back to client from the pmix_ring_out call */
 
 	debug3("mpi/pmi2: out _handle_ring");
@@ -272,6 +275,8 @@ _handle_kvs_put(int fd, int lrank, client_req_t *req)
 
 	/* no need to add k-v to hash. just get it ready to be up-forward */
 	rc = temp_kvs_add(key, val);
+	xfree(key);
+	xfree(val);
 
 	resp = client_resp_new();
 	client_resp_append(resp, CMD_KEY"="KVSPUTRESP_CMD";" RC_KEY"=%d;", rc);
@@ -322,7 +327,7 @@ _handle_kvs_get(int fd, int lrank, client_req_t *req)
 {
 	int rc;
 	client_resp_t *resp;
-	char *key, *val;
+	char *key = NULL, *val;
 
 	debug3("mpi/pmi2: in _handle_kvs_get");
 
@@ -330,6 +335,7 @@ _handle_kvs_get(int fd, int lrank, client_req_t *req)
 	client_req_get_str(req, KEY_KEY, &key);
 
 	val = kvs_get(key);
+	xfree(key);
 
 	resp = client_resp_new();
 	if (val != NULL) {
@@ -352,7 +358,7 @@ _handle_info_getnodeattr(int fd, int lrank, client_req_t *req)
 {
 	int rc = 0;
 	client_resp_t *resp;
-	char *key, *val;
+	char *key = NULL, *val;
 	bool wait = false;
 
 	debug3("mpi/pmi2: in _handle_info_getnodeattr from lrank %d", lrank);
@@ -378,7 +384,7 @@ _handle_info_getnodeattr(int fd, int lrank, client_req_t *req)
 	} else {
 		rc = enqueue_nag_req(fd, lrank, key);
 	}
-
+	xfree(key);
 	debug3("mpi/pmi2: out _handle_info_getnodeattr");
 	return rc;
 }
@@ -398,8 +404,12 @@ _handle_info_putnodeattr(int fd, int lrank, client_req_t *req)
 
 	rc = node_attr_put(key, val);
 
+	xfree(key);
+	xfree(val);
+
 	resp = client_resp_new();
-	client_resp_append(resp, CMD_KEY"="PUTNODEATTRRESP_CMD";" RC_KEY"=%d;", rc);
+	client_resp_append(resp,
+			   CMD_KEY"="PUTNODEATTRRESP_CMD";" RC_KEY"=%d;", rc);
 	rc = client_resp_send(resp, fd);
 	client_resp_free(resp);
 
@@ -410,7 +420,7 @@ _handle_info_putnodeattr(int fd, int lrank, client_req_t *req)
 static int
 _handle_info_getjobattr(int fd, int lrank, client_req_t *req)
 {
-	char *key, *val;
+	char *key = NULL, *val;
 	client_resp_t *resp;
 	int rc;
 
@@ -419,11 +429,13 @@ _handle_info_getjobattr(int fd, int lrank, client_req_t *req)
 	client_req_get_str(req, KEY_KEY, &key);
 
 	val = job_attr_get(key);
+	xfree(key);
 
 	resp = client_resp_new();
 	client_resp_append(resp, CMD_KEY"="GETJOBATTRRESP_CMD";" RC_KEY"=0;");
 	if (val != NULL) {
-		client_resp_append(resp, FOUND_KEY"="TRUE_VAL";" VALUE_KEY"=%s;",
+		client_resp_append(resp,
+				   FOUND_KEY"="TRUE_VAL";" VALUE_KEY"=%s;",
 				   val);
 	} else {
 		client_resp_append(resp, FOUND_KEY"="FALSE_VAL";");
@@ -448,7 +460,7 @@ _handle_name_publish(int fd, int lrank, client_req_t *req)
 	client_req_parse_body(req);
 	client_req_get_str(req, NAME_KEY, &name);
 	client_req_get_str(req, PORT_KEY, &port);
-	
+
 	rc = name_publish_up(name, port);
 	xfree(name);
 	xfree(port);
@@ -474,7 +486,7 @@ _handle_name_unpublish(int fd, int lrank, client_req_t *req)
 
 	client_req_parse_body(req);
 	client_req_get_str(req, NAME_KEY, &name);
-	
+
 	rc = name_unpublish_up(name);
 	xfree(name);
 
@@ -598,7 +610,7 @@ handle_pmi2_cmd(int fd, int lrank)
 
 	i = 0;
 	while (pmi2_cmd_handlers[i].cmd != NULL) {
-		if (!strcmp(req->cmd, pmi2_cmd_handlers[i].cmd))
+		if (!xstrcmp(req->cmd, pmi2_cmd_handlers[i].cmd))
 			break;
 		i ++;
 	}
diff --git a/src/plugins/mpi/pmi2/ring.c b/src/plugins/mpi/pmi2/ring.c
index 7a3118cd3..dd6a5dfc0 100644
--- a/src/plugins/mpi/pmi2/ring.c
+++ b/src/plugins/mpi/pmi2/ring.c
@@ -219,7 +219,7 @@ static int pmix_stepd_send(const char* buf, uint32_t size, int rank)
 	int retries = 0;
 	while (1) {
 		/* attempt to send message */
-		rc = slurm_forward_data(host, tree_sock_addr, size, (char*) buf);
+		rc = slurm_forward_data(&host, tree_sock_addr, size, buf);
 		if (rc == SLURM_SUCCESS) {
 			/* message sent successfully, we're done */
 			break;
diff --git a/src/plugins/mpi/pmi2/setup.c b/src/plugins/mpi/pmi2/setup.c
index 1d1845550..ab9f6f5b3 100644
--- a/src/plugins/mpi/pmi2/setup.c
+++ b/src/plugins/mpi/pmi2/setup.c
@@ -71,7 +71,7 @@
 #include "kvs.h"
 #include "ring.h"
 
-#define PMI2_SOCK_ADDR_FMT "/tmp/sock.pmi2.%u.%u"
+#define PMI2_SOCK_ADDR_FMT "%s/sock.pmi2.%u.%u"
 
 
 extern char **environ;
@@ -184,7 +184,7 @@ static int
 _setup_stepd_tree_info(const stepd_step_rec_t *job, char ***env)
 {
 	hostlist_t hl;
-	char srun_host[64];
+	char *srun_host;
 	uint16_t port;
 	char *p;
 	int tree_width;
@@ -233,24 +233,23 @@ _setup_stepd_tree_info(const stepd_step_rec_t *job, char ***env)
 
 	tree_info.pmi_port = 0;	/* not used */
 
-	p = getenvp(*env, "SLURM_SRUN_COMM_HOST");
-	if (!p) {
+	srun_host = getenvp(*env, "SLURM_SRUN_COMM_HOST");
+	if (!srun_host) {
 		error("mpi/pmi2: unable to find srun comm ifhn in env");
 		return SLURM_ERROR;
-	} else {
-		strncpy(srun_host, p, 64);
 	}
 	p = getenvp(*env, PMI2_SRUN_PORT_ENV);
 	if (!p) {
 		error("mpi/pmi2: unable to find srun pmi2 port in env");
 		return SLURM_ERROR;
-	} else {
-		port = atoi(p);
-		unsetenvp(*env, PMI2_SRUN_PORT_ENV);
 	}
+	port = atoi(p);
+
 	tree_info.srun_addr = xmalloc(sizeof(slurm_addr_t));
 	slurm_set_addr(tree_info.srun_addr, port, srun_host);
 
+	unsetenvp(*env, PMI2_SRUN_PORT_ENV);
+
 	/* init kvs seq to 0. TODO: reduce array size */
 	tree_info.children_kvs_seq = xmalloc(sizeof(uint32_t) *
 					     job_info.nnodes);
@@ -266,6 +265,7 @@ _setup_stepd_sockets(const stepd_step_rec_t *job, char ***env)
 {
 	struct sockaddr_un sa;
 	int i;
+	char *spool;
 
 	debug("mpi/pmi2: setup sockets");
 
@@ -275,9 +275,12 @@ _setup_stepd_sockets(const stepd_step_rec_t *job, char ***env)
 		return SLURM_ERROR;
 	}
 	sa.sun_family = PF_UNIX;
+
+	spool = slurm_get_slurmd_spooldir();
 	snprintf(sa.sun_path, sizeof(sa.sun_path), PMI2_SOCK_ADDR_FMT,
-		 job->jobid, job->stepid);
+		 spool, job->jobid, job->stepid);
 	unlink(sa.sun_path);    /* remove possible old socket */
+	xfree(spool);
 
 	if (bind(tree_sock, (struct sockaddr *)&sa, SUN_LEN(&sa)) < 0) {
 		error("mpi/pmi2: failed to bind tree socket: %m");
@@ -609,6 +612,7 @@ _setup_srun_tree_info(const mpi_plugin_client_info_t *job)
 {
 	char *p;
 	uint16_t p_port;
+	char *spool;
 
 	memset(&tree_info, 0, sizeof(tree_info));
 
@@ -628,8 +632,10 @@ _setup_srun_tree_info(const mpi_plugin_client_info_t *job)
 	} else
 		tree_info.srun_addr = NULL;
 
+	spool = slurm_get_slurmd_spooldir();
 	snprintf(tree_sock_addr, 128, PMI2_SOCK_ADDR_FMT,
-		 job->jobid, job->stepid);
+		 spool, job->jobid, job->stepid);
+	xfree(spool);
 
 	/* init kvs seq to 0. TODO: reduce array size */
 	tree_info.children_kvs_seq = xmalloc(sizeof(uint32_t) *
diff --git a/src/plugins/mpi/pmi2/spawn.c b/src/plugins/mpi/pmi2/spawn.c
index ca8c83861..1bca9c5ee 100644
--- a/src/plugins/mpi/pmi2/spawn.c
+++ b/src/plugins/mpi/pmi2/spawn.c
@@ -356,7 +356,6 @@ spawn_resp_send_to_stepd(spawn_resp_t *resp, char *node)
 	Buf buf;
 	int rc;
 	uint16_t cmd;
-	hostlist_t hl;
 
 	buf = init_buf(1024);
 
@@ -364,11 +363,9 @@ spawn_resp_send_to_stepd(spawn_resp_t *resp, char *node)
 	pack16(cmd, buf);
 	spawn_resp_pack(resp, buf);
 
-	hl = hostlist_create(node);
-	rc = tree_msg_to_stepds(hl, 
+	rc = slurm_forward_data(&node, tree_sock_addr,
 				get_buf_offset(buf),
 				get_buf_data(buf));
-	hostlist_destroy(hl);
 	free_buf(buf);
 	return rc;
 }
@@ -483,25 +480,25 @@ _exec_srun_single(spawn_req_t *req, char **env)
 	for (i = 0; i < subcmd->info_cnt; i ++) {
 		if (0) {
 
-		} else if (! strcmp(subcmd->info_keys[i], "host")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "host")) {
 			xstrfmtcat(argv[j ++], "--nodelist=%s",
 				   subcmd->info_vals[i]);
 
-		} else if (! strcmp(subcmd->info_keys[i], "arch")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "arch")) {
 			error("mpi/pmi2: spawn info key 'arch' not supported");
 
-		} else if (! strcmp(subcmd->info_keys[i], "wdir")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "wdir")) {
 			xstrfmtcat(argv[j ++], "--chdir=%s",
 				   subcmd->info_vals[i]);
 
-		} else if (! strcmp(subcmd->info_keys[i], "path")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "path")) {
 			env_array_overwrite_fmt(&env, "PATH", "%s",
 						subcmd->info_vals[i]);
 
-		} else if (! strcmp(subcmd->info_keys[i], "file")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "file")) {
 			error("mpi/pmi2: spawn info key 'file' not supported");
 
-		} else if (! strcmp(subcmd->info_keys[i], "soft")) {
+		} else if (! xstrcmp(subcmd->info_keys[i], "soft")) {
 			error("mpi/pmi2: spawn info key 'soft' not supported");
 
 		} else {
diff --git a/src/plugins/mpi/pmi2/tree.c b/src/plugins/mpi/pmi2/tree.c
index 2aeafa4f9..62152486b 100644
--- a/src/plugins/mpi/pmi2/tree.c
+++ b/src/plugins/mpi/pmi2/tree.c
@@ -685,54 +685,6 @@ rwfail:
 	return SLURM_ERROR;
 }
 
-extern int
-tree_msg_to_stepds(hostlist_t hl, uint32_t len, char *data)
-{
-	List ret_list = NULL;
-	int temp_rc = 0, rc = 0;
-	ret_data_info_t *ret_data_info = NULL;
-	slurm_msg_t *msg = xmalloc(sizeof(slurm_msg_t));
-	forward_data_msg_t req;
-	char *nodelist = NULL;
-
-	slurm_msg_t_init(msg);
-	req.address = tree_sock_addr;
-	req.len = len;
-	req.data = data;
-
-	msg->msg_type = REQUEST_FORWARD_DATA;
-	msg->data = &req;
-
-	nodelist = hostlist_ranged_string_xmalloc(hl);
-
-	debug("tree_msg_to_stepds: send to %s", nodelist);
-
-	if ((ret_list = slurm_send_recv_msgs(nodelist, msg, 0, false))) {
-		while ((ret_data_info = list_pop(ret_list))) {
-			temp_rc = slurm_get_return_code(ret_data_info->type,
-							ret_data_info->data);
-			if (temp_rc){
-				rc = temp_rc;
-				/* This is retried outside of the function, so
-				 * don't note this as an error since it is
-				 * handled outside this function.
-				 */
-				debug("tree_msg_to_stepds: host=%s, rc = %d",
-				      ret_data_info->node_name, rc);
-			} else {
-				hostlist_delete_host(hl, ret_data_info->node_name);
-			}
-		}
-	} else {
-		error("tree_msg_to_stepds: no list was returned");
-		rc = SLURM_ERROR;
-	}
-
-	slurm_free_msg(msg);
-	xfree(nodelist);
-	return rc;
-}
-
 extern int
 tree_msg_to_spawned_sruns(uint32_t len, char *msg)
 {
diff --git a/src/plugins/mpi/pmi2/tree.h b/src/plugins/mpi/pmi2/tree.h
index ccc254c23..3a4ff6ba6 100644
--- a/src/plugins/mpi/pmi2/tree.h
+++ b/src/plugins/mpi/pmi2/tree.h
@@ -59,7 +59,6 @@ enum {
 extern int handle_tree_cmd(int fd);
 extern int tree_msg_to_srun(uint32_t len, char *msg);
 extern int tree_msg_to_srun_with_resp(uint32_t len, char *msg, Buf *resp_ptr);
-extern int tree_msg_to_stepds(hostlist_t hl, uint32_t len, char *data);
 extern int tree_msg_to_spawned_sruns(uint32_t len, char *msg);
 
 
diff --git a/src/plugins/mpi/pmix/Makefile.am b/src/plugins/mpi/pmix/Makefile.am
new file mode 100644
index 000000000..1824c992d
--- /dev/null
+++ b/src/plugins/mpi/pmix/Makefile.am
@@ -0,0 +1,22 @@
+# Makefile for mpi/pmix plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(PMIX_CPPFLAGS)
+
+pkglib_LTLIBRARIES = mpi_pmix.la 
+
+# OpenMPI MPI plugin.
+mpi_pmix_la_SOURCES = mpi_pmix.c pmixp_agent.c pmixp_client.c pmixp_coll.c pmixp_nspaces.c pmixp_info.c \
+			pmixp_server.c pmixp_state.c pmixp_io.c pmixp_utils.c pmixp_dmdx.c \
+			pmixp_agent.h pmixp_client.h pmixp_coll.h pmixp_nspaces.h pmixp_info.h \
+			pmixp_server.h pmixp_state.h pmixp_io.h pmixp_utils.h pmixp_common.h pmixp_dmdx.h
+
+mpi_pmix_la_LIBADD = \
+	$(top_builddir)/src/slurmd/common/libslurmd_reverse_tree_math.la $(PMIX_LDFLAGS) $(PMIX_LIBS)
+
+mpi_pmix_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+
+
diff --git a/src/plugins/mpi/pmix/Makefile.in b/src/plugins/mpi/pmix/Makefile.in
new file mode 100644
index 000000000..36529f290
--- /dev/null
+++ b/src/plugins/mpi/pmix/Makefile.in
@@ -0,0 +1,854 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for mpi/pmix plugin
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/mpi/pmix
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+mpi_pmix_la_DEPENDENCIES = $(top_builddir)/src/slurmd/common/libslurmd_reverse_tree_math.la \
+	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_mpi_pmix_la_OBJECTS = mpi_pmix.lo pmixp_agent.lo pmixp_client.lo \
+	pmixp_coll.lo pmixp_nspaces.lo pmixp_info.lo pmixp_server.lo \
+	pmixp_state.lo pmixp_io.lo pmixp_utils.lo pmixp_dmdx.lo
+mpi_pmix_la_OBJECTS = $(am_mpi_pmix_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+mpi_pmix_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(mpi_pmix_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(mpi_pmix_la_SOURCES)
+DIST_SOURCES = $(mpi_pmix_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/auxdir/depcomp \
+	TODO
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(PMIX_CPPFLAGS)
+pkglib_LTLIBRARIES = mpi_pmix.la 
+
+# OpenMPI MPI plugin.
+mpi_pmix_la_SOURCES = mpi_pmix.c pmixp_agent.c pmixp_client.c pmixp_coll.c pmixp_nspaces.c pmixp_info.c \
+			pmixp_server.c pmixp_state.c pmixp_io.c pmixp_utils.c pmixp_dmdx.c \
+			pmixp_agent.h pmixp_client.h pmixp_coll.h pmixp_nspaces.h pmixp_info.h \
+			pmixp_server.h pmixp_state.h pmixp_io.h pmixp_utils.h pmixp_common.h pmixp_dmdx.h
+
+mpi_pmix_la_LIBADD = \
+	$(top_builddir)/src/slurmd/common/libslurmd_reverse_tree_math.la $(PMIX_LDFLAGS) $(PMIX_LIBS)
+
+mpi_pmix_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/mpi/pmix/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/plugins/mpi/pmix/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+mpi_pmix.la: $(mpi_pmix_la_OBJECTS) $(mpi_pmix_la_DEPENDENCIES) $(EXTRA_mpi_pmix_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(mpi_pmix_la_LINK) -rpath $(pkglibdir) $(mpi_pmix_la_OBJECTS) $(mpi_pmix_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpi_pmix.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_agent.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_client.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_coll.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_dmdx.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_info.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_io.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_nspaces.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_server.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_state.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pmixp_utils.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+.PRECIOUS: Makefile
+
+
+# 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/mpi/pmix/TODO b/src/plugins/mpi/pmix/TODO
new file mode 100644
index 000000000..92c429e19
--- /dev/null
+++ b/src/plugins/mpi/pmix/TODO
@@ -0,0 +1,5 @@
+The list of things that has to be done in future
+
+1. Retrieve cpusets from SLURM and pass it to the application.
+2. Implement MPI dynamics.
+3. ...
diff --git a/src/plugins/mpi/pmix/mpi_pmix.c b/src/plugins/mpi/pmix/mpi_pmix.c
new file mode 100644
index 000000000..e3f29c711
--- /dev/null
+++ b/src/plugins/mpi/pmix/mpi_pmix.c
@@ -0,0 +1,174 @@
+/*****************************************************************************\
+ **  mpi_pmix.c - Main plugin callbacks for PMIx support in SLURM
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Y. Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#if     HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <signal.h>
+#include <sys/types.h>
+
+#include "pmixp_common.h"
+#include "pmixp_server.h"
+#include "pmixp_debug.h"
+#include "pmixp_agent.h"
+#include "pmixp_info.h"
+
+#include <pmix_server.h>
+#include <pmixp_client.h>
+
+/*
+ * These variables are required by the generic plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *      <application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "switch" for SLURM switch) and <method> is a description
+ * of how this plugin satisfies that application.  SLURM will only load
+ * a switch plugin if the plugin_type string has a prefix of "switch/".
+ *
+ * plugin_version - an unsigned 32-bit integer giving the version number
+ * of the plugin.  If major and minor revisions are desired, the major
+ * version number may be multiplied by a suitable magnitude constant such
+ * as 100 or 1000.  Various SLURM versions will likely require a certain
+ * minimum version for their plugins as this API matures.
+ */
+const char plugin_name[] = "PMIx plugin";
+const char plugin_type[] = "mpi/pmix";
+const uint32_t plugin_version = SLURM_VERSION_NUMBER;
+
+int p_mpi_hook_slurmstepd_prefork(const stepd_step_rec_t *job, char ***env)
+{
+	int ret;
+	pmixp_debug_hang(0);
+	PMIXP_DEBUG("start");
+
+	if (SLURM_SUCCESS != (ret = pmixp_stepd_init(job, env))) {
+		PMIXP_ERROR("pmixp_stepd_init() failed");
+		goto err_ext;
+	}
+	if (SLURM_SUCCESS != (ret = pmixp_agent_start())) {
+		PMIXP_ERROR("pmixp_agent_start() failed");
+		goto err_ext;
+	}
+	return SLURM_SUCCESS;
+
+err_ext:
+	/* Abort the whole job if error! */
+	slurm_kill_job_step(job->jobid, job->stepid, SIGKILL);
+	return ret;
+}
+
+int p_mpi_hook_slurmstepd_task(const mpi_plugin_task_info_t *job, char ***env)
+{
+	pmix_proc_t proc;
+	char **tmp_env = NULL;
+	pmixp_debug_hang(0);
+
+	PMIXP_DEBUG("Patch environment for task %d", job->gtaskid);
+	proc.rank = job->gtaskid;
+	strncpy(proc.nspace, pmixp_info_namespace(), PMIX_MAX_NSLEN);
+	PMIx_server_setup_fork(&proc, &tmp_env);
+	if (NULL != tmp_env) {
+		int i;
+		for (i = 0; NULL != tmp_env[i]; i++) {
+			char *value = strchr(tmp_env[i], '=');
+			if (NULL != value) {
+				*value = '\0';
+				value++;
+				env_array_overwrite(env,
+						(const char *)tmp_env[i],
+						value);
+			}
+			free(tmp_env[i]);
+		}
+		free(tmp_env);
+		tmp_env = NULL;
+	}
+	return SLURM_SUCCESS;
+}
+
+mpi_plugin_client_state_t *p_mpi_hook_client_prelaunch(
+		const mpi_plugin_client_info_t *job, char ***env)
+{
+	char *mapping = NULL;
+	PMIXP_DEBUG("setup process mapping in srun");
+	uint32_t nnodes = job->step_layout->node_cnt;
+	uint32_t ntasks = job->step_layout->task_cnt;
+	uint16_t *task_cnt = job->step_layout->tasks;
+	uint32_t **tids = job->step_layout->tids;
+	mapping = pack_process_mapping(nnodes, ntasks, task_cnt, tids);
+	if (NULL == mapping) {
+		PMIXP_ERROR("Cannot create process mapping");
+		return NULL;
+	}
+	setenvf(env, PMIXP_SLURM_MAPPING_ENV, "%s", mapping);
+	xfree(mapping);
+
+	/* only return NULL on error */
+	return (void *)0xdeadbeef;
+}
+
+int p_mpi_hook_client_single_task_per_node(void)
+{
+	return false;
+}
+
+int p_mpi_hook_client_fini(void)
+{
+	return SLURM_SUCCESS;
+}
+
+int fini(void)
+{
+	PMIXP_DEBUG("%s: call fini()", pmixp_info_hostname());
+	pmixp_agent_stop();
+	pmixp_stepd_finalize();
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/mpi/pmix/node_leader/fileops.c b/src/plugins/mpi/pmix/node_leader/fileops.c
new file mode 100644
index 000000000..bb6f54615
--- /dev/null
+++ b/src/plugins/mpi/pmix/node_leader/fileops.c
@@ -0,0 +1,251 @@
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <fcntl.h>
+extern int errno;
+#include <errno.h>
+#include <stdlib.h>
+
+
+/* Check the file and return:
+ * - 1 in case it exists
+ * - 0 if not exists
+ * - (-1) in case of unexpected error, like EPERM)
+ * if file exists is_symlink variable is set if the file
+ * is a symlink
+ */
+static int
+_file_exists(char *path)
+{
+    struct stat buf;
+
+    if (stat(path, &buf)) {
+        if (errno == ENOENT) {
+            /* OK. this symlink was removed by somebody else */
+            return 0;
+        }else{
+            fprintf(stderr,"Error while stat'ing symlink %s: %s (%d)\n",
+                    path, strerror(errno), errno);
+            return -1;
+        }
+    }
+    return 1;
+}
+
+static int
+_symlink_exists(char *path)
+{
+    struct stat buf;
+
+    if (lstat(path, &buf)) {
+        return 0;
+    }
+
+    if (!S_ISLNK(buf.st_mode)) {
+        return -1;
+    }
+    return 1;
+}
+
+static int
+_create_locked_cmd(char *path, int cmd)
+{
+    int ret = 0, fd;
+    struct flock flk;
+
+    fd = open(path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+    if (0 > fd) {
+        fprintf(stderr,"Error opening file %s: %s (%d)\n",
+                path, strerror(errno), errno);
+        return -1;
+    }
+
+
+    flk.l_whence = SEEK_SET;
+    flk.l_start = 0;
+    flk.l_len = 0;
+    flk.l_type = F_WRLCK;
+
+    do{
+        if (0 == (ret = fcntl(fd, cmd, &flk))) {
+            break;
+        } else if (EINTR != errno) {
+            fprintf(stderr,"Error locking file %s: %s (%d)\n",
+                    path, strerror(errno), errno);
+            close(fd);
+            return -errno;
+        }
+    } while(EINTR == errno);
+
+    if (0 == ret)
+        return fd;
+
+    close(fd);
+    return ret;
+}
+
+static int
+_is_locked(char *path)
+{
+    int ret, fd;
+    struct flock flk;
+    memset(&flk, 0, sizeof(flk));
+
+    fd = open(path, O_RDONLY);
+    if (0 > fd) {
+        if (EEXIST == errno) {
+            return 0;
+        } else {
+            fprintf(stderr,"Error opening file %s: %s (%d)\n",
+                    path, strerror(errno), errno);
+            return -1;
+        }
+    }
+
+    do{
+        if (0 == (ret = fcntl(fd, F_GETLK, &flk))) {
+            break;
+        }
+    } while(EINTR == errno);
+
+    if (ret) {
+        fprintf(stderr,"Error getting file lock information for %s: %s (%d)\n",
+                path, strerror(errno), errno);
+        return -1;
+    }
+
+    if (F_WRLCK == flk.l_type && SEEK_SET == flk.l_whence) {
+        return 1;
+    }
+    return 0;
+}
+
+int pmix_leader_is_alive(char *lname)
+{
+    int ret, error;
+    char fname[FILENAME_MAX] = { 0 };
+    char lock_name[FILENAME_MAX] = { 0 };
+
+    ret = _symlink_exists(lname);
+    if (0 > ret) {
+        fprintf(stderr,"Error accessing symlink %s: %d:%s\n",
+                lname, error, strerror(error));
+        return -1;
+    }
+    if (0 > readlink(lname, fname, FILENAME_MAX - 1)) {
+        if (ENOENT == errno) {
+            /* Symlink was removed between _symlink_exists & readlink */
+            return 0;
+        } else {
+            fprintf(stderr,"Error reading symlink %s: %d:%s\n",
+                    lname, error, strerror(error));
+            return -1;
+        }
+    }
+
+    snprintf(lock_name, FILENAME_MAX - 1, "%s.lock",fname);
+    ret = _file_exists(lock_name);
+    /* In case of fatal error (ret < 0) or file abscense */
+    if (0 >= ret)
+        return ret;
+    return _is_locked(lock_name);
+}
+
+void pmix_remove_leader_symlink(char *path)
+{
+    int ret, is_symlink;
+
+    /* Check prior to go further */
+    ret = _symlink_exists(path);
+    if (0 > ret) {
+        fprintf(stderr,"FATAL error\n");
+        exit(1);
+    }
+    if (0 == ret) {
+        /* File was already deleted. Nothing to do */
+        return;
+    }
+
+    char lockname[FILENAME_MAX];
+    sprintf(lockname,"%s.lock", path);
+    int fd = pmix_create_locked_wait(lockname);
+
+    /* Check prior to go further */
+    ret = _symlink_exists(path);
+    if (0 > ret) {
+        fprintf(stderr,"FATAL error\n");
+        exit(1);
+    }
+    if (0 == ret) {
+        /* File was already deleted. Nothing to do */
+        goto exit;
+    }
+
+    if (pmix_leader_is_alive(path)) {
+        /* Somebody already took care about this */
+        goto exit;
+    }
+
+    if (unlink(path)) {
+        if (ENOENT != errno) {
+            fprintf(stderr, "unlink(%s): %s", path, strerror(errno));
+            exit(1);
+        }
+    }
+
+exit:
+    close(fd);
+}
+
+int pmix_create_locked(char *path)
+{
+    return _create_locked_cmd(path, F_SETLK);
+}
+
+int pmix_create_locked_wait(char *path)
+{
+    return _create_locked_cmd(path, F_SETLKW);
+}
+
+
+#if 0
+
+#define FPREFIX "test"
+
+int main(int argc, char **argv)
+{
+    char lockfile[FILENAME_MAX], basefile[FILENAME_MAX];
+    if (2 > argc) {
+        fprintf(stderr, "Not enough parameters\n");
+        exit(0);
+    }
+
+    sprintf(basefile, FPREFIX ".%s", argv[1]);
+    sprintf(lockfile,"%s.lock",basefile);
+    if (0 > _create_locked(lockfile)) {
+        fprintf(stderr, "Cannot create personal lock file %s\n", basefile);
+        exit(0);
+    }
+
+    int fd = open(basefile,O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
+    if (fd < 0) {
+        fprintf(stderr,"Cannot create basefile\n");
+        exit(0);
+    }
+
+    while(1) {
+        if (!pmix_leader_is_alive(FPREFIX)) {
+            pmix_remove_leader_symlink(FPREFIX);
+            if (!symlink(basefile, FPREFIX)) {
+                while(1) {
+                    sleep(1);
+                }
+            }
+        }
+        sleep(1);
+    }
+}
+#endif
diff --git a/src/plugins/mpi/pmix/node_leader/fileops.h b/src/plugins/mpi/pmix/node_leader/fileops.h
new file mode 100644
index 000000000..adcaff426
--- /dev/null
+++ b/src/plugins/mpi/pmix/node_leader/fileops.h
@@ -0,0 +1,9 @@
+#ifndef FILEOPS_H
+#define FILEOPS_H
+
+int pmix_leader_is_alive(char *lname);
+void pmix_remove_leader_symlink(char *path);
+int pmix_create_locked(char *path);
+int pmix_create_locked_wait(char *path);
+
+#endif /* FILEOPS_H */
diff --git a/src/plugins/mpi/pmix/node_leader/ln_leader.c b/src/plugins/mpi/pmix/node_leader/ln_leader.c
new file mode 100644
index 000000000..5118b7390
--- /dev/null
+++ b/src/plugins/mpi/pmix/node_leader/ln_leader.c
@@ -0,0 +1,207 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+extern int errno;
+#include <string.h>
+#include <dirent.h>
+
+#include <sys/types.h>          /* See NOTES */
+#include <sys/socket.h>
+#include <unistd.h>
+#include <sys/un.h>
+#include <stdlib.h>
+#include <poll.h>
+
+#include "fileops.h"
+
+/* SLURM portability */
+#define SLURM_SUCCESS 0
+#define SLURM_ERROR 1
+/* TODO: fix */
+#define FILENAME_PREFIX "pmix_addr"
+
+typedef struct {
+    int jobid, stepid;
+} local_records_t;
+
+int my_jobid = -1;
+int my_stepid = -1;
+int sfd = -1, lockfd = -1;
+
+char linkname[FILENAME_MAX];
+char usockname[FILENAME_MAX], lockname[FILENAME_MAX];
+
+int prepare_srv_socket(char *path);
+void establish_listen_sock(int jobid, int stepid);
+
+int pid_from_usockname(char *us_name, int jobid);
+int run_discovery(int jobid, int stepid, int *is_leader);
+
+int main(int argc, char **argv)
+{
+    int is_leader;
+    if (argc < 3) {
+        fprintf(stderr,"Not enough arguments\n");
+        exit(0);
+    }
+    my_jobid = atoi(argv[1]);
+    my_stepid = atoi(argv[2]);
+    sprintf(linkname, "%s.%d", FILENAME_PREFIX, my_jobid);
+    sprintf(usockname,"%s.%d", linkname, my_stepid);
+    sprintf(lockname, "%s.lock",usockname);
+
+    if (0 > (lockfd = pmix_create_locked(lockname))) {
+        fprintf(stderr,"Can't create lock file %s\n", lockname);
+        exit(0);
+    }
+
+    sfd = prepare_srv_socket(usockname);
+
+    int i = 0;
+    while(1) {
+        int fd = run_discovery(my_jobid, my_stepid, &is_leader);
+        if (is_leader) {
+            fprintf("Iteration %d. I am the leader\n", i);
+            service_requests(fd);
+        } else {
+            monitor_leader(fd);
+            printf("server closed connection. Repeat resolution\n");
+        }
+        i++;
+    }
+}
+
+int run_discovery(int jobid, int my_stepid, int *is_leader)
+{
+    char lname[FILENAME_MAX], fname[FILENAME_MAX], fname1[FILENAME_MAX];
+
+    *is_leader = 0;
+    if (!pmix_leader_is_alive(linkname)) {
+        pmix_remove_leader_symlink(linkname);
+        if (!symlink(usockname, linkname)) {
+            *is_leader = 1;
+            return sfd;
+        }
+    }
+    return connect_to_server(linkname);
+}
+
+
+int prepare_srv_socket(char *path)
+{
+    static struct sockaddr_un sa;
+    int ret = 0;
+
+    /* Make sure that socket file doesn't exists */
+    if (0 == access(path, F_OK)) {
+        /* remove old file */
+        if (0 != unlink(path)) {
+            /*PMIXP_ERROR_STD*/
+            printf("Cannot delete outdated socket fine: %s",
+                    path);
+            return SLURM_ERROR;
+        }
+    }
+
+    if (strlen(path) >= sizeof(sa.sun_path)) {
+        /*PMIXP_ERROR_STD*/
+        printf("UNIX socket path is too long: %lu, max %lu",
+                (unsigned long)strlen(path),
+                (unsigned long)sizeof(sa.sun_path)-1);
+        return SLURM_ERROR;
+    }
+
+    int fd = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (fd < 0) {
+        /*PMIXP_ERROR_STD*/
+        printf("Cannot create UNIX socket");
+        return SLURM_ERROR;
+    }
+
+    memset(&sa, 0, sizeof(sa));
+    sa.sun_family = AF_UNIX;
+    strcpy(sa.sun_path, path);
+    if (ret = bind(fd, (struct sockaddr*)&sa, SUN_LEN(&sa))) {
+        /*PMIXP_ERROR_STD*/
+        printf("Cannot bind() UNIX socket %s", path);
+        goto err_fd;
+    }
+
+    if ((ret = listen(fd, 64))) {
+        /*PMIXP_ERROR_STD*/
+        printf("Cannot listen(%d, 64) UNIX socket %s", fd, path);
+        goto err_bind;
+    }
+    return fd;
+
+err_bind:
+    unlink(path);
+err_fd:
+    close(fd);
+    return ret;
+}
+
+int connect_to_server(char *path)
+{
+    static struct sockaddr_un sa;
+    memset(&sa, 0, sizeof(sa));
+    sa.sun_family = AF_UNIX;
+    strcpy(sa.sun_path, path);
+
+    int fd = socket(AF_UNIX, SOCK_STREAM, 0);
+    if (fd < 0) {
+        fprintf(stderr,"Cannot create UNIX socket");
+        return -1;
+    }
+
+    if (connect(fd, &sa, SUN_LEN(&sa))) {
+        close(fd);
+        return -1;
+    }
+    local_records_t rec;
+    rec.jobid = my_jobid;
+    rec.stepid = my_stepid;
+    int ret = write(fd, &rec, sizeof(rec));
+    if (sizeof(rec) != ret) {
+        close(fd);
+        return -1;
+    }
+    return fd;
+}
+
+void service_requests(int fd)
+{
+    while(1) {
+        int cfd;
+        if (0 < (cfd = accept(fd, NULL, 0))) {
+            local_records_t rec;
+            int ret = read(cfd, &rec, sizeof(rec));
+            if (ret != sizeof(rec)) {
+                fprintf("%s:%d: read mismatch: %d vs %d\n",
+                        __FILE__, __LINE__, ret, sizeof(rec));
+                exit(0);
+            }
+            fprintf(stderr,"New client connected: jobid=%d, stepid=%d, fd = %d\n",
+                   rec.jobid, rec.stepid, fd);
+        }
+    }
+}
+
+void monitor_leader(int fd)
+{
+    struct pollfd fds;
+    fds.fd = fd;
+    fds.events = 0;
+
+    /* Drop shutdown before the check */
+
+    int rc = poll(&fds, 1, -1);
+    if (rc < 0) {
+        fprintf(stderr,"Get poll error %d: %s", errno, strerror(errno));
+        exit(1);
+    }
+    if (fds.revents != POLLHUP) {
+        fprintf(stderr,"revents = %x", fds.revents);
+    }
+}
diff --git a/src/plugins/mpi/pmix/pmixp_agent.c b/src/plugins/mpi/pmix/pmixp_agent.c
new file mode 100644
index 000000000..a126fe74a
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_agent.c
@@ -0,0 +1,368 @@
+/*****************************************************************************\
+ **  pmix_agent.c - PMIx agent thread
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Y. Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include <pthread.h>
+#include <sched.h>
+#include <poll.h>
+#include <arpa/inet.h>
+#include <time.h>
+
+#include "pmixp_common.h"
+#include "pmixp_server.h"
+#include "pmixp_client.h"
+#include "pmixp_state.h"
+#include "pmixp_debug.h"
+#include "pmixp_nspaces.h"
+#include "pmixp_utils.h"
+
+#define MAX_RETRIES 5
+
+static int _agent_is_running = 0;
+static int _timer_is_running = 0;
+static eio_handle_t *_io_handle = NULL;
+
+static int _agent_spawned = 0, _timer_spawned = 0;
+static pthread_t _agent_tid = 0;
+static pthread_t _timer_tid = 0;
+
+struct timer_data_t {
+	int initialized;
+	int work_in, work_out;
+	int stop_in, stop_out;
+};
+static struct timer_data_t timer_data;
+
+static bool _conn_readable(eio_obj_t *obj);
+static int _server_conn_read(eio_obj_t *obj, List objs);
+static int _timer_conn_read(eio_obj_t *obj, List objs);
+static struct io_operations srv_ops = {
+	.readable = &_conn_readable,
+	.handle_read = &_server_conn_read
+};
+
+static struct io_operations to_ops = {
+	.readable = &_conn_readable,
+	.handle_read = &_timer_conn_read
+};
+
+static bool _conn_readable(eio_obj_t *obj)
+{
+	PMIXP_DEBUG("fd = %d", obj->fd);
+	if (obj->shutdown == true) {
+		if (obj->fd != -1) {
+			close(obj->fd);
+			obj->fd = -1;
+		}
+		PMIXP_DEBUG("    false, shutdown");
+		return false;
+	}
+	return true;
+}
+
+static int _server_conn_read(eio_obj_t *obj, List objs)
+{
+	int fd;
+	struct sockaddr addr;
+	socklen_t size = sizeof(addr);
+	int shutdown = 0;
+
+	PMIXP_DEBUG("fd = %d", obj->fd);
+
+	while (1) {
+		/* Return early if fd is not now ready */
+		if (!pmixp_fd_read_ready(obj->fd, &shutdown)) {
+			if (shutdown) {
+				obj->shutdown = true;
+				if (shutdown < 0) {
+					PMIXP_ERROR_NO(shutdown, "sd=%d failure", obj->fd);
+				}
+			}
+			return 0;
+		}
+
+		while ((fd = accept(obj->fd, &addr, &size)) < 0) {
+			if (errno == EINTR)
+				continue;
+			if (errno == EAGAIN) /* No more connections */
+				return 0;
+			if ((errno == ECONNABORTED) || (errno == EWOULDBLOCK)) {
+				return 0;
+			}
+			PMIXP_ERROR_STD("accept()ing connection sd=%d", obj->fd);
+			return 0;
+		}
+
+		PMIXP_DEBUG("accepted connection: sd=%d", fd);
+		/* read command from socket and handle it */
+		pmix_server_new_conn(fd);
+	}
+	return 0;
+}
+
+static int _timer_conn_read(eio_obj_t *obj, List objs)
+{
+	char *tmpbuf[32];
+	int shutdown;
+	PMIXP_DEBUG("Timeout thread, fd = %d", obj->fd);
+
+	/* drain everything from in fd */
+	while (32 == pmixp_read_buf(obj->fd, tmpbuf, 32, &shutdown, false))
+		;
+	if (shutdown) {
+		PMIXP_ERROR("readin from timer fd, shouldn't happen");
+		obj->shutdown = true;
+	}
+
+	/* check direct modex requests */
+	pmixp_dmdx_timeout_cleanup();
+
+	/* check collective statuses */
+	pmixp_state_coll_cleanup();
+
+	return 0;
+}
+
+static void _shutdown_timeout_fds(void);
+
+#define SETUP_FDS(fds) { \
+	fd_set_nonblocking(fds[0]);	\
+	fd_set_close_on_exec(fds[0]);	\
+	fd_set_nonblocking(fds[1]);	\
+	fd_set_close_on_exec(fds[1]);	\
+	}
+
+static int _setup_timeout_fds(void)
+{
+	int fds[2];
+
+	timer_data.work_in = timer_data.work_out = -1;
+	timer_data.stop_in = timer_data.stop_out = -1;
+
+	if (pipe(fds)) {
+		return SLURM_ERROR;
+	}
+	SETUP_FDS(fds);
+	timer_data.work_in = fds[0];
+	timer_data.work_out = fds[1];
+
+	if (pipe(fds)) {
+		_shutdown_timeout_fds();
+		return SLURM_ERROR;
+	}
+	SETUP_FDS(fds);
+	timer_data.stop_in = fds[0];
+	timer_data.stop_out = fds[1];
+
+	timer_data.initialized = 1;
+
+	return SLURM_SUCCESS;
+}
+
+static void _shutdown_timeout_fds(void)
+{
+	if (0 <= timer_data.work_in) {
+		close(timer_data.work_in);
+		timer_data.work_in = -1;
+	}
+	if (0 <= timer_data.work_out) {
+		close(timer_data.work_out);
+		timer_data.work_out = -1;
+	}
+	if (0 <= timer_data.stop_in) {
+		close(timer_data.stop_in);
+		timer_data.stop_in = -1;
+	}
+	if (0 <= timer_data.stop_out) {
+		close(timer_data.stop_out);
+		timer_data.stop_out = -1;
+	}
+}
+
+/*
+ * main loop of agent thread
+ */
+static void *_agent_thread(void *unused)
+{
+	PMIXP_DEBUG("Start agent thread");
+	eio_obj_t *obj;
+	int preval;
+
+	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &preval);
+	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &preval);
+
+	_io_handle = eio_handle_create(0);
+
+	obj = eio_obj_create(pmixp_info_srv_fd(), &srv_ops, (void *)(-1));
+	eio_new_initial_obj(_io_handle, obj);
+
+	obj = eio_obj_create(timer_data.work_in, &to_ops, (void *)(-1));
+	eio_new_initial_obj(_io_handle, obj);
+
+	pmixp_info_io_set(_io_handle);
+
+	_agent_is_running = 1;
+
+	eio_handle_mainloop(_io_handle);
+
+	PMIXP_DEBUG("agent thread exit");
+	eio_handle_destroy(_io_handle);
+
+	_agent_is_running = 0;
+	return NULL;
+}
+
+static void *_pmix_timer_thread(void *unused)
+{
+	struct pollfd pfds[1];
+	int preval;
+
+	pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &preval);
+	pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &preval);
+
+	PMIXP_DEBUG("Start timer thread");
+
+	pfds[0].fd = timer_data.stop_in;
+	pfds[0].events = POLLIN;
+
+	_timer_is_running = 1;
+
+	/* our job is to sleep 1 sec and then trigger
+	 * the timer event in the main loop */
+
+	while (1) {
+		/* during normal operation there should be no
+		 * activity on the stop fd.
+		 * So normally we need to exit by the timeout.
+		 * This forses periodic timer events (once each second) */
+		int ret = poll(pfds, 1, 1000);
+		char c = 1;
+		if (0 < ret) {
+			/* there was an event on stop_fd, exit */
+			break;
+		}
+		/* activate main thread's timer event */
+		write(timer_data.work_out, &c, 1);
+	}
+
+	_timer_is_running = 0;
+
+	return NULL;
+}
+
+int pmixp_agent_start(void)
+{
+	int retries = 0;
+	pthread_attr_t attr;
+
+	_setup_timeout_fds();
+
+	slurm_attr_init(&attr);
+
+	/* start agent thread */
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+	while ((errno = pthread_create(&_agent_tid, &attr, _agent_thread, NULL))) {
+		if (++retries > MAX_RETRIES) {
+			PMIXP_ERROR_STD("pthread_create error");
+			slurm_attr_destroy(&attr);
+			return SLURM_ERROR;
+		}
+		sleep(1);
+	}
+	_agent_spawned = 1;
+
+	/* wait for the agent thread to initialize */
+	while (!_agent_is_running) {
+		sched_yield();
+	}
+
+	PMIXP_DEBUG("agent thread started: tid = %lu",
+			(unsigned long) _agent_tid);
+
+	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+	while ((errno = pthread_create(&_timer_tid, &attr, _pmix_timer_thread,
+			NULL))) {
+		if (++retries > MAX_RETRIES) {
+			PMIXP_ERROR_STD("pthread_create error");
+			slurm_attr_destroy(&attr);
+			return SLURM_ERROR;
+		}
+		sleep(1);
+	}
+	_timer_spawned = 1;
+
+	/* wait for the agent thread to initialize */
+	while (!_timer_is_running) {
+		sched_yield();
+	}
+
+	slurm_attr_destroy(&attr);
+
+	PMIXP_DEBUG("timer thread started: tid = %lu",
+			(unsigned long) _timer_tid);
+
+	return SLURM_SUCCESS;
+}
+
+int pmixp_agent_stop(void)
+{
+	char c = 1;
+	if (_agent_is_running) {
+		eio_signal_shutdown(_io_handle);
+		/* wait for the agent thread to stop */
+		while (_agent_is_running) {
+			sched_yield();
+		}
+	}
+	if (_agent_spawned) {
+		pthread_cancel(_agent_tid);
+	}
+
+	if (timer_data.initialized) {
+		/* cancel timer */
+		write(timer_data.stop_out, &c, 1);
+		while (_timer_is_running) {
+			sched_yield();
+		}
+		/* close timer fds */
+		_shutdown_timeout_fds();
+	}
+
+	if (_timer_spawned) {
+		pthread_cancel(_timer_tid);
+	}
+	return SLURM_SUCCESS;
+}
diff --git a/src/slurmdbd/agent.c b/src/plugins/mpi/pmix/pmixp_agent.h
similarity index 78%
rename from src/slurmdbd/agent.c
rename to src/plugins/mpi/pmix/pmixp_agent.h
index a9383d102..c57ad3822 100644
--- a/src/slurmdbd/agent.c
+++ b/src/plugins/mpi/pmix/pmixp_agent.h
@@ -1,11 +1,9 @@
 /*****************************************************************************\
- *  agent.c - functions for queued requests
+ **  pmix_agent.h - PMIx agent thread
  *****************************************************************************
- *  Copyright (C) 2002-2007 The Regents of the University of California.
- *  Copyright (C) 2008 Lawrence Livermore National Security.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Morris Jette <jette1@llnl.gov>
- *  CODE-OCEC-09-009. All rights reserved.
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Y. Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
  *
  *  This file is part of SLURM, a resource management program.
  *  For details, see <http://slurm.schedmd.com/>.
@@ -35,4 +33,14 @@
  *  You should have received a copy of the GNU General Public License along
  *  with SLURM; if not, write to the Free Software Foundation, Inc.,
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
+ \*****************************************************************************/
+
+#ifndef PMIXP_AGENT_H
+#define PMIXP_AGENT_H
+
+#include "pmixp_common.h"
+
+int pmixp_agent_start(void);
+int pmixp_agent_stop(void);
+
+#endif /* PMIXP_AGENT_H */
diff --git a/src/plugins/mpi/pmix/pmixp_client.c b/src/plugins/mpi/pmix/pmixp_client.c
new file mode 100644
index 000000000..cf04dc6e6
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_client.c
@@ -0,0 +1,716 @@
+/*****************************************************************************\
+ **  pmix_client.c - PMIx client communication code
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "pmixp_state.h"
+#include "pmixp_io.h"
+#include "pmixp_nspaces.h"
+#include "pmixp_debug.h"
+#include "pmixp_coll.h"
+#include "pmixp_server.h"
+#include "pmixp_dmdx.h"
+
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <pmix_server.h>
+
+#define PMIXP_ALLOC_KEY(kvp, key_str)				\
+{								\
+	char *key = key_str;					\
+	kvp = (pmix_info_t *)xmalloc(sizeof(pmix_info_t));	\
+	(void)strncpy(kvp->key, key, PMIX_MAX_KEYLEN);		\
+}
+
+#define PMIXP_FREE_KEY(kvp)				\
+{								\
+	xfree(kvp);						\
+}
+
+static int client_connected(const pmix_proc_t *proc, void *server_object)
+{
+	/* we don't do anything by now */
+	return PMIX_SUCCESS;
+}
+
+static void op_callbk(pmix_status_t status, void *cbdata)
+{
+	PMIXP_DEBUG("op callback is called with status=%d", status);
+}
+
+static void errhandler_reg_callbk(pmix_status_t status, int errhandler_ref,
+		void *cbdata)
+{
+	PMIXP_DEBUG("Error handler registration callback is called with status=%d, ref=%d",
+		    status, errhandler_ref);
+}
+
+static pmix_status_t client_finalized(const pmix_proc_t *proc,
+		void *server_object, pmix_op_cbfunc_t cbfunc, void *cbdata)
+{
+	/* don'n do anything by now */
+	if (NULL != cbfunc) {
+		cbfunc(PMIX_SUCCESS, cbdata);
+	}
+	return PMIX_SUCCESS;
+}
+
+static pmix_status_t
+abort_fn(const pmix_proc_t *proc, void *server_object, int status,
+		const char msg[], pmix_proc_t procs[], size_t nprocs,
+		pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
+	   const pmix_info_t info[], size_t ninfo,
+	   char *data, size_t ndata,
+	   pmix_modex_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+dmodex_fn(const pmix_proc_t *proc,
+	  const pmix_info_t info[], size_t ninfo,
+		pmix_modex_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+publish_fn(const pmix_proc_t *proc,
+	   const pmix_info_t info[], size_t ninfo,
+		pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+lookup_fn(const pmix_proc_t *proc, char **keys,
+	  const pmix_info_t info[], size_t ninfo,
+	  pmix_lookup_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+unpublish_fn(const pmix_proc_t *proc, char **keys,
+	     const pmix_info_t info[], size_t ninfo,
+	     pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+spawn_fn(const pmix_proc_t *proc,
+	 const pmix_info_t job_info[], size_t ninfo,
+		const pmix_app_t apps[], size_t napps,
+		pmix_spawn_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+connect_fn(const pmix_proc_t procs[], size_t nprocs,
+	   const pmix_info_t info[], size_t ninfo,
+	   pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+static pmix_status_t
+disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
+	      const pmix_info_t info[], size_t ninfo,
+	      pmix_op_cbfunc_t cbfunc, void *cbdata);
+
+pmix_server_module_t _slurm_pmix_cb = {
+	client_connected,
+	client_finalized,
+	abort_fn,
+	fencenb_fn,
+	dmodex_fn,
+	publish_fn,
+	lookup_fn,
+	unpublish_fn,
+	spawn_fn,
+	connect_fn,
+	disconnect_fn,
+	NULL,
+	NULL
+};
+
+static void errhandler(pmix_status_t status, pmix_proc_t proc[], size_t nproc,
+		pmix_info_t info[], size_t ninfo);
+
+int pmixp_libpmix_init(void)
+{
+	int rc;
+	mode_t rights = (S_IRUSR | S_IWUSR | S_IXUSR) | (S_IRGRP | S_IWGRP | S_IXGRP);
+	pmix_info_t *kvp;
+
+	/* NOTE: we need user who owns the job to access PMIx usock
+	 * file. According to 'man 7 unix':
+	 * "... In the Linux implementation, sockets which are visible in the file system
+	 * honor the permissions of the directory  they are  in... "
+	 * Our case is the following: slurmstepd is usually running as root, user application will
+	 * be "sudo'ed". To provide both of them with acces to the unix socket we do the following:
+	 * 1. Owner ID is set to the job owner.
+	 * 2. Group ID corresponds to slurmstepd.
+	 * 3. Set 0770 access mode */
+	if (0 != mkdir(pmixp_info_tmpdir_lib(), rights) ) {
+		PMIXP_ERROR_STD("Cannot create directory \"%s\"", pmixp_info_tmpdir_lib());
+		return errno;
+	}
+
+	/* There might be umask that will drop essential rights. Fix it explicitly.
+	 * TODO: is there more elegant solution? */
+	if (chmod(pmixp_info_tmpdir_lib(), rights) < 0) {
+		error("chown(%s): %m", pmixp_info_tmpdir_lib());
+		return errno;
+	}
+
+	if (chown(pmixp_info_tmpdir_lib(), (uid_t) pmixp_info_jobuid(), (gid_t) -1) < 0) {
+		error("chown(%s): %m", pmixp_info_tmpdir_lib());
+		return errno;
+	}
+	
+	setenv(PMIXP_PMIXLIB_TMPDIR, pmixp_info_tmpdir_lib(), 1);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_USERID);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_jobuid());
+
+	/* setup the server library */
+	if (PMIX_SUCCESS != (rc = PMIx_server_init(&_slurm_pmix_cb, kvp, 1))) {
+		PMIXP_ERROR_STD("PMIx_server_init failed with error %d\n", rc);
+		return SLURM_ERROR;
+	}
+
+	PMIXP_FREE_KEY(kvp);
+	
+	/*
+	if( pmixp_fixrights(pmixp_info_tmpdir_lib(),
+		(uid_t) pmixp_info_jobuid(), rights) ){
+	}
+	*/
+
+	/* register the errhandler */
+	PMIx_Register_errhandler(NULL, 0, errhandler, errhandler_reg_callbk,
+			NULL);
+
+	return 0;
+}
+
+int pmixp_libpmix_finalize(void)
+{
+	int rc = SLURM_SUCCESS, rc1;
+
+	/* deregister the errhandler */
+	PMIx_Deregister_errhandler(0, op_callbk, NULL);
+
+	if (PMIX_SUCCESS != PMIx_server_finalize()) {
+		rc = SLURM_ERROR;
+	}
+
+	rc1 = pmixp_rmdir_recursively(pmixp_info_tmpdir_lib());
+	if (0 == rc) {
+		/* return only one error :) */
+		rc = rc1;
+	}
+	return rc;
+}
+
+static void errhandler(pmix_status_t status,
+		       pmix_proc_t proc[], size_t nproc,
+		       pmix_info_t info[], size_t ninfo)
+{
+	/* TODO: do something more sophisticated here */
+	/* FIXME: use proper specificator for nranges */
+	PMIXP_ERROR_STD("Error handler invoked: status = %d, nranges = %d",
+			status, (int) nproc);
+	slurm_kill_job_step(pmixp_info_jobid(), pmixp_info_stepid(), SIGKILL);
+}
+
+/*
+ * general proc-level attributes
+ */
+static void _general_proc_info(List lresp)
+{
+	pmix_info_t *kvp;
+	/*      TODO: how can we get this information in SLURM?
+	 *      PMIXP_ALLOC_KEY(kvp, PMIX_CPUSET);
+	 *      PMIX_VAL_SET(&kvp->value, string, "");
+	 *      list_append(lresp, kvp);
+	 *      TODO: what should we provide for credentials?
+	 *      #define PMIX_CREDENTIAL            "pmix.cred"
+	 *      TODO: Once spawn will be implemented we'll need to check here
+	 */
+	 PMIXP_ALLOC_KEY(kvp, PMIX_SPAWNED);
+	 PMIX_VAL_SET(&kvp->value, flag, 0);
+	 list_append(lresp, kvp);
+
+	 /*
+	 *       TODO: what is the portable way to get arch string?
+	 *       #define PMIX_ARCH                  "pmix.arch"
+	 */
+}
+
+/*
+ * scratch directory locations for use by applications
+ */
+static void _set_tmpdirs(List lresp)
+{
+	pmix_info_t *kvp;
+	char *p = NULL;
+
+	/* We consider two sources of the tempdir:
+	 * - SLURM's slurm.conf TmpFS option;
+	 * - env var SLURM_PMIX_TMPDIR;
+	 * do we need to do anything else?
+	 */
+	p = pmixp_info_tmpdir_cli();
+	if (NULL == p) {
+		p = PMIXP_TMPDIR_DEFAULT;
+	}
+	PMIXP_ALLOC_KEY(kvp, PMIX_TMPDIR);
+	PMIX_VAL_SET(&kvp->value, string, p);
+	list_append(lresp, kvp);
+	PMIXP_ALLOC_KEY(kvp, PMIX_NSDIR);
+	PMIX_VAL_SET(&kvp->value, string, p);
+	list_append(lresp, kvp);
+	PMIXP_ALLOC_KEY(kvp, PMIX_PROCDIR);
+	PMIX_VAL_SET(&kvp->value, string, p);
+	list_append(lresp, kvp);
+}
+
+/*
+ * information about relative ranks as assigned by the RM
+ */
+static void _set_procdatas(List lresp)
+{
+	pmixp_namespace_t *nsptr = pmixp_nspaces_local();
+	pmix_info_t *kvp, *tkvp;
+	char *p = NULL;
+	int i;
+
+	/* (char*) jobid assigned by scheduler */
+	xstrfmtcat(p, "%d.%d", pmixp_info_jobid(), pmixp_info_stepid());
+	PMIXP_ALLOC_KEY(kvp, PMIX_JOBID);
+	PMIX_VAL_SET(&kvp->value, string, p);
+	xfree(p);
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_NODEID);
+	PMIX_VAL_SET(&kvp->value, uint32_t, nsptr->node_id);
+	list_append(lresp, kvp);
+
+	/* store information about local processes */
+	for (i = 0; i < pmixp_info_tasks(); i++) {
+		List rankinfo;
+		ListIterator it;
+		int count, j, localid, nodeid;
+		char *nodename;
+		pmix_info_t *info;
+
+		rankinfo = list_create(pmixp_xfree_xmalloced);
+
+		PMIXP_ALLOC_KEY(kvp, PMIX_RANK);
+		PMIX_VAL_SET(&kvp->value, int, i);
+		list_append(rankinfo, kvp);
+
+		/* TODO: always use 0 so far. this is not the general case though
+		 * (see SLURM MIMD: man srun, section MULTIPLE PROGRAM CONFIGURATION)
+		 */
+		PMIXP_ALLOC_KEY(kvp, PMIX_APPNUM);
+		PMIX_VAL_SET(&kvp->value, int, 0);
+		list_append(rankinfo, kvp);
+
+		/* TODO: the same as for previous here */
+		PMIXP_ALLOC_KEY(kvp, PMIX_APPLDR);
+		PMIX_VAL_SET(&kvp->value, int, 0);
+		list_append(rankinfo, kvp);
+
+		/* TODO: fix when several apps will appear */
+		PMIXP_ALLOC_KEY(kvp, PMIX_GLOBAL_RANK);
+		PMIX_VAL_SET(&kvp->value, uint32_t, i);
+		list_append(rankinfo, kvp);
+
+		/* TODO: fix when several apps will appear */
+		PMIXP_ALLOC_KEY(kvp, PMIX_APP_RANK);
+		PMIX_VAL_SET(&kvp->value, uint32_t, i);
+		list_append(rankinfo, kvp);
+
+		localid = pmixp_info_taskid2localid(i);
+		/* this rank is local, store local info ab't it! */
+		if (0 <= localid) {
+			PMIXP_ALLOC_KEY(kvp, PMIX_LOCAL_RANK);
+			PMIX_VAL_SET(&kvp->value, uint16_t, localid);
+			list_append(rankinfo, kvp);
+
+			/* TODO: fix when several apps will appear */
+			PMIXP_ALLOC_KEY(kvp, PMIX_NODE_RANK);
+			PMIX_VAL_SET(&kvp->value, uint16_t, localid);
+			list_append(rankinfo, kvp);
+		}
+
+		nodeid = nsptr->task_map[i];
+		nodename = hostlist_nth(nsptr->hl, nodeid);
+		PMIXP_ALLOC_KEY(kvp, PMIX_HOSTNAME);
+		PMIX_VAL_SET(&kvp->value, string, nodename);
+		list_append(rankinfo, kvp);
+		free(nodename);
+
+		/* merge rankinfo into one PMIX_PROC_DATA key */
+		count = list_count(rankinfo);
+		PMIXP_ALLOC_KEY(kvp, PMIX_PROC_DATA);
+		kvp->value.type = PMIX_INFO_ARRAY;
+		kvp->value.data.array.size = count;
+		PMIX_INFO_CREATE(info, count);
+		it = list_iterator_create(rankinfo);
+		j = 0;
+		while (NULL != (tkvp = list_next(it))) {
+			/* Just copy all the fields here. We will free original kvp's
+			 * using list_destroy without free'ing their fields so it is
+			 * safe to do so.
+			 */
+			info[j] = *tkvp;
+			j++;
+		}
+		list_destroy(rankinfo);
+
+		kvp->value.data.array.array = (pmix_info_t *)info;
+		info = NULL;
+
+		/* put the complex key to the list */
+		list_append(lresp, kvp);
+	}
+}
+
+static void _set_sizeinfo(List lresp)
+{
+	pmix_info_t *kvp;
+	/* size information */
+	PMIXP_ALLOC_KEY(kvp, PMIX_UNIV_SIZE);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_tasks_uni());
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_JOB_SIZE);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_tasks());
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_LOCAL_SIZE);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_tasks_loc());
+	list_append(lresp, kvp);
+
+	/* TODO: fix it in future */
+	PMIXP_ALLOC_KEY(kvp, PMIX_NODE_SIZE);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_tasks_loc());
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_MAX_PROCS);
+	PMIX_VAL_SET(&kvp->value, uint32_t, pmixp_info_tasks_uni());
+	list_append(lresp, kvp);
+
+}
+
+static int _set_mapsinfo(List lresp)
+{
+	pmix_info_t *kvp;
+	char *regexp, *input;
+	pmixp_namespace_t *nsptr = pmixp_nspaces_local();
+	hostlist_t hl = nsptr->hl;
+	int rc, i, j;
+	int count = hostlist_count(hl);
+
+	input = hostlist_deranged_string_malloc(hl);
+	rc = PMIx_generate_regex(input, &regexp);
+	free(input);
+	if (PMIX_SUCCESS != rc) {
+		return SLURM_ERROR;
+	}
+	PMIXP_ALLOC_KEY(kvp, PMIX_NODE_MAP);
+	PMIX_VAL_SET(&kvp->value, string, regexp);
+	regexp = NULL;
+	list_append(lresp, kvp);
+
+	input = NULL;
+	for (i = 0; i < count; i++) {
+		/* for each node - run through all tasks and
+		 * record taskid's that reside on this node
+		 */
+		int first = 1;
+		for (j = 0; j < nsptr->ntasks; j++) {
+			if (nsptr->task_map[j] == i) {
+				if (first) {
+					first = 0;
+				} else {
+					xstrfmtcat(input, ",");
+				}
+				xstrfmtcat(input, "%u", j);
+			}
+		}
+		if (i < (count - 1)) {
+			xstrfmtcat(input, ";");
+		}
+	}
+	rc = PMIx_generate_ppn(input, &regexp);
+	xfree(input);
+	if (PMIX_SUCCESS != rc) {
+		return SLURM_ERROR;
+	}
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_PROC_MAP);
+	PMIX_VAL_SET(&kvp->value, string, regexp);
+	regexp = NULL;
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_ANL_MAP);
+	PMIX_VAL_SET(&kvp->value, string, pmixp_info_task_map());
+	regexp = NULL;
+	list_append(lresp, kvp);
+
+	return SLURM_SUCCESS;
+}
+
+static void _set_localinfo(List lresp)
+{
+	pmix_info_t *kvp;
+	uint32_t tmp;
+	char *p = NULL;
+	int i;
+
+	xstrfmtcat(p, "%u", pmixp_info_taskid(0));
+	tmp = pmixp_info_taskid(0);
+	for (i = 1; i < pmixp_info_tasks_loc(); i++) {
+		uint32_t rank = pmixp_info_taskid(i);
+		xstrfmtcat(p, ",%u", rank);
+		if (tmp > rank) {
+			tmp = rank;
+		}
+	}
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_LOCAL_PEERS);
+	PMIX_VAL_SET(&kvp->value, string, p);
+	xfree(p);
+	list_append(lresp, kvp);
+
+	PMIXP_ALLOC_KEY(kvp, PMIX_LOCALLDR);
+	PMIX_VAL_SET(&kvp->value, uint32_t, tmp);
+	list_append(lresp, kvp);
+}
+
+typedef struct {
+	volatile int active;
+} _register_caddy_t;
+
+static void _release_cb(pmix_status_t status, void *cbdata)
+{
+	(void)status;
+	_register_caddy_t *caddy = (_register_caddy_t *)cbdata;
+	caddy->active = 0;
+}
+
+int pmixp_libpmix_job_set(void)
+{
+	List lresp;
+	pmix_info_t *info;
+	int ninfo;
+	ListIterator it;
+	pmix_info_t *kvp;
+
+	int i, rc;
+	uid_t uid = pmixp_info_jobuid();
+	gid_t gid = pmixp_info_jobgid();
+	_register_caddy_t *register_caddy;
+
+	register_caddy = xmalloc(sizeof(_register_caddy_t)*(pmixp_info_tasks_loc()+1));
+	pmixp_debug_hang(0);
+
+	/* Use list to safely expand/reduce key-value pairs. */
+	lresp = list_create(pmixp_xfree_xmalloced);
+
+	_general_proc_info(lresp);
+
+	_set_tmpdirs(lresp);
+
+	_set_procdatas(lresp);
+
+	_set_sizeinfo(lresp);
+
+	if (SLURM_SUCCESS != _set_mapsinfo(lresp)) {
+		list_destroy(lresp);
+		PMIXP_ERROR("Can't build nodemap");
+		return SLURM_ERROR;
+	}
+
+	_set_localinfo(lresp);
+
+	ninfo = list_count(lresp);
+	PMIX_INFO_CREATE(info, ninfo);
+	it = list_iterator_create(lresp);
+	i = 0;
+	while (NULL != (kvp = list_next(it))) {
+		info[i] = *kvp;
+		i++;
+	}
+	list_destroy(lresp);
+
+	register_caddy[0].active = 1;
+	rc = PMIx_server_register_nspace(pmixp_info_namespace(),
+			pmixp_info_tasks_loc(), info, ninfo, _release_cb,
+			&register_caddy[0]);
+
+	if (PMIX_SUCCESS != rc) {
+		PMIXP_ERROR("Cannot register namespace %s, nlocalproc=%d, "
+			    "ninfo = %d", pmixp_info_namespace(),
+			    pmixp_info_tasks_loc(), ninfo);
+		return SLURM_ERROR;
+	}
+
+	PMIXP_DEBUG("task initialization");
+	for (i = 0; i < pmixp_info_tasks_loc(); i++) {
+		pmix_proc_t proc;
+		register_caddy[i+1].active = 1;
+		strncpy(proc.nspace, pmixp_info_namespace(), PMIX_MAX_NSLEN);
+		proc.rank = pmixp_info_taskid(i);
+		rc = PMIx_server_register_client(&proc, uid, gid, NULL,
+				_release_cb, &register_caddy[i + 1]);
+		if (PMIX_SUCCESS != rc) {
+			PMIXP_ERROR("Cannot register client %d(%d) in namespace %s",
+				    pmixp_info_taskid(i), i,
+				    pmixp_info_namespace());
+			return SLURM_ERROR;
+		}
+	}
+
+	/* wait for all registration actions to finish */
+	while( 1 ){
+		int exit_flag = 1;
+		struct timespec ts;
+		ts.tv_sec = 0;
+		ts.tv_nsec = 100;
+
+		for(i=0; i <  pmixp_info_tasks_loc() + 1; i++){
+			if( register_caddy[i].active ){
+				exit_flag = 0;
+			}
+		}
+		if( exit_flag ){
+			break;
+		}
+		nanosleep(&ts, NULL);
+	}
+	PMIX_INFO_FREE(info, ninfo);
+	xfree(register_caddy);
+
+	return SLURM_SUCCESS;
+}
+
+static pmix_status_t abort_fn(const pmix_proc_t *proc, void *server_object,
+			      int status, const char msg[], pmix_proc_t procs[],
+			      size_t nprocs, pmix_op_cbfunc_t cbfunc, void *cbdata)
+{
+	/* Just kill this stepid for now. Think what we can do for FT here? */
+	PMIXP_DEBUG("called: status = %d, msg = %s", status, msg);
+	slurm_kill_job_step(pmixp_info_jobid(), pmixp_info_stepid(), SIGKILL);
+
+	if (NULL != cbfunc) {
+		cbfunc(PMIX_SUCCESS, cbdata);
+	}
+	return PMIX_SUCCESS;
+}
+
+pmix_status_t fencenb_fn(const pmix_proc_t procs[], size_t nprocs,
+			 const pmix_info_t info[], size_t ninfo,
+			 char *data, size_t ndata,
+			 pmix_modex_cbfunc_t cbfunc, void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	pmixp_coll_t *coll;
+	pmixp_coll_type_t type = PMIXP_COLL_TYPE_FENCE;
+	pmix_status_t status = PMIX_SUCCESS;
+
+	pmixp_debug_hang(0);
+
+	coll = pmixp_state_coll_get(type, procs, nprocs);
+	pmixp_coll_set_callback(coll, cbfunc, cbdata);
+	if (SLURM_SUCCESS != pmixp_coll_contrib_local(coll, data, ndata)) {
+		goto error;
+	}
+	return PMIX_SUCCESS;
+error:
+	cbfunc(status, NULL, 0, cbdata, NULL, NULL);
+	return status;
+}
+
+static pmix_status_t dmodex_fn(const pmix_proc_t *proc,
+		const pmix_info_t info[], size_t ninfo,
+		pmix_modex_cbfunc_t cbfunc, void *cbdata)
+{
+	int rc;
+	PMIXP_DEBUG("called");
+
+	rc = pmixp_dmdx_get(proc->nspace, proc->rank, cbfunc, cbdata);
+
+	return (SLURM_SUCCESS == rc) ? PMIX_SUCCESS : PMIX_ERROR;
+}
+
+static pmix_status_t publish_fn(const pmix_proc_t *proc,
+		const pmix_info_t info[], size_t ninfo, pmix_op_cbfunc_t cbfunc,
+		void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
+
+static pmix_status_t lookup_fn(const pmix_proc_t *proc, char **keys,
+		const pmix_info_t info[], size_t ninfo,
+		pmix_lookup_cbfunc_t cbfunc, void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
+
+static pmix_status_t unpublish_fn(const pmix_proc_t *proc, char **keys,
+		const pmix_info_t info[], size_t ninfo, pmix_op_cbfunc_t cbfunc,
+		void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
+
+static pmix_status_t spawn_fn(const pmix_proc_t *proc,
+		const pmix_info_t job_info[], size_t ninfo,
+		const pmix_app_t apps[], size_t napps,
+		pmix_spawn_cbfunc_t cbfunc, void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
+
+static pmix_status_t connect_fn(const pmix_proc_t procs[], size_t nprocs,
+		const pmix_info_t info[], size_t ninfo, pmix_op_cbfunc_t cbfunc,
+		void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
+
+static pmix_status_t disconnect_fn(const pmix_proc_t procs[], size_t nprocs,
+		const pmix_info_t info[], size_t ninfo, pmix_op_cbfunc_t cbfunc,
+		void *cbdata)
+{
+	PMIXP_DEBUG("called");
+	return PMIX_ERR_NOT_IMPLEMENTED;
+}
diff --git a/src/plugins/mpi/pmix/pmixp_client.h b/src/plugins/mpi/pmix/pmixp_client.h
new file mode 100644
index 000000000..84c77a099
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_client.h
@@ -0,0 +1,52 @@
+/*****************************************************************************\
+ **  pmix_client.h - PMIx client communication code
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_CLIENT_H
+#define PMIXP_CLIENT_H
+
+#include "pmixp_common.h"
+
+extern pmix_server_module_t _slurm_pmix_callbacks;
+
+int pmixp_libpmix_init(void);
+int pmixp_libpmix_finalize(void);
+int pmixp_libpmix_job_set(void);
+void pmix_libpmix_task_set(int rank, char ***env);
+
+void pmix_client_new_conn(int fd);
+
+#endif /* PMIXP_CLIENT_H */
diff --git a/src/plugins/mpi/pmix/pmixp_coll.c b/src/plugins/mpi/pmix/pmixp_coll.c
new file mode 100644
index 000000000..47b2b11f8
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_coll.c
@@ -0,0 +1,664 @@
+/*****************************************************************************\
+ **  pmix_coll.c - PMIx collective primitives
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "src/slurmd/common/reverse_tree_math.h"
+#include "src/common/slurm_protocol_api.h"
+#include "pmixp_coll.h"
+#include "pmixp_nspaces.h"
+#include "pmixp_server.h"
+
+static void _progress_fan_in(pmixp_coll_t *coll);
+static void _progres_fan_out(pmixp_coll_t *coll, Buf buf);
+
+static int _hostset_from_ranges(const pmix_proc_t *procs, size_t nprocs,
+		hostlist_t *hl_out)
+{
+	int i;
+	hostlist_t hl = hostlist_create("");
+	pmixp_namespace_t *nsptr = NULL;
+	for (i = 0; i < nprocs; i++) {
+		char *node = NULL;
+		hostlist_t tmp;
+		nsptr = pmixp_nspaces_find(procs[i].nspace);
+		if (NULL == nsptr) {
+			goto err_exit;
+		}
+		if (procs[i].rank == PMIX_RANK_WILDCARD) {
+			tmp = hostlist_copy(nsptr->hl);
+		} else {
+			tmp = pmixp_nspace_rankhosts(nsptr, &procs[i].rank, 1);
+		}
+		while (NULL != (node = hostlist_pop(tmp))) {
+			hostlist_push(hl, node);
+			free(node);
+		}
+		hostlist_destroy(tmp);
+	}
+	hostlist_uniq(hl);
+	*hl_out = hl;
+	return SLURM_SUCCESS;
+err_exit:
+	hostlist_destroy(hl);
+	return SLURM_ERROR;
+}
+
+static int _pack_ranges(pmixp_coll_t *coll)
+{
+	pmix_proc_t *procs = coll->procs;
+	size_t nprocs = coll->nprocs;
+	uint32_t size;
+	int i;
+
+	/* 1. store the type of collective */
+	size = coll->type;
+	pack32(size, coll->buf);
+
+	/* 2. Put the number of ranges */
+	pack32(nprocs, coll->buf);
+	for (i = 0; i < (int)nprocs; i++) {
+		/* Pack namespace */
+		packmem(procs->nspace, strlen(procs->nspace) + 1, coll->buf);
+		pack32(procs->rank, coll->buf);
+	}
+
+	return SLURM_SUCCESS;
+}
+
+static void _fan_in_finished(pmixp_coll_t *coll)
+{
+	xassert(PMIXP_COLL_FAN_IN == coll->state);
+	coll->state = PMIXP_COLL_FAN_OUT;
+	memset(coll->ch_contribs, 0, sizeof(int) * coll->children_cnt);
+	coll->contrib_cntr = 0;
+	coll->contrib_local = 0;
+	set_buf_offset(coll->buf, coll->serv_offs);
+	if (SLURM_SUCCESS != _pack_ranges(coll)) {
+		PMIXP_ERROR("Cannot pack ranges to coll message header!");
+	}
+}
+
+static void _fan_out_finished(pmixp_coll_t *coll)
+{
+	coll->seq++; /* move to the next collective */
+	switch (coll->state) {
+	case PMIXP_COLL_FAN_OUT:
+		coll->state = PMIXP_COLL_SYNC;
+		break;
+	case PMIXP_COLL_FAN_OUT_IN:
+		/* we started to receive data for the new collective
+		 * switch to the fan-in stage */
+		coll->state = PMIXP_COLL_FAN_IN;
+		/* set the right timestamp */
+		coll->ts = coll->ts_next;
+		break;
+	default:
+		PMIXP_ERROR("Bad collective state = %d", coll->state);
+		xassert(PMIXP_COLL_FAN_OUT == coll->state || PMIXP_COLL_FAN_OUT_IN == coll->state);
+	}
+}
+
+static void _reset_coll(pmixp_coll_t *coll)
+{
+	switch (coll->state) {
+	case PMIXP_COLL_SYNC:
+		/* already reset */
+		break;
+	case PMIXP_COLL_FAN_IN:
+	case PMIXP_COLL_FAN_OUT:
+		set_buf_offset(coll->buf, coll->serv_offs);
+		if (SLURM_SUCCESS != _pack_ranges(coll)) {
+			PMIXP_ERROR(
+					"Cannot pack ranges to coll message header!");
+		}
+		coll->state = PMIXP_COLL_SYNC;
+		memset(coll->ch_contribs, 0, sizeof(int) * coll->children_cnt);
+		coll->seq++; /* move to the next collective */
+		coll->contrib_cntr = 0;
+		coll->contrib_local = 0;
+		coll->cbdata = NULL;
+		coll->cbfunc = NULL;
+		break;
+	default:
+		PMIXP_ERROR("Bad collective state = %d", coll->state);
+	}
+}
+
+int pmixp_coll_unpack_ranges(Buf buf, pmixp_coll_type_t *type,
+		pmix_proc_t **r, size_t *nr)
+{
+	pmix_proc_t *procs = NULL;
+	uint32_t nprocs = 0;
+	uint32_t tmp;
+	int i, rc;
+
+	/* 1. extract the type of collective */
+	if (SLURM_SUCCESS != (rc = unpack32(&tmp, buf))) {
+		PMIXP_ERROR("Cannot unpack collective type");
+		return rc;
+	}
+	*type = tmp;
+
+	/* 2. get the number of ranges */
+	if (SLURM_SUCCESS != (rc = unpack32(&nprocs, buf))) {
+		PMIXP_ERROR("Cannot unpack collective type");
+		return rc;
+	}
+	*nr = nprocs;
+
+	procs = xmalloc(sizeof(pmix_proc_t) * nprocs);
+	*r = procs;
+
+	for (i = 0; i < (int)nprocs; i++) {
+		/* 3. get namespace/rank of particular process */
+		rc = unpackmem(procs[i].nspace, &tmp, buf);
+		if (SLURM_SUCCESS != rc) {
+			PMIXP_ERROR("Cannot unpack namespace for process #%d",
+					i);
+			return rc;
+		}
+		procs[i].nspace[tmp] = '\0';
+
+		unsigned int tmp;
+		rc = unpack32(&tmp, buf);
+		procs[i].rank = tmp;
+		if (SLURM_SUCCESS != rc) {
+			PMIXP_ERROR(
+					"Cannot unpack ranks for process #%d, nsp=%s",
+					i, procs[i].nspace);
+			return rc;
+		}
+	}
+	return SLURM_SUCCESS;
+}
+
+int pmixp_coll_belong_chk(pmixp_coll_type_t type,
+			  const pmix_proc_t *procs, size_t nprocs)
+{
+	int i;
+	pmixp_namespace_t *nsptr = pmixp_nspaces_local();
+	/* Find my namespace in the range */
+	for (i = 0; i < nprocs; i++) {
+		if (0 != xstrcmp(procs[i].nspace, nsptr->name)) {
+			continue;
+		}
+		if ((procs[i].rank == PMIX_RANK_WILDCARD))
+			return 0;
+		if (0 <= pmixp_info_taskid2localid(procs[i].rank)) {
+			return 0;
+		}
+	}
+	/* we don't participate in this collective! */
+	PMIXP_ERROR("Have collective that doesn't include this job's namespace");
+	return -1;
+}
+
+/*
+ * Based on ideas provided by Hongjia Cao <hjcao@nudt.edu.cn> in PMI2 plugin
+ */
+int pmixp_coll_init(pmixp_coll_t *coll, const pmix_proc_t *procs,
+		size_t nprocs, pmixp_coll_type_t type)
+{
+	hostlist_t hl;
+	uint32_t nodeid = 0, nodes = 0;
+	int parent_id, depth, max_depth, tmp;
+	int width, my_nspace = -1;
+	char *p;
+	int i, *ch_nodeids = NULL;
+
+#ifndef NDEBUG
+	coll->magic = PMIXP_COLL_STATE_MAGIC;
+#endif
+	coll->type = type;
+	coll->state = PMIXP_COLL_SYNC;
+	coll->procs = xmalloc(sizeof(*procs) * nprocs);
+	memcpy(coll->procs, procs, sizeof(*procs) * nprocs);
+	coll->nprocs = nprocs;
+	coll->my_nspace = my_nspace;
+
+	if (SLURM_SUCCESS != _hostset_from_ranges(procs, nprocs, &hl)) {
+		/* TODO: provide ranges output routine */
+		PMIXP_ERROR("Bad ranges information");
+		goto err_exit;
+	}
+
+	width = slurm_get_tree_width();
+	nodes = hostlist_count(hl);
+	nodeid = hostlist_find(hl, pmixp_info_hostname());
+	reverse_tree_info(nodeid, nodes, width, &parent_id, &tmp, &depth,
+			&max_depth);
+	coll->children_cnt = tmp;
+	coll->nodeid = nodeid;
+
+	/* We interested in amount of direct childs */
+	coll->seq = 0;
+	coll->contrib_cntr = 0;
+	coll->contrib_local = false;
+	ch_nodeids = xmalloc(sizeof(int) * width);
+	coll->ch_contribs = xmalloc(sizeof(int) * width);
+	coll->children_cnt = reverse_tree_direct_children(nodeid, nodes, width,
+			depth, ch_nodeids);
+
+	/* create the hostlist with extract direct children's hostnames */
+	coll->ch_hosts = hostlist_create("");
+	for (i = 0; i < coll->children_cnt; i++) {
+		char *hname = hostlist_nth(hl, ch_nodeids[i]);
+		hostlist_push(coll->ch_hosts, hname);
+	}
+	/* just in case, shouldn't be needed */
+	hostlist_uniq(coll->ch_hosts);
+	xfree(ch_nodeids);
+
+	if (parent_id == -1) {
+		/* if we are the root of the tree:
+		 * - we don't have a parent;
+		 * - we have large list of all_childrens (we don't want ourselfs there)
+		 */
+		coll->parent_host = NULL;
+		hostlist_delete_host(hl, pmixp_info_hostname());
+		coll->all_children = hl;
+	} else if (parent_id >= 0) {
+		/* for all other nodes in the tree we need to know:
+		 * - nodename of our parent;
+		 * - we don't need a list of all_childrens and hl anymore
+		 */
+		p = hostlist_nth(hl, parent_id);
+		coll->parent_host = xstrdup(p);
+		/* use empty hostlist here */
+		coll->all_children = hostlist_create("");
+		free(p);
+		hostlist_destroy(hl);
+	}
+
+	/* Collective data */
+	coll->buf = pmixp_server_new_buf();
+	coll->serv_offs = get_buf_offset(coll->buf);
+
+	if (SLURM_SUCCESS != _pack_ranges(coll)) {
+		PMIXP_ERROR("Cannot pack ranges to coll message header!");
+		goto err_exit;
+	}
+
+	/* Callback information */
+	coll->cbdata = NULL;
+	coll->cbfunc = NULL;
+
+	/* init fine grained lock */
+	slurm_mutex_init(&coll->lock);
+
+	return SLURM_SUCCESS;
+err_exit:
+	return SLURM_ERROR;
+}
+
+void pmixp_coll_free(pmixp_coll_t *coll)
+{
+	if (NULL != coll->procs) {
+		xfree(coll->procs);
+	}
+	if (NULL != coll->parent_host) {
+		xfree(coll->parent_host);
+	}
+	hostlist_destroy(coll->all_children);
+	hostlist_destroy(coll->ch_hosts);
+
+	if (NULL != coll->ch_contribs) {
+		xfree(coll->ch_contribs);
+	}
+	free_buf(coll->buf);
+}
+
+int pmixp_coll_contrib_local(pmixp_coll_t *coll, char *data, size_t size)
+{
+	PMIXP_DEBUG("%s:%d: get local contribution", pmixp_info_namespace(),
+			pmixp_info_nodeid());
+
+	/* sanity check */
+	pmixp_coll_sanity_check(coll);
+
+	/* lock the structure */
+	slurm_mutex_lock(&coll->lock);
+
+	/* change the collective state if need */
+	if (PMIXP_COLL_SYNC == coll->state) {
+		PMIXP_DEBUG(
+				"%s:%d: get local contribution: switch to PMIXP_COLL_FAN_IN",
+				pmixp_info_namespace(), pmixp_info_nodeid());
+		coll->state = PMIXP_COLL_FAN_IN;
+		coll->ts = time(NULL);
+	}
+	xassert(PMIXP_COLL_FAN_IN == coll->state);
+
+	/* save & mark local contribution */
+	coll->contrib_local = true;
+	grow_buf(coll->buf, size);
+	memcpy(get_buf_data(coll->buf) + get_buf_offset(coll->buf), data, size);
+	set_buf_offset(coll->buf, get_buf_offset(coll->buf) + size);
+
+	/* unlock the structure */
+	slurm_mutex_unlock(&coll->lock);
+
+	/* check if the collective is ready to progress */
+	_progress_fan_in(coll);
+
+	PMIXP_DEBUG("%s:%d: get local contribution: finish",
+			pmixp_info_namespace(), pmixp_info_nodeid());
+
+	return SLURM_SUCCESS;
+}
+
+int pmixp_coll_contrib_node(pmixp_coll_t *coll, char *nodename, Buf buf)
+{
+	int nodeid;
+	char *data = NULL;
+	uint32_t size;
+	char *state = NULL;
+
+	PMIXP_DEBUG("%s:%d: get contribution from node %s",
+			pmixp_info_namespace(), pmixp_info_nodeid(), nodename);
+
+	/* lock the structure */
+	slurm_mutex_lock(&coll->lock);
+
+	pmixp_coll_sanity_check(coll);
+
+	/* fix the collective status if need */
+	if (PMIXP_COLL_SYNC == coll->state) {
+		PMIXP_DEBUG("%s:%d: get contribution from node %s: switch to PMIXP_COLL_FAN_IN",
+			    pmixp_info_namespace(), pmixp_info_nodeid(),
+			    nodename);
+		coll->state = PMIXP_COLL_FAN_IN;
+		coll->ts = time(NULL);
+	} else if( PMIXP_COLL_FAN_OUT == coll->state) {
+		PMIXP_DEBUG("%s:%d: get contribution from node %s: switch to PMIXP_COLL_FAN_OUT_IN"
+			    " (next collective!)",
+			    pmixp_info_namespace(), pmixp_info_nodeid(),
+			    nodename);
+		coll->state = PMIXP_COLL_FAN_OUT_IN;
+		coll->ts_next = time(NULL);
+	}
+	xassert(PMIXP_COLL_FAN_IN == coll->state || PMIXP_COLL_FAN_OUT_IN == coll->state);
+
+	/* Because of possible timeouts/delays in transmission we
+	 * can receive a contribution second time. Avoid duplications
+	 * by checking our records. */
+	nodeid = hostlist_find(coll->ch_hosts, nodename);
+	xassert(0 <= nodeid);
+	if (0 > nodeid) {
+		/* protect ourselfs if we are running with no asserts */
+		goto proceed;
+	}
+
+	if (0 < coll->ch_contribs[nodeid]) {
+		/* May be 0 or 1. If grater - transmission skew, ignore. */
+		PMIXP_DEBUG("Multiple contributions from child_id=%d, hostname=%s",
+			    nodeid, nodename);
+		/* this is duplication, skip. */
+		goto proceed;
+	}
+
+	data = get_buf_data(buf) + get_buf_offset(buf);
+	size = remaining_buf(buf);
+	grow_buf(coll->buf, size);
+	memcpy(get_buf_data(coll->buf) + get_buf_offset(coll->buf), data, size);
+	set_buf_offset(coll->buf, get_buf_offset(coll->buf) + size);
+
+	/* increase number of individual contributions */
+	coll->ch_contribs[nodeid]++;
+
+	/* increase number of total contributions */
+	coll->contrib_cntr++;
+
+proceed:
+	/* unlock the structure */
+	slurm_mutex_unlock(&coll->lock);
+
+	if( PMIXP_COLL_FAN_IN == coll->state ){
+		/* make a progress if we are in fan-in state */
+		_progress_fan_in(coll);
+	}
+
+	switch( coll->state ){
+	case PMIXP_COLL_SYNC:
+		state = "sync";
+		break;
+	case PMIXP_COLL_FAN_IN:
+		state = "fan-in";
+		break;
+	case PMIXP_COLL_FAN_OUT:
+		state = "fan-out";
+		break;
+	case PMIXP_COLL_FAN_OUT_IN:
+		state = "fan-out-in";
+		break;
+	}
+
+	PMIXP_DEBUG("%s:%d: get contribution from node %s: finish. State = %s",
+		    pmixp_info_namespace(), pmixp_info_nodeid(), nodename,
+		    state);
+
+	return SLURM_SUCCESS;
+}
+
+void pmixp_coll_bcast(pmixp_coll_t *coll, Buf buf)
+{
+	PMIXP_DEBUG("%s:%d: start", pmixp_info_namespace(), pmixp_info_nodeid());
+
+	/* lock the structure */
+	slurm_mutex_lock(&coll->lock);
+
+	_progres_fan_out(coll, buf);
+
+	/* unlock the structure */
+	slurm_mutex_unlock(&coll->lock);
+
+	/* We may already start next collective. Try to progress!
+	 * its OK if we in SYNC - there will be no-op */
+	_progress_fan_in(coll);
+}
+
+static int _copy_payload(Buf inbuf, size_t offs, Buf *outbuf)
+{
+	size_t total_size, copy_size;
+	char *ptr;
+	pmix_proc_t *procs = NULL;
+	size_t nprocs = 0;
+	pmixp_coll_type_t type = 0;
+	Buf buf;
+
+	total_size = get_buf_offset(inbuf);
+	set_buf_offset(inbuf, offs);
+	int rc = pmixp_coll_unpack_ranges(inbuf, &type, &procs, &nprocs);
+	xfree(procs);
+	ptr = get_buf_data(inbuf) + get_buf_offset(inbuf);
+	copy_size = total_size - get_buf_offset(inbuf);
+	buf = init_buf(copy_size);
+	memcpy(get_buf_data(buf), ptr, copy_size);
+	*outbuf = buf;
+	set_buf_offset(inbuf, total_size);
+	return rc;
+}
+
+static void _progress_fan_in(pmixp_coll_t *coll)
+{
+	pmixp_srv_cmd_t type;
+	const char *addr = pmixp_info_srv_addr();
+	char *hostlist = NULL;
+	int rc;
+	Buf root_buf;
+
+	PMIXP_DEBUG("%s:%d: start, local=%d, child_cntr=%d",
+			pmixp_info_namespace(), pmixp_info_nodeid(),
+			coll->contrib_local, coll->contrib_cntr);
+
+	/* lock the collective */
+	slurm_mutex_lock(&coll->lock);
+
+	pmixp_coll_sanity_check(coll);
+
+	if (PMIXP_COLL_FAN_IN != coll->state) {
+		/* In case of race condition between libpmix and
+		 * slurm threads progress_fan_in can be called
+		 * after we moved to the next step. */
+		goto unlock;
+	}
+
+	if (!coll->contrib_local || coll->contrib_cntr != coll->children_cnt) {
+		/* Not yet ready to go to the next step */
+		goto unlock;
+	}
+
+	/* The root of the collective will have parent_host == NULL */
+	if (NULL != coll->parent_host) {
+		hostlist = xstrdup(coll->parent_host);
+		type = PMIXP_MSG_FAN_IN;
+		PMIXP_DEBUG("%s:%d: switch to PMIXP_COLL_FAN_OUT state",
+			    pmixp_info_namespace(), pmixp_info_nodeid());
+	} else {
+		if (0 < hostlist_count(coll->all_children)) {
+			hostlist = hostlist_ranged_string_xmalloc(
+					coll->all_children);
+			type = PMIXP_MSG_FAN_OUT;
+			pmixp_debug_hang(0);
+		}
+		rc = _copy_payload(coll->buf, coll->serv_offs, &root_buf);
+		xassert(0 == rc);
+		PMIXP_DEBUG("%s:%d: finish with this collective (I am the root)",
+			    pmixp_info_namespace(), pmixp_info_nodeid());
+	}
+
+	PMIXP_DEBUG("%s:%d: send data to %s", pmixp_info_namespace(),
+			pmixp_info_nodeid(), hostlist);
+
+	/* Check for the singletone case */
+	if (NULL != hostlist) {
+		if( 0 == coll->seq && NULL != coll->parent_host ){
+			/* This is the first message sent to the parent.
+			 * There might be a race condition where parent
+			 * is not ready to receive the messages.
+			 * Use zero-size message to check parent status first
+			 * and then send the full message.
+			 */
+			pmixp_server_health_chk(hostlist, addr);
+		}
+		rc = pmixp_server_send(hostlist, type, coll->seq, addr,
+				get_buf_data(coll->buf),
+				get_buf_offset(coll->buf));
+
+		if (SLURM_SUCCESS != rc) {
+			PMIXP_ERROR(
+					"Cannot send data (size = %lu), to hostlist:\n%s",
+					(uint64_t) get_buf_offset(coll->buf),
+					hostlist);
+			/* return error indication to PMIx. Nodes that haven't received data
+			 * will exit by a timeout.
+			 * FIXME: do we need to do something with successfuly finished nodes?
+			 */
+			goto unlock;
+		}
+	}
+
+	/* transit to the next state */
+	_fan_in_finished(coll);
+
+	/* if we are root - push data to PMIx here.
+	 * Originally there was a homogenuous solution: root nodename was in the hostlist.
+	 * However this may lead to the undesired side effects: we are blocked here sending
+	 * data and cannot receive (it will be triggered in this thread after we will leave
+	 * this callback), so we have to rely on buffering on the SLURM side.
+	 * Better not to do so. */
+	if (NULL == coll->parent_host) {
+		/* if I am the root - pass the data to PMIx and reset collective here */
+		/* copy payload excluding reserved server header */
+		_progres_fan_out(coll, root_buf);
+	}
+
+unlock:
+	if (NULL != hostlist) {
+		xfree(hostlist);
+	}
+
+	/* lock the */
+	slurm_mutex_unlock(&coll->lock);
+}
+
+void _progres_fan_out(pmixp_coll_t *coll, Buf buf)
+{
+	PMIXP_DEBUG("%s:%d: start", pmixp_info_namespace(), pmixp_info_nodeid());
+
+	pmixp_coll_sanity_check(coll);
+
+	xassert(PMIXP_COLL_FAN_OUT == coll->state || PMIXP_COLL_FAN_OUT_IN == coll->state);
+
+	/* update the database */
+	if (NULL != coll->cbfunc) {
+		void *data = get_buf_data(buf) + get_buf_offset(buf);
+		size_t size = remaining_buf(buf);
+		PMIXP_DEBUG("%s:%d: use the callback", pmixp_info_namespace(),
+				pmixp_info_nodeid());
+		coll->cbfunc(PMIX_SUCCESS, data, size, coll->cbdata,
+				pmixp_free_Buf, (void *)buf);
+	}
+	/* Prepare for the next collective operation */
+	_fan_out_finished(coll);
+
+	PMIXP_DEBUG("%s:%d: collective is prepared for the next use",
+			pmixp_info_namespace(), pmixp_info_nodeid());
+}
+
+void pmixp_coll_reset_if_to(pmixp_coll_t *coll, time_t ts)
+{
+	/* lock the */
+	slurm_mutex_lock(&coll->lock);
+
+	if (PMIXP_COLL_SYNC == coll->state) {
+		goto unlock;
+	}
+
+	if (ts - coll->ts > pmixp_info_timeout()) {
+		/* respond to the libpmix */
+		coll->cbfunc(PMIX_ERR_TIMEOUT, NULL, 0, coll->cbdata, NULL,
+				NULL);
+		/* drop the collective */
+		_reset_coll(coll);
+		/* report the timeout event */
+		PMIXP_ERROR("Collective timeout!");
+	}
+unlock:
+	/* unlock the structure */
+	slurm_mutex_unlock(&coll->lock);
+}
diff --git a/src/plugins/mpi/pmix/pmixp_coll.h b/src/plugins/mpi/pmix/pmixp_coll.h
new file mode 100644
index 000000000..168a4febb
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_coll.h
@@ -0,0 +1,201 @@
+/*****************************************************************************\
+ **  pmix_coll.h - PMIx collective primitives
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_COLL_H
+#define PMIXP_COLL_H
+#include "pmixp_common.h"
+#include "pmixp_debug.h"
+
+typedef enum {
+	PMIXP_COLL_SYNC,
+	PMIXP_COLL_FAN_IN,
+	PMIXP_COLL_FAN_OUT,
+	PMIXP_COLL_FAN_OUT_IN
+} pmixp_coll_state_t;
+
+typedef enum {
+	PMIXP_COLL_TYPE_FENCE,
+	PMIXP_COLL_TYPE_CONNECT,
+	PMIXP_COLL_TYPE_DISCONNECT
+} pmixp_coll_type_t;
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIXP_COLL_STATE_MAGIC 0xCA11CAFE
+	int magic;
+#endif
+	/* element-wise lock */
+	pthread_mutex_t lock;
+
+	/* general information */
+	pmixp_coll_state_t state;
+	pmixp_coll_type_t type;
+	/* PMIx collective id */
+	pmix_proc_t *procs;
+	size_t nprocs;
+	int my_nspace;
+	uint32_t nodeid;
+	/* tree structure */
+	char *parent_host;
+	hostlist_t all_children;
+	uint32_t children_cnt;
+
+	/* */
+	uint32_t seq;
+	uint32_t contrib_cntr;
+	bool contrib_local;
+
+	/* Check who contributes */
+	hostlist_t ch_hosts;
+	bool *ch_contribs;
+
+	/* collective data */
+	Buf buf;
+	size_t serv_offs;
+
+	/* libpmix callback data */
+	pmix_modex_cbfunc_t cbfunc;
+	void *cbdata;
+
+	/* timestamp for stale collectives detection */
+	time_t ts, ts_next;
+} pmixp_coll_t;
+
+static inline void pmixp_coll_sanity_check(pmixp_coll_t *coll)
+{
+	xassert(coll->magic == PMIXP_COLL_STATE_MAGIC);
+}
+
+int pmixp_coll_init(pmixp_coll_t *coll, const pmix_proc_t *procs,
+		size_t nprocs, pmixp_coll_type_t type);
+void pmixp_coll_free(pmixp_coll_t *coll);
+
+static inline void pmixp_coll_set_callback(pmixp_coll_t *coll,
+					   pmix_modex_cbfunc_t cbfunc,
+					   void *cbdata)
+{
+	/* no need to protect coll since:
+	 * - only libpmix thread may touch this data during fan-in stage
+	 * - only slurm thread may touch this data during fan-out stage
+	 */
+	pmixp_coll_sanity_check(coll);
+	coll->cbfunc = cbfunc;
+	coll->cbdata = cbdata;
+}
+
+/*
+ * This is important routine that takes responsibility to decide
+ * what messages may appear and what may not. In absence of errors
+ * we won't need this routine. Unfortunately they are exist.
+ * There can be 3 general types of communication errors:
+ * 1. We are trying to send our contribution to a parent and it fails.
+ *    In this case we will be blocked in send function. At some point
+ *    we either succeed or fail after predefined number of trials.
+ *
+ *    If we succeed - we are OK. Otherwise we will abort the whole job step.
+ *
+ * 2. A child of us sends us the message and gets the error, however we
+ *    receive this message (false negative). Child will try again while we might be:
+ *    (a) at FAN-IN step waiting for other contributions.
+ *    (b) at FAN-OUT since we get all we need.
+ *    (c) 2 step forward (SYNC) with coll->seq = (child_seq+1) if root of the tree
+ *        successfuly broadcasted the whole database to us.
+ *    (d) 3 step forward (next FAN-IN) with coll->seq = (child_seq+1)
+ *        if somebody initiated next collective.
+ *    (e) we won't move further because the child with problem won't send us
+ *        next contribution.
+ *
+ *    Cases (a) and (b) can't be noticed here since child and we have the
+ *    same seq number. They will later be detected  in pmixp_coll_contrib_node()
+ *    based on collective contribution accounting vector.
+ *
+ *    Cases (c) and (d) would be visible here and should be treated as possible
+ *    errors that should be ignored discarding the contribution.
+ *
+ *    Other cases are obvious error, we can abort in this case or ignore with
+ *    error.
+ *
+ * 3. Root of the tree broadcasts the data and we get it, however root gets
+ *    false negative. In this case root will try again. We might be:
+ *    (a) at SYNC since we just got the DB and we are fine (coll->seq == root_seq+1)
+ *    (b) at FAN-IN if somebody initiated next collective  (coll->seq == root_seq+1)
+ *    (c) at FAN-OUT if we will collect all necessary contributions and send it to
+ *        our parent.
+ *    (d) we won't be able to switch to SYNC since root will be busy dealing with
+ *        previous DB broadcast.
+ *    (e) at FAN-OUT waiting for the fan-out msg while receiving next fan-in message
+ *        from one of our children (coll->seq + 1 == child_seq).
+ */
+static inline int pmixp_coll_check_seq(pmixp_coll_t *coll, uint32_t seq,
+		char *nodename)
+{
+	if (coll->seq == seq) {
+		/* accept this message */
+		return SLURM_SUCCESS;
+	} else if( (coll->seq+1) == seq ){
+		/* practice shows that because of SLURM communication
+		 * infrastructure our child can switch to the next Fence
+		 * and send us the message before the current fan-out message
+		 * arrived. This is accounted in current state machine, so we
+		 * allow if we receive message with seq number grater by one */
+		return SLURM_SUCCESS;
+	} else if ((coll->seq - 1) == seq) {
+		/* his may be our child OR root of the tree that
+		 * had false negatives from SLURM protocol.
+		 * It's normal situation, return error because we
+		 * want to discard this message */
+		return SLURM_ERROR;
+	}
+	/* maybe need more sophisticated handling in presence of
+	 * several steps. However maybe it's enough to just ignore */
+	/* slurm_kill_job_step(pmixp_info_jobid(), pmixp_info_stepid(), SIGKILL); */
+	return SLURM_ERROR;
+}
+
+int pmixp_coll_contrib_local(pmixp_coll_t *coll, char *data,
+			     size_t ndata);
+int pmixp_coll_contrib_node(pmixp_coll_t *coll, char *nodename, Buf buf);
+void pmixp_coll_bcast(pmixp_coll_t *coll, Buf buf);
+bool pmixp_coll_progress(pmixp_coll_t *coll, char *fwd_node,
+			 void **data, uint64_t size);
+int pmixp_coll_unpack_ranges(Buf buf, pmixp_coll_type_t *type,
+		pmix_proc_t **ranges, size_t *nranges);
+int pmixp_coll_belong_chk(pmixp_coll_type_t type,
+			  const pmix_proc_t *procs, size_t nprocs);
+void pmixp_coll_reset_if_to(pmixp_coll_t *coll, time_t ts);
+
+#endif /* PMIXP_COLL_H */
diff --git a/src/plugins/mpi/pmix/pmixp_common.h b/src/plugins/mpi/pmix/pmixp_common.h
new file mode 100644
index 000000000..594d69353
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_common.h
@@ -0,0 +1,116 @@
+/*****************************************************************************\
+ **  pmix_common.h - PMIx common declarations and includes
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_COMMON_H
+#define PMIXP_COMMON_H
+
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Common includes for all source files
+ * Define SLURM translator header first to override
+ * all translated functions
+ */
+#include "src/common/slurm_xlator.h"
+
+/* Other useful includes */
+#include "slurm/slurm_errno.h"
+#include "src/common/slurm_mpi.h"
+#include "src/slurmd/slurmstepd/slurmstepd_job.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xassert.h"
+#include "src/common/eio.h"
+#include "src/common/mapping.h"
+#include "src/common/fd.h"
+#include "src/common/net.h"
+
+/* PMIx library header */
+#include <pmix_server.h>
+
+/* TODO: use /tmp directory instead */
+#define MAX_USOCK_PATH							\
+	((size_t) &(((struct sockaddr_un *)0 + 1)->sun_family) -	\
+	(size_t)&(((struct sockaddr_un *)0)->sun_path))
+
+/* ----------------------------------------------------------
+ * SLURM environment that influence us:
+ * Job/step resource description
+ * ---------------------------------------------------------- */
+#define PMIXP_STEP_NODES_ENV "SLURM_STEP_NODELIST"
+/* srun does not propagates SLURM_JOB_NODELIST
+ * we need to check both of the variables:
+ * - SLURM_JOB_NODELIST - a new one
+ * - SLURM_NODELIST - a deprecated one */
+#define PMIXP_JOB_NODES_ENV "SLURM_JOB_NODELIST"
+#define PMIXP_JOB_NODES_ENV_DEP "SLURM_NODELIST"
+#define PMIXP_CPUS_PER_NODE_ENV "SLURM_JOB_CPUS_PER_NODE"
+#define PMIXP_CPUS_PER_TASK "SLURM_CPUS_PER_TASK"
+#define PMIXP_SLURM_MAPPING_ENV "SLURM_PMIX_MAPPING_SERV"
+
+/* ----------------------------------------------------------
+ * This variables can be used to adjust the plugin's behavior
+ * TODO: put their description to documentation
+ * ---------------------------------------------------------- */
+
+/* Setup communication timeout */
+#define PMIXP_TIMEOUT "SLURM_PMIX_TIMEOUT"
+#define PMIXP_TIMEOUT_DEFAULT 300
+
+/* setup path to the temp directory for usock files for:
+ * - inter-stepd comunication;
+ * - libpmix - client communication
+ */
+#define PMIXP_TMPDIR_SRV "SLURM_PMIX_SRV_TMPDIR"
+#define PMIXP_TMPDIR_CLI "SLURM_PMIX_TMPDIR"
+#define PMIXP_TMPDIR_DEFAULT "/tmp/"
+#define PMIXP_OS_TMPDIR_ENV "TMPDIR"
+/* This variable will be propagated to server-side
+ * part of libPMIx */
+#define PMIXP_DEBUG_LIB "SLURM_PMIX_SRV_DEBUG"
+
+/* ----------------------------------------------------------
+ * This is libPMIx variable that we need to control it
+ * ---------------------------------------------------------- */
+#define PMIXP_PMIXLIB_TMPDIR "PMIX_SERVER_TMPDIR"
+#define PMIXP_PMIXLIB_DEBUG "PMIX_DEBUG"
+#define PMIXP_PMIXLIB_DEBUG_REDIR "PMIX_OUTPUT_REDIRECT"
+
+#endif /* PMIXP_COMMON_H */
diff --git a/src/plugins/mpi/pmix/pmixp_debug.h b/src/plugins/mpi/pmix/pmixp_debug.h
new file mode 100644
index 000000000..a3d2b4918
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_debug.h
@@ -0,0 +1,113 @@
+/*****************************************************************************\
+ **  pmix_debug.h - PMIx debug primitives
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+#ifndef PMIXP_DEBUG_H
+#define PMIXP_DEBUG_H
+
+#include "pmixp_common.h"
+#include "pmixp_info.h"
+
+#define MAX_MSG_SIZE 1024
+
+#define PMIXP_DEBUG(format, args...) {				\
+	char file[] = __FILE__;					\
+	char *file_base = strrchr(file, '/');			\
+	if (file_base == NULL) {				\
+		file_base = file;				\
+	}							\
+	debug("%s [%d] %s:%d [%s] mpi/pmix: " format "",	\
+		pmixp_info_hostname(), pmixp_info_nodeid(),	\
+		file_base, __LINE__, __func__, ## args);	\
+}
+
+#define PMIXP_ERROR_STD(format, args...) {			\
+	char file[] = __FILE__;					\
+	char *file_base = strrchr(file, '/');			\
+	if (file_base == NULL) {				\
+	file_base = file;					\
+	}							\
+	error("%s [%d] %s:%d [%s] mpi/pmix: ERROR: " format ": %s (%d)",	\
+		pmixp_info_hostname(), pmixp_info_nodeid(),	\
+		file_base, __LINE__, __func__,			\
+		## args, strerror(errno), errno);		\
+}
+
+#define PMIXP_ERROR(format, args...) {				\
+	char file[] = __FILE__;					\
+	char *file_base = strrchr(file, '/');			\
+	if (file_base == NULL) {				\
+		file_base = file;				\
+	}							\
+	error("%s [%d] %s:%d [%s] mpi/pmix: ERROR: " format,	\
+		pmixp_info_hostname(), pmixp_info_nodeid(),	\
+		file_base, __LINE__, __func__, ## args);	\
+}
+
+#define PMIXP_ABORT(format, args...) {				\
+	PMIXP_ERROR(format, ##args);                            \
+	error("%s [%d] %s:%d [%s] mpi/pmix: ERROR: " format,	\
+		pmixp_info_hostname(), pmixp_info_nodeid(),	\
+		file_base, __LINE__, __func__, ## args);	\
+		slurm_kill_job_step(pmixp_info_jobid(),         \
+		pmixp_info_stepid(), SIGKILL);			\
+}
+
+#define PMIXP_ERROR_NO(err, format, args...) {			\
+	char file[] = __FILE__;					\
+	char *file_base = strrchr(file, '/');			\
+	if (file_base == NULL) {				\
+		file_base = file;				\
+	}							\
+	error("%s [%d] %s:%d [%s] mpi/pmix: ERROR: " format ": %s (%d)", \
+		pmixp_info_hostname(), pmixp_info_nodeid(),	\
+		file_base, __LINE__, __func__,			\
+		## args, strerror(err), err);			\
+}
+
+#ifdef NDEBUG
+#define pmixp_debug_hang(x)
+#else
+static inline void _pmixp_debug_hang(int delay)
+{
+	while (delay) {
+		sleep(1);
+	}
+}
+
+#define pmixp_debug_hang(x) _pmixp_debug_hang(x)
+
+#endif
+#endif /* PMIXP_DEBUG_H */
diff --git a/src/plugins/mpi/pmix/pmixp_dmdx.c b/src/plugins/mpi/pmix/pmixp_dmdx.c
new file mode 100644
index 000000000..ade5dd84a
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_dmdx.c
@@ -0,0 +1,470 @@
+/*****************************************************************************\
+ **  pmix_debug.h - PMIx debug primitives
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "pmixp_dmdx.h"
+#include "pmixp_server.h"
+
+/* set default direct modex timeout to 10 sec */
+#define DMDX_DEFAULT_TIMEOUT 10
+
+typedef enum {
+	DMDX_REQUEST = 1,
+	DMDX_RESPONSE
+} dmdx_type_t;
+
+typedef struct {
+	uint32_t seq_num;
+	time_t ts;
+#ifndef NDEBUG
+	/* we need this only for verification */
+	char nspace[PMIX_MAX_NSLEN];
+	int rank;
+#endif
+	pmix_modex_cbfunc_t cbfunc;
+	void *cbdata;
+} dmdx_req_info_t;
+
+typedef struct {
+	uint32_t seq_num;
+	pmix_proc_t proc;
+	char *sender_host, *sender_ns;
+	int rank;
+} dmdx_caddy_t;
+
+void _dmdx_free_caddy(dmdx_caddy_t *caddy)
+{
+	if (NULL == caddy) {
+		/* nothing to do */
+		return;
+	}
+	if (NULL != caddy->sender_host) {
+		xfree(caddy->sender_host);
+	}
+	if (NULL != caddy->sender_ns) {
+		xfree(caddy->sender_ns);
+	}
+	xfree(caddy);
+}
+
+static List _dmdx_requests;
+static uint32_t _dmdx_seq_num = 1;
+
+static void _respond_with_error(int seq_num, char *sender_host,
+				char *sender_ns, int status);
+
+int pmixp_dmdx_init(void)
+{
+	_dmdx_requests = list_create(pmixp_xfree_xmalloced);
+	_dmdx_seq_num = 1;
+	return SLURM_SUCCESS;
+}
+
+int pmixp_dmdx_finalize(void)
+{
+	list_destroy(_dmdx_requests);
+	return 0;
+}
+
+
+static void _setup_header(Buf buf, dmdx_type_t t,
+			  const char *nspace, int rank, int status)
+{
+	char *str;
+	/* 1. pack message type */
+	unsigned char type = (char)t;
+	grow_buf(buf, sizeof(char));
+	pack8(type, buf);
+
+	/* 2. pack namespace _with_ '\0' (strlen(nspace) + 1)! */
+	packmem((char *)nspace, strlen(nspace) + 1, buf);
+
+	/* 3. pack rank */
+	grow_buf(buf, sizeof(int));
+	pack32((uint32_t)rank, buf);
+
+	/* 4. pack my rendezvous point - local namespace
+	 * ! _with_ '\0' (strlen(nspace) + 1) ! */
+	str = pmixp_info_namespace();
+	packmem(str, strlen(str) + 1, buf);
+
+	/* 5. pack the status */
+	pack32((uint32_t)status, buf);
+}
+
+static int _read_type(Buf buf, dmdx_type_t *type)
+{
+	unsigned char t;
+	int rc;
+	/* 1. unpack message type */
+	if (SLURM_SUCCESS != (rc = unpack8(&t, buf))) {
+		PMIXP_ERROR("Cannot unpack message type!");
+		return SLURM_ERROR;
+	}
+	*type = (dmdx_type_t)t;
+	return SLURM_SUCCESS;
+}
+
+static int _read_info(Buf buf, char **ns, int *rank,
+		      char **sender_ns, int *status)
+{
+	uint32_t cnt, uint32_tmp;
+	int rc;
+	*ns = NULL;
+	*sender_ns = NULL;
+
+	/* 1. unpack namespace */
+	if (SLURM_SUCCESS != (rc = unpackmem_ptr(ns, &cnt, buf))) {
+		PMIXP_ERROR("Cannot unpack requested namespace!");
+		return rc;
+	}
+	/* We supposed to unpack a whole null-terminated string (with '\0')!
+	 * (*ns)[cnt] = '\0';
+	 */
+
+	/* 2. unpack rank */
+	if (SLURM_SUCCESS != (rc = unpack32(&uint32_tmp, buf))) {
+		PMIXP_ERROR("Cannot unpack requested rank!");
+		return rc;
+	}
+	*rank = uint32_tmp;
+
+	if (SLURM_SUCCESS != (rc = unpackmem_ptr(sender_ns, &cnt, buf))) {
+		PMIXP_ERROR("Cannot unpack sender namespace!");
+		return rc;
+	}
+	/* We supposed to unpack a whole null-terminated string (with '\0')!
+	 * (*sender_ns)[cnt] = '\0';
+	 */
+
+	/* 4. unpack status */
+	if (SLURM_SUCCESS != (rc = unpack32(&uint32_tmp, buf))) {
+		PMIXP_ERROR("Cannot unpack rank!");
+		return rc;
+	}
+	*status = uint32_tmp;
+	return SLURM_SUCCESS;
+}
+
+static void _respond_with_error(int seq_num, char *sender_host,
+				char *sender_ns, int status)
+{
+	Buf buf = create_buf(NULL, 0);
+	char *addr;
+	int rc;
+
+	/* rank doesn't matter here, don't send it */
+	_setup_header(buf, DMDX_RESPONSE, pmixp_info_namespace(), -1, status);
+	/* generate namespace usocket name */
+	addr = pmixp_info_nspace_usock(sender_ns);
+	/* send response */
+	rc = pmixp_server_send(sender_host, PMIXP_MSG_DMDX, seq_num, addr,
+			get_buf_data(buf), get_buf_offset(buf));
+	if (SLURM_SUCCESS != rc) {
+		PMIXP_ERROR("Cannot send direct modex error" " response to %s",
+				sender_host);
+	}
+	xfree(addr);
+	free_buf(buf);
+}
+
+static void _dmdx_pmix_cb(pmix_status_t status, char *data, size_t sz,
+		void *cbdata)
+{
+	dmdx_caddy_t *caddy = (dmdx_caddy_t *)cbdata;
+	Buf buf = pmixp_server_new_buf();
+	char *addr;
+	int rc;
+
+	/* setup response header */
+	_setup_header(buf, DMDX_RESPONSE, caddy->proc.nspace, caddy->proc.rank,
+			status);
+
+	/* pack the response */
+	packmem(data, sz, buf);
+
+	/* setup response address */
+	addr = pmixp_info_nspace_usock(caddy->sender_ns);
+
+	/* send the request */
+	rc = pmixp_server_send(caddy->sender_host, PMIXP_MSG_DMDX,
+			caddy->seq_num, addr, get_buf_data(buf),
+			get_buf_offset(buf));
+	if (SLURM_SUCCESS != rc) {
+		/* not much we can do here. Caller will react by timeout */
+		PMIXP_ERROR("Cannot send direct modex response to %s",
+				caddy->sender_host);
+	}
+	xfree(addr);
+	free_buf(buf);
+	_dmdx_free_caddy(caddy);
+}
+
+int pmixp_dmdx_get(const char *nspace, int rank,
+		   pmix_modex_cbfunc_t cbfunc, void *cbdata)
+{
+	dmdx_req_info_t *req;
+	char *addr, *host;
+	Buf buf;
+	int rc;
+	uint32_t seq;
+
+	/* need to send the request */
+	host = pmixp_nspace_resolve(nspace, rank);
+	xassert(NULL != host);
+	if (NULL == host) {
+		return SLURM_ERROR;
+	}
+
+	buf = pmixp_server_new_buf();
+
+	/* setup message header */
+	_setup_header(buf, DMDX_REQUEST, nspace, rank, SLURM_SUCCESS);
+	/* generate namespace usocket name */
+	addr = pmixp_info_nspace_usock(nspace);
+	/* store cur seq. num and move to the next request */
+	seq = _dmdx_seq_num++;
+
+	/* track this request */
+	req = xmalloc(sizeof(dmdx_req_info_t));
+	req->seq_num = seq;
+	req->cbfunc = cbfunc;
+	req->cbdata = cbdata;
+	req->ts = time(NULL);
+#ifndef NDEBUG
+	strncpy(req->nspace, nspace, PMIX_MAX_NSLEN);
+	req->rank = rank;
+#endif
+	list_append(_dmdx_requests, req);
+
+	/* send the request */
+	rc = pmixp_server_send(host, PMIXP_MSG_DMDX, seq, addr,
+			get_buf_data(buf), get_buf_offset(buf));
+
+	/* cleanup the resources */
+	xfree(addr);
+	free_buf(buf);
+
+	/* check the return status */
+	if (SLURM_SUCCESS != rc) {
+		PMIXP_ERROR("Cannot send direct modex request to %s", host);
+		cbfunc(PMIX_ERR_COMM_FAILURE, NULL, 0, cbdata, NULL, NULL);
+		return SLURM_ERROR;
+	}
+
+	return rc;
+}
+
+static void _dmdx_req(Buf buf, char *sender_host, uint32_t seq_num)
+{
+	int rank, rc;
+	int status;
+	char *ns = NULL, *sender_ns = NULL;
+	pmixp_namespace_t *nsptr;
+	dmdx_caddy_t *caddy = NULL;
+
+	rc = _read_info(buf, &ns, &rank, &sender_ns,&status);
+	if (SLURM_SUCCESS != rc) {
+		/* there is not much we can do here, but data corruption shouldn't happen */
+		PMIXP_ERROR("Fail to unpack header data in" " request from %s, rc = %d",
+			    sender_host, rc);
+		goto exit;
+	}
+
+	if (0 != xstrcmp(ns, pmixp_info_namespace())) {
+		/* request for namespase that is not controlled by this daemon
+		 * considered as error. This may change in future.  */
+		PMIXP_ERROR("Bad request from %s: asked for" " nspace = %s, mine is %s",
+			    sender_host, ns, pmixp_info_namespace());
+		_respond_with_error(seq_num, sender_host, sender_ns,
+				PMIX_ERR_INVALID_NAMESPACE);
+		goto exit;
+	}
+
+	nsptr = pmixp_nspaces_local();
+	if (nsptr->ntasks <= rank) {
+		PMIXP_ERROR("Bad request from %s: nspace \"%s\"" " has only %d ranks, asked for %d",
+			    sender_host, ns, nsptr->ntasks, rank);
+		_respond_with_error(seq_num, sender_host, sender_ns,
+				PMIX_ERR_BAD_PARAM);
+		goto exit;
+	}
+
+	/* setup temp structure to handle information fro _dmdx_pmix_cb */
+	caddy = xmalloc(sizeof(dmdx_caddy_t));
+	caddy->seq_num = seq_num;
+
+	/* ns is a pointer inside incoming buffer */
+	strncpy(caddy->proc.nspace, ns, PMIX_MAX_NSLEN);
+	ns = NULL; /* protect the data */
+	caddy->proc.rank = rank;
+
+	/* sender_host was passed from outside - copy it */
+	caddy->sender_host = xstrdup(sender_host);
+	sender_host = NULL; /* protect the data */
+
+	/* sender_ns is a pointer inside incoming buffer */
+	caddy->sender_ns = xstrdup(sender_ns);
+	sender_ns = NULL;
+
+	rc = PMIx_server_dmodex_request(&caddy->proc, _dmdx_pmix_cb,
+			(void *)caddy);
+	if (PMIX_SUCCESS != rc) {
+		PMIXP_ERROR("Can't request modex data from libpmix-server," "requesting host = %s, nspace = %s, rank = %d, rc = %d",
+			    caddy->sender_host, caddy->proc.nspace,
+			    caddy->proc.rank, rc);
+		_respond_with_error(seq_num, caddy->sender_host,
+				caddy->sender_ns, rc);
+		_dmdx_free_caddy(caddy);
+	}
+exit:
+	/* we don't need this buffer anymore */
+	free_buf(buf);
+
+	/* no sense to return errors, engine can't do anything
+	 * anyway. We've notified libpmix, that's enough */
+}
+
+static int _dmdx_req_cmp(void *x, void *key)
+{
+	dmdx_req_info_t *req = (dmdx_req_info_t *)x;
+	uint32_t seq_num = *((uint32_t *)key);
+	return (req->seq_num == seq_num);
+}
+
+static void _dmdx_resp(Buf buf, char *sender_host, uint32_t seq_num)
+{
+	dmdx_req_info_t *req;
+	int rank, rc = SLURM_SUCCESS;
+	int status;
+	char *ns = NULL, *sender_ns = NULL;
+	char *data = NULL;
+	uint32_t size = 0;
+
+	/* find the request tracker */
+	ListIterator it = list_iterator_create(_dmdx_requests);
+	req = (dmdx_req_info_t *)list_find(it, _dmdx_req_cmp, &seq_num);
+	if (NULL == req) {
+		/* We haven't sent this request! */
+		PMIXP_ERROR("Received DMDX response with bad " "seq_num=%d from %s!",
+			    seq_num, sender_host);
+		list_iterator_destroy(it);
+		rc = SLURM_ERROR;
+		goto exit;
+	}
+
+	/* get the service data */
+	rc = _read_info(buf, &ns, &rank, &sender_ns, &status);
+	if (SLURM_SUCCESS != rc) {
+		/* notify libpmix about an error */
+		req->cbfunc(PMIX_ERR_UNPACK_FAILURE, NULL, 0, req->cbdata, NULL, NULL);
+		goto exit;
+	}
+
+	/* get the modex blob */
+	if (SLURM_SUCCESS != (rc = unpackmem_ptr(&data, &size, buf))) {
+		/* notify libpmix about an error */
+		req->cbfunc(PMIX_ERR_UNPACK_FAILURE, NULL, 0, req->cbdata, NULL,
+				NULL);
+		goto exit;
+	}
+
+	/* call back to libpmix-server */
+	req->cbfunc(status, data, size, req->cbdata, pmixp_free_Buf,
+			(void *)buf);
+
+	/* release tracker & list iterator */
+	req = NULL;
+	list_delete_item(it);
+	list_iterator_destroy(it);
+exit:
+	if (SLURM_SUCCESS != rc) {
+		/* we are not expect libpmix to call the callback
+		 * to cleanup this buffer */
+		free_buf(buf);
+	}
+	/* no sense to return errors, engine can't do anything
+	 * anyway. We've notified libpmix, that's enough */
+}
+
+void pmixp_dmdx_process(Buf buf, char *host, uint32_t seq)
+{
+	dmdx_type_t type;
+	_read_type(buf, &type);
+
+	switch (type) {
+	case DMDX_REQUEST:
+		_dmdx_req(buf, host, seq);
+		break;
+	case DMDX_RESPONSE:
+		_dmdx_resp(buf, host, seq);
+		break;
+	default:
+		PMIXP_ERROR("Bad request from host %s. Skip", host);
+		break;
+	}
+}
+
+void pmixp_dmdx_timeout_cleanup(void)
+{
+	ListIterator it = list_iterator_create(_dmdx_requests);
+	dmdx_req_info_t *req = NULL;
+	time_t ts = time(NULL);
+
+	/* run through all requests and discard stale one's */
+	while (NULL != (req = list_next(it))) {
+		if ((ts - req->ts) > pmixp_info_timeout()) {
+#ifndef NDEBUG
+			/* respond with the timeout to libpmix */
+			char *host = pmixp_nspace_resolve(req->nspace,
+					req->rank);
+			xassert(NULL != host);
+			PMIXP_ERROR("timeout: ns=%s, rank=%d," " host=%s, ts=%lu",
+				    req->nspace, req->rank,
+				    (NULL != host) ? host : "unknown", ts);
+			if (NULL != host) {
+				free(host);
+			}
+#endif
+			req->cbfunc(PMIX_ERR_TIMEOUT, NULL, 0, req->cbdata,
+					NULL, NULL);
+			/* release tracker & list iterator */
+			list_delete_item(it);
+		}
+	}
+	list_iterator_destroy(it);
+}
diff --git a/src/plugins/mpi/pmix/pmixp_dmdx.h b/src/plugins/mpi/pmix/pmixp_dmdx.h
new file mode 100644
index 000000000..2c87ff03b
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_dmdx.h
@@ -0,0 +1,51 @@
+/*****************************************************************************\
+ **  pmix_debug.h - PMIx debug primitives
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_DMDX_H
+#define PMIXP_DMDX_H
+
+#include "pmixp_common.h"
+#include "pmixp_nspaces.h"
+
+int pmixp_dmdx_init(void);
+int pmixp_dmdx_finalize(void);
+int pmixp_dmdx_get(const char *nspace, int rank,
+		   pmix_modex_cbfunc_t cbfunc, void *cbdata);
+void pmixp_dmdx_process(Buf buf, char *host, uint32_t seq);
+void pmixp_dmdx_timeout_cleanup(void);
+
+#endif /* PMIXP_DMDX_H */
diff --git a/src/plugins/mpi/pmix/pmixp_info.c b/src/plugins/mpi/pmix/pmixp_info.c
new file mode 100644
index 000000000..d2261c5d4
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_info.c
@@ -0,0 +1,336 @@
+/*****************************************************************************\
+ **  pmix_info.c - PMIx various environment information
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include <string.h>
+#include "pmixp_common.h"
+#include "pmixp_debug.h"
+#include "pmixp_info.h"
+
+/* Server communication */
+static char *_server_addr = NULL;
+static int _server_fd = -1;
+
+pmix_jobinfo_t _pmixp_job_info = {0};
+
+static int _resources_set(char ***env);
+static int _env_set(char ***env);
+
+/* stepd global contact information */
+void pmixp_info_srv_contacts(char *path, int fd)
+{
+	_server_addr = xstrdup(path);
+	_server_fd = fd;
+}
+
+const char *pmixp_info_srv_addr(void)
+{
+	/* Check that Server address was initialized */
+	xassert(_server_addr != NULL);
+	return _server_addr;
+}
+
+int pmixp_info_srv_fd(void)
+{
+	/* Check that Server fd was created */
+	xassert(_server_fd >= 0);
+	return _server_fd;
+}
+
+int pmixp_info_set(const stepd_step_rec_t *job, char ***env)
+{
+	int i, rc;
+	size_t msize;
+	memset(&_pmixp_job_info, 0, sizeof(_pmixp_job_info));
+#ifndef NDEBUG
+	_pmixp_job_info.magic = PMIX_INFO_MAGIC;
+#endif
+	/* security info */
+	_pmixp_job_info.uid = job->uid;
+	_pmixp_job_info.gid = job->gid;
+
+	/* This node info */
+	_pmixp_job_info.jobid = job->jobid;
+	_pmixp_job_info.stepid = job->stepid;
+	_pmixp_job_info.node_id = job->nodeid;
+	_pmixp_job_info.node_tasks = job->node_tasks;
+
+	/* Global info */
+	_pmixp_job_info.ntasks = job->ntasks;
+	_pmixp_job_info.nnodes = job->nnodes;
+	msize = sizeof(*_pmixp_job_info.task_cnts) * job->nnodes;
+	_pmixp_job_info.task_cnts = xmalloc(msize);
+	for (i = 0; i < job->nnodes; i++) {
+		_pmixp_job_info.task_cnts[i] = job->task_cnts[i];
+	}
+
+	msize = _pmixp_job_info.node_tasks * sizeof(uint32_t);
+	_pmixp_job_info.gtids = xmalloc(msize);
+	for (i = 0; i < job->node_tasks; i++) {
+		_pmixp_job_info.gtids[i] = job->task[i]->gtid;
+	}
+
+	/* Setup hostnames and job-wide info */
+	if ((rc = _resources_set(env))) {
+		return rc;
+	}
+
+	if ((rc = _env_set(env))) {
+		return rc;
+	}
+
+	snprintf(_pmixp_job_info.nspace, PMIX_MAX_NSLEN, "slurm.pmix.%d.%d",
+			pmixp_info_jobid(), pmixp_info_stepid());
+
+	return SLURM_SUCCESS;
+}
+
+int pmixp_info_free(void)
+{
+	if (NULL != _pmixp_job_info.task_cnts) {
+		xfree(_pmixp_job_info.task_cnts);
+	}
+	if (NULL != _pmixp_job_info.gtids) {
+		xfree(_pmixp_job_info.gtids);
+	}
+
+	if (NULL != _pmixp_job_info.task_map_packed) {
+		xfree(_pmixp_job_info.task_map_packed);
+	}
+
+	hostlist_destroy(_pmixp_job_info.job_hl);
+	hostlist_destroy(_pmixp_job_info.step_hl);
+	if (NULL != _pmixp_job_info.hostname) {
+		xfree(_pmixp_job_info.hostname);
+	}
+	return SLURM_SUCCESS;
+}
+
+static eio_handle_t *_io_handle = NULL;
+
+void pmixp_info_io_set(eio_handle_t *h)
+{
+	_io_handle = h;
+}
+
+eio_handle_t *pmixp_info_io()
+{
+	xassert(_io_handle != NULL);
+	return _io_handle;
+}
+
+/*
+ * Job and step nodes/tasks count and hostname extraction routines
+ */
+
+/*
+ * Derived from src/srun/libsrun/opt.c
+ * _get_task_count()
+ *
+ * FIXME: original _get_task_count has some additinal ckeck
+ * for opt.ntasks_per_node & opt.cpus_set
+ * Should we care here?
+ static int _get_task_count(char ***env, uint32_t *tasks, uint32_t *cpus)
+ {
+ pmixp_debug_hang(1);
+ char *cpus_per_node = NULL, *cpus_per_task_env = NULL, *end_ptr = NULL;
+ int cpus_per_task = 1, cpu_count, node_count, task_count;
+ int total_tasks = 0, total_cpus = 0;
+
+ cpus_per_node = getenvp(*env, PMIX_CPUS_PER_NODE_ENV);
+ if (cpus_per_node == NULL) {
+ PMIXP_ERROR_NO(0,"Cannot find %s environment variable", PMIX_CPUS_PER_NODE_ENV);
+ return SLURM_ERROR;
+ }
+ cpus_per_task_env = getenvp(*env, PMIX_CPUS_PER_TASK);
+ if (cpus_per_task_env != NULL) {
+ cpus_per_task = strtol(cpus_per_task_env, &end_ptr, 10);
+ }
+
+ cpu_count = strtol(cpus_per_node, &end_ptr, 10);
+ task_count = cpu_count / cpus_per_task;
+ while (1) {
+ if ((end_ptr[0] == '(') && (end_ptr[1] == 'x')) {
+ end_ptr += 2;
+ node_count = strtol(end_ptr, &end_ptr, 10);
+ task_count *= node_count;
+ total_tasks += task_count;
+ cpu_count *= node_count;
+ total_cpus += cpu_count;
+ if (end_ptr[0] == ')')
+ end_ptr++;
+ } else if ((end_ptr[0] == ',') || (end_ptr[0] == 0))
+ total_tasks += task_count;
+ else {
+ PMIXP_ERROR_NO(0,"Invalid value for environment variable %s (%s)",
+ PMIX_CPUS_PER_NODE_ENV, cpus_per_node);
+ return SLURM_ERROR;
+ }
+ if (end_ptr[0] == ',')
+ end_ptr++;
+ if (end_ptr[0] == 0)
+ break;
+ }
+ *tasks = total_tasks;
+ *cpus = total_cpus;
+ return 0;
+ }
+ */
+
+static int _resources_set(char ***env)
+{
+	char *p = NULL;
+
+	/* Initialize all memory pointers that would be allocated to NULL
+	 * So in case of error exit we will know what to xfree
+	 */
+	_pmixp_job_info.job_hl = hostlist_create("");
+	_pmixp_job_info.step_hl = hostlist_create("");
+	_pmixp_job_info.hostname = NULL;
+
+	/* Save step host list */
+	p = getenvp(*env, PMIXP_STEP_NODES_ENV);
+	if (!p) {
+		PMIXP_ERROR_NO(ENOENT, "Environment variable %s not found",
+				PMIXP_STEP_NODES_ENV);
+		goto err_exit;
+	}
+	hostlist_push(_pmixp_job_info.step_hl, p);
+
+	/* Extract our node name */
+	p = hostlist_nth(_pmixp_job_info.step_hl, _pmixp_job_info.node_id);
+	_pmixp_job_info.hostname = xstrdup(p);
+	free(p);
+
+	/* Determine job-wide node id and job-wide node count */
+	p = getenvp(*env, PMIXP_JOB_NODES_ENV);
+	if (p == NULL) {
+		p = getenvp(*env, PMIXP_JOB_NODES_ENV_DEP);
+		if (p == NULL) {
+			/* shouldn't happen if we are under SLURM! */
+			PMIXP_ERROR_NO(ENOENT, "Neither of nodelist environment variables: %s OR %s was found!",
+					PMIXP_JOB_NODES_ENV, PMIXP_JOB_NODES_ENV_DEP);
+			goto err_exit;
+		}
+	}
+	hostlist_push(_pmixp_job_info.job_hl, p);
+	_pmixp_job_info.nnodes_job = hostlist_count(_pmixp_job_info.job_hl);
+	_pmixp_job_info.node_id_job = hostlist_find(_pmixp_job_info.job_hl,
+			_pmixp_job_info.hostname);
+
+	/* FIXME!! ------------------------------------------------------------- */
+	/* TODO: _get_task_count not always works well.
+	 if (_get_task_count(env, &_pmixp_job_info.ntasks_job, &_pmixp_job_info.ncpus_job) < 0) {
+	 _pmixp_job_info.ntasks_job  = _pmixp_job_info.ntasks;
+	 _pmixp_job_info.ncpus_job  = _pmixp_job_info.ntasks;
+	 }
+	 xassert(_pmixp_job_info.ntasks <= _pmixp_job_info.ntasks_job);
+	 */
+	_pmixp_job_info.ntasks_job = _pmixp_job_info.ntasks;
+	_pmixp_job_info.ncpus_job = _pmixp_job_info.ntasks;
+
+	/* Save task-to-node mapping */
+	p = getenvp(*env, PMIXP_SLURM_MAPPING_ENV);
+	if (p == NULL) {
+		/* Direct modex won't work */
+		PMIXP_ERROR_NO(ENOENT, "No %s environment variable found!",
+				PMIXP_SLURM_MAPPING_ENV);
+		goto err_exit;
+	}
+
+	_pmixp_job_info.task_map_packed = xstrdup(p);
+
+	return SLURM_SUCCESS;
+err_exit:
+	hostlist_destroy(_pmixp_job_info.job_hl);
+	hostlist_destroy(_pmixp_job_info.step_hl);
+	if (NULL != _pmixp_job_info.hostname) {
+		xfree(_pmixp_job_info.hostname);
+	}
+	return SLURM_ERROR;
+}
+
+static int _env_set(char ***env)
+{
+	char *p = NULL;
+	char *spool = slurm_get_slurmd_spooldir();
+
+	/* ----------- Temp directories settings ------------- */
+	_pmixp_job_info.lib_tmpdir = xstrdup_printf("%s/pmix.%d.%d/", spool,
+			pmixp_info_jobid(), pmixp_info_stepid());
+	xfree(spool);
+
+	/* save client temp directory if requested
+	 * TODO: We want to get TmpFS value as well if exists.
+	 * Need to sync with SLURM developers.
+	 */
+	p = getenvp(*env, PMIXP_TMPDIR_CLI);
+	if (NULL != p) {
+		_pmixp_job_info.cli_tmpdir = xstrdup(p);
+	} else {
+		p = slurm_get_tmp_fs();
+		if (NULL != p) {
+			_pmixp_job_info.cli_tmpdir = p;
+		}
+	}
+
+	/* ----------- Timeout setting ------------- */
+	/* TODO: also would be nice to have a cluster-wide setting in SLURM */
+	_pmixp_job_info.timeout = PMIXP_TIMEOUT_DEFAULT;
+	p = getenvp(*env, PMIXP_TIMEOUT);
+	if (NULL != p) {
+		int tmp;
+		tmp = atoi(p);
+		if (tmp > 0) {
+			_pmixp_job_info.timeout = tmp;
+		}
+	}
+
+	/* ----------- Forward PMIX settings ------------- */
+	/* FIXME: this may be intrusive as well as PMIx library will create
+	 * lots of output files in /tmp by default.
+	 * somebody can use this or annoyance */
+	p = getenvp(*env, PMIXP_PMIXLIB_DEBUG);
+	if (NULL != p) {
+		setenv(PMIXP_PMIXLIB_DEBUG, p, 1);
+		/* output into the file since we are in slurmstepd
+		 * and stdout is muted.
+		 * One needs to check TMPDIR for the results */
+		setenv(PMIXP_PMIXLIB_DEBUG_REDIR, "file", 1);
+	}
+
+	return SLURM_SUCCESS;
+}
diff --git a/src/plugins/mpi/pmix/pmixp_info.h b/src/plugins/mpi/pmix/pmixp_info.h
new file mode 100644
index 000000000..b51fec493
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_info.h
@@ -0,0 +1,278 @@
+/*****************************************************************************\
+ **  pmix_info.h - PMIx various environment information
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_INFO_H
+#define PMIXP_INFO_H
+
+#include "pmixp_common.h"
+
+/*
+ *  Slurm job and job-step information
+ */
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIX_INFO_MAGIC 0xCAFEFACE
+	int magic;
+#endif
+	char nspace[PMIX_MAX_NSLEN];
+	uint32_t jobid; /* Current SLURM job id */
+	uint32_t stepid; /* Current step id (or NO_VAL) */
+	uint32_t nnodes; /* number of nodes in current step */
+	uint32_t nnodes_job; /* number of nodes in current job */
+	uint32_t ntasks; /* total number of tasks in current step */
+	uint32_t ntasks_job; /* total possible number of tasks in job */
+	uint32_t ncpus_job; /* total possible number of cpus in job */
+	uint32_t *task_cnts; /* Number of tasks on each node in this step */
+	int node_id; /* relative position of this node in this step */
+	int node_id_job; /* relative position of this node in SLURM job */
+	hostlist_t job_hl;
+	hostlist_t step_hl;
+	char *hostname;
+	uint32_t node_tasks; /* number of tasks on *this* node */
+	uint32_t *gtids; /* global ids of tasks located on *this* node */
+	char *task_map_packed; /* string represents packed task mapping information */
+	int timeout;
+	char *cli_tmpdir;
+	char *lib_tmpdir;
+	uid_t uid;
+	gid_t gid;
+} pmix_jobinfo_t;
+
+extern pmix_jobinfo_t _pmixp_job_info;
+
+/* slurmd contact information */
+void pmixp_info_srv_contacts(char *path, int fd);
+const char *pmixp_info_srv_addr(void);
+int pmixp_info_srv_fd(void);
+
+static inline int pmixp_info_timeout(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.timeout;
+}
+
+/* My hostname */
+static inline char *pmixp_info_hostname(void)
+{
+	return _pmixp_job_info.hostname;
+}
+
+/* Cli tempdir */
+static inline char *pmixp_info_tmpdir_cli(void)
+{
+	return _pmixp_job_info.cli_tmpdir;
+}
+
+/* Cli tempdir */
+static inline char *pmixp_info_tmpdir_lib(void)
+{
+	return _pmixp_job_info.lib_tmpdir;
+}
+
+/* Dealing with I/O */
+void pmixp_info_io_set(eio_handle_t *h);
+eio_handle_t *pmixp_info_io();
+
+/* Job information */
+int pmixp_info_set(const stepd_step_rec_t *job, char ***env);
+int pmixp_info_free(void);
+
+static inline uint32_t pmixp_info_jobuid(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.uid;
+}
+
+static inline uint32_t pmixp_info_jobgid(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.gid;
+}
+
+static inline uint32_t pmixp_info_jobid(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.jobid;
+}
+
+static inline uint32_t pmixp_info_stepid(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.stepid;
+}
+
+static inline char *pmixp_info_namespace(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.nspace;
+}
+
+static inline uint32_t pmixp_info_nodeid(void)
+{
+	/* This routine is called from PMIX_DEBUG/ERROR and
+	 * this CAN happen before initialization. Relax demand to have
+	 * _pmix_job_info.magic == PMIX_INFO_MAGIC
+	 * ! xassert(_pmix_job_info.magic == PMIX_INFO_MAGIC);
+	 */
+	return _pmixp_job_info.node_id;
+}
+
+static inline uint32_t pmixp_info_nodeid_job(void)
+{
+	/* This routine is called from PMIX_DEBUG/ERROR and
+	 * this CAN happen before initialization. Relax demand to have
+	 * _pmix_job_info.magic == PMIX_INFO_MAGIC
+	 * ! xassert(_pmix_job_info.magic == PMIX_INFO_MAGIC);
+	 */
+	return _pmixp_job_info.node_id_job;
+}
+
+static inline uint32_t pmixp_info_nodes(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.nnodes;
+}
+
+static inline uint32_t pmixp_info_nodes_uni(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.nnodes_job;
+}
+
+static inline uint32_t pmixp_info_tasks(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.ntasks;
+}
+
+static inline uint32_t pmixp_info_tasks_node(uint32_t nodeid)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	xassert(nodeid < _pmixp_job_info.nnodes);
+	return _pmixp_job_info.task_cnts[nodeid];
+}
+
+static inline uint32_t *pmixp_info_tasks_cnts(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.task_cnts;
+}
+
+static inline uint32_t pmixp_info_tasks_loc(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.node_tasks;
+}
+
+static inline uint32_t pmixp_info_tasks_uni(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.ntasks_job;
+}
+
+static inline uint32_t pmixp_info_cpus(void)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	return _pmixp_job_info.ncpus_job;
+}
+
+static inline uint32_t pmixp_info_taskid(uint32_t localid)
+{
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	xassert(localid < _pmixp_job_info.node_tasks);
+	return _pmixp_job_info.gtids[localid];
+}
+
+/*
+ * Since tasks array in SLURM job structure is uint16_t
+ * task local id can't be grater than 2^16. So we can
+ * safely return int here. We need (-1) for the not-found case
+ */
+static inline int pmixp_info_taskid2localid(uint32_t taskid)
+{
+	int i;
+	xassert(_pmixp_job_info.magic == PMIX_INFO_MAGIC);
+	xassert(taskid < _pmixp_job_info.ntasks);
+
+	for (i = 0; i < _pmixp_job_info.node_tasks; i++) {
+		if (_pmixp_job_info.gtids[i] == taskid)
+			return i;
+	}
+	return -1;
+}
+
+static inline char *pmixp_info_task_map(void)
+{
+	return _pmixp_job_info.task_map_packed;
+}
+
+static inline hostlist_t pmixp_info_step_hostlist(void)
+{
+	return _pmixp_job_info.step_hl;
+}
+
+static inline char *pmixp_info_step_host(int nodeid)
+{
+	xassert(nodeid < _pmixp_job_info.nnodes);
+	char *p = hostlist_nth(_pmixp_job_info.step_hl, nodeid);
+	char *ret = xstrdup(p);
+	free(p);
+	return ret;
+}
+
+static inline char *pmixp_info_job_host(int nodeid)
+{
+	xassert(nodeid < _pmixp_job_info.nnodes_job);
+	char *p = hostlist_nth(_pmixp_job_info.job_hl, nodeid);
+	char *ret = xstrdup(p);
+	free(p);
+	return ret;
+}
+
+/* namespaces list operations */
+static inline char *pmixp_info_nspace_usock(const char *nspace)
+{
+	char *spool, *usock = NULL;
+	debug("mpi/pmix: setup sockets");
+	spool = slurm_get_slurmd_spooldir();
+	xstrfmtcat(usock, "%s/stepd.%s", spool, nspace);
+	xfree(spool);
+	return usock;
+}
+
+#endif /* PMIXP_INFO_H */
diff --git a/src/plugins/mpi/pmix/pmixp_io.c b/src/plugins/mpi/pmix/pmixp_io.c
new file mode 100644
index 000000000..3581a8f13
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_io.c
@@ -0,0 +1,448 @@
+/*****************************************************************************\
+ **  pmix_io.c - PMIx non-blocking IO routines
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <errno.h>
+
+#include "pmixp_common.h"
+#include "pmixp_io.h"
+#include "pmixp_debug.h"
+#include "pmixp_utils.h"
+
+void pmix_io_init(pmixp_io_engine_t *eng, int fd,
+		pmixp_io_engine_header_t header)
+{
+	/* Initialize general options */
+#ifndef NDEBUG
+	eng->magic = PMIX_MSGSTATE_MAGIC;
+#endif
+	eng->error = 0;
+	eng->sd = fd;
+	eng->header = header;
+	eng->operating = true;
+
+	if (header.pack_hdr_cb == NULL && header.unpack_hdr_cb == NULL) {
+		xassert(header.host_size == header.net_size);
+	}
+	/* Init receiver */
+	eng->rcvd_hdr = xmalloc(eng->header.net_size);
+	if (eng->header.unpack_hdr_cb) {
+		eng->rcvd_hdr_host = xmalloc(eng->header.host_size);
+	} else {
+		eng->rcvd_hdr_host = eng->rcvd_hdr;
+	}
+
+	eng->rcvd_pay_size = 0;
+	eng->rcvd_payload = NULL;
+	eng->rcvd_hdr_offs = eng->rcvd_pay_offs = 0;
+	eng->rcvd_padding = 0;
+	/* Init transmitter */
+	eng->send_current = NULL;
+	if (eng->header.pack_hdr_cb) {
+		eng->send_hdr_net = xmalloc(eng->header.net_size);
+	}
+	eng->send_hdr_size = eng->send_hdr_offs = 0;
+	eng->send_payload = NULL;
+	eng->send_pay_size = eng->send_pay_offs = 0;
+	eng->send_queue = list_create(pmixp_xfree_xmalloced);
+}
+
+void pmix_io_finalize(pmixp_io_engine_t *eng, int error)
+{
+	if (!eng->operating) {
+		return;
+	}
+	eng->operating = false;
+
+	/* Free transmitter */
+	if (list_count(eng->send_queue)) {
+		list_destroy(eng->send_queue);
+	}
+	if (NULL != eng->send_current) {
+		xfree(eng->send_current);
+	}
+	eng->send_current = NULL;
+	eng->send_payload = NULL;
+	eng->send_pay_size = eng->send_pay_offs = 0;
+	if (eng->header.pack_hdr_cb) {
+		xfree(eng->send_hdr_net);
+	}
+	eng->send_hdr_size = eng->send_hdr_offs = 0;
+
+	/* Free receiver */
+	if (NULL != eng->rcvd_payload) {
+		xfree(eng->rcvd_payload);
+	}
+
+	xfree(eng->rcvd_hdr);
+	if (eng->header.unpack_hdr_cb) {
+		xfree(eng->rcvd_hdr_host);
+	}
+	eng->rcvd_hdr = NULL;
+	eng->rcvd_hdr_host = NULL;
+
+	eng->rcvd_pay_size = 0;
+	eng->rcvd_payload = NULL;
+	eng->rcvd_hdr_offs = eng->rcvd_pay_offs = 0;
+
+	if (error < 0) {
+		eng->error = -error;
+	} else {
+		eng->error = 0;
+	}
+}
+
+/* Receiver */
+
+int pmix_io_first_header(int fd, void *buf, uint32_t *_offs, uint32_t len)
+{
+	int shutdown;
+	uint32_t offs = *_offs;
+
+	offs += pmixp_read_buf(fd, buf + offs, len, &shutdown, true);
+	*_offs = offs;
+	if (shutdown) {
+		if (shutdown < 0) {
+			PMIXP_ERROR_NO(shutdown, "Unexpected connection close");
+		} else {
+			PMIXP_DEBUG("Unexpected connection close");
+		}
+		return SLURM_ERROR;
+	}
+	return 0;
+}
+
+static inline void _rcvd_next_message(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->rcvd_hdr != NULL);
+	xassert(eng->operating);
+
+	eng->rcvd_pad_recvd = 0;
+	eng->rcvd_hdr_offs = 0;
+	eng->rcvd_pay_offs = eng->rcvd_pay_size = 0;
+	eng->rcvd_payload = NULL;
+
+}
+
+static inline int _rcvd_swithch_to_body(pmixp_io_engine_t *eng)
+{
+	int rc;
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+	xassert(eng->header.net_size == eng->rcvd_hdr_offs);
+
+	eng->rcvd_pay_offs = eng->rcvd_pay_size = 0;
+	eng->rcvd_payload = NULL;
+	if (eng->header.unpack_hdr_cb) {
+		/* If this is inter-node communication - unpack the buffer first */
+		rc = eng->header.unpack_hdr_cb(eng->rcvd_hdr, eng->rcvd_hdr_host);
+		if (0 != rc) {
+			PMIXP_ERROR_NO(rc, "Cannot unpack message header");
+			return rc;
+		}
+	}
+	eng->rcvd_pay_size = eng->header.pay_size_cb(eng->rcvd_hdr_host);
+	eng->rcvd_payload = xmalloc(eng->rcvd_pay_size);
+	return 0;
+}
+
+static inline bool _rcvd_have_padding(pmixp_io_engine_t *eng)
+{
+	return eng->rcvd_padding && eng->rcvd_pad_recvd < eng->rcvd_padding;
+}
+
+static inline bool _rcvd_need_header(pmixp_io_engine_t *eng)
+{
+	return eng->rcvd_hdr_offs < eng->header.net_size;
+}
+
+void pmix_io_rcvd(pmixp_io_engine_t *eng)
+{
+	size_t size, remain;
+	void *offs;
+	int shutdown;
+	int fd = eng->sd;
+
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+
+	if (pmix_io_finalized(eng)) {
+		return;
+	}
+
+	if (pmix_io_rcvd_ready(eng)) {
+		/* nothing to do,
+		 * first the current message has to be extracted
+		 */
+		return;
+	}
+	/* Drop padding first so it won't corrupt the message */
+	if (_rcvd_have_padding(eng)) {
+		char buf[eng->rcvd_padding];
+		size = eng->rcvd_padding;
+		remain = size - eng->rcvd_pad_recvd;
+		eng->rcvd_pad_recvd +=
+			pmixp_read_buf(fd, buf, remain, &shutdown, false);
+		if (shutdown) {
+			pmix_io_finalize(eng, 0);
+			return;
+		}
+		if (eng->rcvd_pad_recvd < size) {
+			/* normal return. receive another portion of header later */
+			return;
+		}
+	}
+
+	if (_rcvd_need_header(eng)) {
+		/* need to finish with the header */
+		size = eng->header.net_size;
+		remain = size - eng->rcvd_hdr_offs;
+		offs = eng->rcvd_hdr + eng->rcvd_hdr_offs;
+		eng->rcvd_hdr_offs +=
+			pmixp_read_buf(fd, offs, remain, &shutdown, false);
+		if (shutdown) {
+			pmix_io_finalize(eng, shutdown);
+			return;
+		}
+		if (eng->rcvd_hdr_offs < size) {
+			/* normal return. receive another portion of header later */
+			return;
+		}
+		/* if we are here then header is received and we can adjust buffer */
+		if ((shutdown = _rcvd_swithch_to_body(eng))) {
+			pmix_io_finalize(eng, shutdown);
+			return;
+		}
+		/* go ahared with body receive */
+	}
+	/* we are receiving the body */
+	xassert(eng->rcvd_hdr_offs == eng->header.net_size);
+	if (0 == eng->rcvd_pay_size) {
+		/* zero-byte message. exit. next time we will hit pmix_nbmsg_rcvd_ready */
+		return;
+	}
+	size = eng->rcvd_pay_size;
+	remain = size - eng->rcvd_pay_offs;
+	eng->rcvd_pay_offs +=
+		pmixp_read_buf(fd, eng->rcvd_payload + eng->rcvd_pay_offs,
+			remain, &shutdown, false);
+	if (shutdown) {
+		pmix_io_finalize(eng, 0);
+		return;
+	}
+	if (eng->rcvd_pay_offs == size) {
+		/* normal return. receive another portion later */
+		PMIXP_DEBUG("Message is ready for processing!");
+		return;
+	}
+
+}
+
+void *pmix_io_rcvd_extract(pmixp_io_engine_t *eng, void *header)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+	xassert(pmix_io_rcvd_ready(eng));
+
+	void *ptr = eng->rcvd_payload;
+	memcpy(header, eng->rcvd_hdr_host, (size_t)eng->header.host_size);
+	/* Drop message state to receive new one */
+	_rcvd_next_message(eng);
+	return ptr;
+}
+
+/* Transmitter */
+
+static inline int _send_set_current(pmixp_io_engine_t *eng, void *msg)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+
+	/* Set message basis */
+	eng->send_current = msg;
+
+	/* Setup header for sending */
+	if (eng->header.pack_hdr_cb) {
+		eng->send_hdr_size =
+			eng->header.pack_hdr_cb(msg, eng->send_hdr_net);
+		xassert(eng->send_hdr_size > 0);
+	} else {
+		eng->send_hdr_net = msg;
+		eng->send_hdr_size = eng->header.net_size;
+	}
+	eng->send_hdr_offs = 0;
+
+	/* Setup payload for sending */
+	eng->send_payload = (char *)msg + eng->header.host_size;
+	eng->send_pay_size = eng->header.pay_size_cb(msg);
+	eng->send_pay_offs = 0;
+	return 0;
+}
+
+static inline void _send_free_current(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+	xassert(eng->send_current);
+
+	eng->send_payload = NULL;
+	eng->send_pay_size = eng->send_pay_offs = 0;
+
+	if (eng->header.pack_hdr_cb == NULL) {
+		eng->send_hdr_net = NULL;
+	}
+	eng->send_hdr_size = eng->send_hdr_offs = 0;
+	xfree(eng->send_current);
+	eng->send_current = NULL;
+}
+
+static inline int _send_header_ok(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+	xassert(eng->send_current != NULL);
+
+	return (eng->send_current != NULL) && (eng->send_hdr_size > 0)
+			&& (eng->send_hdr_offs == eng->send_hdr_size);
+}
+
+static inline int _send_payload_ok(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+
+	return (eng->send_current != NULL) && _send_header_ok(eng)
+			&& (eng->send_pay_size > 0)
+			&& (eng->send_pay_offs == eng->send_pay_size);
+}
+
+void pmix_io_send_enqueue(pmixp_io_engine_t *eng, void *msg)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+	if (eng->send_current == NULL) {
+		_send_set_current(eng, msg);
+	} else {
+		list_enqueue(eng->send_queue, msg);
+	}
+	pmix_io_send_progress(eng);
+}
+
+bool pmix_io_send_pending(pmixp_io_engine_t *eng)
+{
+	int rc;
+
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+
+	if (_send_payload_ok(eng)) {
+		/* The current message is send. Cleanup current msg */
+		_send_free_current(eng);
+	}
+
+	if (eng->send_current == NULL) {
+		/* Try next element */
+		int n = list_count(eng->send_queue);
+		if (0 == n) {
+			/* Nothing to do */
+			return false;
+		}
+		void *msg = list_dequeue(eng->send_queue);
+		xassert(msg != NULL);
+		if ((rc = _send_set_current(eng, msg))) {
+			PMIXP_ERROR_NO(rc, "Cannot switch to the next message");
+			pmix_io_finalize(eng, rc);
+		}
+	}
+	return true;
+}
+
+void pmix_io_send_progress(pmixp_io_engine_t *eng)
+{
+	int fd = eng->sd;
+	uint32_t size, remain;
+	void *offs;
+
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	xassert(eng->operating);
+
+	while (pmix_io_send_pending(eng)) {
+		/* try to send everything untill fd became blockable
+		 * FIXME: maybe set some restriction on number of messages sended at once
+		 */
+		int shutdown = 0;
+		if (!_send_header_ok(eng)) {
+			size = eng->send_hdr_size;
+			remain = size - eng->send_hdr_offs;
+			offs = eng->send_hdr_net + eng->send_hdr_offs;
+			int cnt = pmixp_write_buf(fd, offs, remain, &shutdown,
+					false);
+			if (shutdown) {
+				pmix_io_finalize(eng, shutdown);
+				return;
+			}
+			if (cnt == 0) {
+				break;
+			}
+			eng->send_hdr_offs += cnt;
+			if (!_send_header_ok(eng)) {
+				/* Go to the next interation and try to finish header reception */
+				continue;
+			}
+		}
+
+		if (_send_header_ok(eng)) {
+			size = eng->send_pay_size;
+			remain = size - eng->send_pay_offs;
+			offs = eng->send_payload + eng->send_pay_offs;
+			int cnt = pmixp_write_buf(fd, offs, remain, &shutdown,
+					false);
+			if (shutdown) {
+				pmix_io_finalize(eng, shutdown);
+				return;
+			}
+			if (0 == cnt) {
+				break;
+			}
+			eng->send_pay_offs += cnt;
+		}
+	}
+}
diff --git a/src/plugins/mpi/pmix/pmixp_io.h b/src/plugins/mpi/pmix/pmixp_io.h
new file mode 100644
index 000000000..d5f5cc0e1
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_io.h
@@ -0,0 +1,126 @@
+/*****************************************************************************\
+ **  pmix_io.h - PMIx non-blocking IO routines
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_IO_H
+#define PMIXP_IO_H
+
+#include <poll.h>
+#include "pmixp_common.h"
+#include "pmixp_utils.h"
+
+/* Message management */
+
+typedef uint32_t (*pmix_io_engine_hsize_cb_t)(void *hdr);
+typedef int (*pmix_io_engine_hpack_cb_t)(void *hdr_host, void *hdr_net);
+typedef int (*pmix_io_engine_hunpack_cb_t)(void *hdr_net, void *hdr_host);
+typedef struct {
+	uint32_t host_size, net_size;
+	pmix_io_engine_hpack_cb_t pack_hdr_cb;
+	pmix_io_engine_hunpack_cb_t unpack_hdr_cb;
+	pmix_io_engine_hsize_cb_t pay_size_cb;
+} pmixp_io_engine_header_t;
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIX_MSGSTATE_MAGIC 0xC0FFEEEE
+	int magic;
+#endif
+	/* User supplied information */
+	int sd;
+	int error;
+	pmixp_io_engine_header_t header;
+	bool operating;
+	/* receiver */
+	uint32_t rcvd_hdr_offs;
+	void *rcvd_hdr;
+	void *rcvd_hdr_host;
+	uint32_t rcvd_pay_size;
+	uint32_t rcvd_pay_offs;
+	void *rcvd_payload;
+	uint32_t rcvd_padding;
+	uint32_t rcvd_pad_recvd;
+	/* sender */
+	void *send_current;
+	void *send_hdr_net;
+	uint32_t send_hdr_offs;
+	uint32_t send_hdr_size;
+	void *send_payload;
+	uint32_t send_pay_offs;
+	uint32_t send_pay_size;
+	List send_queue;
+} pmixp_io_engine_t;
+
+static inline void pmix_io_rcvd_padding(pmixp_io_engine_t *eng,
+		uint32_t padsize)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	eng->rcvd_padding = padsize;
+}
+
+static inline bool pmix_io_rcvd_ready(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	return (eng->rcvd_hdr_offs == eng->header.net_size)
+			&& (eng->rcvd_pay_size == eng->rcvd_pay_offs);
+}
+
+static inline bool pmix_io_finalized(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	return !(eng->operating);
+}
+
+static inline int pmix_io_error(pmixp_io_engine_t *eng)
+{
+	xassert(eng->magic == PMIX_MSGSTATE_MAGIC);
+	return eng->error;
+}
+
+void pmix_io_init(pmixp_io_engine_t *eng, int fd,
+		pmixp_io_engine_header_t header);
+void pmix_io_finalize(pmixp_io_engine_t *eng, int error);
+
+/* Receiver */
+int pmix_io_first_header(int fd, void *buf, uint32_t *_offs, uint32_t len);
+void pmix_io_rcvd(pmixp_io_engine_t *eng);
+void *pmix_io_rcvd_extract(pmixp_io_engine_t *eng, void *header);
+/* Transmitter */
+void pmix_io_send_enqueue(pmixp_io_engine_t *eng, void *msg);
+void pmix_io_send_progress(pmixp_io_engine_t *eng);
+bool pmix_io_send_pending(pmixp_io_engine_t *eng);
+
+#endif /* PMIXP_IO_H */
diff --git a/src/plugins/mpi/pmix/pmixp_nspaces.c b/src/plugins/mpi/pmix/pmixp_nspaces.c
new file mode 100644
index 000000000..af68df16f
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_nspaces.c
@@ -0,0 +1,197 @@
+/*****************************************************************************\
+ **  pmix_db.c - PMIx KVS database
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "pmixp_nspaces.h"
+
+pmixp_db_t _pmixp_nspaces;
+
+static void _xfree_nspace(void *n)
+{
+	pmixp_namespace_t *nsptr = n;
+	xfree(nsptr->task_cnts);
+	xfree(nsptr->task_map);
+	xfree(nsptr->task_map_packed);
+	xfree(nsptr);
+}
+
+int pmixp_nspaces_init(void)
+{
+	char *mynspace, *task_map;
+	uint32_t nnodes, ntasks, *task_cnts;
+	int nodeid, rc;
+	hostlist_t hl;
+
+#ifndef NDEBUG
+	_pmixp_nspaces.magic = PMIXP_NSPACE_DB_MAGIC;
+#endif
+	_pmixp_nspaces.nspaces = list_create(_xfree_nspace);
+	mynspace = pmixp_info_namespace();
+	nnodes = pmixp_info_nodes();
+	nodeid = pmixp_info_nodeid();
+	ntasks = pmixp_info_tasks();
+	task_cnts = pmixp_info_tasks_cnts();
+	task_map = pmixp_info_task_map();
+	hl = pmixp_info_step_hostlist();
+	/* Initialize local namespace */
+	rc = pmixp_nspaces_add(mynspace, nnodes, nodeid, ntasks, task_cnts,
+				task_map, hostlist_copy(hl));
+	_pmixp_nspaces.local = pmixp_nspaces_find(mynspace);
+	return rc;
+}
+
+int pmixp_nspaces_finalize(void)
+{
+	list_destroy(_pmixp_nspaces.nspaces);
+	return 0;
+}
+
+int pmixp_nspaces_add(char *name, uint32_t nnodes, int node_id,
+		      uint32_t ntasks, uint32_t *task_cnts,
+		      char *task_map_packed, hostlist_t hl)
+{
+	pmixp_namespace_t *nsptr = xmalloc(sizeof(pmixp_namespace_t));
+	int i;
+
+	xassert(_pmixp_nspaces.magic == PMIXP_NSPACE_DB_MAGIC);
+
+	/* fill up informational part */
+#ifndef NDEBUG
+	nsptr->magic = PMIXP_NSPACE_MAGIC;
+#endif
+	strcpy(nsptr->name, name);
+	nsptr->nnodes = nnodes;
+	nsptr->node_id = node_id;
+	nsptr->ntasks = ntasks;
+	nsptr->task_cnts = xmalloc(sizeof(uint32_t) * nnodes);
+	/* Cannot use memcpy here because of different types */
+	for (i = 0; i < nnodes; i++) {
+		nsptr->task_cnts[i] = task_cnts[i];
+	}
+	nsptr->task_map_packed = xstrdup(task_map_packed);
+	nsptr->task_map = unpack_process_mapping_flat(task_map_packed, nnodes,
+							ntasks, NULL);
+	if (nsptr->task_map == NULL) {
+		xfree(nsptr->task_cnts);
+		xfree(nsptr->task_map_packed);
+		return SLURM_ERROR;
+	}
+	nsptr->hl = hl;
+	list_append(_pmixp_nspaces.nspaces, nsptr);
+	return SLURM_SUCCESS;
+}
+
+pmixp_namespace_t *pmixp_nspaces_local()
+{
+	xassert(_pmixp_nspaces.magic == PMIXP_NSPACE_DB_MAGIC);
+	return _pmixp_nspaces.local;
+}
+
+pmixp_namespace_t *pmixp_nspaces_find(const char *name)
+{
+	xassert(_pmixp_nspaces.magic == PMIXP_NSPACE_DB_MAGIC);
+
+	ListIterator it = list_iterator_create(_pmixp_nspaces.nspaces);
+	pmixp_namespace_t *nsptr = NULL;
+	while (NULL != (nsptr = list_next(it))) {
+		xassert(nsptr->magic == PMIXP_NSPACE_MAGIC);
+		if (0 == xstrcmp(nsptr->name, name)) {
+			goto exit;
+		}
+	}
+	/* Didn't found one! */
+	nsptr = NULL;
+exit:
+	return nsptr;
+}
+
+hostlist_t pmixp_nspace_rankhosts(pmixp_namespace_t *nsptr, const int *ranks,
+		size_t nranks)
+{
+	hostlist_t hl = hostlist_create("");
+	int i;
+	for (i = 0; i < nranks; i++) {
+		int rank = ranks[i];
+		int node = nsptr->task_map[rank];
+		char *node_s = hostlist_nth(nsptr->hl, node);
+		hostlist_push(hl, node_s);
+		free(node_s);
+	}
+	hostlist_uniq(hl);
+	return hl;
+}
+
+char *pmixp_nspace_resolve(const char *name, int rank)
+{
+	pmixp_namespace_t *nsptr;
+
+	xassert(_pmixp_nspaces.magic == PMIXP_NSPACE_DB_MAGIC);
+
+	ListIterator it = list_iterator_create(_pmixp_nspaces.nspaces);
+	while (NULL != (nsptr = list_next(it))) {
+		xassert(nsptr->magic == PMIXP_NSPACE_MAGIC);
+		if (0 == xstrcmp(nsptr->name, name)) {
+			break;
+		}
+	}
+
+	if (NULL == nsptr) {
+		return NULL;
+	}
+	xassert(rank < nsptr->ntasks);
+
+	return hostlist_nth(nsptr->hl, nsptr->task_map[rank]);
+}
+
+size_t pmixp_nspace_mdx_lsize(List l)
+{
+	ListIterator it = list_iterator_create(l);
+	pmix_modex_data_t *data;
+	size_t ret = 0;
+
+	while (NULL != (data = list_next(it))) {
+		/* we need to save:
+		 * - rank (uint32_t)
+		 * - scope (uint32_t)
+		 * - size of the blob (uint32_t)
+		 * - blob data (data->size)
+		 */
+		ret += data->size + 3 * sizeof(int);
+	}
+	list_iterator_destroy(it);
+	return ret;
+}
diff --git a/src/plugins/mpi/pmix/pmixp_nspaces.h b/src/plugins/mpi/pmix/pmixp_nspaces.h
new file mode 100644
index 000000000..5b380f610
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_nspaces.h
@@ -0,0 +1,102 @@
+/*****************************************************************************\
+ **  pmix_db.h - PMIx KVS database
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_NSPACES_H
+#define PMIXP_NSPACES_H
+
+#include "pmixp_common.h"
+#include "pmixp_info.h"
+#include "pmixp_debug.h"
+#include "pmixp_state.h"
+
+typedef struct {
+	void *blob;
+	int blob_sz;
+} pmixp_blob_t;
+
+typedef struct {
+	pmix_modex_data_t data;
+	pmix_scope_t scope;
+} pmixp_modex_t;
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIXP_NSPACE_MAGIC 0xCAFED00D
+	int magic;
+#endif
+	char name[PMIX_MAX_NSLEN];
+	uint32_t nnodes; /* number of nodes in this namespace              */
+	int node_id; /* relative position of this node in this step    */
+	uint32_t ntasks; /* total number of tasks in this namespace        */
+	uint32_t *task_cnts; /* Number of tasks on each node in this namespace */
+	char *task_map_packed; /* string represents packed task mapping information */
+	uint32_t *task_map; /* i'th task is located on task_map[i] node     */
+	hostlist_t hl;
+} pmixp_namespace_t;
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIXP_NSPACE_DB_MAGIC 0xCAFEBABE
+	int magic;
+#endif
+	List nspaces;
+	pmixp_namespace_t *local;
+} pmixp_db_t;
+
+int pmixp_nspaces_init(void);
+int pmixp_nspaces_finalize(void);
+pmixp_namespace_t *pmixp_nspaces_find(const char *name);
+pmixp_namespace_t *pmixp_nspaces_local(void);
+int pmixp_nspaces_add(char *name, uint32_t nnodes, int node_id,
+		      uint32_t ntasks, uint32_t *task_cnts,
+		      char *task_map_packed, hostlist_t hl);
+
+/* operations on the specific namespace */
+static inline hostlist_t pmixp_nspace_hostlist(pmixp_namespace_t *nsptr)
+{
+	hostlist_t hl = hostlist_copy(nsptr->hl);
+	return hl;
+}
+
+hostlist_t pmixp_nspace_rankhosts(pmixp_namespace_t *nsptr,
+				  const int *ranks, size_t nranks);
+char *pmixp_nspace_resolve(const char *name, int rank);
+
+size_t pmixp_nspace_mdx_lsize(List l);
+int pmixp_nspaces_push(Buf buf, int cnt);
+
+#endif /* PMIXP_NSPACES_H */
diff --git a/src/plugins/mpi/pmix/pmixp_server.c b/src/plugins/mpi/pmix/pmixp_server.c
new file mode 100644
index 000000000..777f3ae97
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_server.c
@@ -0,0 +1,484 @@
+/*****************************************************************************\
+ **  pmix_server.c - PMIx server side functionality
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "pmixp_info.h"
+#include "pmixp_coll.h"
+#include "pmixp_debug.h"
+#include "pmixp_io.h"
+#include "pmixp_client.h"
+#include "pmixp_server.h"
+#include "pmixp_nspaces.h"
+#include "pmixp_state.h"
+#include "pmixp_client.h"
+#include "pmixp_dmdx.h"
+
+#include <pmix_server.h>
+
+#define PMIX_SERVER_MSG_MAGIC 0xCAFECA11
+typedef struct {
+	uint32_t magic;
+	uint32_t type;
+	uint32_t seq;
+	uint32_t nodeid;
+	uint32_t msgsize;
+} send_header_t;
+
+#define SEND_HDR_SIZE (5 * sizeof(uint32_t))
+
+typedef struct {
+	uint32_t size;		/* Has to be first (appended by SLURM API) */
+	send_header_t send_hdr;
+} recv_header_t;
+#define RCVD_HDR_SIZE (sizeof(uint32_t) + SEND_HDR_SIZE)
+
+Buf pmixp_server_new_buf(void)
+{
+	Buf buf = create_buf(xmalloc(SEND_HDR_SIZE), SEND_HDR_SIZE);
+	/* Skip header. It will be filled right before the sending */
+	set_buf_offset(buf, SEND_HDR_SIZE);
+	return buf;
+}
+
+static uint32_t _recv_payload_size(void *buf);
+static int _send_pack_hdr(void *host, void *net);
+static int _recv_unpack_hdr(void *net, void *host);
+
+static bool _serv_readable(eio_obj_t *obj);
+static int _serv_read(eio_obj_t *obj, List objs);
+static void _process_server_request(recv_header_t *_hdr, void *payload);
+static int _process_message(pmixp_io_engine_t *me);
+
+static struct io_operations peer_ops = {
+	.readable = _serv_readable,
+	.handle_read = _serv_read
+};
+
+pmixp_io_engine_header_t srv_rcvd_header = {
+	.host_size = sizeof(recv_header_t),
+	.net_size = RCVD_HDR_SIZE,
+	.pack_hdr_cb = NULL,
+	.unpack_hdr_cb = _recv_unpack_hdr,
+	.pay_size_cb = _recv_payload_size
+};
+
+static volatile int _was_initialized = 0;
+
+int pmixp_stepd_init(const stepd_step_rec_t *job, char ***env)
+{
+	char *path;
+	int fd, rc;
+
+	if (SLURM_SUCCESS != (rc = pmixp_info_set(job, env))) {
+		PMIXP_ERROR("pmixp_info_set(job, env) failed");
+		return rc;
+	}
+
+	/* Create UNIX socket for slurmd communication */
+	path = pmixp_info_nspace_usock(pmixp_info_namespace());
+	if (NULL == path) {
+		PMIXP_ERROR("Out-of-memory");
+		rc = SLURM_ERROR;
+		goto err_path;
+	}
+	if ((fd = pmixp_usock_create_srv(path)) < 0) {
+		rc = SLURM_ERROR;
+		goto err_usock;
+	}
+	fd_set_close_on_exec(fd);
+	pmixp_info_srv_contacts(path, fd);
+
+	if (SLURM_SUCCESS != (rc = pmixp_nspaces_init())) {
+		PMIXP_ERROR("pmixp_nspaces_init() failed");
+		goto err_usock;
+	}
+
+	if (SLURM_SUCCESS != (rc = pmixp_state_init())) {
+		PMIXP_ERROR("pmixp_state_init() failed");
+		goto err_state;
+	}
+
+	if (SLURM_SUCCESS != (rc = pmixp_dmdx_init())) {
+		PMIXP_ERROR("pmixp_dmdx_init() failed");
+		goto err_dmdx;
+	}
+
+	if (SLURM_SUCCESS != (rc = pmixp_libpmix_init())) {
+		PMIXP_ERROR("pmixp_libpmix_init() failed");
+		goto err_lib;
+	}
+
+	if (SLURM_SUCCESS != (rc = pmixp_libpmix_job_set())) {
+		PMIXP_ERROR("pmixp_libpmix_job_set() failed");
+		goto err_job;
+	}
+
+	xfree(path);
+	_was_initialized = 1;
+	return SLURM_SUCCESS;
+
+err_job:
+	pmixp_libpmix_finalize();
+err_lib:
+	pmixp_dmdx_finalize();
+err_dmdx:
+	pmixp_state_finalize();
+err_state:
+	pmixp_nspaces_finalize();
+err_usock:
+	xfree(path);
+err_path:
+	pmixp_info_free();
+	return rc;
+}
+
+int pmixp_stepd_finalize(void)
+{
+	char *path;
+	if (!_was_initialized) {
+		/* nothing to do */
+		return 0;
+	}
+
+	pmixp_libpmix_finalize();
+	pmixp_dmdx_finalize();
+	pmixp_state_finalize();
+	pmixp_nspaces_finalize();
+
+	/* cleanup the usock */
+	PMIXP_DEBUG("Remove PMIx plugin usock");
+	close(pmixp_info_srv_fd());
+	path = pmixp_info_nspace_usock(pmixp_info_namespace());
+	unlink(path);
+	xfree(path);
+
+	/* free the information */
+	pmixp_info_free();
+	return SLURM_SUCCESS;
+}
+
+/* this routine tries to complete message processing on message
+ * engine (me). Return value:
+ * - 0: no progress was observed on the descriptor
+ * - 1: one more message was successfuly processed
+ * - 2: all messages are completed
+ */
+static int _process_message(pmixp_io_engine_t *me)
+{
+	int ret = 0;
+	pmix_io_rcvd(me);
+	if (pmix_io_rcvd_ready(me)) {
+		recv_header_t hdr;
+		void *msg = pmix_io_rcvd_extract(me, &hdr);
+		_process_server_request(&hdr, msg);
+		ret = 1;
+	}
+	if (pmix_io_finalized(me)) {
+		ret = 2;
+	}
+	return ret;
+}
+
+
+/*
+ * TODO: we need to keep track of the "me"
+ * structures created here, because we need to
+ * free them in "pmixp_stepd_finalize"
+ */
+void pmix_server_new_conn(int fd)
+{
+	eio_obj_t *obj;
+	PMIXP_DEBUG("Request from fd = %d", fd);
+
+	/* Set nonblocking */
+	fd_set_nonblocking(fd);
+	fd_set_close_on_exec(fd);
+
+	pmixp_io_engine_t *me = xmalloc(sizeof(pmixp_io_engine_t));
+	pmix_io_init(me, fd, srv_rcvd_header);
+	/* We use slurm_forward_data to send message to stepd's
+	 * SLURM will put user ID there. We need to skip it.
+	 */
+	pmix_io_rcvd_padding(me, sizeof(uint32_t));
+
+	if( 2 == _process_message(me) ){
+		/* connection was fully processed here */
+		xfree(me);
+		return;
+	}
+
+	/* If it is a blocking operation: create AIO object to
+	 * handle it */
+	obj = eio_obj_create(fd, &peer_ops, (void *)me);
+	eio_new_obj(pmixp_info_io(), obj);
+}
+
+/*
+ *  Server message processing
+ */
+
+static uint32_t _recv_payload_size(void *buf)
+{
+	recv_header_t *ptr = (recv_header_t *)buf;
+	send_header_t *hdr = &ptr->send_hdr;
+	xassert(ptr->size == hdr->msgsize + SEND_HDR_SIZE);
+	xassert(hdr->magic == PMIX_SERVER_MSG_MAGIC);
+	return hdr->msgsize;
+}
+
+/*
+ * Pack message header.
+ * Returns packed size
+ * Note: asymmetric to _recv_unpack_hdr because of additional SLURM header
+ */
+static int _send_pack_hdr(void *host, void *net)
+{
+	send_header_t *ptr = (send_header_t *)host;
+	Buf packbuf = create_buf(net, sizeof(send_header_t));
+	int size = 0;
+	pack32(ptr->magic, packbuf);
+	pack32(ptr->type, packbuf);
+	pack32(ptr->seq, packbuf);
+	pack32(ptr->nodeid, packbuf);
+	pack32(ptr->msgsize, packbuf);
+	size = get_buf_offset(packbuf);
+	xassert(size == SEND_HDR_SIZE);
+	/* free the Buf packbuf, but not the memory to which it points */
+	packbuf->head = NULL;
+	free_buf(packbuf);
+	return size;
+}
+
+/*
+ * Unpack message header.
+ * Returns 0 on success and -errno on failure
+ * Note: asymmetric to _send_pack_hdr because of additional SLURM header
+ */
+static int _recv_unpack_hdr(void *net, void *host)
+{
+	recv_header_t *ptr = (recv_header_t *)host;
+	Buf packbuf = create_buf(net, sizeof(recv_header_t));
+	if (unpack32(&ptr->size, packbuf)) {
+		return -EINVAL;
+	}
+	if (unpack32(&ptr->send_hdr.magic, packbuf)) {
+		return -EINVAL;
+	}
+	xassert(ptr->send_hdr.magic == PMIX_SERVER_MSG_MAGIC);
+
+	if (unpack32(&ptr->send_hdr.type, packbuf)) {
+		return -EINVAL;
+	}
+
+	if (unpack32(&ptr->send_hdr.seq, packbuf)) {
+		return -EINVAL;
+	}
+
+	if (unpack32(&ptr->send_hdr.nodeid, packbuf)) {
+		return -EINVAL;
+	}
+
+	if (unpack32(&ptr->send_hdr.msgsize, packbuf)) {
+		return -EINVAL;
+	}
+	/* free the Buf packbuf, but not the memory to which it points */
+	packbuf->head = NULL;
+	free_buf(packbuf);
+	return 0;
+}
+
+int pmixp_server_send(char *hostlist, pmixp_srv_cmd_t type, uint32_t seq,
+		const char *addr, void *data, size_t size)
+{
+	send_header_t hdr;
+	char nhdr[sizeof(send_header_t)];
+	size_t hsize;
+	int rc;
+
+	hdr.magic = PMIX_SERVER_MSG_MAGIC;
+	hdr.type = type;
+	hdr.msgsize = size - SEND_HDR_SIZE;
+	hdr.seq = seq;
+	/* Store global nodeid that is
+	 *  independent from exact collective */
+	hdr.nodeid = pmixp_info_nodeid_job();
+	hsize = _send_pack_hdr(&hdr, nhdr);
+	memcpy(data, nhdr, hsize);
+
+	rc = pmixp_stepd_send(hostlist, addr, data, size, 500, 7, 0);
+	if (SLURM_SUCCESS != rc) {
+		PMIXP_ERROR("Cannot send message to %s, size = %u, hostlist:\n%s",
+			    addr, (uint32_t) size, hostlist);
+	}
+	return rc;
+}
+
+int pmixp_server_health_chk(char *hostlist,  const char *addr)
+{
+	send_header_t hdr;
+	char nhdr[sizeof(send_header_t)];
+	size_t hsize;
+	Buf buf = pmixp_server_new_buf();
+	char *data = get_buf_data(buf);
+	int rc;
+
+	hdr.magic = PMIX_SERVER_MSG_MAGIC;
+	hdr.type = PMIXP_MSG_HEALTH_CHK;
+	hdr.msgsize = 1;
+	hdr.seq = 0;
+	/* Store global nodeid that is
+	 *  independent from exact collective */
+	hdr.nodeid = pmixp_info_nodeid_job();
+	hsize = _send_pack_hdr(&hdr, nhdr);
+	memcpy(data, nhdr, hsize);
+
+	grow_buf(buf, sizeof(char));
+	pack8('\n', buf);
+
+	rc = pmixp_stepd_send(hostlist, addr, data, get_buf_offset(buf), 4, 14, 1);
+	if (SLURM_SUCCESS != rc) {
+		PMIXP_ERROR("Was unable to wait for the parent %s to become alive on addr %s",
+			    hostlist, addr);
+	}
+
+	return rc;
+}
+
+static bool _serv_readable(eio_obj_t *obj)
+{
+	/* We should delete connection right when it  was closed or failed */
+	xassert(obj->shutdown == false);
+	return true;
+}
+
+static void _process_server_request(recv_header_t *_hdr, void *payload)
+{
+	send_header_t *hdr = &_hdr->send_hdr;
+	char *nodename = pmixp_info_job_host(hdr->nodeid);
+	Buf buf;
+	int rc;
+
+	buf = create_buf(payload, hdr->msgsize);
+
+	switch (hdr->type) {
+	case PMIXP_MSG_FAN_IN:
+	case PMIXP_MSG_FAN_OUT: {
+		pmixp_coll_t *coll;
+		pmix_proc_t *procs = NULL;
+		size_t nprocs = 0;
+		pmixp_coll_type_t type = 0;
+
+		rc = pmixp_coll_unpack_ranges(buf, &type, &procs, &nprocs);
+		if (SLURM_SUCCESS != rc) {
+			PMIXP_ERROR("Bad message header from node %s", nodename);
+			return;
+		}
+		coll = pmixp_state_coll_get(type, procs, nprocs);
+		xfree(procs);
+
+		PMIXP_DEBUG("FENCE collective message from node \"%s\", type = %s, seq = %d",
+			    nodename, (PMIXP_MSG_FAN_IN == hdr->type) ? "fan-in" : "fan-out",
+			    hdr->seq);
+		rc = pmixp_coll_check_seq(coll, hdr->seq, nodename);
+		if (SLURM_SUCCESS != rc) {
+			/* this is unexepable event: either something went
+			 * really wrong or the state machine is incorrect.
+			 * This will 100% lead to application hang.
+			 */
+			PMIXP_ERROR("Bad collective seq. #%d from %s, current is %d",
+				    hdr->seq, nodename, coll->seq);
+			pmixp_debug_hang(0); /* enable hang to debug this! */
+			slurm_kill_job_step(pmixp_info_jobid(), pmixp_info_stepid(),
+					    SIGKILL);
+
+			break;
+		}
+
+		if (PMIXP_MSG_FAN_IN == hdr->type) {
+			pmixp_coll_contrib_node(coll, nodename, buf);
+			/* we don't need this buffer anymore */
+			free_buf(buf);
+		} else {
+			pmixp_coll_bcast(coll, buf);
+			/* buf will be free'd by the PMIx callback */
+		}
+
+		break;
+	}
+	case PMIXP_MSG_DMDX: {
+		pmixp_dmdx_process(buf, nodename, hdr->seq);
+		break;
+	}
+	case PMIXP_MSG_HEALTH_CHK: {
+		/* this is just health ping.
+		 * TODO: can we do something more sophisticated?
+		 */
+		free_buf(buf);
+		break;
+	}
+	default:
+		PMIXP_ERROR("Unknown message type %d", hdr->type);
+		break;
+	}
+	xfree(nodename);
+}
+
+static int _serv_read(eio_obj_t *obj, List objs)
+{
+	PMIXP_DEBUG("fd = %d", obj->fd);
+	pmixp_io_engine_t *me = (pmixp_io_engine_t *)obj->arg;
+	bool proceed = true;
+
+	pmixp_debug_hang(0);
+
+	/* Read and process all received messages */
+	while (proceed) {
+		switch( _process_message(me) ){
+		case 2:
+			obj->shutdown = true;
+			PMIXP_DEBUG("Connection finalized fd = %d", obj->fd);
+			/* cleanup after this connection */
+			eio_remove_obj(obj, objs);
+			xfree(me);
+		case 0:
+			proceed = 0;
+		case 1:
+			break;
+		}
+	}
+	return 0;
+}
diff --git a/src/plugins/mpi/pmix/pmixp_server.h b/src/plugins/mpi/pmix/pmixp_server.h
new file mode 100644
index 000000000..b73307572
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_server.h
@@ -0,0 +1,61 @@
+/*****************************************************************************\
+ **  pmix_server.h - PMIx server side functionality
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_SERVER_H
+#define PMIXP_SERVER_H
+
+#include "pmixp_common.h"
+
+typedef enum {
+	PMIXP_MSG_HEALTH_CHK,
+	PMIXP_MSG_FAN_IN,
+	PMIXP_MSG_FAN_OUT,
+	PMIXP_MSG_DMDX
+} pmixp_srv_cmd_t;
+
+int pmixp_stepd_init(const stepd_step_rec_t *job, char ***env);
+int pmixp_stepd_finalize(void);
+int pmix_srun_init(const mpi_plugin_client_info_t *job, char ***env);
+void pmix_server_new_conn(int fd);
+int pmixp_server_send(char *hostlist, pmixp_srv_cmd_t type, uint32_t seq,
+		      const char *addr, void *data, size_t size);
+int pmixp_server_health_chk(char *hostlist,  const char *addr);
+
+
+Buf pmixp_server_new_buf(void);
+
+#endif /* PMIXP_SERVER_H */
diff --git a/src/plugins/mpi/pmix/pmixp_state.c b/src/plugins/mpi/pmix/pmixp_state.c
new file mode 100644
index 000000000..23e71fe1d
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_state.c
@@ -0,0 +1,179 @@
+/*****************************************************************************\
+ **  pmix_state.c - PMIx agent state related code
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#include "pmixp_common.h"
+#include "pmixp_debug.h"
+#include "pmixp_info.h"
+#include "pmixp_state.h"
+#include "pmixp_nspaces.h"
+#include "pmixp_coll.h"
+
+pmixp_state_t _pmixp_state;
+
+void _xfree_coll(void *x)
+{
+	pmixp_coll_t *coll = (pmixp_coll_t *)x;
+	pmixp_coll_free(coll);
+	xfree(coll);
+}
+
+int pmixp_state_init(void)
+{
+#ifndef NDEBUG
+	_pmixp_state.magic = PMIX_STATE_MAGIC;
+#endif
+	_pmixp_state.coll = list_create(_xfree_coll);
+
+	slurm_mutex_init(&_pmixp_state.lock);
+	return SLURM_SUCCESS;
+}
+
+void pmixp_state_finalize(void)
+{
+#ifndef NDEBUG
+	_pmixp_state.magic = 0;
+#endif
+	list_destroy(_pmixp_state.coll);
+}
+
+static bool _compare_ranges(const pmix_proc_t *r1, const pmix_proc_t *r2,
+			    size_t nprocs)
+{
+	int i;
+	for (i = 0; i < nprocs; i++) {
+		if (0 != xstrcmp(r1[i].nspace, r2[i].nspace)) {
+			return false;
+		}
+		if (r1[i].rank != r2[i].rank) {
+			return false;
+		}
+	}
+	return true;
+}
+
+static pmixp_coll_t *_find_collective(pmixp_coll_type_t type,
+				      const pmix_proc_t *procs,
+				      size_t nprocs)
+{
+	pmixp_coll_t *coll = NULL, *ret = NULL;
+	ListIterator it;
+
+	/* Walk through the list looking for the collective descriptor */
+	it = list_iterator_create(_pmixp_state.coll);
+	while (NULL != (coll = list_next(it))) {
+		if (coll->nprocs != nprocs) {
+			continue;
+		}
+		if (coll->type != type) {
+			continue;
+		}
+		if (0 == coll->nprocs) {
+			ret = coll;
+			goto exit;
+		}
+		if (_compare_ranges(coll->procs, procs, nprocs)) {
+			ret = coll;
+			goto exit;
+		}
+	}
+exit:
+	list_iterator_destroy(it);
+	return ret;
+}
+
+pmixp_coll_t *pmixp_state_coll_get(pmixp_coll_type_t type,
+				   const pmix_proc_t *procs,
+				   size_t nprocs)
+{
+	pmixp_coll_t *ret = NULL;
+
+	/* Collectives are created once for each type and process set
+	 * and resides till the end of jobstep lifetime.
+	 * So in most cases we will find that collective is already
+	 * exists.
+	 * First we try to find collective in the list without locking. */
+
+	if (NULL != (ret = _find_collective(type, procs, nprocs))) {
+		return ret;
+	}
+
+	/* if we failed to find the collective we most probably need
+	 * to create a new structure. To do so we need to lo lock the
+	 * whole state and try to search again to exclude situation where
+	 * concurent thread already created it while we were doing the
+	 * first search */
+
+	if (0 != pmixp_coll_belong_chk(type, procs, nprocs)) {
+		return NULL;
+	}
+
+	slurm_mutex_lock(&_pmixp_state.lock);
+
+	if (NULL == (ret = _find_collective(type, procs, nprocs))) {
+		/* 1. Create and insert unitialized but locked coll
+		 * structure into the list. We can release the state
+		 * structure right after that */
+		ret = xmalloc(sizeof(*ret));
+		/* initialize with unlocked list but locked element */
+		if (PMIX_SUCCESS != pmixp_coll_init(ret, procs, nprocs, type)) {
+			if (NULL != ret->procs) {
+				xfree(ret->procs);
+			}
+			xfree(ret);
+			ret = NULL;
+		} else {
+			list_append(_pmixp_state.coll, ret);
+		}
+	}
+
+	slurm_mutex_unlock(&_pmixp_state.lock);
+	return ret;
+}
+
+void pmixp_state_coll_cleanup(void)
+{
+	pmixp_coll_t *coll = NULL;
+	ListIterator it;
+	time_t ts = time(NULL);
+
+	/* Walk through the list looking for the collective descriptor */
+	it = list_iterator_create(_pmixp_state.coll);
+	while (NULL != (coll = list_next(it))) {
+		pmixp_coll_reset_if_to(coll, ts);
+	}
+	list_iterator_destroy(it);
+}
diff --git a/src/plugins/mpi/pmix/pmixp_state.h b/src/plugins/mpi/pmix/pmixp_state.h
new file mode 100644
index 000000000..3c8f74e1c
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_state.h
@@ -0,0 +1,88 @@
+/*****************************************************************************\
+ **  pmix_state.h - PMIx agent state related code
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_STATE_H
+#define PMIXP_STATE_H
+
+#include "pmixp_common.h"
+#include "pmixp_debug.h"
+#include "pmixp_io.h"
+#include "pmixp_coll.h"
+#include "pmixp_dmdx.h"
+
+/*
+ * PMIx plugin state structure
+ */
+
+typedef struct {
+#ifndef NDEBUG
+#define PMIX_STATE_MAGIC 0xFEEDCAFE
+	int magic;
+#endif
+	List coll;
+	eio_handle_t *srv_handle;
+	pthread_mutex_t lock;
+} pmixp_state_t;
+
+extern pmixp_state_t _pmixp_state;
+
+/*
+ * General PMIx plugin state manipulation functions
+ */
+
+int pmixp_state_init(void);
+void pmixp_state_finalize(void);
+
+static inline void pmixp_state_sanity_check(void)
+{
+	xassert(_pmixp_state.magic == PMIX_STATE_MAGIC);
+}
+
+/*
+ * Collective state
+ */
+
+pmixp_coll_t *pmixp_state_coll_get(pmixp_coll_type_t type,
+				   const pmix_proc_t *ranges,
+				   size_t nranges);
+pmixp_coll_t *pmixp_state_coll_new(pmixp_coll_type_t type,
+				   const pmix_proc_t *ranges,
+				   size_t nranges);
+
+void pmixp_state_coll_cleanup(void);
+
+#endif /* PMIXP_STATE_H */
diff --git a/src/plugins/mpi/pmix/pmixp_utils.c b/src/plugins/mpi/pmix/pmixp_utils.c
new file mode 100644
index 000000000..fb90534b3
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_utils.c
@@ -0,0 +1,419 @@
+/*****************************************************************************\
+ **	pmix_utils.c - Various PMIx utility functions
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <errno.h>
+#include <poll.h>
+#include <time.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+
+#include "pmixp_common.h"
+#include "pmixp_utils.h"
+#include "pmixp_debug.h"
+
+void pmixp_xfree_xmalloced(void *x)
+{
+	xfree(x);
+}
+
+void pmixp_free_Buf(void *x)
+{
+	Buf buf = (Buf)x;
+	free_buf(buf);
+}
+
+int pmixp_usock_create_srv(char *path)
+{
+	static struct sockaddr_un sa;
+	int ret = 0;
+
+	if (strlen(path) >= sizeof(sa.sun_path)) {
+		PMIXP_ERROR_STD("UNIX socket path is too long: %lu, max %lu",
+				(unsigned long) strlen(path),
+				(unsigned long) sizeof(sa.sun_path) - 1);
+		return SLURM_ERROR;
+	}
+
+	int fd = socket(AF_UNIX, SOCK_STREAM, 0);
+	if (fd < 0) {
+		PMIXP_ERROR_STD("Cannot create UNIX socket");
+		return SLURM_ERROR;
+	}
+
+	memset(&sa, 0, sizeof(sa));
+	sa.sun_family = AF_UNIX;
+	strcpy(sa.sun_path, path);
+	if ((ret = bind(fd, (struct sockaddr *)&sa, SUN_LEN(&sa)))) {
+		PMIXP_ERROR_STD("Cannot bind() UNIX socket %s", path);
+		goto err_fd;
+	}
+
+	if ((ret = listen(fd, 64))) {
+		PMIXP_ERROR_STD("Cannot listen(%d, 64) UNIX socket %s", fd,
+				path);
+		goto err_bind;
+
+	}
+	return fd;
+
+err_bind:
+	unlink(path);
+err_fd:
+	close(fd);
+	return ret;
+}
+
+size_t pmixp_read_buf(int sd, void *buf, size_t count, int *shutdown,
+		bool blocking)
+{
+	ssize_t ret, offs = 0;
+
+	*shutdown = 0;
+
+	if (!blocking && !pmixp_fd_read_ready(sd, shutdown)) {
+		return 0;
+	}
+
+	if (blocking) {
+		fd_set_blocking(sd);
+	}
+
+	while (count - offs > 0) {
+		ret = read(sd, (char *)buf + offs, count - offs);
+		if (ret > 0) {
+			offs += ret;
+			continue;
+		} else if (ret == 0) {
+			/* connection closed. */
+			*shutdown = 1;
+			return offs;
+		}
+		switch (errno) {
+		case EINTR:
+			continue;
+		case EWOULDBLOCK:
+			/* we can get here in non-blocking mode only */
+			return offs;
+		default:
+			PMIXP_ERROR_STD("blocking=%d", blocking);
+			*shutdown = -errno;
+			return offs;
+		}
+	}
+
+	if (blocking) {
+		fd_set_nonblocking(sd);
+	}
+	return offs;
+}
+
+size_t pmixp_write_buf(int sd, void *buf, size_t count, int *shutdown,
+		bool blocking)
+{
+	ssize_t ret, offs = 0;
+
+	*shutdown = 0;
+
+	if (!blocking && !pmixp_fd_write_ready(sd, shutdown)) {
+		return 0;
+	}
+
+	if (blocking) {
+		fd_set_blocking(sd);
+	}
+
+	while (count - offs > 0) {
+		ret = write(sd, (char *)buf + offs, count - offs);
+		if (ret > 0) {
+			offs += ret;
+			continue;
+		}
+		switch (errno) {
+		case EINTR:
+			continue;
+		case EWOULDBLOCK:
+			return offs;
+		default:
+			*shutdown = -errno;
+			return offs;
+		}
+	}
+
+	if (blocking) {
+		fd_set_nonblocking(sd);
+	}
+
+	return offs;
+}
+
+bool pmixp_fd_read_ready(int fd, int *shutdown)
+{
+	struct pollfd pfd[1];
+	int rc;
+	struct timeval tv;
+	double start, cur;
+	pfd[0].fd = fd;
+	pfd[0].events = POLLIN;
+	/* Drop shutdown before the check */
+	*shutdown = 0;
+
+	gettimeofday(&tv,NULL);
+	start = tv.tv_sec + 1E-6*tv.tv_usec;
+	cur = start;
+	while( cur - start < 0.01 ){
+		rc = poll(pfd, 1, 10);
+		
+		/* update current timestamp */
+		gettimeofday(&tv,NULL);
+		cur = tv.tv_sec + 1E-6*tv.tv_usec;
+		if( rc < 0 ){
+			if( errno == EINTR ){
+				continue;
+			} else {
+				*shutdown = -errno;
+				return false;
+			}
+		}
+		break;
+	}
+
+	bool ret = ((rc == 1) && (pfd[0].revents & POLLIN));
+	if (!ret && (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL))) {
+		if (pfd[0].revents & (POLLERR | POLLNVAL)) {
+			*shutdown = -EBADF;
+		} else {
+			/* POLLHUP - normal connection close */
+			*shutdown = 1;
+		}
+	}
+	return ret;
+}
+
+bool pmixp_fd_write_ready(int fd, int *shutdown)
+{
+	struct pollfd pfd[1];
+	int rc;
+	struct timeval tv;
+	double start, cur;
+	pfd[0].fd = fd;
+	pfd[0].events = POLLOUT;
+
+	gettimeofday(&tv,NULL);
+	start = tv.tv_sec + 1E-6*tv.tv_usec;
+	cur = start;
+	while( cur - start < 0.01 ){
+		rc = poll(pfd, 1, 10);
+		
+		/* update current timestamp */
+		gettimeofday(&tv,NULL);
+		cur = tv.tv_sec + 1E-6*tv.tv_usec;
+		if( rc < 0 ){
+			if( errno == EINTR ){
+				continue;
+			} else {
+				*shutdown = -errno;
+				return false;
+			}
+		}
+		break;
+	}
+
+	if (pfd[0].revents & (POLLERR | POLLHUP | POLLNVAL)) {
+		if (pfd[0].revents & (POLLERR | POLLNVAL)) {
+			*shutdown = -EBADF;
+		} else {
+			/* POLLHUP - normal connection close */
+			*shutdown = 1;
+		}
+	}
+	return ((rc == 1) && (pfd[0].revents & POLLOUT));
+}
+
+int pmixp_stepd_send(char *nodelist, const char *address, char *data,
+		     uint32_t len, unsigned int start_delay,
+		     unsigned int retry_cnt, int silent)
+{
+
+	int retry = 0, rc;
+	unsigned int delay = start_delay; /* in milliseconds */
+	char *copy_of_nodelist = xstrdup(nodelist);
+
+	while (1) {
+		if (!silent && retry >= 1) {
+			PMIXP_ERROR("send failed, rc=%d, try #%d", rc, retry);
+		}
+
+		rc = slurm_forward_data(
+			&copy_of_nodelist, (char *)address, len, data);
+
+		if (rc == SLURM_SUCCESS)
+			break;
+
+		retry++;
+		if (retry >= retry_cnt)
+			break;
+
+		/* wait with constantly increasing delay */
+		struct timespec ts =
+			{(delay / 1000), ((delay % 1000) * 1000000)};
+		nanosleep(&ts, NULL);
+		delay *= 2;
+	}
+	xfree(copy_of_nodelist);
+
+	return rc;
+}
+
+static int _is_dir(char *path)
+{
+	struct stat stat_buf;
+	int rc;
+	if (0 > (rc = stat(path, &stat_buf))) {
+		PMIXP_ERROR_STD("Cannot stat() path=\"%s\"", path);
+		return rc;
+	} else if (!S_ISDIR(stat_buf.st_mode)) {
+		return 0;
+	}
+	return 1;
+}
+
+int pmixp_rmdir_recursively(char *path)
+{
+	char nested_path[PATH_MAX];
+	DIR *dp;
+	struct dirent *ent;
+
+	int rc;
+
+	/*
+	 * Make sure that "directory" exists and is a directory.
+	 */
+	if (1 != (rc = _is_dir(path))) {
+		PMIXP_ERROR("path=\"%s\" is not a directory", path);
+		return (rc == 0) ? -1 : rc;
+	}
+
+	if ((dp = opendir(path)) == NULL) {
+		PMIXP_ERROR_STD("cannot open path=\"%s\"", path);
+		return -1;
+	}
+
+	while ((ent = readdir(dp)) != NULL) {
+		if (0 == xstrcmp(ent->d_name, ".")
+				|| 0 == xstrcmp(ent->d_name, "..")) {
+			/* skip special dir's */
+			continue;
+		}
+		snprintf(nested_path, sizeof(nested_path), "%s/%s", path,
+				ent->d_name);
+		if (_is_dir(nested_path)) {
+			pmixp_rmdir_recursively(nested_path);
+		} else {
+			unlink(nested_path);
+		}
+	}
+	closedir(dp);
+	if ((rc = rmdir(path))) {
+		PMIXP_ERROR_STD("Cannot remove path=\"%s\"", path);
+	}
+	return rc;
+}
+
+static inline int _file_fix_rights(char *path, uid_t uid, mode_t mode)
+{
+	if (chmod(path, mode) < 0) {
+		PMIXP_ERROR("chown(%s): %m", path);
+		return errno;
+	}
+
+	if (chown(path, uid, (gid_t) -1) < 0) {
+		PMIXP_ERROR("chown(%s): %m", path);
+		return errno;
+	}
+	return 0;
+}
+
+int pmixp_fixrights(char *path, uid_t uid, mode_t mode)
+{
+	char nested_path[PATH_MAX];
+	DIR *dp;
+	struct dirent *ent;
+	int rc;
+
+	/*
+	 * Make sure that "directory" exists and is a directory.
+	 */
+	if (1 != (rc = _is_dir(path))) {
+		PMIXP_ERROR("path=\"%s\" is not a directory", path);
+		return (rc == 0) ? -1 : rc;
+	}
+
+	if ((dp = opendir(path)) == NULL) {
+		PMIXP_ERROR_STD("cannot open path=\"%s\"", path);
+		return -1;
+	}
+
+	while ((ent = readdir(dp)) != NULL) {
+		if (0 == xstrcmp(ent->d_name, ".")
+				|| 0 == xstrcmp(ent->d_name, "..")) {
+			/* skip special dir's */
+			continue;
+		}
+		snprintf(nested_path, sizeof(nested_path), "%s/%s", path,
+				ent->d_name);
+		if (_is_dir(nested_path)) {
+			if( (rc = _file_fix_rights(nested_path, uid, mode)) ){
+				PMIXP_ERROR_STD("cannot fix permissions for \"%s\"", nested_path);
+				return -1;
+			}
+			pmixp_rmdir_recursively(nested_path);
+		} else {
+			if( (rc = _file_fix_rights(nested_path, uid, mode)) ){
+				PMIXP_ERROR_STD("cannot fix permissions for \"%s\"", nested_path);
+				return -1;
+			}
+		}
+	}
+	closedir(dp);
+	return 0;
+}
diff --git a/src/plugins/mpi/pmix/pmixp_utils.h b/src/plugins/mpi/pmix/pmixp_utils.h
new file mode 100644
index 000000000..a8d17b8be
--- /dev/null
+++ b/src/plugins/mpi/pmix/pmixp_utils.h
@@ -0,0 +1,59 @@
+/*****************************************************************************\
+ **	pmix_utils.c - Various PMIx utility functions
+ *****************************************************************************
+ *  Copyright (C) 2014-2015 Artem Polyakov. All rights reserved.
+ *  Copyright (C) 2015      Mellanox Technologies. All rights reserved.
+ *  Written by Artem Polyakov <artpol84@gmail.com, artemp@mellanox.com>.
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+ \*****************************************************************************/
+
+#ifndef PMIXP_UTILS_H
+#define PMIXP_UTILS_H
+
+#include "pmixp_common.h"
+
+void pmixp_xfree_xmalloced(void *x);
+void pmixp_free_Buf(void *x);
+int pmixp_usock_create_srv(char *path);
+size_t pmixp_read_buf(int fd, void *buf, size_t count, int *shutdown,
+		      bool blocking);
+size_t pmixp_write_buf(int fd, void *buf, size_t count, int *shutdown,
+		       bool blocking);
+bool pmixp_fd_read_ready(int fd, int *shutdown);
+bool pmixp_fd_write_ready(int fd, int *shutdown);
+int pmixp_srun_send(slurm_addr_t *addr, uint32_t len, char *data);
+int pmixp_stepd_send(char *nodelist, const char *address, char *data,
+		     uint32_t len, unsigned int start_delay, unsigned int retry_cnt,
+		     int silent);
+int pmixp_rmdir_recursively(char *path);
+int pmixp_fixrights(char *path, uid_t uid, mode_t mode);
+
+#endif /* PMIXP_UTILS_H*/
diff --git a/src/plugins/mpi/pmix/tests/pmix_client.c b/src/plugins/mpi/pmix/tests/pmix_client.c
new file mode 100644
index 000000000..343df98a7
--- /dev/null
+++ b/src/plugins/mpi/pmix/tests/pmix_client.c
@@ -0,0 +1,368 @@
+/*
+ * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
+ *                         University Research and Technology
+ *                         Corporation.  All rights reserved.
+ * Copyright (c) 2004-2011 The University of Tennessee and The University
+ *                         of Tennessee Research Foundation.  All rights
+ *                         reserved.
+ * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
+ *                         University of Stuttgart.  All rights reserved.
+ * Copyright (c) 2004-2005 The Regents of the University of California.
+ *                         All rights reserved.
+ * Copyright (c) 2006-2013 Los Alamos National Security, LLC.
+ *                         All rights reserved.
+ * Copyright (c) 2009-2012 Cisco Systems, Inc.  All rights reserved.
+ * Copyright (c) 2011      Oak Ridge National Labs.  All rights reserved.
+ * Copyright (c) 2013-2014 Intel, Inc.  All rights reserved.
+ * Copyright (c) 2015      Mellanox Technologies, Inc.  All rights reserved.
+ * $COPYRIGHT$
+ *
+ * Additional copyrights may follow
+ *
+ * $HEADER$
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <time.h>
+
+#include <pmix.h>
+#include "test_common.h"
+
+#define true 1
+#define false 0
+
+int get_local_peers(int **_peers)
+{
+	pmix_value_t *val;
+	int *peers = NULL;
+	char *sptr, *token, *eptr, *str;
+	int npeers;
+	char nspace[PMIX_MAX_VALLEN];
+	int rank, count, rc;
+
+	/* To get namespace and rank */
+	if (PMIX_SUCCESS != (rc = PMIx_Init(nspace, &rank))) {
+		TEST_ERROR(("rank %d: PMIx_Init failed: %d", rank, rc));
+		exit(0);
+	}
+	//* to keep reference counter consistent */
+	PMIx_Finalize();
+
+	/* get number of neighbours on this node */
+	if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, rank, PMIX_LOCAL_SIZE, &val))) {
+		TEST_ERROR(("rank %d: PMIx_Get local peer # failed: %d", rank, rc));
+		exit(0);
+	}
+	if (NULL == val) {
+		TEST_ERROR(("rank %d: PMIx_Get local peer # returned NULL value", rank));
+		exit(0);
+	}
+
+	if (val->type != PMIX_UINT32 ) {
+		TEST_ERROR(("rank %d: local peer # attribute value type mismatch,"
+			    " want %d get %d(%d)",
+			    rank, PMIX_UINT32, val->type));
+		exit(0);
+	}
+	npeers = val->data.uint32;
+	peers = malloc(sizeof(int) * npeers);
+
+	/* get ranks of neighbours on this node */
+	if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, rank, PMIX_LOCAL_PEERS, &val))) {
+		TEST_ERROR(("rank %d: PMIx_Get local peers failed: %d", rank, rc));
+		exit(0);
+	}
+	if (NULL == val) {
+		TEST_ERROR(("rank %d: PMIx_Get local peers returned NULL value", rank));
+		exit(0);
+	}
+
+	if (val->type != PMIX_STRING ) {
+		TEST_ERROR(("rank %d: local peers attribute value type mismatch,"
+			    " want %d get %d(%d)",
+			    rank, PMIX_UINT32, val->type));
+		exit(0);
+	}
+
+	count = 0;
+	sptr = NULL;
+	str = val->data.string;
+	do{
+		if (count > npeers) {
+			TEST_ERROR(("rank %d: Bad peer ranks number: should be %d, actual %d (%s)",
+			    rank, npeers, count, val->data.string));
+			exit(0);
+		}
+		token = strtok_r(str, ",", &sptr);
+		str = NULL;
+		if (NULL != token) {
+			peers[count++] = strtol(token,&eptr,10);
+			if (*eptr != '\0') {
+				TEST_ERROR(("rank %d: Bad peer ranks string", rank));
+				exit(0);
+			}
+		}
+
+	} while(NULL != token);
+
+	if (count != npeers) {
+		TEST_ERROR(("rank %d: Bad peer ranks number: should be %d, actual %d (%s)",
+			    rank, npeers, count, val->data.string));
+		exit(0);
+	}
+
+	*_peers = peers;
+	return count;
+}
+
+void release_cb(pmix_status_t status, void *cbdata)
+{
+	int *ptr = (int*)cbdata;
+	*ptr = 0;
+}
+
+int main(int argc, char **argv)
+{
+	char nspace[PMIX_MAX_VALLEN];
+	int rank;
+	int rc, i, j;
+	pmix_value_t value;
+	char key[50], sval[50];
+	int nprocs = 1;
+	int collect = false;
+	int nonblocking = false;
+	pmix_value_t *val = &value;
+	int *peers, npeers;
+
+	TEST_OUTPUT(("rank X: Start", rank));
+
+	//    system("set");
+
+	/* check options */
+	for (i=1; i < argc; i++) {
+		if (0 == xstrcmp(argv[i], "--n") || 0 == xstrcmp(argv[i], "-n")) {
+			i++;
+			nprocs = strtol(argv[i], NULL, 10);
+		} else if (0 == xstrcmp(argv[i], "collect")) {
+			collect = true;
+		} else if (0 == xstrcmp(argv[i], "nb")) {
+			nonblocking = true;
+		} else if ((0 == xstrcmp(argv[i], "-v")) || (0 == xstrcmp(argv[i], "--verbose"))) {
+			TEST_VERBOSE_ON();
+		}else {
+			fprintf(stderr, "unrecognized option: %s\n", argv[i]);
+			exit(1);
+		}
+	}
+
+	TEST_OUTPUT(("rank X: parsed command line", rank));
+
+	{
+		int delay = 0;
+		while(delay) {
+			sleep(1);
+		}
+	}
+
+	/* init us */
+	if (PMIX_SUCCESS != (rc = PMIx_Init(nspace, &rank))) {
+		TEST_ERROR(("rank %d: PMIx_Init failed: %d", rank, rc));
+		exit(0);
+	}
+
+	TEST_OUTPUT(("rank %d: PMIx_Init success", rank));
+
+	if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, rank,PMIX_UNIV_SIZE,&val))) {
+		TEST_ERROR(("rank %d: PMIx_Get universe size failed: %d", rank, rc));
+		exit(0);
+	}
+	if (NULL == val) {
+		TEST_ERROR(("rank %d: PMIx_Get universe size returned NULL value", rank));
+		exit(0);
+	}
+	/* TODO: Guess number of processes from the SLURM environment! */
+	if (val->type != PMIX_UINT32 || val->data.uint32 != nprocs) {
+		TEST_ERROR(("rank %d: Universe size value or type mismatch,"
+			    " want %d(%d) get %d(%d)",
+			    rank, nprocs, PMIX_UINT32,
+			    val->data.integer, val->type));
+		exit(0);
+	}
+	TEST_OUTPUT(("rank %d: Universe size check: PASSED", rank));
+
+	/* Guess the namespace from SLURM environment
+    if (0 != xstrcmp(nspace, TEST_NAMESPACE)) {
+	TEST_ERROR(("rank %d: Bad nspace!", rank));
+	exit(0);
+    }
+*/
+
+	for (i=0; i < 3; i++) {
+		(void)snprintf(key, 50, "local-key-%d", i);
+		PMIX_VAL_SET(&value, int, 12340 + i);
+		if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_LOCAL, key, &value))) {
+			TEST_ERROR(("rank %d: PMIx_Put failed: %d", rank, rc));
+			exit(0);
+		}
+
+		(void)snprintf(key, 50, "remote-key-%d", i);
+		(void)snprintf(sval, 50, "Test string #%d", i);
+		PMIX_VAL_SET(&value, string, sval);
+		if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_REMOTE, key, &value))) {
+			TEST_ERROR(("rank %d: PMIx_Put failed: %d", rank, rc));
+			exit(0);
+		}
+		PMIX_VALUE_DESTRUCT(&value);
+
+		(void)snprintf(key, 50, "global-key-%d", i);
+		PMIX_VAL_SET(&value, float, 12.15 + i);
+		if (PMIX_SUCCESS != (rc = PMIx_Put(PMIX_GLOBAL, key, &value))) {
+			TEST_ERROR(("rank %d: PMIx_Put failed: %d", rank, rc));
+			exit(0);
+		}
+	}
+
+	/* Submit the data */
+	if (PMIX_SUCCESS != (rc = PMIx_Commit())) {
+	    TEST_ERROR(("rank %d: PMIx_Commit failed: %d", rank, rc));
+	    goto error_out;
+	}
+
+	/* Perform a fence if was requested */
+	if (!nonblocking) {
+		if (PMIX_SUCCESS != (rc = PMIx_Fence(NULL, 0, 1))) {
+			TEST_ERROR(("rank %d: PMIx_Fence failed: %d", rank, rc));
+			exit(0);
+		}
+	} else {
+		int in_progress = 1, count;
+		if (PMIX_SUCCESS != (rc = PMIx_Fence_nb(NULL, 0, collect, release_cb, &in_progress))) {
+			TEST_ERROR(("rank %d: PMIx_Fence failed: %d", rank, rc));
+			exit(0);
+		}
+
+		count = 0;
+		while(in_progress) {
+			struct timespec ts;
+			ts.tv_sec = 0;
+			ts.tv_nsec = 100;
+			nanosleep(&ts,NULL);
+			count++;
+
+		}
+		TEST_OUTPUT(("PMIx_Fence_nb(barrier,collect): free time: %lfs", count*100*1E-9));
+	}
+	TEST_OUTPUT(("rank %d: Fence successfully completed", rank));
+
+	npeers = get_local_peers(&peers);
+
+//{
+//    int delay = 1;
+//    while(delay) {
+//	sleep(1);
+//    }
+//}
+	/* Check the predefined output */
+	for (i=0; i < nprocs; i++) {
+
+		for (j=0; j < 3; j++) {
+			int local = 0, k;
+			for(k=0; k<npeers; k++) {
+				if (peers[k] == i) {
+					local = 1;
+				}
+			}
+
+			if (local) {
+				sprintf(key,"local-key-%d",j);
+				if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, i, key, &val))) {
+					TEST_ERROR(("rank %d: PMIx_Get failed: %d", rank, rc));
+					exit(0);
+				}
+				if (NULL == val) {
+					TEST_ERROR(("rank %d: PMIx_Get returned NULL value", rank));
+					exit(0);
+				}
+				if (val->type != PMIX_INT || val->data.integer != (12340+j)) {
+					TEST_ERROR(("rank %d: Key %s value or type mismatch,"
+						    " want %d(%d) get %d(%d)",
+						    rank, key, (12340+j), PMIX_INT,
+						    val->data.integer, val->type));
+					exit(0);
+				}
+				TEST_VERBOSE(("rank %d: GET OF %s SUCCEEDED", rank, key));
+				PMIX_VALUE_RELEASE(val);
+			}
+			sprintf(key,"remote-key-%d",j);
+			sprintf(sval,"Test string #%d",j);
+			if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, i, key, &val))) {
+				TEST_ERROR(("rank %d: PMIx_Get failed (%d)", rank, rc));
+				exit(0);
+			}
+			if (val->type != PMIX_STRING || xstrcmp(val->data.string, sval)) {
+				TEST_ERROR(("rank %d:  Key %s value or type mismatch, wait %s(%d) get %s(%d)",
+					    rank, key, sval, PMIX_STRING, val->data.string, val->type));
+				exit(0);
+			}
+			TEST_VERBOSE(("rank %d: GET OF %s SUCCEEDED", rank, key));
+			PMIX_VALUE_RELEASE(val);
+
+			sprintf(key, "global-key-%d", j);
+			if (PMIX_SUCCESS != (rc = PMIx_Get(nspace, i, key, &val))) {
+				TEST_ERROR(("rank %d: PMIx_Get failed (%d)", rank, rc))
+						exit(0);
+			}
+			if (val->type != PMIX_FLOAT || val->data.fval != (float)12.15 + j) {
+				TEST_ERROR(("rank %d [ERROR]: Key %s value or type mismatch,"
+					    " wait %f(%d) get %f(%d)",
+					    rank, key, ((float)10.15 + i), PMIX_FLOAT,
+					    val->data.fval, val->type));
+				exit(0);
+			}
+			PMIX_VALUE_RELEASE(val);
+			TEST_VERBOSE(("rank %d: GET OF %s SUCCEEDED", rank, key));
+		}
+
+		/* ask for a non-existent key */
+		if (PMIX_SUCCESS == (rc = PMIx_Get(nspace, i, "foobar", &val))) {
+			TEST_ERROR(("rank %d: PMIx_Get returned success instead of failure",
+				    rank));
+			exit(0);
+		}
+		if (PMIX_ERR_NOT_FOUND != rc) {
+			TEST_ERROR(("rank %d [ERROR]: PMIx_Get returned %d instead of not_found",
+				    rank, rc));
+		}
+		if (NULL != val) {
+			TEST_ERROR(("rank %d [ERROR]: PMIx_Get did not return NULL value", rank));
+			exit(0);
+		}
+		TEST_VERBOSE(("rank %d: rank %d is OK", rank, i));
+	}
+
+	TEST_OUTPUT(("rank %d: test PASSED", rank));
+
+error_out:
+	/* finalize us */
+	TEST_OUTPUT(("rank %d: Finalizing", rank));
+	fflush(stderr);
+	/*
+    {
+	int delay = 1;
+	while(delay) {
+	    sleep(1);
+	}
+    }
+*/
+
+	if (PMIX_SUCCESS != (rc = PMIx_Finalize())) {
+		TEST_ERROR(("rank %d:PMIx_Finalize failed: %d", rank, rc));
+	} else {
+		TEST_OUTPUT(("rank %d:PMIx_Finalize successfully completed", rank));
+	}
+
+	exit(0);
+}
diff --git a/src/plugins/mpi/pmix/tests/test_common.c b/src/plugins/mpi/pmix/tests/test_common.c
new file mode 100644
index 000000000..353dbde7f
--- /dev/null
+++ b/src/plugins/mpi/pmix/tests/test_common.c
@@ -0,0 +1,15 @@
+#include "test_common.h"
+#include <stdarg.h>
+
+int pmix_test_verbose = 0;
+
+#define OUTPUT_MAX 1024
+char *pmix_test_output_prepare(const char *fmt, ...)
+{
+    static char output[OUTPUT_MAX];
+    va_list args;
+    va_start(args, fmt);
+    memset(output, 0, sizeof(output));
+    vsnprintf(output, OUTPUT_MAX - 1, fmt, args);
+    return output;
+}
diff --git a/src/plugins/mpi/pmix/tests/test_common.h b/src/plugins/mpi/pmix/tests/test_common.h
new file mode 100644
index 000000000..5644df82f
--- /dev/null
+++ b/src/plugins/mpi/pmix/tests/test_common.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2013-2015 Intel, Inc.  All rights reserved.
+ * Copyright (c) 2015      Artem Y. Polyakov <artpol84@gmail.com>.
+ *                         All rights reserved.
+ * $COPYRIGHT$
+ *
+ * Additional copyrights may follow
+ *
+ * $HEADER$
+ *
+ */
+
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
+
+#include <stdio.h>
+#include <string.h>
+
+#define TEST_NAMESPACE "smoky_nspace"
+#define TEST_CREDENTIAL "dummy"
+
+/* WARNING: pmix_test_output_prepare is currently not threadsafe!
+ * fix it once needed!
+ */
+char *pmix_test_output_prepare(const char *fmt,...);
+extern int pmix_test_verbose;
+
+#define STRIPPED_FILE_NAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
+
+#define TEST_OUTPUT(x) { \
+    fprintf(stderr,"%s:%s: %s\n",STRIPPED_FILE_NAME, __func__, \
+            pmix_test_output_prepare x); \
+    fflush(stderr); \
+}
+
+#define TEST_ERROR(x) { \
+    fprintf(stderr,"ERROR [%s:%d:%s]: %s\n", STRIPPED_FILE_NAME, __LINE__, __func__, \
+            pmix_test_output_prepare x); \
+    fflush(stderr); \
+}
+
+#define TEST_VERBOSE_ON() (pmix_test_verbose = 1)
+
+#define TEST_VERBOSE(x) { \
+    if (pmix_test_verbose) { \
+        TEST_OUTPUT(x); \
+    } \
+}
+
+
+#endif // TEST_COMMON_H
diff --git a/src/plugins/node_features/Makefile.am b/src/plugins/node_features/Makefile.am
new file mode 100644
index 000000000..b151849bc
--- /dev/null
+++ b/src/plugins/node_features/Makefile.am
@@ -0,0 +1,3 @@
+# Makefile for node_features plugins
+
+SUBDIRS = knl_cray
diff --git a/src/plugins/node_features/Makefile.in b/src/plugins/node_features/Makefile.in
new file mode 100644
index 000000000..2c1b4f711
--- /dev/null
+++ b/src/plugins/node_features/Makefile.in
@@ -0,0 +1,800 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for node_features plugins
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/node_features
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
+	ctags-recursive dvi-recursive html-recursive info-recursive \
+	install-data-recursive install-dvi-recursive \
+	install-exec-recursive install-html-recursive \
+	install-info-recursive install-pdf-recursive \
+	install-ps-recursive install-recursive installcheck-recursive \
+	installdirs-recursive pdf-recursive ps-recursive \
+	tags-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+am__recursive_targets = \
+  $(RECURSIVE_TARGETS) \
+  $(RECURSIVE_CLEAN_TARGETS) \
+  $(am__extra_recursive_targets)
+AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
+	distdir
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = knl_cray
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plugins/node_features/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/plugins/node_features/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run 'make' without going through this Makefile.
+# To change the values of 'make' variables: instead of editing Makefiles,
+# (1) if the variable is set in 'config.status', edit 'config.status'
+#     (which will cause the Makefiles to be regenerated when you run 'make');
+# (2) otherwise, pass the desired values on the 'make' command line.
+$(am__recursive_targets):
+	@fail=; \
+	if $(am__make_keepgoing); then \
+	  failcom='fail=yes'; \
+	else \
+	  failcom='exit 1'; \
+	fi; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-recursive
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-recursive
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+	check-am clean clean-generic clean-libtool cscopelist-am ctags \
+	ctags-am distclean distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-am uninstall uninstall-am
+
+.PRECIOUS: Makefile
+
+
+# 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/node_features/knl_cray/Makefile.am b/src/plugins/node_features/knl_cray/Makefile.am
new file mode 100644
index 000000000..1073776c6
--- /dev/null
+++ b/src/plugins/node_features/knl_cray/Makefile.am
@@ -0,0 +1,21 @@
+# Makefile for node_features_knl_cray plugin
+
+AUTOMAKE_OPTIONS = foreign
+
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+
+if WITH_JSON_PARSER
+
+AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(DATAWARP_CPPFLAGS) $(JSON_CPPFLAGS)
+
+pkglib_LTLIBRARIES = node_features_knl_cray.la
+node_features_knl_cray_la_SOURCES = node_features_knl_cray.c
+node_features_knl_cray_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(DATAWARP_LDFLAGS) $(JSON_LDFLAGS)
+
+force:
+$(node_features_knl_cray_la_LIBADD) : force
+	@cd `dirname $@` && $(MAKE) `basename $@`
+
+else
+EXTRA_node_features_knl_cray_la_SOURCES = node_features_knl_cray.c
+endif
diff --git a/src/plugins/node_features/knl_cray/Makefile.in b/src/plugins/node_features/knl_cray/Makefile.in
new file mode 100644
index 000000000..0c2a9cbcd
--- /dev/null
+++ b/src/plugins/node_features/knl_cray/Makefile.in
@@ -0,0 +1,845 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for node_features_knl_cray plugin
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+am__make_running_with_option = \
+  case $${target_option-} in \
+      ?) ;; \
+      *) echo "am__make_running_with_option: internal error: invalid" \
+              "target option '$${target_option-}' specified" >&2; \
+         exit 1;; \
+  esac; \
+  has_opt=no; \
+  sane_makeflags=$$MAKEFLAGS; \
+  if $(am__is_gnu_make); then \
+    sane_makeflags=$$MFLAGS; \
+  else \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        bs=\\; \
+        sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+          | sed "s/$$bs$$bs[$$bs $$bs	]*//g"`;; \
+    esac; \
+  fi; \
+  skip_next=no; \
+  strip_trailopt () \
+  { \
+    flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+  }; \
+  for flg in $$sane_makeflags; do \
+    test $$skip_next = yes && { skip_next=no; continue; }; \
+    case $$flg in \
+      *=*|--*) continue;; \
+        -*I) strip_trailopt 'I'; skip_next=yes;; \
+      -*I?*) strip_trailopt 'I';; \
+        -*O) strip_trailopt 'O'; skip_next=yes;; \
+      -*O?*) strip_trailopt 'O';; \
+        -*l) strip_trailopt 'l'; skip_next=yes;; \
+      -*l?*) strip_trailopt 'l';; \
+      -[dEDm]) skip_next=yes;; \
+      -[JT]) skip_next=yes;; \
+    esac; \
+    case $$flg in \
+      *$$target_option*) has_opt=yes; break;; \
+    esac; \
+  done; \
+  test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = src/plugins/node_features/knl_cray
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+	$(top_srcdir)/auxdir/ax_pthread.m4 \
+	$(top_srcdir)/auxdir/libtool.m4 \
+	$(top_srcdir)/auxdir/ltoptions.m4 \
+	$(top_srcdir)/auxdir/ltsugar.m4 \
+	$(top_srcdir)/auxdir/ltversion.m4 \
+	$(top_srcdir)/auxdir/lt~obsolete.m4 \
+	$(top_srcdir)/auxdir/slurm.m4 \
+	$(top_srcdir)/auxdir/x_ac__system_configuration.m4 \
+	$(top_srcdir)/auxdir/x_ac_affinity.m4 \
+	$(top_srcdir)/auxdir/x_ac_aix.m4 \
+	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
+	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
+	$(top_srcdir)/auxdir/x_ac_cray.m4 \
+	$(top_srcdir)/auxdir/x_ac_curl.m4 \
+	$(top_srcdir)/auxdir/x_ac_databases.m4 \
+	$(top_srcdir)/auxdir/x_ac_debug.m4 \
+	$(top_srcdir)/auxdir/x_ac_dlfcn.m4 \
+	$(top_srcdir)/auxdir/x_ac_env.m4 \
+	$(top_srcdir)/auxdir/x_ac_freeipmi.m4 \
+	$(top_srcdir)/auxdir/x_ac_gpl_licensed.m4 \
+	$(top_srcdir)/auxdir/x_ac_hwloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_iso.m4 \
+	$(top_srcdir)/auxdir/x_ac_json.m4 \
+	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
+	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
+	$(top_srcdir)/auxdir/x_ac_munge.m4 \
+	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
+	$(top_srcdir)/auxdir/x_ac_netloc.m4 \
+	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
+	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
+	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
+	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
+	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
+	$(top_srcdir)/auxdir/x_ac_readline.m4 \
+	$(top_srcdir)/auxdir/x_ac_rrdtool.m4 \
+	$(top_srcdir)/auxdir/x_ac_setpgrp.m4 \
+	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
+	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
+	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h $(top_builddir)/slurm/slurm.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+node_features_knl_cray_la_LIBADD =
+am__node_features_knl_cray_la_SOURCES_DIST = node_features_knl_cray.c
+@WITH_JSON_PARSER_TRUE@am_node_features_knl_cray_la_OBJECTS =  \
+@WITH_JSON_PARSER_TRUE@	node_features_knl_cray.lo
+am__EXTRA_node_features_knl_cray_la_SOURCES_DIST =  \
+	node_features_knl_cray.c
+node_features_knl_cray_la_OBJECTS =  \
+	$(am_node_features_knl_cray_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
+node_features_knl_cray_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+	$(AM_CFLAGS) $(CFLAGS) $(node_features_knl_cray_la_LDFLAGS) \
+	$(LDFLAGS) -o $@
+@WITH_JSON_PARSER_TRUE@am_node_features_knl_cray_la_rpath = -rpath \
+@WITH_JSON_PARSER_TRUE@	$(pkglibdir)
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo "  GEN     " $@;
+am__v_GEN_1 = 
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 = 
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -I$(top_builddir)/slurm
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+	$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+	$(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo "  CC      " $@;
+am__v_CC_1 = 
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(node_features_knl_cray_la_SOURCES) \
+	$(EXTRA_node_features_knl_cray_la_SOURCES)
+DIST_SOURCES = $(am__node_features_knl_cray_la_SOURCES_DIST) \
+	$(am__EXTRA_node_features_knl_cray_la_SOURCES_DIST)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates.  Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+  BEGIN { nonempty = 0; } \
+  { items[$$0] = 1; nonempty = 1; } \
+  END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique.  This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+  list='$(am__tagged_files)'; \
+  unique=`for i in $$list; do \
+    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+  done | $(am__uniquify_input)`
+ETAGS = etags
+CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/auxdir/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGL_LOADED = @BGL_LOADED@
+BGQ_LOADED = @BGQ_LOADED@
+BG_INCLUDES = @BG_INCLUDES@
+BG_LDFLAGS = @BG_LDFLAGS@
+BG_L_P_LOADED = @BG_L_P_LOADED@
+BLCR_CPPFLAGS = @BLCR_CPPFLAGS@
+BLCR_HOME = @BLCR_HOME@
+BLCR_LDFLAGS = @BLCR_LDFLAGS@
+BLCR_LIBS = @BLCR_LIBS@
+BLUEGENE_LOADED = @BLUEGENE_LOADED@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CHECK_CFLAGS = @CHECK_CFLAGS@
+CHECK_LIBS = @CHECK_LIBS@
+CMD_LDFLAGS = @CMD_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CRAY_JOB_CPPFLAGS = @CRAY_JOB_CPPFLAGS@
+CRAY_JOB_LDFLAGS = @CRAY_JOB_LDFLAGS@
+CRAY_SELECT_CPPFLAGS = @CRAY_SELECT_CPPFLAGS@
+CRAY_SELECT_LDFLAGS = @CRAY_SELECT_LDFLAGS@
+CRAY_SWITCH_CPPFLAGS = @CRAY_SWITCH_CPPFLAGS@
+CRAY_SWITCH_LDFLAGS = @CRAY_SWITCH_LDFLAGS@
+CRAY_TASK_CPPFLAGS = @CRAY_TASK_CPPFLAGS@
+CRAY_TASK_LDFLAGS = @CRAY_TASK_LDFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATAWARP_CPPFLAGS = @DATAWARP_CPPFLAGS@
+DATAWARP_LDFLAGS = @DATAWARP_LDFLAGS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DL_LIBS = @DL_LIBS@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FREEIPMI_CPPFLAGS = @FREEIPMI_CPPFLAGS@
+FREEIPMI_LDFLAGS = @FREEIPMI_LDFLAGS@
+FREEIPMI_LIBS = @FREEIPMI_LIBS@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
+GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
+GLIB_LIBS = @GLIB_LIBS@
+GLIB_MKENUMS = @GLIB_MKENUMS@
+GOBJECT_QUERY = @GOBJECT_QUERY@
+GREP = @GREP@
+GTK_CFLAGS = @GTK_CFLAGS@
+GTK_LIBS = @GTK_LIBS@
+H5CC = @H5CC@
+H5FC = @H5FC@
+HAVEMYSQLCONFIG = @HAVEMYSQLCONFIG@
+HAVE_AIX = @HAVE_AIX@
+HAVE_MAN2HTML = @HAVE_MAN2HTML@
+HAVE_NRT = @HAVE_NRT@
+HAVE_OPENSSL = @HAVE_OPENSSL@
+HAVE_SOME_CURSES = @HAVE_SOME_CURSES@
+HDF5_CC = @HDF5_CC@
+HDF5_CFLAGS = @HDF5_CFLAGS@
+HDF5_CPPFLAGS = @HDF5_CPPFLAGS@
+HDF5_FC = @HDF5_FC@
+HDF5_FFLAGS = @HDF5_FFLAGS@
+HDF5_FLIBS = @HDF5_FLIBS@
+HDF5_LDFLAGS = @HDF5_LDFLAGS@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_VERSION = @HDF5_VERSION@
+HWLOC_CPPFLAGS = @HWLOC_CPPFLAGS@
+HWLOC_LDFLAGS = @HWLOC_LDFLAGS@
+HWLOC_LIBS = @HWLOC_LIBS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JSON_CPPFLAGS = @JSON_CPPFLAGS@
+JSON_LDFLAGS = @JSON_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBCURL = @LIBCURL@
+LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIB_LDFLAGS = @LIB_LDFLAGS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MUNGE_CPPFLAGS = @MUNGE_CPPFLAGS@
+MUNGE_DIR = @MUNGE_DIR@
+MUNGE_LDFLAGS = @MUNGE_LDFLAGS@
+MUNGE_LIBS = @MUNGE_LIBS@
+MYSQL_CFLAGS = @MYSQL_CFLAGS@
+MYSQL_LIBS = @MYSQL_LIBS@
+NCURSES = @NCURSES@
+NETLOC_CPPFLAGS = @NETLOC_CPPFLAGS@
+NETLOC_LDFLAGS = @NETLOC_LDFLAGS@
+NETLOC_LIBS = @NETLOC_LIBS@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NRT_CPPFLAGS = @NRT_CPPFLAGS@
+NUMA_LIBS = @NUMA_LIBS@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OFED_CPPFLAGS = @OFED_CPPFLAGS@
+OFED_LDFLAGS = @OFED_LDFLAGS@
+OFED_LIBS = @OFED_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PAM_DIR = @PAM_DIR@
+PAM_LIBS = @PAM_LIBS@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
+PROCTRACKDIR = @PROCTRACKDIR@
+PROJECT = @PROJECT@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REAL_BGQ_LOADED = @REAL_BGQ_LOADED@
+REAL_BG_L_P_LOADED = @REAL_BG_L_P_LOADED@
+RELEASE = @RELEASE@
+RRDTOOL_CPPFLAGS = @RRDTOOL_CPPFLAGS@
+RRDTOOL_LDFLAGS = @RRDTOOL_LDFLAGS@
+RRDTOOL_LIBS = @RRDTOOL_LIBS@
+RUNJOB_LDFLAGS = @RUNJOB_LDFLAGS@
+SED = @SED@
+SEMAPHORE_LIBS = @SEMAPHORE_LIBS@
+SEMAPHORE_SOURCES = @SEMAPHORE_SOURCES@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLEEP_CMD = @SLEEP_CMD@
+SLURMCTLD_PORT = @SLURMCTLD_PORT@
+SLURMCTLD_PORT_COUNT = @SLURMCTLD_PORT_COUNT@
+SLURMDBD_PORT = @SLURMDBD_PORT@
+SLURMD_PORT = @SLURMD_PORT@
+SLURM_API_AGE = @SLURM_API_AGE@
+SLURM_API_CURRENT = @SLURM_API_CURRENT@
+SLURM_API_MAJOR = @SLURM_API_MAJOR@
+SLURM_API_REVISION = @SLURM_API_REVISION@
+SLURM_API_VERSION = @SLURM_API_VERSION@
+SLURM_MAJOR = @SLURM_MAJOR@
+SLURM_MICRO = @SLURM_MICRO@
+SLURM_MINOR = @SLURM_MINOR@
+SLURM_PREFIX = @SLURM_PREFIX@
+SLURM_VERSION_NUMBER = @SLURM_VERSION_NUMBER@
+SLURM_VERSION_STRING = @SLURM_VERSION_STRING@
+SO_LDFLAGS = @SO_LDFLAGS@
+SSL_CPPFLAGS = @SSL_CPPFLAGS@
+SSL_LDFLAGS = @SSL_LDFLAGS@
+SSL_LIBS = @SSL_LIBS@
+STRIP = @STRIP@
+SUCMD = @SUCMD@
+UTIL_LIBS = @UTIL_LIBS@
+VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+_libcurl_config = @_libcurl_config@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_have_man2html = @ac_have_man2html@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lua_CFLAGS = @lua_CFLAGS@
+lua_LIBS = @lua_LIBS@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AUTOMAKE_OPTIONS = foreign
+PLUGIN_FLAGS = -module -avoid-version --export-dynamic
+@WITH_JSON_PARSER_TRUE@AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common $(DATAWARP_CPPFLAGS) $(JSON_CPPFLAGS)
+@WITH_JSON_PARSER_TRUE@pkglib_LTLIBRARIES = node_features_knl_cray.la
+@WITH_JSON_PARSER_TRUE@node_features_knl_cray_la_SOURCES = node_features_knl_cray.c
+@WITH_JSON_PARSER_TRUE@node_features_knl_cray_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(DATAWARP_LDFLAGS) $(JSON_LDFLAGS)
+@WITH_JSON_PARSER_FALSE@EXTRA_node_features_knl_cray_la_SOURCES = node_features_knl_cray.c
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/plugins/node_features/knl_cray/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign src/plugins/node_features/knl_cray/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+	}
+
+uninstall-pkglibLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+	done
+
+clean-pkglibLTLIBRARIES:
+	-test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+	@list='$(pkglib_LTLIBRARIES)'; \
+	locs=`for p in $$list; do echo $$p; done | \
+	      sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+	      sort -u`; \
+	test -z "$$locs" || { \
+	  echo rm -f $${locs}; \
+	  rm -f $${locs}; \
+	}
+
+node_features_knl_cray.la: $(node_features_knl_cray_la_OBJECTS) $(node_features_knl_cray_la_DEPENDENCIES) $(EXTRA_node_features_knl_cray_la_DEPENDENCIES) 
+	$(AM_V_CCLD)$(node_features_knl_cray_la_LINK) $(am_node_features_knl_cray_la_rpath) $(node_features_knl_cray_la_OBJECTS) $(node_features_knl_cray_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node_features_knl_cray.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(am__tagged_files)
+	$(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	set x; \
+	here=`pwd`; \
+	$(am__define_uniq_tagged_files); \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+	$(am__define_uniq_tagged_files); \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+	list='$(am__tagged_files)'; \
+	case "$(srcdir)" in \
+	  [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+	  *) sdir=$(subdir)/$(srcdir) ;; \
+	esac; \
+	for i in $$list; do \
+	  if test -f "$$i"; then \
+	    echo "$(subdir)/$$i"; \
+	  else \
+	    echo "$$sdir/$$i"; \
+	  fi; \
+	done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+	for dir in "$(DESTDIR)$(pkglibdir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-pkglibLTLIBRARIES cscopelist-am ctags \
+	ctags-am distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-pkglibLTLIBRARIES install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
+	uninstall-pkglibLTLIBRARIES
+
+.PRECIOUS: Makefile
+
+
+@WITH_JSON_PARSER_TRUE@force:
+@WITH_JSON_PARSER_TRUE@$(node_features_knl_cray_la_LIBADD) : force
+@WITH_JSON_PARSER_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/node_features/knl_cray/node_features_knl_cray.c b/src/plugins/node_features/knl_cray/node_features_knl_cray.c
new file mode 100644
index 000000000..df2ebe168
--- /dev/null
+++ b/src/plugins/node_features/knl_cray/node_features_knl_cray.c
@@ -0,0 +1,1961 @@
+/*****************************************************************************\
+ *  node_features_knl_cray.c - Plugin for managing Cray KNL state information
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *  Written by Morris Jette <jette@schedmd.com>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#if HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#define _GNU_SOURCE	/* For POLLRDHUP */
+#include <ctype.h>
+#include <poll.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#if HAVE_JSON_C_INC
+#  include <json-c/json.h>
+#elif HAVE_JSON_INC
+#  include <json/json.h>
+#endif
+
+#include "slurm/slurm.h"
+
+#include "src/common/assoc_mgr.h"
+#include "src/common/fd.h"
+#include "src/common/gres.h"
+#include "src/common/list.h"
+#include "src/common/macros.h"
+#include "src/common/pack.h"
+#include "src/common/parse_config.h"
+#include "src/common/slurm_protocol_api.h"
+#include "src/common/timers.h"
+#include "src/common/uid.h"
+#include "src/common/xmalloc.h"
+#include "src/common/xstring.h"
+#include "src/slurmctld/job_scheduler.h"
+#include "src/slurmctld/locks.h"
+#include "src/slurmctld/node_scheduler.h"
+#include "src/slurmctld/reservation.h"
+#include "src/slurmctld/slurmctld.h"
+#include "src/slurmctld/state_save.h"
+
+/* Maximum poll wait time for child processes, in milliseconds */
+#define MAX_POLL_WAIT 500
+
+/* Intel Knights Landing Configuration Modes */
+#define KNL_NUMA_CNT	5
+#define KNL_MCDRAM_CNT	4
+#define KNL_NUMA_FLAG	0x00ff
+#define KNL_ALL2ALL	0x0001
+#define KNL_SNC2	0x0002
+#define KNL_SNC4	0x0004
+#define KNL_HEMI	0x0008
+#define KNL_QUAD	0x0010
+#define KNL_MCDRAM_FLAG	0xff00
+#define KNL_CACHE	0x0100
+#define KNL_SPLIT	0x0200
+#define KNL_EQUAL	0x0400
+#define KNL_FLAT	0x0800
+
+/* These are defined here so when we link with something other than
+ * the slurmctld we will have these symbols defined.  They will get
+ * overwritten when linking with the slurmctld.
+ */
+#if defined (__APPLE__)
+slurmctld_config_t slurmctld_config __attribute__((weak_import));
+#else
+slurmctld_config_t slurmctld_config;
+#endif
+
+/*
+ * These variables are required by the burst buffer plugin interface.  If they
+ * are not found in the plugin, the plugin loader will ignore it.
+ *
+ * plugin_name - a string giving a human-readable description of the
+ * plugin.  There is no maximum length, but the symbol must refer to
+ * a valid string.
+ *
+ * plugin_type - a string suggesting the type of the plugin or its
+ * applicability to a particular form of data or method of data handling.
+ * If the low-level plugin API is used, the contents of this string are
+ * unimportant and may be anything.  SLURM uses the higher-level plugin
+ * interface which requires this string to be of the form
+ *
+ *      <application>/<method>
+ *
+ * where <application> is a description of the intended application of
+ * the plugin (e.g., "node_features" for SLURM node_features) and <method> is a
+ * description of how this plugin satisfies that application.  SLURM will only
+ * load a node_features plugin if the plugin_type string has a prefix of
+ * "node_features/".
+ *
+ * plugin_version - an unsigned 32-bit integer containing the Slurm version
+ * (major.minor.micro combined into a single number).
+ */
+const char plugin_name[]        = "node_features knl_cray plugin";
+const char plugin_type[]        = "node_features/knl_cray";
+const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
+
+/* Configuration Paramters */
+static char *capmc_path = NULL;
+static uint32_t capmc_poll_freq = 45;	/* capmc state polling frequency */
+static uint32_t capmc_timeout = 0;	/* capmc command timeout in msec */
+static bool  debug_flag = false;
+static uint16_t allow_mcdram = KNL_MCDRAM_FLAG;
+static uint16_t allow_numa = KNL_NUMA_FLAG;
+static uid_t *allowed_uid = NULL;
+static int allowed_uid_cnt = 0;
+static uint16_t default_mcdram = KNL_CACHE;
+static uint16_t default_numa = KNL_ALL2ALL;
+static char *syscfg_path = NULL;
+static pthread_mutex_t config_mutex = PTHREAD_MUTEX_INITIALIZER;
+static bool reconfig = false;
+
+/* Percentage of MCDRAM used for cache by type, updated from capmc */
+static int mcdram_pct[KNL_MCDRAM_CNT];
+static uint64_t *mcdram_per_node = NULL;
+
+/* NOTE: New knl_cray.conf parameters added below must also be added to the
+ * contribs/cray/capmc_suspend.c and contribs/cray/capmc_resume.c files */
+static s_p_options_t knl_conf_file_options[] = {
+	{"AllowMCDRAM", S_P_STRING},
+	{"AllowNUMA", S_P_STRING},
+	{"AllowUserBoot", S_P_STRING},
+	{"CapmcPath", S_P_STRING},
+	{"CapmcPollFreq", S_P_UINT32},
+	{"CapmcTimeout", S_P_UINT32},
+	{"DefaultMCDRAM", S_P_STRING},
+	{"DefaultNUMA", S_P_STRING},
+	{"LogFile", S_P_STRING},
+	{"SyscfgPath", S_P_STRING},
+	{NULL}
+};
+
+typedef struct mcdram_cap {
+	uint32_t nid;
+	char *mcdram_cfg;
+} mcdram_cap_t;
+
+typedef struct mcdram_cfg {
+	uint64_t dram_size;
+	uint32_t nid;
+	char *mcdram_cfg;
+	uint64_t mcdram_size;
+	uint16_t mcdram_pct;
+} mcdram_cfg_t;
+
+typedef struct numa_cap {
+	uint32_t nid;
+	char *numa_cfg;
+} numa_cap_t;
+
+typedef struct numa_cfg {
+	uint32_t nid;
+	char *numa_cfg;
+} numa_cfg_t;
+
+static s_p_hashtbl_t *_config_make_tbl(char *filename);
+static void _free_script_argv(char **script_argv);
+static mcdram_cap_t *_json_parse_mcdram_cap_array(json_object *jobj, char *key,
+						  int *num);
+static mcdram_cfg_t *_json_parse_mcdram_cfg_array(json_object *jobj, char *key,
+						  int *num);
+static void _json_parse_mcdram_cap_object(json_object *jobj, mcdram_cap_t *ent);
+static void _json_parse_mcdram_cfg_object(json_object *jobj, mcdram_cfg_t *ent);
+static numa_cap_t *_json_parse_numa_cap_array(json_object *jobj, char *key,
+					      int *num);
+static numa_cfg_t *_json_parse_numa_cfg_array(json_object *jobj, char *key,
+					      int *num);
+static void _json_parse_numa_cap_object(json_object *jobj, numa_cap_t *ent);
+static void _json_parse_numa_cfg_object(json_object *jobj, numa_cfg_t *ent);
+static int  _knl_mcdram_bits_cnt(uint16_t mcdram_num);
+static uint16_t _knl_mcdram_parse(char *mcdram_str, char *sep);
+static char *_knl_mcdram_str(uint16_t mcdram_num);
+static uint16_t _knl_mcdram_token(char *token);
+static int _knl_numa_bits_cnt(uint16_t numa_num);
+static uint16_t _knl_numa_parse(char *numa_str, char *sep);
+static char *_knl_numa_str(uint16_t numa_num);
+static uint16_t _knl_numa_token(char *token);
+static void _log_script_argv(char **script_argv, char *resp_msg);
+static void _mcdram_cap_free(mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt);
+static void _mcdram_cap_log(mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt);
+static void _mcdram_cfg_free(mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt);
+static void _mcdram_cfg_log(mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt);
+static void _merge_strings(char **node_features, char *node_cfg,
+			   uint16_t allow_types);
+static void _numa_cap_free(numa_cap_t *numa_cap, int numa_cap_cnt);
+static void _numa_cap_log(numa_cap_t *numa_cap, int numa_cap_cnt);
+static void _numa_cfg_free(numa_cfg_t *numa_cfg, int numa_cfg_cnt);
+static void _numa_cfg_log(numa_cfg_t *numa_cfg, int numa_cfg_cnt);
+static uint64_t _parse_size(char *size_str);
+static char *_run_script(char *cmd_path, char **script_argv, int *status);
+static void _strip_knl_opts(char **features);
+static int  _tot_wait (struct timeval *start_time);
+static void _update_all_node_features(
+				mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt,
+				mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt,
+				numa_cap_t *numa_cap, int numa_cap_cnt,
+				numa_cfg_t *numa_cfg, int numa_cfg_cnt);
+static void _update_mcdram_pct(char *tok, int mcdram_num);
+static void _update_node_features(struct node_record *node_ptr,
+				  mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt,
+				  mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt,
+				  numa_cap_t *numa_cap, int numa_cap_cnt,
+				  numa_cfg_t *numa_cfg, int numa_cfg_cnt);
+
+static s_p_hashtbl_t *_config_make_tbl(char *filename)
+{
+	s_p_hashtbl_t *tbl = NULL;
+
+	xassert(filename);
+
+	if (!(tbl = s_p_hashtbl_create(knl_conf_file_options))) {
+		error("knl.conf: %s: s_p_hashtbl_create error: %m", __func__);
+		return tbl;
+	}
+
+	if (s_p_parse_file(tbl, NULL, filename, false) == SLURM_ERROR) {
+		error("knl.conf: %s: s_p_parse_file error: %m", __func__);
+		s_p_hashtbl_destroy(tbl);
+		tbl = NULL;
+	}
+
+	return tbl;
+}
+
+/*
+ * Return the count of MCDRAM bits set
+ */
+static int _knl_mcdram_bits_cnt(uint16_t mcdram_num)
+{
+	int cnt = 0, i;
+	uint16_t tmp = 1;
+
+	for (i = 0; i < 16; i++) {
+		if ((mcdram_num & KNL_MCDRAM_FLAG) & tmp)
+			cnt++;
+		tmp = tmp << 1;
+	}
+	return cnt;
+}
+
+/*
+ * Translate KNL MCDRAM string to equivalent numeric value
+ * mcdram_str IN - String to scan
+ * sep IN - token separator to search for
+ * RET MCDRAM numeric value
+ */
+static uint16_t _knl_mcdram_parse(char *mcdram_str, char *sep)
+{
+	char *save_ptr = NULL, *tmp, *tok;
+	uint16_t mcdram_num = 0;
+
+	if (!mcdram_str)
+		return mcdram_num;
+
+	tmp = xstrdup(mcdram_str);
+	tok = strtok_r(tmp, sep, &save_ptr);
+	while (tok) {
+		mcdram_num |= _knl_mcdram_token(tok);
+		tok = strtok_r(NULL, sep, &save_ptr);
+	}
+	xfree(tmp);
+
+	return mcdram_num;
+}
+
+/*
+ * Translate KNL MCDRAM number to equivalent string value
+ * Caller must free return value
+ */
+static char *_knl_mcdram_str(uint16_t mcdram_num)
+{
+	char *mcdram_str = NULL, *sep = "";
+
+	if (mcdram_num & KNL_CACHE) {
+		xstrfmtcat(mcdram_str, "%scache", sep);
+		sep = ",";
+	}
+	if (mcdram_num & KNL_SPLIT) {
+		xstrfmtcat(mcdram_str, "%ssplit", sep);
+		sep = ",";
+	}
+	if (mcdram_num & KNL_FLAT) {
+		xstrfmtcat(mcdram_str, "%sflat", sep);
+		sep = ",";
+	}
+	if (mcdram_num & KNL_EQUAL) {
+		xstrfmtcat(mcdram_str, "%sequal", sep);
+//		sep = ",";	/* Remove to avoid CLANG error */
+	}
+
+	return mcdram_str;
+}
+
+/*
+ * Given a KNL MCDRAM token, return its equivalent numeric value
+ * token IN - String to scan
+ * RET MCDRAM numeric value
+ */
+static uint16_t _knl_mcdram_token(char *token)
+{
+	uint16_t mcdram_num = 0;
+
+	if (!xstrcasecmp(token, "cache"))
+		mcdram_num = KNL_CACHE;
+	else if (!xstrcasecmp(token, "split"))
+		mcdram_num = KNL_SPLIT;
+	else if (!xstrcasecmp(token, "flat"))
+		mcdram_num = KNL_FLAT;
+	else if (!xstrcasecmp(token, "equal"))
+		mcdram_num = KNL_EQUAL;
+
+	return mcdram_num;
+}
+
+/*
+ * Return the count of NUMA bits set
+ */
+static int _knl_numa_bits_cnt(uint16_t numa_num)
+{
+	int cnt = 0, i;
+	uint16_t tmp = 1;
+
+	for (i = 0; i < 16; i++) {
+		if ((numa_num & KNL_NUMA_FLAG) & tmp)
+			cnt++;
+		tmp = tmp << 1;
+	}
+	return cnt;
+}
+
+/*
+ * Translate KNL NUMA string to equivalent numeric value
+ * numa_str IN - String to scan
+ * sep IN - token separator to search for
+ * RET NUMA numeric value
+ */
+static uint16_t _knl_numa_parse(char *numa_str, char *sep)
+{
+	char *save_ptr = NULL, *tmp, *tok;
+	uint16_t numa_num = 0;
+
+	if (!numa_str)
+		return numa_num;
+
+	tmp = xstrdup(numa_str);
+	tok = strtok_r(tmp, sep, &save_ptr);
+	while (tok) {
+		numa_num |= _knl_numa_token(tok);
+		tok = strtok_r(NULL, sep, &save_ptr);
+	}
+	xfree(tmp);
+
+	return numa_num;
+}
+
+/*
+ * Translate KNL NUMA number to equivalent string value
+ * Caller must free return value
+ */
+static char *_knl_numa_str(uint16_t numa_num)
+{
+	char *numa_str = NULL, *sep = "";
+
+	if (numa_num & KNL_ALL2ALL) {
+		xstrfmtcat(numa_str, "%sa2a", sep);
+		sep = ",";
+	}
+	if (numa_num & KNL_SNC2) {
+		xstrfmtcat(numa_str, "%ssnc2", sep);
+		sep = ",";
+	}
+	if (numa_num & KNL_SNC4) {
+		xstrfmtcat(numa_str, "%ssnc4", sep);
+		sep = ",";
+	}
+	if (numa_num & KNL_HEMI) {
+		xstrfmtcat(numa_str, "%shemi", sep);
+		sep = ",";
+	}
+	if (numa_num & KNL_QUAD) {
+		xstrfmtcat(numa_str, "%squad", sep);
+//		sep = ",";	/* Remove to avoid CLANG error */
+	}
+
+	return numa_str;
+
+}
+
+/*
+ * Given a KNL NUMA token, return its equivalent numeric value
+ * token IN - String to scan
+ * RET NUMA numeric value
+ */
+static uint16_t _knl_numa_token(char *token)
+{
+	uint16_t numa_num = 0;
+
+	if (!xstrcasecmp(token, "a2a"))
+		numa_num |= KNL_ALL2ALL;
+	else if (!xstrcasecmp(token, "snc2"))
+		numa_num |= KNL_SNC2;
+	else if (!xstrcasecmp(token, "snc4"))
+		numa_num |= KNL_SNC4;
+	else if (!xstrcasecmp(token, "hemi"))
+		numa_num |= KNL_HEMI;
+	else if (!xstrcasecmp(token, "quad"))
+		numa_num |= KNL_QUAD;
+
+	return numa_num;
+}
+
+/* Remove all KNL feature names from the "features" string */
+static void _strip_knl_opts(char **features)
+{
+	char *save_ptr = NULL, *tok;
+	char *tmp_str, *result_str = NULL, *sep = "";
+
+	if (*features == NULL)
+		return;
+
+	tmp_str = xstrdup(*features);
+	tok = strtok_r(tmp_str, ",", &save_ptr);
+	while (tok) {
+		if (!_knl_mcdram_token(tok) && !_knl_numa_token(tok)) {
+			xstrfmtcat(result_str, "%s%s", sep, tok);
+			sep = ",";
+		}
+		tok = strtok_r(NULL, ",", &save_ptr);
+	}
+	xfree(tmp_str);
+	xfree(*features);
+	*features = result_str;
+}
+
+/*
+ * Return time in msec since "start time"
+ */
+static int _tot_wait (struct timeval *start_time)
+{
+	struct timeval end_time;
+	int msec_delay;
+
+	gettimeofday(&end_time, NULL);
+	msec_delay =   (end_time.tv_sec  - start_time->tv_sec ) * 1000;
+	msec_delay += ((end_time.tv_usec - start_time->tv_usec + 500) / 1000);
+	return msec_delay;
+}
+
+/* Free an array of xmalloced records. The array must be NULL terminated. */
+static void _free_script_argv(char **script_argv)
+{
+	int i;
+
+	for (i = 0; script_argv[i]; i++)
+		xfree(script_argv[i]);
+	xfree(script_argv);
+}
+
+/* Update our mcdram_pct array with new data.
+ * tok IN - percentage of MCDRAM to be used as cache (string form)
+ * mcdram_num - MCDRAM value (bit from KNL_FLAT, etc.)
+ */
+static void _update_mcdram_pct(char *tok, int mcdram_num)
+{
+	static int mcdram_set = 0;
+	int inx;
+
+	if (mcdram_set == KNL_MCDRAM_CNT)
+		return;
+
+	for (inx = 0; inx < KNL_MCDRAM_CNT; inx++) {
+		if ((KNL_CACHE << inx) == mcdram_num)
+			break;
+	}
+	if ((inx >= KNL_MCDRAM_CNT) || (mcdram_pct[inx] != -1))
+		return;
+	mcdram_pct[inx] = strtol(tok, NULL, 10);
+	mcdram_set++;
+}
+
+static void _json_parse_mcdram_cap_object(json_object *jobj, mcdram_cap_t *ent)
+{
+	enum json_type type;
+	struct json_object_iter iter;
+	int64_t x;
+	const char *p;
+	char *tmp_str, *tok, *save_ptr = NULL, *sep = "";
+	int last_mcdram_num = -1;
+
+	json_object_object_foreachC(jobj, iter) {
+		type = json_object_get_type(iter.val);
+		switch (type) {
+		case json_type_int:
+			x = json_object_get_int64(iter.val);
+			if (xstrcmp(iter.key, "nid") == 0) {
+				ent->nid = x;
+			}
+			break;
+		case json_type_string:
+			p = json_object_get_string(iter.val);
+			if (xstrcmp(iter.key, "mcdram_cfg") == 0) {
+				tmp_str = xstrdup(p);
+				tok = strtok_r(tmp_str, ",", &save_ptr);
+				while (tok) {
+					if ((tok[0] >= '0') && (tok[0] <= '9')){
+						_update_mcdram_pct(tok,
+							last_mcdram_num);
+						last_mcdram_num = -1;
+					} else {
+						last_mcdram_num =
+							_knl_mcdram_token(tok);
+						xstrfmtcat(ent->mcdram_cfg,
+							   "%s%s", sep, tok);
+						sep = ",";
+					}
+					tok = strtok_r(NULL, ",", &save_ptr);
+				}
+				xfree(tmp_str);
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+static uint64_t _parse_size(char *size_str)
+{
+	uint64_t size_num = 0;
+	char *end_ptr = NULL;
+
+	size_num = (uint64_t) strtol(size_str, &end_ptr, 10);
+	if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K'))
+		size_num *= 1024;
+	else if ((end_ptr[0] == 'm') || (end_ptr[0] == 'M'))
+		size_num *= (1024 * 1024);
+	else if ((end_ptr[0] == 'g') || (end_ptr[0] == 'G'))
+		size_num *= (1024 * 1024 * 1024);
+	else if (end_ptr[0] != '\0')
+		info("Invalid MCDRAM size: %s", size_str);
+
+	return size_num;
+}
+
+static void _json_parse_mcdram_cfg_object(json_object *jobj, mcdram_cfg_t *ent)
+{
+	enum json_type type;
+	struct json_object_iter iter;
+	int64_t x;
+	const char *p;
+
+	json_object_object_foreachC(jobj, iter) {
+		type = json_object_get_type(iter.val);
+		switch (type) {
+		case json_type_int:
+			x = json_object_get_int64(iter.val);
+			if (xstrcmp(iter.key, "nid") == 0) {
+				ent->nid = x;
+			}
+			break;
+		case json_type_string:
+			p = json_object_get_string(iter.val);
+			if (xstrcmp(iter.key, "dram_size") == 0) {
+				ent->dram_size = _parse_size((char *) p);
+			} else if (xstrcmp(iter.key, "mcdram_cfg") == 0) {
+				ent->mcdram_cfg = xstrdup(p);
+			} else if (xstrcmp(iter.key, "mcdram_pct") == 0) {
+				ent->mcdram_pct = _parse_size((char *) p);
+			} else if (xstrcmp(iter.key, "mcdram_size") == 0) {
+				ent->mcdram_size = _parse_size((char *) p);
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+static void _json_parse_numa_cap_object(json_object *jobj, numa_cap_t *ent)
+{
+	enum json_type type;
+	struct json_object_iter iter;
+	int64_t x;
+	const char *p;
+
+	json_object_object_foreachC(jobj, iter) {
+		type = json_object_get_type(iter.val);
+		switch (type) {
+		case json_type_int:
+			x = json_object_get_int64(iter.val);
+			if (xstrcmp(iter.key, "nid") == 0) {
+				ent->nid = x;
+			}
+			break;
+		case json_type_string:
+			p = json_object_get_string(iter.val);
+			if (xstrcmp(iter.key, "numa_cfg") == 0) {
+				ent->numa_cfg = xstrdup(p);
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+static void _json_parse_numa_cfg_object(json_object *jobj, numa_cfg_t *ent)
+{
+	enum json_type type;
+	struct json_object_iter iter;
+	int64_t x;
+	const char *p;
+
+	json_object_object_foreachC(jobj, iter) {
+		type = json_object_get_type(iter.val);
+		switch (type) {
+		case json_type_int:
+			x = json_object_get_int64(iter.val);
+			if (xstrcmp(iter.key, "nid") == 0) {
+				ent->nid = x;
+			}
+			break;
+		case json_type_string:
+			p = json_object_get_string(iter.val);
+			if (xstrcmp(iter.key, "numa_cfg") == 0) {
+				ent->numa_cfg = xstrdup(p);
+			}
+			break;
+		default:
+			break;
+		}
+	}
+}
+
+static mcdram_cap_t *_json_parse_mcdram_cap_array(json_object *jobj, char *key,
+						  int *num)
+{
+	json_object *jarray;
+	json_object *jvalue;
+	mcdram_cap_t *ents;
+	int i;
+
+	jarray = jobj;
+	json_object_object_get_ex(jobj, key, &jarray);
+
+	*num = json_object_array_length(jarray);
+	ents = xmalloc(*num * sizeof(mcdram_cap_t));
+
+	for (i = 0; i < *num; i++) {
+		jvalue = json_object_array_get_idx(jarray, i);
+		_json_parse_mcdram_cap_object(jvalue, &ents[i]);
+	}
+
+	return ents;
+}
+
+static mcdram_cfg_t *_json_parse_mcdram_cfg_array(json_object *jobj, char *key,
+						  int *num)
+{
+	json_object *jarray;
+	json_object *jvalue;
+	mcdram_cfg_t *ents;
+	int i;
+
+	jarray = jobj;
+	json_object_object_get_ex(jobj, key, &jarray);
+
+	*num = json_object_array_length(jarray);
+	ents = xmalloc(*num * sizeof(mcdram_cfg_t));
+
+	for (i = 0; i < *num; i++) {
+		jvalue = json_object_array_get_idx(jarray, i);
+		_json_parse_mcdram_cfg_object(jvalue, &ents[i]);
+	}
+
+	return ents;
+}
+
+static numa_cap_t *_json_parse_numa_cap_array(json_object *jobj, char *key,
+					      int *num)
+{
+	json_object *jarray;
+	json_object *jvalue;
+	numa_cap_t *ents;
+	int i;
+
+	jarray = jobj;
+	json_object_object_get_ex(jobj, key, &jarray);
+
+	*num = json_object_array_length(jarray);
+	ents = xmalloc(*num * sizeof(numa_cap_t));
+
+	for (i = 0; i < *num; i++) {
+		jvalue = json_object_array_get_idx(jarray, i);
+		_json_parse_numa_cap_object(jvalue, &ents[i]);
+	}
+
+	return ents;
+}
+
+static numa_cfg_t *_json_parse_numa_cfg_array(json_object *jobj, char *key,
+					      int *num)
+{
+	json_object *jarray;
+	json_object *jvalue;
+	numa_cfg_t *ents;
+	int i;
+
+	jarray = jobj;
+	json_object_object_get_ex(jobj, key, &jarray);
+
+	*num = json_object_array_length(jarray);
+	ents = xmalloc(*num * sizeof(numa_cfg_t));
+
+	for (i = 0; i < *num; i++) {
+		jvalue = json_object_array_get_idx(jarray, i);
+		_json_parse_numa_cfg_object(jvalue, &ents[i]);
+	}
+
+	return ents;
+}
+
+/* Log a command's arguments. */
+static void _log_script_argv(char **script_argv, char *resp_msg)
+{
+	char *cmd_line = NULL;
+	int i;
+
+	if (!debug_flag)
+		return;
+
+	for (i = 0; script_argv[i]; i++) {
+		if (i)
+			xstrcat(cmd_line, " ");
+		xstrcat(cmd_line, script_argv[i]);
+	}
+	info("%s", cmd_line);
+	if (resp_msg && resp_msg[0])
+		info("%s", resp_msg);
+	xfree(cmd_line);
+}
+
+static void _mcdram_cap_free(mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt)
+{
+	int i;
+
+	if (!mcdram_cap)
+		return;
+	for (i = 0; i < mcdram_cap_cnt; i++) {
+		xfree(mcdram_cap[i].mcdram_cfg);
+	}
+	xfree(mcdram_cap);
+}
+
+static void _mcdram_cap_log(mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt)
+{
+	int i;
+
+	if (!mcdram_cap)
+		return;
+	for (i = 0; i < mcdram_cap_cnt; i++) {
+		info("MCDRAM_CAP[%d]: nid:%u mcdram_cfg:%s",
+		     i, mcdram_cap[i].nid, mcdram_cap[i].mcdram_cfg);
+	}
+}
+
+static void _mcdram_cfg_free(mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt)
+{
+	int i;
+
+	if (!mcdram_cfg)
+		return;
+	for (i = 0; i < mcdram_cfg_cnt; i++) {
+		xfree(mcdram_cfg[i].mcdram_cfg);
+	}
+	xfree(mcdram_cfg);
+}
+
+static void _mcdram_cfg_log(mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt)
+{
+	int i;
+
+	if (!mcdram_cfg)
+		return;
+	for (i = 0; i < mcdram_cfg_cnt; i++) {
+		info("MCDRAM_CFG[%d]: nid:%u dram_size:%"PRIu64" mcdram_cfg:%s mcdram_pct:%u mcdram_size:%"PRIu64,
+		     i, mcdram_cfg[i].nid, mcdram_cfg[i].dram_size,
+		     mcdram_cfg[i].mcdram_cfg, mcdram_cfg[i].mcdram_pct,
+		     mcdram_cfg[i].mcdram_size);
+	}
+}
+
+static void _numa_cap_free(numa_cap_t *numa_cap, int numa_cap_cnt)
+{
+	int i;
+
+	if (!numa_cap)
+		return;
+	for (i = 0; i < numa_cap_cnt; i++) {
+		xfree(numa_cap[i].numa_cfg);
+	}
+	xfree(numa_cap);
+}
+
+static void _numa_cap_log(numa_cap_t *numa_cap, int numa_cap_cnt)
+{
+	int i;
+
+	if (!numa_cap)
+		return;
+	for (i = 0; i < numa_cap_cnt; i++) {
+		info("NUMA_CAP[%d]: nid:%u numa_cfg:%s",
+		     i, numa_cap[i].nid, numa_cap[i].numa_cfg);
+	}
+}
+
+static void _numa_cfg_free(numa_cfg_t *numa_cfg, int numa_cfg_cnt)
+{
+	int i;
+
+	if (!numa_cfg)
+		return;
+	for (i = 0; i < numa_cfg_cnt; i++) {
+		xfree(numa_cfg[i].numa_cfg);
+	}
+	xfree(numa_cfg);
+}
+
+static void _numa_cfg_log(numa_cfg_t *numa_cfg, int numa_cfg_cnt)
+{
+	int i;
+
+	if (!numa_cfg)
+		return;
+	for (i = 0; i < numa_cfg_cnt; i++) {
+		info("NUMA_CFG[%d]: nid:%u numa_cfg:%s",
+		     i, numa_cfg[i].nid, numa_cfg[i].numa_cfg);
+	}
+}
+
+/* Run a script and return its stdout plus exit status */
+static char *_run_script(char *cmd_path, char **script_argv, int *status)
+{
+	int cc, i, new_wait, resp_size = 0, resp_offset = 0;
+	pid_t cpid;
+	char *resp = NULL;
+	int pfd[2] = { -1, -1 };
+
+	if (access(cmd_path, R_OK | X_OK) < 0) {
+		error("%s: %s can not be executed: %m", __func__, cmd_path);
+		*status = 127;
+		resp = xstrdup("Slurm node_features/knl_cray configuration error");
+		return resp;
+	}
+	if (pipe(pfd) != 0) {
+		error("%s: pipe(): %m", __func__);
+		*status = 127;
+		resp = xstrdup("System error");
+		return resp;
+	}
+
+	if ((cpid = fork()) == 0) {
+		cc = sysconf(_SC_OPEN_MAX);
+		dup2(pfd[1], STDERR_FILENO);
+		dup2(pfd[1], STDOUT_FILENO);
+		for (i = 0; i < cc; i++) {
+			if ((i != STDERR_FILENO) && (i != STDOUT_FILENO))
+				close(i);
+		}
+#ifdef SETPGRP_TWO_ARGS
+		setpgrp(0, 0);
+#else
+		setpgrp();
+#endif
+		execv(cmd_path, script_argv);
+		error("%s: execv(%s): %m", __func__, cmd_path);
+		exit(127);
+	} else if (cpid < 0) {
+		close(pfd[0]);
+		close(pfd[1]);
+		error("%s: fork(): %m", __func__);
+	} else {
+		struct pollfd fds;
+		struct timeval tstart;
+		resp_size = 1024;
+		resp = xmalloc(resp_size);
+		close(pfd[1]);
+		gettimeofday(&tstart, NULL);
+		while (1) {
+			if (slurmctld_config.shutdown_time) {
+				error("%s: killing %s operation on shutdown",
+				      __func__, script_argv[1]);
+				break;
+			}
+			fds.fd = pfd[0];
+			fds.events = POLLIN | POLLHUP | POLLRDHUP;
+			fds.revents = 0;
+			new_wait = capmc_timeout - _tot_wait(&tstart);
+			if (new_wait <= 0) {
+				error("%s: %s poll timeout @ %d msec",
+				      __func__, script_argv[1], capmc_timeout);
+				break;
+			}
+			new_wait = MIN(new_wait, MAX_POLL_WAIT);
+			i = poll(&fds, 1, new_wait);
+			if (i == 0) {
+				continue;
+			} else if (i < 0) {
+				error("%s: %s poll:%m", __func__,
+				      script_argv[1]);
+				break;
+			}
+			if ((fds.revents & POLLIN) == 0)
+				break;
+			i = read(pfd[0], resp + resp_offset,
+				 resp_size - resp_offset);
+			if (i == 0) {
+				break;
+			} else if (i < 0) {
+				if (errno == EAGAIN)
+					continue;
+				error("%s: read(%s): %m", __func__, capmc_path);
+				break;
+			} else {
+				resp_offset += i;
+				if (resp_offset + 1024 >= resp_size) {
+					resp_size *= 2;
+					resp = xrealloc(resp, resp_size);
+				}
+			}
+		}
+		killpg(cpid, SIGTERM);
+		usleep(10000);
+		killpg(cpid, SIGKILL);
+		waitpid(cpid, status, 0);
+		close(pfd[0]);
+	}
+	return resp;
+}
+
+static void _merge_strings(char **node_features, char *node_cfg,
+			   uint16_t allow_types)
+{
+	char *tmp_str1, *tok1, *save_ptr1 = NULL;
+	char *tmp_str2, *tok2, *save_ptr2 = NULL;
+	bool mcdram_filter = false, numa_filter = false;
+
+	if ((node_cfg == NULL) || (node_cfg[0] == '\0'))
+		return;
+	if (*node_features == NULL) {
+		*node_features = xstrdup(node_cfg);
+		return;
+	}
+
+	if ((allow_types &  KNL_MCDRAM_FLAG) &&
+	    (allow_types != KNL_MCDRAM_FLAG))
+		mcdram_filter = true;
+	if ((allow_types &  KNL_NUMA_FLAG) &&
+	    (allow_types != KNL_NUMA_FLAG))
+		numa_filter = true;
+
+	/* Merge strings and avoid duplicates */
+	tmp_str1 = xstrdup(node_cfg);
+	tok1 = strtok_r(tmp_str1, ",", &save_ptr1);
+	while (tok1) {
+		bool match = false;
+		if (mcdram_filter &&
+		    ((_knl_mcdram_token(tok1) & allow_types) == 0))
+			goto next_tok;
+		if (numa_filter &&
+		    ((_knl_numa_token(tok1) & allow_types) == 0))
+			goto next_tok;
+		tmp_str2 = xstrdup(*node_features);
+		tok2 = strtok_r(tmp_str2, ",", &save_ptr2);
+		while (tok2) {
+			if (!xstrcmp(tok1, tok2)) {
+				match = true;
+				break;
+			}
+			tok2 = strtok_r(NULL, ",", &save_ptr2);
+		}
+		xfree(tmp_str2);
+		if (!match)
+			xstrfmtcat(*node_features, ",%s", tok1);
+next_tok:	tok1 = strtok_r(NULL, ",", &save_ptr1);
+	}
+	xfree(tmp_str1);
+}
+
+/* Update features and features_act fields for ALL nodes based upon
+ * its current configuration provided by capmc */
+static void _update_all_node_features(
+				mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt,
+				mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt,
+				numa_cap_t *numa_cap, int numa_cap_cnt,
+				numa_cfg_t *numa_cfg, int numa_cfg_cnt)
+{
+	struct node_record *node_ptr;
+	char node_name[32], *prefix;
+	int i, width = 5;
+	uint64_t mcdram_size;
+
+	if ((node_record_table_ptr == NULL) ||
+	    (node_record_table_ptr->name == NULL)) {
+		prefix = xstrdup("nid");
+	} else {
+		prefix = xstrdup(node_record_table_ptr->name);
+		for (i = 0; prefix[i]; i++) {
+			if ((prefix[i] >= '0') && (prefix[i] <= '9')) {
+				prefix[i] = '\0';
+				width = 1;
+				for (i++ ; prefix[i]; i++)
+					width++;
+				break;
+			}
+		}
+	}
+	if (mcdram_cap) {
+		for (i = 0; i < mcdram_cap_cnt; i++) {
+			snprintf(node_name, sizeof(node_name),
+				 "%s%.*d", prefix, width, mcdram_cap[i].nid);
+			node_ptr = find_node_record(node_name);
+			if (node_ptr) {
+				_merge_strings(&node_ptr->features,
+					       mcdram_cap[i].mcdram_cfg,
+					       allow_mcdram);
+			}
+		}
+	}
+	if (mcdram_cfg) {
+		for (i = 0; i < mcdram_cfg_cnt; i++) {
+			snprintf(node_name, sizeof(node_name),
+				 "%s%.*d", prefix, width, mcdram_cfg[i].nid);
+			if (!(node_ptr = find_node_record(node_name)))
+				continue;
+			mcdram_per_node[node_ptr - node_record_table_ptr] =
+				mcdram_cfg[i].mcdram_size;
+			_merge_strings(&node_ptr->features_act,
+				       mcdram_cfg[i].mcdram_cfg,
+				       allow_mcdram);
+			mcdram_size = mcdram_cfg[i].mcdram_size *
+				      (100 - mcdram_cfg[i].mcdram_pct) / 100;
+			if (!node_ptr->gres) {
+				node_ptr->gres =
+					xstrdup(node_ptr->config_ptr->gres);
+			}
+			gres_plugin_node_feature(node_ptr->name, "hbm",
+						 mcdram_size, &node_ptr->gres,
+						 &node_ptr->gres_list);
+		}
+	}
+	if (numa_cap) {
+		for (i = 0; i < numa_cap_cnt; i++) {
+			snprintf(node_name, sizeof(node_name),
+				 "%s%.*d", prefix, width, numa_cap[i].nid);
+			node_ptr = find_node_record(node_name);
+			if (node_ptr) {
+				_merge_strings(&node_ptr->features,
+					       numa_cap[i].numa_cfg,
+					       allow_numa);
+			}
+		}
+	}
+	if (numa_cfg) {
+		for (i = 0; i < numa_cfg_cnt; i++) {
+			snprintf(node_name, sizeof(node_name),
+				 "%s%.*d", prefix, width, numa_cfg[i].nid);
+			node_ptr = find_node_record(node_name);
+			if (node_ptr) {
+				_merge_strings(&node_ptr->features_act,
+					       numa_cfg[i].numa_cfg,
+					       allow_numa);
+			}
+		}
+	}
+	xfree(prefix);
+}
+
+/* Update a specific node's features and features_act fields based upon
+ * its current configuration provided by capmc */
+static void _update_node_features(struct node_record *node_ptr,
+				  mcdram_cap_t *mcdram_cap, int mcdram_cap_cnt,
+				  mcdram_cfg_t *mcdram_cfg, int mcdram_cfg_cnt,
+				  numa_cap_t *numa_cap, int numa_cap_cnt,
+				  numa_cfg_t *numa_cfg, int numa_cfg_cnt)
+{
+	int i, nid;
+	char *end_ptr = "";
+	uint64_t mcdram_size;
+
+	xassert(node_ptr);
+	nid = strtol(node_ptr->name + 3, &end_ptr, 10);
+	if (end_ptr[0] != '\0') {
+		error("%s: Invalid node name (%s)", __func__, node_ptr->name);
+		return;
+	}
+
+	_strip_knl_opts(&node_ptr->features);
+	if (node_ptr->features && !node_ptr->features_act)
+		node_ptr->features_act = xstrdup(node_ptr->features);
+	_strip_knl_opts(&node_ptr->features_act);
+
+	if (mcdram_cap) {
+		for (i = 0; i < mcdram_cap_cnt; i++) {
+			if (nid == mcdram_cap[i].nid) {
+				_merge_strings(&node_ptr->features,
+					       mcdram_cap[i].mcdram_cfg,
+					       allow_mcdram);
+				break;
+			}
+		}
+	}
+	if (mcdram_cfg) {
+		for (i = 0; i < mcdram_cfg_cnt; i++) {
+			if (nid != mcdram_cfg[i].nid)
+				continue;
+			_merge_strings(&node_ptr->features_act,
+				       mcdram_cfg[i].mcdram_cfg,
+				       allow_mcdram);
+			mcdram_per_node[node_ptr - node_record_table_ptr] =
+				mcdram_cfg[i].mcdram_size;
+			mcdram_size = mcdram_cfg[i].mcdram_size *
+				      (100 - mcdram_cfg[i].mcdram_pct) / 100;
+			if (!node_ptr->gres) {
+				node_ptr->gres =
+					xstrdup(node_ptr->config_ptr->gres);
+			}
+			gres_plugin_node_feature(node_ptr->name, "hbm",
+						 mcdram_size, &node_ptr->gres,
+						 &node_ptr->gres_list);
+			break;
+		}
+	}
+	if (numa_cap) {
+		for (i = 0; i < numa_cap_cnt; i++) {
+			if (nid == numa_cap[i].nid) {
+				_merge_strings(&node_ptr->features,
+					       numa_cap[i].numa_cfg,
+					       allow_numa);
+				break;
+			}
+		}
+	}
+	if (numa_cfg) {
+		for (i = 0; i < numa_cfg_cnt; i++) {
+			if (nid == numa_cfg[i].nid) {
+				_merge_strings(&node_ptr->features_act,
+					       numa_cfg[i].numa_cfg,
+					       allow_numa);
+				break;
+			}
+		}
+	}
+}
+
+static void _make_uid_array(char *uid_str)
+{
+	char *save_ptr = NULL, *tmp_str, *tok;
+	int i, uid_cnt = 0;
+
+	if (!uid_str)
+		return;
+
+	/* Count the number of users */
+	for (i = 0; uid_str[i]; i++) {
+		if (uid_str[i] == ',')
+			uid_cnt++;
+	}
+	uid_cnt++;
+
+	allowed_uid = xmalloc(sizeof(uid_t) * uid_cnt);
+	allowed_uid_cnt = 0;
+	tmp_str = xstrdup(uid_str);
+	tok = strtok_r(tmp_str, ",", &save_ptr);
+	while (tok) {
+		if (uid_from_string(tok, &allowed_uid[allowed_uid_cnt++]) < 0)
+			fatal("knl_cray.conf: Invalid AllowUserBoot: %s", tok);
+		tok = strtok_r(NULL, ",", &save_ptr);
+	}
+	xfree(tmp_str);
+}
+
+static char *_make_uid_str(uid_t *uid_array, int uid_cnt)
+{
+	char *sep = "", *tmp_str = NULL, *uid_str = NULL;
+	int i;
+
+	if (allowed_uid_cnt == 0) {
+		uid_str = xstrdup("ALL");
+		return uid_str;
+	}
+
+	for (i = 0; i < uid_cnt; i++) {
+		tmp_str = uid_to_string(uid_array[i]);
+		xstrfmtcat(uid_str, "%s%s(%d)", sep, tmp_str, uid_array[i]);
+		xfree(tmp_str);
+		sep = ",";
+	}
+
+	return uid_str;
+}
+
+/* Load configuration */
+extern int init(void)
+{
+	char *allow_mcdram_str, *allow_numa_str, *allow_user_str;
+	char *default_mcdram_str, *default_numa_str;
+	char *knl_conf_file, *tmp_str = NULL;
+	s_p_hashtbl_t *tbl;
+	struct stat stat_buf;
+	int i;
+
+	/* Set default values */
+	allow_mcdram = KNL_MCDRAM_FLAG;
+	allow_numa = KNL_NUMA_FLAG;
+	xfree(allowed_uid);
+	allowed_uid_cnt = 0;
+	xfree(capmc_path);
+	capmc_poll_freq = 45;
+	capmc_timeout = 1000;
+	debug_flag = false;
+	default_mcdram = KNL_CACHE;
+	default_numa = KNL_ALL2ALL;
+	for (i = 0; i < KNL_MCDRAM_CNT; i++)
+		mcdram_pct[i] = -1;
+
+	knl_conf_file = get_extra_conf_path("knl_cray.conf");
+	if ((stat(knl_conf_file, &stat_buf) == 0) &&
+	    (tbl = _config_make_tbl(knl_conf_file))) {
+		if (s_p_get_string(&tmp_str, "AllowMCDRAM", tbl)) {
+			allow_mcdram = _knl_mcdram_parse(tmp_str, ",");
+			if (_knl_mcdram_bits_cnt(allow_mcdram) < 1) {
+				fatal("knl_cray.conf: Invalid AllowMCDRAM=%s",
+				      tmp_str);
+			}
+			xfree(tmp_str);
+		}
+		if (s_p_get_string(&tmp_str, "AllowNUMA", tbl)) {
+			allow_numa = _knl_numa_parse(tmp_str, ",");
+			if (_knl_numa_bits_cnt(allow_numa) < 1) {
+				fatal("knl_cray.conf: Invalid AllowNUMA=%s",
+				      tmp_str);
+			}
+			xfree(tmp_str);
+		}
+		if (s_p_get_string(&tmp_str, "AllowUserBoot", tbl)) {
+			_make_uid_array(tmp_str);
+			xfree(tmp_str);
+		}
+		(void) s_p_get_string(&capmc_path, "CapmcPath", tbl);
+		(void) s_p_get_uint32(&capmc_poll_freq, "CapmcPollFreq", tbl);
+		(void) s_p_get_uint32(&capmc_timeout, "CapmcTimeout", tbl);
+		if (s_p_get_string(&tmp_str, "DefaultMCDRAM", tbl)) {
+			default_mcdram = _knl_mcdram_parse(tmp_str, ",");
+			if (_knl_mcdram_bits_cnt(default_mcdram) != 1) {
+				fatal("knl_cray.conf: Invalid DefaultMCDRAM=%s",
+				      tmp_str);
+			}
+			xfree(tmp_str);
+		}
+		if (s_p_get_string(&tmp_str, "DefaultNUMA", tbl)) {
+			default_numa = _knl_numa_parse(tmp_str, ",");
+			if (_knl_numa_bits_cnt(default_numa) != 1) {
+				fatal("knl_cray.conf: Invalid DefaultNUMA=%s",
+				      tmp_str);
+			}
+			xfree(tmp_str);
+		}
+		(void) s_p_get_string(&syscfg_path, "SyscfgPath", tbl);
+		s_p_hashtbl_destroy(tbl);
+	} else {
+		error("something wrong with opening/reading knl_cray.conf");
+	}
+	xfree(knl_conf_file);
+	if (!capmc_path)
+		capmc_path = xstrdup("/opt/cray/capmc/default/bin/capmc");
+	capmc_timeout = MAX(capmc_timeout, 500);
+	if (!syscfg_path)
+		verbose("SyscfgPath is not configured");
+
+	if (slurm_get_debug_flags() & DEBUG_FLAG_NODE_FEATURES)
+		debug_flag = true;
+
+	if (slurm_get_debug_flags() & DEBUG_FLAG_NODE_FEATURES) {
+		allow_mcdram_str = _knl_mcdram_str(allow_mcdram);
+		allow_numa_str = _knl_numa_str(allow_numa);
+		allow_user_str = _make_uid_str(allowed_uid, allowed_uid_cnt);
+		default_mcdram_str = _knl_mcdram_str(default_mcdram);
+		default_numa_str = _knl_numa_str(default_numa);
+		info("AllowMCDRAM=%s AllowNUMA=%s",
+		     allow_mcdram_str, allow_numa_str);
+		info("AllowUserBoot=%s", allow_user_str);
+		info("CapmcPath=%s", capmc_path);
+		info("CapmcPollFreq=%u sec", capmc_poll_freq);
+		info("CapmcTimeout=%u msec", capmc_timeout);
+		info("DefaultMCDRAM=%s DefaultNUMA=%s",
+		     default_mcdram_str, default_numa_str);
+		info("SyscfgPath=%s", syscfg_path);
+		xfree(allow_mcdram_str);
+		xfree(allow_numa_str);
+		xfree(allow_user_str);
+		xfree(default_mcdram_str);
+		xfree(default_numa_str);
+	}
+	gres_plugin_add("hbm");
+
+	return SLURM_SUCCESS;
+}
+
+/* Release allocated memory */
+extern int fini(void)
+{
+	xfree(allowed_uid);
+	allowed_uid_cnt = 0;
+	xfree(capmc_path);
+	capmc_timeout = 0;
+	debug_flag = false;
+	xfree(mcdram_per_node);
+	xfree(syscfg_path);
+	return SLURM_SUCCESS;
+}
+
+/* Reload configuration */
+extern int node_features_p_reconfig(void)
+{
+	slurm_mutex_lock(&config_mutex);
+	reconfig = true;
+	slurm_mutex_unlock(&config_mutex);
+	return SLURM_SUCCESS;
+}
+
+/* Update active and available features on specified nodes,
+ * sets features on all nodes if node_list is NULL */
+extern int node_features_p_get_node(char *node_list)
+{
+	json_object *j;
+	json_object_iter iter;
+	int i, status = 0, rc = SLURM_SUCCESS;
+	DEF_TIMERS;
+	char *resp_msg, **script_argv;
+	mcdram_cap_t *mcdram_cap = NULL;
+	mcdram_cfg_t *mcdram_cfg = NULL;
+	numa_cap_t *numa_cap = NULL;
+	numa_cfg_t *numa_cfg = NULL;
+	int mcdram_cap_cnt = 0, mcdram_cfg_cnt = 0;
+	int numa_cap_cnt = 0, numa_cfg_cnt = 0;
+	struct node_record *node_ptr;
+	hostlist_t host_list;
+	char *node_name;
+
+	slurm_mutex_lock(&config_mutex);
+	if (reconfig) {
+		(void) init();
+		reconfig = true;
+	}
+	slurm_mutex_unlock(&config_mutex);
+	if (!mcdram_per_node)
+		mcdram_per_node = xmalloc(sizeof(uint64_t) * node_record_count);
+
+	/*
+	 * Load available MCDRAM capabilities
+	 */
+	script_argv = xmalloc(sizeof(char *) * 4);	/* NULL terminated */
+	script_argv[0] = xstrdup("capmc");
+	script_argv[1] = xstrdup("get_mcdram_capabilities");
+	START_TIMER;
+	resp_msg = _run_script(capmc_path, script_argv, &status);
+	END_TIMER;
+	if (debug_flag) {
+		info("%s: get_mcdram_capabilities ran for %s",
+		     __func__, TIME_STR);
+	}
+	_log_script_argv(script_argv, resp_msg);
+	_free_script_argv(script_argv);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: get_mcdram_capabilities status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: get_mcdram_capabilities returned no information",
+		     __func__);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+
+	j = json_tokener_parse(resp_msg);
+	if (j == NULL) {
+		error("%s: json parser failed on %s", __func__, resp_msg);
+		xfree(resp_msg);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+	xfree(resp_msg);
+	json_object_object_foreachC(j, iter) {
+		if (xstrcmp(iter.key, "nids"))
+			continue;
+		mcdram_cap = _json_parse_mcdram_cap_array(j, iter.key,
+							  &mcdram_cap_cnt);
+		break;
+	}
+	json_object_put(j);	/* Frees json memory */
+
+	/*
+	 * Load current MCDRAM configuration
+	 */
+	script_argv = xmalloc(sizeof(char *) * 4);	/* NULL terminated */
+	script_argv[0] = xstrdup("capmc");
+	script_argv[1] = xstrdup("get_mcdram_cfg");
+	START_TIMER;
+	resp_msg = _run_script(capmc_path, script_argv, &status);
+	END_TIMER;
+	if (debug_flag)
+		info("%s: get_mcdram_cfg ran for %s", __func__, TIME_STR);
+	_log_script_argv(script_argv, resp_msg);
+	_free_script_argv(script_argv);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: get_mcdram_cfg status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: get_mcdram_cfg returned no information", __func__);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+
+	j = json_tokener_parse(resp_msg);
+	if (j == NULL) {
+		error("%s: json parser failed on %s", __func__, resp_msg);
+		xfree(resp_msg);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+	xfree(resp_msg);
+	json_object_object_foreachC(j, iter) {
+		if (xstrcmp(iter.key, "nids"))
+			continue;
+		mcdram_cfg = _json_parse_mcdram_cfg_array(j, iter.key,
+							  &mcdram_cfg_cnt);
+		break;
+	}
+	json_object_put(j);	/* Frees json memory */
+
+	/*
+	 * Load available NUMA capabilities
+	 */
+	script_argv = xmalloc(sizeof(char *) * 4);	/* NULL terminated */
+	script_argv[0] = xstrdup("capmc");
+	script_argv[1] = xstrdup("get_numa_capabilities");
+	START_TIMER;
+	resp_msg = _run_script(capmc_path, script_argv, &status);
+	END_TIMER;
+	if (debug_flag) {
+		info("%s: get_numa_capabilities ran for %s",
+		     __func__, TIME_STR);
+	}
+	_log_script_argv(script_argv, resp_msg);
+	_free_script_argv(script_argv);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: get_numa_capabilities status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: get_numa_capabilities returned no information",
+		     __func__);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+
+	j = json_tokener_parse(resp_msg);
+	if (j == NULL) {
+		error("%s: json parser failed on %s", __func__, resp_msg);
+		xfree(resp_msg);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+	xfree(resp_msg);
+	json_object_object_foreachC(j, iter) {
+		if (xstrcmp(iter.key, "nids"))
+			continue;
+		numa_cap = _json_parse_numa_cap_array(j, iter.key,
+						      &numa_cap_cnt);
+		break;
+	}
+	json_object_put(j);	/* Frees json memory */
+
+	/*
+	 * Load current NUMA configuration
+	 */
+	script_argv = xmalloc(sizeof(char *) * 4);	/* NULL terminated */
+	script_argv[0] = xstrdup("capmc");
+	script_argv[1] = xstrdup("get_numa_cfg");
+	START_TIMER;
+	resp_msg = _run_script(capmc_path, script_argv, &status);
+	END_TIMER;
+	if (debug_flag)
+		info("%s: get_numa_cfg ran for %s", __func__, TIME_STR);
+	_log_script_argv(script_argv, resp_msg);
+	_free_script_argv(script_argv);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: get_numa_cfg status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: get_numa_cfg returned no information", __func__);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+
+	j = json_tokener_parse(resp_msg);
+	if (j == NULL) {
+		error("%s: json parser failed on %s", __func__, resp_msg);
+		xfree(resp_msg);
+		rc = SLURM_ERROR;
+		goto fini;
+	}
+	xfree(resp_msg);
+	json_object_object_foreachC(j, iter) {
+		if (xstrcmp(iter.key, "nids"))
+			continue;
+		numa_cfg = _json_parse_numa_cfg_array(j, iter.key,
+						      &numa_cfg_cnt);
+		break;
+	}
+	json_object_put(j);	/* Frees json memory */
+
+	if (debug_flag) {
+		_mcdram_cap_log(mcdram_cap, mcdram_cap_cnt);
+		_mcdram_cfg_log(mcdram_cfg, mcdram_cfg_cnt);
+		_numa_cap_log(numa_cap, numa_cap_cnt);
+		_numa_cfg_log(numa_cfg, numa_cfg_cnt);
+	}
+
+	START_TIMER;
+	if (node_list) {
+		if ((host_list = hostlist_create(node_list)) == NULL) {
+			error ("hostlist_create error on %s: %m", node_list);
+			goto fini;
+		}
+		while ((node_name = hostlist_shift(host_list))) {
+			node_ptr = find_node_record(node_name);
+			if (node_ptr) {
+				_update_node_features(node_ptr,
+						      mcdram_cap,mcdram_cap_cnt,
+						      mcdram_cfg,mcdram_cfg_cnt,
+						      numa_cap, numa_cap_cnt,
+						      numa_cfg, numa_cfg_cnt);
+			}
+			xfree(node_name);
+		}
+		hostlist_destroy (host_list);
+	} else {
+		for (i=0, node_ptr=node_record_table_ptr; i<node_record_count;
+		     i++, node_ptr++) {
+			xfree(node_ptr->features_act);
+			_strip_knl_opts(&node_ptr->features);
+			if (node_ptr->features && !node_ptr->features_act) {
+				node_ptr->features_act =
+					xstrdup(node_ptr->features);
+			} else {
+				_strip_knl_opts(&node_ptr->features_act);
+			}
+		}
+		_update_all_node_features(mcdram_cap, mcdram_cap_cnt,
+					  mcdram_cfg, mcdram_cfg_cnt,
+					  numa_cap, numa_cap_cnt,
+					  numa_cfg, numa_cfg_cnt);
+	}
+	END_TIMER;
+	if (debug_flag)
+		info("%s: update_node_features ran for %s", __func__, TIME_STR);
+
+	last_node_update = time(NULL);
+
+fini:	_mcdram_cap_free(mcdram_cap, mcdram_cap_cnt);
+	_mcdram_cfg_free(mcdram_cfg, mcdram_cfg_cnt);
+	_numa_cap_free(numa_cap, numa_cap_cnt);
+	_numa_cfg_free(numa_cfg, numa_cfg_cnt);
+
+	return rc;
+}
+
+/* Get this node's current and available MCDRAM and NUMA settings from BIOS.
+ * avail_modes IN/OUT - append available modes, must be xfreed
+ * current_mode IN/OUT - append current modes, must be xfreed
+ *
+ * NOTES about syscfg (from Intel):
+ * To display the BIOS Parameters:
+ * >> syscfg /d biossettings <"BIOS variable Name">
+ *
+ * To Set the BIOS Parameters:
+ * >> syscfg /bcs <AdminPw> <"BIOS variable Name"> <Value>
+ * Note: If AdminPw is not set use ""
+ */
+extern void node_features_p_node_state(char **avail_modes, char **current_mode)
+{
+	char *avail_states = NULL, *cur_state = NULL;
+	char *resp_msg, *argv[10], *avail_sep = "", *cur_sep = "", *tok;
+	int status = 0;
+
+	if (!syscfg_path || !avail_modes || !current_mode)
+		return;
+
+	argv[0] = "syscfg";
+	argv[1] = "/d";
+	argv[2] = "BIOSSETTINGS";
+	argv[3] = "Cluster Mode";
+	argv[4] = NULL;
+	resp_msg = _run_script(syscfg_path, argv, &status);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: syscfg status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: syscfg returned no information", __func__);
+	} else {
+		tok = strstr(resp_msg, "Current Value : ");
+		if (tok) {
+			tok += 16;
+			if (!strncasecmp(tok, "All2All", 3)) {
+				cur_state = xstrdup("a2a");
+				cur_sep = ",";
+			} else if (!strncasecmp(tok, "Hemisphere", 3)) {
+				cur_state = xstrdup("hemi");
+				cur_sep = ",";
+			} else if (!strncasecmp(tok, "Quadrant", 3)) {
+				cur_state = xstrdup("quad");
+				cur_sep = ",";
+			} else if (!strncasecmp(tok, "SNC-2", 5)) {
+				cur_state = xstrdup("snc2");
+				cur_sep = ",";
+			} else if (!strncasecmp(tok, "SNC-4", 5)) {
+				cur_state = xstrdup("snc4");
+				cur_sep = ",";
+			}
+		}
+		if (strcasestr(resp_msg, "All2All")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "a2a");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "Hemisphere")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "hemi");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "Quadrant")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "quad");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "SNC-2")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "snc2");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "SNC-4")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "snc4");
+			avail_sep = ",";
+		}
+		xfree(resp_msg);
+	}
+
+	argv[0] = "syscfg";
+	argv[1] = "/d";
+	argv[2] = "BIOSSETTINGS";
+	argv[3] = "Memory Mode";
+	argv[4] = NULL;
+	resp_msg = _run_script(syscfg_path, argv, &status);
+	if (!WIFEXITED(status) || (WEXITSTATUS(status) != 0)) {
+		error("%s: syscfg status:%u response:%s",
+		      __func__, status, resp_msg);
+	}
+	if (resp_msg == NULL) {
+		info("%s: syscfg returned no information", __func__);
+	} else {
+		tok = strstr(resp_msg, "Current Value : ");
+		if (tok) {
+			tok += 16;
+			if (!strncasecmp(tok, "Cache", 3)) {
+				xstrfmtcat(cur_state, "%s%s", cur_sep, "cache");
+			} else if (!strncasecmp(tok, "Flat", 3)) {
+				xstrfmtcat(cur_state, "%s%s", cur_sep, "flat");
+			} else if (!strncasecmp(tok, "Hybrid", 3)) {
+				xstrfmtcat(cur_state, "%s%s", cur_sep, "equal");
+			}
+		}
+		if (strcasestr(resp_msg, "Cache")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "cache");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "Flat")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "flat");
+			avail_sep = ",";
+		}
+		if (strcasestr(resp_msg, "Hybrid")) {
+			xstrfmtcat(avail_states, "%s%s", avail_sep, "equal");
+			/* avail_sep = ",";	CLANG error: Dead assignment */
+		}
+		xfree(resp_msg);
+	}
+
+	if (*avail_modes) {	/* Append for multiple node_features plugins */
+		if (*avail_modes[0])
+			avail_sep = ",";
+		else
+			avail_sep = "";
+		xstrfmtcat(*avail_modes, "%s%s", avail_sep, avail_states);
+		xfree(avail_states);
+	} else {
+		*avail_modes = avail_states;
+	}
+
+	if (*current_mode) {	/* Append for multiple node_features plugins */
+		if (*current_mode[0])
+			cur_sep = ",";
+		else
+			cur_sep = "";
+		xstrfmtcat(*current_mode, "%s%s", cur_sep, cur_state);
+		xfree(cur_state);
+	} else {
+		*current_mode = cur_state;
+	}
+}
+
+/* Test if a job's feature specification is valid */
+extern int node_features_p_job_valid(char *job_features)
+{
+	uint16_t job_mcdram, job_numa;
+	int mcdram_cnt, numa_cnt;
+
+	if ((job_features == NULL) || (job_features[0] == '\0'))
+		return SLURM_SUCCESS;
+
+	if (strchr(job_features, '[') ||	/* Unsupported operator */
+	    strchr(job_features, ']') ||
+	    strchr(job_features, '|') ||
+	    strchr(job_features, '*'))
+		return ESLURM_INVALID_KNL;
+	
+	job_mcdram = _knl_mcdram_parse(job_features, "&,");
+	mcdram_cnt = _knl_mcdram_bits_cnt(job_mcdram);
+	if (mcdram_cnt > 1)			/* Multiple MCDRAM options */
+		return ESLURM_INVALID_KNL;
+
+	job_numa = _knl_numa_parse(job_features, "&,");
+	numa_cnt = _knl_numa_bits_cnt(job_numa);
+	if (numa_cnt > 1)			/* Multiple NUMA options */
+		return ESLURM_INVALID_KNL;
+
+	return SLURM_SUCCESS;
+}
+
+/* Translate a job's feature request to the node features needed at boot time */
+extern char *node_features_p_job_xlate(char *job_features)
+{
+	char *node_features = NULL;
+	char *tmp, *save_ptr = NULL, *sep = "", *tok;
+	bool has_numa = false, has_mcdram = false;
+
+	if ((job_features == NULL) || (job_features[0] ==  '\0'))
+		return node_features;
+
+	tmp = xstrdup(job_features);
+	tok = strtok_r(tmp, "&", &save_ptr);
+	while (tok) {
+		bool knl_opt = false;
+		if (_knl_mcdram_token(tok)) {
+			if (!has_mcdram) {
+				has_mcdram = true;
+				knl_opt = true;
+			}
+		}
+		if (_knl_numa_token(tok)) {
+			if (!has_numa) {
+				has_numa = true;
+				knl_opt = true;
+			}
+		}
+		if (knl_opt) {
+			xstrfmtcat(node_features, "%s%s", sep, tok);
+			sep = ",";
+		}
+		tok = strtok_r(NULL, "&", &save_ptr);
+	}
+	xfree(tmp);
+
+	/* Add default options */
+	if (!has_mcdram) {
+		tmp = _knl_mcdram_str(default_mcdram);
+		xstrfmtcat(node_features, "%s%s", sep, tmp);
+		sep = ",";
+		xfree(tmp);
+	}
+	if (!has_numa) {
+		tmp = _knl_numa_str(default_numa);
+		xstrfmtcat(node_features, "%s%s", sep, tmp);
+		// sep = ",";		Removed to avoid CLANG error
+		xfree(tmp);
+	}
+
+	return node_features;
+}
+
+/* Return true if the plugin requires PowerSave mode for booting nodes */
+extern bool node_features_p_node_power(void)
+{
+	return true;
+}
+
+/* Return true if the plugin requires RebootProgram for booting nodes */
+extern bool node_features_p_node_reboot(void)
+{
+	return false;
+}
+
+/* Note the active features associated with a set of nodes have been updated.
+ * Specifically update the node's "hbm" GRES value as needed.
+ * IN active_features - New active features
+ * IN node_bitmap - bitmap of nodes changed
+ * RET error code */
+extern int node_features_p_node_update(char *active_features,
+				       bitstr_t *node_bitmap)
+{
+	int i, i_first, i_last;
+	int rc = SLURM_SUCCESS;
+	uint16_t mcdram_inx;
+	uint64_t mcdram_size;
+	struct node_record *node_ptr;
+
+	if (mcdram_per_node == NULL) {
+		error("%s: mcdram_per_node == NULL", __func__);
+		return SLURM_ERROR;
+	}
+	mcdram_inx = _knl_mcdram_parse(active_features, ",");
+	if (mcdram_inx == 0)
+		return rc;
+	for (i = 0; i < KNL_MCDRAM_CNT; i++) {
+		if ((KNL_CACHE << i) == mcdram_inx)
+			break;
+	}
+	if ((i >= KNL_MCDRAM_CNT) || (mcdram_pct[i] == -1))
+		return rc;
+	mcdram_inx = i;
+
+	xassert(node_bitmap);
+	i_first = bit_ffs(node_bitmap);
+	if (i_first >= 0)
+		i_last = bit_fls(node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first; i <= i_last; i++) {
+		if (!bit_test(node_bitmap, i))
+			continue;
+		if (i >= node_record_count) {
+			error("%s: Invalid node index (%d >= %d)",
+			      __func__, i, node_record_count);
+			rc = SLURM_ERROR;
+			break;
+		}
+		mcdram_size = mcdram_per_node[i] *
+			      (100 - mcdram_pct[mcdram_inx]) / 100;
+		node_ptr = node_record_table_ptr + i;
+		gres_plugin_node_feature(node_ptr->name, "hbm",
+					 mcdram_size, &node_ptr->gres,
+					 &node_ptr->gres_list);
+	}
+
+	return rc;
+}
+
+/* Translate a node's feature specification by replacing any features associated
+ * with this plugin in the original value with the new values, preserving any
+ * features that are not associated with this plugin
+ * RET node's new merged features, must be xfreed */
+extern char *node_features_p_node_xlate(char *new_features, char *orig_features)
+{
+	char *node_features = NULL;
+	char *tmp, *save_ptr = NULL, *sep = "", *tok;
+
+	if (new_features) {
+		tmp = xstrdup(new_features);
+		tok = strtok_r(tmp, ",", &save_ptr);
+		while (tok) {
+			if ((_knl_mcdram_token(tok) != 0) ||
+			    (_knl_numa_token(tok)   != 0)) {
+				xstrfmtcat(node_features, "%s%s", sep, tok);
+				sep = ",";
+			}
+			tok = strtok_r(NULL, ",", &save_ptr);
+		}
+		xfree(tmp);
+	}
+
+	if (!node_features) {	/* No new info from compute node */
+		node_features = xstrdup(orig_features);
+		return node_features;
+	}
+
+	tmp = xstrdup(orig_features);
+	tok = strtok_r(tmp, ",", &save_ptr);
+	while (tok) {
+		if ((_knl_mcdram_token(tok) == 0) &&
+		    (_knl_numa_token(tok)   == 0)) {
+			xstrfmtcat(node_features, "%s%s", sep, tok);
+			sep = ",";
+		}
+		tok = strtok_r(NULL, ",", &save_ptr);
+	}
+	xfree(tmp);
+
+	return node_features;
+}
+
+/* Determine if the specified user can modify the currently available node
+ * features */
+extern bool node_features_p_user_update(uid_t uid)
+{
+	int i;
+
+	if (allowed_uid_cnt == 0)   /* Default is ALL users allowed to update */
+		return true;
+
+	for (i = 0; i < allowed_uid_cnt; i++) {
+		if (allowed_uid[i] == uid)
+			return true;
+	}
+
+	return false;
+}
diff --git a/src/plugins/power/Makefile.in b/src/plugins/power/Makefile.in
index 9b3dd0285..ae33bc7d4 100644
--- a/src/plugins/power/Makefile.in
+++ b/src/plugins/power/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/power
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/power/common/Makefile.in b/src/plugins/power/common/Makefile.in
index b37a455b9..d1d6f4682 100644
--- a/src/plugins/power/common/Makefile.in
+++ b/src/plugins/power/common/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/power/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -217,8 +218,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -318,6 +317,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -356,6 +359,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -399,6 +405,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -449,6 +458,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/power/common/power_common.c b/src/plugins/power/common/power_common.c
index d1b60805c..d22b2d503 100644
--- a/src/plugins/power/common/power_common.c
+++ b/src/plugins/power/common/power_common.c
@@ -50,7 +50,7 @@
 #include <sys/types.h>
 #include <unistd.h>
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
 #define POLLRDHUP POLLHUP
 #include <signal.h>
 #endif
diff --git a/src/plugins/power/cray/Makefile.in b/src/plugins/power/cray/Makefile.in
index 1f1a253a7..96d40c678 100644
--- a/src/plugins/power/cray/Makefile.in
+++ b/src/plugins/power/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/power/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -253,8 +254,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -354,6 +353,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -392,6 +395,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -435,6 +441,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -485,6 +494,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/power/cray/power_cray.c b/src/plugins/power/cray/power_cray.c
index 3b99527b2..2928a1b96 100644
--- a/src/plugins/power/cray/power_cray.c
+++ b/src/plugins/power/cray/power_cray.c
@@ -434,7 +434,7 @@ static void _get_capabilities(void)
 	json_object_object_foreachC(j_obj, iter) {
 		/* NOTE: The error number "e" and message "err_msg" fields
 		 * are currently ignored. */
-		if (!strcmp(iter.key, "groups")) {
+		if (!xstrcmp(iter.key, "groups")) {
 			ents = _json_parse_array_capabilities(j_obj, iter.key,
 							      &num_ent);
 			break;
@@ -534,15 +534,15 @@ static void _parse_capable_control(json_object *j_control,
 				break;
 			case json_type_string:
 //				info("%s: Key string %s", __func__, iter.key);
-				if (!strcmp(iter.key, "name"))
+				if (!xstrcmp(iter.key, "name"))
 					p = json_object_get_string(iter.val);
 				break;
 			case json_type_int:
 //				info("%s: Key int %s", __func__, iter.key);
 				x = json_object_get_int64(iter.val);
-				if (!strcmp(iter.key, "max"))
+				if (!xstrcmp(iter.key, "max"))
 					max_watts = x;
-				else if (!strcmp(iter.key, "min"))
+				else if (!xstrcmp(iter.key, "min"))
 					min_watts = x;
 				break;
 			default:
@@ -551,10 +551,10 @@ static void _parse_capable_control(json_object *j_control,
 	}
 
 	if (p) {
-		if (!strcmp(p, "accel")) {
+		if (!xstrcmp(p, "accel")) {
 			ent->accel_max_watts = max_watts;
 			ent->accel_min_watts = min_watts;
-		} else if (!strcmp(p, "node")) {
+		} else if (!xstrcmp(p, "node")) {
 			ent->node_max_watts = max_watts;
 			ent->node_min_watts = min_watts;
 		}
@@ -646,9 +646,9 @@ static void _json_parse_capabilities(json_object *jobj,
 				break;
 			case json_type_array:
 //				info("%s: Key array %s", __func__, iter.key);
-				if (!strcmp(iter.key, "controls")) {
+				if (!xstrcmp(iter.key, "controls")) {
 					_parse_capable_controls(jobj, ent);
-				} else if (!strcmp(iter.key, "nids")) {
+				} else if (!xstrcmp(iter.key, "nids")) {
 					_parse_nids(jobj, ent, "nids");
 				}
 				break;
@@ -743,7 +743,7 @@ static void _get_caps(void)
 	json_object_object_foreachC(j_obj, iter) {
 		/* NOTE: The error number "e" and message "err_msg" fields
 		 * are currently ignored. */
-		if (!strcmp(iter.key, "nids")) {
+		if (!xstrcmp(iter.key, "nids")) {
 			ents = _json_parse_array_caps(j_obj, iter.key,
 						      &num_ent);
 			break;
@@ -824,13 +824,13 @@ static void _parse_caps_control(json_object *j_control,
 				break;
 			case json_type_string:
 //				info("%s: Key string %s", __func__, iter.key);
-				if (!strcmp(iter.key, "name"))
+				if (!xstrcmp(iter.key, "name"))
 					p = json_object_get_string(iter.val);
 				break;
 			case json_type_int:
 //				info("%s: Key int %s", __func__, iter.key);
 				x = json_object_get_int64(iter.val);
-				if (!strcmp(iter.key, "val"))
+				if (!xstrcmp(iter.key, "val"))
 					cap_watts = x;
 				break;
 			default:
@@ -839,7 +839,7 @@ static void _parse_caps_control(json_object *j_control,
 	}
 
 	if (p) {
-		if (!strcmp(p, "node")) {
+		if (!xstrcmp(p, "node")) {
 			ent->cap_watts = cap_watts;
 		}
 	}
@@ -899,14 +899,14 @@ static void _json_parse_nid(json_object *jobj, power_config_nodes_t *ent)
 				break;
 			case json_type_array:
 //				info("%s: Key array %s", __func__, iter.key);
-				if (!strcmp(iter.key, "controls")) {
+				if (!xstrcmp(iter.key, "controls")) {
 					_parse_caps_controls(jobj, ent);
 				}
 				break;
 			case json_type_int:
 //				info("%s: Key int %s", __func__, iter.key);
 				x = json_object_get_int64(iter.val);
-				if (!strcmp(iter.key, "nid")) {
+				if (!xstrcmp(iter.key, "nid")) {
 					ent->node_name = xmalloc(sizeof(char *));
 					xstrfmtcat(ent->node_name[0],
 						   "nid%5.5d", x);
@@ -965,7 +965,7 @@ static void _get_nodes_ready(void)
 	json_object_object_foreachC(j_obj, iter) {
 		/* NOTE: The error number "e", message "err_msg", "off", and
 		 * "on" fields are currently ignored. */
-		if (!strcmp(iter.key, "ready")) {
+		if (!xstrcmp(iter.key, "ready")) {
 			ents = _json_parse_ready(j_obj, iter.key, &num_ent);
 			break;
 		}
@@ -1025,7 +1025,7 @@ _json_parse_ready(json_object *jobj, char *key, int *num)
 				break;
 			case json_type_array:
 //				info("%s: Key array %s", __func__, iter.key);
-				if (!strcmp(iter.key, "ready")) {
+				if (!xstrcmp(iter.key, "ready")) {
 					ents->state = 1;	/* 1=ready */
 					_parse_nids(jobj, ents, "ready");
 				}
@@ -1100,7 +1100,7 @@ static void _get_node_energy_counter(void)
 	json_object_object_foreachC(j_obj, iter) {
 		/* NOTE: The error number "e", message "err_msg", and
 		 * "nid_count" fields are currently ignored. */
-		if (!strcmp(iter.key, "nodes")) {
+		if (!xstrcmp(iter.key, "nodes")) {
 			ents = _json_parse_array_energy(j_obj, iter.key,
 							&num_ent);
 			break;
@@ -1217,9 +1217,9 @@ static void _json_parse_energy(json_object *jobj, power_config_nodes_t *ent)
 			case json_type_int:
 //				info("%s: Key int %s", __func__, iter.key);
 				x = json_object_get_int64(iter.val);
-				if (!strcmp(iter.key, "energy_ctr")) {
+				if (!xstrcmp(iter.key, "energy_ctr")) {
 					ent->joule_counter = x;
-				} else if (!strcmp(iter.key, "nid")) {
+				} else if (!xstrcmp(iter.key, "nid")) {
 					ent->node_cnt = 1;
 					ent->node_name = xmalloc(sizeof(char*));
 					ent->node_name[0] = xmalloc(10);
@@ -1230,7 +1230,7 @@ static void _json_parse_energy(json_object *jobj, power_config_nodes_t *ent)
 			case json_type_string:
 //				info("%s: Key string %s", __func__, iter.key);
 				p = json_object_get_string(iter.val);
-				if (!strcmp(iter.key, "time")) {
+				if (!xstrcmp(iter.key, "time")) {
 					ent->time_usec =
 						_time_str2num((char *) p);
 				}
@@ -1251,10 +1251,10 @@ static void _my_sleep(int add_secs)
 
 	ts.tv_sec  = tv.tv_sec + add_secs;
 	ts.tv_nsec = tv.tv_usec * 1000;
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	if (!stop_power)
 		pthread_cond_timedwait(&term_cond, &term_lock, &ts);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 /* Periodically attempt to re-balance power caps across nodes */
@@ -1702,10 +1702,10 @@ static void _set_power_caps(void)
 /* Terminate power thread */
 static void _stop_power_agent(void)
 {
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	stop_power = true;
 	pthread_cond_signal(&term_cond);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 /*
@@ -1719,10 +1719,10 @@ extern int init(void)
 	if (!run_in_daemon("slurmctld"))
 		return SLURM_SUCCESS;
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (power_thread) {
 		debug2("Power thread already running, not starting another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -1732,7 +1732,7 @@ extern int init(void)
 	if (pthread_create(&power_thread, &attr, _power_agent, NULL))
 		error("Unable to start power thread: %m");
 	slurm_attr_destroy(&attr);
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -1742,7 +1742,7 @@ extern int init(void)
  */
 extern void fini(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (power_thread) {
 		_stop_power_agent();
 		pthread_join(power_thread, NULL);
@@ -1750,15 +1750,15 @@ extern void fini(void)
 		xfree(capmc_path);
 		xfree(full_nid_string);
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /* Read the configuration file */
 extern void power_p_reconfig(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	_load_config();
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /* Note that a suspended job has been resumed */
diff --git a/src/plugins/power/none/Makefile.in b/src/plugins/power/none/Makefile.in
index f972cfa74..336977bfb 100644
--- a/src/plugins/power/none/Makefile.in
+++ b/src/plugins/power/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/power/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/preempt/Makefile.in b/src/plugins/preempt/Makefile.in
index f19007b70..9fb7a0489 100644
--- a/src/plugins/preempt/Makefile.in
+++ b/src/plugins/preempt/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/preempt
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/preempt/job_prio/Makefile.in b/src/plugins/preempt/job_prio/Makefile.in
index 63ed5c764..ae7d67dbf 100644
--- a/src/plugins/preempt/job_prio/Makefile.in
+++ b/src/plugins/preempt/job_prio/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/preempt/job_prio
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/preempt/job_prio/preempt_job_prio.c b/src/plugins/preempt/job_prio/preempt_job_prio.c
index a75a2ae09..f507106c0 100644
--- a/src/plugins/preempt/job_prio/preempt_job_prio.c
+++ b/src/plugins/preempt/job_prio/preempt_job_prio.c
@@ -139,7 +139,7 @@ static bool _account_preemptable(struct job_record *preemptor_job_ptr,
 		    preemptee_job_ptr->name);
 	}
 
-	if (!strcmp(preemptor_assoc->acct, preemptee_assoc->acct)) {
+	if (!xstrcmp(preemptor_assoc->acct, preemptee_assoc->acct)) {
 		if (slurm_get_debug_flags() & DEBUG_FLAG_PRIO) {
 			info("%s: Preemptor and preemptee share account = %s",
 			     plugin_type, preemptee_assoc->acct);
@@ -171,7 +171,7 @@ static bool _account_preemptable(struct job_record *preemptor_job_ptr,
 	}
 
 	i = strlen(preemptee_assoc->acct);
-	if (strncmp(((preemptee_assoc->acct) + i - 2), "_p", 2)) {
+	if (xstrncmp(((preemptee_assoc->acct) + i - 2), "_p", 2)) {
 		if (slurm_get_debug_flags() & DEBUG_FLAG_PRIO) {
 			info("%s: Preemptee is skipped, NON-PREEMPTABLE "
 			     "(not ending with _p) account %s",
@@ -519,9 +519,9 @@ static void _account_under_alloc(struct job_record *preemptor_job_ptr,
 			(long)(preemptor_new_usage * EPSILON);
 		preemptee_current_usage =
 			(long)(preemptee_acct_usage_ptr->current_usage*EPSILON);
-		if (((strcmp(preemptor_assoc->acct,
-			     ((slurmdb_assoc_rec_t *)
-			      preemptee_job_ptr->assoc_ptr)->acct) != 0) &&
+		if (((xstrcmp(preemptor_assoc->acct,
+			      ((slurmdb_assoc_rec_t *)
+			       preemptee_job_ptr->assoc_ptr)->acct) != 0) &&
 		    (preemptor_new_usage >= preemptee_acct_usage_ptr->current_usage ||
 		     preemptee_acct_usage_ptr->current_cpu_count <= 0)) &&
 		    (preemptee_acct_usage_ptr->current_usage > 0)) {
@@ -631,7 +631,7 @@ static int _overalloc_test(struct job_record *preemptor,
 	if (((new_fairshare_preemptee > 1.0 && new_fairshare_preemptor < 1.0) ||
 	     (new_fairshare_preemptee < 1.0 && new_fairshare_preemptor > 1.0))&&
 	    (new_fairshare_diff != 0.0) &&
-	    (strcmp(assoc_preemptor->acct, assoc_preemptee->acct) != 0)) {
+	    (xstrcmp(assoc_preemptor->acct, assoc_preemptee->acct) != 0)) {
 		if (new_fairshare_diff > 0.0) {
 			relation = "lower (better)";
 			rc = 1;	/* Preemptor can preempt */
diff --git a/src/plugins/preempt/none/Makefile.in b/src/plugins/preempt/none/Makefile.in
index 3f20373c2..cebac8dbf 100644
--- a/src/plugins/preempt/none/Makefile.in
+++ b/src/plugins/preempt/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/preempt/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/preempt/partition_prio/Makefile.in b/src/plugins/preempt/partition_prio/Makefile.in
index f94c8629f..d414c6655 100644
--- a/src/plugins/preempt/partition_prio/Makefile.in
+++ b/src/plugins/preempt/partition_prio/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/preempt/partition_prio
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/preempt/partition_prio/preempt_partition_prio.c b/src/plugins/preempt/partition_prio/preempt_partition_prio.c
index 7a4cb652a..ee60a03e3 100644
--- a/src/plugins/preempt/partition_prio/preempt_partition_prio.c
+++ b/src/plugins/preempt/partition_prio/preempt_partition_prio.c
@@ -109,7 +109,8 @@ extern List find_preemptable_jobs(struct job_record *job_ptr)
 		if (!IS_JOB_RUNNING(job_p) && !IS_JOB_SUSPENDED(job_p))
 			continue;
 		if ((job_p->part_ptr == NULL) ||
-		    (job_p->part_ptr->priority >= job_ptr->part_ptr->priority)||
+		    (job_p->part_ptr->priority_tier >=
+		     job_ptr->part_ptr->priority_tier) ||
 		    (job_p->part_ptr->preempt_mode == PREEMPT_MODE_OFF))
 			continue;
 		if ((job_p->node_bitmap == NULL) ||
@@ -133,7 +134,7 @@ extern List find_preemptable_jobs(struct job_record *job_ptr)
 	return preemptee_job_list;
 }
 
-/* Generate the job's priority. It is partly based upon the partition priority
+/* Generate a job priority. It is partly based upon the partition priority_tier
  * and partly based upon the job size. We want to put smaller jobs at the top
  * of the preemption queue and use a sort algorithm to minimize the number of
  * job's preempted. */
@@ -142,7 +143,7 @@ static uint32_t _gen_job_prio(struct job_record *job_ptr)
 	uint32_t job_prio;
 
 	if (job_ptr->part_ptr)
-		job_prio = job_ptr->part_ptr->priority << 16;
+		job_prio = job_ptr->part_ptr->priority_tier << 16;
 	else
 		job_prio = 0;
 
@@ -205,8 +206,8 @@ extern bool job_preempt_check(job_queue_rec_t *preemptor,
 			      job_queue_rec_t *preemptee)
 {
 	if (preemptor->part_ptr && preemptee->part_ptr) {
-		if (preemptor->part_ptr->priority >
-		    preemptee->part_ptr->priority)
+		if (preemptor->part_ptr->priority_tier >
+		    preemptee->part_ptr->priority_tier)
 			return true;
 	}
 
diff --git a/src/plugins/preempt/qos/Makefile.in b/src/plugins/preempt/qos/Makefile.in
index ec1955ede..614442eb5 100644
--- a/src/plugins/preempt/qos/Makefile.in
+++ b/src/plugins/preempt/qos/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/preempt/qos
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/priority/Makefile.in b/src/plugins/priority/Makefile.in
index 2ea9bbd55..d8075ea7f 100644
--- a/src/plugins/priority/Makefile.in
+++ b/src/plugins/priority/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/priority
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/priority/basic/Makefile.in b/src/plugins/priority/basic/Makefile.in
index 786d9ff95..3582c07ab 100644
--- a/src/plugins/priority/basic/Makefile.in
+++ b/src/plugins/priority/basic/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/priority/basic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/priority/basic/priority_basic.c b/src/plugins/priority/basic/priority_basic.c
index 95af79418..16dce1fd5 100644
--- a/src/plugins/priority/basic/priority_basic.c
+++ b/src/plugins/priority/basic/priority_basic.c
@@ -181,16 +181,11 @@ extern void priority_p_job_end(struct job_record *job_ptr)
 	assoc_mgr_lock_t locks = { NO_LOCK, WRITE_LOCK, NO_LOCK,
 				   WRITE_LOCK, NO_LOCK, NO_LOCK, NO_LOCK };
 
-	/* No unused cpu_run_secs if job ran past its time limit */
-	if (job_ptr->end_time >= job_ptr->start_time + time_limit_secs)
-		return;
-
+	/* No decaying in basic priority. Just remove the total secs. */
 	unused_tres_run_secs = xmalloc(sizeof(uint64_t) * slurmctld_tres_cnt);
 	for (i=0; i<slurmctld_tres_cnt; i++) {
 		unused_tres_run_secs[i] =
-			(uint64_t)(job_ptr->start_time +
-				   time_limit_secs - job_ptr->end_time) *
-			job_ptr->tres_req_cnt[i];
+			job_ptr->tres_alloc_cnt[i] * time_limit_secs;
 	}
 
 	assoc_mgr_lock(&locks);
@@ -200,12 +195,12 @@ extern void priority_p_job_end(struct job_record *job_ptr)
 		for (i=0; i<slurmctld_tres_cnt; i++) {
 			if (unused_tres_run_secs[i] >
 			    qos_ptr->usage->grp_used_tres_run_secs[i]) {
-			qos_ptr->usage->grp_used_tres_run_secs[i] = 0;
-			debug2("acct_policy_job_fini: "
-			       "grp_used_tres_run_secs "
-			       "underflow for qos %s tres %s",
-			       qos_ptr->name,
-			       assoc_mgr_tres_name_array[i]);
+				qos_ptr->usage->grp_used_tres_run_secs[i] = 0;
+				debug2("acct_policy_job_fini: "
+				       "grp_used_tres_run_secs "
+				       "underflow for qos %s tres %s",
+				       qos_ptr->name,
+				       assoc_mgr_tres_name_array[i]);
 			} else
 				qos_ptr->usage->grp_used_tres_run_secs[i] -=
 					unused_tres_run_secs[i];
diff --git a/src/plugins/priority/multifactor/Makefile.in b/src/plugins/priority/multifactor/Makefile.in
index 68a494a6d..d771cc135 100644
--- a/src/plugins/priority/multifactor/Makefile.in
+++ b/src/plugins/priority/multifactor/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/priority/multifactor
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -251,8 +252,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -352,6 +351,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -390,6 +393,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -433,6 +439,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -483,6 +492,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/priority/multifactor/priority_multifactor.c b/src/plugins/priority/multifactor/priority_multifactor.c
index e27daea77..617303a15 100644
--- a/src/plugins/priority/multifactor/priority_multifactor.c
+++ b/src/plugins/priority/multifactor/priority_multifactor.c
@@ -74,6 +74,7 @@
 #include "slurm/slurm_errno.h"
 
 #include "src/common/parse_time.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_time.h"
 #include "src/common/xstring.h"
 #include "src/common/gres.h"
@@ -341,7 +342,7 @@ static int _write_last_decay_ran(time_t last_ran, time_t last_reset)
 	char *old_file, *new_file, *state_file;
 	Buf buffer;
 
-	if (!strcmp(slurmctld_conf.state_save_location, "/dev/null")) {
+	if (!xstrcmp(slurmctld_conf.state_save_location, "/dev/null")) {
 		error("Can not save priority state information, "
 		      "StateSaveLocation is /dev/null");
 		return error_code;
@@ -596,7 +597,7 @@ static uint32_t _get_priority_internal(time_t start_time,
 		part_iterator = list_iterator_create(job_ptr->part_ptr_list);
 		while ((part_ptr = (struct part_record *)
 			list_next(part_iterator))) {
-			priority_part = part_ptr->priority /
+			priority_part = part_ptr->priority_job_factor /
 				(double)part_max_priority *
 				(double)weight_part;
 			priority_part +=
@@ -799,7 +800,7 @@ static double _calc_billable_tres(struct job_record *job_ptr, time_t start_time)
 		    ((i == TRES_ARRAY_CPU) ||
 		     (i == TRES_ARRAY_MEM) ||
 		     (i == TRES_ARRAY_NODE) ||
-		     (!strcasecmp(tres_type, "gres"))))
+		     (!xstrcasecmp(tres_type, "gres"))))
 			to_bill_node = MAX(to_bill_node, tres_value);
 		else
 			to_bill_global += tres_value;
@@ -1201,9 +1202,8 @@ static void *_decay_thread(void *no_data)
 				   NO_LOCK, NO_LOCK, NO_LOCK };
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_decay", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_decay");
+	if (prctl(PR_SET_NAME, "decay", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "decay");
 	}
 #endif
 	/*
@@ -1632,8 +1632,8 @@ int init ( void )
 
 	/* Check to see if we are running a supported accounting plugin */
 	temp = slurm_get_accounting_storage_type();
-	if (strcasecmp(temp, "accounting_storage/slurmdbd")
-	    && strcasecmp(temp, "accounting_storage/mysql")) {
+	if (xstrcasecmp(temp, "accounting_storage/slurmdbd")
+	    && xstrcasecmp(temp, "accounting_storage/mysql")) {
 		error("You are not running a supported "
 		      "accounting_storage plugin\n(%s).\n"
 		      "Fairshare can only be calculated with either "
@@ -1844,12 +1844,15 @@ extern List priority_p_get_priority_factors_list(
 			if (_filter_job(job_ptr, req_job_list, req_user_list))
 				continue;
 
-			if ((slurmctld_conf.private_data & PRIVATE_DATA_JOBS)
-			    && (job_ptr->user_id != uid)
-			    && !validate_operator(uid)
-			    && !assoc_mgr_is_user_acct_coord(
-				    acct_db_conn, uid,
-				    job_ptr->account))
+			if ((slurmctld_conf.private_data & PRIVATE_DATA_JOBS) &&
+			    (job_ptr->user_id != uid) &&
+			    !validate_operator(uid) &&
+			    (((slurm_mcs_get_privatedata() == 0) &&
+			      !assoc_mgr_is_user_acct_coord(acct_db_conn, uid,
+							    job_ptr->account))||
+			     ((slurm_mcs_get_privatedata() == 1) &&
+			      (mcs_g_check_mcs_label(uid, job_ptr->mcs_label)
+			       != 0))))
 				continue;
 
 			obj = xmalloc(sizeof(priority_factors_object_t));
@@ -2039,7 +2042,8 @@ extern void set_priority_factors(time_t start_time, struct job_record *job_ptr)
 			job_ptr->prio_factors->priority_js = 1.0;
 	}
 
-	if (job_ptr->part_ptr && job_ptr->part_ptr->priority && weight_part) {
+	if (job_ptr->part_ptr && job_ptr->part_ptr->priority_job_factor &&
+	    weight_part) {
 		job_ptr->prio_factors->priority_part =
 			job_ptr->part_ptr->norm_priority;
 	}
diff --git a/src/plugins/proctrack/Makefile.in b/src/plugins/proctrack/Makefile.in
index f1aa99c2c..14b0388e1 100644
--- a/src/plugins/proctrack/Makefile.in
+++ b/src/plugins/proctrack/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/aix/Makefile.in b/src/plugins/proctrack/aix/Makefile.in
index 8606f45cd..a979563fa 100644
--- a/src/plugins/proctrack/aix/Makefile.in
+++ b/src/plugins/proctrack/aix/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/aix
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/cgroup/Makefile.in b/src/plugins/proctrack/cgroup/Makefile.in
index a1f78babb..165aba583 100644
--- a/src/plugins/proctrack/cgroup/Makefile.in
+++ b/src/plugins/proctrack/cgroup/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/cgroup
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/cgroup/proctrack_cgroup.c b/src/plugins/proctrack/cgroup/proctrack_cgroup.c
index 24bd85fa1..4a1690ff5 100644
--- a/src/plugins/proctrack/cgroup/proctrack_cgroup.c
+++ b/src/plugins/proctrack/cgroup/proctrack_cgroup.c
@@ -165,7 +165,7 @@ int _slurm_cgroup_create(stepd_step_rec_t *job, uint64_t id, uid_t uid, gid_t gi
 	xcgroup_lock(&freezer_cg);
 
 	/* create slurm cgroup in the freezer ns (it could already exist) */
-	if (xcgroup_instanciate(&slurm_freezer_cg) != XCGROUP_SUCCESS)
+	if (xcgroup_instantiate(&slurm_freezer_cg) != XCGROUP_SUCCESS)
 		goto bail;
 
 	/* build user cgroup relative path if not set (should not be) */
@@ -239,9 +239,9 @@ int _slurm_cgroup_create(stepd_step_rec_t *job, uint64_t id, uid_t uid, gid_t gi
 		goto bail;
 	}
 
-	if ((xcgroup_instanciate(&user_freezer_cg) != XCGROUP_SUCCESS) ||
-	    (xcgroup_instanciate(&job_freezer_cg)  != XCGROUP_SUCCESS) ||
-	    (xcgroup_instanciate(&step_freezer_cg) != XCGROUP_SUCCESS)) {
+	if ((xcgroup_instantiate(&user_freezer_cg) != XCGROUP_SUCCESS) ||
+	    (xcgroup_instantiate(&job_freezer_cg)  != XCGROUP_SUCCESS) ||
+	    (xcgroup_instantiate(&step_freezer_cg) != XCGROUP_SUCCESS)) {
 		xcgroup_destroy(&user_freezer_cg);
 		xcgroup_destroy(&job_freezer_cg);
 		xcgroup_destroy(&step_freezer_cg);
@@ -373,7 +373,7 @@ _slurm_cgroup_has_pid(pid_t pid)
 	if ( fstatus != XCGROUP_SUCCESS)
 		return false;
 
-	if (strcmp(cg.path, step_freezer_cg.path)) {
+	if (xstrcmp(cg.path, step_freezer_cg.path)) {
 		fstatus = false;
 	}
 	else {
diff --git a/src/plugins/proctrack/cray/Makefile.in b/src/plugins/proctrack/cray/Makefile.in
index 53dc72d32..59dd0b57e 100644
--- a/src/plugins/proctrack/cray/Makefile.in
+++ b/src/plugins/proctrack/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/cray/proctrack_cray.c b/src/plugins/proctrack/cray/proctrack_cray.c
index d2fb63178..838029f90 100644
--- a/src/plugins/proctrack/cray/proctrack_cray.c
+++ b/src/plugins/proctrack/cray/proctrack_cray.c
@@ -62,6 +62,7 @@
 #include "slurm/slurm.h"
 #include "slurm/slurm_errno.h"
 #include "src/common/log.h"
+#include "src/common/timers.h"
 
 #include "src/slurmd/slurmstepd/slurmstepd_job.h"
 
@@ -78,6 +79,7 @@ static pthread_t threadid = 0;
 static pthread_cond_t notify = PTHREAD_COND_INITIALIZER;
 static pthread_mutex_t notify_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t thread_mutex = PTHREAD_MUTEX_INITIALIZER;
+static uint64_t debug_flags = 0;
 
 static void *_create_container_thread(void *args)
 {
@@ -125,6 +127,8 @@ static void _end_container_thread(void)
  */
 extern int init(void)
 {
+	debug_flags = slurm_get_debug_flags();
+
 	debug("%s loaded", plugin_name);
 	return SLURM_SUCCESS;
 }
@@ -144,6 +148,8 @@ extern int fini(void)
 extern int proctrack_p_create(stepd_step_rec_t *job)
 {
 	pthread_attr_t attr;
+	DEF_TIMERS;
+	START_TIMER;
 
 	if (!libjob_handle)
 		init();
@@ -188,6 +194,10 @@ extern int proctrack_p_create(stepd_step_rec_t *job)
 	} else
 		error("proctrack_p_create: already have a cont_id");
 
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	return SLURM_SUCCESS;
 }
 
@@ -202,6 +212,8 @@ int proctrack_p_add(stepd_step_rec_t *job, pid_t pid)
 	char fname[64];
 	int fd;
 #endif
+	DEF_TIMERS;
+	START_TIMER;
 
 	// Attach to the job container
 	if (job_attachpid(pid, job->cont_id) == (jid_t) -1) {
@@ -232,12 +244,17 @@ int proctrack_p_add(stepd_step_rec_t *job, pid_t pid)
 	}
 	TEMP_FAILURE_RETRY(close(fd));
 #endif
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return SLURM_SUCCESS;
 }
 
 int proctrack_p_signal(uint64_t id, int sig)
 {
+	DEF_TIMERS;
+	START_TIMER;
 	if (!threadid) {
 		if ((job_killjid((jid_t) id, sig) < 0)
 		    && (errno != ENODATA) && (errno != EBADF) )
@@ -248,12 +265,17 @@ int proctrack_p_signal(uint64_t id, int sig)
 	} else
 		error("Trying to send signal %d a container 0x%08lx "
 		      "that hasn't had anything added to it yet", sig, id);
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 	return (SLURM_SUCCESS);
 }
 
 int proctrack_p_destroy(uint64_t id)
 {
 	int status;
+	DEF_TIMERS;
+	START_TIMER;
 
 	debug("destroying 0x%08lx 0x%08lx", id, threadid);
 
@@ -263,15 +285,23 @@ int proctrack_p_destroy(uint64_t id)
 	/*  Assume any error means job doesn't exist. Therefore,
 	 *   return SUCCESS to slurmd so it doesn't retry continuously
 	 */
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 	return SLURM_SUCCESS;
 }
 
 uint64_t proctrack_p_find(pid_t pid)
 {
 	jid_t jid;
+	DEF_TIMERS;
+	START_TIMER;
 
 	if ((jid = job_getjid(pid)) == (jid_t) -1)
 		return ((uint64_t) 0);
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return ((uint64_t) jid);
 }
@@ -302,6 +332,8 @@ int proctrack_p_get_pids(uint64_t cont_id, pid_t **pids, int *npids)
 {
 	int pidcnt, bufsize;
 	pid_t *p;
+	DEF_TIMERS;
+	START_TIMER;
 
 	pidcnt = job_getpidcnt((jid_t)cont_id);
 	if (pidcnt > 0) {
@@ -337,6 +369,9 @@ int proctrack_p_get_pids(uint64_t cont_id, pid_t **pids, int *npids)
 		*pids = NULL;
 		*npids = 0;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return SLURM_SUCCESS;
 }
diff --git a/src/plugins/proctrack/linuxproc/Makefile.in b/src/plugins/proctrack/linuxproc/Makefile.in
index b7f440dc9..a3f16bb6c 100644
--- a/src/plugins/proctrack/linuxproc/Makefile.in
+++ b/src/plugins/proctrack/linuxproc/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/linuxproc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/linuxproc/kill_tree.c b/src/plugins/proctrack/linuxproc/kill_tree.c
index 967e0602b..83d792afe 100644
--- a/src/plugins/proctrack/linuxproc/kill_tree.c
+++ b/src/plugins/proctrack/linuxproc/kill_tree.c
@@ -200,7 +200,7 @@ static xppid_t **_build_hashtbl(void)
 
 		/* Record cmd for debugging purpose */
 		_push_to_hashtbl((pid_t)ppid, (pid_t)pid,
-				 strcmp(myname, cmd), cmd, hashtbl);
+				 xstrcmp(myname, cmd), cmd, hashtbl);
 	}
 	closedir(dir);
 	return hashtbl;
diff --git a/src/plugins/proctrack/lua/Makefile.in b/src/plugins/proctrack/lua/Makefile.in
index de55bef18..8ef5a2fcb 100644
--- a/src/plugins/proctrack/lua/Makefile.in
+++ b/src/plugins/proctrack/lua/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/lua
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/lua/proctrack_lua.c b/src/plugins/proctrack/lua/proctrack_lua.c
index 280c9f7b9..9bb3f03c3 100644
--- a/src/plugins/proctrack/lua/proctrack_lua.c
+++ b/src/plugins/proctrack/lua/proctrack_lua.c
@@ -464,7 +464,7 @@ uint64_t proctrack_p_find (pid_t pid)
 	lua_pop (L, -1);
 
 out:
-	slurm_mutex_lock (&lua_lock);
+	slurm_mutex_unlock (&lua_lock);
 	return (id);
 }
 
diff --git a/src/plugins/proctrack/pgid/Makefile.in b/src/plugins/proctrack/pgid/Makefile.in
index 589288c84..55ae8aff5 100644
--- a/src/plugins/proctrack/pgid/Makefile.in
+++ b/src/plugins/proctrack/pgid/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/pgid
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/proctrack/sgi_job/Makefile.in b/src/plugins/proctrack/sgi_job/Makefile.in
index 8acdfc738..665e61ba8 100644
--- a/src/plugins/proctrack/sgi_job/Makefile.in
+++ b/src/plugins/proctrack/sgi_job/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/proctrack/sgi_job
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/route/Makefile.in b/src/plugins/route/Makefile.in
index a7cf60a7c..1e2ff27e7 100644
--- a/src/plugins/route/Makefile.in
+++ b/src/plugins/route/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/route
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/route/default/Makefile.in b/src/plugins/route/default/Makefile.in
index f30227fc1..1a1674d71 100644
--- a/src/plugins/route/default/Makefile.in
+++ b/src/plugins/route/default/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/route/default
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/route/default/route_default.c b/src/plugins/route/default/route_default.c
index b0f196f1c..09005763f 100644
--- a/src/plugins/route/default/route_default.c
+++ b/src/plugins/route/default/route_default.c
@@ -120,9 +120,9 @@ extern int fini(void)
  */
 extern int route_p_split_hostlist(hostlist_t hl,
 				  hostlist_t** sp_hl,
-				  int* count)
+				  int* count, uint16_t tree_width)
 {
-	return route_split_hostlist_treewidth(hl, sp_hl, count);
+	return route_split_hostlist_treewidth(hl, sp_hl, count, tree_width);
 }
 
 /*
diff --git a/src/plugins/route/topology/Makefile.in b/src/plugins/route/topology/Makefile.in
index c0b37d23b..bd1baaf5a 100644
--- a/src/plugins/route/topology/Makefile.in
+++ b/src/plugins/route/topology/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/route/topology
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/route/topology/route_topology.c b/src/plugins/route/topology/route_topology.c
index 8350fd74b..5c35da237 100644
--- a/src/plugins/route/topology/route_topology.c
+++ b/src/plugins/route/topology/route_topology.c
@@ -109,7 +109,7 @@ extern int init(void)
 {
 	char *topotype;
 	topotype = slurm_get_topology_plugin();
-	if (strcasecmp(topotype,"topology/tree") != 0) {
+	if (xstrcasecmp(topotype,"topology/tree") != 0) {
 		fatal("ROUTE: route/topology requires topology/tree");
 	}
 	xfree(topotype);
@@ -145,7 +145,7 @@ extern int fini(void)
  */
 extern int route_p_split_hostlist(hostlist_t hl,
 				  hostlist_t** sp_hl,
-				  int* count)
+				  int* count, uint16_t tree_width)
 {
 	int i, j, k, hl_ndx, msg_count, sw_count, lst_count;
 	char  *buf;
@@ -210,13 +210,15 @@ extern int route_p_split_hostlist(hostlist_t hl,
 		}
 		FREE_NULL_BITMAP(nodes_bitmap);
 		xfree(*sp_hl);
-		return route_split_hostlist_treewidth(hl, sp_hl, count);
+		return route_split_hostlist_treewidth(
+			hl, sp_hl, count, tree_width);
 	}
 	if (switch_record_table[j].level == 0) {
 		/* This is a leaf switch. Construct list based on TreeWidth */
 		FREE_NULL_BITMAP(nodes_bitmap);
 		xfree(*sp_hl);
-		return route_split_hostlist_treewidth(hl, sp_hl, count);
+		return route_split_hostlist_treewidth(
+			hl, sp_hl, count, tree_width);
 	}
 	/* loop through children, construction a hostlist for each child switch
 	 * with nodes in the message list */
diff --git a/src/plugins/sched/Makefile.in b/src/plugins/sched/Makefile.in
index 3016a35a5..41d78d987 100644
--- a/src/plugins/sched/Makefile.in
+++ b/src/plugins/sched/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/backfill/Makefile.in b/src/plugins/sched/backfill/Makefile.in
index 0f6c7e8da..3034fbc03 100644
--- a/src/plugins/sched/backfill/Makefile.in
+++ b/src/plugins/sched/backfill/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched/backfill
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/backfill/backfill.c b/src/plugins/sched/backfill/backfill.c
index 9514383a6..9167352c7 100644
--- a/src/plugins/sched/backfill/backfill.c
+++ b/src/plugins/sched/backfill/backfill.c
@@ -76,6 +76,7 @@
 #include "src/common/power.h"
 #include "src/common/read_config.h"
 #include "src/common/slurm_accounting_storage.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_protocol_api.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
@@ -127,6 +128,7 @@ static int backfill_resolution = BACKFILL_RESOLUTION;
 static int backfill_window = BACKFILL_WINDOW;
 static int bf_max_job_array_resv = BF_MAX_JOB_ARRAY_RESV;
 static int bf_min_age_reserve = 0;
+static uint32_t bf_min_prio_reserve = 0;
 static int max_backfill_job_cnt = 100;
 static int max_backfill_job_per_part = 0;
 static int max_backfill_job_per_user = 0;
@@ -242,13 +244,13 @@ static int _num_feature_count(struct job_record *job_ptr, bool *has_xor)
 	struct job_details *detail_ptr = job_ptr->details;
 	int rc = 0;
 	ListIterator feat_iter;
-	struct feature_record *feat_ptr;
+	job_feature_t *feat_ptr;
 
 	if (detail_ptr->feature_list == NULL)	/* no constraints */
 		return rc;
 
 	feat_iter = list_iterator_create(detail_ptr->feature_list);
-	while ((feat_ptr = (struct feature_record *) list_next(feat_iter))) {
+	while ((feat_ptr = (job_feature_t *) list_next(feat_iter))) {
 		if (feat_ptr->count)
 			rc++;
 		if (feat_ptr->op_code == FEATURE_OP_XOR)
@@ -277,7 +279,7 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 	List preemptee_candidates = NULL;
 	List preemptee_job_list = NULL;
 	ListIterator feat_iter;
-	struct feature_record *feat_ptr;
+	job_feature_t *feat_ptr;
 
 	if (feat_cnt) {
 		/* Ideally schedule the job feature by feature,
@@ -294,15 +296,14 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 		list_size = list_count(detail_ptr->feature_list);
 		feat_cnt_orig = xmalloc(sizeof(uint16_t) * list_size);
 		feat_iter = list_iterator_create(detail_ptr->feature_list);
-		while ((feat_ptr =
-			(struct feature_record *) list_next(feat_iter))) {
+		while ((feat_ptr = (job_feature_t *) list_next(feat_iter))) {
 			high_cnt = MAX(high_cnt, feat_ptr->count);
 			feat_cnt_orig[i++] = feat_ptr->count;
 			feat_ptr->count = 0;
 		}
 		list_iterator_destroy(feat_iter);
 
-		if ((job_req_node_filter(job_ptr, *avail_bitmap) !=
+		if ((job_req_node_filter(job_ptr, *avail_bitmap, true) !=
 		     SLURM_SUCCESS) ||
 		    (bit_set_count(*avail_bitmap) < high_cnt)) {
 			rc = ESLURM_NODES_BUSY;
@@ -321,8 +322,7 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 		/* Restore the feature counts */
 		i = 0;
 		feat_iter = list_iterator_create(detail_ptr->feature_list);
-		while ((feat_ptr =
-			(struct feature_record *) list_next(feat_iter))) {
+		while ((feat_ptr = (job_feature_t *) list_next(feat_iter))) {
 			feat_ptr->count = feat_cnt_orig[i++];
 		}
 		list_iterator_destroy(feat_iter);
@@ -330,7 +330,7 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 	} else if (has_xor) {
 		/* Cache the feature information and test the individual
 		 * features, one at a time */
-		struct feature_record feature_base;
+		job_feature_t feature_base;
 		List feature_cache = detail_ptr->feature_list;
 		time_t low_start = 0;
 
@@ -341,11 +341,10 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 
 		tmp_bitmap = bit_copy(*avail_bitmap);
 		feat_iter = list_iterator_create(feature_cache);
-		while ((feat_ptr =
-		       (struct feature_record *) list_next(feat_iter))) {
+		while ((feat_ptr = (job_feature_t *) list_next(feat_iter))) {
 			feature_base.name = feat_ptr->name;
-			if ((job_req_node_filter(job_ptr, *avail_bitmap) ==
-			      SLURM_SUCCESS) &&
+			if ((job_req_node_filter(job_ptr, *avail_bitmap, true)
+			     == SLURM_SUCCESS) &&
 			    (bit_set_count(*avail_bitmap) >= min_nodes)) {
 				preemptee_candidates =
 					slurm_find_preemptable_jobs(job_ptr);
@@ -383,7 +382,7 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 		list_destroy(detail_ptr->feature_list);
 		detail_ptr->feature_list = feature_cache;
 	} else if (detail_ptr->feature_list) {
-		if ((job_req_node_filter(job_ptr, *avail_bitmap) !=
+		if ((job_req_node_filter(job_ptr, *avail_bitmap, true) !=
 		     SLURM_SUCCESS) ||
 		    (bit_set_count(*avail_bitmap) < min_nodes)) {
 			rc = ESLURM_NODES_BUSY;
@@ -412,7 +411,7 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 
 		if (exc_core_bitmap) {
 			bit_fmt(str, (sizeof(str) - 1), exc_core_bitmap);
-			debug2(" _try_sched with exclude core bitmap: %s",str);
+			debug2("%s exclude core bitmap: %s", __func__, str);
 		}
 
 		rc = select_g_job_test(job_ptr, *avail_bitmap, min_nodes,
@@ -447,10 +446,10 @@ static int  _try_sched(struct job_record *job_ptr, bitstr_t **avail_bitmap,
 /* Terminate backfill_agent */
 extern void stop_backfill_agent(void)
 {
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	stop_backfill = true;
 	pthread_cond_signal(&term_cond);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 /* Return the number of micro-seconds between now and argument "tv" */
@@ -484,10 +483,10 @@ static uint32_t _my_sleep(int usec)
 	nsec *= 1000;
 	ts.tv_sec  = tv1.tv_sec + (nsec / 1000000000);
 	ts.tv_nsec = nsec % 1000000000;
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	if (!stop_backfill)
 		pthread_cond_timedwait(&term_cond, &term_lock, &ts);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 	if (gettimeofday(&tv2, NULL))
 		return usec;
 	sleep_time = (tv2.tv_sec - tv1.tv_sec) * 1000000;
@@ -503,56 +502,74 @@ static void _load_config(void)
 	sched_params = slurm_get_sched_params();
 	debug_flags  = slurm_get_debug_flags();
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_interval=")))
+	if (sched_params && (tmp_ptr = strstr(sched_params, "bf_interval="))) {
 		backfill_interval = atoi(tmp_ptr + 12);
-	if (backfill_interval < 1) {
-		error("Invalid SchedulerParameters bf_interval: %d",
-		      backfill_interval);
+		if (backfill_interval < 1) {
+			error("Invalid SchedulerParameters bf_interval: %d",
+			      backfill_interval);
+			backfill_interval = BACKFILL_INTERVAL;
+		}
+	} else {
 		backfill_interval = BACKFILL_INTERVAL;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_window=")))
+	if (sched_params && (tmp_ptr = strstr(sched_params, "bf_window="))) {
 		backfill_window = atoi(tmp_ptr + 10) * 60;  /* mins to secs */
-	if (backfill_window < 1) {
-		error("Invalid SchedulerParameters bf_window: %d",
-		      backfill_window);
+		if (backfill_window < 1) {
+			error("Invalid SchedulerParameters bf_window: %d",
+			      backfill_window);
+			backfill_window = BACKFILL_WINDOW;
+		}
+	} else {
 		backfill_window = BACKFILL_WINDOW;
 	}
 
 	/* "max_job_bf" replaced by "bf_max_job_test" in version 14.03 and
 	 * can be removed later. Only "bf_max_job_test" is documented. */
-	if (sched_params && (tmp_ptr=strstr(sched_params, "max_job_bf=")))
-		max_backfill_job_cnt = atoi(tmp_ptr + 11);
 	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_max_job_test=")))
 		max_backfill_job_cnt = atoi(tmp_ptr + 16);
+	else if (sched_params && (tmp_ptr=strstr(sched_params, "max_job_bf=")))
+		max_backfill_job_cnt = atoi(tmp_ptr + 11);
+	else
+		max_backfill_job_cnt = 100;
 	if (max_backfill_job_cnt < 1) {
 		error("Invalid SchedulerParameters bf_max_job_test: %d",
 		      max_backfill_job_cnt);
-		max_backfill_job_cnt = 50;
+		max_backfill_job_cnt = 100;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_resolution=")))
+	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_resolution="))) {
 		backfill_resolution = atoi(tmp_ptr + 14);
-	if (backfill_resolution < 1) {
-		error("Invalid SchedulerParameters bf_resolution: %d",
-		      backfill_resolution);
+		if (backfill_resolution < 1) {
+			error("Invalid SchedulerParameters bf_resolution: %d",
+			      backfill_resolution);
+			backfill_resolution = BACKFILL_RESOLUTION;
+		}
+	} else {
 		backfill_resolution = BACKFILL_RESOLUTION;
 	}
 
 	if (sched_params &&
-	    (tmp_ptr=strstr(sched_params, "bf_max_job_array_resv=")))
+	    (tmp_ptr = strstr(sched_params, "bf_max_job_array_resv="))) {
 		bf_max_job_array_resv = atoi(tmp_ptr + 22);
-	if (bf_max_job_array_resv < 0) {
-		error("Invalid SchedulerParameters bf_max_job_array_resv: %d",
-		      bf_max_job_array_resv);
+		if (bf_max_job_array_resv < 0) {
+			error("Invalid SchedulerParameters bf_max_job_array_resv: %d",
+			      bf_max_job_array_resv);
+			bf_max_job_array_resv = BF_MAX_JOB_ARRAY_RESV;
+		}
+	} else {
 		bf_max_job_array_resv = BF_MAX_JOB_ARRAY_RESV;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_max_job_part=")))
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_max_job_part="))) {
 		max_backfill_job_per_part = atoi(tmp_ptr + 16);
-	if (max_backfill_job_per_part < 0) {
-		error("Invalid SchedulerParameters bf_max_job_part: %d",
-		      max_backfill_job_per_part);
+		if (max_backfill_job_per_part < 0) {
+			error("Invalid SchedulerParameters bf_max_job_part: %d",
+			      max_backfill_job_per_part);
+			max_backfill_job_per_part = 0;
+		}
+	} else {
 		max_backfill_job_per_part = 0;
 	}
 	if ((max_backfill_job_per_part != 0) &&
@@ -561,19 +578,27 @@ static void _load_config(void)
 		      max_backfill_job_per_part, max_backfill_job_cnt);
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_max_job_start=")))
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_max_job_start="))) {
 		max_backfill_jobs_start = atoi(tmp_ptr + 17);
-	if (max_backfill_jobs_start < 0) {
-		error("Invalid SchedulerParameters bf_max_job_start: %d",
-		      max_backfill_jobs_start);
+		if (max_backfill_jobs_start < 0) {
+			error("Invalid SchedulerParameters bf_max_job_start: %d",
+			      max_backfill_jobs_start);
+			max_backfill_jobs_start = 0;
+		}
+	} else {
 		max_backfill_jobs_start = 0;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_max_job_user=")))
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_max_job_user="))) {
 		max_backfill_job_per_user = atoi(tmp_ptr + 16);
-	if (max_backfill_job_per_user < 0) {
-		error("Invalid SchedulerParameters bf_max_job_user: %d",
-		      max_backfill_job_per_user);
+		if (max_backfill_job_per_user < 0) {
+			error("Invalid SchedulerParameters bf_max_job_user: %d",
+			      max_backfill_job_per_user);
+			max_backfill_job_per_user = 0;
+		}
+	} else {
 		max_backfill_job_per_user = 0;
 	}
 	if ((max_backfill_job_per_user != 0) &&
@@ -582,44 +607,68 @@ static void _load_config(void)
 		      max_backfill_job_per_user, max_backfill_job_cnt);
 	}
 
+	bf_min_age_reserve = 0;
 	if (sched_params &&
-	    (tmp_ptr=strstr(sched_params, "bf_min_age_reserve=")))
-		bf_min_age_reserve = atoi(tmp_ptr + 19);
-	else
-		bf_min_age_reserve = 0;
-	if (bf_min_age_reserve < 0) {
-		error("Invalid SchedulerParameters bf_min_age_reserve: %d",
-		      bf_min_age_reserve);
-		bf_min_age_reserve = 0;
+	    (tmp_ptr = strstr(sched_params, "bf_min_age_reserve="))) {
+		int min_age = atoi(tmp_ptr + 19);
+		if (min_age < 0) {
+			error("Invalid SchedulerParameters bf_min_age_reserve: %d",
+			      min_age);
+		} else {
+			bf_min_age_reserve = min_age;
+		}
 	}
 
-	/* bf_continue makes backfill continue where it was if interrupted
-	 */
+	bf_min_prio_reserve = 0;
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_min_prio_reserve="))) {
+		int64_t min_prio = (int64_t) atoll(tmp_ptr + 20);
+		if (min_prio < 0) {
+			error("Invalid SchedulerParameters bf_min_prio_reserve: %"PRIi64,
+			      min_prio);
+		} else {
+			bf_min_prio_reserve = (uint32_t) min_prio;
+		}
+	}
+
+	/* bf_continue makes backfill continue where it was if interrupted */
 	if (sched_params && (strstr(sched_params, "bf_continue"))) {
 		backfill_continue = true;
+	} else {
+		backfill_continue = false;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_yield_interval=")))
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_yield_interval="))) {
 		sched_timeout = atoi(tmp_ptr + 18);
-	if (sched_timeout <= 0) {
-		error("Invalid backfill scheduler bf_sched_timeout: %d",
-		      sched_timeout);
+		if (sched_timeout <= 0) {
+			error("Invalid backfill scheduler bf_yield_interval: %d",
+			      sched_timeout);
+			sched_timeout = SCHED_TIMEOUT;
+		}
+	} else {
 		sched_timeout = SCHED_TIMEOUT;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "bf_yield_sleep=")))
+	if (sched_params &&
+	    (tmp_ptr = strstr(sched_params, "bf_yield_sleep="))) {
 		yield_sleep = atoi(tmp_ptr + 15);
-	if (yield_sleep <= 0) {
-		error("Invalid backfill scheduler bf_yield_sleep: %d",
-		      yield_sleep);
+		if (yield_sleep <= 0) {
+			error("Invalid backfill scheduler bf_yield_sleep: %d",
+			      yield_sleep);
+			yield_sleep = YIELD_SLEEP;
+		}
+	} else {
 		yield_sleep = YIELD_SLEEP;
 	}
 
-	if (sched_params && (tmp_ptr=strstr(sched_params, "max_rpc_cnt=")))
+	if (sched_params && (tmp_ptr = strstr(sched_params, "max_rpc_cnt=")))
 		defer_rpc_cnt = atoi(tmp_ptr + 12);
 	else if (sched_params &&
-		 (tmp_ptr=strstr(sched_params, "max_rpc_count=")))
+		 (tmp_ptr = strstr(sched_params, "max_rpc_count=")))
 		defer_rpc_cnt = atoi(tmp_ptr + 14);
+	else
+		defer_rpc_cnt = 0;
 	if (defer_rpc_cnt < 0) {
 		error("Invalid SchedulerParameters max_rpc_cnt: %d",
 		      defer_rpc_cnt);
@@ -680,9 +729,8 @@ extern void *backfill_agent(void *args)
 	bool short_sleep = false;
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_bckfl", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurm_backfill");
+	if (prctl(PR_SET_NAME, "bckfl", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "backfill");
 	}
 #endif
 	_load_config();
@@ -810,14 +858,14 @@ static int _attempt_backfill(void)
 	List job_queue;
 	job_queue_rec_t *job_queue_rec;
 	slurmdb_qos_rec_t *qos_ptr = NULL;
-	int bb, i, j, node_space_recs;
+	int bb, i, j, node_space_recs, mcs_select = 0;
 	struct job_record *job_ptr;
 	struct part_record *part_ptr, **bf_part_ptr = NULL;
-	uint32_t end_time, end_reserve;
+	uint32_t end_time, end_reserve, deadline_time_limit;
 	uint32_t time_limit, comp_time_limit, orig_time_limit, part_time_limit;
 	uint32_t min_nodes, max_nodes, req_nodes;
-	bitstr_t *avail_bitmap = NULL, *resv_bitmap = NULL;
-	bitstr_t *exc_core_bitmap = NULL;
+	bitstr_t *active_bitmap = NULL, *avail_bitmap = NULL;
+	bitstr_t *exc_core_bitmap = NULL, *resv_bitmap = NULL;
 	time_t now, sched_start, later_start, start_res, resv_end, window_end;
 	time_t orig_sched_start, orig_start_time = (time_t) 0;
 	node_space_map_t *node_space;
@@ -835,8 +883,10 @@ static int _attempt_backfill(void)
 	struct timeval start_tv;
 	uint32_t test_array_job_id = 0;
 	uint32_t test_array_count = 0;
-	uint32_t acct_max_nodes, wait_reason = 0;
+	uint32_t acct_max_nodes, wait_reason = 0, job_no_reserve;
 	bool resv_overlap = false;
+	uint8_t save_share_res, save_whole_node;
+	int test_fini;
 
 	bf_sleep_usec = 0;
 #ifdef HAVE_ALPS_CRAY
@@ -995,6 +1045,9 @@ static int _attempt_backfill(void)
 
 		part_ptr = job_queue_rec->part_ptr;
 		job_ptr->part_ptr = part_ptr;
+		job_ptr->priority = job_queue_rec->priority;
+		mcs_select = slurm_mcs_get_select(job_ptr);
+
 		if (job_ptr->state_reason == FAIL_ACCOUNT) {
 			slurmdb_assoc_rec_t assoc_rec;
 			memset(&assoc_rec, 0, sizeof(slurmdb_assoc_rec_t));
@@ -1047,6 +1100,17 @@ static int _attempt_backfill(void)
 		    !acct_policy_job_runnable_pre_select(job_ptr))
 			continue;
 
+		job_no_reserve = 0;
+		if (bf_min_prio_reserve &&
+		    (job_ptr->priority < bf_min_prio_reserve)) {
+			job_no_reserve = TEST_NOW_ONLY;
+		} else if (bf_min_age_reserve && job_ptr->details->begin_time) {
+			pend_time = difftime(time(NULL),
+					     job_ptr->details->begin_time);
+			if (pend_time < bf_min_age_reserve)
+				job_no_reserve = TEST_NOW_ONLY;
+		}
+
 		orig_start_time = job_ptr->start_time;
 		orig_time_limit = job_ptr->time_limit;
 		xfree(job_queue_rec);
@@ -1196,6 +1260,16 @@ next_task:
 			continue;
 		}
 
+		/* test of deadline */
+		now = time(NULL);
+		deadline_time_limit = 0;
+		if ((job_ptr->deadline) && (job_ptr->deadline != NO_VAL)) {
+			if (!deadline_ok(job_ptr, "backfill"))
+				continue;
+
+			deadline_time_limit = (job_ptr->deadline - now) / 60;
+		}
+
 		/* Determine job's expected completion time */
 		if (part_ptr->max_time == INFINITE)
 			part_time_limit = YEAR_MINUTES;
@@ -1212,7 +1286,10 @@ next_task:
 				time_limit = MIN(job_ptr->time_limit,
 						 part_time_limit);
 		}
-		comp_time_limit = time_limit;
+		if (deadline_time_limit)
+			comp_time_limit = MIN(time_limit, deadline_time_limit);
+		else
+			comp_time_limit = time_limit;
 		qos_ptr = job_ptr->qos_ptr;
 		if (qos_ptr && (qos_ptr->flags & QOS_FLAG_NO_RESERVE) &&
 		    slurm_get_preempt_mode())
@@ -1302,6 +1379,8 @@ next_task:
 		/* Identify usable nodes for this job */
 		bit_and(avail_bitmap, part_ptr->node_bitmap);
 		bit_and(avail_bitmap, up_node_bitmap);
+		filter_by_node_owner(job_ptr, avail_bitmap);
+		filter_by_node_mcs(job_ptr, mcs_select, avail_bitmap);
 		for (j=0; ; ) {
 			if ((node_space[j].end_time > start_res) &&
 			     node_space[j].next && (later_start == 0))
@@ -1337,7 +1416,7 @@ next_task:
 		    ((job_ptr->details->req_node_bitmap) &&
 		     (!bit_super_set(job_ptr->details->req_node_bitmap,
 				     avail_bitmap))) ||
-		    (job_req_node_filter(job_ptr, avail_bitmap))) {
+		    (job_req_node_filter(job_ptr, avail_bitmap, true))) {
 			if (later_start) {
 				job_ptr->start_time = 0;
 				goto TRY_LATER;
@@ -1369,10 +1448,38 @@ next_task:
 		}
 		if (debug_flags & DEBUG_FLAG_BACKFILL_MAP)
 			_dump_job_test(job_ptr, avail_bitmap, start_res);
+		test_fini = -1;
+		build_active_feature_bitmap(job_ptr, avail_bitmap,
+					    &active_bitmap);
 		job_ptr->bit_flags |= BACKFILL_TEST;
-		j = _try_sched(job_ptr, &avail_bitmap, min_nodes, max_nodes,
-			       req_nodes, exc_core_bitmap);
+		job_ptr->bit_flags |= job_no_reserve;	/* 0 or TEST_NOW_ONLY */
+		if (active_bitmap) {
+			j = _try_sched(job_ptr, &active_bitmap, min_nodes,
+				       max_nodes, req_nodes, exc_core_bitmap);
+			if (j != SLURM_SUCCESS) {
+				FREE_NULL_BITMAP(avail_bitmap);
+				avail_bitmap = active_bitmap;
+				active_bitmap = NULL;
+				test_fini = 1;
+			} else {
+				FREE_NULL_BITMAP(active_bitmap);
+				save_share_res  = job_ptr->details->share_res;
+				save_whole_node = job_ptr->details->whole_node;
+				job_ptr->details->share_res = 0;
+				job_ptr->details->whole_node = 1;
+				test_fini = 0;
+			}
+		}
+		if (test_fini != 1) {
+			j = _try_sched(job_ptr, &avail_bitmap, min_nodes,
+				       max_nodes, req_nodes, exc_core_bitmap);
+			if (test_fini == 0) {
+				job_ptr->details->share_res = save_share_res;
+				job_ptr->details->whole_node = save_whole_node;
+			}
+		}
 		job_ptr->bit_flags &= ~BACKFILL_TEST;
+		job_ptr->bit_flags &= ~TEST_NOW_ONLY;
 
 		now = time(NULL);
 		if (j != SLURM_SUCCESS) {
@@ -1525,13 +1632,8 @@ next_task:
 			_set_job_time_limit(job_ptr, orig_time_limit);
 		}
 
-		if ((job_ptr->start_time > now) &&
-		    (bf_min_age_reserve && job_ptr->details->begin_time)) {
-			pend_time = difftime(time(NULL),
-					     job_ptr->details->begin_time);
-			if (pend_time < bf_min_age_reserve)
-				continue;
-		}
+		if ((job_ptr->start_time > now) && (job_no_reserve != 0))
+			continue;
 
 		if (later_start && (job_ptr->start_time > later_start)) {
 			/* Try later when some nodes currently reserved for
@@ -1780,13 +1882,13 @@ static bool _more_work (time_t last_backfill_time)
 {
 	bool rc = false;
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if ( (last_job_update  >= last_backfill_time ) ||
 	     (last_node_update >= last_backfill_time ) ||
 	     (last_part_update >= last_backfill_time ) ) {
 		rc = true;
 	}
-	pthread_mutex_unlock( &thread_flag_mutex );
+	slurm_mutex_unlock( &thread_flag_mutex );
 	return rc;
 }
 
diff --git a/src/plugins/sched/backfill/backfill_wrapper.c b/src/plugins/sched/backfill/backfill_wrapper.c
index 53b568dff..2845e8674 100644
--- a/src/plugins/sched/backfill/backfill_wrapper.c
+++ b/src/plugins/sched/backfill/backfill_wrapper.c
@@ -71,11 +71,11 @@ int init( void )
 
 	verbose( "sched: Backfill scheduler plugin loaded" );
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if ( backfill_thread ) {
 		debug2( "Backfill thread already running, not starting "
 			"another" );
-		pthread_mutex_unlock( &thread_flag_mutex );
+		slurm_mutex_unlock( &thread_flag_mutex );
 		return SLURM_ERROR;
 	}
 
@@ -83,7 +83,7 @@ int init( void )
 	/* since we do a join on this later we don't make it detached */
 	if (pthread_create( &backfill_thread, &attr, backfill_agent, NULL))
 		error("Unable to start backfill thread: %m");
-	pthread_mutex_unlock( &thread_flag_mutex );
+	slurm_mutex_unlock( &thread_flag_mutex );
 	slurm_attr_destroy( &attr );
 
 	return SLURM_SUCCESS;
@@ -91,14 +91,14 @@ int init( void )
 
 void fini( void )
 {
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if ( backfill_thread ) {
 		verbose( "Backfill scheduler plugin shutting down" );
 		stop_backfill_agent();
 		pthread_join(backfill_thread, NULL);
 		backfill_thread = 0;
 	}
-	pthread_mutex_unlock( &thread_flag_mutex );
+	slurm_mutex_unlock( &thread_flag_mutex );
 }
 
 int slurm_sched_p_reconfig( void )
diff --git a/src/plugins/sched/builtin/Makefile.in b/src/plugins/sched/builtin/Makefile.in
index 7f6d649f7..07a5f6550 100644
--- a/src/plugins/sched/builtin/Makefile.in
+++ b/src/plugins/sched/builtin/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched/builtin
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/builtin/builtin.c b/src/plugins/sched/builtin/builtin.c
index cc801f03f..b917e08ef 100644
--- a/src/plugins/sched/builtin/builtin.c
+++ b/src/plugins/sched/builtin/builtin.c
@@ -87,10 +87,10 @@ static void _my_sleep(int secs);
 /* Terminate builtin_agent */
 extern void stop_builtin_agent(void)
 {
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	stop_builtin = true;
 	pthread_cond_signal(&term_cond);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 static void _my_sleep(int secs)
@@ -101,10 +101,10 @@ static void _my_sleep(int secs)
 	gettimeofday(&now, NULL);
 	ts.tv_sec = now.tv_sec + secs;
 	ts.tv_nsec = now.tv_usec * 1000;
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	if (!stop_builtin)
 		pthread_cond_timedwait(&term_cond, &term_lock, &ts);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 static void _load_config(void)
@@ -137,7 +137,7 @@ static void _load_config(void)
 	xfree(sched_params);
 
 	select_type = slurm_get_select_type();
-	if (!strcmp(select_type, "select/serial")) {
+	if (!xstrcmp(select_type, "select/serial")) {
 		/* Do not spend time computing expected start time for
 		 * pending jobs */
 		max_sched_job_cnt = 0;
diff --git a/src/plugins/sched/builtin/builtin_wrapper.c b/src/plugins/sched/builtin/builtin_wrapper.c
index aced58dce..33f18d017 100644
--- a/src/plugins/sched/builtin/builtin_wrapper.c
+++ b/src/plugins/sched/builtin/builtin_wrapper.c
@@ -69,11 +69,11 @@ int init( void )
 
 	verbose( "sched: Built-in scheduler plugin loaded" );
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if ( builtin_thread ) {
 		debug2( "Built-in scheduler thread already running, "
 			"not starting another" );
-		pthread_mutex_unlock( &thread_flag_mutex );
+		slurm_mutex_unlock( &thread_flag_mutex );
 		return SLURM_ERROR;
 	}
 
@@ -81,7 +81,7 @@ int init( void )
 	/* since we do a join on this later we don't make it detached */
 	if (pthread_create( &builtin_thread, &attr, builtin_agent, NULL))
 		error("Unable to start built-in scheduler thread: %m");
-	pthread_mutex_unlock( &thread_flag_mutex );
+	slurm_mutex_unlock( &thread_flag_mutex );
 	slurm_attr_destroy( &attr );
 
 	return SLURM_SUCCESS;
@@ -92,14 +92,14 @@ int init( void )
 /**************************************************************************/
 void fini( void )
 {
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if ( builtin_thread ) {
 		verbose( "Built-in scheduler plugin shutting down" );
 		stop_builtin_agent();
 		pthread_join(builtin_thread, NULL);
 		builtin_thread = 0;
 	}
-	pthread_mutex_unlock( &thread_flag_mutex );
+	slurm_mutex_unlock( &thread_flag_mutex );
 }
 
 /**************************************************************************/
diff --git a/src/plugins/sched/hold/Makefile.in b/src/plugins/sched/hold/Makefile.in
index 03f55954e..ce200bbab 100644
--- a/src/plugins/sched/hold/Makefile.in
+++ b/src/plugins/sched/hold/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched/hold
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/wiki/Makefile.in b/src/plugins/sched/wiki/Makefile.in
index 177915ac2..c105d889a 100644
--- a/src/plugins/sched/wiki/Makefile.in
+++ b/src/plugins/sched/wiki/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched/wiki
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/wiki/get_jobs.c b/src/plugins/sched/wiki/get_jobs.c
index d0fae6c79..06b5b26d3 100644
--- a/src/plugins/sched/wiki/get_jobs.c
+++ b/src/plugins/sched/wiki/get_jobs.c
@@ -134,7 +134,7 @@ extern int	get_jobs(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	tmp_char++;
 	lock_slurmctld(job_read_lock);
-	if (strncmp(tmp_char, "ALL", 3) == 0) {
+	if (xstrncmp(tmp_char, "ALL", 3) == 0) {
 		/* report all jobs */
 		buf = _dump_all_jobs(&job_rec_cnt, update_time);
 	} else {
@@ -336,7 +336,7 @@ static char *	_dump_job(struct job_record *job_ptr, time_t update_time)
 
 	if (job_ptr->account) {
 		/* allow QOS spec in form "qos-name" */
-		if (!strncmp(job_ptr->account, "qos-", 4)) {
+		if (!xstrncmp(job_ptr->account, "qos-", 4)) {
 			snprintf(tmp, sizeof(tmp),
 				 "QOS=%s;", job_ptr->account + 4);
 		} else {
@@ -353,14 +353,14 @@ static char *	_dump_job(struct job_record *job_ptr, time_t update_time)
 		copy = xstrdup(job_ptr->comment);
 		cred = strtok(copy, ",");
 		while (cred != NULL) {
-			if (!strncmp(cred, "qos:", 4)) {
+			if (!xstrncmp(cred, "qos:", 4)) {
 				value = &cred[4];
 				if (value[0] != '\0') {
 					snprintf(tmp, sizeof(tmp),
 						 "QOS=%s;", value);
 					xstrcat(buf, tmp);
 				}
-			} else if (!strncmp(cred, "class:", 6)) {
+			} else if (!xstrncmp(cred, "class:", 6)) {
 				value = &cred[6];
 				if (value[0] != '\0') {
 					snprintf(tmp, sizeof(tmp),
diff --git a/src/plugins/sched/wiki/get_nodes.c b/src/plugins/sched/wiki/get_nodes.c
index 99f119436..49810f306 100644
--- a/src/plugins/sched/wiki/get_nodes.c
+++ b/src/plugins/sched/wiki/get_nodes.c
@@ -112,7 +112,7 @@ extern int	get_nodes(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	tmp_char++;
 	lock_slurmctld(node_read_lock);
-	if (strncmp(tmp_char, "ALL", 3) == 0) {
+	if (xstrncmp(tmp_char, "ALL", 3) == 0) {
 		/* report all nodes */
 		buf = _dump_all_nodes(&node_rec_cnt, update_time);
 	} else {
@@ -243,7 +243,7 @@ static char *	_get_node_state(struct node_record *node_ptr)
 	if (!got_select_type) {
 		char * select_type = slurm_get_select_type();
 		if (select_type &&
-		    (strcasecmp(select_type, "select/linear") == 0))
+		    (xstrcasecmp(select_type, "select/linear") == 0))
 			node_allocations = true;
 		else
 			node_allocations = false;
diff --git a/src/plugins/sched/wiki/msg.c b/src/plugins/sched/wiki/msg.c
index eac27c3fb..c223ef970 100644
--- a/src/plugins/sched/wiki/msg.c
+++ b/src/plugins/sched/wiki/msg.c
@@ -83,10 +83,10 @@ extern int spawn_msg_thread(void)
 {
 	pthread_attr_t thread_attr_msg;
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if (thread_running) {
 		error("Wiki thread already running, not starting another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -98,7 +98,7 @@ extern int spawn_msg_thread(void)
 
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 	return SLURM_SUCCESS;
 }
 
@@ -107,7 +107,7 @@ extern int spawn_msg_thread(void)
 \*****************************************************************************/
 extern void term_msg_thread(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		int fd;
                 slurm_addr_t addr;
@@ -133,7 +133,7 @@ extern void term_msg_thread(void)
                 thread_running = false;
                 debug2("join of sched/wiki thread was successful");
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /*****************************************************************************\
@@ -339,9 +339,9 @@ extern int parse_wiki_config(void)
 	}
 
 	if (s_p_get_string(&priority_mode, "JobPriority", tbl)) {
-		if (strcasecmp(priority_mode, "hold") == 0)
+		if (xstrcasecmp(priority_mode, "hold") == 0)
 			init_prio_mode = PRIO_HOLD;
-		else if (strcasecmp(priority_mode, "run") == 0)
+		else if (xstrcasecmp(priority_mode, "run") == 0)
 			init_prio_mode = PRIO_DECREMENT;
 		else
 			error("Invalid value for JobPriority in wiki.conf");
@@ -593,7 +593,7 @@ static int	_parse_msg(char *msg, char **req)
 	if (auth_key[0] != '\0') {
 		char sum[20];	/* format is "CK=%08x08x" */
 		checksum(sum, auth_key, ts_ptr);
-		if (strncmp(sum, msg, 19) != 0) {
+		if (xstrncmp(sum, msg, 19) != 0) {
 			err_code = -422;
 			err_msg = "bad checksum";
 			error("wiki: message checksum error, "
@@ -639,27 +639,27 @@ static void	_proc_msg(slurm_fd_t new_fd, char *msg)
 	}
 	cmd_ptr +=4;
 	err_code = 0;
-	if        (strncmp(cmd_ptr, "GETJOBS", 7) == 0) {
+	if        (xstrncmp(cmd_ptr, "GETJOBS", 7) == 0) {
 		msg_type = "wiki:GETJOBS";
 		if (!get_jobs(cmd_ptr, &err_code, &err_msg))
 			goto free_resp_msg;
-	} else if (strncmp(cmd_ptr, "GETNODES", 8) == 0) {
+	} else if (xstrncmp(cmd_ptr, "GETNODES", 8) == 0) {
 		msg_type = "wiki:GETNODES";
 		if (!get_nodes(cmd_ptr, &err_code, &err_msg))
 			goto free_resp_msg;
-	} else if (strncmp(cmd_ptr, "STARTJOB", 8) == 0) {
+	} else if (xstrncmp(cmd_ptr, "STARTJOB", 8) == 0) {
 		msg_type = "wiki:STARTJOB";
 		start_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "CANCELJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "CANCELJOB", 9) == 0) {
 		msg_type = "wiki:CANCELJOB";
 		cancel_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "SUSPENDJOB", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "SUSPENDJOB", 10) == 0) {
 		msg_type = "wiki:SUSPENDJOB";
 		suspend_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "RESUMEJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "RESUMEJOB", 9) == 0) {
 		msg_type = "wiki:RESUMEJOB";
 		resume_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "MODIFYJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "MODIFYJOB", 9) == 0) {
 		msg_type = "wiki:MODIFYJOB";
 		job_modify_wiki(cmd_ptr, &err_code, &err_msg);
 	} else {
diff --git a/src/plugins/sched/wiki2/Makefile.in b/src/plugins/sched/wiki2/Makefile.in
index 26a531b60..c37932585 100644
--- a/src/plugins/sched/wiki2/Makefile.in
+++ b/src/plugins/sched/wiki2/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/sched/wiki2
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +255,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +354,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +396,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +442,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +495,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/sched/wiki2/cancel_job.c b/src/plugins/sched/wiki2/cancel_job.c
index 57785e101..387e86402 100644
--- a/src/plugins/sched/wiki2/cancel_job.c
+++ b/src/plugins/sched/wiki2/cancel_job.c
@@ -114,11 +114,11 @@ extern int	cancel_job(char *cmd_ptr, int *err_code, char **err_msg)
 		return -1;
 	}
 	type_ptr += 5;
-	if      (strncmp(type_ptr, "TIMEOUT", 7) == 0)
+	if      (xstrncmp(type_ptr, "TIMEOUT", 7) == 0)
 		cancel_type = TYPE_TIMEOUT;
-	else if (strncmp(type_ptr, "WALLCLOCK", 9) == 0)
+	else if (xstrncmp(type_ptr, "WALLCLOCK", 9) == 0)
 		cancel_type = TYPE_TIMEOUT;
-	else if (strncmp(type_ptr, "ADMIN", 5) == 0)
+	else if (xstrncmp(type_ptr, "ADMIN", 5) == 0)
 		cancel_type = TYPE_ADMIN;
 	else {
 		*err_code = -300;
diff --git a/src/plugins/sched/wiki2/event.c b/src/plugins/sched/wiki2/event.c
index 9079bd711..7916ad232 100644
--- a/src/plugins/sched/wiki2/event.c
+++ b/src/plugins/sched/wiki2/event.c
@@ -133,7 +133,7 @@ extern int	event_notify(int event_code, char *desc)
 		return -1;
 	}
 
-	pthread_mutex_lock(&event_mutex);
+	slurm_mutex_lock(&event_mutex);
 	while (retry) {
 		if ((event_fd == -1) && ((rc = _open_fd(now)) == -1)) {
 			/* Can't even open socket.
@@ -171,7 +171,7 @@ extern int	event_notify(int event_code, char *desc)
 			break;
 		}
 	}
-	pthread_mutex_unlock(&event_mutex);
+	slurm_mutex_unlock(&event_mutex);
 	END_TIMER2("event_notify");
 
 	return rc;
diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c
index bb26f7aad..2c1e84c7f 100644
--- a/src/plugins/sched/wiki2/get_jobs.c
+++ b/src/plugins/sched/wiki2/get_jobs.c
@@ -160,7 +160,7 @@ extern int	get_jobs(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	tmp_char++;
 	lock_slurmctld(job_read_lock);
-	if (strncmp(tmp_char, "ALL", 3) == 0) {
+	if (xstrncmp(tmp_char, "ALL", 3) == 0) {
 		/* report all jobs */
 		buf = _dump_all_jobs(&job_rec_cnt, update_time);
 	} else {
diff --git a/src/plugins/sched/wiki2/get_nodes.c b/src/plugins/sched/wiki2/get_nodes.c
index 11fdb5887..ade6ab386 100644
--- a/src/plugins/sched/wiki2/get_nodes.c
+++ b/src/plugins/sched/wiki2/get_nodes.c
@@ -50,7 +50,6 @@ static bool	_hidden_node(struct node_record *node_ptr);
 static char *	_get_node_state(struct node_record *node_ptr);
 static int	_same_info(struct node_record *node1_ptr,
 			   struct node_record *node2_ptr, time_t update_time);
-static int	_str_cmp(char *s1, char *s2);
 
 /*
  * get_nodes - get information on specific node(s) changed since some time
@@ -125,7 +124,7 @@ extern int	get_nodes(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	tmp_char++;
 	lock_slurmctld(node_read_lock);
-	if (strncmp(tmp_char, "ALL", 3) == 0) {
+	if (xstrncmp(tmp_char, "ALL", 3) == 0) {
 		/* report all nodes */
 		buf = _dump_all_nodes(&node_rec_cnt, update_time);
 	} else {
@@ -253,7 +252,7 @@ static int _same_info(struct node_record *node1_ptr,
 
 	if (node1_ptr->node_state != node2_ptr->node_state)
 		return 1;
-	if (_str_cmp(node1_ptr->reason, node2_ptr->reason))
+	if (xstrcmp(node1_ptr->reason, node2_ptr->reason))
 		return 2;
 	if (update_time > last_node_update)
 		return 0;
@@ -273,9 +272,9 @@ static int _same_info(struct node_record *node1_ptr,
 		if (node1_ptr->part_pptr[i] !=  node2_ptr->part_pptr[i])
 			return 6;
 	}
-	if (_str_cmp(node1_ptr->arch, node2_ptr->arch))
+	if (xstrcmp(node1_ptr->arch, node2_ptr->arch))
 		return 7;
-	if (_str_cmp(node1_ptr->os, node2_ptr->os))
+	if (xstrcmp(node1_ptr->os, node2_ptr->os))
 		return 8;
 	if (update_time > 0)
 		return 0;
@@ -295,11 +294,11 @@ static int _same_info(struct node_record *node1_ptr,
 		    (node1_ptr->cpus        != node2_ptr->cpus))
 			return 10;
 	}
-	if (_str_cmp(node1_ptr->config_ptr->feature,
+	if (xstrcmp(node1_ptr->config_ptr->feature,
 		     node2_ptr->config_ptr->feature))
 		return 11;
 
-	if (_str_cmp(node1_ptr->config_ptr->gres,
+	if (xstrcmp(node1_ptr->config_ptr->gres,
 		     node2_ptr->config_ptr->gres))
 		return 12;
 
@@ -429,7 +428,7 @@ static char *	_get_node_state(struct node_record *node_ptr)
 	if (!got_select_type) {
 		char * select_type = slurm_get_select_type();
 		if (select_type &&
-		    (strcasecmp(select_type, "select/linear") == 0))
+		    (xstrcasecmp(select_type, "select/linear") == 0))
 			node_allocations = true;
 		else
 			node_allocations = false;
@@ -458,19 +457,6 @@ static char *	_get_node_state(struct node_record *node_ptr)
 	return "Unknown";
 }
 
-/* Like strcmp(), but can handle NULL pointers */
-static int	_str_cmp(char *s1, char *s2)
-{
-	if (s1 && s2)
-		return strcmp(s1, s2);
-
-	if ((s1 == NULL) && (s2 == NULL))
-		return 0;
-
-	/* One pointer is valid and the other is NULL */
-	return 1;
-}
-
 /* Return true if the node exists in a hidden partition and not in any
  * non-hidden partitions. */
 static bool	_hidden_node(struct node_record *node_ptr)
diff --git a/src/plugins/sched/wiki2/job_will_run.c b/src/plugins/sched/wiki2/job_will_run.c
index c44b119ca..c52fa3a85 100644
--- a/src/plugins/sched/wiki2/job_will_run.c
+++ b/src/plugins/sched/wiki2/job_will_run.c
@@ -87,7 +87,7 @@ extern int	job_will_run(char *cmd_ptr, int *err_code, char **err_msg)
 	}
 	arg_ptr += 4;
 
-	if (strncmp(arg_ptr, "JOBID=", 6)) {
+	if (xstrncmp(arg_ptr, "JOBID=", 6)) {
 		*err_code = -300;
 		*err_msg = "Invalid ARG value";
 		error("wiki: JOBWILLRUN has invalid ARG value");
@@ -204,7 +204,7 @@ static char *	_will_run_test(uint32_t jobid, time_t start_time,
 		return NULL;
 	}
 
-	if (job_req_node_filter(job_ptr, avail_bitmap) != SLURM_SUCCESS) {
+	if (job_req_node_filter(job_ptr, avail_bitmap, true) != SLURM_SUCCESS) {
 		/* Job probably has invalid feature list */
 		*err_code = -730;
 		*err_msg = "Job's required features not available "
@@ -493,7 +493,7 @@ static char *	_will_run_test2(uint32_t jobid, time_t start_time,
 		return NULL;
 	}
 
-	if (job_req_node_filter(job_ptr, avail_bitmap) != SLURM_SUCCESS) {
+	if (job_req_node_filter(job_ptr, avail_bitmap, true) != SLURM_SUCCESS) {
 		/* Job probably has invalid feature list */
 		*err_code = -730;
 		*err_msg = "Job's required features not available "
diff --git a/src/plugins/sched/wiki2/msg.c b/src/plugins/sched/wiki2/msg.c
index a3a990b6c..d38aab0cd 100644
--- a/src/plugins/sched/wiki2/msg.c
+++ b/src/plugins/sched/wiki2/msg.c
@@ -89,10 +89,10 @@ extern int spawn_msg_thread(void)
 {
 	pthread_attr_t thread_attr_msg;
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if (thread_running) {
 		error("Wiki thread already running, not starting another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -105,7 +105,7 @@ extern int spawn_msg_thread(void)
 	(void) event_notify(1235, "Slurm startup");
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 	return SLURM_SUCCESS;
 }
 
@@ -114,7 +114,7 @@ extern int spawn_msg_thread(void)
 \*****************************************************************************/
 extern void term_msg_thread(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		int fd;
 		slurm_addr_t addr;
@@ -140,7 +140,7 @@ extern void term_msg_thread(void)
 		thread_running = false;
 		debug2("join of sched/wiki2 thread was successful");
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /*****************************************************************************\
@@ -343,9 +343,9 @@ extern int parse_wiki_config(void)
 	}
 
 	if (s_p_get_string(&priority_mode, "JobPriority", tbl)) {
-		if (strcasecmp(priority_mode, "hold") == 0)
+		if (xstrcasecmp(priority_mode, "hold") == 0)
 			init_prio_mode = PRIO_HOLD;
-		else if (strcasecmp(priority_mode, "run") == 0)
+		else if (xstrcasecmp(priority_mode, "run") == 0)
 			init_prio_mode = PRIO_DECREMENT;
 		else
 			error("Invalid value for JobPriority in wiki.conf");
@@ -639,7 +639,7 @@ static int	_parse_msg(char *msg, char **req)
 
 	if (auth_key[0] != '\0') {
 		checksum(sum, auth_key, ts_ptr);
-		if (strncmp(sum, msg, 19) != 0) {
+		if (xstrncmp(sum, msg, 19) != 0) {
 			err_code = -422;
 			err_msg = "bad checksum";
 			error("wiki: message checksum error, "
@@ -684,36 +684,36 @@ static void	_proc_msg(slurm_fd_t new_fd, char *msg)
 	}
 	cmd_ptr +=4;
 	err_code = 0;
-	if        (strncmp(cmd_ptr, "GETJOBS", 7) == 0) {
+	if        (xstrncmp(cmd_ptr, "GETJOBS", 7) == 0) {
 		msg_type = "wiki:GETJOBS";
 		if (!get_jobs(cmd_ptr, &err_code, &err_msg))
 			goto free_resp_msg;
-	} else if (strncmp(cmd_ptr, "GETNODES", 8) == 0) {
+	} else if (xstrncmp(cmd_ptr, "GETNODES", 8) == 0) {
 		msg_type = "wiki:GETNODES";
 		if (!get_nodes(cmd_ptr, &err_code, &err_msg))
 			goto free_resp_msg;
-	} else if (strncmp(cmd_ptr, "STARTJOB", 8) == 0) {
+	} else if (xstrncmp(cmd_ptr, "STARTJOB", 8) == 0) {
 		msg_type = "wiki:STARTJOB";
 		start_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "CANCELJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "CANCELJOB", 9) == 0) {
 		msg_type = "wiki:CANCELJOB";
 		cancel_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "REQUEUEJOB", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "REQUEUEJOB", 10) == 0) {
 		msg_type = "wiki:REQUEUEJOB";
 		job_requeue_wiki(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "SUSPENDJOB", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "SUSPENDJOB", 10) == 0) {
 		msg_type = "wiki:SUSPENDJOB";
 		suspend_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "RESUMEJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "RESUMEJOB", 9) == 0) {
 		msg_type = "wiki:RESUMEJOB";
 		resume_job(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "JOBADDTASK", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "JOBADDTASK", 10) == 0) {
 		msg_type = "wiki:JOBADDTASK";
 		job_add_task(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "JOBRELEASETASK", 14) == 0) {
+	} else if (xstrncmp(cmd_ptr, "JOBRELEASETASK", 14) == 0) {
 		msg_type = "wiki:JOBRELEASETASK";
 		job_release_task(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "JOBWILLRUN", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "JOBWILLRUN", 10) == 0) {
 		msg_type = "wiki:JOBWILLRUN";
 		if (strstr(cmd_ptr, "NODES=")) {
 			/* Updated format input and output */
@@ -723,16 +723,16 @@ static void	_proc_msg(slurm_fd_t new_fd, char *msg)
 			if (!job_will_run(cmd_ptr, &err_code, &err_msg))
 				goto free_resp_msg;
 		}
-	} else if (strncmp(cmd_ptr, "MODIFYJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "MODIFYJOB", 9) == 0) {
 		msg_type = "wiki:MODIFYJOB";
 		job_modify_wiki(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "NOTIFYJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "NOTIFYJOB", 9) == 0) {
 		msg_type = "wiki:NOTIFYJOB";
 		job_notify_wiki(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "SIGNALJOB", 9) == 0) {
+	} else if (xstrncmp(cmd_ptr, "SIGNALJOB", 9) == 0) {
 		msg_type = "wiki:SIGNALJOB";
 		job_signal_wiki(cmd_ptr, &err_code, &err_msg);
-	} else if (strncmp(cmd_ptr, "INITIALIZE", 10) == 0) {
+	} else if (xstrncmp(cmd_ptr, "INITIALIZE", 10) == 0) {
 		msg_type = "wiki:INITIALIZE";
 		initialize_wiki(cmd_ptr, &err_code, &err_msg);
 	} else {
diff --git a/src/plugins/select/Makefile.in b/src/plugins/select/Makefile.in
index 994f66434..07addc452 100644
--- a/src/plugins/select/Makefile.in
+++ b/src/plugins/select/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/alps/Makefile.in b/src/plugins/select/alps/Makefile.in
index 71cbb492f..9787b5878 100644
--- a/src/plugins/select/alps/Makefile.in
+++ b/src/plugins/select/alps/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 @HAVE_ALPS_CRAY_EMULATION_FALSE@@HAVE_ALPS_CRAY_TRUE@am__append_3 = libalps/libalps.la
 subdir = src/plugins/select/alps
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -302,8 +303,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -403,6 +402,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -441,6 +444,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -484,6 +490,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -534,6 +543,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/alps/basil_interface.c b/src/plugins/select/alps/basil_interface.c
index 61b9030d3..6468fc22a 100644
--- a/src/plugins/select/alps/basil_interface.c
+++ b/src/plugins/select/alps/basil_interface.c
@@ -382,7 +382,7 @@ extern int basil_inventory(void)
 		 * ids (e.g. the interactive region) (Chris North)
 		 */
 
-		if ((job_ptr == NULL) && (strcmp(rsvn->batch_id, "UNKNOWN"))) {
+		if ((job_ptr == NULL) && (xstrcmp(rsvn->batch_id, "UNKNOWN"))) {
 			error("orphaned ALPS reservation %u, trying to remove",
 			      rsvn->rsvn_id);
 			rel_rc = basil_safe_release(rsvn->rsvn_id, inv);
@@ -536,7 +536,7 @@ extern int basil_geometry(struct node_record *node_ptr_array, int node_cnt)
 			info("proc_type:%s xyz:%u:%u:%u",
 			     proc_type, x_coord, y_coord, z_coord
 #endif
-			if (strcmp(proc_type, "compute") != 0) {
+			if (xstrcmp(proc_type, "compute") != 0) {
 				/*
 				 * Switching a compute node to be a service node
 				 * can not happen at runtime: requires a reboot.
diff --git a/src/plugins/select/alps/libalps/Makefile.in b/src/plugins/select/alps/libalps/Makefile.in
index e07a51e83..e9135fddf 100644
--- a/src/plugins/select/alps/libalps/Makefile.in
+++ b/src/plugins/select/alps/libalps/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/alps/libalps
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -229,8 +230,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +329,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +371,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +417,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +470,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/alps/libalps/basil_request.c b/src/plugins/select/alps/libalps/basil_request.c
index 3db594152..2531e07fc 100644
--- a/src/plugins/select/alps/libalps/basil_request.c
+++ b/src/plugins/select/alps/libalps/basil_request.c
@@ -77,7 +77,7 @@ static void _init_log_config(void)
 	else
 		log_sel = 0;
 	xml_log_loc = getenv("XML_LOG_LOC");
-	if (xml_log_loc && strcmp(xml_log_loc, "SLURM") &&
+	if (xml_log_loc && xstrcmp(xml_log_loc, "SLURM") &&
 	    (strlen(xml_log_loc) < sizeof(xml_log_file_name))) {
 		strcpy(xml_log_file_name, xml_log_loc);
 	} else {
@@ -197,7 +197,7 @@ static void *_timer_func(void *raw_data)
 	debug2("This is a timer thread for process: %d (slurmctld)--"
 	       "timeout: %d, apbasil pid: %d\n", getpid(), time_out, child);
 
-	pthread_mutex_lock(&timer_lock);
+	slurm_mutex_lock(&timer_lock);
 	gettimeofday(&now, NULL);
 	ts.tv_sec = now.tv_sec + time_out;
 	ts.tv_nsec = now.tv_usec * 1000;
@@ -207,7 +207,7 @@ static void *_timer_func(void *raw_data)
 		kill(child, SIGKILL);
 		debug2("Exiting timer thread, apbasil pid had been: %d", child);
 	}
-	pthread_mutex_unlock(&timer_lock);
+	slurm_mutex_unlock(&timer_lock);
 	pthread_exit(NULL);
 }
 
@@ -321,9 +321,9 @@ int basil_request(struct basil_parse_data *bp)
 	if (time_it_out) {
 		slurm_attr_destroy(&attr);
 		debug2("Killing the timer thread.");
-		pthread_mutex_lock(&timer_lock);
+		slurm_mutex_lock(&timer_lock);
 		pthread_cond_broadcast(&timer_cond);
-		pthread_mutex_unlock(&timer_lock);
+		slurm_mutex_unlock(&timer_lock);
 	}
 
 	END_TIMER;
diff --git a/src/plugins/select/alps/libalps/parser_common.c b/src/plugins/select/alps/libalps/parser_common.c
index c12276f16..dbd3738be 100644
--- a/src/plugins/select/alps/libalps/parser_common.c
+++ b/src/plugins/select/alps/libalps/parser_common.c
@@ -571,16 +571,16 @@ static void _start_handler(void *user_data,
 				*/
 				if (ud->bp->method == BM_switch) {
 					if (!strcmp(table[tag].tag,
-						    "ReservationArray"))
+						     "ReservationArray"))
 						tag = BT_SWITCHRESARRAY;
 					else if (!strcmp(table[tag].tag,
-							 "Reservation"))
+							  "Reservation"))
 						tag = BT_SWITCHRES;
 					else if (!strcmp(table[tag].tag,
-							 "ApplicationArray"))
+							  "ApplicationArray"))
 						tag = BT_SWITCHAPPARRAY;
 					else if (!strcmp(table[tag].tag,
-							 "Application"))
+							  "Application"))
 						tag = BT_SWITCHAPP;
 				}
 				break;
@@ -637,16 +637,16 @@ static void _end_handler(void *user_data, const XML_Char *el)
 				*/
 				if (ud->bp->method == BM_switch) {
 					if (!strcmp(table[end_tag].tag,
-						    "ReservationArray"))
+						     "ReservationArray"))
 						end_tag = BT_SWITCHRESARRAY;
 					else if (!strcmp(table[end_tag].tag,
-							 "Reservation"))
+							  "Reservation"))
 						end_tag = BT_SWITCHRES;
 					else if (!strcmp(table[end_tag].tag,
-							 "ApplicationArray"))
+							  "ApplicationArray"))
 						end_tag = BT_SWITCHAPPARRAY;
 					else if (!strcmp(table[end_tag].tag,
-							 "Application"))
+							  "Application"))
 						end_tag = BT_SWITCHAPP;
 				}
 				break;
diff --git a/src/plugins/select/alps/libemulate/Makefile.in b/src/plugins/select/alps/libemulate/Makefile.in
index 788e81cf2..6d98fef2c 100644
--- a/src/plugins/select/alps/libemulate/Makefile.in
+++ b/src/plugins/select/alps/libemulate/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/alps/libemulate
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -222,8 +223,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -323,6 +322,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -361,6 +364,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -404,6 +410,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -454,6 +463,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/alps/select_alps.c b/src/plugins/select/alps/select_alps.c
index 6f3c71b31..68c533016 100644
--- a/src/plugins/select/alps/select_alps.c
+++ b/src/plugins/select/alps/select_alps.c
@@ -48,6 +48,8 @@
 #  endif
 #endif
 
+#include "slurm/slurm.h"
+
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -155,7 +157,7 @@ static int select_cray_dim_size[3] = {-1};
  */
 const char plugin_name[]	= "Cray node selection plugin";
 const char plugin_type[]	= "select/alps";
-uint32_t plugin_id		= 104;
+uint32_t plugin_id		= SELECT_PLUGIN_ALPS;
 const uint32_t plugin_version	= SLURM_VERSION_NUMBER;
 
 static bool _zero_size_job ( struct job_record *job_ptr )
@@ -495,9 +497,9 @@ extern int select_p_step_start(struct step_record *step_ptr)
 	return other_step_start(step_ptr);
 }
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
-	return other_step_finish(step_ptr);
+	return other_step_finish(step_ptr, killing_step);
 }
 
 extern int select_p_pack_select_info(time_t last_query_time,
diff --git a/src/plugins/select/bluegene/Makefile.in b/src/plugins/select/bluegene/Makefile.in
index 1f9f69a29..65d41f061 100644
--- a/src/plugins/select/bluegene/Makefile.in
+++ b/src/plugins/select/bluegene/Makefile.in
@@ -125,7 +125,8 @@ target_triplet = @target@
 @BLUEGENE_LOADED_TRUE@	slurm_epilog$(EXEEXT)
 subdir = src/plugins/select/bluegene
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -138,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -151,6 +151,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -158,6 +159,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -166,7 +168,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -429,8 +430,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -530,6 +529,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -568,6 +571,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -611,6 +617,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -661,6 +670,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/ba/Makefile.in b/src/plugins/select/bluegene/ba/Makefile.in
index 4cc9ff631..35286dc64 100644
--- a/src/plugins/select/bluegene/ba/Makefile.in
+++ b/src/plugins/select/bluegene/ba/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 noinst_PROGRAMS = wire_test$(EXEEXT)
 subdir = src/plugins/select/bluegene/ba
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -233,8 +234,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -334,6 +333,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -372,6 +375,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -415,6 +421,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -465,6 +474,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/ba/block_allocator.c b/src/plugins/select/bluegene/ba/block_allocator.c
index 117aee780..9e9512d15 100644
--- a/src/plugins/select/bluegene/ba/block_allocator.c
+++ b/src/plugins/select/bluegene/ba/block_allocator.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  block_allocator.c - Assorted functions for layout of bluegene blocks,
  *	 wiring, mapping for smap, etc.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -47,6 +46,7 @@
 #include <math.h>
 #include "block_allocator.h"
 #include "src/common/slurmdb_defs.h"
+#include "src/common/strlcpy.h"
 #include "src/common/timers.h"
 #include "src/common/uid.h"
 
@@ -2180,10 +2180,8 @@ static int _set_external_wires(int dim, int count, ba_mp_t* source,
 			continue;
 		}
 
-                memset(&from_node, 0, sizeof(from_node));
-                memset(&to_node, 0, sizeof(to_node));
-                strncpy(from_node, wire_id+2, NODE_LEN-1);
-                strncpy(to_node, wire_id+UNDER_POS+1, NODE_LEN-1);
+                strlcpy(from_node, wire_id+2, NODE_LEN);
+                strlcpy(to_node, wire_id+UNDER_POS+1, NODE_LEN);
 		free(wire_id);
 
 		if ((rc = bridge_get_data(my_wire, RM_WireFromPort, &my_port))
diff --git a/src/plugins/select/bluegene/ba/wire_test.c b/src/plugins/select/bluegene/ba/wire_test.c
index bcc1d797c..4f7ec0876 100644
--- a/src/plugins/select/bluegene/ba/wire_test.c
+++ b/src/plugins/select/bluegene/ba/wire_test.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  wire_test.c - used to debug and test wires on any given system.
- *
- *  $Id: block_allocator.c 17495 2009-05-14 16:49:52Z da $
  *****************************************************************************
  *  Copyright (C) 2004 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/ba_bgq/Makefile.in b/src/plugins/select/bluegene/ba_bgq/Makefile.in
index d37914798..cdeca8372 100644
--- a/src/plugins/select/bluegene/ba_bgq/Makefile.in
+++ b/src/plugins/select/bluegene/ba_bgq/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 noinst_PROGRAMS = wire_test$(EXEEXT)
 subdir = src/plugins/select/bluegene/ba_bgq
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -252,8 +253,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -353,6 +352,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -391,6 +394,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -434,6 +440,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -484,6 +493,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/ba_bgq/block_allocator.c b/src/plugins/select/bluegene/ba_bgq/block_allocator.c
index 2c7acaa66..7154e8aa7 100644
--- a/src/plugins/select/bluegene/ba_bgq/block_allocator.c
+++ b/src/plugins/select/bluegene/ba_bgq/block_allocator.c
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  block_allocator.c - Assorted functions for layout of bgq blocks,
  *	 wiring, mapping for smap, etc.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2011 Lawrence Livermore National Security.
diff --git a/src/plugins/select/bluegene/ba_bgq/wire_test.c b/src/plugins/select/bluegene/ba_bgq/wire_test.c
index f63910849..6e0cd5fe8 100644
--- a/src/plugins/select/bluegene/ba_bgq/wire_test.c
+++ b/src/plugins/select/bluegene/ba_bgq/wire_test.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  wire_test.c - used to debug and test wires on any given system.
- *
- *  $Id: block_allocator.c 17495 2009-05-14 16:49:52Z da $
  *****************************************************************************
  *  Copyright (C) 2004 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/ba_common.c b/src/plugins/select/bluegene/ba_common.c
index a7fa8e725..8288a7af1 100644
--- a/src/plugins/select/bluegene/ba_common.c
+++ b/src/plugins/select/bluegene/ba_common.c
@@ -73,9 +73,11 @@ static bool _check_deny_pass(int dim, uint16_t *deny_pass)
 		return true;
 
 	switch (dim) {
+#ifndef HAVE_BG_L_P
 	case A:
 		check = PASS_DENY_A;
 		break;
+#endif
 	case X:
 		check = PASS_DENY_X;
 		break;
@@ -579,7 +581,7 @@ static ba_mp_t *_internal_loc2ba_mp(int level, uint16_t *coords,
 	curr_mp = coord2ba_mp(coords);
 	if (!curr_mp)
 		return NULL;
-	if (strcasecmp(check, curr_mp->loc))
+	if (xstrcasecmp(check, curr_mp->loc))
 		curr_mp = NULL;
 
 	return curr_mp;
diff --git a/src/plugins/select/bluegene/ba_common.h b/src/plugins/select/bluegene/ba_common.h
index 0fd382a80..3fefd1244 100644
--- a/src/plugins/select/bluegene/ba_common.h
+++ b/src/plugins/select/bluegene/ba_common.h
@@ -46,13 +46,13 @@
 #define BUFSIZE 4096
 
 #define SWAP(a,b,t)				\
-	_STMT_START {				\
+	do {					\
 		(t) = (a);			\
 		(a) = (b);			\
 		(b) = (t);			\
-	} _STMT_END
+	} while (0)
 
-/* This is only used on L and P hense the 6 count */
+/* This is only used on L and P hence the 6 count */
 #define NUM_PORTS_PER_NODE 6
 
 extern int DIM_SIZE[HIGHEST_DIMENSIONS]; /* how many midplanes in
diff --git a/src/plugins/select/bluegene/bg_core.c b/src/plugins/select/bluegene/bg_core.c
index ea23ec133..d12e0094e 100644
--- a/src/plugins/select/bluegene/bg_core.c
+++ b/src/plugins/select/bluegene/bg_core.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  bg_core.c - blue gene node configuration processing module.
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2011 Lawrence Livermore National Security.
diff --git a/src/plugins/select/bluegene/bg_core.h b/src/plugins/select/bluegene/bg_core.h
index 42d246f36..b5cccdefd 100644
--- a/src/plugins/select/bluegene/bg_core.h
+++ b/src/plugins/select/bluegene/bg_core.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  bg_core.h - header for blue gene core functions processing module.
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bg_defined_block.c b/src/plugins/select/bluegene/bg_defined_block.c
index 7fe389d43..e98f4ec8c 100644
--- a/src/plugins/select/bluegene/bg_defined_block.c
+++ b/src/plugins/select/bluegene/bg_defined_block.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  defined_block.c - functions for creating blocks in a static environment.
- *
- *  $Id: defined_block.c 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -174,7 +172,7 @@ extern int create_defined_blocks(bg_layout_t overlapped,
 						 name);
 
 					xfree(name);
-					if (strcmp(temp, bg_record->mp_str)) {
+					if (xstrcmp(temp, bg_record->mp_str)) {
 						fatal("given list of %s "
 						      "but allocated %s, "
 						      "your order might be "
@@ -345,7 +343,7 @@ extern int create_full_system_block(List bg_found_block_list)
 			if (bg_record->cnode_cnt < bg_conf->mp_cnode_cnt)
 				continue;
 
-			if (!strcmp(name, bg_record->mp_str)) {
+			if (!xstrcmp(name, bg_record->mp_str)) {
 				xfree(name);
 				list_iterator_destroy(itr);
 				/* don't create total already there */
@@ -374,7 +372,7 @@ extern int create_full_system_block(List bg_found_block_list)
 			if (bg_record->cnode_cnt < bg_conf->mp_cnode_cnt)
 				continue;
 
-			if (!strcmp(name, bg_record->mp_str)) {
+			if (!xstrcmp(name, bg_record->mp_str)) {
 				debug2("create_full_system_block: not "
 				       "implicitly adding full system block -"
 				       " block already defined");
diff --git a/src/plugins/select/bluegene/bg_defined_block.h b/src/plugins/select/bluegene/bg_defined_block.h
index 39bce1c81..124ac0469 100644
--- a/src/plugins/select/bluegene/bg_defined_block.h
+++ b/src/plugins/select/bluegene/bg_defined_block.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  defined_block.h - header for creating blocks in a static environment.
- *
- *  $Id: defined_block.h 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bg_dynamic_block.c b/src/plugins/select/bluegene/bg_dynamic_block.c
index e0de0fa57..a387f355a 100644
--- a/src/plugins/select/bluegene/bg_dynamic_block.c
+++ b/src/plugins/select/bluegene/bg_dynamic_block.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  dynamic_block.c - functions for creating blocks in a dynamic environment.
- *
- *  $Id: dynamic_block.c 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bg_dynamic_block.h b/src/plugins/select/bluegene/bg_dynamic_block.h
index 68d9cb171..33987592e 100644
--- a/src/plugins/select/bluegene/bg_dynamic_block.h
+++ b/src/plugins/select/bluegene/bg_dynamic_block.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  dynamic_block.h - header for creating blocks in a dynamic environment.
- *
- *  $Id: dynamic_block.h 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bg_job_info.c b/src/plugins/select/bluegene/bg_job_info.c
index 716872d5b..0969ca714 100644
--- a/src/plugins/select/bluegene/bg_job_info.c
+++ b/src/plugins/select/bluegene/bg_job_info.c
@@ -457,7 +457,7 @@ extern int  pack_select_jobinfo(select_jobinfo_t *jobinfo, Buf buffer,
 	int i;
 	int dims = slurmdb_setup_cluster_dims();
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		if (jobinfo) {
 			if (jobinfo->dim_cnt)
 				dims = jobinfo->dim_cnt;
@@ -547,7 +547,7 @@ extern int unpack_select_jobinfo(select_jobinfo_t **jobinfo_pptr, Buf buffer,
 
 	jobinfo->magic = JOBINFO_MAGIC;
 
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		safe_unpack16(&jobinfo->dim_cnt, buffer);
 
 		xassert(jobinfo->dim_cnt);
diff --git a/src/plugins/select/bluegene/bg_job_place.c b/src/plugins/select/bluegene/bg_job_place.c
index 7745cb6f5..3a767e06b 100644
--- a/src/plugins/select/bluegene/bg_job_place.c
+++ b/src/plugins/select/bluegene/bg_job_place.c
@@ -136,8 +136,8 @@ static int _test_image_perms(char *image_name, List image_list,
 
 	itr = list_iterator_create(image_list);
 	while ((image = list_next(itr))) {
-		if (!strcasecmp(image->name, image_name)
-		    || !strcasecmp(image->name, "*")) {
+		if (!xstrcasecmp(image->name, image_name)
+		    || !xstrcasecmp(image->name, "*")) {
 			if (image->def) {
 				allow = 1;
 				break;
@@ -478,8 +478,8 @@ static bg_record_t *_find_matching_block(List block_list,
 				    & DEBUG_FLAG_BG_PICK) {
 					convert_num_unit(
 						(float)bg_record->cpu_cnt,
-						tmp_char,
-						sizeof(tmp_char), UNIT_NONE,
+						tmp_char, sizeof(tmp_char),
+						UNIT_NONE, NO_VAL,
 						CONVERT_NUM_UNIT_EXACT);
 					info("block %s CPU count (%u) "
 					     "not suitable, asking for %u-%u",
@@ -553,30 +553,30 @@ static bg_record_t *_find_matching_block(List block_list,
 		if (check_image) {
 #ifdef HAVE_BGL
 			if (request->blrtsimage &&
-			    strcasecmp(request->blrtsimage,
-				       bg_record->blrtsimage)) {
+			    xstrcasecmp(request->blrtsimage,
+					bg_record->blrtsimage)) {
 				*allow = 1;
 				continue;
 			}
 #endif
 #ifdef HAVE_BG_L_P
 			if (request->linuximage &&
-			    strcasecmp(request->linuximage,
-				       bg_record->linuximage)) {
+			    xstrcasecmp(request->linuximage,
+					bg_record->linuximage)) {
 				*allow = 1;
 				continue;
 			}
 
 			if (request->ramdiskimage &&
-			    strcasecmp(request->ramdiskimage,
-				       bg_record->ramdiskimage)) {
+			    xstrcasecmp(request->ramdiskimage,
+					bg_record->ramdiskimage)) {
 				*allow = 1;
 				continue;
 			}
 #endif
 			if (request->mloaderimage &&
-			    strcasecmp(request->mloaderimage,
-				       bg_record->mloaderimage)) {
+			    xstrcasecmp(request->mloaderimage,
+					bg_record->mloaderimage)) {
 				*allow = 1;
 				continue;
 			}
diff --git a/src/plugins/select/bluegene/bg_job_run.c b/src/plugins/select/bluegene/bg_job_run.c
index ef0efd739..ad4323612 100644
--- a/src/plugins/select/bluegene/bg_job_run.c
+++ b/src/plugins/select/bluegene/bg_job_run.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  bg_job_run.c - blue gene job execution (e.g. initiation and termination)
  *  functions.
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2006 The Regents of the University of California.
  *  Copyright (C) 2011 Lawrence Livermore National Security.
@@ -346,7 +344,7 @@ static void _start_agent(bg_action_t *bg_action_ptr)
 	rc = 0;
 #ifdef HAVE_BGL
 	if (bg_action_ptr->blrtsimage
-	   && strcasecmp(bg_action_ptr->blrtsimage, bg_record->blrtsimage)) {
+	   && xstrcasecmp(bg_action_ptr->blrtsimage, bg_record->blrtsimage)) {
 		debug3("changing BlrtsImage from %s to %s",
 		       bg_record->blrtsimage, bg_action_ptr->blrtsimage);
 		xfree(bg_record->blrtsimage);
@@ -378,7 +376,7 @@ static void _start_agent(bg_action_t *bg_action_ptr)
 
 #ifdef HAVE_BG_L_P
 	if (bg_action_ptr->linuximage
-	   && strcasecmp(bg_action_ptr->linuximage, bg_record->linuximage)) {
+	   && xstrcasecmp(bg_action_ptr->linuximage, bg_record->linuximage)) {
 # ifdef HAVE_BGL
 		debug3("changing LinuxImage from %s to %s",
 		       bg_record->linuximage, bg_action_ptr->linuximage);
@@ -391,7 +389,7 @@ static void _start_agent(bg_action_t *bg_action_ptr)
 		rc = 1;
 	}
 	if (bg_action_ptr->ramdiskimage
-	   && strcasecmp(bg_action_ptr->ramdiskimage,
+	   && xstrcasecmp(bg_action_ptr->ramdiskimage,
 			 bg_record->ramdiskimage)) {
 # ifdef HAVE_BGL
 		debug3("changing RamDiskImage from %s to %s",
@@ -406,7 +404,7 @@ static void _start_agent(bg_action_t *bg_action_ptr)
 	}
 #endif
 	if (bg_action_ptr->mloaderimage
-	   && strcasecmp(bg_action_ptr->mloaderimage,
+	   && xstrcasecmp(bg_action_ptr->mloaderimage,
 			 bg_record->mloaderimage)) {
 		debug3("changing MloaderImage from %s to %s",
 		       bg_record->mloaderimage, bg_action_ptr->mloaderimage);
diff --git a/src/plugins/select/bluegene/bg_list_functions.c b/src/plugins/select/bluegene/bg_list_functions.c
index 535d1cd1f..a1416a088 100644
--- a/src/plugins/select/bluegene/bg_list_functions.c
+++ b/src/plugins/select/bluegene/bg_list_functions.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  bg_list_functions.c - header for dealing with the lists that
  *                        contain bg_records.
- *
- *  $Id: bg_list_functions.c 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2011 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -126,7 +124,7 @@ extern bg_record_t *find_bg_record_in_list(List my_list,
 	itr = list_iterator_create(my_list);
 	while ((bg_record = list_next(itr))) {
 		if (bg_record->bg_block_id && (bg_record->magic == BLOCK_MAGIC))
-			if (!strcasecmp(bg_record->bg_block_id, bg_block_id))
+			if (!xstrcasecmp(bg_record->bg_block_id, bg_block_id))
 				break;
 	}
 	list_iterator_destroy(itr);
@@ -181,8 +179,8 @@ extern bg_record_t *find_and_remove_org_from_bg_list(List my_list,
 		if (bit_equal(bg_record->mp_bitmap, found_record->mp_bitmap)
 		    && bit_equal(bg_record->ionode_bitmap,
 				 found_record->ionode_bitmap)) {
-			if (!strcmp(bg_record->bg_block_id,
-				    found_record->bg_block_id)) {
+			if (!xstrcmp(bg_record->bg_block_id,
+				     found_record->bg_block_id)) {
 				list_remove(itr);
 				if (bg_conf->slurm_debug_flags
 				    & DEBUG_FLAG_SELECT_TYPE)
@@ -210,8 +208,8 @@ extern bg_record_t *find_org_in_bg_list(List my_list, bg_record_t *bg_record)
 		    && bit_equal(bg_record->ionode_bitmap,
 				 found_record->ionode_bitmap)) {
 
-			if (!strcmp(bg_record->bg_block_id,
-				    found_record->bg_block_id)) {
+			if (!xstrcmp(bg_record->bg_block_id,
+				     found_record->bg_block_id)) {
 				if (bg_conf->slurm_debug_flags
 				    & DEBUG_FLAG_SELECT_TYPE)
 					info("got the block");
diff --git a/src/plugins/select/bluegene/bg_list_functions.h b/src/plugins/select/bluegene/bg_list_functions.h
index 4c40d6c23..ce557efd2 100644
--- a/src/plugins/select/bluegene/bg_list_functions.h
+++ b/src/plugins/select/bluegene/bg_list_functions.h
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  bg_list_functions.c - header for dealing with the lists that
  *                        contain bg_records.
- *
- *  $Id: bg_list_functions.c 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2011 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bg_read_config.c b/src/plugins/select/bluegene/bg_read_config.c
index 64df972c4..6ff553d2b 100644
--- a/src/plugins/select/bluegene/bg_read_config.c
+++ b/src/plugins/select/bluegene/bg_read_config.c
@@ -817,7 +817,7 @@ no_calc:
 			ba_deny_pass |= PASS_DENY_Y;
 		if (strstr(tmp_char, "Z"))
 			ba_deny_pass |= PASS_DENY_Z;
-		if (!strcasecmp(tmp_char, "ALL"))
+		if (!xstrcasecmp(tmp_char, "ALL"))
 			ba_deny_pass |= PASS_DENY_ALL;
 		bg_conf->deny_pass = ba_deny_pass;
 		xfree(tmp_char);
@@ -828,11 +828,11 @@ no_calc:
 		     "defaulting to STATIC partitioning");
 		bg_conf->layout_mode = LAYOUT_STATIC;
 	} else {
-		if (!strcasecmp(tmp_char,"STATIC"))
+		if (!xstrcasecmp(tmp_char,"STATIC"))
 			bg_conf->layout_mode = LAYOUT_STATIC;
-		else if (!strcasecmp(tmp_char,"OVERLAP"))
+		else if (!xstrcasecmp(tmp_char,"OVERLAP"))
 			bg_conf->layout_mode = LAYOUT_OVERLAP;
-		else if (!strcasecmp(tmp_char,"DYNAMIC"))
+		else if (!xstrcasecmp(tmp_char,"DYNAMIC"))
 			bg_conf->layout_mode = LAYOUT_DYNAMIC;
 		else {
 			fatal("I don't understand this LayoutMode = %s",
@@ -889,7 +889,7 @@ no_calc:
 		while (token) {
 			valid = false;
 			while((qos = list_next(itr))) {
-				if (!strcasecmp(token, qos->name)) {
+				if (!xstrcasecmp(token, qos->name)) {
 					bit_set(bg_conf->reboot_qos_bitmap,
 						qos->id);
 					valid = true;
diff --git a/src/plugins/select/bluegene/bg_record_functions.c b/src/plugins/select/bluegene/bg_record_functions.c
index f3325a65a..0b79067f9 100644
--- a/src/plugins/select/bluegene/bg_record_functions.c
+++ b/src/plugins/select/bluegene/bg_record_functions.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  bg_record_functions.c - header for creating blocks in a static environment.
- *
- *  $Id: bg_record_functions.c 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -473,7 +471,7 @@ extern int bg_record_cmpf_inc(void *r1, void *r2)
 	}
 
 	if (rec_a->mp_str && rec_b->mp_str) {
-		size_a = strcmp(rec_a->mp_str, rec_b->mp_str);
+		size_a = xstrcmp(rec_a->mp_str, rec_b->mp_str);
 		if (size_a < 0)
 			return -1;
 		else if (size_a > 0)
@@ -1647,7 +1645,7 @@ extern int resume_block(bg_record_t *bg_record)
 		while ((ba_mp = list_next(itr))) {
 			node_ptr = &node_record_table_ptr[ba_mp->index];
 			if (node_ptr->reason
-			    && !strncmp(node_ptr->reason, "update_block", 12))
+			    && !xstrncmp(node_ptr->reason, "update_block", 12))
 				xfree(node_ptr->reason);
 		}
 		list_iterator_destroy(itr);
@@ -1948,7 +1946,7 @@ static int _check_all_blocks_error(int node_inx, time_t event_time,
 			reason = "update_block: setting partial node down.";
 
 		if (!node_ptr->reason
-		    || !strncmp(node_ptr->reason, "update_block", 12)) {
+		    || !xstrncmp(node_ptr->reason, "update_block", 12)) {
 			xfree(node_ptr->reason);
 			node_ptr->reason = xstrdup(reason);
 			node_ptr->reason_time = event_time;
diff --git a/src/plugins/select/bluegene/bg_record_functions.h b/src/plugins/select/bluegene/bg_record_functions.h
index 209471aea..dc9f74fbb 100644
--- a/src/plugins/select/bluegene/bg_record_functions.h
+++ b/src/plugins/select/bluegene/bg_record_functions.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  bg_record_functions.h - header for creating blocks in a static environment.
- *
- *  $Id: bg_record_functions.h 12954 2008-01-04 20:37:49Z da $
  *****************************************************************************
  *  Copyright (C) 2008 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bl/Makefile.in b/src/plugins/select/bluegene/bl/Makefile.in
index e9b450b33..5e96e3398 100644
--- a/src/plugins/select/bluegene/bl/Makefile.in
+++ b/src/plugins/select/bluegene/bl/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/bluegene/bl
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -222,8 +223,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -323,6 +322,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -361,6 +364,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -404,6 +410,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -454,6 +463,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/bl/bridge_linker.c b/src/plugins/select/bluegene/bl/bridge_linker.c
index 142292c58..46ccc4d1b 100644
--- a/src/plugins/select/bluegene/bl/bridge_linker.c
+++ b/src/plugins/select/bluegene/bl/bridge_linker.c
@@ -464,7 +464,7 @@ static void _remove_jobs_on_block_and_reset(rm_job_list_t *job_list,
 		debug2("looking at block %s looking for %s",
 		       job_block, block_id);
 
-		if (strcmp(job_block, block_id)) {
+		if (xstrcmp(job_block, block_id)) {
 			free(job_block);
 			continue;
 		}
@@ -1757,12 +1757,12 @@ extern int bridge_block_sync_users(bg_record_t *bg_record)
 		   believe it is.  If a problem does arise on P please
 		   report and just uncomment this check.
 		*/
-		/* if (!strcmp(user, bg_conf->slurm_user_name)) { */
+		/* if (!xstrcmp(user, bg_conf->slurm_user_name)) { */
 		/* 	free(user); */
 		/* 	continue; */
 		/* } */
 
-		if (user_name && !strcmp(user, user_name)) {
+		if (user_name && !xstrcmp(user, user_name)) {
 			found=1;
 			free(user);
 			continue;
@@ -1875,7 +1875,7 @@ extern int bridge_blocks_load_curr(List curr_block_list)
 			continue;
 		}
 
-		if (strncmp("RMP", bg_block_id, 3)) {
+		if (xstrncmp("RMP", bg_block_id, 3)) {
 			free(bg_block_id);
 			continue;
 		}
@@ -2439,7 +2439,7 @@ extern int bridge_find_nodecard_num(rm_partition_t *block_ptr,
 			rc = SLURM_ERROR;
 			goto cleanup;
 		}
-		if (strcmp(my_card_name, card_name)) {
+		if (xstrcmp(my_card_name, card_name)) {
 			free(card_name);
 			continue;
 		}
diff --git a/src/plugins/select/bluegene/bl/bridge_status.c b/src/plugins/select/bluegene/bl/bridge_status.c
index 889b12422..ac619bef3 100644
--- a/src/plugins/select/bluegene/bl/bridge_status.c
+++ b/src/plugins/select/bluegene/bl/bridge_status.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  bridge_status.c - bluegene block information from the db2 database.
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -111,7 +109,7 @@ static void _configure_node_down(rm_bp_id_t bp_id, my_bluegene_t *my_bg)
 			continue;
 		}
 
-		if (strcmp(bp_id, bpid) != 0) {	/* different midplane */
+		if (xstrcmp(bp_id, bpid) != 0) { /* different midplane */
 			free(bpid);
 			continue;
 		}
@@ -784,11 +782,11 @@ extern int bridge_status_init(void)
 	if (!kill_job_list)
 		kill_job_list = bg_status_create_kill_job_list();
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (block_thread) {
 		debug2("Bluegene threads already running, not starting "
 		       "another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -800,7 +798,7 @@ extern int bridge_status_init(void)
 	/* since we do a join on this later we don't make it detached */
 	if (pthread_create(&state_thread, &attr, _mp_state_agent, NULL))
 		error("Failed to create state_agent thread");
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 	slurm_attr_destroy(&attr);
 
 	return SLURM_SUCCESS;
@@ -809,7 +807,7 @@ extern int bridge_status_init(void)
 extern int bridge_status_fini(void)
 {
 	bridge_status_inited = false;
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if ( block_thread ) {
 		verbose("Bluegene select plugin shutting down");
 		pthread_join(block_thread, NULL);
@@ -819,7 +817,7 @@ extern int bridge_status_fini(void)
 		pthread_join(state_thread, NULL);
 		state_thread = 0;
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	return SLURM_SUCCESS;
 }
diff --git a/src/plugins/select/bluegene/bl/bridge_switch_connections.c b/src/plugins/select/bluegene/bl/bridge_switch_connections.c
index 2a4b79b72..fd01edb41 100644
--- a/src/plugins/select/bluegene/bl/bridge_switch_connections.c
+++ b/src/plugins/select/bluegene/bl/bridge_switch_connections.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  bg_switch_connections.c - Blue Gene switch management functions,
  *  establish switch connections
- *
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -157,7 +155,7 @@ static int _get_switches_by_mpid(
 			continue;
 		}
 
-		if (!strcasecmp((char *)mpid, (char *)curr_mpid)) {
+		if (!xstrcasecmp((char *)mpid, (char *)curr_mpid)) {
 			coord_switch[found_mpid] = curr_switch;
 			found_mpid++;
 			if (found_mpid==SYSTEM_DIMENSIONS) {
diff --git a/src/plugins/select/bluegene/bl/bridge_switch_connections.h b/src/plugins/select/bluegene/bl/bridge_switch_connections.h
index d613da24d..df343e89c 100644
--- a/src/plugins/select/bluegene/bl/bridge_switch_connections.h
+++ b/src/plugins/select/bluegene/bl/bridge_switch_connections.h
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  bridge_switch_connections.h - Blue Gene switch management functions,
  *  establish switch connections
- *
- *  $Id: bridge_switch_connections.c -1   $
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/bl_bgq/Makefile.in b/src/plugins/select/bluegene/bl_bgq/Makefile.in
index 89e9408a4..dc9befbff 100644
--- a/src/plugins/select/bluegene/bl_bgq/Makefile.in
+++ b/src/plugins/select/bluegene/bl_bgq/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/bluegene/bl_bgq
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -240,8 +241,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -341,6 +340,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -379,6 +382,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -422,6 +428,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -472,6 +481,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc b/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc
index ffec01df4..8baac401b 100644
--- a/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc
+++ b/src/plugins/select/bluegene/bl_bgq/bridge_linker.cc
@@ -272,7 +272,7 @@ static bg_record_t * _translate_object_to_block(const Block::Ptr &block_ptr)
 		 node_char);
 
 	xfree(node_char);
-	if (strcmp(mp_str, bg_record->mp_str)) {
+	if (xstrcmp(mp_str, bg_record->mp_str)) {
 		fatal("Couldn't make unknown block %s in our wiring.  "
 		      "Something is wrong with our algo.  Remove this block "
 		      "to continue (found %s, but allocated %s) "
@@ -1197,7 +1197,7 @@ extern int bridge_blocks_load_curr(List curr_block_list)
 		const char *bg_block_id = block_ptr->getName().c_str();
 		uint16_t state;
 
-		if (strncmp("RMP", bg_block_id, 3))
+		if (xstrncmp("RMP", bg_block_id, 3))
 			continue;
 
 		/* find BG Block record */
diff --git a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
index 33a40bed0..70506b351 100644
--- a/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
+++ b/src/plugins/select/bluegene/bl_bgq/bridge_status.cc
@@ -912,8 +912,8 @@ static void _do_block_action_poll(void)
 			if ((bg_record->magic != BLOCK_MAGIC)
 			    || !bg_record->bg_block_id
 			    || (bg_record->state != BG_BLOCK_INITED)
-			    || strcmp(bg_record->bg_block_id,
-				      block_ptr->getName().c_str()))
+			    || xstrcmp(bg_record->bg_block_id,
+				       block_ptr->getName().c_str()))
 				continue;
 
 			bg_record->action = bridge_translate_action(
diff --git a/src/plugins/select/bluegene/libsched_if64.c b/src/plugins/select/bluegene/libsched_if64.c
index 6020ed394..1a33b8a3d 100644
--- a/src/plugins/select/bluegene/libsched_if64.c
+++ b/src/plugins/select/bluegene/libsched_if64.c
@@ -1,8 +1,6 @@
 /*****************************************************************************\
  *  libsched_if.c - here so mpirun can dynamically link to it to make
  *  sure it doesn't go try creating a block all crazy like outside of slurm.
- *
- *  $Id: bluegene.c 9169 2006-09-05 17:26:51Z jette $
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2011 Lawrence Livermore National Security.
diff --git a/src/plugins/select/bluegene/select_bluegene.c b/src/plugins/select/bluegene/select_bluegene.c
index 067f36cb4..f9eb2bf0f 100644
--- a/src/plugins/select/bluegene/select_bluegene.c
+++ b/src/plugins/select/bluegene/select_bluegene.c
@@ -117,7 +117,7 @@ List assoc_mgr_qos_list = NULL;
  */
 const char plugin_name[]       	= "BlueGene node selection plugin";
 const char plugin_type[]       	= "select/bluegene";
-const uint32_t plugin_id	= 100;
+const uint32_t plugin_id	= SELECT_PLUGIN_BLUEGENE;
 const uint32_t plugin_version	= SLURM_VERSION_NUMBER;
 
 /* Global variables */
@@ -220,8 +220,8 @@ static int _delete_old_blocks(List curr_block_list, List found_block_list)
 		while ((init_record = list_next(itr_curr))) {
 			itr_found = list_iterator_create(found_block_list);
 			while ((found_record = list_next(itr_found))) {
-				if (!strcmp(init_record->bg_block_id,
-					    found_record->bg_block_id)) {
+				if (!xstrcmp(init_record->bg_block_id,
+					     found_record->bg_block_id)) {
 					/* don't delete this one */
 					break;
 				}
@@ -340,7 +340,7 @@ static bg_record_t *_translate_info_2_record(block_info_t *block_info)
 	if (block_info->ionode_str) {
 		ba_set_ionode_str(bg_record);
 		if (!bg_record->ionode_str
-		    || strcmp(block_info->ionode_str, bg_record->ionode_str)) {
+		    || xstrcmp(block_info->ionode_str, bg_record->ionode_str)) {
 			error("block %s didn't compute with the correct "
 			      "ionode_str.  Stored as '%s' and "
 			      "came back as '%s'",
@@ -652,7 +652,7 @@ static int _load_state_file(List curr_block_list, char *dir_name)
 	buffer = create_buf(data, data_size);
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
 	debug3("Version string in block_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, BLOCK_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, BLOCK_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t)NO_VAL) {
@@ -778,7 +778,7 @@ static int _load_state_file(List curr_block_list, char *dir_name)
 				 name);
 
 			xfree(name);
-			if (strcmp(temp, bg_record->mp_str)) {
+			if (xstrcmp(temp, bg_record->mp_str)) {
 				fatal("bad wiring in preserved state "
 				      "(found %s, but allocated %s) "
 				      "YOU MUST COLDSTART",
@@ -2029,7 +2029,7 @@ extern int select_p_step_start(struct step_record *step_ptr)
 	return SLURM_SUCCESS;
 }
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	bg_record_t *bg_record = NULL;
 	select_jobinfo_t *jobinfo = NULL, *step_jobinfo = NULL;
@@ -2038,6 +2038,8 @@ extern int select_p_step_finish(struct step_record *step_ptr)
 
 	xassert(step_ptr);
 
+	if (killing_step)	/* Do not care if SIGKILL being sent to step */
+		return SLURM_SUCCESS;
 
 	if (IS_JOB_COMPLETING(step_ptr->job_ptr) ||
 	    IS_JOB_FINISHED(step_ptr->job_ptr)) {
@@ -3299,14 +3301,15 @@ extern int select_p_reconfigure(void)
 #ifdef HAVE_BG
 	slurm_conf_lock();
 	if (!slurmctld_conf.slurm_user_name
-	    || strcmp(bg_conf->slurm_user_name, slurmctld_conf.slurm_user_name))
+	    || xstrcmp(bg_conf->slurm_user_name,
+		       slurmctld_conf.slurm_user_name))
 		error("The slurm user has changed from '%s' to '%s'.  "
 		      "If this is really what you "
 		      "want you will need to restart slurm for this "
 		      "change to be enforced in the bluegene plugin.",
 		      bg_conf->slurm_user_name, slurmctld_conf.slurm_user_name);
 	if (!slurmctld_conf.node_prefix
-	    || strcmp(bg_conf->slurm_node_prefix, slurmctld_conf.node_prefix))
+	    || xstrcmp(bg_conf->slurm_node_prefix, slurmctld_conf.node_prefix))
 		error("Node Prefix has changed from '%s' to '%s'.  "
 		      "If this is really what you "
 		      "want you will need to restart slurm for this "
@@ -3385,8 +3388,10 @@ extern bitstr_t *select_p_resv_test(resv_desc_msg_t *resv_desc_ptr,
 		cores = 16;
 #endif
 		job_rec.details->min_cpus *= cores;
-	} else
+	} else {
+		jobinfo->cnode_cnt = node_cnt * cnodes_per_mp;
 		job_rec.details->min_cpus = node_cnt * bg_conf->cpus_per_mp;
+	}
 
 	job_rec.details->max_cpus = job_rec.details->min_cpus;
 	job_rec.details->core_spec = (uint16_t)NO_VAL;
@@ -3431,6 +3436,7 @@ end_it:
 	xfree(job_rec.details);
 
 	if (rc == SLURM_SUCCESS && job_rec.start_time != INFINITE) {
+		xfree(resv_desc_ptr->node_list);
 		resv_desc_ptr->node_list = xstrdup_select_jobinfo(
 			jobinfo, SELECT_PRINT_NODES);
 		if (jobinfo->ionode_str) {
@@ -3448,6 +3454,12 @@ end_it:
 					continue;
 				bit_set(*core_bitmap, i+offset);
 			}
+		} else {
+			/* This means we ended up doing full nodes, so clear out
+			 * anything vestigal that would say otherwise.
+			 */
+			FREE_NULL_BITMAP(*core_bitmap);
+			xfree(resv_desc_ptr->core_cnt);
 		}
 
 		info("Reservation request for %u nodes satisfied with %s",
diff --git a/src/plugins/select/bluegene/sfree/Makefile.in b/src/plugins/select/bluegene/sfree/Makefile.in
index ede0616c1..06d31cd52 100644
--- a/src/plugins/select/bluegene/sfree/Makefile.in
+++ b/src/plugins/select/bluegene/sfree/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 sbin_PROGRAMS = sfree$(EXEEXT)
 subdir = src/plugins/select/bluegene/sfree
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -224,8 +225,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -325,6 +324,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -363,6 +366,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -406,6 +412,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -456,6 +465,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/bluegene/sfree/opts.c b/src/plugins/select/bluegene/sfree/opts.c
index 9184f6531..b743793bf 100644
--- a/src/plugins/select/bluegene/sfree/opts.c
+++ b/src/plugins/select/bluegene/sfree/opts.c
@@ -1,6 +1,5 @@
 /****************************************************************************\
  *  opts.c - sfree command line option processing functions
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/bluegene/sfree/sfree.c b/src/plugins/select/bluegene/sfree/sfree.c
index 8a70afb5a..991f91a3c 100644
--- a/src/plugins/select/bluegene/sfree/sfree.c
+++ b/src/plugins/select/bluegene/sfree/sfree.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  sfree.c - free specified block or all blocks.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -96,10 +95,10 @@ static int _check_status()
 			while ((block_name = list_next(itr))) {
 				for (i=0; i<block_ptr->record_count;
 				     i++) {
-					if (!strcmp(block_name,
-						    block_ptr->
-						    block_array[i].
-						    bg_block_id)) {
+					if (!xstrcmp(block_name,
+						     block_ptr->
+						     block_array[i].
+						     bg_block_id)) {
 						if (block_ptr->
 						    block_array[i].
 						    state == BG_BLOCK_FREE)
diff --git a/src/plugins/select/bluegene/slurm_epilog.c b/src/plugins/select/bluegene/slurm_epilog.c
index 8fc01b782..589cc2e9b 100644
--- a/src/plugins/select/bluegene/slurm_epilog.c
+++ b/src/plugins/select/bluegene/slurm_epilog.c
@@ -2,8 +2,6 @@
  * slurm_ epilog.c - Wait until the specified partition is no longer ready and
  *      owned by this user. This is executed via SLURM to synchronize the
  *      user's job execution with slurmctld configuration of partitions.
- *
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2004 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/select/cons_res/Makefile.in b/src/plugins/select/cons_res/Makefile.in
index c366aa12d..43a1a895c 100644
--- a/src/plugins/select/cons_res/Makefile.in
+++ b/src/plugins/select/cons_res/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/cons_res
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/cons_res/dist_tasks.c b/src/plugins/select/cons_res/dist_tasks.c
index 6a42b46ad..35f4296eb 100644
--- a/src/plugins/select/cons_res/dist_tasks.c
+++ b/src/plugins/select/cons_res/dist_tasks.c
@@ -66,7 +66,7 @@ uint32_t comb_counts[MAX_BOARDS][MAX_BOARDS] =
    {7,21,35,35,21,7,1,0},
    {8,28,56,70,56,28,8,1}};
 
-static int *sockets_cpu_cnt = NULL;
+static int *sockets_core_cnt = NULL;
 
 /* Generate all combinations of k integers from the
  * set of integers 0 to n-1.
@@ -300,10 +300,10 @@ static int _cmp_int_descend(const void *a, const void *b)
 
 
 /* qsort compare function for board combination socket list
- * NOTE: sockets_cpu_cnt is a global symbol in this module */
+ * NOTE: sockets_core_cnt is a global symbol in this module */
 static int _cmp_sock(const void *a, const void *b)
 {
-	return (sockets_cpu_cnt[*(int*)b] -  sockets_cpu_cnt[*(int*)a]);
+	return (sockets_core_cnt[*(int*)b] -  sockets_core_cnt[*(int*)a]);
 }
 
 /* sync up core bitmap with new CPU count using a best-fit approach
@@ -330,14 +330,16 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 	job_resources_t *job_res = job_ptr->job_resrcs;
 	bool alloc_cores = false, alloc_sockets = false;
 	uint16_t ncpus_per_core = 0xffff;	/* Usable CPUs per core */
+	uint16_t ntasks_per_core = 0xffff;
+	int tmp_cpt = 0;
 	int count, cpu_min, b_min, elig, s_min, comb_idx, sock_idx;
 	int elig_idx, comb_brd_idx, sock_list_idx, comb_min, board_num;
-	int* boards_cpu_cnt;
-	int* sort_brds_cpu_cnt;
+	int* boards_core_cnt;
+	int* sort_brds_core_cnt;
 	int* board_combs;
 	int* socket_list;
 	int* elig_brd_combs;
-	int* elig_cpu_cnt;
+	int* elig_core_cnt;
 	bool* sockets_used;
 	uint16_t boards_nb;
 	uint16_t nboards_nb;
@@ -346,7 +348,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 	uint16_t nsockets_nb;
 	uint16_t sock_per_brd;
 	uint16_t sock_per_comb;
-	uint16_t req_cpus,best_fit_cpus = 0;
+	uint16_t req_cores,best_fit_cores = 0;
 	uint32_t best_fit_location = 0;
 	uint64_t ncomb_brd;
 	bool sufficient, best_fit_sufficient;
@@ -363,8 +365,8 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 		multi_core_data_t *mc_ptr = job_ptr->details->mc_ptr;
 		if ((mc_ptr->ntasks_per_core != (uint16_t) INFINITE) &&
 		    (mc_ptr->ntasks_per_core)) {
-			ncpus_per_core = mc_ptr->ntasks_per_core;
-			ncpus_per_core *= cpus_per_task;
+			ntasks_per_core = mc_ptr->ntasks_per_core;
+			ncpus_per_core  = ntasks_per_core * cpus_per_task;
 		}
 		if ((mc_ptr->threads_per_core != (uint16_t) NO_VAL) &&
 		    (mc_ptr->threads_per_core <  ncpus_per_core)) {
@@ -376,11 +378,11 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 	csize = bit_size(job_res->core_bitmap);
 
 	sockets_nb  = select_node_record[0].sockets;
-	sockets_cpu_cnt = xmalloc(sockets_nb * sizeof(int));
+	sockets_core_cnt = xmalloc(sockets_nb * sizeof(int));
 	sockets_used = xmalloc(sockets_nb * sizeof(bool));
 	boards_nb = select_node_record[0].boards;
-	boards_cpu_cnt = xmalloc(boards_nb * sizeof(int));
-	sort_brds_cpu_cnt = xmalloc(boards_nb * sizeof(int));
+	boards_core_cnt = xmalloc(boards_nb * sizeof(int));
+	sort_brds_core_cnt = xmalloc(boards_nb * sizeof(int));
 
 	for (c = 0, i = 0, n = 0; n < size; n++) {
 
@@ -400,9 +402,19 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 		vpus = MIN(select_node_record[n].vpus, ncpus_per_core);
 
 		/* compute still required cores on the node */
-		req_cpus = cpus / vpus;
+		req_cores = cpus / vpus;
 		if ( cpus % vpus )
-			req_cpus++;
+			req_cores++;
+
+		/* figure out core cnt if task requires more than one core and
+		 * tasks_per_core is 1 */
+		if ((ntasks_per_core == 1) &&
+		    (cpus_per_task > vpus)) {
+			/* how many cores a task will consume */
+			int cores_per_task = (cpus_per_task + vpus - 1) / vpus;
+			int tasks = cpus / cpus_per_task;
+			req_cores = tasks * cores_per_task;
+		}
 
 		if (nboards_nb > MAX_BOARDS) {
 			debug3("cons_res: node[%u]: exceeds max boards; "
@@ -412,46 +424,46 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 
 		if ( nsockets_nb > sockets_nb) {
 			sockets_nb = nsockets_nb;
-			xrealloc(sockets_cpu_cnt, sockets_nb * sizeof(int));
+			xrealloc(sockets_core_cnt, sockets_nb * sizeof(int));
 			xrealloc(sockets_used,sockets_nb * sizeof(bool));
 		}
 
 		if ( nboards_nb > boards_nb) {
 			boards_nb = nboards_nb;
-			xrealloc(boards_cpu_cnt, boards_nb * sizeof(int));
-			xrealloc(sort_brds_cpu_cnt, boards_nb * sizeof(int));
+			xrealloc(boards_core_cnt, boards_nb * sizeof(int));
+			xrealloc(sort_brds_core_cnt, boards_nb * sizeof(int));
 		}
 
 		/* Count available cores on each socket and board */
 		sock_per_brd = nsockets_nb / nboards_nb;
 		for (b = 0; b < nboards_nb; b++) {
-			boards_cpu_cnt[b] = 0;
-			sort_brds_cpu_cnt[b] = 0;
+			boards_core_cnt[b] = 0;
+			sort_brds_core_cnt[b] = 0;
 		}
 		for (s = 0; s < nsockets_nb; s++) {
-			sockets_cpu_cnt[s]=0;
+			sockets_core_cnt[s]=0;
 			sockets_used[s]=false;
 			b = s/sock_per_brd;
 			for ( j = c + (s * ncores_nb) ;
 			      j < c + ((s+1) * ncores_nb) ;
 			      j++ ) {
 				if ( bit_test(job_res->core_bitmap,j) ) {
-					sockets_cpu_cnt[s]++;
-					boards_cpu_cnt[b]++;
-					sort_brds_cpu_cnt[b]++;
+					sockets_core_cnt[s]++;
+					boards_core_cnt[b]++;
+					sort_brds_core_cnt[b]++;
 				}
 			}
 		}
 
 		/* Sort boards in descending order of available core count */
-		qsort(sort_brds_cpu_cnt, nboards_nb, sizeof (int),
+		qsort(sort_brds_core_cnt, nboards_nb, sizeof (int),
 				_cmp_int_descend);
 		/* Determine minimum number of boards required for the
 		 * allocation (b_min) */
 		count = 0;
 		for (b = 0; b < nboards_nb; b++) {
-			count+=sort_brds_cpu_cnt[b];
-			if (count >= req_cpus)
+			count+=sort_brds_core_cnt[b];
+			if (count >= req_cores)
 				break;
 		}
 		b_min = b+1;
@@ -467,7 +479,7 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 		 * for the allocation (eligible board combinations)
 		 */
 		elig_brd_combs = xmalloc(ncomb_brd * sizeof(int));
-		elig_cpu_cnt = xmalloc(ncomb_brd * sizeof(int));
+		elig_core_cnt = xmalloc(ncomb_brd * sizeof(int));
 		elig = 0;
 		for (comb_idx = 0; comb_idx < ncomb_brd; comb_idx++) {
 			count = 0;
@@ -475,11 +487,11 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 				comb_brd_idx++) {
 				board_num = board_combs[(comb_idx * b_min)
 							+ comb_brd_idx];
-				count += boards_cpu_cnt[board_num];
+				count += boards_core_cnt[board_num];
 			}
-			if (count >= req_cpus) {
+			if (count >= req_cores) {
 				elig_brd_combs[elig] = comb_idx;
-				elig_cpu_cnt[elig] = count;
+				elig_core_cnt[elig] = count;
 				elig++;
 			}
 		}
@@ -521,8 +533,8 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 			for (b = 0; b < sock_per_comb; b++) {
 				sock_idx =
 				socket_list[(int)((elig_idx*sock_per_comb)+b)];
-				count+=sockets_cpu_cnt[sock_idx];
-				if (count >= req_cpus)
+				count+=sockets_core_cnt[sock_idx];
+				if (count >= req_cores)
 					break;
 			}
 			b++;
@@ -530,17 +542,21 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 			 * of required sockets and minimum number of CPUs
 			 */
 			if ((b < s_min) ||
-				(b == s_min && elig_cpu_cnt[elig_idx]
+				(b == s_min && elig_core_cnt[elig_idx]
 							    <= cpu_min)) {
 				s_min = b;
 				comb_min = elig_idx;
-				cpu_min = elig_cpu_cnt[elig_idx];
+				cpu_min = elig_core_cnt[elig_idx];
 			}
 		}
-		debug3("cons_res: best_fit: node[%u]: required cpus: %u, "
-				"min req boards: %u,", n, cpus, b_min);
-		debug3("cons_res: best_fit: node[%u]: min req sockets: %u, "
-				"min avail cores: %u", n, s_min, cpu_min);
+		if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE) {
+			info("cons_res: best_fit: node[%u]: "
+			     "required cpus: %u, min req boards: %u,",
+			     n, cpus, b_min);
+			info("cons_res: best_fit: node[%u]: "
+			     "min req sockets: %u, min avail cores: %u",
+			     n, s_min, cpu_min);
+		}
 		/* Re-sort socket list for best-fit board combination in
 		 * ascending order of socket number */
 		qsort(&socket_list[comb_min * sock_per_comb], sock_per_comb,
@@ -548,42 +564,45 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 
 		xfree(board_combs);
 		xfree(elig_brd_combs);
-		xfree(elig_cpu_cnt);
+		xfree(elig_core_cnt);
 
 		/* select cores from the sockets of the best-fit board
 		 * combination using a best-fit approach */
+		tmp_cpt = cpus_per_task;
 		while ( cpus > 0 ) {
 
-			best_fit_cpus = 0;
+			best_fit_cores = 0;
 			best_fit_sufficient = false;
 
 			/* search for the socket with best fit */
 			for ( z = 0; z < sock_per_comb; z++ ) {
 				s = socket_list[(comb_min*sock_per_comb)+z];
-				sufficient = sockets_cpu_cnt[s] >= req_cpus ;
-				if ( (best_fit_cpus == 0) ||
+				sufficient = sockets_core_cnt[s] >= req_cores;
+				if ( (best_fit_cores == 0) ||
 				     (sufficient && !best_fit_sufficient ) ||
-				     (sufficient && (sockets_cpu_cnt[s] <
-						     best_fit_cpus)) ||
-				     (!sufficient && (sockets_cpu_cnt[s] >
-						      best_fit_cpus)) ) {
-					best_fit_cpus = sockets_cpu_cnt[s];
+				     (sufficient && (sockets_core_cnt[s] <
+						     best_fit_cores)) ||
+				     (!sufficient && (sockets_core_cnt[s] >
+						      best_fit_cores)) ) {
+					best_fit_cores = sockets_core_cnt[s];
 					best_fit_location = s;
 					best_fit_sufficient = sufficient;
 				}
 			}
 
 			/* check that we have found a usable socket */
-			if ( best_fit_cpus == 0 )
+			if ( best_fit_cores == 0 )
 				break;
 
 			j = best_fit_location;
 			if (sock_per_brd)
 				j /= sock_per_brd;
-			debug3("cons_res: best_fit: using node[%u]: "
-			       "board[%u]: socket[%u]: %u cores available",
-			       n, j, best_fit_location,
-			       sockets_cpu_cnt[best_fit_location]);
+			if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE) {
+				info("cons_res: best_fit: using node[%u]: "
+				     "board[%u]: socket[%u]: %u cores "
+				     "available", n, j, best_fit_location,
+				     sockets_core_cnt[best_fit_location]);
+			}
 
 			sockets_used[best_fit_location] = true;
 			for ( j = (c + (best_fit_location * ncores_nb));
@@ -609,12 +628,22 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 				 * cpus count using hyperthreading requirement
 				 */
 				if ( bit_test(job_res->core_bitmap, j) ) {
-					sockets_cpu_cnt[best_fit_location]--;
+					sockets_core_cnt[best_fit_location]--;
 					core_cnt++;
 					if (cpus < vpus)
 						cpus = 0;
-					else
+					else if ((ntasks_per_core == 1) &&
+						 (cpus_per_task > vpus)) {
+						int used = MIN(tmp_cpt, vpus);
+						cpus -= used;
+
+						if (tmp_cpt <= used)
+							tmp_cpt = cpus_per_task;
+						else
+							tmp_cpt -= used;
+					} else {
 						cpus -= vpus;
+					}
 				} else if (alloc_sockets) {
 					/* If the core is not used, add it
 					 * anyway if allocating whole sockets */
@@ -658,9 +687,9 @@ static void _block_sync_core_bitmap(struct job_record *job_ptr,
 
 	}
 
-	xfree(boards_cpu_cnt);
-	xfree(sort_brds_cpu_cnt);
-	xfree(sockets_cpu_cnt);
+	xfree(boards_core_cnt);
+	xfree(sort_brds_core_cnt);
+	xfree(sockets_core_cnt);
 	xfree(sockets_used);
 }
 
@@ -681,7 +710,9 @@ static int _cyclic_sync_core_bitmap(struct job_record *job_ptr,
 	bool alloc_cores = false, alloc_sockets = false;
 	uint16_t ncpus_per_core = 0xffff;	/* Usable CPUs per core */
 	uint16_t ntasks_per_socket = 0xffff;
+	uint16_t ntasks_per_core = 0xffff;
 	int error_code = SLURM_SUCCESS;
+	int tmp_cpt = 0; /* cpus_per_task */
 
 	if ((job_res == NULL) || (job_res->core_bitmap == NULL) ||
 	    (job_ptr->details == NULL))
@@ -697,8 +728,8 @@ static int _cyclic_sync_core_bitmap(struct job_record *job_ptr,
 		multi_core_data_t *mc_ptr = job_ptr->details->mc_ptr;
 		if ((mc_ptr->ntasks_per_core != (uint16_t) INFINITE) &&
 		    (mc_ptr->ntasks_per_core)) {
-			ncpus_per_core = mc_ptr->ntasks_per_core;
-			ncpus_per_core *= cpus_per_task;
+			ntasks_per_core = mc_ptr->ntasks_per_core;
+			ncpus_per_core  = ntasks_per_core * cpus_per_task;
 		}
 
 		if ((mc_ptr->threads_per_core != (uint16_t) NO_VAL) &&
@@ -796,20 +827,34 @@ static int _cyclic_sync_core_bitmap(struct job_record *job_ptr,
 				}
 				cpus_cnt[s] -= (cpus_cnt[s] % cpus_per_task);
 			}
+			tmp_cpt = cpus_per_task;
 			for (s = 0; ((s < sockets) && (cpus > 0)); s++) {
 				while ((sock_start[s] < sock_end[s]) &&
 				       (cpus_cnt[s] > 0) && (cpus > 0)) {
 					if (bit_test(core_map, sock_start[s])) {
+						int used;
 						sock_used[s] = true;
 						core_cnt++;
+
+						if ((ntasks_per_core == 1) &&
+						    (cpus_per_task > vpus)) {
+							used = MIN(tmp_cpt,
+								   vpus);
+							if (tmp_cpt <= used)
+								tmp_cpt = cpus_per_task;
+							else
+								tmp_cpt -= used;
+						} else
+							used = vpus;
+
 						if (cpus_cnt[s] < vpus)
 							cpus_cnt[s] = 0;
 						else
-							cpus_cnt[s] -= vpus;
+							cpus_cnt[s] -= used;
 						if (cpus < vpus)
 							cpus = 0;
 						else
-							cpus -= vpus;
+							cpus -= used;
 					}
 					sock_start[s]++;
 				}
diff --git a/src/plugins/select/cons_res/dist_tasks.h b/src/plugins/select/cons_res/dist_tasks.h
index 0846875dd..b0131132d 100644
--- a/src/plugins/select/cons_res/dist_tasks.h
+++ b/src/plugins/select/cons_res/dist_tasks.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  dist_tasks - Assign task count for each resources
- *
- *  $Id: dist_tasks.h,v 1.2 2006/10/31 19:31:31 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 Hewlett-Packard Development Company, L.P.
  *  Written by Susanne M. Balle, <susanne.balle@hp.com>
diff --git a/src/plugins/select/cons_res/job_test.c b/src/plugins/select/cons_res/job_test.c
index 018cba716..9a8718a27 100644
--- a/src/plugins/select/cons_res/job_test.c
+++ b/src/plugins/select/cons_res/job_test.c
@@ -143,6 +143,11 @@ static int _eval_nodes_topo(struct job_record *job_ptr, bitstr_t *node_map,
 			uint32_t min_nodes, uint32_t max_nodes,
 			uint32_t req_nodes, uint32_t cr_node_cnt,
 			uint16_t *cpu_cnt, uint16_t cr_type);
+static uint32_t _gres_sock_job_test(List job_gres_list, List node_gres_list,
+				    bool use_total_gres, bitstr_t *cpu_bitmap,
+				    int cpu_start_bit, int cpu_end_bit,
+				    uint32_t job_id, char *node_name,
+				    uint32_t node_i, uint32_t s_p_n);
 static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes,
 				uint32_t max_nodes, uint32_t req_nodes,
 				bitstr_t *node_map, uint32_t cr_node_cnt,
@@ -151,6 +156,7 @@ static uint16_t *_select_nodes(struct job_record *job_ptr, uint32_t min_nodes,
 				uint16_t cr_type, bool test_only,
 				bitstr_t *part_core_map,
 				bool prefer_alloc_nodes);
+static uint32_t _socks_per_node(struct job_record *job_ptr);
 
 /* _allocate_sockets - Given the job requirements, determine which sockets
  *                     from the given node can be allocated (if any) to this
@@ -215,7 +221,9 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 	uint16_t threads_per_core = select_node_record[node_i].vpus;
 	uint16_t min_cores = 1, min_sockets = 1, ntasks_per_socket = 0;
 	uint16_t ncpus_per_core = 0xffff;	/* Usable CPUs per core */
+	uint16_t ntasks_per_core = 0xffff;
 	uint32_t free_cpu_count = 0, used_cpu_count = 0, *used_cpu_array = NULL;
+	int tmp_cpt = 0; /* cpus_per_task */
 
 	if (entire_sockets_only && job_ptr->details->whole_node &&
 	    (job_ptr->details->core_spec != (uint16_t) NO_VAL)) {
@@ -233,9 +241,9 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 		}
 		if ((mc_ptr->ntasks_per_core != (uint16_t) INFINITE) &&
 		    (mc_ptr->ntasks_per_core)) {
+			ntasks_per_core = mc_ptr->ntasks_per_core;
 			ncpus_per_core = MIN(threads_per_core,
-					     (mc_ptr->ntasks_per_core *
-					      cpus_per_task));
+					     (ntasks_per_core * cpus_per_task));
 		}
 		if ((mc_ptr->threads_per_core != (uint16_t) NO_VAL) &&
 		    (mc_ptr->threads_per_core <  ncpus_per_core)) {
@@ -320,11 +328,12 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 		if (bit_test(core_map, c)) {
 			free_cores[i]++;
 			free_core_count++;
-		} else {
+		} else if (!part_core_map) {
+			used_cores[i]++;
+		} else if (part_core_map && bit_test(part_core_map, c)) {
 			used_cores[i]++;
-		}
-		if (part_core_map && bit_test(part_core_map, c))
 			used_cpu_array[i]++;
+		}
 	}
 
 	for (i = 0; i < sockets; i++) {
@@ -413,6 +422,18 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 
 	if (cpus_per_task < 2) {
 		avail_cpus = num_tasks;
+	} else if ((ntasks_per_core == 1) &&
+		   (cpus_per_task > threads_per_core)) {
+		/* find out how many cores a task will use */
+		int task_cores = (cpus_per_task + threads_per_core - 1) /
+				 threads_per_core;
+		int task_cpus  = task_cores * threads_per_core;
+		/* find out how many tasks can fit on a node */
+		int tasks = avail_cpus / task_cpus;
+		/* how many cpus the the job would use on the node */
+		avail_cpus = tasks * task_cpus;
+		/* subtract out the extra cpus. */
+		avail_cpus -= (tasks * (task_cpus - cpus_per_task));
 	} else {
 		j = avail_cpus / cpus_per_task;
 		num_tasks = MIN(num_tasks, j);
@@ -439,6 +460,7 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 			cps = ntasks_per_socket * cpus_per_task;
 	}
 	si = 9999;
+	tmp_cpt = cpus_per_task;
 	for (c = core_begin; c < core_end && avail_cpus > 0; c++) {
 		if (bit_test(core_map, c) == 0)
 			continue;
@@ -467,8 +489,19 @@ static uint16_t _allocate_sc(struct job_record *job_ptr, bitstr_t *core_map,
 			 * processing of stage 3
 			 */
 			if (avail_cpus >= threads_per_core) {
-				avail_cpus -= threads_per_core;
-				cpu_count += threads_per_core;
+				int used;
+				if ((ntasks_per_core == 1) &&
+				    (cpus_per_task > threads_per_core)) {
+					used = MIN(tmp_cpt, threads_per_core);
+				} else
+					used = threads_per_core;
+				avail_cpus -= used;
+				cpu_count  += used;
+
+				if (tmp_cpt <= used)
+					tmp_cpt = cpus_per_task;
+				else
+					tmp_cpt -= used;
 			}
 			else {
 				cpu_count += avail_cpus;
@@ -510,7 +543,6 @@ fini:
 	return cpu_count;
 }
 
-
 /*
  * _can_job_run_on_node - Given the job requirements, determine which
  *                        resources from the given node (if any) can be
@@ -521,7 +553,8 @@ fini:
  *
  * IN job_ptr       - pointer to job requirements
  * IN/OUT core_map  - core_bitmap of available cores
- * IN n             - index of node to be evaluated
+ * IN node_i        - index of node to be evaluated
+ * IN s_p_n         - Expected sockets_per_node (NO_VAL if not known)
  * IN cr_type       - Consumable Resource setting
  * IN test_only     - ignore allocated memory check
  *
@@ -530,7 +563,7 @@ fini:
  *       which bits to deselect from the core_map to match the cpu_count.
  */
 uint16_t _can_job_run_on_node(struct job_record *job_ptr, bitstr_t *core_map,
-			      const uint32_t node_i,
+			      const uint32_t node_i, uint32_t s_p_n,
 			      struct node_use_record *node_usage,
 			      uint16_t cr_type,
 			      bool test_only, bitstr_t *part_core_map)
@@ -562,11 +595,19 @@ uint16_t _can_job_run_on_node(struct job_record *job_ptr, bitstr_t *core_map,
 	gres_plugin_job_core_filter(job_ptr->gres_list, gres_list, test_only,
 				    core_map, core_start_bit, core_end_bit,
 				    node_ptr->name);
-	gres_cores = gres_plugin_job_test(job_ptr->gres_list,
-					  gres_list, test_only,
-					  core_map, core_start_bit,
-					  core_end_bit, job_ptr->job_id,
-					  node_ptr->name);
+	if (s_p_n == NO_VAL) {
+		gres_cores = gres_plugin_job_test(job_ptr->gres_list,
+						  gres_list, test_only,
+						  core_map, core_start_bit,
+						  core_end_bit, job_ptr->job_id,
+						  node_ptr->name);
+	} else {
+		gres_cores = _gres_sock_job_test(job_ptr->gres_list,
+						 gres_list, test_only,
+						 core_map, core_start_bit,
+						 core_end_bit, job_ptr->job_id,
+						 node_ptr->name, node_i, s_p_n);
+	}
 
 	if (cr_type & CR_CORE) {
 		cpus = _allocate_cores(job_ptr, core_map, part_core_map,
@@ -597,8 +638,26 @@ uint16_t _can_job_run_on_node(struct job_record *job_ptr, bitstr_t *core_map,
 			avail_mem -= node_usage[node_i].alloc_memory;
 		if (job_ptr->details->pn_min_memory & MEM_PER_CPU) {
 			/* memory is per-cpu */
-			while ((cpus > 0) && ((req_mem * cpus) > avail_mem))
-				cpus -= cpu_alloc_size;
+			if (!(cr_type & CR_CPU) &&
+			    job_ptr->details->mc_ptr &&
+			    job_ptr->details->mc_ptr->ntasks_per_core == 1 &&
+			    job_ptr->details->cpus_per_task == 1) {
+				/* In this scenario, cpus represents cores and
+				 * the cpu/core count will be inflated later on
+				 * to include all of the threads on a core. So
+				 * we need to compare apples to apples and only
+				 * remove 1 cpu/core at a time. */
+				while ((cpus > 0) &&
+				       ((req_mem *
+					 (cpus * select_node_record[node_i].vpus))
+					 > avail_mem))
+					cpus -= 1;
+			} else {
+				while ((cpus > 0) &&
+				       ((req_mem * cpus) > avail_mem))
+					cpus -= cpu_alloc_size;
+			}
+
 			if (job_ptr->details->cpus_per_task > 1) {
 				i = cpus % job_ptr->details->cpus_per_task;
 				cpus -= i;
@@ -947,6 +1006,132 @@ static int _get_cpu_cnt(struct job_record *job_ptr, const int node_index,
 	return cpus;
 }
 
+/*
+ * Determine how many CPUs on the node can be used by this job
+ * IN job_gres_list  - job's gres_list built by gres_plugin_job_state_validate()
+ * IN node_gres_list - node's gres_list built by gres_plugin_node_config_validate()
+ * IN use_total_gres - if set then consider all gres resources as available,
+ *		       and none are commited to running jobs
+ * IN cpu_bitmap     - Identification of available CPUs (NULL if no restriction)
+ * IN cpu_start_bit  - index into cpu_bitmap for this node's first CPU
+ * IN cpu_end_bit    - index into cpu_bitmap for this node's last CPU
+ * IN job_id         - job's ID (for logging)
+ * IN node_name      - name of the node (for logging)
+ * IN node_i - Node index
+ * IN s_p_n - Sockets per node required by this job or NO_VAL
+ * RET: NO_VAL    - All cores on node are available
+ *      otherwise - Count of available cores
+ */
+static uint32_t _gres_sock_job_test(List job_gres_list, List node_gres_list,
+				    bool use_total_gres, bitstr_t *core_bitmap,
+				    int core_start_bit, int core_end_bit,
+				    uint32_t job_id, char *node_name,
+				    uint32_t node_i, uint32_t s_p_n)
+{
+	uint32_t core_cnt, sock_cnt, cores_per_sock;
+	uint32_t *avail_cores, result_cores;
+	bitstr_t **sock_core_bitmap;
+	int i, j;
+	int core_bit_cnt, core_inx, sock_inx, best_socket;
+
+	if ((s_p_n == NO_VAL) || (core_bitmap == NULL) ||
+	    (select_node_record == NULL) ||
+	    ((sock_cnt = select_node_record[node_i].sockets) < 2) ||
+	    (sock_cnt == s_p_n)) {
+		/* No socket filtering possible */
+		return gres_plugin_job_test(job_gres_list, node_gres_list,
+					    use_total_gres, core_bitmap,
+					    core_start_bit, core_end_bit,
+				 	    job_id, node_name);
+	}
+
+	/* Build local data structures */
+	core_cnt = core_end_bit - core_start_bit + 1;
+	cores_per_sock = core_cnt / sock_cnt;
+	core_bit_cnt = bit_size(core_bitmap);
+	sock_core_bitmap = xmalloc(sizeof(bitstr_t *) * sock_cnt);
+	for (i = 0; i < sock_cnt; i++)
+		sock_core_bitmap[i] = bit_alloc(core_bit_cnt);
+	for (i = core_start_bit, core_inx = 0, sock_inx = 0;
+	     i <= core_end_bit; i++) {
+		if (core_inx >= cores_per_sock) {
+			core_inx = 0;
+			sock_inx++;
+		}
+		if (bit_test(core_bitmap, i))
+			bit_set(sock_core_bitmap[sock_inx], i);
+		core_inx++;
+	}
+
+	/* Determine how many cores are available from each socket starting
+	 * position and moving forward by s_p_n sockets. In order to keep
+	 * the overhead/time and complexity reasonable, we only consider
+	 * using consecutive sockets. */
+	avail_cores = xmalloc(sizeof(uint32_t) * sock_cnt);
+	if (s_p_n == 0)
+		s_p_n = 1;	/* job needs at least 1 socket */
+	for (i = 0; i <= (sock_cnt - s_p_n); i++) {
+		for (j = 1; j < s_p_n; j++)
+			bit_or(sock_core_bitmap[i], sock_core_bitmap[i+j]);
+		avail_cores[i] = gres_plugin_job_test(job_gres_list,
+					node_gres_list, use_total_gres,
+					sock_core_bitmap[i], core_start_bit,
+					core_end_bit, job_id, node_name);
+	}
+
+	/* Identify the best sockets */
+	best_socket = -1;
+	for (i = 0; i <= (sock_cnt - s_p_n); i++) {
+		if ((best_socket == -1) ||
+		    (avail_cores[i] > avail_cores[best_socket]))
+			best_socket = i;
+	}
+	result_cores = avail_cores[best_socket];
+	bit_and(core_bitmap, sock_core_bitmap[best_socket]);
+
+	/* Free local data structures */
+	for (i = 0; i < sock_cnt; i++)
+		bit_free(sock_core_bitmap[i]);
+	xfree(sock_core_bitmap);
+	xfree(avail_cores);
+
+	return result_cores;
+}
+
+/* Determine how many sockets per node this job requires for GRES */
+static uint32_t _socks_per_node(struct job_record *job_ptr)
+{
+	multi_core_data_t *mc_ptr;
+	uint32_t s_p_n = NO_VAL;
+	uint32_t cpu_cnt, cpus_per_node, tasks_per_node;
+	uint32_t min_nodes;
+
+	if ((job_ptr->details == NULL) || (job_ptr->gres_list == NULL) ||
+	    ((job_ptr->bit_flags & GRES_ENFORCE_BIND) == 0))
+		return s_p_n;
+
+	cpu_cnt = job_ptr->details->num_tasks * job_ptr->details->cpus_per_task;
+	cpu_cnt = MAX(job_ptr->details->min_cpus, cpu_cnt);
+	min_nodes = MAX(job_ptr->details->min_nodes, 1);
+	cpus_per_node = cpu_cnt / min_nodes;
+	if (cpus_per_node <= 1)
+		return (uint32_t) 1;
+
+	mc_ptr = job_ptr->details->mc_ptr;
+	if ((mc_ptr->ntasks_per_socket != (uint16_t) NO_VAL) &&
+	    (mc_ptr->ntasks_per_socket != (uint16_t) INFINITE)) {
+		tasks_per_node = job_ptr->details->num_tasks / min_nodes;
+		s_p_n = (tasks_per_node + mc_ptr->ntasks_per_socket - 1) /
+			mc_ptr->ntasks_per_socket;
+		return s_p_n;
+	}
+
+	/* This logic could be expanded to support additional cases, which may
+	 * require information per node information (e.g. threads per core). */
+
+	return s_p_n;
+}
+
 /* Compute resource usage for the given job on all available resources
  *
  * IN: job_ptr     - pointer to the job requesting resources
@@ -965,12 +1150,13 @@ static void _get_res_usage(struct job_record *job_ptr, bitstr_t *node_map,
 {
 	uint16_t *cpu_cnt;
 	uint32_t n;
+	uint32_t s_p_n = _socks_per_node(job_ptr);
 
 	cpu_cnt = xmalloc(cr_node_cnt * sizeof(uint16_t));
 	for (n = 0; n < cr_node_cnt; n++) {
 		if (!bit_test(node_map, n))
 			continue;
-		cpu_cnt[n] = _can_job_run_on_node(job_ptr, core_map, n,
+		cpu_cnt[n] = _can_job_run_on_node(job_ptr, core_map, n, s_p_n,
 						  node_usage, cr_type,
 						  test_only, part_core_map);
 	}
@@ -1083,7 +1269,8 @@ static int _eval_nodes(struct job_record *job_ptr, bitstr_t *node_map,
 					  cr_node_cnt, cpu_cnt);
 	}
 
-	if (switch_record_cnt && switch_record_table) {
+	if (switch_record_cnt && switch_record_table &&
+	    ((topo_optional == false) || job_ptr->req_switch)) {
 		/* Perform optimized resource selection based upon topology */
 		if (have_dragonfly) {
 			return _eval_nodes_dfly(job_ptr, node_map,
@@ -3096,8 +3283,8 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
 		}
 
 		for (p_ptr = cr_part_ptr; p_ptr; p_ptr = p_ptr->next) {
-			if ((p_ptr->part_ptr->priority <=
-			     jp_ptr->part_ptr->priority) &&
+			if ((p_ptr->part_ptr->priority_tier <=
+			     jp_ptr->part_ptr->priority_tier) &&
 			    (p_ptr->part_ptr->preempt_mode !=
 			     PREEMPT_MODE_OFF)) {
 				if (select_debug_flags &
@@ -3150,7 +3337,8 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *node_bitmap,
 	/* remove existing allocations (jobs) from same-priority partitions
 	 * from avail_cores */
 	for (p_ptr = cr_part_ptr; p_ptr; p_ptr = p_ptr->next) {
-		if (p_ptr->part_ptr->priority != jp_ptr->part_ptr->priority)
+		if (p_ptr->part_ptr->priority_tier !=
+		    jp_ptr->part_ptr->priority_tier)
 			continue;
 		if (!p_ptr->row)
 			continue;
diff --git a/src/plugins/select/cons_res/job_test.h b/src/plugins/select/cons_res/job_test.h
index 89a0be1da..cd632f761 100644
--- a/src/plugins/select/cons_res/job_test.h
+++ b/src/plugins/select/cons_res/job_test.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  select_cons_res.h
- *
- *  $Id: select_cons_res.h,v 1.3 2006/10/31 20:01:38 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 Hewlett-Packard Development Company, L.P.
  *  Written by Susanne M. Balle, <susanne.balle@hp.com>
diff --git a/src/plugins/select/cons_res/select_cons_res.c b/src/plugins/select/cons_res/select_cons_res.c
index 3c8714aca..b82b1c659 100644
--- a/src/plugins/select/cons_res/select_cons_res.c
+++ b/src/plugins/select/cons_res/select_cons_res.c
@@ -91,6 +91,10 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
+
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
 #  if HAVE_STDINT_H
@@ -101,6 +105,8 @@
 #  endif
 #endif
 
+#include <string.h>
+
 #include "src/common/slurm_xlator.h"
 #include "src/common/slurm_selecttype_info.h"
 #include "select_cons_res.h"
@@ -169,7 +175,7 @@ uint32_t *cr_node_cores_offset;
  */
 const char plugin_name[] = "Consumable Resources (CR) Node Selection plugin";
 const char plugin_type[] = "select/cons_res";
-const uint32_t plugin_id      = 101;
+const uint32_t plugin_id      = SELECT_PLUGIN_CONS_RES;
 const uint32_t plugin_version = SLURM_VERSION_NUMBER;
 const uint32_t pstate_version = 7;	/* version control on saved state */
 
@@ -182,6 +188,7 @@ bool     preempt_by_part      = false;
 bool     preempt_by_qos       = false;
 uint64_t select_debug_flags   = 0;
 uint16_t select_fast_schedule = 0;
+bool     topo_optional        = false;
 
 struct part_res_record *select_part_record = NULL;
 struct node_res_record *select_node_record = NULL;
@@ -271,8 +278,10 @@ static void _dump_nodes(void)
 static void _dump_part(struct part_res_record *p_ptr)
 {
 	uint16_t i;
-	info("part:%s rows:%u pri:%u ", p_ptr->part_ptr->name, p_ptr->num_rows,
-	     p_ptr->part_ptr->priority);
+
+	info("part:%s rows:%u prio:%u ", p_ptr->part_ptr->name, p_ptr->num_rows,
+	     p_ptr->part_ptr->priority_tier);
+
 	if (!p_ptr->row)
 		return;
 
@@ -1272,8 +1281,13 @@ static int _rm_job_from_res(struct part_res_record *part_record_ptr,
 					node_usage[i].node_state -=
 						job->node_req;
 				} else {
+					node_ptr = node_record_table_ptr + i;
 					error("cons_res:_rm_job_from_res: "
-					      "node_state mis-count");
+					      "node_state mis-count (job:%u "
+					      "job_cnt:%u node:%s node_cnt:%u)",
+					      job_ptr->job_id, job->node_req,
+					      node_ptr->name,
+					      node_usage[i].node_state);
 					node_usage[i].node_state =
 						NODE_CR_AVAILABLE;
 				}
@@ -1306,27 +1320,17 @@ static int _rm_job_from_one_node(struct job_record *job_ptr,
 	if (select_debug_flags & DEBUG_FLAG_SELECT_TYPE)
 		_dump_job_res(job);
 
-	if (job->whole_node) {
-		/* The node_bitmap remains set for this node, set but its entire
-		 * core_bitmap will be cleared by clear_job_resources_node()
-		 * below. Clear whole_node flag to prevent add_job_to_cores()
-		 * from considering all cores on all allocated nodes as being
-		 * allocated to this job. */
-		verbose("%s: Clearing flag whole_node for job %u",
-			__func__, job_ptr->job_id);
-		job->whole_node = 0;
-	}
-
 	/* subtract memory */
 	node_inx  = node_ptr - node_record_table_ptr;
 	first_bit = bit_ffs(job->node_bitmap);
 	last_bit  = bit_fls(job->node_bitmap);
-	for (i = first_bit, n = -1; i <= last_bit; i++) {
+	for (i = first_bit, n = 0; i <= last_bit; i++) {
 		if (!bit_test(job->node_bitmap, i))
 			continue;
-		n++;
-		if (i != node_inx)
+		if (i != node_inx) {
+			n++;
 			continue;
+		}
 
 		if (job->cpus[n] == 0) {
 			info("attempt to remove node %s from job %u again",
@@ -1342,10 +1346,6 @@ static int _rm_job_from_one_node(struct job_record *job_ptr,
 					job_ptr->job_id, node_ptr->name);
 		gres_plugin_node_state_log(gres_list, node_ptr->name);
 
-		job->cpus[n] = 0;
-		job->ncpus = build_job_resources_cpu_array(job);
-		clear_job_resources_node(job, n);
-
 		if (node_usage[i].alloc_memory < job->memory_allocated[n]) {
 			error("cons_res: node %s memory is underallocated "
 			      "(%u-%u) for job %u",
@@ -1355,7 +1355,8 @@ static int _rm_job_from_one_node(struct job_record *job_ptr,
 		} else
 			node_usage[i].alloc_memory -= job->memory_allocated[n];
 
-		job->memory_allocated[n] = 0;
+		extract_job_resources_node(job, n);
+
 		break;
 	}
 
@@ -1484,7 +1485,7 @@ static int _test_only(struct job_record *job_ptr, bitstr_t *bitmap,
 
 	if (job_ptr->part_ptr->cr_type) {
 		if ((cr_type & CR_SOCKET) || (cr_type & CR_CORE)) {
-			tmp_cr_type &= ~(CR_SOCKET|CR_CORE);
+			tmp_cr_type &= ~(CR_SOCKET | CR_CORE | CR_MEMORY);
 			tmp_cr_type |= job_ptr->part_ptr->cr_type;
 		} else {
 			info("cons_res: Can't use Partition SelectType unless "
@@ -1540,7 +1541,7 @@ top:	orig_map = bit_copy(save_bitmap);
 
 	if (job_ptr->part_ptr->cr_type) {
 		if ((cr_type & CR_SOCKET) || (cr_type & CR_CORE)) {
-			tmp_cr_type &= ~(CR_SOCKET|CR_CORE);
+			tmp_cr_type &= ~(CR_SOCKET | CR_CORE | CR_MEMORY);
 			tmp_cr_type |= job_ptr->part_ptr->cr_type;
 		} else {
 			info("cons_res: Can't use Partition SelectType unless "
@@ -1765,7 +1766,7 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap,
 
 	if (job_ptr->part_ptr->cr_type) {
 		if ((cr_type & CR_SOCKET) || (cr_type & CR_CORE)) {
-			tmp_cr_type &= ~(CR_SOCKET|CR_CORE);
+			tmp_cr_type &= ~(CR_SOCKET | CR_CORE | CR_MEMORY);
 			tmp_cr_type |= job_ptr->part_ptr->cr_type;
 		} else {
 			info("cons_res: Can't use Partition SelectType unless "
@@ -1849,7 +1850,8 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap,
 
 	/* Remove the running jobs from exp_node_cr and try scheduling the
 	 * pending job after each one (or a few jobs that end close in time). */
-	if (rc != SLURM_SUCCESS) {
+	if ((rc != SLURM_SUCCESS) &&
+	    ((job_ptr->bit_flags & TEST_NOW_ONLY) == 0)) {
 		int time_window = 0;
 		bool more_jobs = true;
 		list_sort(cr_job_list, _cr_job_list_sort);
@@ -1970,9 +1972,13 @@ extern int init(void)
 	select_debug_flags = slurm_get_debug_flags();
 
 	topo_param = slurm_get_topology_param();
-	if (topo_param && strstr(topo_param, "dragonfly"))
-		have_dragonfly = true;
-	xfree(topo_param);
+	if (topo_param) {
+		if (strcasestr(topo_param, "dragonfly"))
+			have_dragonfly = true;
+		if (strcasestr(topo_param, "TopoOptional"))
+			topo_optional = true;
+		xfree(topo_param);
+	}
 
 	return SLURM_SUCCESS;
 }
@@ -2372,7 +2378,7 @@ extern int select_p_step_start(struct step_record *step_ptr)
 	return SLURM_SUCCESS;
 }
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	return SLURM_SUCCESS;
 }
@@ -2449,9 +2455,9 @@ extern int select_p_select_nodeinfo_set_all(void)
 	struct part_res_record *p_ptr;
 	struct node_record *node_ptr = NULL;
 	int i, n, start, end;
-	uint16_t tmp, tmp_part;
 	static time_t last_set_all = 0;
 	uint32_t alloc_cpus, node_cores, node_cpus, node_threads;
+	bitstr_t *alloc_core_bitmap = NULL;
 
 	/* only set this once when the last_node_update is newer than
 	 * the last time we set things up. */
@@ -2463,6 +2469,25 @@ extern int select_p_select_nodeinfo_set_all(void)
 	}
 	last_set_all = last_node_update;
 
+	/* Build bitmap representing all cores allocated to all active jobs
+	 * (running or preempted jobs) */
+	for (p_ptr = select_part_record; p_ptr; p_ptr = p_ptr->next) {
+		if (!p_ptr->row)
+			continue;
+		for (i = 0; i < p_ptr->num_rows; i++) {
+			if (!p_ptr->row[i].row_bitmap)
+				continue;
+			if (!alloc_core_bitmap) {
+				alloc_core_bitmap =
+					bit_copy(p_ptr->row[i].row_bitmap);
+			} else if (bit_size(alloc_core_bitmap) ==
+				   bit_size(p_ptr->row[i].row_bitmap)) {
+				bit_or(alloc_core_bitmap,
+				       p_ptr->row[i].row_bitmap);
+			}
+		}
+	}
+
 	for (n = 0, node_ptr = node_record_table_ptr;
 	     n < select_node_cnt; n++, node_ptr++) {
 		select_nodeinfo_t *nodeinfo = NULL;
@@ -2486,25 +2511,15 @@ extern int select_p_select_nodeinfo_set_all(void)
 		}
 
 		start = cr_get_coremap_offset(n);
-		end = cr_get_coremap_offset(n+1);
-		alloc_cpus = 0;
-		for (p_ptr = select_part_record; p_ptr; p_ptr = p_ptr->next) {
-			if (!p_ptr->row)
-				continue;
-			tmp_part = 0;
-			for (i = 0; i < p_ptr->num_rows; i++) {
-				if (!p_ptr->row[i].row_bitmap)
-					continue;
-				tmp = bit_set_count_range(
-					p_ptr->row[i].row_bitmap,
-					start, end);
-				/* Report row with largest CPU count */
-				tmp_part = MAX(tmp, tmp_part);
-			}
-			alloc_cpus += tmp_part;	/* Add CPU counts all parts */
+		end = cr_get_coremap_offset(n + 1);
+		if (alloc_core_bitmap) {
+			alloc_cpus = bit_set_count_range(alloc_core_bitmap,
+							 start, end);
+		} else {
+			alloc_cpus = 0;
 		}
-
 		node_cores = end - start;
+
 		/* Administrator could resume suspended jobs and oversubscribe
 		 * cores, avoid reporting more cores in use than configured */
 		if (alloc_cpus > node_cores)
@@ -2514,8 +2529,8 @@ extern int select_p_select_nodeinfo_set_all(void)
 		 * count up to the proper CPU count as needed */
 		if (node_cores < node_cpus)
 			alloc_cpus *= node_threads;
-
 		nodeinfo->alloc_cpus = alloc_cpus;
+
 		if (select_node_record) {
 			nodeinfo->alloc_memory =
 				select_node_usage[n].alloc_memory;
@@ -2523,6 +2538,7 @@ extern int select_p_select_nodeinfo_set_all(void)
 			nodeinfo->alloc_memory = 0;
 		}
 	}
+	FREE_NULL_BITMAP(alloc_core_bitmap);
 
 	return SLURM_SUCCESS;
 }
@@ -2535,9 +2551,12 @@ extern int select_p_select_nodeinfo_set(struct job_record *job_ptr)
 
 	if (IS_JOB_RUNNING(job_ptr))
 		rc = _add_job_to_res(job_ptr, 0);
-	else if (IS_JOB_SUSPENDED(job_ptr))
-		rc = _add_job_to_res(job_ptr, 1);
-	else
+	else if (IS_JOB_SUSPENDED(job_ptr)) {
+		if (job_ptr->priority == 0)
+			rc = _add_job_to_res(job_ptr, 1);
+		else	/* Gang schedule suspend */
+			rc = _add_job_to_res(job_ptr, 0);
+	} else
 		return SLURM_SUCCESS;
 	gres_plugin_job_state_log(job_ptr->gres_list, job_ptr->job_id);
 
@@ -2701,13 +2720,31 @@ extern int select_p_update_node_config (int index)
 		return SLURM_ERROR;
 	}
 
+	/* Socket and core count can be changed when KNL node reboots in a
+	 * different NUMA configuration */
+	if ((select_fast_schedule == 1) &&
+	    (select_node_record[index].sockets !=
+	     select_node_record[index].node_ptr->config_ptr->sockets) &&
+	    (select_node_record[index].cores !=
+	     select_node_record[index].node_ptr->config_ptr->cores) &&
+	    ((select_node_record[index].sockets *
+	      select_node_record[index].cores) ==
+	     (select_node_record[index].node_ptr->sockets *
+	      select_node_record[index].node_ptr->cores))) {
+		select_node_record[index].sockets =
+			select_node_record[index].node_ptr->config_ptr->sockets;
+		select_node_record[index].cores =
+			select_node_record[index].node_ptr->config_ptr->cores;
+	}
+
 	if (select_fast_schedule)
 		return SLURM_SUCCESS;
 
-	select_node_record[index].real_memory = select_node_record[index].
-		node_ptr->real_memory;
-	select_node_record[index].mem_spec_limit = select_node_record[index].
-		node_ptr->mem_spec_limit;
+	select_node_record[index].real_memory =
+		select_node_record[index].node_ptr->real_memory;
+	select_node_record[index].mem_spec_limit =
+		select_node_record[index].node_ptr->mem_spec_limit;
+
 	return SLURM_SUCCESS;
 }
 
@@ -2743,7 +2780,10 @@ extern int select_p_reconfigure(void)
 			_add_job_to_res(job_ptr, 0);
 		} else if (IS_JOB_SUSPENDED(job_ptr)) {
 			/* add the job in a suspended state */
-			_add_job_to_res(job_ptr, 1);
+			if (job_ptr->priority == 0)
+				(void) _add_job_to_res(job_ptr, 1);
+			else	/* Gang schedule suspend */
+				(void) _add_job_to_res(job_ptr, 0);
 		} else if (_job_cleaning(job_ptr)) {
 			cleaning_job_cnt++;
 			run_time = (int) difftime(now, job_ptr->end_time);
diff --git a/src/plugins/select/cons_res/select_cons_res.h b/src/plugins/select/cons_res/select_cons_res.h
index b552c2fd5..6bb3f90f1 100644
--- a/src/plugins/select/cons_res/select_cons_res.h
+++ b/src/plugins/select/cons_res/select_cons_res.h
@@ -1,10 +1,8 @@
 /*****************************************************************************\
  *  select_cons_res.h
- *
- *  $Id: select_cons_res.h,v 1.3 2006/10/31 20:01:38 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 Hewlett-Packard Development Company, L.P.
-*   Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
  *  Written by Susanne M. Balle, <susanne.balle@hp.com>
  *  CODE-OCEC-09-009. All rights reserved.
  *
@@ -113,6 +111,7 @@ extern bool     preempt_by_part;
 extern bool     preempt_by_qos;
 extern uint64_t select_debug_flags;
 extern uint16_t select_fast_schedule;
+extern bool     topo_optional;
 
 extern struct part_res_record *select_part_record;
 extern struct node_res_record *select_node_record;
diff --git a/src/plugins/select/cray/Makefile.am b/src/plugins/select/cray/Makefile.am
index f9ff5d55c..26472f157 100644
--- a/src/plugins/select/cray/Makefile.am
+++ b/src/plugins/select/cray/Makefile.am
@@ -10,6 +10,6 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common \
 pkglib_LTLIBRARIES = select_cray.la
 
 # Cray node selection plugin.
-select_cray_la_SOURCES = select_cray.c
+select_cray_la_SOURCES = ccm.c ccm.h select_cray.c
 select_cray_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(CRAY_SELECT_LDFLAGS)
 select_cray_la_LIBADD  = ../other/libother_select.la
diff --git a/src/plugins/select/cray/Makefile.in b/src/plugins/select/cray/Makefile.in
index 106d99da9..926319010 100644
--- a/src/plugins/select/cray/Makefile.in
+++ b/src/plugins/select/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -173,7 +174,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(pkglibdir)"
 LTLIBRARIES = $(pkglib_LTLIBRARIES)
 select_cray_la_DEPENDENCIES = ../other/libother_select.la
-am_select_cray_la_OBJECTS = select_cray.lo
+am_select_cray_la_OBJECTS = ccm.lo select_cray.lo
 select_cray_la_OBJECTS = $(am_select_cray_la_OBJECTS)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -501,7 +511,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/common \
 pkglib_LTLIBRARIES = select_cray.la
 
 # Cray node selection plugin.
-select_cray_la_SOURCES = select_cray.c
+select_cray_la_SOURCES = ccm.c ccm.h select_cray.c
 select_cray_la_LDFLAGS = $(SO_LDFLAGS) $(PLUGIN_FLAGS) $(CRAY_SELECT_LDFLAGS)
 select_cray_la_LIBADD = ../other/libother_select.la
 all: all-am
@@ -582,6 +592,7 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ccm.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select_cray.Plo@am__quote@
 
 .c.o:
diff --git a/src/plugins/select/cray/ccm.c b/src/plugins/select/cray/ccm.c
new file mode 100644
index 000000000..03b46140b
--- /dev/null
+++ b/src/plugins/select/cray/ccm.c
@@ -0,0 +1,710 @@
+/*****************************************************************************\
+ *  ccm.c - Cray CCM app ssh launch over the Aries interconnect; node
+ *  selection plugin for cray systems.
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC
+ *  Copyright 2016 Cray Inc. All Rights Reserved.
+ *  Written by Marlys Kohnke
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#define _GNU_SOURCE		/* needed for getline() */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <fcntl.h>
+
+#include "src/common/pack.h"
+#include "src/common/slurm_strcasestr.h"
+#include "src/slurmctld/locks.h"
+#include "ccm.h"
+
+/* CCM use */
+#include "src/slurmctld/job_scheduler.h"
+#include "src/slurmctld/srun_comm.h"
+
+const char *ccm_prolog_path;
+const char *ccm_epilog_path;
+ccm_config_t ccm_config;
+
+static char *_get_ccm_partition(ccm_config_t *ccm_config);
+static int _parse_ccm_config(char *entry, char **ccm_partition);
+static void _free_ccm_info(ccm_info_t *ccm_info);
+static int *_ccm_convert_nodelist(char *nodelist, int *node_cnt);
+static char * _ccm_create_unique_file(char *uniqnm, int *fd,
+				      ccm_info_t *ccm_info);
+static char *_ccm_create_nidlist_file(ccm_info_t *ccm_info);
+static int _run_ccm_prolog_epilog(ccm_info_t *ccm_info, char *ccm_type,
+				  const char *ccm_script);
+
+/*
+ * Open the CCM config file and read the CCM_QUEUES list of partition
+ * name(s).  Store the values in the global ccm_partition array.
+ * This is done once per slurmctld startup.
+ *
+ * Upon success, returns NULL; otherwise, an error string is returned.
+ */
+static char *_get_ccm_partition(ccm_config_t *ccm_config)
+{
+	FILE *fp;
+	size_t num_read, len;
+	char *entry = NULL, *err_mesg = NULL, extra[2];
+	static char err_buf[256];
+	int i, num_ents = 0;
+
+	ccm_config->num_ccm_partitions = 0;
+	fp = fopen(CCM_CONF_PATH, "r");
+	if (fp == NULL) {
+		snprintf(err_buf, sizeof(err_buf),
+			 "CCM unable to open %s, %m\n", CCM_CONF_PATH);
+		err_mesg = err_buf;
+		return err_mesg;
+	}
+	while ((num_read = getline(&entry, &len, fp)) != -1) {
+		if (entry) {
+			if (entry[num_read - 1] == '\n') {
+				entry[num_read - 1] = '\0';
+			}
+			if (slurm_strcasestr(entry, "CCM_QUEUES") == 0) {
+				continue;
+			}
+			/* Ignore a comment line */
+			if (sscanf(entry, " %1[""#""]", extra) == 1) {
+				continue;
+			}
+			num_ents = _parse_ccm_config(entry,
+						     ccm_config->ccm_partition);
+			if (num_ents <= 0) {
+				snprintf(err_buf, sizeof(err_buf),
+					 "CCM bad CCM_QUEUES %s in %s\n",
+					 entry, CCM_CONF_PATH);
+				err_mesg = err_buf;
+				free(entry);
+				return err_mesg;
+			}
+			ccm_config->num_ccm_partitions = num_ents;
+			break;
+		}
+	}
+	debug2("CCM _get_ccm_partition num_ents %d",
+	       ccm_config->num_ccm_partitions);
+	if (ccm_config->num_ccm_partitions > 0) {
+		for (i = 0; i < ccm_config->num_ccm_partitions; i++) {
+			debug2("CCM ccm_config->ccm_partition[%d] %s", i,
+			       ccm_config->ccm_partition[i]);
+		}
+	}
+	free(entry);
+	return err_mesg;
+}
+
+/*
+ * Parse the CCM_QUEUES entry within the CCM config file.
+ * CCM_QUEUES value is a string containing one or more partition names,
+ * such as CCM_QUEUES="ccm_queue, ccm_queue_2"
+ *
+ * Upon success, the ccm_partitions array is filled in and the
+ * number of partition names is returned.  For any error, -1 is returned.
+ */
+static int _parse_ccm_config(char *entry, char **ccm_partition)
+{
+	int num_ents = -1, i = 0, token_sz = 0;
+	char *part_list, *token, *saveptr, *tmp;
+	char const *delims = " \t\n\v\f\r,"; /* whitespace + comma */
+
+	part_list = NULL;
+	/* Find start of tokens indicated by first " */
+	part_list = (strchr(entry, '"'));
+	if (part_list == NULL) {
+		debug("CCM part_list invalid config entry %s", entry);
+		return num_ents;
+	}
+	/* Move past initial " and ignore anything after the end matching " */
+	tmp = strchr(part_list + 1, '"');
+	if (tmp == NULL) {
+		debug("CCM tmp invalid config entry %s", part_list + 1);
+		return num_ents;
+	}
+	*tmp = '\0';
+	token = strtok_r(part_list + 1, delims, &saveptr);
+	while ((token != NULL) && (i < CCM_PARTITION_MAX)) {
+		token_sz = strlen(token);
+		/* Strip off an ending " */
+		if (token[token_sz - 1] == '"') {
+			token[token_sz - 1] = '\0';
+		}
+		if (strlen(token) > 0) {
+			ccm_partition[i] =
+				xmalloc((token_sz + 1) * sizeof(char));
+			strcpy(ccm_partition[i], token);
+			i++;
+		}
+		token = strtok_r(NULL, delims, &saveptr);
+	}
+	num_ents = i;
+	return num_ents;
+}
+
+/*
+ * Free the malloc'd fields within a ccm_info structure.
+ */
+static void _free_ccm_info(ccm_info_t *ccm_info)
+{
+	xfree(ccm_info->cpu_count_reps);
+	xfree(ccm_info->cpus_per_node);
+	xfree(ccm_info->nodelist);
+	return;
+}
+
+/*
+ * Take an input string of hostnames (i.e. nid00050) and convert that string
+ * into an array of integers (i.e. 50).  For success, returns an integer array;
+ * for an error, returns NULL.  For success, nid_cnt is set to the number of
+ * array entries; otherwise, nid_cnt is set to -1.
+ */
+static int * _ccm_convert_nodelist(char *nodelist, int *nid_cnt)
+{
+	hostlist_t hl;
+	int i, cnt = -1, *nid_array = NULL;
+	char *nidname, *nidstr = NULL;
+
+	if (!(hl = hostlist_create(nodelist))) {
+		CRAY_ERR("CCM hostlist_create error on %s", nodelist);
+		return NULL;
+	}
+	if (!(cnt = hostlist_count(hl))) {
+		CRAY_ERR("CCM nodelist %s hostlist_count cnt %d",
+			 nodelist, cnt);
+		hostlist_destroy(hl);
+		return NULL;
+	}
+	i = 0;
+	nid_array = xmalloc(cnt * sizeof(int32_t));
+	while ((nidname = hostlist_shift(hl))) {
+		if (!(nidstr = strpbrk(nidname, "0123456789"))) {
+			CRAY_ERR("CCM unexpected format nidname %s", nidname);
+			free(nidname);
+			xfree(nid_array);
+			hostlist_destroy(hl);
+			return NULL;
+		}
+		nid_array[i++] = atoi(nidstr);
+		free(nidname);
+	}
+	hostlist_destroy(hl);
+
+	*nid_cnt = cnt;
+	return nid_array;
+}
+
+/*
+ * Create a unique nidlist file.  The file name is returned or
+ * NULL for any error.  For success, the assigned fd is returned; otherwise,
+ * uniq_fd is set to -1.  The caller is responsible to free the returned
+ * file name.
+ */
+static char * _ccm_create_unique_file(char *uniqnm, int *uniq_fd,
+				      ccm_info_t *ccm_info)
+{
+	int fd = -1;
+	char *tmpfilenm = NULL;
+
+	/*
+	 * Create a unique temp file; name of the file will be passed
+	 * in an env variable to the CCM prolog/epilog.
+	 */
+	*uniq_fd = -1;
+	tmpfilenm = xstrdup(uniqnm);
+	fd = mkstemp(tmpfilenm);
+	if (fd < 0) {
+		CRAY_ERR("CCM job %u unable to mkstemp %s, %m",
+			 ccm_info->job_id, uniqnm);
+	} else if ((fchmod(fd, 0644)) < 0) {
+		CRAY_ERR("CCM job %u file %s, fd %d, fchmod error, %m",
+			 ccm_info->job_id, uniqnm, fd);
+		close(fd);
+		fd = -1;
+	}
+	if (fd < 0) {
+		xfree(tmpfilenm);
+	} else {
+		*uniq_fd = fd;
+	}
+	return tmpfilenm;
+}
+
+/*
+ * Fill in a nodelist file with one nid entry per PE (exec'd app process).
+ * For 2 PEs running on nid 36 and 1 on nid 100, the file contents are:
+ * 36
+ * 36
+ * 100
+ *
+ * The name of the unique nodelist file is returned; NULL is returned
+ * for any error.  The caller is responsible to free the returned file name.
+ */
+static char *_ccm_create_nidlist_file(ccm_info_t *ccm_info)
+{
+	int i, j, fd = -1, nodecnt = 0, *nodes = NULL;
+	char *unique_filenm = NULL;
+	FILE *tmp_fp = NULL;
+	slurm_step_layout_t *step_layout = NULL;
+
+	/*
+	 * Create a unique temp file; name of the file will be passed
+	 * in an env variable to the CCM prolog/epilog.
+	 */
+	unique_filenm = _ccm_create_unique_file(CCM_CRAY_UNIQUE_FILENAME, &fd,
+						ccm_info);
+	if (!unique_filenm) {
+		return NULL;
+	}
+	if ((tmp_fp = fdopen(fd, "w")) == NULL) {
+		CRAY_ERR("CCM job %u file %s, fd %d, fdopen error %m",
+			 ccm_info->job_id, unique_filenm, fd);
+		close(fd);
+		xfree(unique_filenm);
+		return NULL;
+	}
+	/* Convert the nodelist into an array of nids */
+	nodes = _ccm_convert_nodelist(ccm_info->nodelist, &nodecnt);
+	debug("CCM job %u nodelist %s, nodecnt %d", ccm_info->job_id,
+	      ccm_info->nodelist, nodecnt);
+	if (!nodes) {
+		fclose(tmp_fp);
+		xfree(unique_filenm);
+		return NULL;
+	}
+	for (i = 0; i < nodecnt; i++) {
+		debug3("CCM job %u nodes[%d] is %d",
+		       ccm_info->job_id, i, nodes[i]);
+	}
+	/* Determine how many PEs(tasks) will be run on each node */
+	step_layout = slurm_step_layout_create(ccm_info->nodelist,
+					       ccm_info->cpus_per_node,
+					       ccm_info->cpu_count_reps,
+					       ccm_info->node_cnt,
+					       ccm_info->num_tasks,
+					       ccm_info->cpus_per_task,
+					       ccm_info->task_dist,
+					       ccm_info->plane_size);
+	if (!step_layout) {
+		CRAY_ERR("CCM job %u slurm_step_layout_create failure",
+			 ccm_info->job_id);
+		fclose(tmp_fp);
+		xfree(unique_filenm);
+		xfree(nodes);
+		return NULL;
+	}
+	debug2("CCM job %u step_layout node_cnt %d", ccm_info->job_id,
+	       step_layout->node_cnt);
+	/* Fill in the nodelist file with an entry per PE */
+	for (i = 0; i < step_layout->node_cnt; i++) {
+		debug2("CCM job %u step_layout nodes[%d] %d, tasks[%d] %d",
+		       ccm_info->job_id, i, nodes[i], i,
+		       step_layout->tasks[i]);
+		for (j = 0; j < step_layout->tasks[i]; j++) {
+			fprintf(tmp_fp, "%d\n", nodes[i]);
+			debug3("CCM job %u nodelist file step tasks[%d] %d, "
+			       "j %d nodes[%d] %d", ccm_info->job_id, i,
+			       step_layout->tasks[i], j, i, nodes[i]);
+		}
+	}
+	slurm_step_layout_destroy(step_layout);
+	fclose(tmp_fp);
+	xfree(nodes);
+	debug2("CCM job %u unique_filemn %s", ccm_info->job_id, unique_filenm);
+	return unique_filenm;
+}
+
+/*
+ * Set up the appropriate environment to run the CCM prolog and epilog
+ * scripts.  Fork a child to exec the script; wait for the child to complete.
+ * Return value of kill so caller can decide what further action to take.
+ */
+static int _run_ccm_prolog_epilog(ccm_info_t *ccm_info, char *ccm_type,
+				  const char *ccm_script)
+{
+	int cpid, ret, status, wait_rc, kill = 1;
+	char strval[128], *nid_list_file = NULL;
+	const char *argv[4];
+	DEF_TIMERS;
+
+	START_TIMER;
+	if (!xstrcasecmp(ccm_type, "prolog")) {
+		nid_list_file = _ccm_create_nidlist_file(ccm_info);
+		if (nid_list_file == NULL) {
+			CRAY_ERR("CCM job %u unable to create nidlist file",
+				 ccm_info->job_id);
+			return kill;
+		}
+	}
+	/* Fork a child to exec the CCM script */
+	cpid = fork();
+	if (cpid < 0) {
+		CRAY_ERR("CCM job %u %s fork failed, %m", ccm_info->job_id,
+			 ccm_type);
+		if (nid_list_file) {
+			ret = unlink(nid_list_file);
+			if (ret == -1) {
+				CRAY_ERR("CCM job %u unable to unlink %s",
+					 ccm_info->job_id, nid_list_file);
+			}
+			xfree(nid_list_file);
+		}
+		return kill;
+	} else if (cpid == 0) {
+		/* child */
+		setsid();
+		setpgid(0, 0);
+		snprintf(strval, sizeof(strval), "%u", ccm_info->job_id);
+		setenv("ALPS_PREP_BATCHID", strval, 1);
+		snprintf(strval, sizeof(strval), "%u", ccm_info->user_id);
+		setenv("ALPS_PREP_UID", strval, 1);
+		if (nid_list_file) {
+			setenv("ALPS_PREP_NIDFILE",
+			       (const char *)nid_list_file, 1);
+		}
+		argv[0] = "sh";
+		argv[1] = "-c";
+		argv[2] = ccm_script;
+		argv[3] = NULL;
+		debug("CCM job %u invoking %s %s", ccm_info->job_id, ccm_type,
+		      ccm_script);
+		execv("/bin/sh", (char *const *)argv);
+		CRAY_ERR("CCM job %u %s %s execv failed, %m",
+			 ccm_info->job_id, ccm_type, ccm_script);
+		exit(127);
+	} else {
+		/* parent */
+		while (1) {
+			wait_rc = waitpid(cpid, &status, 0);
+			if (wait_rc > 0) {
+				if (WIFEXITED(status)) {
+					ret = WEXITSTATUS(status);
+					if (ret != 0) {
+						info("CCM job %u %s waitpid "
+						     "ret %d",
+						     ccm_info->job_id,
+						     ccm_type, ret);
+					} else {
+						kill = 0;
+					}
+				} else if (WIFSIGNALED(status)) {
+					info("CCM job %u %s received "
+					     "signal %d", ccm_info->job_id,
+					     ccm_type, WTERMSIG(status));
+				} else {
+					/* Success */
+					kill = 0;
+				}
+				break;
+			} else if (wait_rc < 0) {
+				if (errno == EINTR) {
+					continue;
+				}
+				CRAY_ERR("CCM job %u %s waitpid error %m",
+					 ccm_info->job_id, ccm_type);
+				break;
+			}
+		}
+		if (nid_list_file) {
+			ret = unlink(nid_list_file);
+			if (ret == -1) {
+				info("CCM job %u unable to unlink %s, %m",
+				     ccm_info->job_id, nid_list_file);
+			}
+			xfree(nid_list_file);
+		}
+	}
+	END_TIMER;
+	debug("CCM job %u %s completed in %s", ccm_info->job_id, ccm_type,
+	      TIME_STR);
+	return kill;
+}
+
+/*
+ * Get the CCM configuration information.
+ *
+ */
+extern void ccm_get_config()
+{
+	char *err_msg = NULL, *ccm_env;
+
+	/* Alternate paths for testing purposes */
+	ccm_env = getenv("CCM_PROLOG");
+	if (ccm_env) {
+		ccm_prolog_path = xstrdup(ccm_env);
+	} else {
+		ccm_prolog_path = xstrdup(CCM_PROLOG_PATH);
+	}
+	ccm_env = getenv("CCM_EPILOG");
+	if (ccm_env) {
+		ccm_epilog_path = xstrdup(ccm_env);
+	} else {
+		ccm_epilog_path = xstrdup(CCM_EPILOG_PATH);
+	}
+	ccm_config.ccm_enabled = 0;
+	err_msg = _get_ccm_partition(&ccm_config);
+	if (err_msg) {
+		info("CCM ssh launch disabled, %s", err_msg);
+	} else {
+		if (ccm_config.num_ccm_partitions > 0) {
+			ccm_config.ccm_enabled = 1;
+			info("CCM prolog %s, epilog %s",
+			     ccm_prolog_path, ccm_epilog_path);
+		}
+	}
+	return;
+}
+
+/*
+ * Create a detached pthread to handle CCM prolog and epilog
+ * activities.  This is only called if CCM is enabled and the batch job has
+ * been identified as coming from a CCM partition.
+ */
+extern void spawn_ccm_thread(
+	void *obj_ptr, void *(*start_routine) (void *))
+{
+	pthread_attr_t attr_agent;
+	pthread_t thread_agent;
+	int retries;
+	struct job_record *job_ptr = (struct job_record *)obj_ptr;
+
+	/* spawn a pthread to start CCM prolog or epilog activities */
+	slurm_attr_init(&attr_agent);
+	if (pthread_attr_setdetachstate(&attr_agent, PTHREAD_CREATE_DETACHED)) {
+		CRAY_ERR("CCM job %u pthread_attr_setdetachstate error %m",
+			 job_ptr->job_id);
+	}
+	retries = 0;
+	while (pthread_create(&thread_agent, &attr_agent,
+			      start_routine, obj_ptr)) {
+		CRAY_ERR("CCM job_id %u pthread_create error %m",
+			 job_ptr->job_id);
+		if (++retries > CCM_MAX_PTHREAD_RETRIES) {
+			if (!xstrcasecmp((char *)start_routine, "ccm_begin")) {
+				/* Decrement so job launch can continue */
+				debug("CCM job %u prolog_running_decr, cur %d",
+				      job_ptr->job_id,
+				      job_ptr->details->prolog_running);
+				prolog_running_decr(job_ptr);
+			}
+			fatal("CCM job %u _spawn_ccm_thread can't create "
+			      "pthread", job_ptr->job_id);
+		}
+		usleep(100000);	/* sleep 1/10th second and retry */
+	}
+	slurm_attr_destroy(&attr_agent);
+	return;
+}
+
+/*
+ * Check if this batch job is being started from a CCM partition.
+ * Returns 1 if so, otherwise 0.
+ */
+extern int ccm_check_partitions(struct job_record *job_ptr)
+{
+	int i, ccm_partition;
+	char *partition = NULL;
+
+	ccm_partition = 0;
+	partition = job_ptr->partition;
+	debug2("CCM job %u ccm_check_partitions partition %s",
+	       job_ptr->job_id, partition);
+	for (i = 0; i < ccm_config.num_ccm_partitions; i++) {
+		if (!xstrcasecmp(partition, ccm_config.ccm_partition[i])) {
+			ccm_partition = 1;
+			break;
+		}
+	}
+	return ccm_partition;
+}
+
+/*
+ * As applicable, this is run at batch job start to gather info for the
+ * CCM prolog activities.  If the CCM prolog fails, the job will be
+ * killed.
+ */
+extern void *ccm_begin(void *args)
+{
+	int i, j, num_ents, kill = 1;
+	size_t copysz;
+	ccm_info_t ccm_info;
+	char err_str_buf[128], srun_msg_buf[256];
+	struct job_record *job_ptr = (struct job_record *)args;
+	slurmctld_lock_t job_read_lock =
+		{NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
+
+	debug2("CCM job %u_ccm_begin partition %s", job_ptr->job_id,
+	       job_ptr->partition);
+	memset(&ccm_info, 0, sizeof(ccm_info_t));
+
+	lock_slurmctld(job_read_lock);
+
+	ccm_info.job_id = job_ptr->job_id;
+	ccm_info.user_id = job_ptr->user_id;
+	ccm_info.nodelist = xstrdup(job_ptr->nodes);
+	ccm_info.node_cnt = job_ptr->node_cnt;
+	ccm_info.cpus_per_task = job_ptr->details->cpus_per_task;
+	if (ccm_info.cpus_per_task == 0) {
+		ccm_info.cpus_per_task = 1;
+	}
+	ccm_info.num_cpu_groups = job_ptr->job_resrcs->cpu_array_cnt;
+	copysz = ccm_info.num_cpu_groups * sizeof(uint16_t);
+	ccm_info.cpus_per_node = xmalloc(copysz);
+	memcpy(ccm_info.cpus_per_node, job_ptr->job_resrcs->cpu_array_value,
+	       copysz);
+	copysz = ccm_info.num_cpu_groups * sizeof(uint32_t);
+	ccm_info.cpu_count_reps = xmalloc(copysz);
+	memcpy(ccm_info.cpu_count_reps, job_ptr->job_resrcs->cpu_array_reps,
+	       copysz);
+	ccm_info.num_tasks = job_ptr->details->num_tasks;
+	if (ccm_info.num_tasks == 0) {
+		ccm_info.num_tasks =
+			job_ptr->cpu_cnt / ccm_info.cpus_per_task;
+		debug("CCM job %u ccm_info.num_tasks was 0; now %d",
+		      job_ptr->job_id, ccm_info.num_tasks);
+	}
+	/*
+	 * When task_dist is set to PLANE, the plane_size is still 0.
+	 * This causes a failure later with the slurm_step_layout_create()
+	 * call.  Both task_dist and plane_size are arguments to that
+	 * procedure call used to get the number of tasks for each node.
+	 * I don't think either value impacts that, but leave this code
+	 * here.
+	 */
+	if ((job_ptr->details->task_dist == 0) ||
+	    (job_ptr->details->task_dist > SLURM_DIST_UNKNOWN) ||
+	    (job_ptr->details->task_dist == SLURM_DIST_PLANE)) {
+		ccm_info.task_dist = SLURM_DIST_BLOCK;
+		debug("CCM job %u job task_dist %d, CCM using SLURM_DIST_BLOCK",
+		      job_ptr->job_id, job_ptr->details->task_dist);
+	} else {
+		ccm_info.task_dist = job_ptr->details->task_dist;
+	}
+	ccm_info.plane_size = job_ptr->details->plane_size;
+	unlock_slurmctld(job_read_lock);
+
+	debug("CCM job %u, user_id %u, nodelist %s, node_cnt %d, "
+	      "num_tasks %d", ccm_info.job_id, ccm_info.user_id,
+	      ccm_info.nodelist, ccm_info.node_cnt, ccm_info.num_tasks);
+	debug("CCM job %u cpus_per_task %d, task_dist %u, plane_size %d",
+	      ccm_info.job_id, ccm_info.cpus_per_task, ccm_info.task_dist,
+	      ccm_info.plane_size);
+	for (i = num_ents = 0; i < ccm_info.num_cpu_groups; i++) {
+		for (j = 0; j < ccm_info.cpu_count_reps[i]; j++) {
+			debug3("CCM job %u cpus_per_node[%d] %d, i %d, j %d",
+			       ccm_info.job_id, num_ents,
+			       ccm_info.cpus_per_node[i], i, j);
+			num_ents++;
+		}
+	}
+	if (ccm_info.node_cnt != num_ents) {
+		CRAY_ERR("CCM job %u ccm_info.node_cnt %d doesn't match the "
+			 "number of cpu_count_reps entries %d",
+			 job_ptr->job_id, ccm_info.node_cnt, num_ents);
+		snprintf(err_str_buf, sizeof(err_str_buf),
+			 "node_cnt %d != cpu_count_reps %d, prolog not run",
+			 ccm_info.node_cnt, num_ents);
+	} else {
+		kill = _run_ccm_prolog_epilog(&ccm_info, "prolog",
+					      ccm_prolog_path);
+		snprintf(err_str_buf, sizeof(err_str_buf),
+			 "prolog failed");
+	}
+	debug("CCM ccm_begin job %u prolog_running_decr, cur %d",
+	      ccm_info.job_id, job_ptr->details->prolog_running);
+	prolog_running_decr(job_ptr);
+	if (kill) {
+		/* Stop the launch */
+		CRAY_ERR("CCM %s, job %u killed", err_str_buf, job_ptr->job_id);
+		snprintf(srun_msg_buf, sizeof(srun_msg_buf),
+			 "CCM %s, job %u killed", err_str_buf, ccm_info.job_id);
+		srun_user_message(job_ptr, srun_msg_buf);
+		(void) job_signal(job_ptr->job_id, SIGKILL, 0, 0, false);
+	}
+	/* Free the malloc'd fields within this structure */
+	_free_ccm_info(&ccm_info);
+	return NULL;
+}
+
+/*
+ * As applicable, this is run at batch job exit to provide info for the
+ * CCM epilog activities.  The epilog only needs the job id and user id.
+ * If the CCM prolog is still executing, delay starting the CCM epilog
+ * to prevent bad interactions between the two.  Delay up to
+ * CCM_MAX_EPILOG_DELAY seconds.
+ */
+extern void *ccm_fini(void *args)
+{
+	int rc;
+	ccm_info_t ccm_info;
+	time_t delay;
+	struct job_record *job_ptr = (struct job_record *)args;
+	slurmctld_lock_t job_read_lock =
+		{NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
+
+	memset(&ccm_info, 0, sizeof(ccm_info_t));
+	lock_slurmctld(job_read_lock);
+
+	ccm_info.job_id = job_ptr->job_id;
+	ccm_info.user_id = job_ptr->user_id;
+
+	unlock_slurmctld(job_read_lock);
+	/*
+	 * Delay starting the CCM epilog if the CCM prolog may still be
+	 * running.
+	 */
+	if (job_ptr->details && (job_ptr->details->prolog_running > 0)) {
+		delay = time(0) + CCM_MAX_EPILOG_DELAY;
+		info("CCM job %u epilog delayed; prolog_running %d",
+		     ccm_info.job_id, job_ptr->details->prolog_running);
+		while (job_ptr->details->prolog_running > 0) {
+			usleep(100000);
+			if (time(0) >= delay) {
+				info("CCM job %u epilog max delay; "
+				     "running epilog", ccm_info.job_id);
+				break;
+			}
+		}
+	}
+	debug2("CCM epilog job %u, user_id %u", ccm_info.job_id,
+	       ccm_info.user_id);
+	rc = _run_ccm_prolog_epilog(&ccm_info, "epilog", ccm_epilog_path);
+	if (rc) {
+		/* Log a failure, no further action to take */
+		CRAY_ERR("CCM job %u epilog failed", ccm_info.job_id);
+	}
+	return NULL;
+}
diff --git a/src/plugins/select/cray/ccm.h b/src/plugins/select/cray/ccm.h
new file mode 100644
index 000000000..69f529fa2
--- /dev/null
+++ b/src/plugins/select/cray/ccm.h
@@ -0,0 +1,106 @@
+/*****************************************************************************\
+ *  ccm.h
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC
+ *  Copyright 2016 Cray Inc. All Rights Reserved.
+ *  Written by Marlys Kohnke
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#ifndef SELECT_CRAY_CCM_H
+#define SELECT_CRAY_CCM_H
+
+#include "src/common/slurm_xlator.h"
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#  if HAVE_STDINT_H
+#    include <stdint.h>
+#  endif
+#  if HAVE_INTTYPES_H
+#    include <inttypes.h>
+#  endif
+#  if WITH_PTHREADS
+#    include <pthread.h>
+#  endif
+#endif
+
+/* CCM use */
+#include <string.h>
+#include "src/slurmctld/job_scheduler.h"
+#include "src/slurmctld/srun_comm.h"
+
+/*
+ * CCM will be used to provide app ssh launch using the Cray network
+ * interconnect.
+ */
+#define CCM_MAX_EPILOG_DELAY	30
+#define CCM_MAX_PTHREAD_RETRIES  6
+#define CCM_PARTITION_MAX	32
+#define CCM_CRAY_UNIQUE_FILENAME  "/tmp/crayCCMXXXXXX"
+#define CCM_PROLOG_PATH		"/opt/cray/ccm/default/etc/ccm-prologue"
+#define CCM_EPILOG_PATH		"/opt/cray/ccm/default/etc/ccm-epilogue"
+#define CCM_CONF_PATH           "/etc/opt/cray/ccm/ccm.conf"
+
+typedef struct {
+	char *ccm_partition[CCM_PARTITION_MAX];
+	int num_ccm_partitions;
+	int ccm_enabled;
+} ccm_config_t;
+
+extern ccm_config_t ccm_config;
+extern const char *ccm_prolog_path;
+extern const char *ccm_epilog_path;
+
+
+typedef struct {
+	uint32_t  job_id;
+	uint32_t  user_id;
+	uint32_t  node_cnt;		/* Number of allocated nodes */
+	uint32_t  num_tasks;		/* Number of app PEs/tasks to exec */
+	uint32_t  num_cpu_groups;	/* Number of entries in cpus arrays */
+	uint32_t *cpu_count_reps;	/* Number of reps of each cpu count */
+	uint16_t *cpus_per_node;	/* Number of cpus per node */
+	uint16_t  cpus_per_task;	/* Number of cpus per app task/PE */
+	uint16_t  task_dist;
+	uint16_t  plane_size;
+	char    *nodelist;		/* Allocated node hostname list */
+} ccm_info_t;
+
+#define CRAY_ERR(fmt, ...) error("(%s: %d: %s) "fmt, THIS_FILE, __LINE__, \
+				 __FUNCTION__, ##__VA_ARGS__);
+
+extern void ccm_get_config();
+extern void spawn_ccm_thread(void *obj_ptr, void *(*start_routine) (void *));
+extern int ccm_check_partitions(struct job_record *job_ptr);
+extern void *ccm_begin(void *args);
+extern void *ccm_fini(void *args);
+
+#endif /* CRAY_SELECT_CCM_H */
diff --git a/src/plugins/select/cray/select_cray.c b/src/plugins/select/cray/select_cray.c
index f45703e7c..03449e866 100644
--- a/src/plugins/select/cray/select_cray.c
+++ b/src/plugins/select/cray/select_cray.c
@@ -37,19 +37,6 @@
 
 #define _GNU_SOURCE 1
 
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#  if HAVE_STDINT_H
-#    include <stdint.h>
-#  endif
-#  if HAVE_INTTYPES_H
-#    include <inttypes.h>
-#  endif
-#  if WITH_PTHREADS
-#    include <pthread.h>
-#  endif
-#endif
-
 #include <stdio.h>
 #include <poll.h>
 #include <sys/types.h>
@@ -60,9 +47,11 @@
 
 #include "src/common/slurm_xlator.h"	/* Must be first */
 #include "src/common/pack.h"
+#include "src/common/slurm_accounting_storage.h"
 #include "src/slurmctld/burst_buffer.h"
 #include "src/slurmctld/locks.h"
 #include "other_select.h"
+#include "ccm.h"
 
 #ifdef HAVE_NATIVE_CRAY
 #include "alpscomm_sn.h"
@@ -72,8 +61,9 @@
 #define CLEANING_STARTED	0x0001
 #define CLEANING_COMPLETE	0x0002
 
-#define IS_CLEANING(_X) (_X->cleaning & CLEANING_STARTED)
-#define IS_CLEANED(_X)  (_X->cleaning & CLEANING_COMPLETE)
+#define IS_CLEANING_INIT(_X)		(_X->cleaning == CLEANING_INIT)
+#define IS_CLEANING_STARTED(_X)		(_X->cleaning & CLEANING_STARTED)
+#define IS_CLEANING_COMPLETE(_X)	(_X->cleaning & CLEANING_COMPLETE)
 
 /**
  * struct select_jobinfo - data specific to Cray node selection plugin
@@ -105,9 +95,9 @@ struct select_nodeinfo {
 typedef struct {
 	uint64_t apid;
 	uint32_t exit_code;
+	bool is_step;	/* true if step, false if job */
 	uint32_t jobid;
 	char *nodelist;
-	bool step;
 	uint32_t user_id;
 } nhc_info_t;
 
@@ -146,6 +136,7 @@ struct node_record *node_record_table_ptr __attribute__((weak_import));
 int node_record_count __attribute__((weak_import));
 time_t last_node_update __attribute__((weak_import));
 int slurmctld_primary __attribute__((weak_import));
+void *acct_db_conn  __attribute__((weak_import)) = NULL;
 #else
 slurmctld_config_t slurmctld_config;
 slurm_ctl_conf_t slurmctld_conf;
@@ -155,6 +146,7 @@ struct node_record *node_record_table_ptr;
 int node_record_count;
 time_t last_node_update;
 int slurmctld_primary;
+void *acct_db_conn = NULL;
 #endif
 
 static blade_info_t *blade_array = NULL;
@@ -245,7 +237,7 @@ static uint64_t debug_flags = 0;
  */
 const char plugin_name[]	= "Cray node selection plugin";
 const char plugin_type[]	= "select/cray";
-uint32_t plugin_id		= 107;
+uint32_t plugin_id		= SELECT_PLUGIN_CRAY_LINEAR;
 const uint32_t plugin_version	= SLURM_VERSION_NUMBER;
 
 extern int select_p_select_jobinfo_free(select_jobinfo_t *jobinfo);
@@ -259,8 +251,8 @@ static int _run_nhc(nhc_info_t *nhc_info)
 	int argc = 13, status = 1, wait_rc, i = 0;
 	char *argv[argc];
 	pid_t cpid;
-	char *jobid_char = NULL, *apid_char = NULL, *nodelist_nids = NULL,
-		*exit_char = NULL, *user_char = NULL;
+	char *jobid_char = NULL, *apid_char = NULL, *nodelist_nids = NULL;
+	char *exit_char = NULL, *user_char = NULL;
 	DEF_TIMERS;
 
 	START_TIMER;
@@ -281,12 +273,12 @@ static int _run_nhc(nhc_info_t *nhc_info)
 	argv[i++] = "-u";
 	argv[i++] = user_char;
 	argv[i++] = "-m";
-	argv[i++] = nhc_info->step ? "application" : "reservation";
+	argv[i++] = nhc_info->is_step ? "application" : "reservation";
 	argv[i++] = nodelist_nids;
 	argv[i++] = NULL;
 
 	if (debug_flags & DEBUG_FLAG_SELECT_TYPE) {
-		if (nhc_info->step)
+		if (nhc_info->is_step)
 			info("Calling NHC for jobid %u and apid %"PRIu64" "
 			     "on nodes %s(%s) exit code %u",
 			     nhc_info->jobid, nhc_info->apid,
@@ -336,7 +328,8 @@ static int _run_nhc(nhc_info_t *nhc_info)
 		      "status %u:%u took: %s",
 		      nhc_info->jobid, nhc_info->apid, WEXITSTATUS(status),
 		      WTERMSIG(status), TIME_STR);
-	} else if ((debug_flags & DEBUG_FLAG_SELECT_TYPE) ||
+	} else if ((debug_flags &
+		    (DEBUG_FLAG_SELECT_TYPE | DEBUG_FLAG_TIME_CRAY)) ||
 		   (DELTA_TIMER > 60000000)) {	/* log if over one minute */
 		info("_run_nhc jobid %u and apid %"PRIu64" completion took: %s",
 		     nhc_info->jobid, nhc_info->apid, TIME_STR);
@@ -355,16 +348,33 @@ fini:
 	return 0;
 
 #else
-	if (debug_flags & DEBUG_FLAG_SELECT_TYPE)
-		info("simluating calling NHC for jobid %u "
-		     "and apid %"PRIu64" on nodes %s",
-		     nhc_info->jobid, nhc_info->apid, nhc_info->nodelist);
+	if (debug_flags & DEBUG_FLAG_SELECT_TYPE) {
+		if (nhc_info->is_step) {
+			info("simulating call to NHC for step %u.%u "
+			     "and apid %"PRIu64" on nodes %s",
+			     nhc_info->jobid,
+			     SLURM_ID_HASH_STEP_ID(nhc_info->apid),
+			     nhc_info->apid, nhc_info->nodelist);
+		} else {
+			info("simulating call to NHC for job %u "
+			     "and apid %"PRIu64" on nodes %s",
+			     nhc_info->jobid, nhc_info->apid,
+			     nhc_info->nodelist);
+		}
+	}
 
 	/* simulate sleeping */
 	sleep(1);
 	if (debug_flags & DEBUG_FLAG_SELECT_TYPE) {
-		info("_run_nhc jobid %u and apid %"PRIu64" completed",
-		     nhc_info->jobid, nhc_info->apid);
+		if (nhc_info->is_step) {
+			info("NHC for step %u.%u and apid %"PRIu64" completed",
+			     nhc_info->jobid,
+			     SLURM_ID_HASH_STEP_ID(nhc_info->apid),
+			     nhc_info->apid);
+		} else {
+			info("NHC for job %u and apid %"PRIu64" completed",
+			     nhc_info->jobid, nhc_info->apid);
+		}
 	}
 
 	return 0;
@@ -377,17 +387,17 @@ fini:
  */
 static void _aeld_cleanup(void)
 {
-	aeld_running = 0;
-
 	// Free any used memory
-	pthread_mutex_lock(&aeld_mutex);
+	slurm_mutex_lock(&aeld_mutex);
 	_clear_event_list(app_list, &app_list_size);
 	app_list_capacity = 0;
 	xfree(app_list);
 	_clear_event_list(event_list, &event_list_size);
 	event_list_capacity = 0;
 	xfree(event_list);
-	pthread_mutex_unlock(&aeld_mutex);
+	slurm_mutex_unlock(&aeld_mutex);
+
+	aeld_running = 0;
 }
 
 /*
@@ -437,13 +447,13 @@ static void _start_session(alpsc_ev_session_t **session, int *sessionfd)
 	char *errmsg;
 
 	while (1) {
-		pthread_mutex_lock(&aeld_mutex);
+		slurm_mutex_lock(&aeld_mutex);
 
 		// Create the session
 		rv = alpsc_ev_create_session(&errmsg, session, app_list,
 					     app_list_size);
 
-		pthread_mutex_unlock(&aeld_mutex);
+		slurm_mutex_unlock(&aeld_mutex);
 
 		if (rv) {
 			_handle_aeld_error("alpsc_ev_create_session",
@@ -488,6 +498,7 @@ static void *_aeld_event_loop(void *args)
 	alpsc_ev_session_t *session = NULL;
 	struct pollfd fds[1];
 	char *errmsg;
+	DEF_TIMERS;
 
 	debug("cray: %s", __func__);
 
@@ -504,6 +515,8 @@ static void *_aeld_event_loop(void *args)
 	fds[0].events = POLLIN | POLLPRI | POLLRDHUP;
 	while ((rv = TEMP_FAILURE_RETRY(poll(fds, 1, AELD_EVENT_INTERVAL)))
 	       != -1) {
+		START_TIMER;
+
 		// There was activity on the file descriptor, get state
 		if (rv > 0) {
 			rv = alpsc_ev_get_session_state(&errmsg, session);
@@ -525,7 +538,7 @@ static void *_aeld_event_loop(void *args)
 		}
 
 		// Process the event list
-		pthread_mutex_lock(&aeld_mutex);
+		slurm_mutex_lock(&aeld_mutex);
 		if (event_list_size > 0) {
 			// Send event list to aeld
 			rv = alpsc_ev_set_application_info(&errmsg, session,
@@ -534,21 +547,32 @@ static void *_aeld_event_loop(void *args)
 
 			// Clear the event list
 			_clear_event_list(event_list, &event_list_size);
-			pthread_mutex_unlock(&aeld_mutex);
-			if (rv > 0) {
+			slurm_mutex_unlock(&aeld_mutex);
+			/*
+			 * For this application info call, some errors do
+			 * not require exiting the current session and
+			 * creating a new session.
+			 */
+			if (rv > 2) {
 				_handle_aeld_error(
 					"alpsc_ev_set_application_info",
 					errmsg, rv, &session);
 				_start_session(&session, &sessionfd);
 				fds[0].fd = sessionfd;
+			} else if ((rv == 1) || (rv == 2)) {
+				error("alpsc_ev_set_application_info rv %d, %s",
+				      rv, errmsg);
 			}
 		} else {
-			pthread_mutex_unlock(&aeld_mutex);
+			slurm_mutex_unlock(&aeld_mutex);
 		}
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			END_TIMER3("_aeld_event_loop: took", 20000);
 	}
 
 	error("%s: poll failed: %m", __func__);
 	_aeld_cleanup();
+
 	return NULL;
 }
 
@@ -564,6 +588,9 @@ static void _initialize_event(alpsc_ev_app_t *event,
 	hostlist_iterator_t hlit;
 	char *node;
 	int rv;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	event->apid = SLURM_ID_HASH(job_ptr->job_id, step_ptr->step_id);
 	event->uid = job_ptr->user_id;
@@ -604,6 +631,11 @@ static void _initialize_event(alpsc_ev_app_t *event,
 		hostlist_iterator_destroy(hlit);
 		hostlist_destroy(hl);
 	}
+
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	return;
 }
 
@@ -612,21 +644,21 @@ static void _initialize_event(alpsc_ev_app_t *event,
  */
 static void _copy_event(alpsc_ev_app_t *dest, alpsc_ev_app_t *src)
 {
-        dest->apid = src->apid;
-        dest->uid = src->uid;
-        dest->app_name = xstrdup(src->app_name);
-        dest->batch_id = xstrdup(src->batch_id);
-        dest->state = src->state;
-        if (src->num_nodes > 0 && src->nodes != NULL) {
-                dest->nodes = xmalloc(src->num_nodes * sizeof(int32_t));
-                memcpy(dest->nodes, src->nodes,
+	dest->apid = src->apid;
+	dest->uid = src->uid;
+	dest->app_name = xstrdup(src->app_name);
+	dest->batch_id = xstrdup(src->batch_id);
+	dest->state = src->state;
+	if (src->num_nodes > 0 && src->nodes != NULL) {
+		dest->nodes = xmalloc(src->num_nodes * sizeof(int32_t));
+		memcpy(dest->nodes, src->nodes,
 		       src->num_nodes * sizeof(int32_t));
-                dest->num_nodes = src->num_nodes;
-        } else {
-                dest->nodes = NULL;
-                dest->num_nodes = 0;
-        }
-        return;
+		dest->num_nodes = src->num_nodes;
+	} else {
+		dest->nodes = NULL;
+		dest->num_nodes = 0;
+	}
+	return;
 }
 
 /*
@@ -678,6 +710,9 @@ static void _update_app(struct job_record *job_ptr,
 	int32_t i;
 	alpsc_ev_app_t app;
 	int found;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	// If aeld thread isn't running, do nothing
 	if (aeld_running == 0) {
@@ -688,14 +723,15 @@ static void _update_app(struct job_record *job_ptr,
 	_initialize_event(&app, job_ptr, step_ptr, state);
 
 	// If there are no nodes, set_application_info will fail
-	if (app.nodes == NULL || app.num_nodes == 0) {
-		debug("Job %"PRIu32".%"PRIu32" has no nodes, skipping",
-		      job_ptr->job_id, step_ptr->step_id);
+	if ((app.nodes == NULL) || (app.num_nodes == 0) ||
+	    (app.app_name == NULL) || ((app.app_name)[0] == '\0')) {
+		debug("Job %"PRIu32".%"PRIu32" has no nodes or app name, "
+		      "skipping", job_ptr->job_id, step_ptr->step_id);
 		_free_event(&app);
 		return;
 	}
 
-	pthread_mutex_lock(&aeld_mutex);
+	slurm_mutex_lock(&aeld_mutex);
 
 	// Add it to the event list, only if aeld is up
 	if (aeld_running) {
@@ -765,9 +801,14 @@ static void _update_app(struct job_record *job_ptr,
 		break;
 	}
 
-	pthread_mutex_unlock(&aeld_mutex);
+	slurm_mutex_unlock(&aeld_mutex);
 
 	_free_event(&app);
+
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	return;
 }
 
@@ -779,12 +820,16 @@ static void _start_aeld_thread()
 	debug("cray: %s", __func__);
 
 	// Spawn the aeld thread, only in slurmctld.
-	if (run_in_daemon("slurmctld")) {
+	if (!aeld_running && run_in_daemon("slurmctld")) {
 		pthread_attr_t attr;
-
+		aeld_running = 1;
 		slurm_attr_init(&attr);
-		if (pthread_create(&aeld_thread, &attr, _aeld_event_loop, NULL))
+		if (pthread_create(&aeld_thread, &attr, _aeld_event_loop,
+				   NULL)) {
 			error("pthread_create of message thread: %m");
+			aeld_running = 0;
+		}
+
 		slurm_attr_destroy(&attr);
 	}
 }
@@ -800,7 +845,6 @@ static void _stop_aeld_thread()
 
 	pthread_cancel(aeld_thread);
 	pthread_join(aeld_thread, NULL);
-	aeld_running = 0;
 }
 #endif
 
@@ -895,7 +939,7 @@ static void _set_job_running(struct job_record *job_ptr)
 	select_jobinfo_t *jobinfo = job_ptr->select_jobinfo->data;
 	select_nodeinfo_t *nodeinfo;
 
-	for (i=0; i<node_record_count; i++) {
+	for (i = 0; i < node_record_count; i++) {
 		if (!bit_test(job_ptr->node_bitmap, i))
 			continue;
 
@@ -998,12 +1042,10 @@ static void *_job_fini(void *args)
 
 	/* Locks: Write job, write node */
 	slurmctld_lock_t job_write_lock = {
-		NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK
-	};
+		NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK };
 	slurmctld_lock_t job_read_lock = {
 		NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
 
-
 	if (!job_ptr) {
 		error("_job_fini: no job ptr given, this should never happen");
 		return NULL;
@@ -1034,7 +1076,7 @@ static void *_job_fini(void *args)
 		jobinfo = job_ptr->select_jobinfo->data;
 
 		_remove_job_from_blades(jobinfo);
-		jobinfo->cleaning = CLEANING_COMPLETE;
+		jobinfo->cleaning |= CLEANING_COMPLETE;
 	} else
 		error("_job_fini: job %u had a bad magic, "
 		      "this should never happen", nhc_info.jobid);
@@ -1057,63 +1099,71 @@ static void *_step_fini(void *args)
 	slurmctld_lock_t job_read_lock = {
 		NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
 
-
 	if (!step_ptr) {
-		error("_step_fini: no step ptr given, "
-		      "this should never happen");
+		error("%s: no step_ptr given, this should never happen",
+		      __func__);
 		return NULL;
 	}
 
-	memset(&nhc_info, 0, sizeof(nhc_info_t));
-	nhc_info.step = 1;
 	lock_slurmctld(job_read_lock);
+	memset(&nhc_info, 0, sizeof(nhc_info_t));
 	nhc_info.jobid = step_ptr->job_ptr->job_id;
-	nhc_info.apid = SLURM_ID_HASH(step_ptr->job_ptr->job_id,
-				      step_ptr->step_id);
-	nhc_info.exit_code = step_ptr->exit_code;
-	nhc_info.user_id = step_ptr->job_ptr->user_id;
-
-	if (!step_ptr->step_layout || !step_ptr->step_layout->node_list) {
-		if (step_ptr->job_ptr)
-			nhc_info.nodelist = xstrdup(step_ptr->job_ptr->nodes);
-	} else
-		nhc_info.nodelist = xstrdup(step_ptr->step_layout->node_list);
-	unlock_slurmctld(job_read_lock);
-
-	/* run NHC */
-	_run_nhc(&nhc_info);
-	/***********/
+	jobinfo = step_ptr->select_jobinfo->data;
+	if (IS_CLEANING_COMPLETE(jobinfo)) {
+		debug("%s: NHC previously run for step %u.%u",
+		      __func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
+	} else {
+		/* Run application NHC */
+		nhc_info.is_step = true;
+		nhc_info.apid = SLURM_ID_HASH(step_ptr->job_ptr->job_id,
+					      step_ptr->step_id);
+		nhc_info.exit_code = step_ptr->exit_code;
+		nhc_info.user_id = step_ptr->job_ptr->user_id;
+
+		if (!step_ptr->step_layout ||
+		    !step_ptr->step_layout->node_list) {
+			if (step_ptr->job_ptr)
+				nhc_info.nodelist =
+					xstrdup(step_ptr->job_ptr->nodes);
+		} else {
+			nhc_info.nodelist =
+				xstrdup(step_ptr->step_layout->node_list);
+		}
+		unlock_slurmctld(job_read_lock);
 
-	xfree(nhc_info.nodelist);
+		_run_nhc(&nhc_info);
+		xfree(nhc_info.nodelist);
+	}
 
+	/* NHC has completed, release the step's resources */
 	_throttle_start();
 	lock_slurmctld(job_write_lock);
-	if (!step_ptr->job_ptr) {
-		error("For some reason we don't have a job_ptr for "
-		      "APID %"PRIu64".  This should never happen.",
-		      nhc_info.apid);
+	if (!step_ptr->job_ptr ||
+	    (step_ptr->job_ptr->job_id != nhc_info.jobid)) {
+		error("%s: For some reason we don't have a valid job_ptr for "
+		      "job %u APID %"PRIu64".  This should never happen.",
+		      __func__, nhc_info.jobid, nhc_info.apid);
 	} else if (!step_ptr->step_node_bitmap) {
-		error("For some reason we don't have a step_node_bitmap "
-		      "for APID %"PRIu64".  "
+		error("%s: For some reason we don't have a step_node_bitmap "
+		      "for job %u APID %"PRIu64".  "
 		      "If this is at startup and the step's nodes changed "
 		      "this is expected.  Otherwise this should never happen.",
-		      nhc_info.apid);
+		      __func__, nhc_info.jobid, nhc_info.apid);
 
 		/* This should be the only cleanup needed */
 		jobinfo = step_ptr->select_jobinfo->data;
 
 		_remove_step_from_blades(step_ptr);
-		jobinfo->cleaning = CLEANING_COMPLETE;
+		jobinfo->cleaning |= CLEANING_COMPLETE;
 
 		delete_step_record(step_ptr->job_ptr, step_ptr->step_id);
 	} else {
-		other_step_finish(step_ptr);
+		other_step_finish(step_ptr, false);
 
 		jobinfo = step_ptr->select_jobinfo->data;
 
 		_remove_step_from_blades(step_ptr);
-		jobinfo->cleaning = CLEANING_COMPLETE;
-
+		jobinfo->cleaning |= CLEANING_COMPLETE;
 		/* free resources on the job */
 		post_job_step(step_ptr);
 	}
@@ -1123,6 +1173,55 @@ static void *_step_fini(void *args)
 	return NULL;
 }
 
+static void *_step_kill(void *args)
+{
+	struct step_record *step_ptr = (struct step_record *)args;
+	select_jobinfo_t *jobinfo = NULL;
+	nhc_info_t nhc_info;
+
+	/* Locks: Write job, write node */
+	slurmctld_lock_t job_write_lock = {
+		NO_LOCK, WRITE_LOCK, WRITE_LOCK, NO_LOCK };
+	slurmctld_lock_t job_read_lock = {
+		NO_LOCK, READ_LOCK, NO_LOCK, NO_LOCK };
+
+	if (!step_ptr) {
+		error("%s: no step_ptr given, this should never happen",
+		      __func__);
+		return NULL;
+	}
+
+	memset(&nhc_info, 0, sizeof(nhc_info_t));
+	nhc_info.is_step = true;
+	lock_slurmctld(job_read_lock);
+	nhc_info.jobid = step_ptr->job_ptr->job_id;
+	nhc_info.apid = SLURM_ID_HASH(step_ptr->job_ptr->job_id,
+				      step_ptr->step_id);
+	nhc_info.exit_code = SIGKILL;
+	nhc_info.user_id = step_ptr->job_ptr->user_id;
+
+	if (!step_ptr->step_layout || !step_ptr->step_layout->node_list)
+		nhc_info.nodelist = xstrdup(step_ptr->job_ptr->nodes);
+	else
+		nhc_info.nodelist = xstrdup(step_ptr->step_layout->node_list);
+	unlock_slurmctld(job_read_lock);
+
+	/* run NHC */
+	_run_nhc(&nhc_info);
+	/***********/
+
+	xfree(nhc_info.nodelist);
+
+	_throttle_start();
+	lock_slurmctld(job_write_lock);
+	jobinfo = step_ptr->select_jobinfo->data;
+	jobinfo->cleaning |= CLEANING_COMPLETE;
+	unlock_slurmctld(job_write_lock);
+	_throttle_fini();
+
+	return NULL;
+}
+
 static void _spawn_cleanup_thread(
 	void *obj_ptr, void *(*start_routine) (void *))
 {
@@ -1214,6 +1313,7 @@ unpack_error:
  */
 extern int init ( void )
 {
+	DEF_TIMERS;
 #if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
 	char *err_msg = NULL;
 #endif
@@ -1223,10 +1323,18 @@ extern int init ( void )
 	 */
 	uint16_t select_type_param = slurm_get_select_type_param();
 	if (select_type_param & CR_OTHER_CONS_RES)
-		plugin_id = 108;
+		plugin_id = SELECT_PLUGIN_CRAY_CONS_RES;
 	debug_flags = slurm_get_debug_flags();
 
+#if defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
+	/* Read and store the CCM configured partition name(s). */
+	if (run_in_daemon("slurmctld")) {
+		/* Get any CCM configuration information */
+		ccm_get_config();
+	}
+#endif
 	if (!slurmctld_primary && run_in_daemon("slurmctld")) {
+		START_TIMER;
 		if (slurmctld_config.scheduling_disabled) {
 			info("Scheduling disabled on backup");
 			scheduling_disabled = true;
@@ -1239,6 +1347,9 @@ extern int init ( void )
 			      "the \"no_backup_scheduling\" "
 			      "SchedulerParameter.");
 #endif
+		END_TIMER;
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			info("alpsc_get_topology call took: %s", TIME_STR);
 	}
 
 	verbose("%s loaded", plugin_name);
@@ -1467,7 +1578,7 @@ extern int select_p_state_restore(char *dir_name)
 			for (j=0; j<blade_cnt; j++) {
 				if (blade_info.id == blade_array[j].id) {
 					/* blade_array[j].job_cnt = */
-					/* 	blade_info.job_cnt; */
+					/*	blade_info.job_cnt; */
 					if (!bit_equal(blade_array[j].
 						       node_bitmap,
 						       blade_info.node_bitmap))
@@ -1537,9 +1648,10 @@ extern int select_p_job_init(List job_list)
 			info("select_p_job_init: syncing jobs");
 
 		while ((job_ptr = list_next(itr))) {
-
 			jobinfo = job_ptr->select_jobinfo->data;
-			if (IS_CLEANING(jobinfo) || IS_JOB_RUNNING(job_ptr))
+			if ((IS_CLEANING_STARTED(jobinfo) &&
+			     !IS_CLEANING_COMPLETE(jobinfo)) ||
+			    IS_JOB_RUNNING(job_ptr))
 				_set_job_running_restore(jobinfo);
 
 			/* We need to resize bitmaps if the
@@ -1564,7 +1676,11 @@ extern int select_p_job_init(List job_list)
 				struct step_record *step_ptr;
 				while ((step_ptr = list_next(itr_step))) {
 					jobinfo =step_ptr->select_jobinfo->data;
-					if (jobinfo && IS_CLEANING(jobinfo)) {
+					if (jobinfo &&
+					    IS_CLEANING_STARTED(jobinfo) &&
+					    !IS_CLEANING_COMPLETE(jobinfo)) {
+						jobinfo->cleaning |=
+							CLEANING_STARTED;
 						_spawn_cleanup_thread(
 							step_ptr, _step_fini);
 					}
@@ -1574,11 +1690,27 @@ extern int select_p_job_init(List job_list)
 
 			if (!(slurmctld_conf.select_type_param & CR_NHC_NO)) {
 				jobinfo = job_ptr->select_jobinfo->data;
-				if (jobinfo && IS_CLEANING(jobinfo)) {
+				if (jobinfo &&
+				    IS_CLEANING_STARTED(jobinfo) &&
+				    !IS_CLEANING_COMPLETE(jobinfo)) {
 					_spawn_cleanup_thread(
 						job_ptr, _job_fini);
 				}
 			}
+#if defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
+			/* As applicable, rerun CCM prologue during recovery */
+			if ((ccm_config.ccm_enabled) &&
+			    ccm_check_partitions(job_ptr)) {
+				if ((job_ptr->details) &&
+				    ((job_ptr->details->prolog_running) ||
+				     IS_JOB_CONFIGURING(job_ptr))) {
+					debug("CCM job %u recovery rerun "
+					      "prologue", job_ptr->job_id);
+					job_ptr->job_state |= JOB_CONFIGURING;
+					spawn_ccm_thread(job_ptr, ccm_begin);
+				}
+			}
+#endif
 		}
 		list_iterator_destroy(itr);
 	}
@@ -1602,10 +1734,13 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt)
 	struct node_record *node_rec;
 	int i, j;
 	uint64_t blade_id = 0;
+	DEF_TIMERS;
 
 	if (scheduling_disabled)
 		return other_node_init(node_ptr, node_cnt);
 
+	START_TIMER;
+
 #if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
 	int nn, end_nn, last_nn = 0;
 	bool found = 0;
@@ -1614,17 +1749,21 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt)
 	if (!topology) {
 		if (alpsc_get_topology(&err_msg, &topology,
 				       &topology_num_nodes)) {
+			END_TIMER;
+			if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+				INFO_LINE("call took: %s", TIME_STR);
+
 			if (err_msg) {
 				error("(%s: %d: %s) Could not get system "
 				      "topology info: %s",
 				      THIS_FILE, __LINE__,
-				      __FUNCTION__, err_msg);
+				      __func__, err_msg);
 				free(err_msg);
 			} else {
 				error("(%s: %d: %s) Could not get system "
 				      "topology info: No error "
 				      "message present.",
-				      THIS_FILE, __LINE__, __FUNCTION__);
+				      THIS_FILE, __LINE__, __func__);
 			}
 			return SLURM_ERROR;
 		}
@@ -1653,7 +1792,7 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt)
 						 "0123456789"))) {
 				error("(%s: %d: %s) Error: Node was not "
 				      "recognizable: %s",
-				      THIS_FILE, __LINE__, __FUNCTION__,
+				      THIS_FILE, __LINE__, __func__,
 				      node_rec->name);
 				slurm_mutex_unlock(&blade_mutex);
 				return SLURM_ERROR;
@@ -1719,6 +1858,9 @@ extern int select_p_node_init(struct node_record *node_ptr, int node_cnt)
 	xrealloc(blade_array, sizeof(blade_info_t) * blade_cnt);
 
 	slurm_mutex_unlock(&blade_mutex);
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return other_node_init(node_ptr, node_cnt);
 }
@@ -1842,13 +1984,52 @@ extern int select_p_job_begin(struct job_record *job_ptr)
 	/* xfree(tmp3); */
 	slurm_mutex_unlock(&blade_mutex);
 
+#if defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
+	if (ccm_config.ccm_enabled) {
+		/*
+		 * Create a thread to do setup activity before running the
+		 * CCM prolog for a CCM partition.
+		 */
+		if (ccm_check_partitions(job_ptr)) {
+			if (job_ptr->details == NULL) {
+				/* This info is required; abort the launch */
+				CRAY_ERR("CCM prolog missing job details, "
+					"job %u killed", job_ptr->job_id);
+				srun_user_message(job_ptr,
+				      "CCM prolog missing job details, killed");
+				(void) job_signal(job_ptr->job_id, SIGKILL, 0,
+					0, false);
+			} else {
+				/* Delay job launch until CCM prolog is done */
+				debug("CCM job %u increment prolog_running, "
+					"current %d", job_ptr->job_id,
+					job_ptr->details->prolog_running);
+				job_ptr->details->prolog_running++;
+				/* Cleared in prolog_running_decr() */
+				debug("CCM job %u setting JOB_CONFIGURING",
+					job_ptr->job_id);
+				job_ptr->job_state |= JOB_CONFIGURING;
+				spawn_ccm_thread(job_ptr, ccm_begin);
+			}
+		}
+	}
+#endif
 	return other_job_begin(job_ptr);
 }
 
 extern int select_p_job_ready(struct job_record *job_ptr)
 {
 	xassert(job_ptr);
-
+#if defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
+	if (ccm_check_partitions(job_ptr)) {
+		/* Delay CCM job launch until CCM prolog is done */
+		if (IS_JOB_CONFIGURING(job_ptr)) {
+			debug("CCM job %u job configuring set; job not ready",
+				job_ptr->job_id);
+			return READY_JOB_ERROR;
+		}
+	}
+#endif
 	return other_job_ready(job_ptr);
 }
 
@@ -1880,21 +2061,28 @@ extern int select_p_job_fini(struct job_record *job_ptr)
 {
 	select_jobinfo_t *jobinfo = job_ptr->select_jobinfo->data;
 
-
+#if defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
+	/* Create a thread to run the CCM epilog for a CCM partition */
+	if (ccm_config.ccm_enabled) {
+		if (ccm_check_partitions(job_ptr)) {
+			spawn_ccm_thread(job_ptr, ccm_fini);
+		}
+	}
+#endif
 	if (slurmctld_conf.select_type_param & CR_NHC_NO) {
 		debug3("NHC_No set, not running NHC after allocations");
 		other_job_fini(job_ptr);
 		return SLURM_SUCCESS;
 	}
 
-	if (IS_CLEANING(jobinfo)) {
+	if (IS_CLEANING_STARTED(jobinfo)) {
 		error("%s: Cleaning flag already set for job %u, "
 		      "this should never happen", __func__, job_ptr->job_id);
-	} else if (IS_CLEANED(jobinfo)) {
+	} else if (IS_CLEANING_COMPLETE(jobinfo)) {
 		error("%s: Cleaned flag already set for job %u, "
 		      "this should never happen", __func__, job_ptr->job_id);
 	} else {
-		jobinfo->cleaning = CLEANING_STARTED;
+		jobinfo->cleaning |= CLEANING_STARTED;
 		_spawn_cleanup_thread(job_ptr, _job_fini);
 	}
 
@@ -1906,15 +2094,19 @@ extern int select_p_job_suspend(struct job_record *job_ptr, bool indf_susp)
 #ifdef HAVE_NATIVE_CRAY
 	ListIterator i;
 	struct step_record *step_ptr = NULL;
+	DEF_TIMERS;
 
 	// Make an event for each job step
 	if (aeld_running) {
+		START_TIMER;
 		i = list_iterator_create(job_ptr->step_list);
-		while ((step_ptr = (struct step_record *)list_next(i))
-		       != NULL) {
+		while ((step_ptr = (struct step_record *)list_next(i))) {
 			_update_app(job_ptr, step_ptr, ALPSC_EV_SUSPEND);
 		}
 		list_iterator_destroy(i);
+		END_TIMER;
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			INFO_LINE("call took: %s", TIME_STR);
 	}
 #endif
 
@@ -1926,15 +2118,19 @@ extern int select_p_job_resume(struct job_record *job_ptr, bool indf_susp)
 #ifdef HAVE_NATIVE_CRAY
 	ListIterator i;
 	struct step_record *step_ptr = NULL;
+	DEF_TIMERS;
 
 	// Make an event for each job step
 	if (aeld_running) {
+		START_TIMER;
 		i = list_iterator_create(job_ptr->step_list);
-		while ((step_ptr = (struct step_record *)list_next(i))
-		       != NULL) {
+		while ((step_ptr = (struct step_record *)list_next(i))) {
 			_update_app(job_ptr, step_ptr, ALPSC_EV_RESUME);
 		}
 		list_iterator_destroy(i);
+		END_TIMER;
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			INFO_LINE("call took: %s", TIME_STR);
 	}
 #endif
 
@@ -1947,7 +2143,9 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr,
 					  bitstr_t **avail_nodes)
 {
 	select_jobinfo_t *jobinfo;
+	DEF_TIMERS;
 
+	START_TIMER;
 	xassert(avail_nodes);
 	xassert(!*avail_nodes);
 
@@ -1971,6 +2169,9 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr,
 
 		bit_not(*avail_nodes);
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return other_step_pick_nodes(job_ptr, jobinfo, node_count, avail_nodes);
 }
@@ -1978,6 +2179,9 @@ extern bitstr_t *select_p_step_pick_nodes(struct job_record *job_ptr,
 extern int select_p_step_start(struct step_record *step_ptr)
 {
 	select_jobinfo_t *jobinfo;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 #ifdef HAVE_NATIVE_CRAY
 	if (aeld_running) {
@@ -2012,25 +2216,66 @@ extern int select_p_step_start(struct step_record *step_ptr)
 		}
 		bit_or(jobinfo->used_blades, step_jobinfo->blade_map);
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	return other_step_start(step_ptr);
 }
 
+static void _start_killing_step(struct step_record *step_ptr)
+{
+	select_jobinfo_t *jobinfo;
+
+	if (slurmctld_conf.select_type_param & CR_NHC_STEP_NO) {
+		debug3("NHC_No_Steps set not running NHC on steps.");
+		return;
+	}
+
+	if (!step_ptr->select_jobinfo) {
+		debug3("step never got an allocation.");
+		return;
+	}
+
+	jobinfo = step_ptr->select_jobinfo->data;
+	if (jobinfo && !IS_CLEANING_STARTED(jobinfo)) {
+		jobinfo->cleaning |= CLEANING_STARTED;
+		_spawn_cleanup_thread(step_ptr, _step_kill);
+	}
+}
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
-	select_jobinfo_t *jobinfo = step_ptr->select_jobinfo->data;
+	select_jobinfo_t *jobinfo;
+	DEF_TIMERS;
 
+	START_TIMER;
 #ifdef HAVE_NATIVE_CRAY
 	if (aeld_running) {
 		_update_app(step_ptr->job_ptr, step_ptr, ALPSC_EV_END);
 	}
 #endif
+	/* Send step to db since the step could be deleted by post_job_step()
+	 * before the step is completed and sent to the db (handled in
+	 * _internal_step_complete() in step_mgr.c). post_job_step is called
+	 * after the NHC is run (or immediately with NHC_NO). */
+	jobacct_storage_g_step_complete(acct_db_conn, step_ptr);
 
 	if (slurmctld_conf.select_type_param & CR_NHC_STEP_NO) {
 		debug3("NHC_No_Steps set not running NHC on steps.");
-		other_step_finish(step_ptr);
+		other_step_finish(step_ptr, killing_step);
 		/* free resources on the job */
 		post_job_step(step_ptr);
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			INFO_LINE("call took: %s", TIME_STR);
+		return SLURM_SUCCESS;
+	}
+
+	if (killing_step) {
+		_start_killing_step(step_ptr);
+		other_step_finish(step_ptr, killing_step);
+		if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+			INFO_LINE("call took: %s", TIME_STR);
 		return SLURM_SUCCESS;
 	}
 
@@ -2043,29 +2288,32 @@ extern int select_p_step_finish(struct step_record *step_ptr)
 		debug3("step completion %u.%u was received after job "
 		      "allocation is already completing, no extra NHC needed.",
 		      step_ptr->job_ptr->job_id, step_ptr->step_id);
-		other_step_finish(step_ptr);
+		other_step_finish(step_ptr, killing_step);
 		/* free resources on the job */
 		post_job_step(step_ptr);
 		return SLURM_SUCCESS;
 	}
 #endif
 
+	jobinfo = step_ptr->select_jobinfo->data;
 	if (!jobinfo) {
 		error("%s: job step %u.%u lacks jobinfo",
 		      __func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
-	} else if (IS_CLEANING(jobinfo)) {
-		error("%s: Cleaning flag already set for job step %u.%u, "
-		      "this should never happen.",
-		      __func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
-	} else if (IS_CLEANED(jobinfo)) {
-		error("%s: Cleaned flag already set for job step %u.%u, "
-		      "this should never happen.",
-		      __func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
+	} else if (IS_CLEANING_STARTED(jobinfo)) {
+		verbose("%s: Cleaning flag already set for step %u.%u",
+			__func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
+	} else if (IS_CLEANING_COMPLETE(jobinfo)) {
+		verbose("%s: Cleaned flag already set for step %u.%u",
+			__func__, step_ptr->job_ptr->job_id, step_ptr->step_id);
 	} else {
-		jobinfo->cleaning = CLEANING_STARTED;
+		jobinfo->cleaning |= CLEANING_STARTED;
 		_spawn_cleanup_thread(step_ptr, _step_fini);
 	}
 
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	return SLURM_SUCCESS;
 }
 
@@ -2240,11 +2488,11 @@ extern int select_p_select_jobinfo_set(select_jobinfo_t *jobinfo,
 		break;
 	case SELECT_JOBDATA_NETWORK:
 		if (!in_char || !strlen(in_char)
-		    || !strcmp(in_char, "none"))
+		    || !xstrcmp(in_char, "none"))
 			jobinfo->npc = NPC_NONE;
-		else if (!strcmp(in_char, "system"))
+		else if (!xstrcmp(in_char, "system"))
 			jobinfo->npc = NPC_SYS;
-		else if (!strcmp(in_char, "blade"))
+		else if (!xstrcmp(in_char, "blade"))
 			jobinfo->npc = NPC_BLADE;
 		break;
 	default:
@@ -2278,7 +2526,11 @@ extern int select_p_select_jobinfo_get(select_jobinfo_t *jobinfo,
 		*select_jobinfo = jobinfo->other_jobinfo;
 		break;
 	case SELECT_JOBDATA_CLEANING:
-		*uint16 = (jobinfo->cleaning & CLEANING_STARTED);
+		if (IS_CLEANING_STARTED(jobinfo) &&
+		    !IS_CLEANING_COMPLETE(jobinfo))
+			*uint16 = 1;
+		else
+			*uint16 = 0;
 		break;
 	case SELECT_JOBDATA_NETWORK:
 		xassert(in_char);
diff --git a/src/plugins/select/linear/Makefile.in b/src/plugins/select/linear/Makefile.in
index 3d0695406..aad79b0b3 100644
--- a/src/plugins/select/linear/Makefile.in
+++ b/src/plugins/select/linear/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/linear
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/linear/select_linear.c b/src/plugins/select/linear/select_linear.c
index 3c961aac5..c02e36fa2 100644
--- a/src/plugins/select/linear/select_linear.c
+++ b/src/plugins/select/linear/select_linear.c
@@ -41,6 +41,10 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
+#ifndef   _GNU_SOURCE
+#  define _GNU_SOURCE
+#endif
+
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
 #  if HAVE_STDINT_H
@@ -52,10 +56,11 @@
 #endif
 
 #include <stdio.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <time.h>
+#include <unistd.h>
 
 #include "slurm/slurm.h"
 #include "slurm/slurm_errno.h"
@@ -215,7 +220,7 @@ extern int select_p_select_nodeinfo_free(select_nodeinfo_t *nodeinfo);
  */
 const char plugin_name[]       	= "Linear node selection plugin";
 const char plugin_type[]       	= "select/linear";
-const uint32_t plugin_id	= 102;
+const uint32_t plugin_id	= SELECT_PLUGIN_LINEAR;
 const uint32_t plugin_version	= SLURM_VERSION_NUMBER;
 
 static struct node_record *select_node_ptr = NULL;
@@ -223,6 +228,7 @@ static int select_node_cnt = 0;
 static uint16_t select_fast_schedule;
 static uint16_t cr_type;
 static bool have_dragonfly = false;
+static bool topo_optional = false;
 
 /* Record of resources consumed on each node including job details */
 static struct cr_record *cr_ptr = NULL;
@@ -748,7 +754,8 @@ static int _job_test(struct job_record *job_ptr, bitstr_t *bitmap,
 					   min_nodes, max_nodes, req_nodes);
 	}
 	
-	if (switch_record_cnt && switch_record_table) {
+	if (switch_record_cnt && switch_record_table &&
+	    ((topo_optional == false) || job_ptr->req_switch)) {
 		/* Perform optimized resource selection based upon topology */
 		if (have_dragonfly) {
 			return _job_test_dfly(job_ptr, bitmap,
@@ -3392,7 +3399,8 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap,
 
 	/* Remove the running jobs one at a time from exp_node_cr and try
 	 * scheduling the pending job after each one */
-	if (rc != SLURM_SUCCESS) {
+	if ((rc != SLURM_SUCCESS) &&
+	    ((job_ptr->bit_flags & TEST_NOW_ONLY) == 0)) {
 		list_sort(cr_job_list, _cr_job_list_sort);
 		job_iterator = list_iterator_create(cr_job_list);
 		while ((tmp_job_ptr = (struct job_record *)
@@ -3464,9 +3472,13 @@ extern int init ( void )
 		verbose("%s loaded with argument %u", plugin_name, cr_type);
 
 	topo_param = slurm_get_topology_param();
-	if (topo_param && strstr(topo_param, "dragonfly"))
-		have_dragonfly = true;
-	xfree(topo_param);
+	if (topo_param) {
+		if (strcasestr(topo_param, "dragonfly"))
+			have_dragonfly = true;
+		if (strcasestr(topo_param, "TopoOptional"))
+			topo_optional = true;
+		xfree(topo_param);
+	}
 
 	return rc;
 }
@@ -3806,7 +3818,7 @@ extern int select_p_step_start(struct step_record *step_ptr)
 	return SLURM_SUCCESS;
 }
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	return SLURM_SUCCESS;
 }
diff --git a/src/plugins/select/other/Makefile.in b/src/plugins/select/other/Makefile.in
index 01c2917a8..8d91dd7b5 100644
--- a/src/plugins/select/other/Makefile.in
+++ b/src/plugins/select/other/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/other
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -217,8 +218,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -318,6 +317,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -356,6 +359,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -399,6 +405,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -449,6 +458,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/other/other_select.c b/src/plugins/select/other/other_select.c
index 1b564ae20..68babf73a 100644
--- a/src/plugins/select/other/other_select.c
+++ b/src/plugins/select/other/other_select.c
@@ -441,14 +441,16 @@ extern int other_step_start(struct step_record *step_ptr)
 /*
  * clear what happened in select_g_step_pick_nodes
  * IN/OUT step_ptr - Flush the resources from the job and step.
+ * IN killing_step - if true then we are just starting to kill the step
+ *                   if false, the step is completely terminated
  */
-extern int other_step_finish(struct step_record *step_ptr)
+extern int other_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	if (other_select_init() < 0)
 		return SLURM_ERROR;
 
 	return (*(ops.step_finish))
-		(step_ptr);
+		(step_ptr, killing_step);
 }
 
 extern int other_pack_select_info(time_t last_query_time, uint16_t show_flags,
diff --git a/src/plugins/select/other/other_select.h b/src/plugins/select/other/other_select.h
index ad2375365..d53eb226b 100644
--- a/src/plugins/select/other/other_select.h
+++ b/src/plugins/select/other/other_select.h
@@ -257,8 +257,10 @@ extern int other_step_start(struct step_record *step_ptr);
 /*
  * clear what happened in select_g_step_pick_nodes
  * IN/OUT step_ptr - Flush the resources from the job and step.
+ * IN killing_step - if true then we are just starting to kill the step
+ *                   if false, the step is completely terminated
  */
-extern int other_step_finish(struct step_record *step_ptr);
+extern int other_step_finish(struct step_record *step_ptr, bool killing_step);
 
 /* allocate storage for a select job credential
  * RET jobinfo - storage for a select job credential
diff --git a/src/plugins/select/serial/Makefile.in b/src/plugins/select/serial/Makefile.in
index 6d1a6cc2e..be1ba5142 100644
--- a/src/plugins/select/serial/Makefile.in
+++ b/src/plugins/select/serial/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/select/serial
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/select/serial/job_test.c b/src/plugins/select/serial/job_test.c
index 1d83f2c3f..afe13082e 100644
--- a/src/plugins/select/serial/job_test.c
+++ b/src/plugins/select/serial/job_test.c
@@ -684,7 +684,8 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, int mode,
 	/* remove existing allocations (jobs) from higher-priority partitions
 	 * from avail_cores */
 	for (p_ptr = cr_part_ptr; p_ptr; p_ptr = p_ptr->next) {
-		if ((p_ptr->part_ptr->priority <= jp_ptr->part_ptr->priority) &&
+		if ((p_ptr->part_ptr->priority_tier <=
+		     jp_ptr->part_ptr->priority_tier) &&
 		    (p_ptr->part_ptr->preempt_mode != PREEMPT_MODE_OFF))
 			continue;
 		if (!p_ptr->row)
@@ -723,7 +724,8 @@ extern int cr_job_test(struct job_record *job_ptr, bitstr_t *bitmap, int mode,
 	/* remove existing allocations (jobs) from same-priority partitions
 	 * from avail_cores */
 	for (p_ptr = cr_part_ptr; p_ptr; p_ptr = p_ptr->next) {
-		if (p_ptr->part_ptr->priority != jp_ptr->part_ptr->priority)
+		if (p_ptr->part_ptr->priority_tier !=
+		    jp_ptr->part_ptr->priority_tier)
 			continue;
 		if (!p_ptr->row)
 			continue;
diff --git a/src/plugins/select/serial/select_serial.c b/src/plugins/select/serial/select_serial.c
index 8a6cd56c7..9e98b28c6 100644
--- a/src/plugins/select/serial/select_serial.c
+++ b/src/plugins/select/serial/select_serial.c
@@ -110,7 +110,7 @@ uint32_t *cr_node_cores_offset;
  */
 const char plugin_name[] = "Serial Job Resource Selection plugin";
 const char plugin_type[] = "select/serial";
-const uint32_t plugin_id      = 106;
+const uint32_t plugin_id      = SELECT_PLUGIN_SERIAL;
 const uint32_t plugin_version = SLURM_VERSION_NUMBER;
 const uint32_t pstate_version = 7;	/* version control on saved state */
 
@@ -193,8 +193,10 @@ static void _dump_nodes(void)
 static void _dump_part(struct part_res_record *p_ptr)
 {
 	uint16_t i;
-	info("part:%s rows:%u pri:%u ", p_ptr->part_ptr->name, p_ptr->num_rows,
-	     p_ptr->part_ptr->priority);
+
+	info("part:%s rows:%u prio:%u ", p_ptr->part_ptr->name, p_ptr->num_rows,
+	     p_ptr->part_ptr->priority_tier);
+
 	if (!p_ptr->row)
 		return;
 
@@ -1291,7 +1293,8 @@ static int _will_run_test(struct job_record *job_ptr, bitstr_t *bitmap,
 
 	/* Remove the running jobs one at a time from exp_node_cr and try
 	 * scheduling the pending job after each one. */
-	if (rc != SLURM_SUCCESS) {
+	if ((rc != SLURM_SUCCESS) &&
+	    ((job_ptr->bit_flags & TEST_NOW_ONLY) == 0)) {
 		list_sort(cr_job_list, _cr_job_list_sort);
 		job_iterator = list_iterator_create(cr_job_list);
 		while ((tmp_job_ptr = list_next(job_iterator))) {
@@ -1757,7 +1760,7 @@ extern int select_p_step_start(struct step_record *step_ptr)
 	return SLURM_SUCCESS;
 }
 
-extern int select_p_step_finish(struct step_record *step_ptr)
+extern int select_p_step_finish(struct step_record *step_ptr, bool killing_step)
 {
 	return SLURM_SUCCESS;
 }
@@ -1827,11 +1830,11 @@ extern int select_p_select_nodeinfo_set_all(void)
 {
 	struct part_res_record *p_ptr;
 	struct node_record *node_ptr = NULL;
-	int i=0, n=0, c, start, end;
-	uint16_t tmp, tmp_16 = 0;
+	int i, n, start, end;
 	static time_t last_set_all = 0;
-	uint32_t node_threads, node_cpus;
 	select_nodeinfo_t *nodeinfo = NULL;
+	uint32_t alloc_cpus, node_cores, node_cpus, node_threads;
+	bitstr_t *alloc_core_bitmap = NULL;
 
 	/* only set this once when the last_node_update is newer than
 	   the last time we set things up. */
@@ -1843,7 +1846,26 @@ extern int select_p_select_nodeinfo_set_all(void)
 	}
 	last_set_all = last_node_update;
 
-	for (n=0; n < select_node_cnt; n++) {
+	/* Build bitmap representing all cores allocated to all active jobs
+	 * (running or preempted jobs) */
+	for (p_ptr = select_part_record; p_ptr; p_ptr = p_ptr->next) {
+		if (!p_ptr->row)
+			continue;
+		for (i = 0; i < p_ptr->num_rows; i++) {
+			if (!p_ptr->row[i].row_bitmap)
+				continue;
+			if (!alloc_core_bitmap) {
+				alloc_core_bitmap =
+					bit_copy(p_ptr->row[i].row_bitmap);
+			} else if (bit_size(alloc_core_bitmap) ==
+				   bit_size(p_ptr->row[i].row_bitmap)) {
+				bit_or(alloc_core_bitmap,
+				       p_ptr->row[i].row_bitmap);
+			}
+		}
+	}
+
+	for (n = 0; n < select_node_cnt; n++) {
 		node_ptr = &(node_record_table_ptr[n]);
 
 		/* We have to use the '_g_' here to make sure we get
@@ -1868,34 +1890,27 @@ extern int select_p_select_nodeinfo_set_all(void)
 		}
 
 		start = cr_get_coremap_offset(n);
-		end = cr_get_coremap_offset(n+1);
-		tmp_16 = 0;
-		for (p_ptr = select_part_record; p_ptr; p_ptr = p_ptr->next) {
-			if (!p_ptr->row)
-				continue;
-			for (i = 0; i < p_ptr->num_rows; i++) {
-				if (!p_ptr->row[i].row_bitmap)
-					continue;
-				tmp = 0;
-				for (c = start; c < end; c++) {
-					if (bit_test(p_ptr->row[i].row_bitmap,
-						     c))
-						tmp++;
-				}
-				/* get the row with the largest cpu
-				 * count on it. */
-				if (tmp > tmp_16)
-					tmp_16 = tmp;
-			}
+		end = cr_get_coremap_offset(n + 1);
+		if (alloc_core_bitmap) {
+			alloc_cpus = bit_set_count_range(alloc_core_bitmap,
+							 start, end);
+		} else {
+			alloc_cpus = 0;
 		}
+		node_cores = end - start;
 
-		/* The minimum allocatable unit may a core, so scale
-		 * threads up to the proper CPU count */
-		if ((end - start) < node_cpus)
-			tmp_16 *= node_threads;
+		/* Administrator could resume suspended jobs and oversubscribe
+		 * cores, avoid reporting more cores in use than configured */
+		if (alloc_cpus > node_cores)
+			alloc_cpus = node_cores;
 
-		nodeinfo->alloc_cpus = tmp_16;
+		/* The minimum allocatable unit may a core, so scale by thread
+		 * count up to the proper CPU count as needed */
+		if (node_cores < node_cpus)
+			alloc_cpus *= node_threads;
+		nodeinfo->alloc_cpus = alloc_cpus;
 	}
+	FREE_NULL_BITMAP(alloc_core_bitmap);
 
 	return SLURM_SUCCESS;
 }
@@ -2073,13 +2088,31 @@ extern int select_p_update_node_config(int index)
 		return SLURM_ERROR;
 	}
 
+	/* Socket and core count can be changed when KNL node reboots in a
+	 * different NUMA configuration */
+	if ((select_fast_schedule == 1) &&
+	    (select_node_record[index].sockets !=
+	     select_node_record[index].node_ptr->config_ptr->sockets) &&
+	    (select_node_record[index].cores !=
+	     select_node_record[index].node_ptr->config_ptr->cores) &&
+	    ((select_node_record[index].sockets *
+	      select_node_record[index].cores) ==
+	     (select_node_record[index].node_ptr->sockets *
+	      select_node_record[index].node_ptr->cores))) {
+		select_node_record[index].sockets =
+			select_node_record[index].node_ptr->config_ptr->sockets;
+		select_node_record[index].cores =
+			select_node_record[index].node_ptr->config_ptr->cores;
+	}
+
 	if (select_fast_schedule)
 		return SLURM_SUCCESS;
 
-	select_node_record[index].real_memory = select_node_record[index].
-						node_ptr->real_memory;
-	select_node_record[index].mem_spec_limit = select_node_record[index].
-		node_ptr->mem_spec_limit;
+	select_node_record[index].real_memory =
+		select_node_record[index].node_ptr->real_memory;
+	select_node_record[index].mem_spec_limit =
+		select_node_record[index].node_ptr->mem_spec_limit;
+
 	return SLURM_SUCCESS;
 }
 
diff --git a/src/plugins/slurmctld/Makefile.in b/src/plugins/slurmctld/Makefile.in
index e3edba270..056e46295 100644
--- a/src/plugins/slurmctld/Makefile.in
+++ b/src/plugins/slurmctld/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/slurmctld
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/slurmctld/dynalloc/msg.c b/src/plugins/slurmctld/dynalloc/msg.c
index 10f195c0c..1774c0032 100644
--- a/src/plugins/slurmctld/dynalloc/msg.c
+++ b/src/plugins/slurmctld/dynalloc/msg.c
@@ -101,10 +101,10 @@ extern int spawn_msg_thread(void)
 		return SLURM_ERROR;
 	}
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if (thread_running) {
 		error("dynalloc thread already running, not starting another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -118,7 +118,7 @@ extern int spawn_msg_thread(void)
 
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 	return SLURM_SUCCESS;
 }
 
@@ -127,7 +127,7 @@ extern int spawn_msg_thread(void)
 \*****************************************************************************/
 extern void term_msg_thread(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		int fd;
 		slurm_addr_t addr;
@@ -153,7 +153,7 @@ extern void term_msg_thread(void)
 		thread_running = false;
 		debug2("join of dynalloc thread successful");
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /*****************************************************************************\
@@ -347,13 +347,14 @@ static void	_proc_msg(slurm_fd_t new_fd, char *msg)
 		send_reply(new_fd, send_buf);
 	} else {
 		//identify the cmd
-		if (0 == strcasecmp(msg, "get total nodes and slots")) {
+		if (0 == xstrcasecmp(msg, "get total nodes and slots")) {
 			get_total_nodes_slots(&nodes, &slots);
 			sprintf(send_buf, "total_nodes=%d total_slots=%d",
 				nodes, slots);
 			info("BBB: send to client: %s", send_buf);
 			send_reply(new_fd, send_buf);
-		} else if (0 == strcasecmp(msg, "get available nodes and slots")) {
+		} else if (0 == xstrcasecmp(msg,
+					    "get available nodes and slots")) {
 			get_free_nodes_slots(&nodes, &slots);
 			sprintf(send_buf, "avail_nodes=%d avail_slots=%d",
 				nodes, slots);
diff --git a/src/plugins/slurmctld/nonstop/Makefile.in b/src/plugins/slurmctld/nonstop/Makefile.in
index ffe165dcf..91342f58f 100644
--- a/src/plugins/slurmctld/nonstop/Makefile.in
+++ b/src/plugins/slurmctld/nonstop/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/slurmctld/nonstop
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -252,8 +253,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -353,6 +352,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -391,6 +394,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -434,6 +440,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -484,6 +493,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/slurmctld/nonstop/do_work.c b/src/plugins/slurmctld/nonstop/do_work.c
index 7ce45ec96..48098afb4 100644
--- a/src/plugins/slurmctld/nonstop/do_work.c
+++ b/src/plugins/slurmctld/nonstop/do_work.c
@@ -305,7 +305,7 @@ extern int save_nonstop_state(void)
 	pack_time(now, buffer);
 
 	/* write individual job records */
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	if (job_fail_list) {
 		job_cnt = list_count(job_fail_list);
 		pack32(job_cnt, buffer);
@@ -317,7 +317,7 @@ extern int save_nonstop_state(void)
 		pack32(job_cnt, buffer);
 	}
 	job_fail_save_time = now;
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 
 	/* write the buffer to file */
 	dir_path = slurm_get_state_save_location();
@@ -436,7 +436,7 @@ extern int restore_nonstop_state(void)
 	}
 	safe_unpack_time(&buf_time, buffer);
 	safe_unpack32(&job_cnt, buffer);
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	for (i = 0; i < job_cnt; i++) {
 		error_code = _unpack_job_state(&job_fail_ptr, buffer);
 		if (error_code)
@@ -449,7 +449,7 @@ extern int restore_nonstop_state(void)
 		}
 		list_append(job_fail_list, job_fail_ptr);
 	}
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 	free_buf(buffer);
 	return error_code;
 
@@ -461,17 +461,17 @@ unpack_error:
 
 extern void init_job_db(void)
 {
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	if (!job_fail_list)
 		job_fail_list = list_create(_job_fail_del);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 extern void term_job_db(void)
 {
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	FREE_NULL_LIST(job_fail_list);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 static uint32_t _get_job_cpus(struct job_record *job_ptr, int node_inx)
@@ -517,7 +517,7 @@ static void _failing_node(struct node_record *node_ptr)
 	if (IS_NODE_FAIL(node_ptr))
 		event_flag |= SMD_EVENT_NODE_FAILING;
 	node_inx = node_ptr - node_record_table_ptr;
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_iterator = list_iterator_create(job_fail_list);
 	while ((job_fail_ptr = (job_failures_t *) list_next(job_iterator))) {
 		if (!_valid_job_ptr(job_fail_ptr))
@@ -530,7 +530,7 @@ static void _failing_node(struct node_record *node_ptr)
 		job_fail_update_time = now;
 	}
 	list_iterator_destroy(job_iterator);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 extern void node_fail_callback(struct job_record *job_ptr,
@@ -551,7 +551,7 @@ extern void node_fail_callback(struct job_record *job_ptr,
 		event_flag |= SMD_EVENT_NODE_FAILED;
 	if (IS_NODE_FAIL(node_ptr))
 		event_flag |= SMD_EVENT_NODE_FAILING;
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_fail_ptr = list_find_first(job_fail_list, _job_fail_find,
 				       &job_ptr->job_id);
 	if (!job_fail_ptr) {
@@ -575,7 +575,7 @@ extern void node_fail_callback(struct job_record *job_ptr,
 			xstrdup(node_ptr->name);
 	job_fail_ptr->time_extend_avail += time_limit_extend;
 	job_fail_update_time = time(NULL);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 extern void job_begin_callback(struct job_record *job_ptr)
@@ -588,7 +588,7 @@ extern void job_begin_callback(struct job_record *job_ptr)
 	if (!job_fail_list || !job_ptr->details ||
 	   !job_ptr->details->depend_list)
 		return;
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	depend_iterator = list_iterator_create(job_ptr->details->depend_list);
 	depend_ptr = (struct depend_spec *) list_next(depend_iterator);
 	if (depend_ptr && (depend_ptr->depend_type == SLURM_DEPEND_EXPAND)) {
@@ -602,16 +602,16 @@ extern void job_begin_callback(struct job_record *job_ptr)
 		      job_fail_ptr->callback_flags);
 	}
 	list_iterator_destroy(depend_iterator);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 extern void job_fini_callback(struct job_record *job_ptr)
 {
 	info("job_fini_callback for job:%u", job_ptr->job_id);
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	list_delete_all(job_fail_list, _job_fail_find, &job_ptr->job_id);
 	/* job_fail_update_time = time(NULL);	not critical */
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 /*
@@ -732,7 +732,7 @@ extern char *fail_nodes(char *cmd_ptr, uid_t cmd_uid,
 	}
 	state_flags = atoi(sep1 + 12);
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_ptr = find_job_record(job_id);
 	if (!job_ptr) {
 		xstrfmtcat(resp, "%s EJOBID", SLURM_VERSION_STRING);
@@ -785,7 +785,7 @@ extern char *fail_nodes(char *cmd_ptr, uid_t cmd_uid,
 		}
 	}
 
-fini:	pthread_mutex_unlock(&job_fail_mutex);
+fini:	slurm_mutex_unlock(&job_fail_mutex);
 	debug("%s: replying to library: %s", __func__, resp);
 	return resp;
 }
@@ -824,7 +824,7 @@ extern char *register_callback(char *cmd_ptr, uid_t cmd_uid,
 	sep1 = strstr(sep1, "PORT:");
 	if (sep1)
 		port_id = atoi(sep1 + 5);
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	if ((sep1 == NULL) || (port_id <= 0)) {
 		xstrfmtcat(resp, "%s EPORT", SLURM_VERSION_STRING);
 		goto fini;
@@ -856,7 +856,7 @@ extern char *register_callback(char *cmd_ptr, uid_t cmd_uid,
 	job_fail_ptr->callback_port = port_id;
 	xstrfmtcat(resp, "%s ENOERROR", SLURM_VERSION_STRING);
 
-fini:	pthread_mutex_unlock(&job_fail_mutex);
+fini:	slurm_mutex_unlock(&job_fail_mutex);
 	debug("%s: replying to library: %s", __func__, resp);
 	return resp;
 }
@@ -869,8 +869,8 @@ fini:	pthread_mutex_unlock(&job_fail_mutex);
 static char *_job_node_features(struct job_record *job_ptr,
 				struct node_record *node_ptr)
 {
-	struct features_record *node_feat_ptr;
-	struct feature_record  *job_feat_ptr;
+	node_feature_t *node_feat_ptr;
+	job_feature_t *job_feat_ptr;
 	ListIterator job_iter, node_iter;
 	char *req_feat = NULL;
 	int node_inx;
@@ -881,15 +881,15 @@ static char *_job_node_features(struct job_record *job_ptr,
 
 	node_inx = node_ptr - node_record_table_ptr;
 	job_iter = list_iterator_create(job_ptr->details->feature_list);
-	while ((job_feat_ptr = (struct feature_record *) list_next(job_iter))) {
-		node_iter = list_iterator_create(feature_list);
-		while ((node_feat_ptr = (struct features_record *)
+	while ((job_feat_ptr = (job_feature_t *) list_next(job_iter))) {
+		node_iter = list_iterator_create(active_feature_list);
+		while ((node_feat_ptr = (node_feature_t *)
 					list_next(node_iter))) {
 			if (!job_feat_ptr->name  ||
 			    !node_feat_ptr->name ||
 			    !node_feat_ptr->node_bitmap ||
 			    !bit_test(node_feat_ptr->node_bitmap, node_inx) ||
-			    strcmp(job_feat_ptr->name, node_feat_ptr->name))
+			    xstrcmp(job_feat_ptr->name, node_feat_ptr->name))
 				continue;
 			if (req_feat)
 				xstrcat(req_feat, "&");
@@ -934,7 +934,7 @@ extern char *drop_node(char *cmd_ptr, uid_t cmd_uid,
 	}
 	node_name = sep1 + 5;
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_fail_ptr = list_find_first(job_fail_list, _job_fail_find, &job_id);
 	if (!job_fail_ptr || !_valid_job_ptr(job_fail_ptr)) {
 		job_ptr = find_job_record(job_id);
@@ -969,7 +969,7 @@ extern char *drop_node(char *cmd_ptr, uid_t cmd_uid,
 	}
 
 	for (i = 0; i < job_fail_ptr->fail_node_cnt; i++) {
-		if (!strcmp(node_name, job_fail_ptr->fail_node_names[i])) {
+		if (!xstrcmp(node_name, job_fail_ptr->fail_node_names[i])) {
 			cpu_cnt = job_fail_ptr->fail_node_cpus[i];
 			failed_inx = i;
 			break;
@@ -1021,7 +1021,7 @@ extern char *drop_node(char *cmd_ptr, uid_t cmd_uid,
 		}
 	}
 	if (job_fail_ptr->pending_node_name &&
-	    !strcmp(job_fail_ptr->pending_node_name, node_name)) {
+	    !xstrcmp(job_fail_ptr->pending_node_name, node_name)) {
 		/* Abort pending replacement request and get back time
 		 * extension (if any) */
 		_kill_job(job_fail_ptr->pending_job_id, cmd_uid);
@@ -1093,7 +1093,7 @@ extern char *drop_node(char *cmd_ptr, uid_t cmd_uid,
 
 fini:	job_fail_update_time = time(NULL);
 	debug("%s: replying to library: %s", __func__, resp);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 	return resp;
 }
 
@@ -1131,7 +1131,7 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid,
 	}
 	node_name = sep1 + 5;
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_fail_ptr = list_find_first(job_fail_list, _job_fail_find, &job_id);
 	if (!job_fail_ptr || !_valid_job_ptr(job_fail_ptr)) {
 		job_ptr = find_job_record(job_id);
@@ -1166,7 +1166,7 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid,
 	}
 
 	for (i = 0; i < job_fail_ptr->fail_node_cnt; i++) {
-		if (!strcmp(node_name, job_fail_ptr->fail_node_names[i])) {
+		if (!xstrcmp(node_name, job_fail_ptr->fail_node_names[i])) {
 			cpu_cnt = job_fail_ptr->fail_node_cpus[i];
 			failed_inx = i;
 			break;
@@ -1214,7 +1214,7 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid,
 		}
 	}
 	if (job_fail_ptr->pending_node_name) {
-		if (strcmp(job_fail_ptr->pending_node_name, node_name)) {
+		if (xstrcmp(job_fail_ptr->pending_node_name, node_name)) {
 			xstrfmtcat(resp, "%s EREPLACEPENDING %s",
 				   SLURM_VERSION_STRING,
 				   job_fail_ptr->pending_node_name);
@@ -1266,7 +1266,7 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid,
 
 	/* Without unlock, the job_begin_callback() function will deadlock.
 	 * Not a great solution, but perhaps the least bad solution. */
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 
 	job_alloc_req.user_id	= job_ptr->user_id;
 	/* Ignore default wckey (it starts with '*') */
@@ -1356,7 +1356,7 @@ extern char *replace_node(char *cmd_ptr, uid_t cmd_uid,
 	xfree(job_alloc_req.qos);
 	xfree(job_alloc_req.wckey);
 
-	pthread_mutex_lock(&job_fail_mutex);	/* Resume lock */
+	slurm_mutex_lock(&job_fail_mutex);	/* Resume lock */
 
 	if (rc != SLURM_SUCCESS) {
 		if (will_run_time) {
@@ -1400,7 +1400,7 @@ merge:
 
 	/* Without unlock, the job_fini_callback() function will deadlock.
 	 * Not a great solution, but perhaps the least bad solution. */
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 
 	if (rc) {
 		info("slurmctld/nonstop: can not shrink job %u: %s",
@@ -1409,11 +1409,11 @@ merge:
 		xstrfmtcat(resp, "%s ENODEREPLACEFAIL %s:",
 			   SLURM_VERSION_STRING,
 			   slurm_strerror(rc));
-		pthread_mutex_lock(&job_fail_mutex);	/* Resume lock */
+		slurm_mutex_lock(&job_fail_mutex);	/* Resume lock */
 		goto fini;
 	}
 	_kill_job(new_job_ptr->job_id, cmd_uid);
-	pthread_mutex_lock(&job_fail_mutex);	/* Resume lock */
+	slurm_mutex_lock(&job_fail_mutex);	/* Resume lock */
 
 	/* Grow the size of the old job to include the new node */
 	slurm_init_job_desc_msg(&job_alloc_req);
@@ -1486,7 +1486,7 @@ merge:
 	}
 
 fini:	job_fail_update_time = time(NULL);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 	if (new_node_name)
 		free(new_node_name);
 	debug("%s: replying to library: %s", __func__, resp);
@@ -1557,7 +1557,7 @@ extern char *show_job(char *cmd_ptr, uid_t cmd_uid, uint32_t protocol_version)
 	sep1 = cmd_ptr + 15;
 	job_id = atoi(sep1);
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 
 	job_fail_ptr = list_find_first(job_fail_list, _job_fail_find, &job_id);
 	if (!job_fail_ptr || !_valid_job_ptr(job_fail_ptr)) {
@@ -1626,7 +1626,7 @@ extern char *show_job(char *cmd_ptr, uid_t cmd_uid, uint32_t protocol_version)
 	xstrfmtcat(resp, "TIME_EXTEND_AVAIL %u",
 		   job_fail_ptr->time_extend_avail);
 
-fini:	pthread_mutex_unlock(&job_fail_mutex);
+fini:	slurm_mutex_unlock(&job_fail_mutex);
 	debug("%s: replying to library: %s", __func__, resp);
 	return resp;
 }
@@ -1650,7 +1650,7 @@ extern char *time_incr(char *cmd_ptr, uid_t cmd_uid, uint32_t protocol_version)
 	sep1 = cmd_ptr + 16;
 	job_id = atoi(sep1);
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	sep1 = strstr(cmd_ptr + 16, "MINUTES:");
 	if (!sep1) {
 		xstrfmtcat(resp, "%s ECMD", SLURM_VERSION_STRING);
@@ -1700,7 +1700,7 @@ extern char *time_incr(char *cmd_ptr, uid_t cmd_uid, uint32_t protocol_version)
 	}
 
 fini:	job_fail_update_time = time(NULL);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 	debug("%s: replying to library: %s", __func__, resp);
 	return resp;
 }
@@ -1720,7 +1720,7 @@ static void _send_event_callbacks(void)
 	if (!job_fail_list)
 		return;
 
-	pthread_mutex_lock(&job_fail_mutex);
+	slurm_mutex_lock(&job_fail_mutex);
 	job_iterator = list_iterator_create(job_fail_list);
 	while ((job_fail_ptr = (job_failures_t *) list_next(job_iterator))) {
 		if (job_fail_ptr->callback_flags == 0)
@@ -1741,7 +1741,7 @@ static void _send_event_callbacks(void)
 			job_fail_ptr->callback_flags = 0;
 			callback_jobid = job_fail_ptr->job_id;
 			/* Release locks for I/O, which could be slow */
-			pthread_mutex_unlock(&job_fail_mutex);
+			slurm_mutex_unlock(&job_fail_mutex);
 			fd = slurm_open_msg_conn(&callback_addr);
 			sent = 0;
 			if (fd < 0) {
@@ -1760,7 +1760,7 @@ static void _send_event_callbacks(void)
 				}
 			}
 			/* Reset locks and clean-up as needed */
-io_fini:		pthread_mutex_lock(&job_fail_mutex);
+io_fini:		slurm_mutex_lock(&job_fail_mutex);
 			if ((sent != sizeof(uint32_t)) &&
 			    (job_fail_ptr->magic == FAILURE_MAGIC) &&
 			    (callback_jobid == job_fail_ptr->job_id)) {
@@ -1772,7 +1772,7 @@ io_fini:		pthread_mutex_lock(&job_fail_mutex);
 	}
 	list_iterator_destroy(job_iterator);
 	job_fail_save_time = time(NULL);
-	pthread_mutex_unlock(&job_fail_mutex);
+	slurm_mutex_unlock(&job_fail_mutex);
 }
 
 static void *_state_thread(void *no_data)
@@ -1805,9 +1805,9 @@ extern int spawn_state_thread(void)
 {
 	pthread_attr_t thread_attr_msg;
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -1817,7 +1817,7 @@ extern int spawn_state_thread(void)
 		fatal("pthread_create %m");
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -1825,7 +1825,7 @@ extern int spawn_state_thread(void)
 /* Terminate thread used to periodically save nonstop plugin state to disk */
 extern void term_state_thread(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		thread_shutdown = true;
 		pthread_join(msg_thread_id, NULL);
@@ -1833,5 +1833,5 @@ extern void term_state_thread(void)
 		thread_shutdown = false;
 		thread_running = false;
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
diff --git a/src/plugins/slurmctld/nonstop/msg.c b/src/plugins/slurmctld/nonstop/msg.c
index 1f20efc30..022674e62 100644
--- a/src/plugins/slurmctld/nonstop/msg.c
+++ b/src/plugins/slurmctld/nonstop/msg.c
@@ -62,7 +62,7 @@
 
 /* This version string is defined at configure time of libsmd. The
  * META of libsmd needs to reflect this version. */
-char *version_string = "VERSION:15.08";
+char *version_string = "VERSION:16.05";
 
 /* When a remote socket closes on AIX, we have seen poll() return EAGAIN
  * indefinitely for a pending write request. Rather than locking up
@@ -248,43 +248,44 @@ static void _proc_msg(slurm_fd_t new_fd, char *msg, slurm_addr_t cli_addr)
 		info("slurmctld/nonstop: msg decrypted:%s", msg_decrypted);
 	cmd_ptr = msg_decrypted;
 
-			   /* 123456789012345678901234567890 */
-	if (strncmp(cmd_ptr, version_string, 13) == 0) {
+	/* 123456789012345678901234567890 */
+	if (xstrncmp(cmd_ptr, version_string, 13) == 0) {
 		cmd_ptr = strchr(cmd_ptr + 13, ':');
 		if (cmd_ptr) {
 			cmd_ptr++;
 			protocol_version = SLURM_PROTOCOL_VERSION;
 		}
 	}
+
 	if (protocol_version == 0) {
 		info("slurmctld/nonstop: Message version invalid");
 		resp = xstrdup("Error:\"Message version invalid\"");
 		goto send_resp;
 	}
-	if (strncmp(cmd_ptr, "CALLBACK:JOBID:", 15) == 0) {
+	if (xstrncmp(cmd_ptr, "CALLBACK:JOBID:", 15) == 0) {
 		resp = register_callback(cmd_ptr, cmd_uid, cli_addr,
 					 protocol_version);
-	} else if (strncmp(cmd_ptr, "DRAIN:NODES:", 12) == 0) {
+	} else if (xstrncmp(cmd_ptr, "DRAIN:NODES:", 12) == 0) {
 		lock_slurmctld(node_write_lock);
 		resp = drain_nodes_user(cmd_ptr, cmd_uid, protocol_version);
 		unlock_slurmctld(node_write_lock);
-	} else if (strncmp(cmd_ptr, "DROP_NODE:JOBID:", 15) == 0) {
+	} else if (xstrncmp(cmd_ptr, "DROP_NODE:JOBID:", 15) == 0) {
 		lock_slurmctld(job_write_lock2);
 		resp = drop_node(cmd_ptr, cmd_uid, protocol_version);
 		unlock_slurmctld(job_write_lock2);
-	} else if (strncmp(cmd_ptr, "GET_FAIL_NODES:JOBID:", 21) == 0) {
+	} else if (xstrncmp(cmd_ptr, "GET_FAIL_NODES:JOBID:", 21) == 0) {
 		lock_slurmctld(job_read_lock);
 		resp = fail_nodes(cmd_ptr, cmd_uid, protocol_version);
 		unlock_slurmctld(job_read_lock);
-	} else if (strncmp(cmd_ptr, "REPLACE_NODE:JOBID:", 19) == 0) {
+	} else if (xstrncmp(cmd_ptr, "REPLACE_NODE:JOBID:", 19) == 0) {
 		lock_slurmctld(job_write_lock2);
 		resp = replace_node(cmd_ptr, cmd_uid, protocol_version);
 		unlock_slurmctld(job_write_lock2);
-	} else if (strncmp(cmd_ptr, "SHOW_CONFIG", 11) == 0) {
+	} else if (xstrncmp(cmd_ptr, "SHOW_CONFIG", 11) == 0) {
 		resp = show_config(cmd_ptr, cmd_uid, protocol_version);
-	} else if (strncmp(cmd_ptr, "SHOW_JOB:JOBID:", 15) == 0) {
+	} else if (xstrncmp(cmd_ptr, "SHOW_JOB:JOBID:", 15) == 0) {
 		resp = show_job(cmd_ptr, cmd_uid, protocol_version);
-	} else if (strncmp(cmd_ptr, "TIME_INCR:JOBID:", 16) == 0) {
+	} else if (xstrncmp(cmd_ptr, "TIME_INCR:JOBID:", 16) == 0) {
 		lock_slurmctld(job_write_lock);
 		resp = time_incr(cmd_ptr, cmd_uid, protocol_version);
 		unlock_slurmctld(job_write_lock);
@@ -357,10 +358,10 @@ extern int spawn_msg_thread(void)
 {
 	pthread_attr_t thread_attr_msg;
 
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		error("nonstop thread already running");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return SLURM_ERROR;
 	}
 
@@ -370,14 +371,14 @@ extern int spawn_msg_thread(void)
 		fatal("pthread_create %m");
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	return SLURM_SUCCESS;
 }
 
 extern void term_msg_thread(void)
 {
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
 		int fd;
 		slurm_addr_t addr;
@@ -402,5 +403,5 @@ extern void term_msg_thread(void)
 		thread_running = false;
 		debug2("join of slurmctld/nonstop thread was successful");
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
diff --git a/src/plugins/slurmctld/nonstop/read_config.c b/src/plugins/slurmctld/nonstop/read_config.c
index 8d24c22e3..3fc9347ee 100644
--- a/src/plugins/slurmctld/nonstop/read_config.c
+++ b/src/plugins/slurmctld/nonstop/read_config.c
@@ -229,7 +229,7 @@ static uid_t *_xlate_users(char *user_str, int *user_cnt)
 	tok = strtok_r(tmp_str, ",", &save_ptr);
 	while (tok) {
 		int rc = 0;
-		if (!strcasecmp(tok, "ALL"))
+		if (!xstrcasecmp(tok, "ALL"))
 			uid = NO_VAL;
 		else
 			rc = uid_from_string(tok, &uid);
@@ -256,7 +256,7 @@ static void _validate_config(void)
 	if (user_drain_deny) {
 		if (!user_drain_allow_str)
 			user_drain_allow_str = xstrdup("ALL");
-		if (strcasecmp(user_drain_allow_str, "ALL"))
+		if (xstrcasecmp(user_drain_allow_str, "ALL"))
 			fatal("nonstop.conf: Bad UserDrainAllow/Deny values");
 	}
 	user_drain_allow = _xlate_users(user_drain_allow_str,
diff --git a/src/plugins/slurmd/Makefile.in b/src/plugins/slurmd/Makefile.in
index d6b652ffb..8745603e5 100644
--- a/src/plugins/slurmd/Makefile.in
+++ b/src/plugins/slurmd/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/slurmd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/Makefile.in b/src/plugins/switch/Makefile.in
index ad64f2acf..916d2c40a 100644
--- a/src/plugins/switch/Makefile.in
+++ b/src/plugins/switch/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/cray/Makefile.in b/src/plugins/switch/cray/Makefile.in
index 11eb86546..9b7120635 100644
--- a/src/plugins/switch/cray/Makefile.in
+++ b/src/plugins/switch/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -252,8 +253,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -353,6 +352,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -391,6 +394,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -434,6 +440,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -484,6 +493,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/cray/cookies.c b/src/plugins/switch/cray/cookies.c
index d236ad693..a3e56cea5 100644
--- a/src/plugins/switch/cray/cookies.c
+++ b/src/plugins/switch/cray/cookies.c
@@ -127,11 +127,11 @@ extern int cleanup_lease_extender(void)
 
 	lease_extender_running = false;
 
-	pthread_mutex_lock(&cookie_id_mutex);
+	slurm_mutex_lock(&cookie_id_mutex);
 	xfree(cookie_id_list);
 	cookie_id_list_size = 0;
 	cookie_id_list_capacity = 0;
-	pthread_mutex_unlock(&cookie_id_mutex);
+	slurm_mutex_unlock(&cookie_id_mutex);
 
 	return SLURM_SUCCESS;
 }
@@ -249,12 +249,12 @@ static void _add_cookie(int32_t cookie_id)
 	int32_t i;
 
 	// Lock the mutex
-	pthread_mutex_lock(&cookie_id_mutex);
+	slurm_mutex_lock(&cookie_id_mutex);
 
 	// If the cookie is already in the list, skip
 	for (i = 0; i < cookie_id_list_size; i++) {
 		if (cookie_id_list[i] == cookie_id) {
-			pthread_mutex_unlock(&cookie_id_mutex);
+			slurm_mutex_unlock(&cookie_id_mutex);
 			CRAY_INFO("Duplicate cookie %"PRId32" found in tracked"
 				  " cookie list", cookie_id);
 			return;
@@ -278,7 +278,7 @@ static void _add_cookie(int32_t cookie_id)
 	cookie_id_list_size++;
 
 	// Unlock the mutex
-	pthread_mutex_unlock(&cookie_id_mutex);
+	slurm_mutex_unlock(&cookie_id_mutex);
 }
 
 /*
@@ -290,7 +290,7 @@ static void _remove_cookie(int32_t cookie_id)
 	int found = 0;
 
 	// Lock the mutex
-	pthread_mutex_lock(&cookie_id_mutex);
+	slurm_mutex_lock(&cookie_id_mutex);
 
 	// Find a match in the list
 	for (i = 0; i < cookie_id_list_size; i++) {
@@ -312,7 +312,7 @@ static void _remove_cookie(int32_t cookie_id)
 	}
 
 	// Unlock the mutex
-	pthread_mutex_unlock(&cookie_id_mutex);
+	slurm_mutex_unlock(&cookie_id_mutex);
 }
 
 static void *_lease_extender(void *args)
@@ -327,7 +327,7 @@ static void *_lease_extender(void *args)
 
 	while (lease_extender_running) {
 		// Lock the mutex
-		pthread_mutex_lock(&cookie_id_mutex);
+		slurm_mutex_lock(&cookie_id_mutex);
 
 		// If there are cookies, extend their leases
 		if (cookie_id_list_size > 0) {
@@ -344,7 +344,7 @@ static void *_lease_extender(void *args)
 		}
 
 		// Unlock the mutex
-		pthread_mutex_unlock(&cookie_id_mutex);
+		slurm_mutex_unlock(&cookie_id_mutex);
 
 		// Wait until we want to extend leases again
 		sleep(COOKIE_LEASE_INTERVAL);
diff --git a/src/plugins/switch/cray/gpu.c b/src/plugins/switch/cray/gpu.c
index c340c7ec9..bcb23e05e 100644
--- a/src/plugins/switch/cray/gpu.c
+++ b/src/plugins/switch/cray/gpu.c
@@ -62,10 +62,10 @@ static int _get_mps_request(stepd_step_rec_t *job)
 		return 2;
 	}
 
-	if (!strcasecmp(envval, "on") || !strcmp(envval, "1")) {
+	if (!xstrcasecmp(envval, "on") || !xstrcmp(envval, "1")) {
 		debug2("GPU mps requested on");
 		return 1;
-	} else if (!strcasecmp(envval, "off") || !strcmp(envval, "0")) {
+	} else if (!xstrcasecmp(envval, "off") || !xstrcmp(envval, "0")) {
 		debug2("GPU mps requested off");
 		return 0;
 	}
diff --git a/src/plugins/switch/cray/scaling.c b/src/plugins/switch/cray/scaling.c
index 8b59490d8..c1baae230 100644
--- a/src/plugins/switch/cray/scaling.c
+++ b/src/plugins/switch/cray/scaling.c
@@ -173,7 +173,7 @@ static uint32_t _get_mem_total(void)
 		if (lsz > 0) {
 			sscanf(lin, "%s %d", meminfo_str,
 			       &meminfo_value);
-			if (!strcmp(meminfo_str, "MemTotal:")) {
+			if (!xstrcmp(meminfo_str, "MemTotal:")) {
 				total_mem = meminfo_value;
 				break;
 			}
diff --git a/src/plugins/switch/cray/switch_cray.c b/src/plugins/switch/cray/switch_cray.c
index 65df561f0..4d1194495 100644
--- a/src/plugins/switch/cray/switch_cray.c
+++ b/src/plugins/switch/cray/switch_cray.c
@@ -186,6 +186,9 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 	int rc, cnt = 0;
 	int32_t *nodes = NULL;
 	slurm_cray_jobinfo_t *job = (slurm_cray_jobinfo_t *) switch_job;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (!job || (job->magic == CRAY_NULL_JOBINFO_MAGIC)) {
 		CRAY_DEBUG("switch_job was NULL");
@@ -208,6 +211,11 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 
 	// Get cookies for network configuration
 	rc = lease_cookies(job, nodes, step_layout->node_cnt);
+
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+
 	xfree(nodes);
 	if (rc != SLURM_SUCCESS) {
 		return rc;
@@ -223,6 +231,9 @@ extern void switch_p_free_jobinfo(switch_jobinfo_t *switch_job)
 {
 	slurm_cray_jobinfo_t *job = (slurm_cray_jobinfo_t *) switch_job;
 	int i;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (!job || (job->magic == CRAY_NULL_JOBINFO_MAGIC)) {
 		CRAY_DEBUG("switch_job was NULL");
@@ -253,6 +264,9 @@ extern void switch_p_free_jobinfo(switch_jobinfo_t *switch_job)
 	if (job->num_ptags)
 		xfree(job->ptags);
 	xfree(job);
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return;
 }
@@ -463,6 +477,9 @@ extern int switch_p_job_init(stepd_step_rec_t *job)
 	char *npc = "none";
 	int access = ALPSC_NET_PERF_CTR_NONE;
 #endif
+	DEF_TIMERS;
+
+	START_TIMER;
 
 #ifdef HAVE_CRAY_NETWORK
 	/* No PAGG job containers; uid used instead to configure network */
@@ -574,9 +591,9 @@ extern int switch_p_job_init(stepd_step_rec_t *job)
 		SELECT_JOBDATA_NETWORK, &npc);
 	CRAY_DEBUG("network performance counters SELECT_JOBDATA_NETWORK %s",
 		npc);
-	if (strcasecmp(npc, "system") == 0) {
+	if (xstrcasecmp(npc, "system") == 0) {
 		access = ALPSC_NET_PERF_CTR_SYSTEM;
-	} else if (strcasecmp(npc, "blade") == 0) {
+	} else if (xstrcasecmp(npc, "blade") == 0) {
 		access = ALPSC_NET_PERF_CTR_BLADE;
 	}
 	if (access != ALPSC_NET_PERF_CTR_NONE) {
@@ -642,7 +659,11 @@ extern int switch_p_job_init(stepd_step_rec_t *job)
 	job_setapid(getpid(), sw_job->apid);
 #endif
 
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
+
 	return SLURM_SUCCESS;
 }
 
@@ -687,6 +708,9 @@ extern int switch_p_job_fini(switch_jobinfo_t *jobinfo)
 {
 #if defined(HAVE_NATIVE_CRAY) || defined(HAVE_CRAY_NETWORK)
 	slurm_cray_jobinfo_t *job = (slurm_cray_jobinfo_t *) jobinfo;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (!job || (job->magic == CRAY_NULL_JOBINFO_MAGIC)) {
 		CRAY_ERR("jobinfo pointer was NULL");
@@ -728,6 +752,9 @@ extern int switch_p_job_fini(switch_jobinfo_t *jobinfo)
 	unlink_iaa_file(job);
 #endif
 
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -741,6 +768,9 @@ extern int switch_p_job_postfini(stepd_step_rec_t *job)
 #ifdef HAVE_NATIVE_CRAY
         int gpu_cnt = 0;
 #endif
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (!job->switch_job) {
 		CRAY_DEBUG("job->switch_job was NULL");
@@ -789,6 +819,9 @@ extern int switch_p_job_postfini(stepd_step_rec_t *job)
 			 rc);
 	}
 
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -874,6 +907,9 @@ extern int switch_p_job_step_complete(switch_jobinfo_t *jobinfo,
 #if defined(HAVE_NATIVE_CRAY) || defined(HAVE_CRAY_NETWORK)
 	slurm_cray_jobinfo_t *job = (slurm_cray_jobinfo_t *) jobinfo;
 	int rc = 0;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (!job || (job->magic == CRAY_NULL_JOBINFO_MAGIC)) {
 		CRAY_DEBUG("switch_job was NULL");
@@ -889,6 +925,9 @@ extern int switch_p_job_step_complete(switch_jobinfo_t *jobinfo,
 	if (rc != SLURM_SUCCESS) {
 		return rc;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -938,6 +977,9 @@ extern int switch_p_job_step_pre_suspend(stepd_step_rec_t *job)
 	slurm_cray_jobinfo_t *jobinfo = (slurm_cray_jobinfo_t *)job->switch_job;
 	char *err_msg = NULL;
 	int rc;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	rc = alpsc_pre_suspend(&err_msg, job->cont_id, jobinfo->ptags,
 			       jobinfo->num_ptags, SUSPEND_TIMEOUT_MSEC);
@@ -945,6 +987,9 @@ extern int switch_p_job_step_pre_suspend(stepd_step_rec_t *job)
 	if (rc != 1) {
 		return SLURM_ERROR;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -958,12 +1003,18 @@ extern int switch_p_job_step_post_suspend(stepd_step_rec_t *job)
 #if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
 	char *err_msg = NULL;
 	int rc;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	rc = alpsc_post_suspend(&err_msg, job->cont_id);
 	ALPSC_CN_DEBUG("alpsc_post_suspend");
 	if (rc != 1) {
 		return SLURM_ERROR;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -978,6 +1029,9 @@ extern int switch_p_job_step_pre_resume(stepd_step_rec_t *job)
 	slurm_cray_jobinfo_t *jobinfo = (slurm_cray_jobinfo_t *)job->switch_job;
 	char *err_msg = NULL;
 	int rc;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	rc = alpsc_pre_resume(&err_msg, job->cont_id, jobinfo->ptags,
 			       jobinfo->num_ptags);
@@ -985,6 +1039,9 @@ extern int switch_p_job_step_pre_resume(stepd_step_rec_t *job)
 	if (rc != 1) {
 		return SLURM_ERROR;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -998,12 +1055,18 @@ extern int switch_p_job_step_post_resume(stepd_step_rec_t *job)
 #if defined(HAVE_NATIVE_CRAY_GA) && !defined(HAVE_CRAY_NETWORK)
 	char *err_msg = NULL;
 	int rc;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	rc = alpsc_post_resume(&err_msg, job->cont_id);
 	ALPSC_CN_DEBUG("alpsc_post_resume");
 	if (rc != 1) {
 		return SLURM_ERROR;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
diff --git a/src/plugins/switch/cray/switch_cray.h b/src/plugins/switch/cray/switch_cray.h
index 2007f57dd..0a629da05 100644
--- a/src/plugins/switch/cray/switch_cray.h
+++ b/src/plugins/switch/cray/switch_cray.h
@@ -175,15 +175,15 @@ extern int release_cookies(slurm_cray_jobinfo_t *job);
 /**********************************************************
  * Macros
  **********************************************************/
-#define ALPSC_CN_DEBUG(f) alpsc_debug(THIS_FILE, __LINE__, __FUNCTION__, \
+#define ALPSC_CN_DEBUG(f) alpsc_debug(THIS_FILE, __LINE__, __func__, \
 					rc, 1, f, &err_msg);
-#define ALPSC_SN_DEBUG(f) alpsc_debug(THIS_FILE, __LINE__, __FUNCTION__, \
+#define ALPSC_SN_DEBUG(f) alpsc_debug(THIS_FILE, __LINE__, __func__, \
 					rc, 0, f, &err_msg);
 #define CRAY_ERR(fmt, ...) error("(%s: %d: %s) "fmt, THIS_FILE, __LINE__, \
-				 __FUNCTION__, ##__VA_ARGS__);
+				 __func__, ##__VA_ARGS__);
 #define CRAY_DEBUG(fmt, ...) debug2("(%s: %d: %s) "fmt, THIS_FILE, __LINE__, \
-				    __FUNCTION__, ##__VA_ARGS__);
+				    __func__, ##__VA_ARGS__);
 #define CRAY_INFO(fmt, ...) info("(%s: %d: %s) "fmt, THIS_FILE, __LINE__, \
-				 __FUNCTION__, ##__VA_ARGS__);
+				 __func__, ##__VA_ARGS__);
 
 #endif /* SWITCH_CRAY_H */
diff --git a/src/plugins/switch/cray/util.c b/src/plugins/switch/cray/util.c
index 9c74eb84e..4185ef812 100644
--- a/src/plugins/switch/cray/util.c
+++ b/src/plugins/switch/cray/util.c
@@ -276,7 +276,7 @@ void recursive_rmdir(const char *dirnm)
 		name_len = strlen(dir->d_name);
 		if (name_len == 1 && dir->d_name[0] == '.')
 			continue;
-		if (name_len == 2 && strcmp(dir->d_name, "..") == 0)
+		if (name_len == 2 && xstrcmp(dir->d_name, "..") == 0)
 			continue;
 		fnm_len = dirnm_len + name_len + 2;
 		free(fnm);
diff --git a/src/plugins/switch/generic/Makefile.in b/src/plugins/switch/generic/Makefile.in
index 53d1b73a7..245071e94 100644
--- a/src/plugins/switch/generic/Makefile.in
+++ b/src/plugins/switch/generic/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch/generic
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/generic/switch_generic.c b/src/plugins/switch/generic/switch_generic.c
index 26211607a..fabf1d68e 100644
--- a/src/plugins/switch/generic/switch_generic.c
+++ b/src/plugins/switch/generic/switch_generic.c
@@ -40,9 +40,6 @@
 #  include "config.h"
 #endif
 
-#if !defined(__FreeBSD__)
-#include <net/if.h>
-#endif
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <sys/types.h>
@@ -56,6 +53,11 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 
+/* net/if.h must come after sys/types.h on NetBSD */
+#if !defined(__FreeBSD__)
+#include <net/if.h>
+#endif
+
 #include "slurm/slurm_errno.h"
 #include "src/common/slurm_xlator.h"
 #include "src/common/xmalloc.h"
@@ -134,28 +136,6 @@ sw_gen_libstate_t *libstate = NULL;
 extern int switch_p_free_node_info(switch_node_info_t **switch_node);
 extern int switch_p_alloc_node_info(switch_node_info_t **switch_node);
 
-/* The _lock() and _unlock() functions are used to lock/unlock a
- * global mutex.  Used to serialize access to the global library
- * state variable nrt_state.
- */
-static void _lock(void)
-{
-	int err = 1;
-
-	while (err) {
-		err = pthread_mutex_lock(&global_lock);
-	}
-}
-
-static void _unlock(void)
-{
-	int err = 1;
-
-	while (err) {
-		err = pthread_mutex_unlock(&global_lock);
-	}
-}
-
 static void
 _alloc_libstate(void)
 {
@@ -241,7 +221,7 @@ _find_node(char *node_name)
 		n = libstate->hash_table[i];
 		while (n) {
 			xassert(n->magic == SW_GEN_NODE_INFO_MAGIC);
-			if (!strcmp(n->node_name, node_name))
+			if (!xstrcmp(n->node_name, node_name))
 				return n;
 			n = n->next;
 		}
@@ -254,7 +234,7 @@ _find_node(char *node_name)
 		n = libstate->hash_table[i];
 		while (n) {
 			xassert(n->magic == SW_GEN_NODE_INFO_MAGIC);
-			if (!strcmp(n->node_name, node_name))
+			if (!xstrcmp(n->node_name, node_name))
 				return n;
 			n = n->next;
 		}
@@ -292,7 +272,7 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
 	struct sw_gen_node_info *next;
 	bool new_alloc;      /* True if this is new node to be added to cache */
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	old_node_info = _find_node(new_node_info->node_name);
 	new_alloc = (old_node_info == NULL);
 	if (new_alloc) {
@@ -314,7 +294,7 @@ static void _cache_node_info(sw_gen_node_info_t *new_node_info)
 
 	if (new_alloc)
 		_hash_add_nodeinfo(old_node_info);
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 }
 
 /*
@@ -330,9 +310,9 @@ int init(void)
 
 int fini(void)
 {
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	_free_libstate();
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 	return SLURM_SUCCESS;
 }
 
@@ -358,9 +338,9 @@ int switch_p_libstate_restore(char * dir_name, bool recover)
 	if (debug_flags & DEBUG_FLAG_SWITCH)
 		info("switch_p_libstate_restore() starting");
 	/* No state saved or restored for this plugin, just initialize */
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	_alloc_libstate();
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return SLURM_SUCCESS;
 }
diff --git a/src/plugins/switch/none/Makefile.in b/src/plugins/switch/none/Makefile.in
index 9fe411c82..8c1c939c0 100644
--- a/src/plugins/switch/none/Makefile.in
+++ b/src/plugins/switch/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/nrt/Makefile.in b/src/plugins/switch/nrt/Makefile.in
index f5162b9f8..15a726f9f 100644
--- a/src/plugins/switch/nrt/Makefile.in
+++ b/src/plugins/switch/nrt/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch/nrt
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -297,8 +298,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -398,6 +397,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -436,6 +439,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -479,6 +485,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -529,6 +538,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/nrt/libpermapi/Makefile.in b/src/plugins/switch/nrt/libpermapi/Makefile.in
index 313568ede..bc31acc39 100644
--- a/src/plugins/switch/nrt/libpermapi/Makefile.in
+++ b/src/plugins/switch/nrt/libpermapi/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/switch/nrt/libpermapi
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/switch/nrt/libpermapi/shr_64.c b/src/plugins/switch/nrt/libpermapi/shr_64.c
index c8cd4d611..0285210ca 100644
--- a/src/plugins/switch/nrt/libpermapi/shr_64.c
+++ b/src/plugins/switch/nrt/libpermapi/shr_64.c
@@ -118,7 +118,7 @@ static char *_name_from_addr(char *addr)
 	xassert(host_usage);
 	host_ptr = host_usage;
 	while (host_ptr && host_ptr->host_address) {
-		if (!strcmp(addr, host_ptr->host_address))
+		if (!xstrcmp(addr, host_ptr->host_address))
 			return host_ptr->host_name;
 		host_ptr++;
 	}
@@ -1317,11 +1317,11 @@ extern int pe_rm_get_job_info(rmhandle_t resource_mgr, job_info_t **job_info,
 			*token = strtok_r(network_str, ",", &save_ptr);
 		while (token) {
 			/* network options */
-			if (!strcasecmp(token, "ip")   ||
-			    !strcasecmp(token, "ipv4")  ||
-			    !strcasecmp(token, "ipv6")) {
+			if (!xstrcasecmp(token, "ip")   ||
+			    !xstrcasecmp(token, "ipv4")  ||
+			    !xstrcasecmp(token, "ipv6")) {
 				mode = "IP";
-			} else if (!strcasecmp(token, "us")) {
+			} else if (!xstrcasecmp(token, "us")) {
 				mode = "US";
 			}
 			/* Currently ignoring all other options */
@@ -1590,37 +1590,37 @@ extern int pe_rm_init(int *rmapi_version, rmhandle_t *resource_mgr, char *rm_id,
 			while (tok) {
 				if ((tok_inx == 1) && !myargv[1]) {
 					myargv[1] = xstrdup(tok);
-				} else if (!strcmp(tok, "-adapter_use")) {
+				} else if (!xstrcmp(tok, "-adapter_use")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					adapter_use = xstrdup(tok);
-				} else if (!strcmp(tok, "-collective_groups")){
+				} else if (!xstrcmp(tok, "-collective_groups")){
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					collectives = xstrdup(tok);
-				} else if (!strcmp(tok, "-euidevice")) {
+				} else if (!xstrcmp(tok, "-euidevice")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					euidevice = xstrdup(tok);
-				} else if (!strcmp(tok, "-euilib")) {
+				} else if (!xstrcmp(tok, "-euilib")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					euilib = xstrdup(tok);
-				} else if (!strcmp(tok, "-imm_send_buffers")) {
+				} else if (!xstrcmp(tok, "-imm_send_buffers")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					immediate = xstrdup(tok);
-				} else if (!strcmp(tok, "-instances")) {
+				} else if (!xstrcmp(tok, "-instances")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
 					instances = xstrdup(tok);
-				} else if (!strcmp(tok, "-use_bulk_xfer")) {
+				} else if (!xstrcmp(tok, "-use_bulk_xfer")) {
 					tok = strtok_r(NULL, " ", &save_ptr);
 					if (!tok)
 						break;
@@ -1670,7 +1670,7 @@ extern int pe_rm_init(int *rmapi_version, rmhandle_t *resource_mgr, char *rm_id,
 			}
 			xfree(opt.network);
 			if (adapter_use) {
-				if (!strcmp(adapter_use, "dedicated"))
+				if (!xstrcmp(adapter_use, "dedicated"))
 					opt.exclusive = true;
 				xfree(adapter_use);
 			}
@@ -1703,7 +1703,7 @@ extern int pe_rm_init(int *rmapi_version, rmhandle_t *resource_mgr, char *rm_id,
 				xstrcat(opt.network, "instances=");
 				xstrcat(opt.network, instances);
 			}
-			if (bulk_xfer && !strcmp(bulk_xfer, "yes")) {
+			if (bulk_xfer && !xstrcmp(bulk_xfer, "yes")) {
 				if (opt.network)
 					xstrcat(opt.network, ",");
 				xstrcat(opt.network, "bulk_xfer");
diff --git a/src/plugins/switch/nrt/nrt.c b/src/plugins/switch/nrt/nrt.c
index 7daffc7f4..4bb987962 100644
--- a/src/plugins/switch/nrt/nrt.c
+++ b/src/plugins/switch/nrt/nrt.c
@@ -303,7 +303,6 @@ static int	_job_step_window_state(slurm_nrt_jobinfo_t *jp,
 				       hostlist_t hl, win_state_t state);
 static int	_load_min_window_id(char *adapter_name,
 				    nrt_adapter_t adapter_type);
-static void	_lock(void);
 static nrt_job_key_t _next_key(void);
 static int	_pack_libstate(slurm_nrt_libstate_t *lp, Buf buffer,
 			       uint16_t protocol_version);
@@ -314,7 +313,6 @@ static char *	_state_str(win_state_t state);
 static int	_unload_window_all_jobs(char *adapter_name,
 					nrt_adapter_t adapter_type,
 					nrt_window_id_t window_id);
-static void	_unlock(void);
 static int	_unpack_libstate(slurm_nrt_libstate_t *lp, Buf buffer);
 static int	_unpack_nodeinfo(slurm_nrt_nodeinfo_t *n, Buf buf,
 				 bool believe_window_status,
@@ -332,29 +330,6 @@ static int	_wait_job(nrt_job_key_t job_key,preemption_state_t want_state,
 static char *	_win_state_str(win_state_t state);
 static int	_window_state_set(slurm_nrt_jobinfo_t *jp, char *hostname,
 				  win_state_t state);
-/* The _lock() and _unlock() functions are used to lock/unlock a
- * global mutex.  Used to serialize access to the global library
- * state variable nrt_state.
- */
-static void
-_lock(void)
-{
-	int err = 1;
-
-	while (err) {
-		err = pthread_mutex_lock(&global_lock);
-	}
-}
-
-static void
-_unlock(void)
-{
-	int err = 1;
-
-	while (err) {
-		err = pthread_mutex_unlock(&global_lock);
-	}
-}
 
 /* The lid caching functions were created to avoid unnecessary
  * function calls each time we need to load network tables on a node.
@@ -485,7 +460,7 @@ _find_node(slurm_nrt_libstate_t *lp, char *name)
 		n = lp->hash_table[i];
 		while (n) {
 			xassert(n->magic == NRT_NODEINFO_MAGIC);
-			if (!strncmp(n->name, name, NRT_HOSTLEN))
+			if (!xstrncmp(n->name, name, NRT_HOSTLEN))
 				return n;
 			n = n->next;
 		}
@@ -498,8 +473,8 @@ _find_node(slurm_nrt_libstate_t *lp, char *name)
 		n = lp->hash_table[i];
 		while (n) {
 			xassert(n->magic == NRT_NODEINFO_MAGIC);
-			if (!strncmp(n->name, node_ptr->node_hostname,
-				     NRT_HOSTLEN))
+			if (!xstrncmp(n->name, node_ptr->node_hostname,
+				      NRT_HOSTLEN))
 				return n;
 			n = n->next;
 		}
@@ -642,7 +617,7 @@ _job_step_window_state(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_ERROR;
 	}
 
@@ -656,13 +631,13 @@ _job_step_window_state(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 		return SLURM_SUCCESS;
 
 	hi = hostlist_iterator_create(hl);
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	while ((host = hostlist_next(hi))) {
 		err = _window_state_set(jp, host, state);
 		rc = MAX(rc, err);
 		free(host);
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 	hostlist_iterator_destroy(hi);
 
 	return rc;
@@ -729,8 +704,8 @@ _window_state_set(slurm_nrt_jobinfo_t *jp, char *hostname, win_state_t state)
 		/* Find the adapter that matches the one in tableinfo */
 		for (j = 0; j < node->adapter_count; j++) {
 			adapter = &node->adapter_list[j];
-			if (strcasecmp(adapter->adapter_name,
-				       tableinfo[i].adapter_name))
+			if (xstrcasecmp(adapter->adapter_name,
+					tableinfo[i].adapter_name))
 				continue;
 			for (task_id = 0; task_id < tableinfo[i].table_length;
 			     task_id++) {
@@ -1347,8 +1322,8 @@ _allocate_window_single(char *adapter_name, slurm_nrt_jobinfo_t *jp,
 		debug2("adapter %s at index %d",
 		       node->adapter_list[i].adapter_name, i);
 		if (adapter_name) {
-			if (!strcasecmp(node->adapter_list[i].adapter_name,
-					adapter_name)) {
+			if (!xstrcasecmp(node->adapter_list[i].adapter_name,
+					 adapter_name)) {
 				adapter = &node->adapter_list[i];
 				break;
 			}
@@ -1824,7 +1799,7 @@ _print_jobinfo(slurm_nrt_jobinfo_t *j)
 
 	if ((j == NULL) || (j->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return;
 	}
 
@@ -1929,10 +1904,10 @@ nrt_init(void)
 	slurm_nrt_libstate_t *tmp;
 
 	tmp = _alloc_libstate();
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	xassert(!nrt_state);
 	nrt_state = tmp;
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return SLURM_SUCCESS;
 }
@@ -2392,9 +2367,9 @@ nrt_build_nodeinfo(slurm_nrt_nodeinfo_t *n, char *name)
 	xassert(name);
 
 	strncpy(n->name, name, NRT_HOSTLEN);
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	err = _get_adapters(n);
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return err;
 }
@@ -2566,7 +2541,7 @@ _fake_unpack_adapters(Buf buf, slurm_nrt_nodeinfo_t *n,
 
 		for (j = 0; j < n->adapter_count; j++) {
 			tmp_a = n->adapter_list + j;
-			if (strcmp(tmp_a->adapter_name, name_ptr))
+			if (xstrcmp(tmp_a->adapter_name, name_ptr))
 				continue;
 			if (tmp_a->cau_indexes_avail != cau_indexes_avail) {
 				info("switch/nrt: resetting cau_indexes_avail "
@@ -2818,9 +2793,9 @@ nrt_unpack_nodeinfo(slurm_nrt_nodeinfo_t *n, Buf buf, uint16_t protocol_version)
 {
 	int rc;
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	rc = _unpack_nodeinfo(n, buf, false, protocol_version);
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 	return rc;
 }
 
@@ -2866,7 +2841,7 @@ nrt_job_step_complete(slurm_nrt_jobinfo_t *jp, hostlist_t hl)
 	xassert(!hostlist_is_empty(hl));
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_ERROR;
 	}
 
@@ -2888,7 +2863,7 @@ nrt_job_step_complete(slurm_nrt_jobinfo_t *jp, hostlist_t hl)
 	hostlist_uniq(uniq_hl);
 	hi = hostlist_iterator_create(uniq_hl);
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	if (nrt_state != NULL) {
 		while ((node_name = hostlist_next(hi)) != NULL) {
 			_free_resources_by_job(jp, node_name);
@@ -2902,7 +2877,7 @@ nrt_job_step_complete(slurm_nrt_jobinfo_t *jp, hostlist_t hl)
 		 */
 		debug("nrt_job_step_complete called when nrt_state == NULL");
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	hostlist_iterator_destroy(hi);
 	hostlist_destroy(uniq_hl);
@@ -2949,12 +2924,12 @@ _next_key(void)
 
 	xassert(nrt_state);
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	key = nrt_state->key_index;
 	if (key == 0)
 		key++;
 	nrt_state->key_index = (nrt_job_key_t) (key + 1);
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return key;
 }
@@ -2975,8 +2950,8 @@ static nrt_protocol_table_t *_get_protocol_table(char *protocol)
 	token = strtok_r(protocol_str, ",", &save_ptr);
 	while (token) {
 		for (i = 0; i < protocol_table->protocol_table_cnt; i++) {
-			if (!strcmp(token, protocol_table->protocol_table[i].
-					   protocol_name))
+			if (!xstrcmp(token, protocol_table->protocol_table[i].
+					    protocol_name))
 				break;
 		}
 		if ((i >= protocol_table->protocol_table_cnt) &&
@@ -3040,7 +3015,7 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_ERROR;
 	}
 
@@ -3073,7 +3048,7 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 	 */
 	hi = hostlist_iterator_create(hl);
 	host = hostlist_next(hi);
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	node = _find_node(nrt_state, host);
 	if (host != NULL)
 		free(host);
@@ -3082,8 +3057,8 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 			nrt_adapter_t ad_type;
 			/* Match specific adapter name */
 			if (adapter_name &&
-			    strcmp(adapter_name,
-				   node->adapter_list[i].adapter_name)) {
+			    xstrcmp(adapter_name,
+				    node->adapter_list[i].adapter_name)) {
 				continue;
 			}
 			/* Match specific adapter type (IB, HFI, etc) */
@@ -3125,7 +3100,7 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 		jp->tables_per_task = 0;
 		info("switch/nrt: no adapter found for job");
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 	if (jp->tables_per_task == 0) {
 		hostlist_iterator_destroy(hi);
 		return SLURM_FAILURE;
@@ -3196,7 +3171,7 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 	}
 
 	if (jp->tables_per_task) {
-		_lock();
+		slurm_mutex_lock(&global_lock);
 		for  (i = 0; i < nnodes; i++) {
 			host = hostlist_next(hi);
 			if (!host)
@@ -3221,13 +3196,13 @@ nrt_build_jobinfo(slurm_nrt_jobinfo_t *jp, hostlist_t hl,
 								instances, j);
 				}
 				if (rc != SLURM_SUCCESS) {
-					_unlock();
+					slurm_mutex_unlock(&global_lock);
 					goto fail;
 				}
 			}
 			free(host);
 		}
-		_unlock();
+		slurm_mutex_unlock(&global_lock);
 	}
 
 
@@ -3513,7 +3488,7 @@ nrt_unpack_jobinfo(slurm_nrt_jobinfo_t *j, Buf buf,
 
 	if (j->magic == NRT_NULL_MAGIC) {
 		debug2("(%s: %d: %s) Nothing to unpack.",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_SUCCESS;
 	}
 
@@ -3600,7 +3575,7 @@ nrt_get_jobinfo(slurm_nrt_jobinfo_t *jp, int key, void *data)
 
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_SUCCESS;
 	}
 
@@ -3795,7 +3770,7 @@ nrt_load_table(slurm_nrt_jobinfo_t *jp, int uid, int pid, char *job_name)
 
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_ERROR;
 	}
 
@@ -3970,7 +3945,7 @@ nrt_unload_table(slurm_nrt_jobinfo_t *jp)
 {
 	if ((jp == NULL) || (jp->magic == NRT_NULL_MAGIC)) {
 		debug2("(%s: %d: %s) job->switch_job was NULL",
-		       THIS_FILE, __LINE__, __FUNCTION__);
+		       THIS_FILE, __LINE__, __func__);
 		return SLURM_ERROR;
 	}
 
@@ -4039,7 +4014,7 @@ _pack_libstate(slurm_nrt_libstate_t *lp, Buf buffer, uint16_t protocol_version)
 extern void
 nrt_libstate_save(Buf buffer, bool free_flag)
 {
-	_lock();
+	slurm_mutex_lock(&global_lock);
 
 	if (nrt_state != NULL)
 		_pack_libstate(nrt_state, buffer, SLURM_PROTOCOL_VERSION);
@@ -4050,7 +4025,7 @@ nrt_libstate_save(Buf buffer, bool free_flag)
 		_free_libstate(nrt_state);
 		nrt_state = NULL;	/* freed above */
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 }
 
 /* Used by: slurmctld */
@@ -4066,7 +4041,7 @@ _unpack_libstate(slurm_nrt_libstate_t *lp, Buf buffer)
 	/* Validate state version */
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
 	debug3("Version string in job_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, NRT_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, NRT_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t) NO_VAL) {
@@ -4112,17 +4087,17 @@ nrt_libstate_restore(Buf buffer)
 {
 	int rc;
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	xassert(!nrt_state);
 
 	nrt_state = _alloc_libstate();
 	if (!nrt_state) {
 		error("nrt_libstate_restore nrt_state is NULL");
-		_unlock();
+		slurm_mutex_unlock(&global_lock);
 		return SLURM_FAILURE;
 	}
 	rc = _unpack_libstate(nrt_state, buffer);
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return rc;
 }
@@ -4141,10 +4116,10 @@ nrt_libstate_clear(void)
 	else
 		debug3("Clearing state on all windows in global NRT state");
 
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	if (!nrt_state || !nrt_state->node_list) {
 		error("nrt_state or node_list not initialized!");
-		_unlock();
+		slurm_mutex_unlock(&global_lock);
 		return SLURM_ERROR;
 	}
 
@@ -4164,7 +4139,7 @@ nrt_libstate_clear(void)
 			}
 		}
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return SLURM_SUCCESS;
 }
@@ -4476,19 +4451,19 @@ extern bool nrt_adapter_name_check(char *token, hostlist_t hl)
 	hi = hostlist_iterator_create(hl);
 	host = hostlist_next(hi);
 	hostlist_iterator_destroy(hi);
-	_lock();
+	slurm_mutex_lock(&global_lock);
 	node = _find_node(nrt_state, host);
 	if (host)
 		free(host);
 	if (node && node->adapter_list) {
 		for (i = 0; i < node->adapter_count; i++) {
-			if (strcmp(token,node->adapter_list[i].adapter_name))
+			if (xstrcmp(token,node->adapter_list[i].adapter_name))
 				continue;
 			name_found = true;
 			break;
 		}
 	}
-	_unlock();
+	slurm_mutex_unlock(&global_lock);
 
 	return name_found;
 }
diff --git a/src/plugins/switch/nrt/switch_nrt.c b/src/plugins/switch/nrt/switch_nrt.c
index 303634d85..b7fd38bb2 100644
--- a/src/plugins/switch/nrt/switch_nrt.c
+++ b/src/plugins/switch/nrt/switch_nrt.c
@@ -515,7 +515,7 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 				info("switch/nrt: invalid option: %s", token);
 				err = SLURM_ERROR;
 			}
-		} else if (!strcasecmp(token, "bulk_xfer")) {
+		} else if (!xstrcasecmp(token, "bulk_xfer")) {
 			bulk_xfer = true;
 
 		/* device name options */
@@ -526,9 +526,9 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 				      "network string", token);
 				adapter_name = xstrdup(name_ptr);
 				sn_all = false;
-			} else if (!strcasecmp(name_ptr, "sn_all")) {
+			} else if (!xstrcasecmp(name_ptr, "sn_all")) {
 				sn_all = true;
-			} else if (!strcasecmp(name_ptr, "sn_single")) {
+			} else if (!xstrcasecmp(name_ptr, "sn_single")) {
 				sn_all = false;
 			} else {
 				info("switch/nrt: invalid devname: %s",
@@ -539,19 +539,19 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 		/* device type options */
 		} else if (!strncasecmp(token, "devtype=", 8)) {
 			char *type_ptr = token + 8;
-			if (!strcasecmp(type_ptr, "ib")) {
+			if (!xstrcasecmp(type_ptr, "ib")) {
 				dev_type = NRT_IB;
-			} else if (!strcasecmp(type_ptr, "hfi")) {
+			} else if (!xstrcasecmp(type_ptr, "hfi")) {
 				dev_type = NRT_HFI;
-			} else if (!strcasecmp(type_ptr, "iponly")) {
+			} else if (!xstrcasecmp(type_ptr, "iponly")) {
 				dev_type = NRT_IPONLY;
-			} else if (!strcasecmp(type_ptr, "hpce")) {
+			} else if (!xstrcasecmp(type_ptr, "hpce")) {
 				dev_type = NRT_HPCE;
-			} else if (!strcasecmp(type_ptr, "kmux")) {
+			} else if (!xstrcasecmp(type_ptr, "kmux")) {
 				dev_type = NRT_KMUX;
-			} else if (!strcasecmp(type_ptr, "sn_all")) {
+			} else if (!xstrcasecmp(type_ptr, "sn_all")) {
 				sn_all = true;
-			} else if (!strcasecmp(type_ptr, "sn_single")) {
+			} else if (!xstrcasecmp(type_ptr, "sn_single")) {
 				sn_all = false;
 			} else {
 				info("switch/nrt: invalid option: %s", token);
@@ -573,13 +573,13 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 			}
 
 		/* network options */
-		} else if (!strcasecmp(token, "ip")) {
+		} else if (!xstrcasecmp(token, "ip")) {
 			ip_v4 = true;
-		} else if (!strcasecmp(token, "ipv4")) {
+		} else if (!xstrcasecmp(token, "ipv4")) {
 			ip_v4 = true;
-		} else if (!strcasecmp(token, "ipv6")) {
+		} else if (!xstrcasecmp(token, "ipv6")) {
 			ip_v4 = false;
-		} else if (!strcasecmp(token, "us")) {
+		} else if (!xstrcasecmp(token, "us")) {
 			user_space = true;
 
 		/* protocol options */
@@ -593,9 +593,9 @@ extern int switch_p_build_jobinfo(switch_jobinfo_t *switch_job,
 			xstrcat(protocol, token);
 
 		/* adapter options */
-		} else if (!strcasecmp(token, "sn_all")) {
+		} else if (!xstrcasecmp(token, "sn_all")) {
 			sn_all = true;
-		} else if (!strcasecmp(token, "sn_single")) {
+		} else if (!xstrcasecmp(token, "sn_single")) {
 			sn_all = false;
 
 		/* Collective Acceleration Units (CAU) */
diff --git a/src/plugins/task/Makefile.in b/src/plugins/task/Makefile.in
index a7ba4c44a..153a42355 100644
--- a/src/plugins/task/Makefile.in
+++ b/src/plugins/task/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/task
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/task/affinity/Makefile.in b/src/plugins/task/affinity/Makefile.in
index 1e62f6ea9..533e911e4 100644
--- a/src/plugins/task/affinity/Makefile.in
+++ b/src/plugins/task/affinity/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/task/affinity
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -261,8 +262,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -362,6 +361,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -400,6 +403,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -443,6 +449,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -493,6 +502,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/task/affinity/affinity.c b/src/plugins/task/affinity/affinity.c
index 43730e54b..d4f4a558c 100644
--- a/src/plugins/task/affinity/affinity.c
+++ b/src/plugins/task/affinity/affinity.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/plugins/task/affinity/affinity.c - task affinity plugin
- *  $Id: affinity.c,v 1.2 2005/11/04 02:46:51 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2005-2006 Hewlett-Packard Development Company, L.P.
  *
@@ -235,7 +234,7 @@ int get_cpuset(cpu_set_t *mask, stepd_step_rec_t *job)
 
 	if (job->cpu_bind_type & CPU_BIND_MAP) {
 		unsigned int mycpu = 0;
-		if (strncmp(mstr, "0x", 2) == 0) {
+		if (xstrncmp(mstr, "0x", 2) == 0) {
 			mycpu = strtoul (&(mstr[2]), NULL, 16);
 		} else {
 			mycpu = strtoul (mstr, NULL, 10);
@@ -280,7 +279,7 @@ int get_cpuset(cpu_set_t *mask, stepd_step_rec_t *job)
 		 * domain. Otherwise bind this task to the given
 		 * socket */
 		uint32_t myldom = 0;
-		if (strncmp(mstr, "0x", 2) == 0) {
+		if (xstrncmp(mstr, "0x", 2) == 0) {
 			myldom = strtoul (&(mstr[2]), NULL, 16);
 		} else {
 			myldom = strtoul (mstr, NULL, 10);
diff --git a/src/plugins/task/affinity/affinity.h b/src/plugins/task/affinity/affinity.h
index 4d81cd4f6..eb40f3847 100644
--- a/src/plugins/task/affinity/affinity.h
+++ b/src/plugins/task/affinity/affinity.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/plugins/task/affinity/affinity.h - task affinity plugin
- *  $Id: affinity.h,v 1.2 2005/11/04 02:46:51 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2005 Hewlett-Packard Development Company, L.P.
  *
diff --git a/src/plugins/task/affinity/dist_tasks.c b/src/plugins/task/affinity/dist_tasks.c
index 80ce167ad..5bc1eda1e 100644
--- a/src/plugins/task/affinity/dist_tasks.c
+++ b/src/plugins/task/affinity/dist_tasks.c
@@ -1039,8 +1039,7 @@ static int _task_layout_lllp_cyclic(launch_tasks_request_msg_t *req,
 			*/
 			if (!(req->cpu_bind_type & CPU_BIND_ONE_THREAD_PER_CORE)
 			    && ((req->cpu_bind_type & CPU_BIND_TO_CORES)
-				|| (slurm_get_select_type_param() &
-				    CR_ONE_TASK_PER_CORE))) {
+				|| (req->ntasks_per_core == 1))) {
 				int threads_not_used;
 				if (req->cpus_per_task < hw_threads)
 					threads_not_used =
@@ -1104,6 +1103,7 @@ static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
 	int max_cpus = max_tasks * req->cpus_per_task;
 	bitstr_t *avail_map;
 	bitstr_t **masks = NULL;
+	int sock_inx, pu_per_socket, *socket_tasks = NULL;
 
 	info("_task_layout_lllp_block ");
 
@@ -1138,6 +1138,9 @@ static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
 	*masks_p = xmalloc(max_tasks * sizeof(bitstr_t*));
 	masks = *masks_p;
 
+	pu_per_socket = hw_cores * hw_threads;
+	socket_tasks = xmalloc(hw_sockets);
+
 	/* block distribution with oversubsciption */
 	c = 0;
 	while (taskcount < max_tasks) {
@@ -1153,6 +1156,12 @@ static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
 			if (bit_test(avail_map, i) == 0)
 				continue;
 
+			sock_inx = i / pu_per_socket;
+			if ((req->ntasks_per_socket != 0) &&
+			    (socket_tasks[sock_inx] >= req->ntasks_per_socket))
+				continue;
+			socket_tasks[sock_inx]++;
+
 			if (!masks[taskcount])
 				masks[taskcount] = bit_alloc(
 					conf->block_map_size);
@@ -1174,8 +1183,7 @@ static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
 			*/
 			if (!(req->cpu_bind_type & CPU_BIND_ONE_THREAD_PER_CORE)
 			    && ((req->cpu_bind_type & CPU_BIND_TO_CORES)
-				|| (slurm_get_select_type_param() &
-				    CR_ONE_TASK_PER_CORE))) {
+				|| (req->ntasks_per_core == 1))) {
 				int threads_not_used;
 				if (req->cpus_per_task < hw_threads)
 					threads_not_used =
@@ -1189,7 +1197,10 @@ static int _task_layout_lllp_block(launch_tasks_request_msg_t *req,
 			if (++taskcount >= max_tasks)
 				break;
 		}
+		for (i = 0; i < hw_sockets; i++)
+			socket_tasks[i] = 0;
 	}
+	xfree(socket_tasks);
 
 	/* last step: expand the masks to bind each task
 	 * to the requested resource */
diff --git a/src/plugins/task/affinity/numa.c b/src/plugins/task/affinity/numa.c
index 7515ebc58..8f5046bb5 100644
--- a/src/plugins/task/affinity/numa.c
+++ b/src/plugins/task/affinity/numa.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/plugins/task/affinity/numa.c - numa-based memory affinity functions
- *  $Id: affinity.c,v 1.2 2005/11/04 02:46:51 palermo Exp $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California and
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -225,7 +224,7 @@ int get_memset(nodemask_t *mask, stepd_step_rec_t *job)
 
 	if (job->mem_bind_type & MEM_BIND_MAP) {
 		unsigned int my_node = 0;
-		if (strncmp(mstr, "0x", 2) == 0) {
+		if (xstrncmp(mstr, "0x", 2) == 0) {
 			my_node = strtoul (&(mstr[2]), NULL, 16);
 		} else {
 			my_node = strtoul (mstr, NULL, 10);
diff --git a/src/plugins/task/affinity/schedutils.c b/src/plugins/task/affinity/schedutils.c
index 37dec3552..c8f235293 100644
--- a/src/plugins/task/affinity/schedutils.c
+++ b/src/plugins/task/affinity/schedutils.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/plugins/task/affinity/schedutils.c - scheduling utilities
- *  $Id: schedutils.c,v 1.2 2005/11/04 02:46:51 palermo Exp $
  *****************************************************************************
  *  Routines in this file are taken from the taskset utility (schedutils pkg)
  *  Copyright (C) 2004 Robert Love
diff --git a/src/plugins/task/affinity/task_affinity.c b/src/plugins/task/affinity/task_affinity.c
index 97f8d196f..0f93d40ea 100644
--- a/src/plugins/task/affinity/task_affinity.c
+++ b/src/plugins/task/affinity/task_affinity.c
@@ -90,7 +90,13 @@ const uint32_t plugin_version   = SLURM_VERSION_NUMBER;
  */
 extern int init (void)
 {
-	debug("%s loaded", plugin_name);
+	cpu_set_t cur_mask;
+	char mstr[1 + CPU_SETSIZE / 4];
+
+	slurm_getaffinity(0, sizeof(cur_mask), &cur_mask);
+	cpuset_to_str(&cur_mask, mstr);
+	verbose("%s loaded with CPU mask %s", plugin_name, mstr);
+
 	return SLURM_SUCCESS;
 }
 
@@ -110,43 +116,44 @@ static void _update_bind_type(launch_tasks_request_msg_t *req)
 {
 	bool set_bind = false;
 
-	if (conf->task_plugin_param & CPU_BIND_NONE) {
-		req->cpu_bind_type |= CPU_BIND_NONE;
-		req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
-		req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
-		set_bind = true;
-	} else if (conf->task_plugin_param & CPU_BIND_TO_SOCKETS) {
-		req->cpu_bind_type &= (~CPU_BIND_NONE);
-		req->cpu_bind_type |= CPU_BIND_TO_SOCKETS;
-		req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
-		req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
-		set_bind = true;
-	} else if (conf->task_plugin_param & CPU_BIND_TO_CORES) {
-		req->cpu_bind_type &= (~CPU_BIND_NONE);
-		req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
-		req->cpu_bind_type |= CPU_BIND_TO_CORES;
-		req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
-		set_bind = true;
-	} else if (conf->task_plugin_param & CPU_BIND_TO_THREADS) {
-		req->cpu_bind_type &= (~CPU_BIND_NONE);
-		req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
-		req->cpu_bind_type |= CPU_BIND_TO_THREADS;
-		req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
-		set_bind = true;
-	} else if (conf->task_plugin_param & CPU_BIND_TO_LDOMS) {
-		req->cpu_bind_type &= (~CPU_BIND_NONE);
-		req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
-		req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
-		req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
-		req->cpu_bind_type &= CPU_BIND_TO_LDOMS;
-		set_bind = true;
+	if ((req->cpu_bind_type & (~CPU_BIND_VERBOSE)) == 0) {
+		if (conf->task_plugin_param & CPU_BIND_NONE) {
+			req->cpu_bind_type |= CPU_BIND_NONE;
+			req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
+			req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
+			set_bind = true;
+		} else if (conf->task_plugin_param & CPU_BIND_TO_SOCKETS) {
+			req->cpu_bind_type &= (~CPU_BIND_NONE);
+			req->cpu_bind_type |= CPU_BIND_TO_SOCKETS;
+			req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
+			req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
+			set_bind = true;
+		} else if (conf->task_plugin_param & CPU_BIND_TO_CORES) {
+			req->cpu_bind_type &= (~CPU_BIND_NONE);
+			req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
+			req->cpu_bind_type |= CPU_BIND_TO_CORES;
+			req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
+			set_bind = true;
+		} else if (conf->task_plugin_param & CPU_BIND_TO_THREADS) {
+			req->cpu_bind_type &= (~CPU_BIND_NONE);
+			req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
+			req->cpu_bind_type |= CPU_BIND_TO_THREADS;
+			req->cpu_bind_type &= (~CPU_BIND_TO_LDOMS);
+			set_bind = true;
+		} else if (conf->task_plugin_param & CPU_BIND_TO_LDOMS) {
+			req->cpu_bind_type &= (~CPU_BIND_NONE);
+			req->cpu_bind_type &= (~CPU_BIND_TO_SOCKETS);
+			req->cpu_bind_type &= (~CPU_BIND_TO_CORES);
+			req->cpu_bind_type &= (~CPU_BIND_TO_THREADS);
+			req->cpu_bind_type &= CPU_BIND_TO_LDOMS;
+			set_bind = true;
+		}
 	}
-
 	if (conf->task_plugin_param & CPU_BIND_VERBOSE) {
 		req->cpu_bind_type |= CPU_BIND_VERBOSE;
 		set_bind = true;
@@ -293,7 +300,7 @@ extern int task_p_slurmd_release_resources (uint32_t job_id)
 			continue;
 		if (rc || (result == NULL))
 			break;
-		if (strncmp(entry.d_name, "slurm", 5))
+		if (xstrncmp(entry.d_name, "slurm", 5))
 			continue;
 		if (snprintf(path, PATH_MAX, "%s/%s",
 					 base, entry.d_name) >= PATH_MAX) {
diff --git a/src/plugins/task/cgroup/Makefile.in b/src/plugins/task/cgroup/Makefile.in
index 299672729..4d7a00fce 100644
--- a/src/plugins/task/cgroup/Makefile.in
+++ b/src/plugins/task/cgroup/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/task/cgroup
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/task/cgroup/task_cgroup.c b/src/plugins/task/cgroup/task_cgroup.c
index 04fc6020a..7e07857fb 100644
--- a/src/plugins/task/cgroup/task_cgroup.c
+++ b/src/plugins/task/cgroup/task_cgroup.c
@@ -335,7 +335,7 @@ extern char* task_cgroup_create_slurm_cg (xcgroup_ns_t* ns) {
 		return pre;
 	}
 	slurm_cg.notify = 0;
-	if (xcgroup_instanciate(&slurm_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&slurm_cg) != XCGROUP_SUCCESS) {
 		error("unable to build slurm cgroup for ns %s: %m",
 		      ns->subsystems);
 		xcgroup_destroy(&slurm_cg);
diff --git a/src/plugins/task/cgroup/task_cgroup_cpuset.c b/src/plugins/task/cgroup/task_cgroup_cpuset.c
index d281fdce7..7d01ecb6a 100644
--- a/src/plugins/task/cgroup/task_cgroup_cpuset.c
+++ b/src/plugins/task/cgroup/task_cgroup_cpuset.c
@@ -163,61 +163,6 @@ static inline int _char_to_val(int c)
 		return -1;
 }
 
-static char *_cpuset_to_str(const cpu_set_t *mask, char *str)
-{
-	int base;
-	char *ptr = str;
-	char *ret = NULL;
-
-	for (base = CPU_SETSIZE - 4; base >= 0; base -= 4) {
-		char val = 0;
-		if (CPU_ISSET(base, mask))
-			val |= 1;
-		if (CPU_ISSET(base + 1, mask))
-			val |= 2;
-		if (CPU_ISSET(base + 2, mask))
-			val |= 4;
-		if (CPU_ISSET(base + 3, mask))
-			val |= 8;
-		if (!ret && val)
-			ret = ptr;
-		*ptr++ = _val_to_char(val);
-	}
-	*ptr = '\0';
-	return ret ? ret : ptr - 1;
-}
-
-static int _str_to_cpuset(cpu_set_t *mask, const char* str)
-{
-	int len = strlen(str);
-	const char *ptr = str + len - 1;
-	int base = 0;
-
-	/* skip 0x, it's all hex anyway */
-	if (len > 1 && !memcmp(str, "0x", 2L))
-		str += 2;
-
-	CPU_ZERO(mask);
-	while (ptr >= str) {
-		char val = _char_to_val(*ptr);
-		if (val == (char) -1)
-			return -1;
-		if (val & 1)
-			CPU_SET(base, mask);
-		if (val & 2)
-			CPU_SET(base + 1, mask);
-		if (val & 4)
-			CPU_SET(base + 2, mask);
-		if (val & 8)
-			CPU_SET(base + 3, mask);
-		len--;
-		ptr--;
-		base += 4;
-	}
-
-	return 0;
-}
-
 /* when cgroups are configured with cpuset, at least
  * cpuset.cpus and cpuset.mems must be set or the cgroup
  * will not be available at all.
@@ -294,6 +239,61 @@ static int _xcgroup_cpuset_init(xcgroup_t* cg)
 
 #ifdef HAVE_HWLOC
 
+static char *_cpuset_to_str(const cpu_set_t *mask, char *str)
+{
+	int base;
+	char *ptr = str;
+	char *ret = NULL;
+
+	for (base = CPU_SETSIZE - 4; base >= 0; base -= 4) {
+		char val = 0;
+		if (CPU_ISSET(base, mask))
+			val |= 1;
+		if (CPU_ISSET(base + 1, mask))
+			val |= 2;
+		if (CPU_ISSET(base + 2, mask))
+			val |= 4;
+		if (CPU_ISSET(base + 3, mask))
+			val |= 8;
+		if (!ret && val)
+			ret = ptr;
+		*ptr++ = _val_to_char(val);
+	}
+	*ptr = '\0';
+	return ret ? ret : ptr - 1;
+}
+
+static int _str_to_cpuset(cpu_set_t *mask, const char* str)
+{
+	int len = strlen(str);
+	const char *ptr = str + len - 1;
+	int base = 0;
+
+	/* skip 0x, it's all hex anyway */
+	if (len > 1 && !memcmp(str, "0x", 2L))
+		str += 2;
+
+	CPU_ZERO(mask);
+	while (ptr >= str) {
+		char val = _char_to_val(*ptr);
+		if (val == (char) -1)
+			return -1;
+		if (val & 1)
+			CPU_SET(base, mask);
+		if (val & 2)
+			CPU_SET(base + 1, mask);
+		if (val & 4)
+			CPU_SET(base + 2, mask);
+		if (val & 8)
+			CPU_SET(base + 3, mask);
+		len--;
+		ptr--;
+		base += 4;
+	}
+
+	return 0;
+}
+
 static void
 _slurm_chkaffinity(cpu_set_t *mask, stepd_step_rec_t *job, int statval)
 {
@@ -537,7 +537,7 @@ static int _get_sched_cpuset(hwloc_topology_t topology,
 
 	if (job->cpu_bind_type & CPU_BIND_MAP) {
 		unsigned int mycpu = 0;
-		if (strncmp(mstr, "0x", 2) == 0) {
+		if (xstrncmp(mstr, "0x", 2) == 0) {
 			mycpu = strtoul (&(mstr[2]), NULL, 16);
 		} else {
 			mycpu = strtoul (mstr, NULL, 10);
@@ -580,7 +580,7 @@ static int _get_sched_cpuset(hwloc_topology_t topology,
 
 	if (job->cpu_bind_type & CPU_BIND_LDMAP) {
 		uint32_t myldom = 0;
-		if (strncmp(mstr, "0x", 2) == 0) {
+		if (xstrncmp(mstr, "0x", 2) == 0) {
 			myldom = strtoul (&(mstr[2]), NULL, 16);
 		} else {
 			myldom = strtoul (mstr, NULL, 10);
@@ -1229,7 +1229,7 @@ again:
 			   getuid(),getgid()) != XCGROUP_SUCCESS) {
 		goto error;
 	}
-	if (xcgroup_instanciate(&user_cpuset_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&user_cpuset_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuset_cg);
 		goto error;
 	}
@@ -1265,7 +1265,7 @@ again:
 		xcgroup_destroy(&user_cpuset_cg);
 		goto error;
 	}
-	if (xcgroup_instanciate(&job_cpuset_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&job_cpuset_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuset_cg);
 		xcgroup_destroy(&job_cpuset_cg);
 		goto error;
@@ -1291,7 +1291,7 @@ again:
 		xcgroup_destroy(&job_cpuset_cg);
 		goto error;
 	}
-	if (xcgroup_instanciate(&step_cpuset_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&step_cpuset_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_cpuset_cg);
 		xcgroup_destroy(&job_cpuset_cg);
 		xcgroup_destroy(&step_cpuset_cg);
diff --git a/src/plugins/task/cgroup/task_cgroup_devices.c b/src/plugins/task/cgroup/task_cgroup_devices.c
index 3e4429bb7..554583c46 100644
--- a/src/plugins/task/cgroup/task_cgroup_devices.c
+++ b/src/plugins/task/cgroup/task_cgroup_devices.c
@@ -262,10 +262,10 @@ extern int task_cgroup_devices_create(stepd_step_rec_t *job)
 	gres_count[f] = 1;
 	for (k = 0; k < gres_conf_lines; k++) {
 		if ((k+1 < gres_conf_lines) &&
-		    (strcmp(gres_name[k],gres_name[k+1]) == 0))
+		    (xstrcmp(gres_name[k],gres_name[k+1]) == 0))
 			gres_count[f]++;
 		if ((k+1 < gres_conf_lines) &&
-		    (strcmp(gres_name[k],gres_name[k+1]) != 0)) {
+		    (xstrcmp(gres_name[k],gres_name[k+1]) != 0)) {
 			f++;
 			gres_count[f] = 1;
 		}
@@ -279,7 +279,7 @@ extern int task_cgroup_devices_create(stepd_step_rec_t *job)
 			    getuid(),getgid()) != XCGROUP_SUCCESS ) {
 		goto error;
 	}
-	if ( xcgroup_instanciate(&user_devices_cg) != XCGROUP_SUCCESS ) {
+	if ( xcgroup_instantiate(&user_devices_cg) != XCGROUP_SUCCESS ) {
 		xcgroup_destroy(&user_devices_cg);
 		goto error;
 	}
@@ -300,7 +300,7 @@ extern int task_cgroup_devices_create(stepd_step_rec_t *job)
 		xcgroup_destroy(&user_devices_cg);
 		goto error;
 	}
-	if ( xcgroup_instanciate(&job_devices_cg) != XCGROUP_SUCCESS ) {
+	if ( xcgroup_instantiate(&job_devices_cg) != XCGROUP_SUCCESS ) {
 		xcgroup_destroy(&user_devices_cg);
 		xcgroup_destroy(&job_devices_cg);
 		goto error;
@@ -351,7 +351,7 @@ extern int task_cgroup_devices_create(stepd_step_rec_t *job)
 		xcgroup_destroy(&job_devices_cg);
 		goto error;
 	}
-	if ( xcgroup_instanciate(&step_devices_cg) != XCGROUP_SUCCESS ) {
+	if ( xcgroup_instantiate(&step_devices_cg) != XCGROUP_SUCCESS ) {
 		xcgroup_destroy(&user_devices_cg);
 		xcgroup_destroy(&job_devices_cg);
 		xcgroup_destroy(&step_devices_cg);
@@ -447,6 +447,7 @@ static void _calc_device_major(char *dev_path[PATH_MAX],
 		minor = (int)minor(fs.st_rdev);
 		debug3("device : %s major %d, minor %d\n",
 			dev_path[k], major, minor);
+		memset(str1, 0, sizeof(str1));
 		if (S_ISBLK(fs.st_mode)) {
 			sprintf(str1, "b %d:", major);
 			//info("device is block ");
diff --git a/src/plugins/task/cgroup/task_cgroup_memory.c b/src/plugins/task/cgroup/task_cgroup_memory.c
index b92d87eaf..6c62ce79c 100644
--- a/src/plugins/task/cgroup/task_cgroup_memory.c
+++ b/src/plugins/task/cgroup/task_cgroup_memory.c
@@ -94,7 +94,10 @@ extern int task_cgroup_memory_init(slurm_cgroup_conf_t *slurm_cgroup_conf)
 	/* initialize memory cgroup namespace */
 	if (xcgroup_ns_create(slurm_cgroup_conf, &memory_ns, "", "memory")
 	    != XCGROUP_SUCCESS) {
-		error("task/cgroup: unable to create memory namespace");
+		error("task/cgroup: unable to create memory namespace. "
+			"You may need to set the Linux kernel option "
+			"cgroup_enable=memory (and reboot), or disable "
+			"ConstrainRAMSpace in cgroup.conf.");
 		return SLURM_ERROR;
 	}
 
@@ -273,7 +276,7 @@ static int memcg_initialize (xcgroup_ns_t *ns, xcgroup_t *cg,
 
 	cg->notify = notify;
 
-	if (xcgroup_instanciate (cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate (cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy (cg);
 		return -1;
 	}
@@ -408,7 +411,7 @@ extern int task_cgroup_memory_create(stepd_step_rec_t *job)
 			    getuid(),getgid()) != XCGROUP_SUCCESS) {
 		goto error;
 	}
-	if (xcgroup_instanciate(&user_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&user_memory_cg) != XCGROUP_SUCCESS) {
 		xcgroup_destroy(&user_memory_cg);
 		goto error;
 	}
diff --git a/src/plugins/task/cray/Makefile.in b/src/plugins/task/cray/Makefile.in
index 14829a67f..a66734fcf 100644
--- a/src/plugins/task/cray/Makefile.in
+++ b/src/plugins/task/cray/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/task/cray
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/task/cray/task_cray.c b/src/plugins/task/cray/task_cray.c
index 47af3e388..2d1f596e3 100644
--- a/src/plugins/task/cray/task_cray.c
+++ b/src/plugins/task/cray/task_cray.c
@@ -65,9 +65,9 @@
 
 #ifdef HAVE_NATIVE_CRAY
 #include "alpscomm_cn.h"
+#endif
 
 static uint64_t debug_flags = 0;
-#endif
 
 /*
  * These variables are required by the generic plugin interface.  If they
@@ -150,10 +150,10 @@ static int track_status = 1;
 // File containing the number of currently running Slurm steps
 #define NUM_STEPS_FILE	TASK_CRAY_RUN_DIR"/slurm_num_steps"
 
-#define _ALPSC_DEBUG(f) _alpsc_debug(THIS_FILE, __LINE__, __FUNCTION__, \
+#define _ALPSC_DEBUG(f) _alpsc_debug(THIS_FILE, __LINE__, __func__, \
 				     rc, 1, f, err_msg);
 #define CRAY_ERR(fmt, ...) error("(%s: %d: %s) "fmt, THIS_FILE, __LINE__, \
-				    __FUNCTION__, ##__VA_ARGS__);
+				    __func__, ##__VA_ARGS__);
 #endif
 
 /*
@@ -239,11 +239,16 @@ extern int task_p_slurmd_reserve_resources (uint32_t job_id,
  */
 extern int task_p_slurmd_suspend_job (uint32_t job_id)
 {
+	DEF_TIMERS;
+	START_TIMER;
 	debug("task_p_slurmd_suspend_job: %u", job_id);
 
 #ifdef HAVE_NATIVE_CRAY
 	_step_epilogue();
 #endif
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return SLURM_SUCCESS;
 }
@@ -253,11 +258,16 @@ extern int task_p_slurmd_suspend_job (uint32_t job_id)
  */
 extern int task_p_slurmd_resume_job (uint32_t job_id)
 {
+	DEF_TIMERS;
+	START_TIMER;
 	debug("task_p_slurmd_resume_job: %u", job_id);
 
 #ifdef HAVE_NATIVE_CRAY
 	_step_prologue();
 #endif
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return SLURM_SUCCESS;
 }
@@ -278,6 +288,8 @@ extern int task_p_slurmd_release_resources (uint32_t job_id)
  */
 extern int task_p_pre_setuid (stepd_step_rec_t *job)
 {
+	DEF_TIMERS;
+	START_TIMER;
 	debug("task_p_pre_setuid: %u.%u",
 	      job->jobid, job->stepid);
 
@@ -285,6 +297,9 @@ extern int task_p_pre_setuid (stepd_step_rec_t *job)
 	if (!job->batch)
 		_step_prologue();
 #endif
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 
 	return SLURM_SUCCESS;
 }
@@ -299,7 +314,9 @@ extern int task_p_pre_launch (stepd_step_rec_t *job)
 #ifdef HAVE_NATIVE_CRAY
 	int rc;
 	uint64_t apid;
+	DEF_TIMERS;
 
+	START_TIMER;
 	apid = SLURM_ID_HASH(job->jobid, job->stepid);
 	debug("task_p_pre_launch: %u.%u, apid %"PRIu64", task %d",
 	      job->jobid, job->stepid, apid, job->envtp->procid);
@@ -345,6 +362,9 @@ extern int task_p_pre_launch (stepd_step_rec_t *job)
 		CRAY_ERR("Failed to set env variable %s",
 			 ALPS_APP_ID_ENV);
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -355,15 +375,23 @@ extern int task_p_pre_launch (stepd_step_rec_t *job)
  */
 extern int task_p_pre_launch_priv (stepd_step_rec_t *job)
 {
+	int rc = SLURM_SUCCESS;
+	DEF_TIMERS;
+
+	START_TIMER;
+
 #ifdef HAVE_NATIVE_CRAY
 	debug("task_p_pre_launch_priv: %u.%u",
 	      job->jobid, job->stepid);
 
 	if (track_status) {
-		return _make_status_file(job);
+		rc = _make_status_file(job);
 	}
 #endif
-	return SLURM_SUCCESS;
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+	return rc;
 }
 
 /*
@@ -374,15 +402,23 @@ extern int task_p_pre_launch_priv (stepd_step_rec_t *job)
 extern int task_p_post_term (stepd_step_rec_t *job,
 			     stepd_step_task_info_t *task)
 {
+	int rc = SLURM_SUCCESS;
+	DEF_TIMERS;
+
+	START_TIMER;
+
 #ifdef HAVE_NATIVE_CRAY
 	debug("task_p_post_term: %u.%u, task %d",
 	      job->jobid, job->stepid, job->envtp->procid);
 
 	if (track_status) {
-		return _check_status_file(job, task);
+		rc = _check_status_file(job, task);
 	}
 #endif
-	return SLURM_SUCCESS;
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
+	return rc;
 }
 
 /*
@@ -397,6 +433,9 @@ extern int task_p_post_step (stepd_step_rec_t *job)
 	char *err_msg = NULL, path[PATH_MAX];
 	int32_t *numa_nodes;
 	cpu_set_t *cpuMasks;
+	DEF_TIMERS;
+
+	START_TIMER;
 
 	if (track_status) {
 		// Get the lli file name
@@ -489,6 +528,9 @@ extern int task_p_post_step (stepd_step_rec_t *job)
 	if (rc != 1) {
 		return SLURM_ERROR;
 	}
+	END_TIMER;
+	if (debug_flags & DEBUG_FLAG_TIME_CRAY)
+		INFO_LINE("call took: %s", TIME_STR);
 #endif
 	return SLURM_SUCCESS;
 }
@@ -712,7 +754,7 @@ static int _get_numa_nodes(char *path, int *cnt, int32_t **numa_array) {
 		if (*(bm->maskp) & ((long unsigned) 1 << i)) {
 			if (debug_flags & DEBUG_FLAG_TASK) {
 				info("(%s: %d: %s) NUMA Node %d is present",
-				     THIS_FILE,	__LINE__, __FUNCTION__, i);
+				     THIS_FILE,	__LINE__, __func__, i);
 			}
 			(*numa_array)[index++] = i;
 		}
diff --git a/src/plugins/task/none/Makefile.in b/src/plugins/task/none/Makefile.in
index 7b09759a1..d777a9c71 100644
--- a/src/plugins/task/none/Makefile.in
+++ b/src/plugins/task/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/task/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -248,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -349,6 +348,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -387,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -430,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -480,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/3d_torus/Makefile.in b/src/plugins/topology/3d_torus/Makefile.in
index e4a631e7c..5e58c5006 100644
--- a/src/plugins/topology/3d_torus/Makefile.in
+++ b/src/plugins/topology/3d_torus/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology/3d_torus
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/3d_torus/hilbert_slurm.c b/src/plugins/topology/3d_torus/hilbert_slurm.c
index 124d3a564..d540803f6 100644
--- a/src/plugins/topology/3d_torus/hilbert_slurm.c
+++ b/src/plugins/topology/3d_torus/hilbert_slurm.c
@@ -59,14 +59,9 @@ extern void nodes_to_hilbert_curve(void)
 	struct node_record *node_ptr;
 	coord_t hilbert[3];
 	int dims = 3;
-#ifdef HAVE_SUN_CONST
-	int offset = 1;
-#else	/* !HAVE_SUN_CONST */
-	int offset = 0;
 #if 	(SYSTEM_DIMENSIONS != 3)
 		fatal("current logic only supports 3-dimensions");
 #endif	/* SYSTEM_DIMENSIONS != 3) */
-#endif	/* !HAVE_SUN_CONST */
 
 	/* We can only re-order the nodes once at slurmctld startup.
 	 * After that time, many bitmaps are created based upon the
@@ -79,11 +74,10 @@ extern void nodes_to_hilbert_curve(void)
 	for (i=0, coord_inx=0, node_ptr=node_record_table_ptr;
 	     i<node_record_count; i++, node_ptr++) {
 		j = strlen(node_ptr->name);
-		if (j < (dims + offset)) {
+		if (j < dims) {
 			fatal("hostname %s lacks numeric %d dimension suffix",
 			      node_ptr->name, dims);
 		}
-		j -= offset;
 		for (k=dims; k; k--) {
 			coords[coord_inx] = select_char2coord(
 				node_ptr->name[j-k]);
diff --git a/src/plugins/topology/3d_torus/topology_3d_torus.c b/src/plugins/topology/3d_torus/topology_3d_torus.c
index c5191aa45..3163b9e95 100644
--- a/src/plugins/topology/3d_torus/topology_3d_torus.c
+++ b/src/plugins/topology/3d_torus/topology_3d_torus.c
@@ -1,6 +1,6 @@
 /*****************************************************************************\
  *  topology_3d_torus.c - Support for 3-Dimension torus interconnect
- *	topology, default for Cray XT and Sun Constellation systems
+ *	topology, default for Cray XT systems
  *****************************************************************************
  *  Copyright (C) 2009 Lawrence Livermore National Security.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/plugins/topology/Makefile.in b/src/plugins/topology/Makefile.in
index 6667abe13..b4a04c4a6 100644
--- a/src/plugins/topology/Makefile.in
+++ b/src/plugins/topology/Makefile.in
@@ -92,7 +92,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/hypercube/Makefile.in b/src/plugins/topology/hypercube/Makefile.in
index e406729d8..637b11b91 100644
--- a/src/plugins/topology/hypercube/Makefile.in
+++ b/src/plugins/topology/hypercube/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology/hypercube
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/hypercube/topology_hypercube.c b/src/plugins/topology/hypercube/topology_hypercube.c
index d1ebf2a8f..23d3413c3 100644
--- a/src/plugins/topology/hypercube/topology_hypercube.c
+++ b/src/plugins/topology/hypercube/topology_hypercube.c
@@ -321,7 +321,7 @@ static void _validate_switches(void)
 		/* See if switch name has already been defined. */
 		prior_ptr = switch_data_table;
 		for (j = 0; j < i; j++, prior_ptr++) {
-			if (strcmp(switch_ptr->name, prior_ptr->name) == 0) {
+			if (xstrcmp(switch_ptr->name, prior_ptr->name) == 0) {
 				fatal("Switch (%s) has already been defined",
 				      prior_ptr->name);
 			}
@@ -623,7 +623,7 @@ static int _parse_connected_switches(switch_data *sw_record)
 
 		// look up node struct and add pointer to it in switch's struct
 		for (i = 0; i < switch_data_cnt; i++, ptr++) {
-			if (strcmp(ptr->name, sw_name) == 0) {
+			if (xstrcmp(ptr->name, sw_name) == 0) {
 				sw_record->sw_conns[conn_count] = ptr;
 				break;
 			}
@@ -940,7 +940,7 @@ static int _get_switch_index(switch_data ** switch_table,
 		const switch_data * ptr = switch_table[i];
 
 		if (ptr != NULL) {
-			if (strcmp(ptr->name, switch_ptr->name) == 0) {
+			if (xstrcmp(ptr->name, switch_ptr->name) == 0) {
 				return i;
 			}
 		}
diff --git a/src/plugins/topology/node_rank/Makefile.in b/src/plugins/topology/node_rank/Makefile.in
index b210309ce..eb127bdcb 100644
--- a/src/plugins/topology/node_rank/Makefile.in
+++ b/src/plugins/topology/node_rank/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology/node_rank
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/none/Makefile.in b/src/plugins/topology/none/Makefile.in
index efadfbb27..b3f46fff0 100644
--- a/src/plugins/topology/none/Makefile.in
+++ b/src/plugins/topology/none/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology/none
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/tree/Makefile.in b/src/plugins/topology/tree/Makefile.in
index f7acc4265..ea1ab9b5d 100644
--- a/src/plugins/topology/tree/Makefile.in
+++ b/src/plugins/topology/tree/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/plugins/topology/tree
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -249,8 +250,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -350,6 +349,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -388,6 +391,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -431,6 +437,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -481,6 +490,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/plugins/topology/tree/topology_tree.c b/src/plugins/topology/tree/topology_tree.c
index d9c32cccc..b258d0a57 100644
--- a/src/plugins/topology/tree/topology_tree.c
+++ b/src/plugins/topology/tree/topology_tree.c
@@ -244,7 +244,7 @@ static void _find_child_switches (int sw)
 		/* Find switch whose name is the name of this child.
 		 * and add its index to child index array */
 		for (i=0; i<switch_record_cnt; i++) {
-			if (strcmp(swname, switch_record_table[i].name) == 0) {
+			if (xstrcmp(swname, switch_record_table[i].name) == 0) {
 				switch_record_table[sw].switch_index[cldx] = i;
 				switch_record_table[i].parent = sw;
 				cldx++;
@@ -288,7 +288,7 @@ static void _validate_switches(void)
 		/* See if switch name has already been defined. */
 		prior_ptr = switch_record_table;
 		for (j=0; j<i; j++, prior_ptr++) {
-			if (strcmp(switch_ptr->name, prior_ptr->name) == 0) {
+			if (xstrcmp(switch_ptr->name, prior_ptr->name) == 0) {
 				fatal("Switch (%s) has already been defined",
 				      prior_ptr->name);
 			}
@@ -460,7 +460,7 @@ static int _get_switch_inx(const char *name)
 
 	switch_ptr = switch_record_table;
 	for (i=0; i<switch_record_cnt; i++, switch_ptr++) {
-		if (strcmp(switch_ptr->name, name) == 0)
+		if (xstrcmp(switch_ptr->name, name) == 0)
 			return i;
 	}
 
diff --git a/src/sacct/Makefile.in b/src/sacct/Makefile.in
index 83ec29fa7..4140a18c0 100644
--- a/src/sacct/Makefile.in
+++ b/src/sacct/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 bin_PROGRAMS = sacct$(EXEEXT)
 subdir = src/sacct
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sacct/options.c b/src/sacct/options.c
index bc6e80ad1..14cc98800 100644
--- a/src/sacct/options.c
+++ b/src/sacct/options.c
@@ -42,6 +42,7 @@
 #include "src/common/read_config.h"
 #include "src/common/slurm_time.h"
 #include "src/common/uid.h"
+#include "src/common/slurm_strcasestr.h"
 #include "sacct.h"
 #include <time.h>
 
@@ -49,6 +50,7 @@
 #define OPT_LONG_NAME	   0x100
 #define OPT_LONG_DELIMITER 0x101
 #define OPT_LONG_NOCONVERT 0x102
+#define OPT_LONG_UNITS     0x103
 
 void _help_fields_msg(void);
 void _help_msg(void);
@@ -140,7 +142,8 @@ static int _addto_id_char_list(List char_list, char *names, bool gid)
 					name = _convert_to_id( name, gid );
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -168,7 +171,7 @@ static int _addto_id_char_list(List char_list, char *names, bool gid)
 			name = _convert_to_id(name, gid);
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -225,7 +228,8 @@ static int _addto_state_char_list(List char_list, char *names)
 					name = xstrdup_printf("%d", c);
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -257,7 +261,7 @@ static int _addto_state_char_list(List char_list, char *names)
 			name = xstrdup_printf("%d", c);
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -373,8 +377,8 @@ sacct [<OPTION>]                                                            \n \
      -s, --state:                                                           \n\
 	           Select jobs based on their current state or the state    \n\
                    they were in during the time period given: running (r),  \n\
-                   completed (cd), failed (f), timeout (to), resizing (rs)  \n\
-                   and node_fail (nf).                                      \n\
+                   completed (cd), failed (f), timeout (to), resizing (rs), \n\
+                   deadline (dl) and node_fail (nf).                        \n\
      -S, --starttime:                                                       \n\
                    Select jobs eligible after this time.  Default is        \n\
                    00:00:00 of the current day, unless '-s' is set then     \n\
@@ -421,6 +425,7 @@ void _init_params()
 	params.job_cond = xmalloc(sizeof(slurmdb_job_cond_t));
 	params.job_cond->without_usage_truncation = 1;
 	params.convert_flags = CONVERT_NUM_UNIT_EXACT;
+	params.units = NO_VAL;
 }
 
 int get_data(void)
@@ -524,6 +529,7 @@ void parse_command_line(int argc, char **argv)
                 {"clusters",       required_argument, 0,    'M'},
                 {"nodelist",       required_argument, 0,    'N'},
                 {"noconvert",      no_argument,       0,    OPT_LONG_NOCONVERT},
+                {"units",          required_argument, 0,    OPT_LONG_UNITS},
                 {"noheader",       no_argument,       0,    'n'},
                 {"fields",         required_argument, 0,    'o'},
                 {"format",         required_argument, 0,    'o'},
@@ -580,7 +586,7 @@ void parse_command_line(int argc, char **argv)
 			   everything else.
 			*/
 		case 'M':
-			if (!strcasecmp(optarg, "-1")) {
+			if (!xstrcasecmp(optarg, "-1")) {
 				all_clusters = 1;
 				break;
 			}
@@ -671,6 +677,14 @@ void parse_command_line(int argc, char **argv)
 		case OPT_LONG_NOCONVERT:
 			params.convert_flags |= CONVERT_NUM_UNIT_NO;
 			break;
+		case OPT_LONG_UNITS:
+		{
+			int type = get_unit_type(*optarg);
+			if (type == SLURM_ERROR)
+				fatal("Invalid unit type");
+			params.units = type;
+		}
+			break;
 		case 'n':
 			print_fields_have_header = 0;
 			break;
@@ -744,7 +758,7 @@ void parse_command_line(int argc, char **argv)
 			params.opt_help = 3;
 			break;
 		case 'u':
-			if (!strcmp(optarg, "-1")) {
+			if (!xstrcmp(optarg, "-1")) {
 				all_users = 1;
 				break;
 			}
@@ -848,7 +862,7 @@ void parse_command_line(int argc, char **argv)
 		g_slurm_jobcomp_init(params.opt_filein);
 
 		acct_type = slurm_get_jobcomp_type();
-		if ((strcmp(acct_type, "jobcomp/none") == 0)
+		if ((xstrcmp(acct_type, "jobcomp/none") == 0)
 		    &&  (stat(params.opt_filein, &stat_buf) != 0)) {
 			fprintf(stderr, "SLURM job completion is disabled\n");
 			exit(1);
@@ -858,7 +872,7 @@ void parse_command_line(int argc, char **argv)
 		slurm_acct_storage_init(params.opt_filein);
 
 		acct_type = slurm_get_accounting_storage_type();
-		if ((strcmp(acct_type, "accounting_storage/none") == 0)
+		if ((xstrcmp(acct_type, "accounting_storage/none") == 0)
 		    &&  (stat(params.opt_filein, &stat_buf) != 0)) {
 			fprintf(stderr,
 				"SLURM accounting storage is disabled\n");
diff --git a/src/sacct/print.c b/src/sacct/print.c
index 2ff27c2fa..084f8e262 100644
--- a/src/sacct/print.c
+++ b/src/sacct/print.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  print.c - print functions for sacct
- *
- *  $Id: print.c 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -113,7 +111,7 @@ static void _print_small_double(
 
 	if (dub > 1)
 		convert_num_unit((double)dub, outbuf, buf_size, units,
-				 params.convert_flags);
+				 params.units, params.convert_flags);
 	else if (dub > 0)
 		snprintf(outbuf, buf_size, "%.2fM", dub);
 	else
@@ -349,7 +347,7 @@ void print_fields(type_t type, void *object)
 					tmp_int = tmp_uint64;
 			}
 			convert_num_unit((double)tmp_int, outbuf,
-					 sizeof(outbuf), UNIT_NONE,
+					 sizeof(outbuf), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			field->print_routine(field,
 					     outbuf,
@@ -388,9 +386,9 @@ void print_fields(type_t type, void *object)
 				}
 			}
 			if (!fuzzy_equal(tmp_dub, NO_VAL))
-				convert_num_unit2((double)tmp_dub,
-						  outbuf, sizeof(outbuf),
-						  UNIT_KILO, 1000,
+				convert_num_unit2((double)tmp_dub, outbuf,
+						  sizeof(outbuf), UNIT_KILO,
+						  params.units, 1000,
 						  params.convert_flags &
 						  (~CONVERT_NUM_UNIT_EXACT));
 
@@ -502,8 +500,8 @@ void print_fields(type_t type, void *object)
 			}
 			if (!fuzzy_equal(tmp_dub, NO_VAL))
 				convert_num_unit((double)tmp_dub, outbuf,
-						 sizeof(outbuf),
-						 UNIT_KILO,
+						 sizeof(outbuf), UNIT_KILO,
+						 params.units,
 						 params.convert_flags);
 
 			field->print_routine(field,
@@ -527,8 +525,8 @@ void print_fields(type_t type, void *object)
 			}
 			if (!fuzzy_equal(tmp_dub, NO_VAL))
 				convert_num_unit((double)tmp_dub, outbuf,
-						 sizeof(outbuf),
-						 UNIT_KILO,
+						 sizeof(outbuf), UNIT_KILO,
+						 params.units,
 						 params.convert_flags);
 
 			field->print_routine(field,
@@ -553,8 +551,8 @@ void print_fields(type_t type, void *object)
 
 			if (!fuzzy_equal(tmp_dub, NO_VAL))
 				convert_num_unit((double)tmp_dub, outbuf,
-						 sizeof(outbuf),
-						 UNIT_KILO,
+						 sizeof(outbuf), UNIT_KILO,
+						 params.units,
 						 params.convert_flags);
 
 			field->print_routine(field,
@@ -625,9 +623,9 @@ void print_fields(type_t type, void *object)
 				}
 			}
 			if (!fuzzy_equal(tmp_dub, NO_VAL))
-				convert_num_unit2((double)tmp_dub,
-						  outbuf, sizeof(outbuf),
-						  UNIT_NONE, 1000,
+				convert_num_unit2((double)tmp_dub, outbuf,
+						  sizeof(outbuf), UNIT_NONE,
+						  params.units, 1000,
 						  params.convert_flags &
 						  (~CONVERT_NUM_UNIT_EXACT));
 
@@ -1137,7 +1135,7 @@ void print_fields(type_t type, void *object)
 					convert_num_unit(
 						(double)tmp_uint64,
 						outbuf, sizeof(outbuf),
-						UNIT_KILO,
+						UNIT_KILO, params.units,
 						params.convert_flags);
 			}
 
@@ -1215,7 +1213,7 @@ void print_fields(type_t type, void *object)
 					convert_num_unit(
 						(double)tmp_uint64,
 						outbuf, sizeof(outbuf),
-						UNIT_KILO,
+						UNIT_KILO, params.units,
 						params.convert_flags);
 			}
 
@@ -1295,7 +1293,7 @@ void print_fields(type_t type, void *object)
 					convert_num_unit(
 						(double)tmp_uint64,
 						outbuf, sizeof(outbuf),
-						UNIT_KILO,
+						UNIT_KILO, params.units,
 						params.convert_flags);
 			}
 
@@ -1478,7 +1476,7 @@ void print_fields(type_t type, void *object)
 			}
 			convert_num_unit((double)tmp_int, outbuf,
 					 sizeof(outbuf), UNIT_NONE,
-					 params.convert_flags);
+					 params.units, params.convert_flags);
 			field->print_routine(field,
 					     outbuf,
 					     (curr_inx == field_count));
@@ -1705,7 +1703,7 @@ void print_fields(type_t type, void *object)
 				}
 				convert_num_unit((double)tmp_uint32,
 						 outbuf, sizeof(outbuf),
-						 UNIT_MEGA,
+						 UNIT_MEGA, params.units,
 						 params.convert_flags);
 				if (per_cpu)
 					sprintf(outbuf+strlen(outbuf), "c");
@@ -1742,7 +1740,7 @@ void print_fields(type_t type, void *object)
 			}
 			convert_num_unit((double)tmp_int, outbuf,
 					 sizeof(outbuf), UNIT_NONE,
-					 params.convert_flags);
+					 params.units, params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
@@ -2054,7 +2052,8 @@ void print_fields(type_t type, void *object)
 			}
 
 			tmp_char = slurmdb_make_tres_string_from_simple(
-				tmp_char, g_tres_list);
+				tmp_char, g_tres_list, params.units,
+				params.convert_flags);
 
 			field->print_routine(field,
 					     tmp_char,
@@ -2083,7 +2082,8 @@ void print_fields(type_t type, void *object)
 			}
 
 			tmp_char = slurmdb_make_tres_string_from_simple(
-				tmp_char, g_tres_list);
+				tmp_char, g_tres_list, params.units,
+				params.convert_flags);
 
 			field->print_routine(field,
 					     tmp_char,
diff --git a/src/sacct/process.c b/src/sacct/process.c
index a909ec30c..3fe7cd6b7 100644
--- a/src/sacct/process.c
+++ b/src/sacct/process.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  process.c - process functions for sacct
- *
- *  $Id: process.c 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/sacct/sacct.h b/src/sacct/sacct.h
index 85b9aab87..3380b0a27 100644
--- a/src/sacct/sacct.h
+++ b/src/sacct/sacct.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  sacct.h - header file for sacct
- *
- *  $Id: sacct.h 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -176,7 +174,7 @@ typedef enum {
 } sacct_print_types_t;
 
 typedef struct {
-	uint32_t convert_flags;
+	uint32_t convert_flags;	/* --noconvert */
 	slurmdb_job_cond_t *job_cond;
 	int opt_completion;	/* --completion */
 	int opt_dup;		/* --duplicates; +1 = explicitly set */
@@ -187,6 +185,7 @@ typedef struct {
 	int opt_noheader;	/* can only be cleared */
 	int opt_allocs;		/* --total */
 	int opt_uid;		/* running persons uid */
+	int units;		/* --units*/
 } sacct_parameters_t;
 
 extern print_field_t fields[];
diff --git a/src/sacctmgr/Makefile.am b/src/sacctmgr/Makefile.am
index 468992c59..564f28ce3 100644
--- a/src/sacctmgr/Makefile.am
+++ b/src/sacctmgr/Makefile.am
@@ -19,6 +19,7 @@ sacctmgr_SOURCES =	\
 	common.c                \
 	event_functions.c	\
 	file_functions.c	\
+	lost_jobs_functions.c	\
 	job_functions.c		\
 	reservation_functions.c	\
 	resource_functions.c	\
diff --git a/src/sacctmgr/Makefile.in b/src/sacctmgr/Makefile.in
index c4ed31d5c..7647f4d27 100644
--- a/src/sacctmgr/Makefile.in
+++ b/src/sacctmgr/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sacctmgr$(EXEEXT)
 subdir = src/sacctmgr
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -150,12 +151,12 @@ am_sacctmgr_OBJECTS = account_functions.$(OBJEXT) \
 	archive_functions.$(OBJEXT) association_functions.$(OBJEXT) \
 	config_functions.$(OBJEXT) cluster_functions.$(OBJEXT) \
 	common.$(OBJEXT) event_functions.$(OBJEXT) \
-	file_functions.$(OBJEXT) job_functions.$(OBJEXT) \
-	reservation_functions.$(OBJEXT) resource_functions.$(OBJEXT) \
-	sacctmgr.$(OBJEXT) qos_functions.$(OBJEXT) \
-	txn_functions.$(OBJEXT) user_functions.$(OBJEXT) \
-	wckey_functions.$(OBJEXT) problem_functions.$(OBJEXT) \
-	tres_function.$(OBJEXT)
+	file_functions.$(OBJEXT) lost_jobs_functions.$(OBJEXT) \
+	job_functions.$(OBJEXT) reservation_functions.$(OBJEXT) \
+	resource_functions.$(OBJEXT) sacctmgr.$(OBJEXT) \
+	qos_functions.$(OBJEXT) txn_functions.$(OBJEXT) \
+	user_functions.$(OBJEXT) wckey_functions.$(OBJEXT) \
+	problem_functions.$(OBJEXT) tres_function.$(OBJEXT)
 sacctmgr_OBJECTS = $(am_sacctmgr_OBJECTS)
 am__DEPENDENCIES_1 =
 sacctmgr_DEPENDENCIES = $(top_builddir)/src/db_api/libslurmdb.o \
@@ -233,8 +234,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -334,6 +333,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -372,6 +375,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -415,6 +421,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -465,6 +474,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -492,6 +502,7 @@ sacctmgr_SOURCES = \
 	common.c                \
 	event_functions.c	\
 	file_functions.c	\
+	lost_jobs_functions.c	\
 	job_functions.c		\
 	reservation_functions.c	\
 	resource_functions.c	\
@@ -606,6 +617,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/event_functions.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_functions.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job_functions.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lost_jobs_functions.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/problem_functions.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qos_functions.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reservation_functions.Po@am__quote@
diff --git a/src/sacctmgr/account_functions.c b/src/sacctmgr/account_functions.c
index 274521082..c8a584524 100644
--- a/src/sacctmgr/account_functions.c
+++ b/src/sacctmgr/account_functions.c
@@ -324,7 +324,7 @@ static int _isdefault(int cond_set, List acct_list, List assoc_list)
 			   only_defs, so thre query could return all
 			   the associations, even without defaults. */
 			if (cond_set == 1) {
-				if (strcasecmp(acct, assoc->acct))
+				if (xstrcasecmp(acct, assoc->acct))
 					continue;
 			} else {
 				snprintf(tmp, 1000, " A = %s ", assoc->acct);
@@ -526,7 +526,7 @@ extern int sacctmgr_add_account(int argc, char *argv[])
 			if (start_acct->organization)
 				acct->organization =
 					xstrdup(start_acct->organization);
-			else if (strcmp(start_assoc->parent_acct, "root"))
+			else if (xstrcmp(start_assoc->parent_acct, "root"))
 				acct->organization =
 					xstrdup(start_assoc->parent_acct);
 			else
@@ -1088,7 +1088,7 @@ extern int sacctmgr_delete_account(int argc, char *argv[])
 		char *tmp_char = NULL;
 		itr = list_iterator_create(acct_cond->assoc_cond->acct_list);
 		while ((tmp_char = list_next(itr))) {
-			if (!strcasecmp(tmp_char, "root"))
+			if (!xstrcasecmp(tmp_char, "root"))
 				break;
 		}
 		list_iterator_destroy(itr);
diff --git a/src/sacctmgr/archive_functions.c b/src/sacctmgr/archive_functions.c
index 091af2179..799dad13d 100644
--- a/src/sacctmgr/archive_functions.c
+++ b/src/sacctmgr/archive_functions.c
@@ -93,7 +93,8 @@ extern int _addto_uid_char_list(List char_list, char *names)
 					name = _string_to_uid( name );
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -121,7 +122,7 @@ extern int _addto_uid_char_list(List char_list, char *names)
 			name = _string_to_uid( name );
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
diff --git a/src/sacctmgr/association_functions.c b/src/sacctmgr/association_functions.c
index 6d89cec20..2e6de6871 100644
--- a/src/sacctmgr/association_functions.c
+++ b/src/sacctmgr/association_functions.c
@@ -845,7 +845,7 @@ extern int sacctmgr_list_assoc(int argc, char *argv[])
 		return SLURM_ERROR;
 	}
 
-	slurmdb_sort_hierarchical_assoc_list(assoc_list);
+	slurmdb_sort_hierarchical_assoc_list(assoc_list, true);
 
 	itr = list_iterator_create(assoc_list);
 	itr2 = list_iterator_create(print_fields_list);
@@ -855,7 +855,7 @@ extern int sacctmgr_list_assoc(int argc, char *argv[])
 
 	while((assoc = list_next(itr))) {
 		int curr_inx = 1;
-		if (!last_cluster || strcmp(last_cluster, assoc->cluster)) {
+		if (!last_cluster || xstrcmp(last_cluster, assoc->cluster)) {
 			if (tree_list) {
 				list_flush(tree_list);
 			} else {
diff --git a/src/sacctmgr/cluster_functions.c b/src/sacctmgr/cluster_functions.c
index 8bc031d4f..b5db3a0c5 100644
--- a/src/sacctmgr/cluster_functions.c
+++ b/src/sacctmgr/cluster_functions.c
@@ -282,7 +282,7 @@ extern int sacctmgr_add_cluster(int argc, char *argv[])
 
 			list_iterator_reset(itr);
 			while((cluster_rec = list_next(itr))) {
-				if (!strcasecmp(cluster_rec->name, name))
+				if (!xstrcasecmp(cluster_rec->name, name))
 					break;
 			}
 			if (cluster_rec) {
@@ -483,7 +483,8 @@ extern int sacctmgr_list_cluster(int argc, char *argv[])
 				sacctmgr_initialize_g_tres_list();
 
 				tmp_char = slurmdb_make_tres_string_from_simple(
-					cluster->tres_str, g_tres_list);
+					cluster->tres_str, g_tres_list, NO_VAL,
+					CONVERT_NUM_UNIT_EXACT);
 				field->print_routine(field,
 						     tmp_char,
 						     (curr_inx == field_count));
@@ -1045,7 +1046,7 @@ extern int sacctmgr_dump_cluster (int argc, char *argv[])
 
 	slurmdb_hierarchical_rec = list_peek(slurmdb_hierarchical_rec_list);
 	assoc = slurmdb_hierarchical_rec->assoc;
-	if (strcmp(assoc->acct, "root")) {
+	if (xstrcmp(assoc->acct, "root")) {
 		fprintf(stderr, "Root association not on the top it was %s\n",
 			assoc->acct);
 	} else
diff --git a/src/sacctmgr/common.c b/src/sacctmgr/common.c
index dbce30bae..97387575b 100644
--- a/src/sacctmgr/common.c
+++ b/src/sacctmgr/common.c
@@ -45,8 +45,6 @@
 #include <unistd.h>
 #include <termios.h>
 
-#define FORMAT_STRING_SIZE 32
-
 static pthread_t lock_warning_thread;
 
 static void *_print_lock_warn(void *no_data)
@@ -426,6 +424,16 @@ static print_field_t *_get_print_field(char *object)
 		field->name = xstrdup("MaxTRESMins");
 		field->len = 13;
 		field->print_routine = sacctmgr_print_tres;
+	} else if (!strncasecmp("MaxTRESRunMinsPerAccount", object,
+				MAX(command_len, 18)) ||
+		   !strncasecmp("MaxTRESRunMinsPerAcct", object,
+				MAX(command_len, 18)) ||
+		   !strncasecmp("MaxTRESRunMinsPA", object,
+				MAX(command_len, 15))) {
+		field->type = PRINT_MAXTRMA;
+		field->name = xstrdup("MaxTRESRunMinsPA");
+		field->len = 15;
+		field->print_routine = sacctmgr_print_tres;
 	} else if (!strncasecmp("MaxTRESRunMinsPerUser", object,
 				MAX(command_len, 8)) ||
 		   !strncasecmp("MaxTRESRunMinsPU", object,
@@ -434,6 +442,16 @@ static print_field_t *_get_print_field(char *object)
 		field->name = xstrdup("MaxTRESRunMinsPU");
 		field->len = 15;
 		field->print_routine = sacctmgr_print_tres;
+	} else if (!strncasecmp("MaxTRESPerAccount", object,
+				MAX(command_len, 11)) ||
+		   !strncasecmp("MaxTRESPerAcct", object,
+				MAX(command_len, 11)) ||
+		   !strncasecmp("MaxTRESPA", object,
+				MAX(command_len, 9))) {
+		field->type = PRINT_MAXTA;
+		field->name = xstrdup("MaxTRESPA");
+		field->len = 13;
+		field->print_routine = sacctmgr_print_tres;
 	} else if (!strncasecmp("MaxTRESPerUser", object,
 				MAX(command_len, 11))) {
 		field->type = PRINT_MAXTU;
@@ -445,6 +463,16 @@ static print_field_t *_get_print_field(char *object)
 		field->name = xstrdup("MaxJobs");
 		field->len = 7;
 		field->print_routine = print_fields_uint;
+	} else if (!strncasecmp("MaxJobsPerAccount", object,
+				MAX(command_len, 11)) ||
+		   !strncasecmp("MaxJobsPerAcct", object,
+				MAX(command_len, 11)) ||
+		   !strncasecmp("MaxJobsPA", object,
+				MAX(command_len, 9))) {
+		field->type = PRINT_MAXJA;
+		field->name = xstrdup("MaxJobsPA");
+		field->len = 9;
+		field->print_routine = print_fields_uint;
 	} else if (!strncasecmp("MaxJobsPerUser", object,
 				MAX(command_len, 8)) ||
 		   !strncasecmp("MaxJobsPU", object,
@@ -472,6 +500,16 @@ static print_field_t *_get_print_field(char *object)
 		field->name = xstrdup("MaxSubmit");
 		field->len = 9;
 		field->print_routine = print_fields_uint;
+	} else if (!strncasecmp("MaxSubmitJobsPerAccount", object,
+				MAX(command_len, 17)) ||
+		   !strncasecmp("MaxSubmitJobsPerAcct", object,
+				MAX(command_len, 17)) ||
+		   !strncasecmp("MaxSubmitJobsPA", object,
+				MAX(command_len, 15))) {
+		field->type = PRINT_MAXSA;
+		field->name = xstrdup("MaxSubmitPA");
+		field->len = 11;
+		field->print_routine = print_fields_uint;
 	} else if (!strncasecmp("MaxSubmitJobsPerUser", object,
 				MAX(command_len, 10)) ||
 		   !strncasecmp("MaxSubmitJobsPU", object,
@@ -1099,18 +1137,18 @@ extern slurmdb_assoc_rec_t *sacctmgr_find_assoc_from_list(
 	while((assoc = list_next(itr))) {
 		if (((!user && assoc->user)
 		     || (user && (!assoc->user
-				  || strcasecmp(user, assoc->user))))
+				  || xstrcasecmp(user, assoc->user))))
 		    || (account && (!assoc->acct
-				    || strcasecmp(account, assoc->acct)))
+				    || xstrcasecmp(account, assoc->acct)))
 		    || ((!cluster && assoc->cluster)
 			|| (cluster && (!assoc->cluster
-					|| strcasecmp(cluster,
-						      assoc->cluster)))))
+					|| xstrcasecmp(cluster,
+						       assoc->cluster)))))
 			continue;
 		else if (partition) {
 			if (partition[0] != '*'
 			    && (!assoc->partition
-				|| strcasecmp(partition, assoc->partition)))
+				|| xstrcasecmp(partition, assoc->partition)))
 				continue;
 		} else if (assoc->partition)
 			continue;
@@ -1140,8 +1178,8 @@ extern slurmdb_assoc_rec_t *sacctmgr_find_account_base_assoc_from_list(
 	while((assoc = list_next(itr))) {
 		/* info("is it %s %s %s", assoc->user, assoc->acct, assoc->cluster); */
 		if (assoc->user
-		    || strcasecmp(temp, assoc->acct)
-		    || strcasecmp(cluster, assoc->cluster))
+		    || xstrcasecmp(temp, assoc->acct)
+		    || xstrcasecmp(cluster, assoc->cluster))
 			continue;
 		/* 	info("found it"); */
 		break;
@@ -1168,7 +1206,7 @@ extern slurmdb_qos_rec_t *sacctmgr_find_qos_from_list(
 
 	itr = list_iterator_create(qos_list);
 	while((qos = list_next(itr))) {
-		if (!strcasecmp(working_name, qos->name))
+		if (!xstrcasecmp(working_name, qos->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1190,8 +1228,8 @@ extern slurmdb_res_rec_t *sacctmgr_find_res_from_list(
 	while ((res = list_next(itr))) {
 		if ((id == res->id)
 		    || (name && server
-			&& !strcasecmp(server, res->server)
-			&& !strcasecmp(name, res->name)))
+			&& !xstrcasecmp(server, res->server)
+			&& !xstrcasecmp(name, res->name)))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1210,7 +1248,7 @@ extern slurmdb_user_rec_t *sacctmgr_find_user_from_list(
 
 	itr = list_iterator_create(user_list);
 	while((user = list_next(itr))) {
-		if (!strcasecmp(name, user->name))
+		if (!xstrcasecmp(name, user->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1230,7 +1268,7 @@ extern slurmdb_account_rec_t *sacctmgr_find_account_from_list(
 
 	itr = list_iterator_create(acct_list);
 	while((account = list_next(itr))) {
-		if (!strcasecmp(name, account->name))
+		if (!xstrcasecmp(name, account->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1250,7 +1288,7 @@ extern slurmdb_cluster_rec_t *sacctmgr_find_cluster_from_list(
 
 	itr = list_iterator_create(cluster_list);
 	while((cluster = list_next(itr))) {
-		if (!strcasecmp(name, cluster->name))
+		if (!xstrcasecmp(name, cluster->name))
 			break;
 	}
 	list_iterator_destroy(itr);
@@ -1271,13 +1309,13 @@ extern slurmdb_wckey_rec_t *sacctmgr_find_wckey_from_list(
 	while((wckey = list_next(itr))) {
 		if (((!user && wckey->user)
 		     || (user && (!wckey->user
-				  || strcasecmp(user, wckey->user))))
+				  || xstrcasecmp(user, wckey->user))))
 		    || (name && (!wckey->name
-				 || strcasecmp(name, wckey->name)))
+				 || xstrcasecmp(name, wckey->name)))
 		    || ((!cluster && wckey->cluster)
 			|| (cluster && (!wckey->cluster
-					|| strcasecmp(cluster,
-						      wckey->cluster)))))
+					|| xstrcasecmp(cluster,
+						       wckey->cluster)))))
 			continue;
 		break;
 	}
@@ -1428,7 +1466,8 @@ extern int addto_action_char_list(List char_list, char *names)
 
 					name = xstrdup_printf("%u", id);
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 					list_iterator_reset(itr);
@@ -1466,7 +1505,7 @@ extern int addto_action_char_list(List char_list, char *names)
 
 			name = xstrdup_printf("%u", id);
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -1584,7 +1623,8 @@ extern void sacctmgr_print_tres(print_field_t *field, char *tres_simple_str,
 	sacctmgr_initialize_g_tres_list();
 
 	print_this = slurmdb_make_tres_string_from_simple(
-		tres_simple_str, g_tres_list);
+		tres_simple_str, g_tres_list, NO_VAL, CONVERT_NUM_UNIT_EXACT);
+
 
 	if (!print_this)
 		print_this = xstrdup("");
@@ -1634,21 +1674,24 @@ extern void sacctmgr_print_assoc_limits(slurmdb_assoc_rec_t *assoc)
 	if (assoc->grp_tres) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres, g_tres_list);
+			assoc->grp_tres, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  GrpTRES       = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (assoc->grp_tres_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres_mins, g_tres_list);
+			assoc->grp_tres_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);;
 		printf("  GrpTRESMins   = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (assoc->grp_tres_run_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres_run_mins, g_tres_list);
+			assoc->grp_tres_run_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  GrpTRESRunMins= %s\n", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1676,28 +1719,32 @@ extern void sacctmgr_print_assoc_limits(slurmdb_assoc_rec_t *assoc)
 	if (assoc->max_tres_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_pj, g_tres_list);
+			assoc->max_tres_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  MaxTRES       = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (assoc->max_tres_pn) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_pn, g_tres_list);
+			assoc->max_tres_pn, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  MaxTRESPerNode= %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (assoc->max_tres_mins_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_mins_pj, g_tres_list);
+			assoc->max_tres_mins_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  MaxTRESMins   = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (assoc->max_tres_run_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_run_mins, g_tres_list);
+			assoc->max_tres_run_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		printf("  MaxTRESRUNMins= %s\n", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1748,132 +1795,167 @@ extern void sacctmgr_print_qos_limits(slurmdb_qos_rec_t *qos)
 
 	if (qos->flags && (qos->flags != QOS_FLAG_NOTSET)) {
 		char *tmp_char = slurmdb_qos_flags_str(qos->flags);
-		printf("  Flags          = %s\n", tmp_char);
+		printf("  Flags                    = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 
 	if (qos->grace_time == INFINITE)
-		printf("  GraceTime      = NONE\n");
+		printf("  GraceTime                = NONE\n");
 	else if (qos->grace_time != NO_VAL)
-		printf("  GraceTime      = %d\n", qos->grace_time);
+		printf("  GraceTime                = %d\n", qos->grace_time);
 
 	if (qos->grp_jobs == INFINITE)
-		printf("  GrpJobs        = NONE\n");
+		printf("  GrpJobs                  = NONE\n");
 	else if (qos->grp_jobs != NO_VAL)
-		printf("  GrpJobs        = %u\n", qos->grp_jobs);
+		printf("  GrpJobs                  = %u\n", qos->grp_jobs);
 
 	if (qos->grp_submit_jobs == INFINITE)
-		printf("  GrpSubmitJobs  = NONE\n");
+		printf("  GrpSubmitJobs            = NONE\n");
 	else if (qos->grp_submit_jobs != NO_VAL)
-		printf("  GrpSubmitJobs  = %u\n",
+		printf("  GrpSubmitJobs            = %u\n",
 		       qos->grp_submit_jobs);
 
 	if (qos->grp_tres) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->grp_tres, g_tres_list);
-		printf("  GrpTRES       = %s\n", tmp_char);
+			qos->grp_tres, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  GrpTRES                  = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->grp_tres_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->grp_tres_mins, g_tres_list);
-		printf("  GrpTRESMins   = %s\n", tmp_char);
+			qos->grp_tres_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  GrpTRESMins              = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->grp_tres_run_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->grp_tres_run_mins, g_tres_list);
-		printf("  GrpTRESRunMins= %s\n", tmp_char);
+			qos->grp_tres_run_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  GrpTRESRunMins           = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 
 	if (qos->grp_wall == INFINITE)
-		printf("  GrpWall        = NONE\n");
+		printf("  GrpWall                  = NONE\n");
 	else if (qos->grp_wall != NO_VAL) {
 		char time_buf[32];
 		mins2time_str((time_t) qos->grp_wall,
 			      time_buf, sizeof(time_buf));
-		printf("  GrpWall        = %s\n", time_buf);
+		printf("  GrpWall                  = %s\n", time_buf);
 	}
 
+	if (qos->max_jobs_pa == INFINITE)
+		printf("  MaxJobsPerAccount        = NONE\n");
+	else if (qos->max_jobs_pa != NO_VAL)
+		printf("  MaxJobsPerAccount        = %u\n",
+		       qos->max_jobs_pa);
 	if (qos->max_jobs_pu == INFINITE)
 		printf("  MaxJobsPerUser = NONE\n");
 	else if (qos->max_jobs_pu != NO_VAL)
 		printf("  MaxJobsPerUser = %u\n",
 		       qos->max_jobs_pu);
 
+	if (qos->max_submit_jobs_pa == INFINITE)
+		printf("  MaxSubmitJobsPerAccount  = NONE\n");
+	else if (qos->max_submit_jobs_pa != NO_VAL)
+		printf("  MaxSubmitJobsPerAccount  = %u\n",
+		       qos->max_submit_jobs_pa);
+
 	if (qos->max_submit_jobs_pu == INFINITE)
-		printf("  MaxSubmitJobs  = NONE\n");
+		printf("  MaxSubmitJobsPerUser     = NONE\n");
 	else if (qos->max_submit_jobs_pu != NO_VAL)
-		printf("  MaxSubmitJobs  = %u\n",
+		printf("  MaxSubmitJobsPerUser     = %u\n",
 		       qos->max_submit_jobs_pu);
 
+	if (qos->max_tres_pa) {
+		sacctmgr_initialize_g_tres_list();
+		tmp_char = slurmdb_make_tres_string_from_simple(
+			qos->max_tres_pa, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESPerAccount        = %s\n", tmp_char);
+		xfree(tmp_char);
+	}
 	if (qos->max_tres_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->max_tres_pj, g_tres_list);
-		printf("  MaxTRESPerJob = %s\n", tmp_char);
+			qos->max_tres_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESPerJob            = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->max_tres_pn) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->max_tres_pn, g_tres_list);
-		printf("  MaxTRESPerNode= %s\n", tmp_char);
+			qos->max_tres_pn, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESPerNode           = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->max_tres_pu) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->max_tres_pu, g_tres_list);
-		printf("  MaxTRESPerUser= %s\n", tmp_char);
+			qos->max_tres_pu, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESPerUser           = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->max_tres_mins_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->max_tres_mins_pj, g_tres_list);
-		printf("  MaxTRESMins   = %s\n", tmp_char);
+			qos->max_tres_mins_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESMins              = %s\n", tmp_char);
+		xfree(tmp_char);
+	}
+	if (qos->max_tres_run_mins_pa) {
+		sacctmgr_initialize_g_tres_list();
+		tmp_char = slurmdb_make_tres_string_from_simple(
+			qos->max_tres_run_mins_pa, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESRUNMinsPerAccount = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 	if (qos->max_tres_run_mins_pu) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			qos->max_tres_run_mins_pu, g_tres_list);
-		printf("  MaxTRESRUNMins= %s\n", tmp_char);
+			qos->max_tres_run_mins_pu, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
+		printf("  MaxTRESRUNMinsPerUser    = %s\n", tmp_char);
 		xfree(tmp_char);
 	}
 
 	if (qos->max_wall_pj == INFINITE)
-		printf("  MaxWall        = NONE\n");
+		printf("  MaxWall                  = NONE\n");
 	else if (qos->max_wall_pj != NO_VAL) {
 		char time_buf[32];
 		mins2time_str((time_t) qos->max_wall_pj,
 			      time_buf, sizeof(time_buf));
-		printf("  MaxWall        = %s\n", time_buf);
+		printf("  MaxWall                  = %s\n", time_buf);
 	}
 
 	if (qos->preempt_list) {
 		char *temp_char = get_qos_complete_str(g_qos_list,
 						       qos->preempt_list);
 		if (temp_char) {
-			printf("  Preempt        = %s\n", temp_char);
+			printf("  Preempt          = %s\n", temp_char);
 			xfree(temp_char);
 		}
 	}
 
 	if (qos->preempt_mode && (qos->preempt_mode != (uint16_t)NO_VAL)) {
-		printf("  PreemptMode    = %s\n",
+		printf("  PreemptMode              = %s\n",
 		       preempt_mode_string(qos->preempt_mode));
 	}
 
 	if (qos->priority == INFINITE)
-		printf("  Priority       = NONE\n");
+		printf("  Priority                 = NONE\n");
 	else if (qos->priority != NO_VAL)
-		printf("  Priority       = %d\n", qos->priority);
+		printf("  Priority                 = %d\n", qos->priority);
 
 }
 
@@ -1883,7 +1965,7 @@ extern int sort_coord_list(void *a, void *b)
 	slurmdb_coord_rec_t *coord_b = *(slurmdb_coord_rec_t **)b;
 	int diff;
 
-	diff = strcmp(coord_a->name, coord_b->name);
+	diff = xstrcmp(coord_a->name, coord_b->name);
 
 	if (diff < 0)
 		return -1;
@@ -1937,7 +2019,7 @@ extern int sacctmgr_validate_cluster_list(List cluster_list)
 
 		list_iterator_reset(itr);
 		while ((cluster_rec = list_next(itr))) {
-			if (!strcasecmp(cluster_rec->name, cluster))
+			if (!xstrcasecmp(cluster_rec->name, cluster))
 				break;
 		}
 		if (!cluster_rec) {
diff --git a/src/sacctmgr/config_functions.c b/src/sacctmgr/config_functions.c
index 17aa00fb9..31e12139f 100644
--- a/src/sacctmgr/config_functions.c
+++ b/src/sacctmgr/config_functions.c
@@ -55,6 +55,7 @@ static uint16_t msg_timeout;
 static char    *plugin_dir = NULL;
 static uint16_t private_data;
 static uint32_t slurm_user_id;
+static uint16_t tcp_timeout;
 static uint16_t track_wckey;
 
 static List dbd_config_list = NULL;
@@ -103,6 +104,7 @@ static void _load_slurm_config(void)
 	plugin_dir = slurm_get_plugin_dir();
 	private_data = slurm_get_private_data();
 	slurm_user_id = slurm_get_slurm_user_id();
+	tcp_timeout = slurm_get_tcp_timeout();
 	track_wckey = slurm_get_track_wckey();
 }
 
@@ -141,6 +143,7 @@ static void _print_slurm_config(void)
 	printf("SlurmUserId            = %s(%u)\n", user_name, slurm_user_id);
 	printf("SLURM_CONF             = %s\n", default_slurm_config_file);
 	printf("SLURM_VERSION          = %s\n", SLURM_VERSION_STRING);
+	printf("TCPTimeout             = %u sec\n", tcp_timeout);
 	printf("TrackWCKey             = %u\n", track_wckey);
 }
 
diff --git a/src/sacctmgr/event_functions.c b/src/sacctmgr/event_functions.c
index 7faf952b7..9eeea6e4a 100644
--- a/src/sacctmgr/event_functions.c
+++ b/src/sacctmgr/event_functions.c
@@ -121,7 +121,8 @@ static int _addto_state_char_list(List char_list, char *names)
 					name = xstrdup_printf("%u", c);
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -153,7 +154,7 @@ static int _addto_state_char_list(List char_list, char *names)
 			name = xstrdup_printf("%u", c);
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -227,7 +228,8 @@ static int _addto_id_char_list(List char_list, char *names, bool gid)
 					name = _convert_to_id( name, gid );
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -255,7 +257,7 @@ static int _addto_id_char_list(List char_list, char *names, bool gid)
 			name = _convert_to_id(name, gid);
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -468,26 +470,26 @@ extern int sacctmgr_list_event(int argc, char *argv[])
 	   time correctly for just the past day.
 	*/
 	if (argc == 0) {
-                struct tm start_tm;
+		struct tm start_tm;
 		event_cond->period_start = time(NULL);
 
-                if (!slurm_localtime_r(&event_cond->period_start,
+		if (!slurm_localtime_r(&event_cond->period_start,
 				       &start_tm)) {
-                        fprintf(stderr,
-                                " Couldn't get localtime from %ld",
-                                (long)event_cond->period_start);
-                        exit_code = 1;
-                        return 0;
-                }
-                start_tm.tm_sec = 0;
-                start_tm.tm_min = 0;
-                start_tm.tm_hour = 0;
-                start_tm.tm_mday--;
-                start_tm.tm_isdst = -1;
-                event_cond->period_start = slurm_mktime(&start_tm);
-        }
-
-	for (i=0; i<argc; i++) {
+			fprintf(stderr,
+				" Couldn't get localtime from %ld",
+				(long)event_cond->period_start);
+			exit_code = 1;
+			return 0;
+		}
+		start_tm.tm_sec = 0;
+		start_tm.tm_min = 0;
+		start_tm.tm_hour = 0;
+		start_tm.tm_mday--;
+		start_tm.tm_isdst = -1;
+		event_cond->period_start = slurm_mktime(&start_tm);
+	}
+
+	for (i = 0; i < argc; i++) {
 		int command_len = strlen(argv[i]);
 		if (!strncasecmp (argv[i], "Where", MAX(command_len, 5))
 		    || !strncasecmp (argv[i], "Set", MAX(command_len, 3)))
@@ -557,8 +559,8 @@ extern int sacctmgr_list_event(int argc, char *argv[])
 				convert_num_unit(
 					(float)slurmdb_find_tres_count_in_string(
 						event->tres_str, TRES_CPU),
-					tmp, sizeof(tmp),
-					UNIT_NONE, CONVERT_NUM_UNIT_EXACT);
+					tmp, sizeof(tmp), UNIT_NONE, NO_VAL,
+					CONVERT_NUM_UNIT_EXACT);
 
 				field->print_routine(
 					field,
@@ -628,7 +630,8 @@ extern int sacctmgr_list_event(int argc, char *argv[])
 				sacctmgr_initialize_g_tres_list();
 
 				tmp_char = slurmdb_make_tres_string_from_simple(
-					event->tres_str, g_tres_list);
+					event->tres_str, g_tres_list, NO_VAL,
+					CONVERT_NUM_UNIT_EXACT);
 
 				field->print_routine(
 					field,
diff --git a/src/sacctmgr/file_functions.c b/src/sacctmgr/file_functions.c
index ae76a3b42..661a84669 100644
--- a/src/sacctmgr/file_functions.c
+++ b/src/sacctmgr/file_functions.c
@@ -580,7 +580,7 @@ static int _mod_assoc(sacctmgr_file_opts_t *file_opts,
 			   file_opts->assoc_rec.max_wall_pj);
 	}
 	if (assoc->parent_acct && parent
-	    && strcmp(assoc->parent_acct, parent)) {
+	    && xstrcmp(assoc->parent_acct, parent)) {
 		mod_assoc.parent_acct = parent;
 		changed = 1;
 		xstrfmtcat(my_info,
@@ -604,7 +604,7 @@ static int _mod_assoc(sacctmgr_file_opts_t *file_opts,
 			mod_assoc.qos_list = list_create(slurm_destroy_char);
 		while ((new_qos = list_next(new_qos_itr))) {
 			while ((now_qos = list_next(now_qos_itr))) {
-				if (!strcmp(new_qos, now_qos))
+				if (!xstrcmp(new_qos, now_qos))
 					break;
 			}
 			list_iterator_reset(now_qos_itr);
@@ -784,7 +784,7 @@ static int _mod_acct(sacctmgr_file_opts_t *file_opts,
 	if (file_opts->desc)
 		desc = xstrdup(file_opts->desc);
 
-	if (desc && strcmp(desc, acct->description)) {
+	if (desc && xstrcmp(desc, acct->description)) {
 		xstrfmtcat(my_info,
 			   "%-30.30s for %-7.7s %-10.10s %8s -> %s\n",
 			   " Changed description", "Account",
@@ -799,7 +799,7 @@ static int _mod_acct(sacctmgr_file_opts_t *file_opts,
 	if (file_opts->org)
 		org = xstrdup(file_opts->org);
 
-	if (org && strcmp(org, acct->organization)) {
+	if (org && xstrcmp(org, acct->organization)) {
 		xstrfmtcat(my_info,
 			   "%-30.30s for %-7.7s %-10.10s %8s -> %s\n",
 			   " Changed organization", "Account",
@@ -875,7 +875,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 		def_acct = xstrdup(file_opts->def_acct);
 
 	if (def_acct &&
-	    (!user->default_acct || strcmp(def_acct, user->default_acct))) {
+	    (!user->default_acct || xstrcmp(def_acct, user->default_acct))) {
 		xstrfmtcat(my_info,
 			   "%-30.30s for %-7.7s %-10.10s %8s -> %s\n",
 			   " Changed Default Account", "User",
@@ -890,7 +890,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 		def_wckey = xstrdup(file_opts->def_wckey);
 
 	if (def_wckey &&
-	    (!user->default_wckey || strcmp(def_wckey, user->default_wckey))) {
+	    (!user->default_wckey || xstrcmp(def_wckey, user->default_wckey))) {
 		xstrfmtcat(my_info,
 			   "%-30.30s for %-7.7s %-10.10s %8s -> %s\n",
 			   " Changed Default WCKey", "User",
@@ -992,7 +992,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 			while ((coord = list_next(coord_itr))) {
 				if (!coord->direct)
 					continue;
-				if (!strcmp(coord->name, temp_char)) {
+				if (!xstrcmp(coord->name, temp_char)) {
 					break;
 				}
 			}
@@ -1036,7 +1036,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 			wckey->name = xstrdup(temp_char);
 			wckey->cluster = xstrdup(cluster);
 			wckey->user = xstrdup(user->name);
-			if (!strcmp(wckey->name, user->default_wckey))
+			if (!xstrcmp(wckey->name, user->default_wckey))
 				wckey->is_def = 1;
 			list_push(user->wckey_list, wckey);
 
@@ -1066,7 +1066,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 
 		while ((temp_char = list_next(char_itr))) {
 			while ((wckey = list_next(wckey_itr))) {
-				if (!strcmp(wckey->name, temp_char))
+				if (!xstrcmp(wckey->name, temp_char))
 					break;
 			}
 			if (!wckey) {
@@ -1076,7 +1076,7 @@ static int _mod_user(sacctmgr_file_opts_t *file_opts,
 				wckey->name = xstrdup(temp_char);
 				wckey->cluster = xstrdup(cluster);
 				wckey->user = xstrdup(user->name);
-				if (!strcmp(wckey->name, user->default_wckey))
+				if (!xstrcmp(wckey->name, user->default_wckey))
 					wckey->is_def = 1;
 
 				list_append(add_list, wckey);
@@ -1164,7 +1164,7 @@ static slurmdb_user_rec_t *_set_user_up(sacctmgr_file_opts_t *file_opts,
 			wckey->name = xstrdup(temp_char);
 			wckey->user = xstrdup(user->name);
 			wckey->cluster = xstrdup(cluster);
-			if (!strcmp(wckey->name, user->default_wckey))
+			if (!xstrcmp(wckey->name, user->default_wckey))
 				wckey->is_def = 1;
 			list_push(user->wckey_list, wckey);
 		}
@@ -1189,7 +1189,7 @@ static slurmdb_account_rec_t *_set_acct_up(sacctmgr_file_opts_t *file_opts,
 		acct->description = xstrdup(file_opts->name);
 	if (file_opts->org)
 		acct->organization = xstrdup(file_opts->org);
-	else if (strcmp(parent, "root"))
+	else if (xstrcmp(parent, "root"))
 		acct->organization = xstrdup(parent);
 	else
 		acct->organization = xstrdup(file_opts->name);
@@ -1234,7 +1234,7 @@ static slurmdb_assoc_rec_t *_set_assoc_up(sacctmgr_file_opts_t *file_opts,
 		assoc->cluster = xstrdup(cluster);
 		assoc->partition = xstrdup(file_opts->assoc_rec.partition);
 		assoc->user = xstrdup(file_opts->name);
-		if (!strcmp(assoc->acct, file_opts->def_acct))
+		if (!xstrcmp(assoc->acct, file_opts->def_acct))
 			assoc->is_def = 1;
 		break;
 	default:
@@ -1407,7 +1407,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->grp_tres_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres_mins, g_tres_list);
+			assoc->grp_tres_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":GrpTRESMins=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1415,7 +1416,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->grp_tres_run_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres_run_mins, g_tres_list);
+			assoc->grp_tres_run_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":GrpTRESRunMins=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1423,7 +1425,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->grp_tres) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->grp_tres, g_tres_list);
+			assoc->grp_tres, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":GrpTRES=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1440,7 +1443,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->max_tres_mins_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_mins_pj, g_tres_list);
+			assoc->max_tres_mins_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":MaxTRESMinsPerJob=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1448,7 +1452,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->max_tres_run_mins) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_run_mins, g_tres_list);
+			assoc->max_tres_run_mins, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":MaxTRESRunMins=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1456,7 +1461,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->max_tres_pj) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_pj, g_tres_list);
+			assoc->max_tres_pj, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":MaxTRESPerJob=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1464,7 +1470,8 @@ extern int print_file_add_limits_to_line(char **line,
 	if (assoc->max_tres_pn) {
 		sacctmgr_initialize_g_tres_list();
 		tmp_char = slurmdb_make_tres_string_from_simple(
-			assoc->max_tres_pn, g_tres_list);
+			assoc->max_tres_pn, g_tres_list, NO_VAL,
+			CONVERT_NUM_UNIT_EXACT);
 		xstrfmtcat(*line, ":MaxTRESPerNode=%s", tmp_char);
 		xfree(tmp_char);
 	}
@@ -1695,8 +1702,8 @@ extern void load_sacctmgr_cfg_file (int argc, char *argv[])
 		}
 		start++;
 
-		if (!strcasecmp("Machine", object)
-		    || !strcasecmp("Cluster", object)) {
+		if (!xstrcasecmp("Machine", object)
+		    || !xstrcasecmp("Cluster", object)) {
 			slurmdb_assoc_cond_t assoc_cond;
 
 			if (cluster_name && !cluster_name_set) {
@@ -1885,7 +1892,7 @@ extern void load_sacctmgr_cfg_file (int argc, char *argv[])
 			break;
 		}
 
-		if (!strcasecmp("Parent", object)) {
+		if (!xstrcasecmp("Parent", object)) {
 			file_opts = _parse_options(line+start);
 			xfree(parent);
 
@@ -1918,8 +1925,8 @@ extern void load_sacctmgr_cfg_file (int argc, char *argv[])
 			       "before any children in your file\n");
 		}
 
-		if (!strcasecmp("Project", object)
-		    || !strcasecmp("Account", object)) {
+		if (!xstrcasecmp("Project", object)
+		    || !xstrcasecmp("Account", object)) {
 			file_opts = _parse_options(line+start);
 
 			if (!file_opts) {
@@ -2011,7 +2018,7 @@ extern void load_sacctmgr_cfg_file (int argc, char *argv[])
 			}
 			_destroy_sacctmgr_file_opts(file_opts);
 			continue;
-		} else if (!strcasecmp("User", object)) {
+		} else if (!xstrcasecmp("User", object)) {
 			file_opts = _parse_options(line+start);
 
 			if (!file_opts) {
diff --git a/src/sacctmgr/lost_jobs_functions.c b/src/sacctmgr/lost_jobs_functions.c
new file mode 100644
index 000000000..c3ab13da3
--- /dev/null
+++ b/src/sacctmgr/lost_jobs_functions.c
@@ -0,0 +1,236 @@
+/*****************************************************************************\
+ * lost_jobs_functions.c - functions dealing with lost jobs
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC.
+ *  Written by Nathan Yee <nyee32@schedmd.com>
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+#include "src/sacctmgr/sacctmgr.h"
+#include "src/common/assoc_mgr.h"
+
+static int _job_sort_by_start_time(void *void1, void * void2)
+{
+	time_t start1 = (*(slurmdb_job_rec_t **)void1)->start;
+	time_t start2 = (*(slurmdb_job_rec_t **)void2)->start;
+
+	if (start1 < start2)
+		return -1;
+	else if (start1 > start2)
+		return 1;
+	else
+		return 0;
+}
+
+static void _print_lost_jobs(List jobs)
+{
+	char outbuf[FORMAT_STRING_SIZE];
+	slurmdb_job_rec_t *job = NULL;
+	ListIterator itr = NULL;
+	ListIterator field_itr = NULL;
+	List print_fields_list; /* types are of print_field_t */
+	print_field_t *field = NULL;
+	int field_count;
+	List format_list = list_create(slurm_destroy_char);
+	slurm_addto_char_list(format_list,
+			      "ID%-12,Name,Part,Cluster,State%10,Start,End");
+	print_fields_list = sacctmgr_process_format_list(format_list);
+	FREE_NULL_LIST(format_list);
+
+	print_fields_header(print_fields_list);
+	field_count = list_count(print_fields_list);
+
+	list_sort(jobs, _job_sort_by_start_time);
+
+	itr = list_iterator_create(jobs);
+	field_itr = list_iterator_create(print_fields_list);
+	while((job = list_next(itr))) {
+		int curr_inx = 1;
+		while((field = list_next(field_itr))) {
+			switch(field->type) {
+			case PRINT_ID:
+				field->print_routine(
+					field,
+					job->jobid,
+					(curr_inx == field_count));
+				break;
+			case PRINT_NAME:
+				field->print_routine(
+					field,
+					job->jobname,
+					(curr_inx == field_count));
+				break;
+			case PRINT_PART:
+				field->print_routine(
+					field,
+					job->partition,
+					(curr_inx == field_count));
+				break;
+			case PRINT_CLUSTER:
+				field->print_routine(
+					field,
+					job->cluster,
+					(curr_inx == field_count));
+				break;
+			case PRINT_STATE:
+				snprintf(outbuf, FORMAT_STRING_SIZE, "%s",
+					 job_state_string(job->state));
+				field->print_routine(
+					field,
+					outbuf,
+					(curr_inx == field_count));
+				break;
+			case PRINT_TIMESTART:
+				field->print_routine(
+					field,
+					job->start,
+					(curr_inx == field_count));
+				break;
+			case PRINT_TIMEEND:
+				field->print_routine(
+					field,
+					job->end,
+					(curr_inx == field_count));
+				break;
+			default:
+				break;
+			}
+			curr_inx++;
+		}
+		list_iterator_reset(field_itr);
+		printf("\n");
+	}
+	list_iterator_destroy(field_itr);
+	list_iterator_destroy(itr);
+}
+
+static List _get_lost_jobs(char *cluster)
+{
+	int i = 0;
+	bool job_lost = true;
+	List db_jobs_list = NULL;
+	ListIterator    db_jobs_itr  = NULL;
+	job_info_t     *clus_job     = NULL;
+	job_info_msg_t *clus_jobs    = NULL;
+	slurmdb_job_rec_t  *db_job   = NULL;
+	slurmdb_job_cond_t *job_cond = xmalloc(sizeof(slurmdb_job_cond_t));
+	List lost_jobs = NULL;
+
+	job_cond->without_steps = 1;
+	job_cond->without_usage_truncation = 1;
+	job_cond->state_list = list_create(slurm_destroy_char);
+	slurm_addto_char_list(job_cond->state_list, "1");
+	job_cond->cluster_list = list_create(slurm_destroy_char);
+	slurm_addto_char_list(job_cond->cluster_list, cluster);
+
+	db_jobs_list = slurmdb_jobs_get(db_conn, job_cond);
+	slurmdb_destroy_job_cond(job_cond);
+
+	if (slurm_load_jobs((time_t)NULL, &clus_jobs, 0)) {
+		error("Failed to get jobs from cluster %s: %m", cluster);
+		return NULL;
+	}
+
+	lost_jobs = list_create(NULL);
+	db_jobs_itr = list_iterator_create(db_jobs_list);
+	while ((db_job = list_next(db_jobs_itr))) {
+		job_lost = true;
+		for (i = 0, clus_job = clus_jobs->job_array;
+		     i < clus_jobs->record_count; i++, clus_job++) {
+			if (db_job->jobid == clus_job->job_id) {
+				job_lost = false;
+				break;
+			}
+		}
+
+		if (job_lost)
+			list_append(lost_jobs, db_job);
+	}
+	list_iterator_destroy(db_jobs_itr);
+
+	return lost_jobs;
+}
+
+static void _report_lost_jobs(List lost_jobs)
+{
+	if (list_count(lost_jobs)) {
+		printf("NOTE: Lost jobs are jobs that don't exist in the "
+		       "controller but are still considered running in the "
+		       "datbase\n");
+		_print_lost_jobs(lost_jobs);
+	}
+}
+
+/*
+ * List and ask user if they wish to fix the lost jobs
+ */
+extern int sacctmgr_list_lost_jobs(int argc, char *argv[])
+{
+	List lost_jobs = NULL;
+	int rc = SLURM_SUCCESS;
+	uint32_t my_uid = getuid();
+	char *cluster = NULL;
+
+	char *ask_msg = "\nWould you like to fix these lost jobs?\n"
+			"(This will set the end times to start times and "
+			"states to completed for these jobs and will trigger "
+			"the rollup to reroll usage from before the oldest "
+			"lost job.)\n\n";
+
+	if (!(cluster = slurm_get_cluster_name()))
+		return SLURM_ERROR;
+
+	if (!(lost_jobs = _get_lost_jobs(cluster)))
+		return SLURM_ERROR;
+	xfree(cluster);
+	_report_lost_jobs(lost_jobs);
+
+	if (list_count(lost_jobs)) {
+		rc = acct_storage_g_fix_lost_jobs(db_conn, my_uid, lost_jobs);
+
+		if (rc == SLURM_SUCCESS) {
+			if (commit_check(ask_msg)) {
+				acct_storage_g_commit(db_conn, 1);
+			} else {
+				printf("Changes Discarded\n");
+				acct_storage_g_commit(db_conn, 0);
+			}
+		}
+		else {
+			error("Failed to fix lost job: %s\n",
+			      slurm_strerror(rc));
+		}
+
+	} else {
+		printf("Lost Jobs: No lost jobs found\n");
+	}
+
+	return rc;
+}
diff --git a/src/sacctmgr/qos_functions.c b/src/sacctmgr/qos_functions.c
index 48da08022..dfb5763ed 100644
--- a/src/sacctmgr/qos_functions.c
+++ b/src/sacctmgr/qos_functions.c
@@ -456,12 +456,19 @@ static int _set_rec(int *start, int argc, char *argv[],
 					tres_flags);
 				xfree(tmp_char);
 			}
+		} else if (!strncasecmp (argv[i], "MaxJobsPerAccount",
+					 MAX(command_len, 11)) ||
+			   !strncasecmp (argv[i], "MaxJobsPA",
+					 MAX(command_len, 9))) {
+			if (get_uint(argv[i]+end, &qos->max_jobs_pa,
+			    "MaxJobsPA") == SLURM_SUCCESS)
+				set = 1;
 		} else if (!strncasecmp (argv[i], "MaxJobsPerUser",
 					 MAX(command_len, 4)) ||
 			   !strncasecmp (argv[i], "MaxJobsPU",
 					 MAX(command_len, 4))) {
 			if (get_uint(argv[i]+end, &qos->max_jobs_pu,
-			    "MaxJobs") == SLURM_SUCCESS)
+			    "MaxJobsPU") == SLURM_SUCCESS)
 				set = 1;
 		} else if (!strncasecmp (argv[i], "MaxNodesPerJob",
 					 MAX(command_len, 4))) {
@@ -489,13 +496,34 @@ static int _set_rec(int *start, int argc, char *argv[],
 					tres_flags);
 				xfree(tmp_char);
 			}
+		} else if (!strncasecmp (argv[i], "MaxSubmitJobsPerAccount",
+					 MAX(command_len, 17)) ||
+			   !strncasecmp (argv[i], "MaxSubmitJobsPA",
+					 MAX(command_len, 15))) {
+			if (get_uint(argv[i]+end, &qos->max_submit_jobs_pa,
+			    "MaxSubmitJobsPA") == SLURM_SUCCESS)
+				set = 1;
 		} else if (!strncasecmp (argv[i], "MaxSubmitJobsPerUser",
 					 MAX(command_len, 4)) ||
 			   !strncasecmp (argv[i], "MaxSubmitJobsPU",
 					 MAX(command_len, 4))) {
 			if (get_uint(argv[i]+end, &qos->max_submit_jobs_pu,
-			    "MaxSubmitJobs") == SLURM_SUCCESS)
+			    "MaxSubmitJobsPU") == SLURM_SUCCESS)
+				set = 1;
+		} else if (!strncasecmp(argv[i], "MaxTRESPerAccount",
+					MAX(command_len, 11)) ||
+			   !strncasecmp(argv[i], "MaxTRESPA",
+					MAX(command_len, 9))) {
+			sacctmgr_initialize_g_tres_list();
+
+			if ((tmp_char = slurmdb_format_tres_str(
+				     argv[i]+end, g_tres_list, 1))) {
+				slurmdb_combine_tres_strings(
+					&qos->max_tres_pa, tmp_char,
+					tres_flags);
 				set = 1;
+				xfree(tmp_char);
+			}
 		} else if (!strncasecmp(argv[i], "MaxTRESPerJob",
 					MAX(command_len, 7))) {
 			sacctmgr_initialize_g_tres_list();
@@ -546,7 +574,19 @@ static int _set_rec(int *start, int argc, char *argv[],
 				set = 1;
 				xfree(tmp_char);
 			}
-		} else if (!strncasecmp(argv[i], "MaxTRESRunMins",
+		} else if (!strncasecmp(argv[i], "MaxTRESRunMinsPA",
+					MAX(command_len, 16))) {
+			sacctmgr_initialize_g_tres_list();
+
+			if ((tmp_char = slurmdb_format_tres_str(
+				     argv[i]+end, g_tres_list, 1))) {
+				slurmdb_combine_tres_strings(
+					&qos->max_tres_run_mins_pa, tmp_char,
+					tres_flags);
+				set = 1;
+				xfree(tmp_char);
+			}
+		} else if (!strncasecmp(argv[i], "MaxTRESRunMinsPU",
 					MAX(command_len, 8))) {
 			sacctmgr_initialize_g_tres_list();
 
@@ -889,7 +929,10 @@ extern int sacctmgr_list_qos(int argc, char *argv[])
 				      "MaxTRES,MaxTRESPerN,MaxTRESMins,MaxW,"
 				      "MaxTRESPerUser,"
 				      "MaxJobsPerUser,"
-				      "MaxSubmitJobsPerUser,MinTRES");
+				      "MaxSubmitJobsPerUser,"
+				      "MaxTRESPerAcct,"
+				      "MaxJobsPerAcct,"
+				      "MaxSubmitJobsPerAcct,MinTRES");
 	}
 
 	print_fields_list = sacctmgr_process_format_list(format_list);
@@ -1056,11 +1099,21 @@ extern int sacctmgr_list_qos(int argc, char *argv[])
 					field, qos->max_tres_run_mins_pu,
 					(curr_inx == field_count));
 				break;
+			case PRINT_MAXTRMA:
+				field->print_routine(
+					field, qos->max_tres_run_mins_pa,
+					(curr_inx == field_count));
+				break;
 			case PRINT_MAXT:
 				field->print_routine(
 					field, qos->max_tres_pj,
 					(curr_inx == field_count));
 				break;
+			case PRINT_MAXTA:
+				field->print_routine(
+					field, qos->max_tres_pa,
+					(curr_inx == field_count));
+				break;
 			case PRINT_MAXTN:
 				field->print_routine(
 					field, qos->max_tres_pn,
@@ -1076,6 +1129,11 @@ extern int sacctmgr_list_qos(int argc, char *argv[])
 						     qos->max_jobs_pu,
 						     (curr_inx == field_count));
 				break;
+			case PRINT_MAXJA:
+				field->print_routine(field,
+						     qos->max_jobs_pa,
+						     (curr_inx == field_count));
+				break;
 			case PRINT_MAXN:
 				field->print_routine(
 					field,
@@ -1095,6 +1153,11 @@ extern int sacctmgr_list_qos(int argc, char *argv[])
 						     qos->max_submit_jobs_pu,
 						     (curr_inx == field_count));
 				break;
+			case PRINT_MAXSA:
+				field->print_routine(field,
+						     qos->max_submit_jobs_pa,
+						     (curr_inx == field_count));
+				break;
 			case PRINT_MAXW:
 				field->print_routine(
 					field,
diff --git a/src/sacctmgr/reservation_functions.c b/src/sacctmgr/reservation_functions.c
index 0770ba0b9..1360b1a5b 100644
--- a/src/sacctmgr/reservation_functions.c
+++ b/src/sacctmgr/reservation_functions.c
@@ -283,7 +283,8 @@ int sacctmgr_list_reservation(int argc, char **argv)
 				sacctmgr_initialize_g_tres_list();
 
 				tmp_char = slurmdb_make_tres_string_from_simple(
-					reservation->tres_str, g_tres_list);
+					reservation->tres_str, g_tres_list,
+					NO_VAL, CONVERT_NUM_UNIT_EXACT);
 				field->print_routine(field,
 						     tmp_char,
 						     field_count);
diff --git a/src/sacctmgr/resource_functions.c b/src/sacctmgr/resource_functions.c
index c42a774e0..10ba83f26 100644
--- a/src/sacctmgr/resource_functions.c
+++ b/src/sacctmgr/resource_functions.c
@@ -83,8 +83,8 @@ static void _print_overcommit(slurmdb_res_rec_t *res,
 				cluster = NULL;
 				if (clus_itr) {
 					while ((cluster = list_next(clus_itr)))
-						if (!strcmp(cluster,
-							    clus_res->cluster))
+						if (!xstrcmp(cluster,
+							     clus_res->cluster))
 						    break;
 					list_iterator_reset(clus_itr);
 				} else /* This means we didn't specify
@@ -634,8 +634,8 @@ extern int sacctmgr_add_res(int argc, char *argv[])
 				if (found_itr) {
 					while ((clus_res =
 						list_next(found_itr))) {
-						if (!strcmp(clus_res->cluster,
-							    cluster))
+						if (!xstrcmp(clus_res->cluster,
+							     cluster))
 							break;
 					}
 					list_iterator_reset(found_itr);
diff --git a/src/sacctmgr/sacctmgr.c b/src/sacctmgr/sacctmgr.c
index c6e1af09c..dd28ece34 100644
--- a/src/sacctmgr/sacctmgr.c
+++ b/src/sacctmgr/sacctmgr.c
@@ -181,8 +181,8 @@ main (int argc, char *argv[])
 
 	/* Check to see if we are running a supported accounting plugin */
 	temp = slurm_get_accounting_storage_type();
-	if (strcasecmp(temp, "accounting_storage/slurmdbd")
-	   && strcasecmp(temp, "accounting_storage/mysql")) {
+	if (xstrcasecmp(temp, "accounting_storage/slurmdbd")
+	   && xstrcasecmp(temp, "accounting_storage/mysql")) {
 		fprintf (stderr, "You are not running a supported "
 			 "accounting_storage plugin\n(%s).\n"
 			 "Only 'accounting_storage/slurmdbd' "
@@ -303,10 +303,10 @@ _get_command (int *argc, char **argv)
 	if (in_line == NULL) {
 		exit_flag = 2;
 		return 0;
-	} else if (strncmp (in_line, "#", 1) == 0) {
+	} else if (xstrncmp (in_line, "#", 1) == 0) {
 		free (in_line);
 		return 0;
-	} else if (strcmp (in_line, "!!") == 0) {
+	} else if (xstrcmp (in_line, "!!") == 0) {
 		free (in_line);
 		in_line = last_in_line;
 		in_line_size = last_in_line_size;
@@ -651,6 +651,8 @@ static void _show_it (int argc, char *argv[])
 	} else if (strncasecmp(argv[0], "Problems",
 				MAX(command_len, 1)) == 0) {
 		error_code = sacctmgr_list_problem((argc - 1), &argv[1]);
+	} else if (strncasecmp(argv[0], "LostJobs", MAX(command_len, 1)) == 0) {
+		error_code = sacctmgr_list_lost_jobs((argc - 1), &argv[1]);
 	} else if (strncasecmp(argv[0], "QOS", MAX(command_len, 1)) == 0) {
 		error_code = sacctmgr_list_qos((argc - 1), &argv[1]);
 	} else if (!strncasecmp(argv[0], "Resource", MAX(command_len, 4))) {
diff --git a/src/sacctmgr/sacctmgr.h b/src/sacctmgr/sacctmgr.h
index a75776b1c..c01da83e7 100644
--- a/src/sacctmgr/sacctmgr.h
+++ b/src/sacctmgr/sacctmgr.h
@@ -87,6 +87,7 @@
 #define CKPT_WAIT	10
 #define	MAX_INPUT_FIELDS 128
 #define BUFFER_SIZE 4096
+#define FORMAT_STRING_SIZE 34
 
 typedef enum {
 	/* COMMON */
@@ -122,13 +123,17 @@ typedef enum {
 	PRINT_MAXCU,
 	PRINT_MAXTM,
 	PRINT_MAXTRM,
+	PRINT_MAXTRMA,
 	PRINT_MAXT,
+	PRINT_MAXTA,
 	PRINT_MAXTN,
 	PRINT_MAXTU,
 	PRINT_MAXJ,
+	PRINT_MAXJA,
 	PRINT_MAXN,
 	PRINT_MAXNU,
 	PRINT_MAXS,
+	PRINT_MAXSA,
 	PRINT_MAXW,
 	PRINT_MINC,
 	PRINT_MINT,
@@ -353,4 +358,7 @@ extern void load_sacctmgr_cfg_file (int argc, char *argv[]);
 /* txn_functions.c */
 extern int sacctmgr_list_txn(int argc, char *argv[]);
 
+/* lost_jobs_functions.c */
+extern int sacctmgr_list_lost_jobs(int argc, char *argv[]);
+
 #endif
diff --git a/src/sacctmgr/user_functions.c b/src/sacctmgr/user_functions.c
index de6663a55..5fadb3ee4 100644
--- a/src/sacctmgr/user_functions.c
+++ b/src/sacctmgr/user_functions.c
@@ -556,7 +556,7 @@ static int _check_coord_request(slurmdb_user_cond_t *user_cond, bool check)
 
 		while((name = list_next(itr))) {
 			while((acct_rec = list_next(itr2))) {
-				if (!strcmp(name, acct_rec->name))
+				if (!xstrcmp(name, acct_rec->name))
 					break;
 			}
 			list_iterator_reset(itr2);
@@ -590,7 +590,7 @@ static int _check_coord_request(slurmdb_user_cond_t *user_cond, bool check)
 
 		while((name = list_next(itr))) {
 			while((user_rec = list_next(itr2))) {
-				if (!strcmp(name, user_rec->name))
+				if (!xstrcmp(name, user_rec->name))
 					break;
 			}
 			list_iterator_reset(itr2);
@@ -620,7 +620,7 @@ static bool _check_user_has_default_assoc(char *user_name, List assoc_list)
 	char *last_cluster = NULL;
 
 	while ((assoc = list_next(itr))) {
-		if (last_cluster && strcmp(last_cluster, assoc->cluster)) {
+		if (last_cluster && xstrcmp(last_cluster, assoc->cluster)) {
 			if (!def_found) {
 				exit_code = 1;
 				fprintf(stderr,
@@ -1051,7 +1051,7 @@ extern int sacctmgr_add_user(int argc, char *argv[])
 					assoc->cluster = xstrdup(cluster);
 					assoc->partition = xstrdup(partition);
 					if (local_def_acct &&
-					    !strcmp(local_def_acct, account))
+					    !xstrcmp(local_def_acct, account))
 						assoc->is_def = 1;
 
 					assoc->def_qos_id =
@@ -1097,7 +1097,7 @@ extern int sacctmgr_add_user(int argc, char *argv[])
 				slurmdb_init_assoc_rec(assoc, 0);
 				assoc->user = xstrdup(name);
 				if (local_def_acct
-				   && !strcmp(local_def_acct, account))
+				   && !xstrcmp(local_def_acct, account))
 					assoc->is_def = 1;
 				assoc->acct = xstrdup(account);
 				assoc->cluster = xstrdup(cluster);
@@ -1162,7 +1162,7 @@ extern int sacctmgr_add_user(int argc, char *argv[])
 				wckey->name = xstrdup(account);
 				wckey->cluster = xstrdup(cluster);
 				if (local_def_wckey
-				   && !strcmp(local_def_wckey, account))
+				   && !xstrcmp(local_def_wckey, account))
 					wckey->is_def = 1;
 				if (user)
 					list_append(user->wckey_list, wckey);
@@ -1204,8 +1204,11 @@ no_default:
 
 	if (user_str) {
 		printf(" Adding User(s)\n%s", user_str);
-		printf(" Settings =\n");
-		printf("  Default Account = %s\n", default_acct);
+		if (default_acct || default_wckey ||
+		    (admin_level != SLURMDB_ADMIN_NOTSET))
+			printf(" Settings =\n");
+		if (default_acct)
+			printf("  Default Account = %s\n", default_acct);
 		if (default_wckey)
 			printf("  Default WCKey   = %s\n", default_wckey);
 
@@ -1466,15 +1469,15 @@ extern int sacctmgr_list_user(int argc, char *argv[])
 
 				/* get the defaults */
 				if (!curr_cluster
-				    || strcmp(curr_cluster, assoc->cluster)) {
+				    || xstrcmp(curr_cluster, assoc->cluster)) {
 					slurmdb_assoc_rec_t *assoc2;
 					/* We shouldn't have to reset this
 					 * unless no default is on the
 					 * cluster. */
 					while ((assoc2 = list_next(itr4))) {
 						if (!assoc2->is_def ||
-						    strcmp(assoc->cluster,
-							   assoc2->cluster))
+						    xstrcmp(assoc->cluster,
+							    assoc2->cluster))
 							continue;
 						curr_cluster = assoc2->cluster;
 						xfree(user->default_acct);
@@ -1497,9 +1500,9 @@ extern int sacctmgr_list_user(int argc, char *argv[])
 						while ((wckey =
 							list_next(wckey_itr))) {
 							if (!wckey->is_def ||
-							    strcmp(curr_cluster,
-								   wckey->
-								   cluster))
+							    xstrcmp(curr_cluster,
+								    wckey->
+								    cluster))
 								continue;
 
 							xfree(user->
diff --git a/src/salloc/Makefile.in b/src/salloc/Makefile.in
index b88710366..ec414fa7a 100644
--- a/src/salloc/Makefile.in
+++ b/src/salloc/Makefile.in
@@ -95,7 +95,8 @@ bin_PROGRAMS = salloc$(EXEEXT)
 @HAVE_ALPS_CRAY_TRUE@@HAVE_REAL_CRAY_TRUE@am__append_1 = -ljob
 subdir = src/salloc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/salloc/opt.c b/src/salloc/opt.c
index 062a39ec0..9520b1212 100644
--- a/src/salloc/opt.c
+++ b/src/salloc/opt.c
@@ -110,8 +110,7 @@
 #define OPT_EXCLUSIVE   0x0d
 #define OPT_OVERCOMMIT  0x0e
 #define OPT_ACCTG_FREQ  0x0f
-
-#define OPT_SICP        0x10
+#define OPT_GRES_FLAGS  0x10
 #define OPT_MEM_BIND    0x11
 #define OPT_IMMEDIATE   0x12
 #define OPT_POWER       0x13
@@ -177,10 +176,12 @@
 #define LONG_OPT_REQ_SWITCH      0x143
 #define LONG_OPT_PROFILE         0x144
 #define LONG_OPT_CPU_FREQ        0x145
+#define LONG_OPT_GRES_FLAGS      0x146
 #define LONG_OPT_PRIORITY        0x160
-#define LONG_OPT_SICP            0x161
 #define LONG_OPT_POWER           0x162
 #define LONG_OPT_THREAD_SPEC     0x163
+#define LONG_OPT_MCS_LABEL       0x165
+#define LONG_OPT_DEADLINE        0x166
 
 
 /*---- global variables, defined in opt.h ----*/
@@ -290,7 +291,7 @@ static void _opt_default()
 	uid_t uid = getuid();
 
 	opt.user = uid_to_string(uid);
-	if (strcmp(opt.user, "nobody") == 0)
+	if (xstrcmp(opt.user, "nobody") == 0)
 		fatal("Invalid user id: %u", uid);
 
 	opt.uid = uid;
@@ -328,7 +329,6 @@ static void _opt_default()
 	opt.account  = NULL;
 	opt.comment  = NULL;
 	opt.qos      = NULL;
-	opt.sicp_mode = 0;
 	opt.power_flags = 0;
 
 	opt.distribution = SLURM_DIST_UNKNOWN;
@@ -367,6 +367,7 @@ static void _opt_default()
 	}
 	opt.reboot          = false;
 	opt.no_rotate	    = false;
+	opt.job_flags       = 0;
 
 	opt.euid	    = (uid_t) -1;
 	opt.egid	    = (gid_t) -1;
@@ -384,6 +385,7 @@ static void _opt_default()
 	opt.wckey           = NULL;
 	opt.req_switch      = -1;
 	opt.wait4switch     = -1;
+	opt.mcs_label	    = NULL;
 
 	opt.nice = NO_VAL;
 	opt.priority = 0;
@@ -418,6 +420,7 @@ env_vars_t env_vars[] = {
   {"SALLOC_DEBUG",         OPT_DEBUG,      NULL,               NULL          },
   {"SALLOC_EXCLUSIVE",     OPT_EXCLUSIVE,  NULL,               NULL          },
   {"SALLOC_GEOMETRY",      OPT_GEOMETRY,   NULL,               NULL          },
+  {"SALLOC_GRES_FLAGS",    OPT_GRES_FLAGS, NULL,               NULL          },
   {"SALLOC_IMMEDIATE",     OPT_IMMEDIATE,  NULL,               NULL          },
   {"SALLOC_HINT",          OPT_HINT,       NULL,               NULL          },
   {"SLURM_HINT",           OPT_HINT,       NULL,               NULL          },
@@ -433,7 +436,6 @@ env_vars_t env_vars[] = {
   {"SALLOC_PROFILE",       OPT_PROFILE,    NULL,               NULL          },
   {"SALLOC_QOS",           OPT_STRING,     &opt.qos,           NULL          },
   {"SALLOC_RESERVATION",   OPT_STRING,     &opt.reservation,   NULL          },
-  {"SALLOC_SICP",          OPT_SICP,       NULL,               NULL          },
   {"SALLOC_SIGNAL",        OPT_SIGNAL,     NULL,               NULL          },
   {"SALLOC_THREAD_SPEC",   OPT_THREAD_SPEC,NULL,               NULL          },
   {"SALLOC_TIMELIMIT",     OPT_STRING,     &opt.time_limit_str,NULL          },
@@ -497,7 +499,7 @@ _process_env_var(env_vars_t *e, const char *val)
 		 */
 		if (val[0] == '\0') {
 			*((bool *)e->arg) = true;
-		} else if (strcasecmp(val, "yes") == 0) {
+		} else if (xstrcasecmp(val, "yes") == 0) {
 			*((bool *)e->arg) = true;
 		} else if ((strtol(val, &end, 10) != 0)
 			   && end != val) {
@@ -538,7 +540,15 @@ _process_env_var(env_vars_t *e, const char *val)
 			      e->var, val);
 		}
 		break;
-
+	case OPT_GRES_FLAGS:
+		if (!xstrcasecmp(val, "enforce-binding")) {
+			opt.job_flags |= GRES_ENFORCE_BIND;
+		} else {
+			error("Invalid SALLOC_GRES_FLAGS specification: %s",
+			      val);
+			exit(error_exit);
+		}
+		break;
 	case OPT_IMMEDIATE:
 		if (val)
 			opt.immediate = strtol(val, NULL, 10);
@@ -559,9 +569,11 @@ _process_env_var(env_vars_t *e, const char *val)
 		break;
 	case OPT_EXCLUSIVE:
 		if (val[0] == '\0') {
-			opt.shared = 0;
-		} else if (!strcasecmp(val, "user")) {
-			opt.shared = 2;
+			opt.shared = JOB_SHARED_NONE;
+		} else if (!xstrcasecmp(val, "user")) {
+			opt.shared = JOB_SHARED_USER;
+		} else if (!xstrcasecmp(val, "mcs")) {
+			opt.shared = JOB_SHARED_MCS;
 		} else {
 			error("\"%s=%s\" -- invalid value, ignoring...",
 			      e->var, val);
@@ -595,10 +607,6 @@ _process_env_var(env_vars_t *e, const char *val)
 		opt.power_flags = power_flags_id((char *)val);
 		break;
 
-	case OPT_SICP:
-		opt.sicp_mode = 1;
-		break;
-
 	case OPT_SIGNAL:
 		if (get_signal_opts((char *)val, &opt.warn_signal,
 				    &opt.warn_time, &opt.warn_flags)) {
@@ -663,6 +671,7 @@ void set_options(const int argc, char **argv)
 		{"ntasks",        required_argument, 0, 'n'},
 		{"nodes",         required_argument, 0, 'N'},
 		{"overcommit",    no_argument,       0, 'O'},
+		{"oversubscribe", no_argument,       0, 's'},
 		{"partition",     required_argument, 0, 'p'},
 		{"quiet",         no_argument,       0, 'Q'},
 		{"no-rotate",     no_argument,       0, 'R'},
@@ -687,16 +696,19 @@ void set_options(const int argc, char **argv)
 		{"contiguous",    no_argument,       0, LONG_OPT_CONT},
 		{"cores-per-socket", required_argument, 0, LONG_OPT_CORESPERSOCKET},
 		{"cpu-freq",         required_argument, 0, LONG_OPT_CPU_FREQ},
+		{"deadline",      required_argument, 0, LONG_OPT_DEADLINE},
 		{"exclusive",     optional_argument, 0, LONG_OPT_EXCLUSIVE},
 		{"get-user-env",  optional_argument, 0, LONG_OPT_GET_USER_ENV},
 		{"gid",           required_argument, 0, LONG_OPT_GID},
 		{"gres",          required_argument, 0, LONG_OPT_GRES},
+		{"gres-flags",    required_argument, 0, LONG_OPT_GRES_FLAGS},
 		{"hint",          required_argument, 0, LONG_OPT_HINT},
 		{"ioload-image",  required_argument, 0, LONG_OPT_RAMDISK_IMAGE},
 		{"jobid",         required_argument, 0, LONG_OPT_JOBID},
 		{"linux-image",   required_argument, 0, LONG_OPT_LINUX_IMAGE},
 		{"mail-type",     required_argument, 0, LONG_OPT_MAIL_TYPE},
 		{"mail-user",     required_argument, 0, LONG_OPT_MAIL_USER},
+		{"mcs-label",     required_argument, 0, LONG_OPT_MCS_LABEL},
 		{"mem",           required_argument, 0, LONG_OPT_MEM},
 		{"mem-per-cpu",   required_argument, 0, LONG_OPT_MEM_PER_CPU},
 		{"mem_bind",      required_argument, 0, LONG_OPT_MEM_BIND},
@@ -719,7 +731,6 @@ void set_options(const int argc, char **argv)
 		{"ramdisk-image", required_argument, 0, LONG_OPT_RAMDISK_IMAGE},
 		{"reboot",	  no_argument,       0, LONG_OPT_REBOOT},
 		{"reservation",   required_argument, 0, LONG_OPT_RESERVATION},
-		{"sicp",          optional_argument, 0, LONG_OPT_SICP},
 		{"signal",        required_argument, 0, LONG_OPT_SIGNAL},
 		{"sockets-per-node", required_argument, 0, LONG_OPT_SOCKETSPERNODE},
 		{"switches",      required_argument, 0, LONG_OPT_REQ_SWITCH},
@@ -931,11 +942,21 @@ void set_options(const int argc, char **argv)
 		case LONG_OPT_CONT:
 			opt.contiguous = true;
 			break;
+		case LONG_OPT_DEADLINE:
+			opt.deadline = parse_time(optarg, 0);
+			if (errno == ESLURM_INVALID_TIME_VALUE) {
+				error("Invalid deadline specification %s",
+				       optarg);
+				exit(error_exit);
+			}
+			break;
                 case LONG_OPT_EXCLUSIVE:
 			if (optarg == NULL) {
-				opt.shared = 0;
-			} else if (!strcasecmp(optarg, "user")) {
-				opt.shared = 2;
+				opt.shared = JOB_SHARED_NONE;
+			} else if (!xstrcasecmp(optarg, "user")) {
+				opt.shared = JOB_SHARED_USER;
+			} else if (!xstrcasecmp(optarg, "mcs")) {
+				opt.shared = JOB_SHARED_MCS;
 			} else {
 				error("invalid exclusive option %s", optarg);
 				exit(error_exit);
@@ -1035,7 +1056,7 @@ void set_options(const int argc, char **argv)
 			break;
 		case LONG_OPT_MAIL_TYPE:
 			opt.mail_type |= parse_mail_type(optarg);
-			if (opt.mail_type == 0) {
+			if (opt.mail_type == (uint16_t)INFINITE) {
 				error("--mail-type=%s invalid", optarg);
 				exit(error_exit);
 			}
@@ -1044,16 +1065,16 @@ void set_options(const int argc, char **argv)
 			xfree(opt.mail_user);
 			opt.mail_user = xstrdup(optarg);
 			break;
+		case LONG_OPT_MCS_LABEL: {
+			xfree(opt.mcs_label);
+			opt.mcs_label = xstrdup(optarg);
+			break;
+		}
 		case LONG_OPT_NICE:
 			if (optarg)
 				opt.nice = strtol(optarg, NULL, 10);
 			else
 				opt.nice = 100;
-			if (abs(opt.nice) > NICE_OFFSET) {
-				error("Invalid nice value, must be between "
-				       "-%d and %d", NICE_OFFSET, NICE_OFFSET);
-				exit(error_exit);
-			}
 			if (opt.nice < 0) {
 				uid_t my_uid = getuid();
 				if ((my_uid != 0) &&
@@ -1206,9 +1227,6 @@ void set_options(const int argc, char **argv)
 		case LONG_OPT_POWER:
 			opt.power_flags = power_flags_id(optarg);
 			break;
-		case LONG_OPT_SICP:
-			opt.sicp_mode = 1;
-			break;
 		case LONG_OPT_SIGNAL:
 			if (get_signal_opts(optarg, &opt.warn_signal,
 					    &opt.warn_time, &opt.warn_flags)) {
@@ -1222,14 +1240,23 @@ void set_options(const int argc, char **argv)
 			opt.time_min_str = xstrdup(optarg);
 			break;
 		case LONG_OPT_GRES:
-			if (!strcasecmp(optarg, "help") ||
-			    !strcasecmp(optarg, "list")) {
+			if (!xstrcasecmp(optarg, "help") ||
+			    !xstrcasecmp(optarg, "list")) {
 				print_gres_help();
 				exit(0);
 			}
 			xfree(opt.gres);
 			opt.gres = xstrdup(optarg);
 			break;
+		case LONG_OPT_GRES_FLAGS:
+			if (!xstrcasecmp(optarg, "enforce-binding")) {
+				opt.job_flags |= GRES_ENFORCE_BIND;
+			} else {
+				error("Invalid gres-flags specification: %s",
+				      optarg);
+				exit(error_exit);
+			}
+			break;
 		case LONG_OPT_WAIT_ALL_NODES:
 			opt.wait_all_nodes = strtol(optarg, NULL, 10);
 			break;
@@ -1477,7 +1504,7 @@ static bool _opt_verify(void)
 		return false;
 	}
 	if (opt.shared && opt.shared != (uint16_t)NO_VAL) {
-		info("Space sharing nodes is not supported on Cray systems");
+		info("Oversubscribing resources is not supported on Cray/ALPS systems");
 		opt.shared = false;
 	}
 	if (opt.overcommit) {
@@ -1635,6 +1662,10 @@ static bool _opt_verify(void)
 		if (opt.time_min == 0)
 			opt.time_min = INFINITE;
 	}
+	if ((opt.deadline) && (opt.begin) && (opt.deadline < opt.begin)) {
+		error("Incompatible begin and deadline time specification");
+		exit(error_exit);
+	}
 
 #ifdef HAVE_AIX
 	if (opt.network == NULL)
@@ -1692,7 +1723,7 @@ extern char *spank_get_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(tmp_str);
 		return (opt.spank_job_env[i] + len);
@@ -1719,7 +1750,7 @@ extern int   spank_set_job_env(const char *name, const char *value,
 	xstrcat(tmp_str, value);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		if (overwrite) {
 			xfree(opt.spank_job_env[i]);
@@ -1752,7 +1783,7 @@ extern int   spank_unset_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(opt.spank_job_env[i]);
 		for (j=(i+1); j<opt.spank_job_env_size; i++, j++)
@@ -1888,7 +1919,6 @@ static void _opt_list(void)
 		info("gres           : %s", opt.gres);
 	info("network        : %s", opt.network);
 	info("power          : %s", power_flags_str(opt.power_flags));
-	info("sicp           : %u", opt.sicp_mode);
 	info("profile        : `%s'",
 	     acct_gather_profile_to_string(opt.profile));
 	info("qos            : %s", opt.qos);
@@ -1929,6 +1959,11 @@ static void _opt_list(void)
 		slurm_make_time_str(&opt.begin, time_str, sizeof(time_str));
 		info("begin          : %s", time_str);
 	}
+	if (opt.deadline) {
+		char time_str[32];
+		slurm_make_time_str(&opt.deadline, time_str, sizeof(time_str));
+		info("deadline       : %s", time_str);
+	}
 	info("mail_type      : %s", print_mail_type(opt.mail_type));
 	info("mail_user      : %s", opt.mail_user);
 	info("sockets-per-node  : %d", opt.sockets_per_node);
@@ -1955,6 +1990,8 @@ static void _opt_list(void)
 	} else
 		info("core-spec         : %d", opt.core_spec);
 	info("burst_buffer      : `%s'", opt.burst_buffer);
+	if (opt.mcs_label)
+		info("mcs-label         : %s",opt.mcs_label);
 	xfree(str);
 
 }
@@ -1965,7 +2002,7 @@ static void _usage(void)
 "Usage: salloc [-N numnodes|[min nodes]-[max nodes]] [-n num-processors]\n"
 "              [[-c cpus-per-node] [-r n] [-p partition] [--hold] [-t minutes]\n"
 "              [--immediate[=secs]] [--no-kill] [--overcommit] [-D path]\n"
-"              [--share] [-J jobname] [--jobid=id]\n"
+"              [--oversubscribe] [-J jobname] [--jobid=id]\n"
 "              [--verbose] [--gid=group] [--uid=user] [--licenses=names]\n"
 "              [--contiguous] [--mincpus=n] [--mem=MB] [--tmp=MB] [-C list]\n"
 "              [--account=name] [--dependency=type:jobid] [--comment=name]\n"
@@ -1984,13 +2021,13 @@ static void _usage(void)
 "              [--mloader-image=path] [--ioload-image=path]\n"
 #endif
 #endif
-"              [--mail-type=type] [--mail-user=user][--nice[=value]]\n"
+"              [--mail-type=type] [--mail-user=user] [--nice[=value]]\n"
 "              [--bell] [--no-bell] [--kill-command[=signal]]\n"
 "              [--nodefile=file] [--nodelist=hosts] [--exclude=hosts]\n"
 "              [--network=type] [--mem-per-cpu=MB] [--qos=qos]\n"
-"              [--mem_bind=...] [--reservation=name]\n"
-"              [--time-min=minutes] [--gres=list] [--profile=...]\n"
-"              [--cpu-freq=min[-max[:gov]] [--sicp] [--power=flags]\n"
+"              [--mem_bind=...] [--reservation=name] [--mcs-label=mcs]\n"
+"              [--time-min=minutes] [--gres=list] [--gres-flags=opts]\n"
+"              [--cpu-freq=min[-max[:gov]] [--power=flags] [--profile=...]\n"
 "              [--switches=max-switches[@max-time-to-wait]]\n"
 "              [--core-spec=cores] [--thread-spec=threads] [--reboot]\n"
 "              [--bb=burst_buffer_spec] [--bbf=burst_buffer_file]\n"
@@ -2014,10 +2051,13 @@ static void _help(void)
 "      --comment=name          arbitrary comment\n"
 "      --cpu-freq=min[-max[:gov]] requested cpu frequency (and governor)\n"
 "  -d, --dependency=type:jobid defer job until condition on jobid is satisfied\n"
+"      --deadline=time         remove the job if no ending possible before\n"
+"                              this deadline (start > (deadline - time[-min]))\n"
 "  -D, --chdir=path            change working directory\n"
 "      --get-user-env          used by Moab.  See srun man page.\n"
 "      --gid=group_id          group ID to run job as (user root only)\n"
 "      --gres=list             required generic resources\n"
+"      --gres-flags=opts       flags related to GRES management\n"
 "  -H, --hold                  submit job in held state\n"
 "  -I, --immediate[=secs]      exit if resources not available in \"secs\"\n"
 "      --jobid=id              specify jobid to use\n"
@@ -2030,6 +2070,7 @@ static void _help(void)
 "      --mail-type=type        notify on state change: BEGIN, END, FAIL or ALL\n"
 "      --mail-user=user        who to send email notification for job state\n"
 "                              changes\n"
+"      --mcs-label=mcs         mcs label if mcs plugin mcs/group is used\n"
 "  -n, --tasks=N               number of processors required\n"
 "      --nice[=value]          decrease scheduling priority by value\n"
 "      --no-bell               do NOT ring the terminal bell\n"
@@ -2045,9 +2086,7 @@ static void _help(void)
 "      --qos=qos               quality of service\n"
 "  -Q, --quiet                 quiet mode (suppress informational messages)\n"
 "      --reboot                reboot compute nodes before starting job\n"
-"  -s, --share                 share nodes with other jobs\n"
-"      --sicp                  If specified, signifies job is to receive\n"
-"                              job id from the incluster reserve range.\n"
+"  -s, --oversubscribe         oversubscribe resources with other jobs\n"
 "      --signal=[B:]num[@time] send signal when time limit within time seconds\n"
 "      --switches=max-switches{@max-time-to-wait}\n"
 "                              Optimum switches and max time to wait for optimum\n"
@@ -2074,6 +2113,9 @@ static void _help(void)
 "Consumable resources related options:\n"
 "      --exclusive[=user]      allocate nodes in exclusive mode when\n"
 "                              cpu consumable resource is enabled\n"
+"      --exclusive[=mcs]       allocate nodes in exclusive mode when\n"
+"                              cpu consumable resource is enabled\n"
+"                              and mcs plugin is enabled\n"
 "      --mem-per-cpu=MB        maximum amount of real memory per allocated\n"
 "                              cpu required by the job.\n"
 "                              --mem >= --mem-per-cpu if --mem is specified.\n"
@@ -2090,7 +2132,7 @@ static void _help(void)
 "      --ntasks-per-socket=n   number of tasks to invoke on each socket\n");
 	conf = slurm_conf_lock();
 	if (conf->task_plugin != NULL
-	    && strcasecmp(conf->task_plugin, "task/affinity") == 0) {
+	    && xstrcasecmp(conf->task_plugin, "task/affinity") == 0) {
 		printf(
 "      --hint=                 Bind tasks according to application hints\n"
 "                              (see \"--hint=help\" for options)\n"
diff --git a/src/salloc/opt.h b/src/salloc/opt.h
index 32378c84a..1f48ceb44 100644
--- a/src/salloc/opt.h
+++ b/src/salloc/opt.h
@@ -168,7 +168,9 @@ typedef struct salloc_options {
 	uint32_t cpu_freq_max;  /* Maximum cpu frequency  */
 	uint32_t cpu_freq_gov;  /* cpu frequency governor */
 	uint8_t power_flags;	/* Power management options	*/
-	uint8_t sicp_mode;	/* Inter-cluster job ID		*/
+	char *mcs_label;	/* mcs label if mcs plugin in use */
+	time_t deadline;	/* --deadline                   */
+	uint32_t job_flags;	/* --kill_invalid_dep, --gres-flags */
 } opt_t;
 
 extern opt_t opt;
diff --git a/src/salloc/salloc.c b/src/salloc/salloc.c
index 38d703718..ef3c4828e 100644
--- a/src/salloc/salloc.c
+++ b/src/salloc/salloc.c
@@ -218,14 +218,24 @@ int main(int argc, char *argv[])
 	}
 
 	if (opt.get_user_env_time >= 0) {
+		bool no_env_cache = false;
+		char *sched_params;
 		char *user = uid_to_string(opt.uid);
-		if (strcmp(user, "nobody") == 0) {
+
+		if (xstrcmp(user, "nobody") == 0) {
 			error("Invalid user id %u: %m", (uint32_t)opt.uid);
 			exit(error_exit);
 		}
+
+		sched_params = slurm_get_sched_params();
+		no_env_cache = (sched_params &&
+				strstr(sched_params, "no_env_cache"));
+		xfree(sched_params);
+
 		env = env_array_user_default(user,
 					     opt.get_user_env_time,
-					     opt.get_user_env_mode);
+					     opt.get_user_env_mode,
+					     no_env_cache);
 		xfree(user);
 		if (env == NULL)
 			exit(error_exit);    /* error already logged */
@@ -439,12 +449,12 @@ int main(int argc, char *argv[])
 
 	env_array_set_environment(env);
 	env_array_free(env);
-	pthread_mutex_lock(&allocation_state_lock);
+	slurm_mutex_lock(&allocation_state_lock);
 	if (allocation_state == REVOKED) {
 		error("Allocation was revoked for job %u before command could "
 		      "be run", alloc->job_id);
 		pthread_cond_broadcast(&allocation_state_cond);
-		pthread_mutex_unlock(&allocation_state_lock);
+		slurm_mutex_unlock(&allocation_state_lock);
 		if (slurm_complete_job(alloc->job_id, status) != 0) {
 			error("Unable to clean up allocation for job %u: %m",
 			      alloc->job_id);
@@ -453,7 +463,7 @@ int main(int argc, char *argv[])
  	}
 	allocation_state = GRANTED;
 	pthread_cond_broadcast(&allocation_state_cond);
-	pthread_mutex_unlock(&allocation_state_lock);
+	slurm_mutex_unlock(&allocation_state_lock);
 
 	/*  Ensure that salloc has initial terminal foreground control.  */
 	if (is_interactive) {
@@ -470,12 +480,12 @@ int main(int argc, char *argv[])
 
 		tcsetpgrp(STDIN_FILENO, pid);
 	}
-	pthread_mutex_lock(&allocation_state_lock);
+	slurm_mutex_lock(&allocation_state_lock);
 	if (suspend_flag)
 		pthread_cond_wait(&allocation_state_cond, &allocation_state_lock);
 	command_pid = _fork_command(command_argv);
 	pthread_cond_broadcast(&allocation_state_cond);
-	pthread_mutex_unlock(&allocation_state_lock);
+	slurm_mutex_unlock(&allocation_state_lock);
 
 	/*
 	 * Wait for command to exit, OR for waitpid to be interrupted by a
@@ -504,20 +514,20 @@ int main(int argc, char *argv[])
 	 * Relinquish the job allocation (if not already revoked).
 	 */
 relinquish:
-	pthread_mutex_lock(&allocation_state_lock);
+	slurm_mutex_lock(&allocation_state_lock);
 	if (allocation_state != REVOKED) {
-		pthread_mutex_unlock(&allocation_state_lock);
+		slurm_mutex_unlock(&allocation_state_lock);
 
 		info("Relinquishing job allocation %u", alloc->job_id);
 		if ((slurm_complete_job(alloc->job_id, status) != 0) &&
 		    (slurm_get_errno() != ESLURM_ALREADY_DONE))
 			error("Unable to clean up job allocation %u: %m",
 			      alloc->job_id);
-		pthread_mutex_lock(&allocation_state_lock);
+		slurm_mutex_lock(&allocation_state_lock);
 		allocation_state = REVOKED;
 	}
 	pthread_cond_broadcast(&allocation_state_cond);
-	pthread_mutex_unlock(&allocation_state_lock);
+	slurm_mutex_unlock(&allocation_state_lock);
 
 	slurm_free_resource_allocation_response_msg(alloc);
 	slurm_allocation_msg_thr_destroy(msg_thr);
@@ -684,6 +694,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 		desc->mail_user = xstrdup(opt.mail_user);
 	if (opt.begin)
 		desc->begin_time = opt.begin;
+	if (opt.deadline)
+		desc->deadline = opt.deadline;
 	if (opt.burst_buffer)
 		desc->burst_buffer = opt.burst_buffer;
 	if (opt.account)
@@ -765,6 +777,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 		desc->time_limit = opt.time_limit;
 	if (opt.time_min  != NO_VAL)
 		desc->time_min = opt.time_min;
+	if (opt.job_flags)
+		desc->bitflags = opt.job_flags;
 	desc->shared = opt.shared;
 	desc->job_id = opt.jobid;
 
@@ -781,8 +795,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 
 	if (opt.power_flags)
 		desc->power_flags = opt.power_flags;
-	if (opt.sicp_mode)
-		desc->sicp_mode = opt.sicp_mode;
+	if (opt.mcs_label)
+		desc->mcs_label = xstrdup(opt.mcs_label);
 
 	return 0;
 }
@@ -866,7 +880,7 @@ static void _job_complete_handler(srun_job_complete_msg_t *comp)
 	}
 
 	if (comp->step_id == NO_VAL) {
-		pthread_mutex_lock(&allocation_state_lock);
+		slurm_mutex_lock(&allocation_state_lock);
 		if (allocation_state != REVOKED) {
 			/* If the allocation_state is already REVOKED, then
 			 * no need to print this message.  We probably
@@ -883,7 +897,7 @@ static void _job_complete_handler(srun_job_complete_msg_t *comp)
 		}
 		allocation_state = REVOKED;
 		pthread_cond_broadcast(&allocation_state_cond);
-		pthread_mutex_unlock(&allocation_state_lock);
+		slurm_mutex_unlock(&allocation_state_lock);
 		/*
 		 * Clean up child process: only if the forked process has not
 		 * yet changed state (waitpid returning 0).
@@ -1121,7 +1135,7 @@ static int _wait_nodes_ready(resource_allocation_response_msg_t *alloc)
 
 	pending_job_id = alloc->job_id;
 
-	if (alloc->alias_list && !strcmp(alloc->alias_list, "TBD"))
+	if (alloc->alias_list && !xstrcmp(alloc->alias_list, "TBD"))
 		opt.wait_all_nodes = 1;	/* Wait for boot & addresses */
 	if (opt.wait_all_nodes == (uint16_t) NO_VAL)
 		opt.wait_all_nodes = DEFAULT_WAIT_ALL_NODES;
@@ -1156,7 +1170,7 @@ static int _wait_nodes_ready(resource_allocation_response_msg_t *alloc)
 		char *tmp_str;
 		if (i > 0)
      			info("Nodes %s are ready for job", alloc->node_list);
-		if (alloc->alias_list && !strcmp(alloc->alias_list, "TBD") &&
+		if (alloc->alias_list && !xstrcmp(alloc->alias_list, "TBD") &&
 		    (slurm_allocation_lookup_lite(pending_job_id, &resp)
 		     == SLURM_SUCCESS)) {
 			tmp_str = alloc->alias_list;
diff --git a/src/salloc/salloc.h b/src/salloc/salloc.h
index eaa88c8e6..938a90431 100644
--- a/src/salloc/salloc.h
+++ b/src/salloc/salloc.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  salloc.h - definitions for srun option processing
- *  $Id: opt.h 8700 2006-07-26 01:12:40Z morrone $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/sattach/Makefile.in b/src/sattach/Makefile.in
index cf6a2598e..942c5ed46 100644
--- a/src/sattach/Makefile.in
+++ b/src/sattach/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sattach$(EXEEXT)
 subdir = src/sattach
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sattach/attach.c b/src/sattach/attach.c
index 57539a147..5a6ec035c 100644
--- a/src/sattach/attach.c
+++ b/src/sattach/attach.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  attach.c - Definitions needed for parallel debugger
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/sattach/attach.h b/src/sattach/attach.h
index 012c99e2e..6183172a0 100644
--- a/src/sattach/attach.h
+++ b/src/sattach/attach.h
@@ -7,9 +7,6 @@
  *  http://www.etnus.com/
 \*****************************************************************************/
 
-/*  $Id$
- */
-
 /* This file contains support for bringing processes up stopped, so that
  * a debugger can attach to them     (done for TotalView)
  */
diff --git a/src/sattach/opt.c b/src/sattach/opt.c
index 94b6d8706..7b247b3ac 100644
--- a/src/sattach/opt.c
+++ b/src/sattach/opt.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  opt.c - options processing for sattach
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -192,7 +191,7 @@ static void _opt_default()
 	uid_t uid = getuid();
 
 	opt.user = uid_to_string(uid);
-	if (strcmp(opt.user, "nobody") == 0)
+	if (xstrcmp(opt.user, "nobody") == 0)
 		fatal("Invalid user id: %u", uid);
 
 	opt.uid = uid;
@@ -331,21 +330,21 @@ void set_options(const int argc, char **argv)
 			exit(0);
 			break;
 		case LONG_OPT_IN_FILTER:
-			if (strcmp(optarg, "-") != 0) {
+			if (xstrcmp(optarg, "-") != 0) {
 				opt.input_filter = (uint32_t)
 					_get_pos_int(optarg, "input-filter");
 			}
 			opt.input_filter_set = true;
 			break;
 		case LONG_OPT_OUT_FILTER:
-			if (strcmp(optarg, "-") != 0) {
+			if (xstrcmp(optarg, "-") != 0) {
 				opt.output_filter = (uint32_t)
 					_get_pos_int(optarg, "output-filter");
 			}
 			opt.output_filter_set = true;
 			break;
 		case LONG_OPT_ERR_FILTER:
-			if (strcmp(optarg, "-") != 0) {
+			if (xstrcmp(optarg, "-") != 0) {
 				opt.error_filter = (uint32_t)
 					_get_pos_int(optarg, "error-filter");
 			}
diff --git a/src/sattach/opt.h b/src/sattach/opt.h
index 12f66ad04..af1022a9b 100644
--- a/src/sattach/opt.h
+++ b/src/sattach/opt.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  opt.h - definitions for sattach option processing
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/sattach/sattach.c b/src/sattach/sattach.c
index 1570599d9..e0ea7e5fa 100644
--- a/src/sattach/sattach.c
+++ b/src/sattach/sattach.c
@@ -140,7 +140,7 @@ int sattach(int argc, char *argv[])
 		log_alter(logopt, 0, NULL);
 	}
 	launch_type = slurm_get_launch_type();
-	if (launch_type && strcmp(launch_type, "launch/slurm")) {
+	if (launch_type && xstrcmp(launch_type, "launch/slurm")) {
 		error("sattach does not support LaunchType=%s", launch_type);
 		exit(error_exit);
 	}
@@ -408,6 +408,7 @@ static int _attach_to_tasks(uint32_t jobid,
 
 	msg.msg_type = REQUEST_REATTACH_TASKS;
 	msg.data = &reattach_msg;
+	msg.protocol_version = layout->start_protocol_ver;
 
 	if (layout->front_end)
 		hosts = layout->front_end;
@@ -456,7 +457,7 @@ static message_thread_state_t *_msg_thr_create(int num_nodes, int num_tasks)
 
 	debug("Entering _msg_thr_create()");
 	mts = (message_thread_state_t *)xmalloc(sizeof(message_thread_state_t));
-	pthread_mutex_init(&mts->lock, NULL);
+	slurm_mutex_init(&mts->lock);
 	pthread_cond_init(&mts->cond, NULL);
 	mts->tasks_started = bit_alloc(num_tasks);
 	mts->tasks_exited = bit_alloc(num_tasks);
@@ -494,12 +495,12 @@ fail:
 static void _msg_thr_wait(message_thread_state_t *mts)
 {
 	/* Wait for all known running tasks to complete */
-	pthread_mutex_lock(&mts->lock);
+	slurm_mutex_lock(&mts->lock);
 	while (bit_set_count(mts->tasks_exited)
 	       < bit_set_count(mts->tasks_started)) {
 		pthread_cond_wait(&mts->cond, &mts->lock);
 	}
-	pthread_mutex_unlock(&mts->lock);
+	slurm_mutex_unlock(&mts->lock);
 }
 
 static void _msg_thr_destroy(message_thread_state_t *mts)
@@ -519,14 +520,14 @@ _launch_handler(message_thread_state_t *mts, slurm_msg_t *resp)
 	launch_tasks_response_msg_t *msg = resp->data;
 	int i;
 
-	pthread_mutex_lock(&mts->lock);
+	slurm_mutex_lock(&mts->lock);
 
 	for (i = 0; i < msg->count_of_pids; i++) {
 		bit_set(mts->tasks_started, msg->task_ids[i]);
 	}
 
 	pthread_cond_signal(&mts->cond);
-	pthread_mutex_unlock(&mts->lock);
+	slurm_mutex_unlock(&mts->lock);
 
 }
 
@@ -543,7 +544,7 @@ _exit_handler(message_thread_state_t *mts, slurm_msg_t *exit_msg)
 		return;
 	}
 
-	pthread_mutex_lock(&mts->lock);
+	slurm_mutex_lock(&mts->lock);
 
 	for (i = 0; i < msg->num_tasks; i++) {
 		debug("task %d done", msg->task_id_list[i]);
@@ -570,7 +571,7 @@ _exit_handler(message_thread_state_t *mts, slurm_msg_t *exit_msg)
 	}
 
 	pthread_cond_signal(&mts->cond);
-	pthread_mutex_unlock(&mts->lock);
+	slurm_mutex_unlock(&mts->lock);
 }
 
 static void
@@ -598,17 +599,14 @@ _handle_msg(void *arg, slurm_msg_t *msg)
 	case RESPONSE_LAUNCH_TASKS:
 		debug2("received task launch");
 		_launch_handler(mts, msg);
-		slurm_free_launch_tasks_response_msg(msg->data);
 		break;
 	case MESSAGE_TASK_EXIT:
 		debug2("received task exit");
 		_exit_handler(mts, msg);
-		slurm_free_task_exit_msg(msg->data);
 		break;
 	case SRUN_JOB_COMPLETE:
 		debug2("received job step complete message");
 		/* FIXME - does nothing yet */
-		slurm_free_srun_job_complete_msg(msg->data);
 		break;
 	default:
 		error("received spurious message type: %d",
diff --git a/src/sbatch/Makefile.in b/src/sbatch/Makefile.in
index b1be652f7..b8ad223a5 100644
--- a/src/sbatch/Makefile.in
+++ b/src/sbatch/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sbatch$(EXEEXT)
 subdir = src/sbatch
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -225,8 +226,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -326,6 +325,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -364,6 +367,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -407,6 +413,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -457,6 +466,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c
index 663dfef3c..358357c29 100644
--- a/src/sbatch/opt.c
+++ b/src/sbatch/opt.c
@@ -93,6 +93,13 @@
 
 #include "src/sbatch/opt.h"
 
+enum wrappers {
+	WRPR_START,
+	WRPR_BSUB,
+	WRPR_PBS,
+	WRPR_CNT
+};
+
 /* generic OPT_ definitions -- mainly for use with env vars  */
 #define OPT_NONE        0x00
 #define OPT_INT         0x01
@@ -118,11 +125,10 @@
 #define OPT_SIGNAL      0x15
 #define OPT_GET_USER_ENV  0x16
 #define OPT_EXPORT        0x17
-/* #define OPT_CLUSTERS      0x18 */
+#define OPT_GRES_FLAGS    0x18
 #define OPT_TIME_VAL      0x19
 #define OPT_CORE_SPEC     0x1a
 #define OPT_CPU_FREQ      0x1b
-#define OPT_SICP          0x1c
 #define OPT_POWER         0x1d
 #define OPT_ARRAY_INX     0x20
 #define OPT_PROFILE       0x21
@@ -130,9 +136,9 @@
 
 /* generic getopt_long flags, integers and *not* valid characters */
 #define LONG_OPT_PROPAGATE   0x100
-#define LONG_OPT_SICP        0x101
 #define LONG_OPT_MEM_BIND    0x102
 #define LONG_OPT_POWER       0x103
+#define LONG_OPT_WAIT        0x104
 #define LONG_OPT_JOBID       0x105
 #define LONG_OPT_TMP         0x106
 #define LONG_OPT_MEM         0x107
@@ -190,8 +196,11 @@
 #define LONG_OPT_PARSABLE        0x157
 #define LONG_OPT_CPU_FREQ        0x158
 #define LONG_OPT_THREAD_SPEC     0x159
+#define LONG_OPT_GRES_FLAGS      0x15a
 #define LONG_OPT_PRIORITY        0x160
 #define LONG_OPT_KILL_INV_DEP    0x161
+#define LONG_OPT_MCS_LABEL       0x165
+#define LONG_OPT_DEADLINE        0x166
 
 /*---- global variables, defined in opt.h ----*/
 opt_t opt;
@@ -211,8 +220,12 @@ static void _opt_default(void);
 static void _opt_batch_script(const char *file, const void *body, int size);
 
 /* set options from pbs batch script */
-static void _opt_pbs_batch_script(const char *file, const void *body, int size,
-				  int argc, char **argv);
+static bool _opt_wrpr_batch_script(const char *file, const void *body, int size,
+				  int argc, char **argv, int magic);
+
+/* Wrapper functions */
+static void _set_pbs_options(int argc, char **argv);
+static void _set_bsub_options(int argc, char **argv);
 
 /* set options based upon env vars  */
 static void _opt_env(void);
@@ -229,9 +242,8 @@ static void _process_env_var(env_vars_t *e, const char *val);
 static uint16_t _parse_pbs_mail_type(const char *arg);
 
 static void  _usage(void);
-static  void _fullpath(char **filename, const char *cwd);
+static void _fullpath(char **filename, const char *cwd);
 static void _set_options(int argc, char **argv);
-static void _set_pbs_options(int argc, char **argv);
 static void _parse_pbs_resource_list(char *rl);
 
 /*---[ end forward declarations of static functions ]---------------------*/
@@ -294,7 +306,7 @@ static void _opt_default()
 	uid_t uid = getuid();
 
 	opt.user = uid_to_string(uid);
-	if (strcmp(opt.user, "nobody") == 0)
+	if (xstrcmp(opt.user, "nobody") == 0)
 		fatal("Invalid user id: %u", uid);
 
 	opt.script_argc = 0;
@@ -334,7 +346,6 @@ static void _opt_default()
 	opt.time_limit = NO_VAL;
 	opt.time_min = NO_VAL;
 	opt.partition = NULL;
-	opt.sicp_mode = 0;
 	opt.power_flags = 0;
 
 	opt.job_name = NULL;
@@ -401,6 +412,7 @@ static void _opt_default()
 	opt.reservation       = NULL;
 	opt.req_switch        = -1;
 	opt.umask             = -1;
+	opt.wait              = false;
 	opt.wait4switch       = -1;
 	opt.wckey             = NULL;
 
@@ -412,7 +424,9 @@ static void _opt_default()
 	opt.priority = 0;
 
 	opt.test_only   = false;
-	opt.kill_invalid_dep = 0;
+	opt.job_flags = 0;
+
+	opt.mcs_label		= NULL;
 }
 
 /*---[ env var processing ]-----------------------------------------------*/
@@ -451,7 +465,10 @@ env_vars_t env_vars[] = {
   {"SBATCH_DEBUG",         OPT_DEBUG,      NULL,               NULL          },
   {"SBATCH_DISTRIBUTION",  OPT_DISTRIB ,   NULL,               NULL          },
   {"SBATCH_EXCLUSIVE",     OPT_EXCLUSIVE,  NULL,               NULL          },
+  {"SBATCH_EXPORT",        OPT_STRING,     &opt.export_env,    NULL          },
   {"SBATCH_GEOMETRY",      OPT_GEOMETRY,   NULL,               NULL          },
+  {"SBATCH_GET_USER_ENV",  OPT_GET_USER_ENV, NULL,             NULL          },
+  {"SBATCH_GRES_FLAGS",    OPT_GRES_FLAGS, NULL,               NULL          },
   {"SBATCH_HINT",          OPT_HINT,       NULL,               NULL          },
   {"SLURM_HINT",           OPT_HINT,       NULL,               NULL          },
   {"SBATCH_IMMEDIATE",     OPT_BOOL,       &opt.immediate,     NULL          },
@@ -471,18 +488,16 @@ env_vars_t env_vars[] = {
   {"SBATCH_PROFILE",       OPT_PROFILE,    NULL,               NULL          },
   {"SBATCH_QOS",           OPT_STRING,     &opt.qos,           NULL          },
   {"SBATCH_RAMDISK_IMAGE", OPT_STRING,     &opt.ramdiskimage,  NULL          },
+  {"SBATCH_REQ_SWITCH",    OPT_INT,        &opt.req_switch,    NULL          },
   {"SBATCH_REQUEUE",       OPT_REQUEUE,    NULL,               NULL          },
   {"SBATCH_RESERVATION",   OPT_STRING,     &opt.reservation,   NULL          },
-  {"SBATCH_SICP",          OPT_SICP,       NULL,               NULL          },
   {"SBATCH_SIGNAL",        OPT_SIGNAL,     NULL,               NULL          },
   {"SBATCH_THREAD_SPEC",   OPT_THREAD_SPEC,NULL,               NULL          },
   {"SBATCH_TIMELIMIT",     OPT_STRING,     &opt.time_limit_str,NULL          },
+  {"SBATCH_WAIT",          OPT_BOOL,       &opt.wait,          NULL          },
   {"SBATCH_WAIT_ALL_NODES",OPT_INT,        &opt.wait_all_nodes,NULL          },
-  {"SBATCH_WCKEY",         OPT_STRING,     &opt.wckey,         NULL          },
-  {"SBATCH_GET_USER_ENV",  OPT_GET_USER_ENV, NULL,             NULL          },
-  {"SBATCH_EXPORT",        OPT_STRING,     &opt.export_env,    NULL          },
-  {"SBATCH_REQ_SWITCH",    OPT_INT,        &opt.req_switch,    NULL          },
   {"SBATCH_WAIT4SWITCH",   OPT_TIME_VAL,   NULL,               NULL          },
+  {"SBATCH_WCKEY",         OPT_STRING,     &opt.wckey,         NULL          },
 
   {NULL, 0, NULL, NULL}
 };
@@ -538,7 +553,7 @@ _process_env_var(env_vars_t *e, const char *val)
 		 */
 		if (val[0] == '\0') {
 			*((bool *)e->arg) = true;
-		} else if (strcasecmp(val, "yes") == 0) {
+		} else if (xstrcasecmp(val, "yes") == 0) {
 			*((bool *)e->arg) = true;
 		} else if ((strtol(val, &end, 10) != 0)
 			   && end != val) {
@@ -551,6 +566,7 @@ _process_env_var(env_vars_t *e, const char *val)
 	case OPT_ARRAY_INX:
 		xfree(opt.array_inx);
 		opt.array_inx = xstrdup(val);
+		break;
 
 	case OPT_DEBUG:
 		if (val[0] != '\0') {
@@ -610,11 +626,23 @@ _process_env_var(env_vars_t *e, const char *val)
 		}
 		break;
 
+	case OPT_GRES_FLAGS:
+		if (!xstrcasecmp(val, "enforce-binding")) {
+			opt.job_flags |= GRES_ENFORCE_BIND;
+		} else {
+			error("Invalid SBATCH_GRES_FLAGS specification: %s",
+			      val);
+			exit(error_exit);
+		}
+		break;
+
 	case OPT_EXCLUSIVE:
 		if (val[0] == '\0') {
-			opt.shared = 0;
-		} else if (!strcasecmp(val, "user")) {
-			opt.shared = 2;
+			opt.shared = JOB_SHARED_NONE;
+		} else if (!xstrcasecmp(val, "user")) {
+			opt.shared = JOB_SHARED_USER;
+		} else if (!xstrcasecmp(val, "mcs")) {
+			opt.shared = JOB_SHARED_MCS;
 		} else {
 			error("\"%s=%s\" -- invalid value, ignoring...",
 			      e->var, val);
@@ -672,9 +700,6 @@ _process_env_var(env_vars_t *e, const char *val)
 	case OPT_POWER:
 		opt.power_flags = power_flags_id((char *)val);
 		break;
-	case OPT_SICP:
-		opt.sicp_mode = 1;
-		break;
 	case OPT_THREAD_SPEC:
 		opt.core_spec = parse_int("thread_spec", val, false) |
 					 CORE_SPEC_THREAD;
@@ -719,6 +744,7 @@ static struct option long_options[] = {
 	{"nodes",         required_argument, 0, 'N'},
 	{"output",        required_argument, 0, 'o'},
 	{"overcommit",    no_argument,       0, 'O'},
+	{"oversubscribe", no_argument,       0, 's'},
 	{"partition",     required_argument, 0, 'p'},
 	{"quiet",         no_argument,       0, 'Q'},
 	{"no-rotate",     no_argument,       0, 'R'},
@@ -742,11 +768,13 @@ static struct option long_options[] = {
 	{"contiguous",    no_argument,       0, LONG_OPT_CONT},
 	{"cores-per-socket", required_argument, 0, LONG_OPT_CORESPERSOCKET},
 	{"cpu-freq",         required_argument, 0, LONG_OPT_CPU_FREQ},
+	{"deadline",      required_argument, 0, LONG_OPT_DEADLINE},
 	{"exclusive",     optional_argument, 0, LONG_OPT_EXCLUSIVE},
 	{"export",        required_argument, 0, LONG_OPT_EXPORT},
 	{"export-file",   required_argument, 0, LONG_OPT_EXPORT_FILE},
 	{"get-user-env",  optional_argument, 0, LONG_OPT_GET_USER_ENV},
 	{"gres",          required_argument, 0, LONG_OPT_GRES},
+	{"gres-flags",    required_argument, 0, LONG_OPT_GRES_FLAGS},
 	{"gid",           required_argument, 0, LONG_OPT_GID},
 	{"hint",          required_argument, 0, LONG_OPT_HINT},
 	{"ignore-pbs",    no_argument,       0, LONG_OPT_IGNORE_PBS},
@@ -755,6 +783,7 @@ static struct option long_options[] = {
 	{"linux-image",   required_argument, 0, LONG_OPT_LINUX_IMAGE},
 	{"mail-type",     required_argument, 0, LONG_OPT_MAIL_TYPE},
 	{"mail-user",     required_argument, 0, LONG_OPT_MAIL_USER},
+	{"mcs-label",     required_argument, 0, LONG_OPT_MCS_LABEL},
 	{"mem",           required_argument, 0, LONG_OPT_MEM},
 	{"mem-per-cpu",   required_argument, 0, LONG_OPT_MEM_PER_CPU},
 	{"mem_bind",      required_argument, 0, LONG_OPT_MEM_BIND},
@@ -780,7 +809,6 @@ static struct option long_options[] = {
 	{"reboot",        no_argument,       0, LONG_OPT_REBOOT},
 	{"requeue",       no_argument,       0, LONG_OPT_REQUEUE},
 	{"reservation",   required_argument, 0, LONG_OPT_RESERVATION},
-	{"sicp",          optional_argument, 0, LONG_OPT_SICP},
 	{"signal",        required_argument, 0, LONG_OPT_SIGNAL},
 	{"sockets-per-node", required_argument, 0, LONG_OPT_SOCKETSPERNODE},
 	{"switches",      required_argument, 0, LONG_OPT_REQ_SWITCH},
@@ -791,6 +819,7 @@ static struct option long_options[] = {
 	{"threads-per-core", required_argument, 0, LONG_OPT_THREADSPERCORE},
 	{"tmp",           required_argument, 0, LONG_OPT_TMP},
 	{"uid",           required_argument, 0, LONG_OPT_UID},
+	{"wait",          no_argument,       0, LONG_OPT_WAIT},
 	{"wait-all-nodes",required_argument, 0, LONG_OPT_WAIT_ALL_NODES},
 	{"wckey",         required_argument, 0, LONG_OPT_WCKEY},
 	{"wrap",          required_argument, 0, LONG_OPT_WRAP},
@@ -798,7 +827,7 @@ static struct option long_options[] = {
 };
 
 static char *opt_string =
-	"+ba:A:B:c:C:d:D:e:F:g:hHi:IJ:kL:m:M:n:N:o:Op:P:QRsS:t:uU:vVw:x:";
+	"+ba:A:B:c:C:d:D:e:F:g:hHi:IJ:kL:m:M:n:N:o:Op:P:QRsS:t:uU:vVw:Wx:";
 char *pos_delimit;
 
 
@@ -914,11 +943,21 @@ char *process_options_first_pass(int argc, char **argv)
 int process_options_second_pass(int argc, char *argv[], const char *file,
 				const void *script_body, int script_size)
 {
+	int i;
+
 	/* set options from batch script */
 	_opt_batch_script(file, script_body, script_size);
 
-	/* set options from pbs batch script */
-	_opt_pbs_batch_script(file, script_body, script_size, argc, argv);
+	for (i = WRPR_START + 1; i < WRPR_CNT; i++) {
+		/* Convert command from batch script to sbatch command */
+		bool stop = _opt_wrpr_batch_script(file, script_body,
+						   script_size, argc, argv, i);
+
+		if (stop) {
+			break;
+		}
+
+	}
 
 	/* set options from env vars */
 	_opt_env();
@@ -1075,9 +1114,9 @@ static void _opt_batch_script(const char * file, const void *body, int size)
 
 	while ((line = _next_line(body, size, &state)) != NULL) {
 		lineno++;
-		if (!strncmp(line, magic_word1, magic_word_len1))
+		if (!xstrncmp(line, magic_word1, magic_word_len1))
 			ptr = line + magic_word_len1;
-		else if (!strncmp(line, magic_word2, magic_word_len2)) {
+		else if (!xstrncmp(line, magic_word2, magic_word_len2)) {
 			ptr = line + magic_word_len2;
 			if (!warned) {
 				error("Change from #SLURM to #SBATCH in your "
@@ -1122,15 +1161,17 @@ static void _opt_batch_script(const char * file, const void *body, int size)
 }
 
 /*
- * set pbs options from batch script
+ * set wrapper (ie. pbs, bsub) options from batch script
  *
  * Build an argv-style array of options from the script "body",
  * then pass the array to _set_options for() further parsing.
  */
-static void _opt_pbs_batch_script(const char *file, const void *body, int size,
-				  int cmd_argc, char **cmd_argv)
+static bool _opt_wrpr_batch_script(const char *file, const void *body,
+				     int size, int cmd_argc, char **cmd_argv,
+				     int magic)
 {
-	char *magic_word = "#PBS";
+	char *magic_word;
+	void (*wrp_func) (int,char**) = NULL;
 	int magic_word_len;
 	int argc;
 	char **argv;
@@ -1142,14 +1183,30 @@ static void _opt_pbs_batch_script(const char *file, const void *body, int size,
 	int lineno = 0;
 	int non_comments = 0;
 	int i;
+	bool found = false;
 
 	if (ignore_pbs)
-		return;
+		return false;
 	if (getenv("SBATCH_IGNORE_PBS"))
-		return;
+		return false;
 	for (i = 0; i < cmd_argc; i++) {
-		if (!strcmp(cmd_argv[i], "--ignore-pbs"))
-			return;
+		if (!xstrcmp(cmd_argv[i], "--ignore-pbs"))
+			return false;
+	}
+
+	/* Check what command it is */
+	switch (magic) {
+	case WRPR_BSUB:
+		magic_word = "#BSUB";
+		wrp_func = _set_bsub_options;
+		break;
+	case WRPR_PBS:
+		magic_word = "#PBS";
+		wrp_func = _set_pbs_options;
+		break;
+
+	default:
+		return false;
 	}
 
 	magic_word_len = strlen(magic_word);
@@ -1160,7 +1217,7 @@ static void _opt_pbs_batch_script(const char *file, const void *body, int size,
 
 	while ((line = _next_line(body, size, &state)) != NULL) {
 		lineno++;
-		if (strncmp(line, magic_word, magic_word_len) != 0) {
+		if (xstrncmp(line, magic_word, magic_word_len) != 0) {
 			if (line[0] != '#')
 				non_comments++;
 			xfree(line);
@@ -1169,24 +1226,42 @@ static void _opt_pbs_batch_script(const char *file, const void *body, int size,
 			continue;
 		}
 
+		/* Set found to be true since we found a valid command */
+		found = true;
 		/* this line starts with the magic word */
 		ptr = line + magic_word_len;
 		while ((option = _get_argument(file, lineno, ptr, &skipped))) {
 			debug2("Found in script, argument \"%s\"", option);
 			argc += 1;
 			xrealloc(argv, sizeof(char*) * argc);
+
+			/* Only check the even options here (they are
+			 * the - options) */
+			if (magic == WRPR_BSUB && !(argc%2)) {
+				/* Since Slurm doesn't allow long
+				 * names with a single '-' we must
+				 * translate before hand.
+				 */
+				if (!xstrcmp("-cwd", option)) {
+					xfree(option);
+					option = xstrdup("-c");
+				}
+			}
+
 			argv[argc-1] = option;
 			ptr += skipped;
 		}
 		xfree(line);
 	}
 
-	if (argc > 0)
-		_set_pbs_options(argc, argv);
+	if (argc > 0 && wrp_func != NULL)
+		wrp_func(argc, argv);
 
 	for (i = 1; i < argc; i++)
 		xfree(argv[i]);
 	xfree(argv);
+
+	return found;
 }
 
 static void _set_options(int argc, char **argv)
@@ -1257,7 +1332,7 @@ static void _set_options(int argc, char **argv)
 			break;
 		case 'e':
 			xfree(opt.efname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.efname = xstrdup("/dev/null");
 			else
 				opt.efname = xstrdup(optarg);
@@ -1286,7 +1361,7 @@ static void _set_options(int argc, char **argv)
 			break;
 		case 'i':
 			xfree(opt.ifname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.ifname = xstrdup("/dev/null");
 			else
 				opt.ifname = xstrdup(optarg);
@@ -1336,7 +1411,7 @@ static void _set_options(int argc, char **argv)
 			break;
 		case 'o':
 			xfree(opt.ofname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.ofname = xstrdup("/dev/null");
 			else
 				opt.ofname = xstrdup(optarg);
@@ -1387,11 +1462,21 @@ static void _set_options(int argc, char **argv)
 		case LONG_OPT_CONT:
 			opt.contiguous = true;
 			break;
+		case LONG_OPT_DEADLINE:
+			opt.deadline = parse_time(optarg, 0);
+			if (errno == ESLURM_INVALID_TIME_VALUE) {
+				error("Invalid deadline specification %s",
+				       optarg);
+				exit(error_exit);
+			}
+			break;
 		case LONG_OPT_EXCLUSIVE:
 			if (optarg == NULL) {
-				opt.shared = 0;
-			} else if (!strcasecmp(optarg, "user")) {
-				opt.shared = 2;
+				opt.shared = JOB_SHARED_NONE;
+			} else if (!xstrcasecmp(optarg, "user")) {
+				opt.shared = JOB_SHARED_USER;
+			} else if (!xstrcasecmp(optarg, "mcs")) {
+				opt.shared = JOB_SHARED_MCS;
 			} else {
 				error("invalid exclusive option %s", optarg);
 				exit(error_exit);
@@ -1501,7 +1586,7 @@ static void _set_options(int argc, char **argv)
 			break;
 		case LONG_OPT_MAIL_TYPE:
 			opt.mail_type |= parse_mail_type(optarg);
-			if (opt.mail_type == 0) {
+			if (opt.mail_type == (uint16_t)INFINITE) {
 				error("--mail-type=%s invalid", optarg);
 				exit(error_exit);
 			}
@@ -1510,6 +1595,11 @@ static void _set_options(int argc, char **argv)
 			xfree(opt.mail_user);
 			opt.mail_user = xstrdup(optarg);
 			break;
+		case LONG_OPT_MCS_LABEL: {
+			xfree(opt.mcs_label);
+			opt.mcs_label = xstrdup(optarg);
+			break;
+		}
 		case LONG_OPT_BURST_BUFFER:
 			xfree(opt.burst_buffer);
 			opt.burst_buffer = xstrdup(optarg);
@@ -1519,11 +1609,6 @@ static void _set_options(int argc, char **argv)
 				opt.nice = strtol(optarg, NULL, 10);
 			else
 				opt.nice = 100;
-			if (abs(opt.nice) > NICE_OFFSET) {
-				error("Invalid nice value, must be between "
-				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
-				exit(error_exit);
-			}
 			if (opt.nice < 0) {
 				uid_t my_uid = getuid();
 				if ((my_uid != 0) &&
@@ -1681,6 +1766,9 @@ static void _set_options(int argc, char **argv)
 			xfree(opt.network);
 			opt.network = xstrdup(optarg);
 			break;
+		case LONG_OPT_WAIT:
+			opt.wait = true;
+			break;
 		case LONG_OPT_WCKEY:
 			xfree(opt.wckey);
 			opt.wckey = xstrdup(optarg);
@@ -1710,21 +1798,30 @@ static void _set_options(int argc, char **argv)
 			opt.time_min_str = xstrdup(optarg);
 			break;
 		case LONG_OPT_GRES:
-			if (!strcasecmp(optarg, "help") ||
-			    !strcasecmp(optarg, "list")) {
+			if (!xstrcasecmp(optarg, "help") ||
+			    !xstrcasecmp(optarg, "list")) {
 				print_gres_help();
 				exit(0);
 			}
 			xfree(opt.gres);
 			opt.gres = xstrdup(optarg);
 			break;
+		case LONG_OPT_GRES_FLAGS:
+			if (!xstrcasecmp(optarg, "enforce-binding")) {
+				opt.job_flags |= GRES_ENFORCE_BIND;
+			} else {
+				error("Invalid gres-flags specification: %s",
+				      optarg);
+				exit(error_exit);
+			}
+			break;
 		case LONG_OPT_WAIT_ALL_NODES:
 			opt.wait_all_nodes = strtol(optarg, NULL, 10);
 			break;
 		case LONG_OPT_EXPORT:
 			xfree(opt.export_env);
 			opt.export_env = xstrdup(optarg);
-			if (!strcasecmp(opt.export_env, "ALL"))
+			if (!xstrcasecmp(opt.export_env, "ALL"))
 				; /* srun ignores "ALL", it is the default */
 			else
 				setenv("SLURM_EXPORT_ENV", opt.export_env, 0);
@@ -1734,7 +1831,7 @@ static void _set_options(int argc, char **argv)
 			opt.export_file = xstrdup(optarg);
 			break;
 		case LONG_OPT_CPU_FREQ:
-		        if (cpu_freq_verify_cmdline(optarg, &opt.cpu_freq_min,
+			if (cpu_freq_verify_cmdline(optarg, &opt.cpu_freq_min,
 					&opt.cpu_freq_max, &opt.cpu_freq_gov))
 				error("Invalid --cpu-freq argument: %s. "
 						"Ignored", optarg);
@@ -1760,19 +1857,16 @@ static void _set_options(int argc, char **argv)
 		case LONG_OPT_POWER:
 			opt.power_flags = power_flags_id(optarg);
 			break;
-		case LONG_OPT_SICP:
-			opt.sicp_mode = 1;
-			break;
 		case LONG_OPT_THREAD_SPEC:
 			opt.core_spec = parse_int("thread_spec",
 						  optarg, false) |
 					CORE_SPEC_THREAD;
 			break;
 		case LONG_OPT_KILL_INV_DEP:
-			if (strcasecmp(optarg, "yes") == 0)
-				opt.kill_invalid_dep |= KILL_INV_DEP;
-			if (strcasecmp(optarg, "no") == 0)
-				opt.kill_invalid_dep |= NO_KILL_INV_DEP;
+			if (xstrcasecmp(optarg, "yes") == 0)
+				opt.job_flags |= KILL_INV_DEP;
+			if (xstrcasecmp(optarg, "no") == 0)
+				opt.job_flags |= NO_KILL_INV_DEP;
 			break;
 		default:
 			if (spank_process_option (opt_char, optarg) < 0) {
@@ -1809,6 +1903,116 @@ static void _proc_get_user_env(char *optarg)
 	else if ((end_ptr[0] == 'l') || (end_ptr[0] == 'L'))
 		opt.get_user_env_mode = 2;
 }
+static void _set_bsub_options(int argc, char **argv) {
+
+	int opt_char, option_index = 0;
+	char *bsub_opt_string = "+c:e:J:m:M:n:o:q:W:x";
+	char *tmp_str, *char_ptr;
+
+	struct option bsub_long_options[] = {
+		{"cwd", required_argument, 0, 'c'},
+		{"error_file", required_argument, 0, 'e'},
+		{"job_name", required_argument, 0, 'J'},
+		{"hostname", required_argument, 0, 'm'},
+		{"memory_limit", required_argument, 0, 'M'},
+		{"memory_limit", required_argument, 0, 'M'},
+		{"output_file", required_argument, 0, 'o'},
+		{"queue_name", required_argument, 0, 'q'},
+		{"time", required_argument, 0, 'W'},
+		{"exclusive", no_argument, 0, 'x'},
+		{NULL, 0, 0, 0}
+	};
+
+	optind = 0;
+	while ((opt_char = getopt_long(argc, argv, bsub_opt_string,
+				       bsub_long_options, &option_index))
+	       != -1) {
+		switch (opt_char) {
+		case 'c':
+			xfree(opt.cwd);
+			if (is_full_path(optarg))
+				opt.cwd = xstrdup(optarg);
+			else
+				opt.cwd = make_full_path(optarg);
+			break;
+		case 'e':
+			xfree(opt.efname);
+			if (xstrcasecmp(optarg, "none") == 0)
+				opt.efname = xstrdup("/dev/null");
+			else
+				opt.efname = xstrdup(optarg);
+			break;
+		case 'J':
+			opt.job_name = xstrdup(optarg);
+			break;
+		case 'm':
+			/* Since BSUB requires a list of space
+			   sperated host we need to replace the spaces
+			   with , */
+			tmp_str = xstrdup(optarg);
+			char_ptr = strstr(tmp_str, " ");
+
+			while (char_ptr != NULL) {
+				*char_ptr = ',';
+				char_ptr = strstr(tmp_str, " ");
+			}
+			opt.nodelist = xstrdup(tmp_str);
+			xfree(tmp_str);
+			break;
+		case 'M':
+			opt.mem_per_cpu = xstrntol(optarg,
+						   NULL, strlen(optarg), 10);
+			break;
+		case 'n':
+			opt.ntasks_set = true;
+			/* Since it is value in bsub to give a min and
+			 * max task count we will only read the max if
+			 * it exists.
+			 */
+			char_ptr = strstr(optarg, ",");
+			if (char_ptr) {
+				char_ptr++;
+				if (!char_ptr[0]) {
+					error("#BSUB -n format not correct "
+					      "given: '%s'",
+					      optarg);
+					exit(error_exit);
+				}
+			} else
+				char_ptr = optarg;
+
+			opt.ntasks =
+				parse_int("number of tasks", char_ptr, true);
+
+			break;
+		case 'o':
+			xfree(opt.ofname);
+			opt.ofname = xstrdup(optarg);
+			break;
+		case 'q':
+			opt.partition = xstrdup(optarg);
+			break;
+		case 'W':
+			opt.time_limit = xstrntol(optarg, NULL,
+						  strlen(optarg), 10);
+			break;
+		case 'x':
+			opt.shared = 0;
+			break;
+		default:
+			error("Unrecognized command line parameter %c",
+			      opt_char);
+			exit(error_exit);
+		}
+	}
+
+
+	if (optind < argc) {
+		error("Invalid argument: %s", argv[optind]);
+		exit(error_exit);
+	}
+
+}
 
 static void _set_pbs_options(int argc, char **argv)
 {
@@ -1863,7 +2067,7 @@ static void _set_pbs_options(int argc, char **argv)
 			break;
 		case 'e':
 			xfree(opt.efname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.efname = xstrdup("/dev/null");
 			else
 				opt.efname = xstrdup(optarg);
@@ -1888,7 +2092,7 @@ static void _set_pbs_options(int argc, char **argv)
 			break;
 		case 'm':
 			opt.mail_type |= _parse_pbs_mail_type(optarg);
-			if ((opt.mail_type == 0) && strcasecmp(optarg, "n")) {
+			if (opt.mail_type == (uint16_t)INFINITE) {
 				error("-m=%s invalid", optarg);
 				exit(error_exit);
 			}
@@ -1903,7 +2107,7 @@ static void _set_pbs_options(int argc, char **argv)
 			break;
 		case 'o':
 			xfree(opt.ofname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.ofname = xstrdup("/dev/null");
 			else
 				opt.ofname = xstrdup(optarg);
@@ -1913,11 +2117,6 @@ static void _set_pbs_options(int argc, char **argv)
 				opt.nice = strtol(optarg, NULL, 10);
 			else
 				opt.nice = 100;
-			if (abs(opt.nice) > NICE_OFFSET) {
-				error("Invalid nice value, must be between "
-				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
-				exit(error_exit);
-			}
 			if (opt.nice < 0) {
 				uid_t my_uid = getuid();
 				if ((my_uid != 0) &&
@@ -2013,7 +2212,7 @@ static void _parse_pbs_nodes_opts(char *node_opts)
 	hostlist_t hl = hostlist_create(NULL);
 
 	while (node_opts[i]) {
-		if (!strncmp(node_opts+i, "ppn=", 4)) {
+		if (!xstrncmp(node_opts+i, "ppn=", 4)) {
 			i+=4;
 			ppn += strtol(node_opts+i, NULL, 10);
 			_get_next_pbs_node_part(node_opts, &i);
@@ -2093,10 +2292,10 @@ static void _parse_pbs_resource_list(char *rl)
 			if (!strncasecmp(rl+i, "true", 4) && (gpus < 1))
 				gpus = 1;
 			/* Also see "naccelerators=" below */
-		} else if (!strncmp(rl+i, "arch=", 5)) {
+		} else if (!xstrncmp(rl+i, "arch=", 5)) {
 			i+=5;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "cput=", 5)) {
+		} else if (!xstrncmp(rl+i, "cput=", 5)) {
 			i+=5;
 			temp = _get_pbs_option_value(rl, &i, ',');
 			if (!temp) {
@@ -2106,7 +2305,7 @@ static void _parse_pbs_resource_list(char *rl)
 			xfree(opt.time_limit_str);
 			opt.time_limit_str = xstrdup(temp);
 			xfree(temp);
-		} else if (!strncmp(rl+i, "file=", 5)) {
+		} else if (!xstrncmp(rl+i, "file=", 5)) {
 			int end = 0;
 
 			i+=5;
@@ -2129,10 +2328,10 @@ static void _parse_pbs_resource_list(char *rl)
 				exit(error_exit);
 			}
 			xfree(temp);
-		} else if (!strncmp(rl+i, "host=", 5)) {
+		} else if (!xstrncmp(rl+i, "host=", 5)) {
 			i+=5;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "mem=", 4)) {
+		} else if (!xstrncmp(rl+i, "mem=", 4)) {
 			int end = 0;
 
 			i+=4;
@@ -2170,7 +2369,7 @@ static void _parse_pbs_resource_list(char *rl)
 		 * NB: no "mppmem" here since it specifies per-PE memory units,
 		 *     whereas SLURM uses per-node and per-CPU memory units.
 		 */
-		} else if (!strncmp(rl + i, "mppdepth=", 9)) {
+		} else if (!xstrncmp(rl + i, "mppdepth=", 9)) {
 			/* Cray: number of CPUs (threads) per processing element */
 			i += 9;
 			temp = _get_pbs_option_value(rl, &i, ',');
@@ -2180,7 +2379,7 @@ static void _parse_pbs_resource_list(char *rl)
 				opt.cpus_set	  = true;
 			}
 			xfree(temp);
-		} else if (!strncmp(rl + i, "mppnodes=", 9)) {
+		} else if (!xstrncmp(rl + i, "mppnodes=", 9)) {
 			/* Cray `nodes' variant: hostlist without prefix */
 			i += 9;
 			temp = _get_pbs_option_value(rl, &i, ',');
@@ -2190,7 +2389,7 @@ static void _parse_pbs_resource_list(char *rl)
 			}
 			xfree(opt.nodelist);
 			opt.nodelist = temp;
-		} else if (!strncmp(rl + i, "mppnppn=", 8)) {
+		} else if (!xstrncmp(rl + i, "mppnppn=", 8)) {
 			/* Cray: number of processing elements per node */
 			i += 8;
 			temp = _get_pbs_option_value(rl, &i, ',');
@@ -2198,7 +2397,7 @@ static void _parse_pbs_resource_list(char *rl)
 				opt.ntasks_per_node = parse_int("mppnppn",
 								temp, true);
 			xfree(temp);
-		} else if (!strncmp(rl + i, "mppwidth=", 9)) {
+		} else if (!xstrncmp(rl + i, "mppwidth=", 9)) {
 			/* Cray: task width (number of processing elements) */
 			i += 9;
 			temp = _get_pbs_option_value(rl, &i, ',');
@@ -2223,18 +2422,13 @@ static void _parse_pbs_resource_list(char *rl)
 				opt.mincpus = parse_int("ncpus", temp, true);
 				xfree(temp);
 			}
-		} else if (!strncmp(rl+i, "nice=", 5)) {
-			i+=5;
+		} else if (!xstrncmp(rl+i, "nice=", 5)) {
+			i += 5;
 			temp = _get_pbs_option_value(rl, &i, ',');
 			if (temp)
 				opt.nice = strtol(temp, NULL, 10);
 			else
 				opt.nice = 100;
-			if (abs(opt.nice) > NICE_OFFSET) {
-				error("Invalid nice value, must be between "
-				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
-				exit(error_exit);
-			}
 			if (opt.nice < 0) {
 				uid_t my_uid = getuid();
 				if ((my_uid != 0) &&
@@ -2245,7 +2439,7 @@ static void _parse_pbs_resource_list(char *rl)
 				}
 			}
 			xfree(temp);
-		} else if (!strncmp(rl+i, "nodes=", 6)) {
+		} else if (!xstrncmp(rl+i, "nodes=", 6)) {
 			i+=6;
 			temp = _get_pbs_option_value(rl, &i, ',');
 			if (!temp) {
@@ -2254,13 +2448,13 @@ static void _parse_pbs_resource_list(char *rl)
 			}
 			_parse_pbs_nodes_opts(temp);
 			xfree(temp);
-		} else if (!strncmp(rl+i, "opsys=", 6)) {
- 			i+=6;
+		} else if (!xstrncmp(rl+i, "opsys=", 6)) {
+			i+=6;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "other=", 6)) {
+		} else if (!xstrncmp(rl+i, "other=", 6)) {
 			i+=6;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "pcput=", 6)) {
+		} else if (!xstrncmp(rl+i, "pcput=", 6)) {
 			i+=6;
 			temp = _get_pbs_option_value(rl, &i, ',');
 			if (!temp) {
@@ -2270,10 +2464,10 @@ static void _parse_pbs_resource_list(char *rl)
 			xfree(opt.time_limit_str);
 			opt.time_limit_str = xstrdup(temp);
 			xfree(temp);
-		} else if (!strncmp(rl+i, "pmem=", 5)) {
+		} else if (!xstrncmp(rl+i, "pmem=", 5)) {
 			i+=5;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "proc=", 5)) {
+		} else if (!xstrncmp(rl+i, "proc=", 5)) {
 			i += 5;
 			if (opt.constraints)
 				xstrcat(opt.constraints, ",");
@@ -2281,7 +2475,7 @@ static void _parse_pbs_resource_list(char *rl)
 			xstrcat(opt.constraints, temp);
 			xfree(temp);
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "pvmem=", 6)) {
+		} else if (!xstrncmp(rl+i, "pvmem=", 6)) {
 			i+=6;
 			_get_next_pbs_option(rl, &i);
 		} else if (!strncasecmp(rl+i, "select=", 7)) {
@@ -2294,13 +2488,13 @@ static void _parse_pbs_resource_list(char *rl)
 				opt.nodes_set = true;
 				xfree(temp);
 			}
-		} else if (!strncmp(rl+i, "software=", 9)) {
+		} else if (!xstrncmp(rl+i, "software=", 9)) {
 			i+=9;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "vmem=", 5)) {
+		} else if (!xstrncmp(rl+i, "vmem=", 5)) {
 			i+=5;
 			_get_next_pbs_option(rl, &i);
-		} else if (!strncmp(rl+i, "walltime=", 9)) {
+		} else if (!xstrncmp(rl+i, "walltime=", 9)) {
 			i+=9;
 			temp = _get_pbs_option_value(rl, &i, ',');
 			if (!temp) {
@@ -2596,6 +2790,10 @@ static bool _opt_verify(void)
 		if (opt.time_min == 0)
 			opt.time_min = INFINITE;
 	}
+	if ((opt.deadline) && (opt.begin) && (opt.deadline < opt.begin)) {
+		error("Incompatible begin and deadline time specification");
+		exit(error_exit);
+	}
 
 	if (opt.ckpt_interval_str) {
 		opt.ckpt_interval = time_str2mins(opt.ckpt_interval_str);
@@ -2614,7 +2812,7 @@ static bool _opt_verify(void)
 
 	if (opt.immediate) {
 		char *sched_name = slurm_get_sched_type();
-		if (strcmp(sched_name, "sched/wiki") == 0) {
+		if (xstrcmp(sched_name, "sched/wiki") == 0) {
 			info("WARNING: Ignoring the -I/--immediate option "
 				"(not supported by Maui)");
 			opt.immediate = false;
@@ -2685,7 +2883,7 @@ static bool _opt_verify(void)
 
 static uint16_t _parse_pbs_mail_type(const char *arg)
 {
-	uint16_t rc =  0;
+	uint16_t rc = 0;
 
 	if (strchr(arg, 'b') || strchr(arg, 'B'))
 		rc |= MAIL_JOB_BEGIN;
@@ -2694,6 +2892,11 @@ static uint16_t _parse_pbs_mail_type(const char *arg)
 	if (strchr(arg, 'a') || strchr(arg, 'A'))
 		rc |= MAIL_JOB_FAIL;
 
+	if (strchr(arg, 'n') || strchr(arg, 'N'))
+		rc = 0;
+	else if (!rc)
+		rc = (uint16_t)INFINITE;
+
 	return rc;
 }
 
@@ -2715,7 +2918,7 @@ extern char *spank_get_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(tmp_str);
 		return (opt.spank_job_env[i] + len);
@@ -2742,7 +2945,7 @@ extern int   spank_set_job_env(const char *name, const char *value,
 	xstrcat(tmp_str, value);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		if (overwrite) {
 			xfree(opt.spank_job_env[i]);
@@ -2775,7 +2978,7 @@ extern int   spank_unset_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i=0; i<opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(opt.spank_job_env[i]);
 		for (j=(i+1); j<opt.spank_job_env_size; i++, j++)
@@ -2945,6 +3148,11 @@ static void _opt_list(void)
 		slurm_make_time_str(&opt.begin, time_str, sizeof(time_str));
 		info("begin             : %s", time_str);
 	}
+	if (opt.deadline) {
+		char time_str[32];
+		slurm_make_time_str(&opt.deadline, time_str, sizeof(time_str));
+		info("deadline          : %s", time_str);
+	}
 	info("array             : %s",
 	     opt.array_inx == NULL ? "N/A" : opt.array_inx);
 	info("cpu_freq_min      : %u", opt.cpu_freq_min);
@@ -2976,20 +3184,22 @@ static void _opt_list(void)
 	info("burst_buffer      : `%s'", opt.burst_buffer);
 	info("remote command    : `%s'", str);
 	info("power             : %s", power_flags_str(opt.power_flags));
-	info("sicp              : %u", opt.sicp_mode);
+	info("wait              : %s", opt.wait ? "no" : "yes");
+	if (opt.mcs_label)
+		info("mcs-label         : %s",opt.mcs_label);
 	xfree(str);
 
 }
 
 static void _usage(void)
 {
- 	printf(
+	printf(
 "Usage: sbatch [-N nnodes] [-n ntasks]\n"
 "              [-c ncpus] [-r n] [-p partition] [--hold] [--parsable] [-t minutes]\n"
 "              [-D path] [--immediate] [--no-kill] [--overcommit]\n"
 "              [--input file] [--output file] [--error file]\n"
 "              [--time-min=minutes] [--licenses=names] [--clusters=cluster_names]\n"
-"              [--workdir=directory] [--share] [-m dist] [-J jobname]\n"
+"              [--workdir=directory] [--oversubscibe] [-m dist] [-J jobname]\n"
 "              [--jobid=id] [--verbose] [--gid=group] [--uid=user]\n"
 "              [--contiguous] [--mincpus=n] [--mem=MB] [--tmp=MB] [-C list]\n"
 "              [--account=name] [--dependency=type:jobid] [--comment=name]\n"
@@ -3008,12 +3218,12 @@ static void _usage(void)
 "              [--mloader-image=path] [--ioload-image=path]\n"
 #endif
 #endif
-"              [--mail-type=type] [--mail-user=user][--nice[=value]]\n"
+"              [--mail-type=type] [--mail-user=user][--nice[=value]] [--wait]\n"
 "              [--requeue] [--no-requeue] [--ntasks-per-node=n] [--propagate]\n"
 "              [--nodefile=file] [--nodelist=hosts] [--exclude=hosts]\n"
 "              [--network=type] [--mem-per-cpu=MB] [--qos=qos] [--gres=list]\n"
-"              [--mem_bind=...] [--reservation=name]\n"
-"              [--cpu-freq=min[-max[:gov]] [--sicp] [--power=flags]\n"
+"              [--mem_bind=...] [--reservation=name] [--mcs-label=mcs]\n"
+"              [--cpu-freq=min[-max[:gov]] [--power=flags] [--gres-flags=opts]\n"
 "              [--switches=max-switches{@max-time-to-wait}] [--reboot]\n"
 "              [--core-spec=cores] [--thread-spec=threads] [--bb=burst_buffer_spec]\n"
 "              [--array=index_values] [--profile=...] [--ignore-pbs]\n"
@@ -3040,6 +3250,8 @@ static void _help(void)
 "  -c, --cpus-per-task=ncpus   number of cpus required per task\n"
 
 "  -d, --dependency=type:jobid defer job until condition on jobid is satisfied\n"
+"      --deadline=time         remove the job if no ending possible before\n"
+"                              this deadline (start > (deadline - time[-min]))\n"
 "  -D, --workdir=directory     set working directory for batch script\n"
 "  -e, --error=err             file for batch script's standard error\n"
 "      --export[=names]        specify environment variables to export\n"
@@ -3048,6 +3260,7 @@ static void _help(void)
 "      --get-user-env          load environment from local cluster\n"
 "      --gid=group_id          group ID to run job as (user root only)\n"
 "      --gres=list             required generic resources\n"
+"      --gres-flags=opts       flags related to GRES management\n"
 "  -H, --hold                  submit job in held state\n"
 "      --ignore-pbs            Ignore #PBS options in the batch script\n"
 "  -i, --input=in              file for batch script's standard input\n"
@@ -3062,6 +3275,7 @@ static void _help(void)
 "      --mail-type=type        notify on state change: BEGIN, END, FAIL or ALL\n"
 "      --mail-user=user        who to send email notification for job state\n"
 "                              changes\n"
+"      --mcs-label=mcs         mcs label if mcs plugin mcs/group is used\n"
 "  -n, --ntasks=ntasks         number of tasks to run\n"
 "      --nice[=value]          decrease scheduling priority by value\n"
 "      --no-requeue            if set, do not permit the job to be requeued\n"
@@ -3082,9 +3296,8 @@ static void _help(void)
 "  -Q, --quiet                 quiet mode (suppress informational messages)\n"
 "      --reboot                reboot compute nodes before starting job\n"
 "      --requeue               if set, permit the job to be requeued\n"
-"  -s, --share                 share nodes with other jobs\n"
+"  -s, --oversubscribe         over subscribe resources with other jobs\n"
 "  -S, --core-spec=cores       count of reserved cores\n"
-"      --sicp                  If specified, signifies job is to receive\n"
 "      --signal=[B:]num[@time] send signal when time limit within time seconds\n"
 "      --switches=max-switches{@max-time-to-wait}\n"
 "                              Optimum switches and max time to wait for optimum\n"
@@ -3093,6 +3306,7 @@ static void _help(void)
 "      --time-min=minutes      minimum time limit (if distinct)\n"
 "      --uid=user_id           user ID to run job as (user root only)\n"
 "  -v, --verbose               verbose mode (multiple -v's increase verbosity)\n"
+"  -W, --wait                  wait for completion of submitted job\n"
 "      --wckey=wckey           wckey to run job under\n"
 "      --wrap[=command string] wrap command string in a sh script and submit\n"
 
@@ -3112,6 +3326,9 @@ static void _help(void)
 "Consumable resources related options:\n"
 "      --exclusive[=user]      allocate nodes in exclusive mode when\n"
 "                              cpu consumable resource is enabled\n"
+"      --exclusive[=mcs]       allocate nodes in exclusive mode when\n"
+"                              cpu consumable resource is enabled\n"
+"                              and mcs plugin is enabled\n"
 "      --mem-per-cpu=MB        maximum amount of real memory per allocated\n"
 "                              cpu required by the job.\n"
 "                              --mem >= --mem-per-cpu if --mem is specified.\n"
@@ -3128,7 +3345,7 @@ static void _help(void)
 "      --ntasks-per-socket=n   number of tasks to invoke on each socket\n");
 	conf = slurm_conf_lock();
 	if (conf->task_plugin != NULL
-	    && strcasecmp(conf->task_plugin, "task/affinity") == 0) {
+	    && xstrcasecmp(conf->task_plugin, "task/affinity") == 0) {
 		printf(
 "      --hint=                 Bind tasks according to application hints\n"
 "                              (see \"--hint=help\" for options)\n"
diff --git a/src/sbatch/opt.h b/src/sbatch/opt.h
index 5f4d40d26..50980f0bb 100644
--- a/src/sbatch/opt.h
+++ b/src/sbatch/opt.h
@@ -81,7 +81,7 @@ typedef struct sbatch_options {
 	bool nodes_set;		/* true if nodes explicitly set */
 	int sockets_per_node;	/* --sockets-per-node=n		*/
 	int cores_per_socket;	/* --cores-per-socket=n		*/
-	uint32_t kill_invalid_dep;  /* --kill_invalid_dep           */
+	uint32_t job_flags;	/* --kill_invalid_dep, --gres-flags */
 	int threads_per_core;	/* --threads-per-core=n		*/
 	int ntasks_per_node;	/* --ntasks-per-node=n		*/
 	int ntasks_per_socket;	/* --ntasks-per-socket=n	*/
@@ -168,6 +168,7 @@ typedef struct sbatch_options {
 	int get_user_env_mode;	/* --get-user-env=[S|L]         */
 	char *export_env;	/* --export			*/
 	char *export_file;	/* --export-file=file		*/
+	bool wait;		/* -W, --wait			*/
 	char *wckey;            /* --wckey workload characterization key */
 	char *reservation;      /* --reservation */
  	int ckpt_interval;	/* --checkpoint (int minutes)   */
@@ -186,7 +187,8 @@ typedef struct sbatch_options {
 	bool test_only;		/* --test-only			*/
 	char *burst_buffer;	/* -bb				*/
 	uint8_t power_flags;	/* Power management options	*/
-	uint8_t sicp_mode;	/* Inter-cluster job ID		*/
+	char *mcs_label;	/* mcs label if mcs plugin in use */
+	time_t deadline;	/* ---deadline                  */
 } opt_t;
 
 extern opt_t opt;
diff --git a/src/sbatch/sbatch.c b/src/sbatch/sbatch.c
index 9bd574c75..f89452a29 100644
--- a/src/sbatch/sbatch.c
+++ b/src/sbatch/sbatch.c
@@ -77,6 +77,7 @@ static int   _set_rlimit_env(void);
 static void  _set_spank_env(void);
 static void  _set_submit_dir_env(void);
 static int   _set_umask_env(void);
+static int   _job_wait(uint32_t job_id);
 
 int main(int argc, char *argv[])
 {
@@ -86,7 +87,7 @@ int main(int argc, char *argv[])
 	char *script_name;
 	void *script_body;
 	int script_size = 0;
-	int retries = 0;
+	int rc = 0, retries = 0;
 
 	slurm_conf_init(NULL);
 	log_init(xbasename(argv[0]), logopt, 0, NULL);
@@ -217,10 +218,55 @@ int main(int argc, char *argv[])
 			printf(";%s", working_cluster_rec->name);
 		printf("\n");
 	}
+	if (opt.wait)
+		rc = _job_wait(resp->job_id);
 
 	xfree(desc.script);
 	slurm_free_submit_response_response_msg(resp);
-	return 0;
+	return rc;
+}
+
+/* Wait for specified job ID to terminate, return it's exit code */
+static int _job_wait(uint32_t job_id)
+{
+	slurm_job_info_t *job_ptr;
+	job_info_msg_t *resp = NULL;
+	int ec = 0, ec2, i, rc;
+	int sleep_time = 2;
+	bool complete = false;
+
+	while (!complete) {
+		complete = true;
+		sleep(sleep_time);
+		sleep_time = MIN(sleep_time + 2, 10);
+
+		rc = slurm_load_job(&resp, job_id, SHOW_ALL);
+		if (rc == SLURM_SUCCESS) {
+			for (i = 0, job_ptr = resp->job_array;
+			     (i < resp->record_count) && complete;
+			     i++, job_ptr++) {
+				if (IS_JOB_FINISHED(job_ptr)) {
+					if (WIFEXITED(job_ptr->exit_code)) {
+						ec2 = WEXITSTATUS(job_ptr->
+								  exit_code);
+					} else
+						ec2 = 1;
+					ec = MAX(ec, ec2);
+				} else {
+					complete = false;
+				}
+			}
+			slurm_free_job_info_msg(resp);
+		} else if (rc == ESLURM_INVALID_JOB_ID) {
+			error("Job %u no longer found and exit code not found",
+			      job_id);
+		} else {
+			error("Currently unable to load job state "
+			      "information, retrying: %m");
+		}
+	}
+
+	return ec;
 }
 
 static char *_find_quote_token(char *tmp, char *sep, char **last)
@@ -283,7 +329,7 @@ static void _env_merge_filter(job_desc_msg_t *desc)
 	tok = _find_quote_token(tmp, ",", &last);
 	while (tok) {
 
-		if (strcasecmp(tok, "ALL") == 0) {
+		if (xstrcasecmp(tok, "ALL") == 0) {
 			env_array_merge(&desc->environment,
 					(const char **)environ);
 			tok = _find_quote_token(NULL, ",", &last);
@@ -297,7 +343,7 @@ static void _env_merge_filter(job_desc_msg_t *desc)
 		} else {
 			len = strlen(tok);
 			for (i = 0; environ[i]; i++) {
-				if (strncmp(tok, environ[i], len) ||
+				if (xstrncmp(tok, environ[i], len) ||
 				    (environ[i][len] != '='))
 					continue;
 				save_env[0] = environ[i];
@@ -311,7 +357,7 @@ static void _env_merge_filter(job_desc_msg_t *desc)
 	xfree(tmp);
 
 	for (i = 0; environ[i]; i++) {
-		if (strncmp("SLURM_", environ[i], 6))
+		if (xstrncmp("SLURM_", environ[i], 6))
 			continue;
 		save_env[0] = environ[i];
 		env_array_merge(&desc->environment,
@@ -410,6 +456,8 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 		desc->burst_buffer = opt.burst_buffer;
 	if (opt.begin)
 		desc->begin_time = opt.begin;
+	if (opt.deadline)
+		desc->deadline = opt.deadline;
 	if (opt.account)
 		desc->account = xstrdup(opt.account);
 	if (opt.comment)
@@ -503,9 +551,9 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 	}
 	if (opt.export_env == NULL) {
 		env_array_merge(&desc->environment, (const char **)environ);
-	} else if (!strcasecmp(opt.export_env, "ALL")) {
+	} else if (!xstrcasecmp(opt.export_env, "ALL")) {
 		env_array_merge(&desc->environment, (const char **)environ);
-	} else if (!strcasecmp(opt.export_env, "NONE")) {
+	} else if (!xstrcasecmp(opt.export_env, "NONE")) {
 		desc->environment = env_array_create();
 		env_array_merge_slurm(&desc->environment,
 				      (const char **)environ);
@@ -558,10 +606,10 @@ static int _fill_job_desc_from_opts(job_desc_msg_t *desc)
 
 	if (opt.power_flags)
 		desc->power_flags = opt.power_flags;
-	if (opt.sicp_mode)
-		desc->sicp_mode = opt.sicp_mode;
-	if (opt.kill_invalid_dep)
-		desc->bitflags = opt.kill_invalid_dep;
+	if (opt.job_flags)
+		desc->bitflags = opt.job_flags;
+	if (opt.mcs_label)
+		desc->mcs_label = xstrdup(opt.mcs_label);
 
 	return 0;
 }
diff --git a/src/sbcast/Makefile.am b/src/sbcast/Makefile.am
index 0c4c4a735..9fa48ffe5 100644
--- a/src/sbcast/Makefile.am
+++ b/src/sbcast/Makefile.am
@@ -6,7 +6,9 @@ AUTOMAKE_OPTIONS = foreign
 AM_CPPFLAGS = -I$(top_srcdir) $(BG_INCLUDES)
 bin_PROGRAMS = sbcast
 
-sbcast_LDADD = 	$(top_builddir)/src/api/libslurm.o $(DL_LIBS) -lm
+sbcast_LDADD = 	$(top_builddir)/src/api/libslurm.o \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
+	$(DL_LIBS) -lm
 
 noinst_HEADERS = sbcast.h
 sbcast_SOURCES = sbcast.c opts.c
diff --git a/src/sbcast/Makefile.in b/src/sbcast/Makefile.in
index 7da95baa8..caa01a4a8 100644
--- a/src/sbcast/Makefile.in
+++ b/src/sbcast/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 bin_PROGRAMS = sbcast$(EXEEXT)
 subdir = src/sbcast
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -153,6 +154,7 @@ am_sbcast_OBJECTS = sbcast.$(OBJEXT) opts.$(OBJEXT)
 sbcast_OBJECTS = $(am_sbcast_OBJECTS)
 am__DEPENDENCIES_1 =
 sbcast_DEPENDENCIES = $(top_builddir)/src/api/libslurm.o \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
 	$(am__DEPENDENCIES_1)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
@@ -228,8 +230,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +329,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +371,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +417,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +470,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -474,7 +485,10 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 AM_CPPFLAGS = -I$(top_srcdir) $(BG_INCLUDES)
-sbcast_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) -lm
+sbcast_LDADD = $(top_builddir)/src/api/libslurm.o \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
+	$(DL_LIBS) -lm
+
 noinst_HEADERS = sbcast.h
 sbcast_SOURCES = sbcast.c opts.c
 sbcast_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
diff --git a/src/sbcast/opts.c b/src/sbcast/opts.c
index 8c176432a..dc935a74d 100644
--- a/src/sbcast/opts.c
+++ b/src/sbcast/opts.c
@@ -55,7 +55,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 
-#include "src/common/file_bcast.h"
 #include "src/common/proc_args.h"
 #include "src/common/xstring.h"
 
@@ -81,7 +80,7 @@ extern void parse_command_line(int argc, char *argv[])
 	int opt_char;
 	int option_index;
 	static struct option long_options[] = {
-		{"compress",  no_argument,       0, 'C'},
+		{"compress",  optional_argument, 0, 'C'},
 		{"fanout",    required_argument, 0, 'F'},
 		{"force",     no_argument,       0, 'f'},
 		{"jobid",     required_argument, 0, 'j'},
@@ -96,7 +95,7 @@ extern void parse_command_line(int argc, char *argv[])
 	};
 
 	if (getenv("SBCAST_COMPRESS"))
-		params.compress = true;
+		params.compress = parse_compress_type(env_val);
 	if ( ( env_val = getenv("SBCAST_FANOUT") ) )
 		params.fanout = atoi(env_val);
 	if (getenv("SBCAST_FORCE"))
@@ -109,6 +108,8 @@ extern void parse_command_line(int argc, char *argv[])
 		params.preserve = true;
 	if ( ( env_val = getenv("SBCAST_SIZE") ) )
 		params.block_size = _map_size(env_val);
+	else
+		params.block_size = 8 * 1024 * 1024;
 	if ( ( env_val = getenv("SBCAST_TIMEOUT") ) )
 		params.timeout = (atoi(env_val) * 1000);
 
@@ -122,7 +123,7 @@ extern void parse_command_line(int argc, char *argv[])
 			exit(1);
 			break;
 		case (int)'C':
-			params.compress = true;
+			params.compress = parse_compress_type(optarg);
 			break;
 		case (int)'f':
 			params.force = true;
@@ -134,6 +135,7 @@ extern void parse_command_line(int argc, char *argv[])
 			params.job_id = strtol(optarg, &end_ptr, 10);
 			if (end_ptr[0] == '.')
 				params.step_id = strtol(end_ptr+1, NULL, 10);
+			break;
 		case (int)'p':
 			params.preserve = true;
 			break;
@@ -218,7 +220,7 @@ static void _print_options( void )
 {
 	info("-----------------------------");
 	info("block_size = %u", params.block_size);
-	info("compress   = %s", params.compress ? "true" : "false");
+	info("compress   = %u", params.compress);
 	info("force      = %s", params.force ? "true" : "false");
 	info("fanout     = %d", params.fanout);
 	if (params.step_id == NO_VAL)
@@ -243,17 +245,17 @@ static void _help( void )
 {
 	printf ("\
 Usage: sbcast [OPTIONS] SOURCE DEST\n\
-  -C, --compress      compress the file being transmitted\n\
-  -f, --force         replace destination file as required\n\
-  -F, --fanout=num    specify message fanout\n\
-  -j, --jobid=#[.#]   specify job ID and optional step ID, unneeded if run\n\
-                      inside allocation\n\
-  -p, --preserve      preserve modes and times of source file\n\
-  -s, --size=num      block size in bytes (rounded off)\n\
-  -t, --timeout=secs  specify message timeout (seconds)\n\
-  -v, --verbose       provide detailed event logging\n\
-  -V, --version       print version information and exit\n\
+  -C, --compress[=lib] compress the file being transmitted\n\
+  -f, --force          replace destination file as required\n\
+  -F, --fanout=num     specify message fanout\n\
+  -j, --jobid=#[.#]    specify job ID and optional step ID, unneeded if run\n\
+                       inside allocation\n\
+  -p, --preserve       preserve modes and times of source file\n\
+  -s, --size=num       block size in bytes (rounded off)\n\
+  -t, --timeout=secs   specify message timeout (seconds)\n\
+  -v, --verbose        provide detailed event logging\n\
+  -V, --version        print version information and exit\n\
 \nHelp options:\n\
-  --help              show this help message\n\
-  --usage             display brief usage message\n");
+  --help               show this help message\n\
+  --usage              display brief usage message\n");
 }
diff --git a/src/sbcast/sbcast.c b/src/sbcast/sbcast.c
index cec1751dd..5564458c1 100644
--- a/src/sbcast/sbcast.c
+++ b/src/sbcast/sbcast.c
@@ -3,6 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2006-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
+ *  Copyright (C) 2016 SchedMD LLC.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -51,7 +52,7 @@
 #include <sys/stat.h>
 
 #include "slurm/slurm_errno.h"
-#include "src/common/file_bcast.h"
+
 #include "src/common/forward.h"
 #include "src/common/hostlist.h"
 #include "src/common/log.h"
diff --git a/src/sbcast/sbcast.h b/src/sbcast/sbcast.h
index c201e6853..911b64986 100644
--- a/src/sbcast/sbcast.h
+++ b/src/sbcast/sbcast.h
@@ -45,10 +45,12 @@
 #endif
 
 #include "slurm/slurm.h"
-#include "src/common/file_bcast.h"
+
 #include "src/common/macros.h"
 #include "src/common/slurm_protocol_defs.h"
 
+#include "src/bcast/file_bcast.h"
+
 extern struct bcast_parameters params;
 
 extern void parse_command_line(int argc, char *argv[]);
diff --git a/src/scancel/Makefile.in b/src/scancel/Makefile.in
index 93b6a1c48..d15637d97 100644
--- a/src/scancel/Makefile.in
+++ b/src/scancel/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 bin_PROGRAMS = scancel$(EXEEXT)
 subdir = src/scancel
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -227,8 +228,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -328,6 +327,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -366,6 +369,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -409,6 +415,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -459,6 +468,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/scancel/opt.c b/src/scancel/opt.c
index b1d7f679a..19a459ffd 100644
--- a/src/scancel/opt.c
+++ b/src/scancel/opt.c
@@ -220,7 +220,7 @@ static uint16_t _xlate_signal_name(const char *signal_name)
 		return sig_num;
 
 	for (i=0; i<SIZE(sig_name_num); i++) {
-		if (strcasecmp(sig_name_num[i].name, signal_name) == 0) {
+		if (xstrcasecmp(sig_name_num[i].name, signal_name) == 0) {
 			xfree(sig_names);
 			return sig_name_num[i].val;
 		}
@@ -251,7 +251,7 @@ static void _opt_default(void)
 {
 	char *launch_type = slurm_get_launch_type();
 	/* do this for all but slurm (poe, aprun, etc...) */
-	if (strcmp(launch_type, "launch/slurm"))
+	if (xstrcmp(launch_type, "launch/slurm"))
 		opt.ctld	= true;
 	else
 		opt.ctld	= false;
@@ -289,13 +289,13 @@ static void _opt_env(void)
 	}
 
 	if ( (val=getenv("SCANCEL_BATCH")) ) {
-		if (strcasecmp(val, "true") == 0)
+		if (xstrcasecmp(val, "true") == 0)
 			opt.batch       = true;
-		else if (strcasecmp(val, "T") == 0)
+		else if (xstrcasecmp(val, "T") == 0)
 			opt.batch       = true;
-		else if (strcasecmp(val, "false") == 0)
+		else if (xstrcasecmp(val, "false") == 0)
 			opt.batch       = false;
-		else if (strcasecmp(val, "F") == 0)
+		else if (xstrcasecmp(val, "F") == 0)
 			opt.batch       = false;
 		else
 			error ("Unrecognized SCANCEL_BATCH value: %s", val);
@@ -305,26 +305,26 @@ static void _opt_env(void)
 		opt.ctld = true;
 
 	if ( (val=getenv("SCANCEL_FULL")) ) {
-		if (strcasecmp(val, "true") == 0)
+		if (xstrcasecmp(val, "true") == 0)
 			opt.full       = true;
-		else if (strcasecmp(val, "T") == 0)
+		else if (xstrcasecmp(val, "T") == 0)
 			opt.full       = true;
-		else if (strcasecmp(val, "false") == 0)
+		else if (xstrcasecmp(val, "false") == 0)
 			opt.full       = false;
-		else if (strcasecmp(val, "F") == 0)
+		else if (xstrcasecmp(val, "F") == 0)
 			opt.full       = false;
 		else
 			error ("Unrecognized SCANCEL_FULL value: %s", val);
 	}
 
 	if ( (val=getenv("SCANCEL_INTERACTIVE")) ) {
-		if (strcasecmp(val, "true") == 0)
+		if (xstrcasecmp(val, "true") == 0)
 			opt.interactive = true;
-		else if (strcasecmp(val, "T") == 0)
+		else if (xstrcasecmp(val, "T") == 0)
 			opt.interactive = true;
-		else if (strcasecmp(val, "false") == 0)
+		else if (xstrcasecmp(val, "false") == 0)
 			opt.interactive = false;
-		else if (strcasecmp(val, "F") == 0)
+		else if (xstrcasecmp(val, "F") == 0)
 			opt.interactive = false;
 		else
 			error ("Unrecognized SCANCEL_INTERACTIVE value: %s",
@@ -352,13 +352,13 @@ static void _opt_env(void)
 	}
 
 	if ( (val=getenv("SCANCEL_VERBOSE")) ) {
-		if (strcasecmp(val, "true") == 0)
+		if (xstrcasecmp(val, "true") == 0)
 			opt.verbose = 1;
-		else if (strcasecmp(val, "T") == 0)
+		else if (xstrcasecmp(val, "T") == 0)
 			opt.verbose = 1;
-		else if (strcasecmp(val, "false") == 0)
+		else if (xstrcasecmp(val, "false") == 0)
 			opt.verbose = 0;
-		else if (strcasecmp(val, "F") == 0)
+		else if (xstrcasecmp(val, "F") == 0)
 			opt.verbose = 0;
 		else
 			error ("Unrecognized SCANCEL_VERBOSE value: %s",
diff --git a/src/scancel/scancel.c b/src/scancel/scancel.c
index 11c42e994..d5e192b65 100644
--- a/src/scancel/scancel.c
+++ b/src/scancel/scancel.c
@@ -494,13 +494,13 @@ static void _cancel_jobid_by_state(uint32_t job_state, int filter_cnt, int *rc)
 				continue;
 			}
 
-			pthread_mutex_lock(&num_active_threads_lock);
+			slurm_mutex_lock(&num_active_threads_lock);
 			num_active_threads++;
 			while (num_active_threads > MAX_THREADS) {
 				pthread_cond_wait(&num_active_threads_cond,
 						  &num_active_threads_lock);
 			}
-			pthread_mutex_unlock(&num_active_threads_lock);
+			slurm_mutex_unlock(&num_active_threads_lock);
 
 			cancel_info = (job_cancel_info_t *)
 				      xmalloc(sizeof(job_cancel_info_t));
@@ -533,12 +533,12 @@ static void _cancel_jobid_by_state(uint32_t job_state, int filter_cnt, int *rc)
 			if (opt.interactive) {
 				/* Print any error message for first job before
 				 * starting confirmation of next job */
-				pthread_mutex_lock(&num_active_threads_lock);
+				slurm_mutex_lock(&num_active_threads_lock);
 				while (num_active_threads > 0) {
 					pthread_cond_wait(&num_active_threads_cond,
 							  &num_active_threads_lock);
 				}
-				pthread_mutex_unlock(&num_active_threads_lock);
+				slurm_mutex_unlock(&num_active_threads_lock);
 			}
 		}
 	}
@@ -586,13 +586,13 @@ _cancel_jobs_by_state(uint32_t job_state, int filter_cnt, int *rc)
 		cancel_info->num_active_threads_cond =
 			&num_active_threads_cond;
 
-		pthread_mutex_lock(&num_active_threads_lock);
+		slurm_mutex_lock(&num_active_threads_lock);
 		num_active_threads++;
 		while (num_active_threads > MAX_THREADS) {
 			pthread_cond_wait(&num_active_threads_cond,
 					  &num_active_threads_lock);
 		}
-		pthread_mutex_unlock(&num_active_threads_lock);
+		slurm_mutex_unlock(&num_active_threads_lock);
 
 		err = pthread_create(&dummy, &attr, _cancel_job_id,cancel_info);
 		if (err)   /* Run in-line if thread create fails */
@@ -602,12 +602,12 @@ _cancel_jobs_by_state(uint32_t job_state, int filter_cnt, int *rc)
 		if (opt.interactive) {
 			/* Print any error message for first job before
 			 * starting confirmation of next job */
-			pthread_mutex_lock(&num_active_threads_lock);
+			slurm_mutex_lock(&num_active_threads_lock);
 			while (num_active_threads > 0) {
 				pthread_cond_wait(&num_active_threads_cond,
 						  &num_active_threads_lock);
 			}
-			pthread_mutex_unlock(&num_active_threads_lock);
+			slurm_mutex_unlock(&num_active_threads_lock);
 		}
 	}
 }
@@ -631,21 +631,21 @@ static int _cancel_jobs(int filter_cnt)
 	 * cancellation of running jobs so that we don't have a race condition
 	 * with pending jobs getting scheduled while running jobs are also
 	 * being cancelled. */
-	pthread_mutex_lock( &num_active_threads_lock );
+	slurm_mutex_lock( &num_active_threads_lock );
 	while (num_active_threads > 0) {
 		pthread_cond_wait(&num_active_threads_cond,
 				  &num_active_threads_lock);
 	}
-	pthread_mutex_unlock(&num_active_threads_lock);
+	slurm_mutex_unlock(&num_active_threads_lock);
 
 	_cancel_jobs_by_state(JOB_END, filter_cnt, &rc);
 	/* Wait for any spawned threads that have not finished */
-	pthread_mutex_lock( &num_active_threads_lock );
+	slurm_mutex_lock( &num_active_threads_lock );
 	while (num_active_threads > 0) {
 		pthread_cond_wait(&num_active_threads_cond,
 				  &num_active_threads_lock);
 	}
-	pthread_mutex_unlock(&num_active_threads_lock);
+	slurm_mutex_unlock(&num_active_threads_lock);
 
 	slurm_attr_destroy(&attr);
 	slurm_mutex_destroy(&num_active_threads_lock);
@@ -664,7 +664,7 @@ static void _add_delay(void)
 	static int delay_time = 10000, previous_delay = 0;
 	int my_delay;
 
-	pthread_mutex_lock(&max_delay_lock);
+	slurm_mutex_lock(&max_delay_lock);
 	if (target_resp_time < 0) {
 		target_resp_time = slurm_get_msg_timeout() / 4;
 		target_resp_time = MAX(target_resp_time, 3);
@@ -675,7 +675,7 @@ static void _add_delay(void)
 	}
 	if ((++request_count < MAX_THREADS) ||
 	    (max_resp_time <= target_resp_time)) {
-		pthread_mutex_unlock(&max_delay_lock);
+		slurm_mutex_unlock(&max_delay_lock);
 		return;
 	}
 
@@ -683,7 +683,7 @@ static void _add_delay(void)
 	my_delay = MIN((delay_time + previous_delay), 1000000);
 	previous_delay = delay_time;
 	delay_time = my_delay;
-	pthread_mutex_unlock(&max_delay_lock);
+	slurm_mutex_unlock(&max_delay_lock);
 
 	info("%s: adding delay in RPC send of %d usec", __func__, my_delay);
 	usleep(my_delay);
@@ -744,9 +744,9 @@ _cancel_job_id (void *ci)
 		error_code = slurm_kill_job2(cancel_info->job_id_str,
 					     cancel_info->sig, flags);
 		END_TIMER;
-		pthread_mutex_lock(&max_delay_lock);
+		slurm_mutex_lock(&max_delay_lock);
 		max_resp_time = MAX(max_resp_time, DELTA_TIMER);
-		pthread_mutex_unlock(&max_delay_lock);
+		slurm_mutex_unlock(&max_delay_lock);
 
 		if ((error_code == 0) ||
 		    (errno != ESLURM_TRANSITION_STATE_NO_UPDATE))
@@ -773,11 +773,11 @@ _cancel_job_id (void *ci)
 	/* Purposely free the struct passed in here, so the caller doesn't have
 	 * to keep track of it, but don't destroy the mutex and condition
 	 * variables contained. */
-	pthread_mutex_lock(cancel_info->num_active_threads_lock);
+	slurm_mutex_lock(cancel_info->num_active_threads_lock);
 	*(cancel_info->rc) = MAX(*(cancel_info->rc), error_code);
 	(*(cancel_info->num_active_threads))--;
 	pthread_cond_signal(cancel_info->num_active_threads_cond);
-	pthread_mutex_unlock(cancel_info->num_active_threads_lock);
+	slurm_mutex_unlock(cancel_info->num_active_threads_lock);
 
 	xfree(cancel_info->job_id_str);
 	xfree(cancel_info);
@@ -835,9 +835,9 @@ _cancel_step_id (void *ci)
 			error_code = slurm_signal_job_step(job_id, step_id,
 							   cancel_info->sig);
 		END_TIMER;
-		pthread_mutex_lock(&max_delay_lock);
+		slurm_mutex_lock(&max_delay_lock);
 		max_resp_time = MAX(max_resp_time, DELTA_TIMER);
-		pthread_mutex_unlock(&max_delay_lock);
+		slurm_mutex_unlock(&max_delay_lock);
 
 		if ((error_code == 0) ||
 		    ((errno != ESLURM_TRANSITION_STATE_NO_UPDATE) &&
@@ -862,11 +862,11 @@ _cancel_step_id (void *ci)
 	/* Purposely free the struct passed in here, so the caller doesn't have
 	 * to keep track of it, but don't destroy the mutex and condition
 	 * variables contained. */
-	pthread_mutex_lock(cancel_info->num_active_threads_lock);
+	slurm_mutex_lock(cancel_info->num_active_threads_lock);
 	*(cancel_info->rc) = MAX(*(cancel_info->rc), error_code);
 	(*(cancel_info->num_active_threads))--;
 	pthread_cond_signal(cancel_info->num_active_threads_cond);
-	pthread_mutex_unlock(cancel_info->num_active_threads_lock);
+	slurm_mutex_unlock(cancel_info->num_active_threads_lock);
 
 	xfree(cancel_info->job_id_str);
 	xfree(cancel_info);
@@ -911,6 +911,8 @@ static int _signal_job_by_str(void)
 	if (pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
 		error("pthread_attr_setdetachstate error %m");
 	slurm_mutex_init(&num_active_threads_lock);
+	if (pthread_cond_init(&num_active_threads_cond, NULL))
+		error("pthread_cond_init error %m");
 
 	for (i = 0; opt.job_list[i]; i++) {
 		cancel_info = (job_cancel_info_t *)
@@ -924,13 +926,13 @@ static int _signal_job_by_str(void)
 		cancel_info->num_active_threads_cond =
 			&num_active_threads_cond;
 
-		pthread_mutex_lock(&num_active_threads_lock);
+		slurm_mutex_lock(&num_active_threads_lock);
 		num_active_threads++;
 		while (num_active_threads > MAX_THREADS) {
 			pthread_cond_wait(&num_active_threads_cond,
 					  &num_active_threads_lock);
 		}
-		pthread_mutex_unlock(&num_active_threads_lock);
+		slurm_mutex_unlock(&num_active_threads_lock);
 
 		err = pthread_create(&dummy, &attr, _cancel_job_id,cancel_info);
 		if (err)	/* Run in-line if thread create fails */
@@ -938,12 +940,12 @@ static int _signal_job_by_str(void)
 	}
 
 	/* Wait all spawned threads to finish */
-	pthread_mutex_lock( &num_active_threads_lock );
+	slurm_mutex_lock( &num_active_threads_lock );
 	while (num_active_threads > 0) {
 		pthread_cond_wait(&num_active_threads_cond,
 				  &num_active_threads_lock);
 	}
-	pthread_mutex_unlock(&num_active_threads_lock);
+	slurm_mutex_unlock(&num_active_threads_lock);
 
 	slurm_attr_destroy(&attr);
 
diff --git a/src/scontrol/Makefile.in b/src/scontrol/Makefile.in
index ef42e95b2..515c6c388 100644
--- a/src/scontrol/Makefile.in
+++ b/src/scontrol/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = scontrol$(EXEEXT)
 subdir = src/scontrol
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -232,8 +233,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -333,6 +332,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -371,6 +374,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -414,6 +420,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -464,6 +473,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/scontrol/create_res.c b/src/scontrol/create_res.c
index 82ffd5919..3cc274ccc 100644
--- a/src/scontrol/create_res.c
+++ b/src/scontrol/create_res.c
@@ -36,7 +36,6 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 
-#define _GNU_SOURCE
 #include "src/scontrol/scontrol.h"
 #include "src/slurmctld/reservation.h"
 #include "src/common/proc_args.h"
@@ -118,31 +117,19 @@ static int _parse_resv_core_cnt(resv_desc_msg_t *resv_msg_ptr, char *val,
 {
 
 	char *endptr = NULL, *core_cnt, *tok, *ptrptr = NULL;
-	char *type;
 	int node_inx = 0;
+	uint32_t select_type = slurmdb_setup_plugin_id_select();
 
-	type = slurm_get_select_type();
-	if (strcasestr(type, "cray")) {
-		int param;
-		param = slurm_get_select_type_param();
-		if (! (param & CR_OTHER_CONS_RES)) {
-			error("CoreCnt or CPUCnt is only "
-			      "supported when "
-			      "SelectTypeParameters "
-			      "includes OTHER_CONS_RES");
-			xfree(type);
-			return SLURM_ERROR;
-		}
-	} else if (strcasestr(type, "cons_res") == NULL) {
+	/* only have this on a cons_res machine */
+	if (select_type != SELECT_PLUGIN_CONS_RES &&
+	    select_type != SELECT_PLUGIN_CRAY_CONS_RES) {
 		error("CoreCnt or CPUCnt is only "
-		      "supported when "
-		      "SelectType includes "
-		      "select/cons_res");
-		xfree(type);
+		      "supported when SelectType includes "
+		      "select/cons_res or SelectTypeParameters "
+		      "includes OTHER_CONS_RES on a Cray.");
 		return SLURM_ERROR;
 	}
 
-	xfree(type);
 	core_cnt = xstrdup(val);
 	tok = strtok_r(core_cnt, ",", &ptrptr);
 	while (tok) {
@@ -186,7 +173,7 @@ static int _is_configured_tres(char *type)
 	}
 
 	for (i = 0; i < msg->tres_cnt; ++i) {
-		if (!strcasecmp(msg->tres_names[i], type)) {
+		if (!xstrcasecmp(msg->tres_names[i], type)) {
 			slurm_free_assoc_mgr_info_msg(msg);
 			return SLURM_SUCCESS;
 		}
@@ -220,7 +207,7 @@ static int _parse_resv_tres(char *val, resv_desc_msg_t  *resv_msg_ptr,
 
 		compound = strtok_r(token, "=", &value_str);
 
-		if (!value_str || !*value_str) {
+		if (!compound || !value_str || !*value_str) {
 			error("TRES component '%s' has an invalid value '%s'",
 			      type, token);
 			goto error;
@@ -235,23 +222,19 @@ static int _parse_resv_tres(char *val, resv_desc_msg_t  *resv_msg_ptr,
 		if (_is_configured_tres(compound) < 0)
 			goto error;
 
-		if (!strcasecmp(type, "license")) {
+		if (!xstrcasecmp(type, "license")) {
 			if (tres_license && tres_license[0] != '\0')
 				xstrcatchar(tres_license, ',');
 			xstrfmtcat(tres_license, "%s:%s", name, value_str);
 			token = strtok_r(NULL, ",", &saveptr1);
-			if (tmp)
-				xfree(tmp);
 
-		} else if (strcasecmp(type, "bb") == 0) {
+		} else if (xstrcasecmp(type, "bb") == 0) {
 			if (tres_bb && tres_bb[0] != '\0')
 				xstrcatchar(tres_bb, ',');
 			xstrfmtcat(tres_bb, "%s:%s", name, value_str);
 			token = strtok_r(NULL, ",", &saveptr1);
-			if (tmp)
-				xfree(tmp);
 
-		} else if (strcasecmp(type, "cpu") == 0) {
+		} else if (xstrcasecmp(type, "cpu") == 0) {
 			first = true;
 			discard = false;
 			do {
@@ -280,7 +263,7 @@ static int _parse_resv_tres(char *val, resv_desc_msg_t  *resv_msg_ptr,
 				}
 			} while (!discard && token);
 
-		} else if (strcasecmp(type, "node") == 0) {
+		} else if (xstrcasecmp(type, "node") == 0) {
 			if (tres_nodecnt && tres_nodecnt[0] != '\0')
 				xstrcatchar(tres_nodecnt, ',');
 			xstrcat(tres_nodecnt, value_str);
@@ -319,9 +302,11 @@ static int _parse_resv_tres(char *val, resv_desc_msg_t  *resv_msg_ptr,
 		*free_tres_bb = 1;
 	}
 
+	xfree(tmp);
 	return SLURM_SUCCESS;
 
 error:
+	xfree(tmp);
 	xfree(tres_nodecnt);
 	xfree(tres_corecnt);
 	exit_code = 1;
@@ -615,7 +600,7 @@ scontrol_create_res(int argc, char *argv[])
 	 * only allocate all of the nodes the partition.
 	 */
 	if ((resv_msg.partition != NULL) && (resv_msg.node_list != NULL) &&
-	    (strcasecmp(resv_msg.node_list, "ALL") == 0)) {
+	    (xstrcasecmp(resv_msg.node_list, "ALL") == 0)) {
 		if (resv_msg.flags == NO_VAL)
 			resv_msg.flags = RESERVE_FLAG_PART_NODES;
 		else
@@ -627,7 +612,7 @@ scontrol_create_res(int argc, char *argv[])
 	 * flag is set make sure a partition name is specified.
 	 */
 	if ((resv_msg.partition == NULL) && (resv_msg.node_list != NULL) &&
-	    (strcasecmp(resv_msg.node_list, "ALL") == 0) &&
+	    (xstrcasecmp(resv_msg.node_list, "ALL") == 0) &&
 	    (resv_msg.flags != NO_VAL) &&
 	    (resv_msg.flags & RESERVE_FLAG_PART_NODES)) {
 		exit_code = 1;
diff --git a/src/scontrol/info_assoc_mgr.c b/src/scontrol/info_assoc_mgr.c
index 0dadfef6e..5d346ae83 100644
--- a/src/scontrol/info_assoc_mgr.c
+++ b/src/scontrol/info_assoc_mgr.c
@@ -84,6 +84,83 @@ endit:
 	printf("%s", new_line_char);
 }
 
+static int _print_used_acct_limit(slurmdb_used_limits_t *used_limit,
+				  slurmdb_qos_rec_t *qos_rec)
+{
+	char *new_line_char = one_liner ? " " : "\n        ";
+
+	printf("%sAccount %s%s",
+	       one_liner ? " " : "      ",
+	       used_limit->acct, new_line_char);
+
+	printf("MaxJobsPA=");
+	if (qos_rec->max_jobs_pa != INFINITE)
+		printf("%u", qos_rec->max_jobs_pa);
+	else
+		printf("N");
+	printf("(%u) ", used_limit->jobs);
+
+	printf("MaxSubmitJobsPA=");
+	if (qos_rec->max_submit_jobs_pa != INFINITE)
+		printf("%u", qos_rec->max_submit_jobs_pa);
+	else
+		printf("N");
+	printf("(%u)%s", used_limit->submit_jobs, new_line_char);
+
+	_print_tres_line("MaxTRESPA",
+			 qos_rec->max_tres_pa_ctld,
+			 used_limit->tres, 0, 1);
+
+	/* MaxTRESRunMinsPA doesn't do anything yet, if/when it does
+	 * change the last param in the print_tres_line to 0. */
+
+	/* printf("%s", one_liner ? "" : "    "); */
+	/* _print_tres_line("MaxTRESRunMinsPA", */
+	/* 		 qos_rec->max_tres_run_mins_pa_ctld, */
+	/* 		 used_limit->tres_run_mins, 60, 1); */
+
+
+	return SLURM_SUCCESS;
+}
+
+static int _print_used_user_limit(slurmdb_used_limits_t *used_limit,
+				  slurmdb_qos_rec_t *qos_rec)
+{
+	char *new_line_char = one_liner ? " " : "\n        ";
+
+	printf("%sUser %d%s",
+	       one_liner ? " " : "      ",
+	       used_limit->uid, new_line_char);
+
+	printf("MaxJobsPU=");
+	if (qos_rec->max_jobs_pu != INFINITE)
+		printf("%u", qos_rec->max_jobs_pu);
+	else
+		printf("N");
+	printf("(%u)%s", used_limit->jobs, new_line_char);
+
+	printf("MaxSubmitJobsPU=");
+	if (qos_rec->max_submit_jobs_pu != INFINITE)
+		printf("%u", qos_rec->max_submit_jobs_pu);
+	else
+		printf("N");
+	printf("(%u)%s", used_limit->submit_jobs, new_line_char);
+
+	_print_tres_line("MaxTRESPU",
+			 qos_rec->max_tres_pu_ctld,
+			 used_limit->tres, 0, 1);
+
+	/* MaxTRESRunMinsPU doesn't do anything yet, if/when it does
+	 * change the last param in the print_tres_line to 0. */
+
+	/* printf("%s", one_liner ? "" : "    "); */
+	/* _print_tres_line("MaxTRESRunMinsPU", */
+	/* 		 qos_rec->max_tres_run_mins_pu_ctld, */
+	/* 		 used_limit->tres_run_mins, 60, 1); */
+
+	return SLURM_SUCCESS;
+}
+
 static void _print_assoc_mgr_info(assoc_mgr_info_msg_t *msg)
 {
 	ListIterator itr;
@@ -329,20 +406,6 @@ static void _print_assoc_mgr_info(assoc_mgr_info_msg_t *msg)
 					 qos_rec->usage->
 					 grp_used_tres_run_secs, 60, 0);
 
-			if (qos_rec->max_jobs_pu != INFINITE)
-				printf("MaxJobsPU=%u(%u) ",
-				       qos_rec->max_jobs_pu,
-				       qos_rec->usage->grp_used_jobs);
-			else
-				printf("MaxJobs= ");
-
-			if (qos_rec->max_submit_jobs_pu != INFINITE)
-				printf("MaxSubmitJobs=%u(%u) ",
-				       qos_rec->max_submit_jobs_pu,
-				       qos_rec->usage->grp_used_submit_jobs);
-			else
-				printf("MaxSubmitJobs= ");
-
 			if (qos_rec->max_wall_pj != INFINITE)
 				printf("MaxWallPJ=%u",
 				       qos_rec->max_wall_pj);
@@ -360,15 +423,15 @@ static void _print_assoc_mgr_info(assoc_mgr_info_msg_t *msg)
 					 qos_rec->max_tres_pn_ctld,
 					 NULL, 0, 0);
 
-			_print_tres_line("MaxTRESPU",
-					 qos_rec->max_tres_pu_ctld,
-					 NULL, 0, 0);
-
 			_print_tres_line("MaxTRESMinsPJ",
 					 qos_rec->max_tres_mins_pj_ctld,
 					 NULL, 0, 0);
 
 			/* Doesn't do anything yet */
+			/* _print_tres_line("MaxTRESRunMinsPA", */
+			/* 		 qos_rec->max_tres_mins_pa_ctld, */
+			/* 		 NULL, 0); */
+
 			/* _print_tres_line("MaxTRESRunMinsPU", */
 			/* 		 qos_rec->max_tres_mins_pu_ctld, */
 			/* 		 NULL, 0); */
@@ -376,6 +439,45 @@ static void _print_assoc_mgr_info(assoc_mgr_info_msg_t *msg)
 			_print_tres_line("MinTRESPJ",
 					 qos_rec->min_tres_pj_ctld,
 					 NULL, 0, 1);
+
+			printf("%sPreemptMode=%s%s",
+			       one_liner ? "" : "    ",
+			       preempt_mode_string(
+				       qos_rec->preempt_mode),
+			       one_liner ? "" : "\n");
+
+			if (qos_rec->priority == INFINITE ||
+			    qos_rec->priority == NO_VAL)
+				printf("%sPriority=NONE\n",
+				       one_liner ? "" : "    ");
+			else
+				printf("%sPriority=%u\n",
+				       one_liner ? "" : "    ",
+				       qos_rec->priority);
+
+			printf("%sAccount Limits%s",
+			       one_liner ? "" : "    ",
+			       one_liner ? "" : "\n");
+			if (qos_rec->usage->acct_limit_list) {
+				list_for_each(qos_rec->usage->acct_limit_list,
+					      (ListForF)_print_used_acct_limit,
+					      qos_rec);
+			} else
+				printf("%sNo Accounts%s",
+				       one_liner ? "" : "        ",
+				       one_liner ? "" : "\n");
+
+			printf("%sUser Limits%s",
+			       one_liner ? "" : "    ",
+			       one_liner ? "" : "\n");
+			if (qos_rec->usage->user_limit_list) {
+				list_for_each(qos_rec->usage->user_limit_list,
+					      (ListForF)_print_used_user_limit,
+					      qos_rec);
+			} else
+				printf("%sNo Users%s",
+				       one_liner ? "" : "        ",
+				       one_liner ? "" : "\n");
 		}
 	}
 }
diff --git a/src/scontrol/info_block.c b/src/scontrol/info_block.c
index 40a38a1e8..6535970f8 100644
--- a/src/scontrol/info_block.c
+++ b/src/scontrol/info_block.c
@@ -103,7 +103,7 @@ scontrol_print_block (char *block_name)
 	block_ptr = block_info_ptr->block_array;
 	for (i = 0; i < block_info_ptr->record_count; i++) {
 		if (block_name
-		    && strcmp(block_name, block_ptr[i].bg_block_id))
+		    && xstrcmp(block_name, block_ptr[i].bg_block_id))
 			continue;
 		print_cnt++;
 		slurm_print_block_info(
diff --git a/src/scontrol/info_job.c b/src/scontrol/info_job.c
index 122574a30..1f6e8cf88 100644
--- a/src/scontrol/info_job.c
+++ b/src/scontrol/info_job.c
@@ -1032,30 +1032,3 @@ extern int scontrol_callerid(int argc, char **argv)
 		return SLURM_SUCCESS;
 	}
 }
-
-/*
- * scontrol_print_sicp - print the inter-cluster job information
- */
-extern void
-scontrol_print_sicp (void)
-{
-	int error_code = SLURM_SUCCESS, i;
-	sicp_info_msg_t * sicp_buffer_ptr = NULL;
-	sicp_info_t *sicp_ptr = NULL;
-
-	error_code = slurm_load_sicp(&sicp_buffer_ptr);
-	if (error_code) {
-		exit_code = 1;
-		if (quiet_flag != 1)
-			slurm_perror ("slurm_load_sicp error");
-		return;
-	}
-
-	for (i = 0, sicp_ptr = sicp_buffer_ptr->sicp_array;
-	     i < sicp_buffer_ptr->record_count; i++, sicp_ptr++) {
-		info("JobID=%u State=%s", sicp_ptr->job_id,
-		     job_state_string(sicp_ptr->job_state));
-	}
-
-	slurm_free_sicp_msg(sicp_buffer_ptr);
-}
diff --git a/src/scontrol/info_layout.c b/src/scontrol/info_layout.c
index 37510adf5..61bbcd184 100644
--- a/src/scontrol/info_layout.c
+++ b/src/scontrol/info_layout.c
@@ -47,7 +47,7 @@ scontrol_print_layout (int argc, char *argv[])
 	int i = 0, tag_len = 0;
 	char *tag = NULL, *val = NULL;
 	char *layout_type = NULL, *entities = NULL, *type = NULL;
-	uint32_t no_relation = 0;
+	uint32_t flags = 0;
 	layout_info_msg_t *layout_info_ptr = NULL;
 
 	while (i < argc) {
@@ -71,7 +71,7 @@ scontrol_print_layout (int argc, char *argv[])
 		} else if (strncasecmp (tag, "type", MAX(tag_len, 3)) == 0) {
 			type = val;
 		} else if (strncasecmp (tag, "nolayout", MAX(tag_len, 4)) == 0){
-			no_relation = 1;
+			flags |= LAYOUTS_DUMP_NOLAYOUT;
 		} else {
 			exit_code = 1;
 			if (quiet_flag != 1)
@@ -81,10 +81,8 @@ scontrol_print_layout (int argc, char *argv[])
 		}
 		i++;
 	}
-	if (slurm_load_layout (layout_type,
-			       entities, type,
-			       no_relation, &layout_info_ptr)
-					== SLURM_PROTOCOL_SUCCESS) {
+	if (slurm_load_layout (layout_type, entities, type, flags,
+			       &layout_info_ptr) == SLURM_PROTOCOL_SUCCESS) {
 		slurm_print_layout_info ( stdout, layout_info_ptr, one_liner );
 		slurm_free_layout_info_msg (layout_info_ptr);
 	}
diff --git a/src/scontrol/info_lics.c b/src/scontrol/info_lics.c
index a02700201..5bd13e9ad 100644
--- a/src/scontrol/info_lics.c
+++ b/src/scontrol/info_lics.c
@@ -41,6 +41,41 @@
 #include "scontrol.h"
 
 static void _print_license_info(const char *, license_info_msg_t *);
+static slurm_license_info_t ** _license_sort(license_info_msg_t
+					     *license_list);
+static int _lic_cmp(const void *lic1, const void *lic2);
+
+static int _lic_cmp(const void *lic1, const void *lic2)
+{
+	char *name1 = (*((slurm_license_info_t **)lic1))->name;
+	char *name2 = (*((slurm_license_info_t **)lic2))->name;
+	return xstrcmp(name1, name2);
+}
+
+/* license_sort()
+ *
+ * Sort the list of licenses by their name
+ *
+ */
+static slurm_license_info_t ** _license_sort(license_info_msg_t
+					     *license_list)
+{
+	slurm_license_info_t **lic_list_ptr = xmalloc(
+		sizeof(slurm_license_info_t*) * license_list->num_lic);
+	slurm_license_info_t *lic_ptr;
+	int list_cnt;
+
+	// Set tmp array of pointers to each license
+	for (list_cnt = 0, lic_ptr = license_list->lic_array;
+	     list_cnt < license_list->num_lic; list_cnt++, lic_ptr++) {
+		lic_list_ptr[list_cnt] = lic_ptr;
+	}
+
+	qsort(lic_list_ptr, license_list->num_lic,
+	      sizeof(slurm_license_info_t *), _lic_cmp);
+
+	return lic_list_ptr;
+}
 
 /* scontrol_print_licenses()
  *
@@ -88,23 +123,28 @@ scontrol_print_licenses(const char *name)
 static void _print_license_info(const char *name, license_info_msg_t *msg)
 {
 	int cc;
+	slurm_license_info_t **sorted_lic = NULL;
 
 	if (!msg->num_lic) {
 		printf("No licenses configured in Slurm.\n");
 		return;
 	}
 
+	sorted_lic = _license_sort(msg);
+
 	for (cc = 0; cc < msg->num_lic; cc++) {
-		if (name && strcmp(msg->lic_array[cc].name, name))
+		if (name && xstrcmp((sorted_lic[cc])->name, name))
 			continue;
 		printf("LicenseName=%s%sTotal=%d Used=%u Free=%u Remote=%s\n",
-		       msg->lic_array[cc].name,
+		       (sorted_lic[cc])->name,
 		       one_liner ? " " : "\n    ",
-		       msg->lic_array[cc].total,
-		       msg->lic_array[cc].in_use,
-		       msg->lic_array[cc].available,
-		       msg->lic_array[cc].remote ? "yes" : "no");
+		       (sorted_lic[cc])->total,
+		       (sorted_lic[cc])->in_use,
+		       (sorted_lic[cc])->available,
+		       (sorted_lic[cc])->remote ? "yes" : "no");
 		if (name)
 			break;
 	}
+
+	xfree(sorted_lic);
 }
diff --git a/src/scontrol/info_node.c b/src/scontrol/info_node.c
index 3f4f025b3..a9e141da3 100644
--- a/src/scontrol/info_node.c
+++ b/src/scontrol/info_node.c
@@ -93,7 +93,7 @@ scontrol_print_node (char *node_name, node_info_msg_t  * node_buffer_ptr)
 		if (node_name) {
 			i = (j + last_inx) % node_buffer_ptr->record_count;
 			if ((node_buffer_ptr->node_array[i].name == NULL) ||
-			    strcmp (node_name,
+			    xstrcmp (node_name,
 				    node_buffer_ptr->node_array[i].name))
 				continue;
 		} else if (node_buffer_ptr->node_array[j].name == NULL)
@@ -212,7 +212,7 @@ extern void	scontrol_print_topo (char *node_list)
 
 	/* Search for matching switch name */
 	for (i=0; i<topo_info_msg->record_count; i++) {
-		if (strcmp(topo_info_msg->topo_array[i].name, node_list))
+		if (xstrcmp(topo_info_msg->topo_array[i].name, node_list))
 			continue;
 		slurm_print_topo_record(stdout, &topo_info_msg->topo_array[i],
 					one_liner);
@@ -321,8 +321,8 @@ scontrol_print_front_end(char *node_name,
 		if (node_name) {
 			i = (j + last_inx) % front_end_buffer_ptr->record_count;
 			if (!front_end_buffer_ptr->front_end_array[i].name ||
-			    strcmp(node_name, front_end_buffer_ptr->
-					      front_end_array[i].name))
+			    xstrcmp(node_name, front_end_buffer_ptr->
+				    front_end_array[i].name))
 				continue;
 		} else if (front_end_buffer_ptr->front_end_array[j].name == NULL)
 			continue;
diff --git a/src/scontrol/info_part.c b/src/scontrol/info_part.c
index cc72903c7..3a5860013 100644
--- a/src/scontrol/info_part.c
+++ b/src/scontrol/info_part.c
@@ -108,7 +108,7 @@ scontrol_print_part (char *partition_name)
 	part_ptr = part_info_ptr->partition_array;
 	for (i = 0; i < part_info_ptr->record_count; i++) {
 		if (partition_name &&
-		    strcmp (partition_name, part_ptr[i].name) != 0)
+		    xstrcmp (partition_name, part_ptr[i].name) != 0)
 			continue;
 		print_cnt++;
 		slurm_print_partition_info (stdout, & part_ptr[i],
diff --git a/src/scontrol/info_res.c b/src/scontrol/info_res.c
index f7ac66e27..46ce32127 100644
--- a/src/scontrol/info_res.c
+++ b/src/scontrol/info_res.c
@@ -104,7 +104,7 @@ scontrol_print_res (char *reservation_name)
 	res_ptr = res_info_ptr->reservation_array;
 	for (i = 0; i < res_info_ptr->record_count; i++) {
 		if (reservation_name &&
-		    strcmp (reservation_name, res_ptr[i].name) != 0)
+		    xstrcmp (reservation_name, res_ptr[i].name) != 0)
 			continue;
 		print_cnt++;
 		slurm_print_reservation_info (stdout, & res_ptr[i],
diff --git a/src/scontrol/scontrol.c b/src/scontrol/scontrol.c
index 3fce0ce46..f4b3ccd33 100644
--- a/src/scontrol/scontrol.c
+++ b/src/scontrol/scontrol.c
@@ -295,7 +295,7 @@ _get_command (int *argc, char **argv)
 	if (in_line == NULL) {
 		exit_flag = true;
 		return 0;
-	} else if (strcmp (in_line, "!!") == 0) {
+	} else if (xstrcmp (in_line, "!!") == 0) {
 		free (in_line);
 		in_line = last_in_line;
 		in_line_size = last_in_line_size;
@@ -556,8 +556,8 @@ _print_daemons (void)
 
 	gethostname_short(me, MAX_SLURM_NAME);
 	if ((b = conf->backup_controller)) {
-		if ((strcmp(b, me) == 0) ||
-		    (strcasecmp(b, "localhost") == 0))
+		if ((xstrcmp(b, me) == 0) ||
+		    (xstrcasecmp(b, "localhost") == 0))
 			ctld = 1;
 	}
 	if (conf->control_machine) {
@@ -565,8 +565,8 @@ _print_daemons (void)
 		c = xstrdup(conf->control_machine);
 		token = strtok_r(c, ",", &save_ptr);
 		while (token) {
-			if ((strcmp(token, me) == 0) ||
-			    (strcasecmp(token, "localhost") == 0)) {
+			if ((xstrcmp(token, me) == 0) ||
+			    (xstrcasecmp(token, "localhost") == 0)) {
 				ctld = 1;
 				break;
 			}
@@ -651,6 +651,7 @@ static int _reboot_nodes(char *node_list)
 
 	slurm_msg_t_init(&msg);
 
+	bzero(&req, sizeof(reboot_msg_t));
 	req.node_list = node_list;
 	msg.msg_type = REQUEST_REBOOT_NODES;
 	msg.data = &req;
@@ -1005,6 +1006,23 @@ _process_command (int argc, char *argv[])
 			}
 		}
 	}
+	else if (strncasecmp (tag, "top", MAX(tag_len, 2)) == 0) {
+		if (argc < 2) {
+			exit_code = 1;
+			if (quiet_flag != 1)
+				fprintf(stderr,
+					"too few arguments for keyword:%s\n",
+					tag);
+		} else if (argc > 2) {
+			exit_code = 1;
+			if (quiet_flag != 1)
+				fprintf(stderr,
+					"too many arguments for keyword:%s\n",
+					tag);
+		} else {
+			scontrol_top_job(argv[1]);
+		}
+	}
 	else if (strncasecmp (tag, "wait_job", MAX(tag_len, 2)) == 0) {
 		if (cluster_flags & CLUSTER_FLAG_CRAY_A) {
 			fprintf(stderr,
@@ -1108,7 +1126,7 @@ _process_command (int argc, char *argv[])
 				"debug5", NULL};
 			int index = 0;
 			while (levels[index]) {
-				if (strcasecmp(argv[1], levels[index]) == 0) {
+				if (xstrcasecmp(argv[1], levels[index]) == 0) {
 					level = index;
 					break;
 				}
@@ -1159,7 +1177,7 @@ _process_command (int argc, char *argv[])
 				"disable", "enable", NULL};
 			int index = 0;
 			while (levels[index]) {
-				if (strcasecmp(argv[1], levels[index]) == 0) {
+				if (xstrcasecmp(argv[1], levels[index]) == 0) {
 					level = index;
 					break;
 				}
@@ -1203,7 +1221,7 @@ _process_command (int argc, char *argv[])
 			fprintf(stderr,
 				"too few arguments for keyword:%s\n",
 				tag);
-		} else if (strcmp(argv[1], "config")) {
+		} else if (xstrcmp(argv[1], "config")) {
 			exit_code = 1;
 			fprintf (stderr,
 				 "invalid write argument:%s\n",
@@ -1237,8 +1255,8 @@ _process_command (int argc, char *argv[])
 		/* require full command name */
 		uint16_t options = 0;
 		if (argc == 2) {
-			if (strcmp(argv[1], "slurmctld") &&
-			    strcmp(argv[1], "controller")) {
+			if (xstrcmp(argv[1], "slurmctld") &&
+			    xstrcmp(argv[1], "controller")) {
 				error_code = 1;
 				exit_code = 1;
 				fprintf (stderr,
@@ -1561,8 +1579,6 @@ _show_it (int argc, char *argv[])
 	} else if (strncasecmp (tag, "reservations", MAX(tag_len, 1)) == 0 ||
 		   strncasecmp (tag, "reservationname", MAX(tag_len, 1)) == 0) {
 		scontrol_print_res (val);
-	} else if (strncasecmp (tag, "sicp", MAX(tag_len, 2)) == 0) {
-		scontrol_print_sicp ();     /* UNDOCUMENTED TESTING OPTION */
 	} else if (strncasecmp (tag, "slurmd", MAX(tag_len, 2)) == 0) {
 		_print_slurmd (val);
 	} else if (strncasecmp (tag, "steps", MAX(tag_len, 2)) == 0) {
@@ -1963,6 +1979,7 @@ scontrol [<OPTION>] [<COMMAND>]                                            \n\
      shutdown <OPTS>          shutdown slurm daemons                       \n\
 			      (the primary controller will be stopped)     \n\
      suspend <job_list>       susend specified job (see resume)            \n\
+     top <job_id>             Put specified job first in queue for user    \n\
      takeover                 ask slurm backup controller to take over     \n\
      uhold <jobid_list>       place user hold on specified job (see hold)  \n\
      update <SPECIFICATIONS>  update job, node, partition, reservation,    \n\
diff --git a/src/scontrol/scontrol.h b/src/scontrol/scontrol.h
index 3349eaac2..ea77d3b30 100644
--- a/src/scontrol/scontrol.h
+++ b/src/scontrol/scontrol.h
@@ -153,7 +153,6 @@ extern void	scontrol_print_node (char *node_name,
 				     node_info_msg_t *node_info_ptr);
 extern void	scontrol_print_node_list (char *node_list);
 extern void	scontrol_print_part (char *partition_name);
-extern void	scontrol_print_sicp (void);
 extern void	scontrol_print_block (char *block_name);
 extern void	scontrol_print_res (char *reservation_name);
 extern void	scontrol_print_step (char *job_step_id_str);
@@ -163,6 +162,7 @@ extern void	scontrol_print_powercap (char *node_list);
 extern void	scontrol_requeue(char *job_str);
 extern void	scontrol_requeue_hold(uint32_t state_flag, char *job_str);
 extern void	scontrol_suspend(char *op, char *job_id_str);
+extern void	scontrol_top_job(char *job_str);
 extern int	scontrol_update_front_end (int argc, char *argv[]);
 extern int	scontrol_update_job (int argc, char *argv[]);
 extern int	scontrol_update_layout (int argc, char *argv[]);
diff --git a/src/scontrol/update_job.c b/src/scontrol/update_job.c
index 127017194..fa4827394 100644
--- a/src/scontrol/update_job.c
+++ b/src/scontrol/update_job.c
@@ -458,7 +458,7 @@ scontrol_hold(char *op, char *job_str)
 	     i++, job_ptr++) {
 		if (job_name &&
 		    ((job_ptr->name == NULL) ||
-		     strcmp(job_name, job_ptr->name)))
+		     xstrcmp(job_name, job_ptr->name)))
 			continue;
 
 		if (!IS_JOB_PENDING(job_ptr)) {
@@ -682,6 +682,31 @@ scontrol_requeue_hold(uint32_t state_flag, char *job_str)
 	}
 }
 
+/*
+ * scontrol_top_job - Move the specified job ID to the top of the queue for
+ *	a given user ID, partition, account, and QOS.
+ * IN job_str - a job id
+ */
+extern void
+scontrol_top_job(char *job_id_str)
+{
+	int rc;
+
+	if (strncasecmp(job_id_str, "jobid=", 6) == 0)
+		job_id_str += 6;
+	if (strncasecmp(job_id_str, "job=", 4) == 0)
+		job_id_str += 4;
+
+	rc = slurm_top_job(job_id_str);
+	if (rc != SLURM_SUCCESS) {
+		exit_code = 1;
+		if (quiet_flag != 1) {
+			fprintf(stderr, "%s for job %s\n",
+				slurm_strerror(slurm_get_errno()), job_id_str);
+		}
+	}
+}
+
 /*
  * scontrol_update_job - update the slurm job configuration per the supplied
  *	arguments
@@ -866,9 +891,9 @@ scontrol_update_job (int argc, char *argv[])
 		else if ((strncasecmp(tag, "ReqNodes", MAX(taglen, 8)) == 0) ||
 		         (strncasecmp(tag, "NumNodes", MAX(taglen, 8)) == 0)) {
 			int min_nodes, max_nodes, rc;
-			if (strcmp(val, "0") == 0) {
+			if (xstrcmp(val, "0") == 0) {
 				job_msg.min_nodes = 0;
-			} else if (strcasecmp(val, "ALL") == 0) {
+			} else if (xstrcasecmp(val, "ALL") == 0) {
 				job_msg.min_nodes = INFINITE;
 			} else {
 				min_nodes = (int) job_msg.min_nodes;
@@ -997,7 +1022,8 @@ scontrol_update_job (int argc, char *argv[])
 			}
 			update_cnt++;
 		}
-		else if (strncasecmp(tag, "Shared", MAX(taglen, 2)) == 0) {
+		else if (!strncasecmp(tag, "OverSubscribe", MAX(taglen, 2)) ||
+			 !strncasecmp(tag, "Shared", MAX(taglen, 2))) {
 			if (strncasecmp(val, "YES", MAX(vallen, 1)) == 0)
 				job_msg.shared = 1;
 			else if (strncasecmp(val, "NO", MAX(vallen, 1)) == 0)
@@ -1022,7 +1048,7 @@ scontrol_update_job (int argc, char *argv[])
 			update_cnt++;
 		}
 		else if (strncasecmp(tag, "CoreSpec", MAX(taglen, 4)) == 0) {
-			if (!strcmp(val, "-1") || !strcmp(val, "*"))
+			if (!xstrcmp(val, "-1") || !xstrcmp(val, "*"))
 				job_msg.core_spec = (uint16_t) INFINITE;
 			else if (parse_uint16(val, &job_msg.core_spec)) {
 				error ("Invalid CoreSpec value: %s", val);
@@ -1032,7 +1058,7 @@ scontrol_update_job (int argc, char *argv[])
 			update_cnt++;
 		}
 		else if (strncasecmp(tag, "ThreadSpec", MAX(taglen, 4)) == 0) {
-			if (!strcmp(val, "-1") || !strcmp(val, "*"))
+			if (!xstrcmp(val, "-1") || !xstrcmp(val, "*"))
 				job_msg.core_spec = (uint16_t) INFINITE;
 			else if (parse_uint16(val, &job_msg.core_spec)) {
 				error ("Invalid ThreadSpec value: %s", val);
@@ -1057,8 +1083,8 @@ scontrol_update_job (int argc, char *argv[])
 			update_cnt++;
 		}
 		else if (strncasecmp(tag, "Gres", MAX(taglen, 2)) == 0) {
-			if (!strcasecmp(val, "help") ||
-			    !strcasecmp(val, "list")) {
+			if (!xstrcasecmp(val, "help") ||
+			    !xstrcasecmp(val, "list")) {
 				print_gres_help();
 			} else {
 				job_msg.gres = val;
@@ -1173,6 +1199,11 @@ scontrol_update_job (int argc, char *argv[])
 			}
 			job_uid = (uint32_t) user_id;
 		}
+		else if (!strncasecmp(tag, "Deadline", MAX(taglen, 3))) {
+			if ((job_msg.deadline = parse_time(val, 0))) {
+				update_cnt++;
+			}
+		}
 		else {
 			exit_code = 1;
 			fprintf (stderr, "Update of this parameter is not "
@@ -1550,7 +1581,7 @@ static char *_job_name2id(char *job_name, uint32_t job_uid)
 			if ((job_uid != NO_VAL) &&
 			    (job_uid != job_ptr->user_id))
 				continue;
-			if (!job_ptr->name || strcmp(job_name, job_ptr->name))
+			if (!job_ptr->name || xstrcmp(job_name, job_ptr->name))
 				continue;
 			if (job_ptr->array_task_id != NO_VAL) {
 				xstrfmtcat(job_id_str, "%s%u_%u", sep,
diff --git a/src/scontrol/update_node.c b/src/scontrol/update_node.c
index af0a615e1..c57d89cf8 100644
--- a/src/scontrol/update_node.c
+++ b/src/scontrol/update_node.c
@@ -81,7 +81,12 @@ scontrol_update_node (int argc, char *argv[])
 			update_cnt++;
 		} else if (strncasecmp(tag, "NodeName", MAX(tag_len, 1)) == 0) {
 			node_msg.node_names = val;
-		} else if (strncasecmp(tag, "Features", MAX(tag_len, 1)) == 0) {
+		} else if (!strncasecmp(tag, "ActiveFeatures", MAX(tag_len,3))){
+			node_msg.features_act = val;
+			update_cnt++;
+		} else if (!strncasecmp(tag, "Features", MAX(tag_len, 1)) ||
+			   !strncasecmp(tag, "AvailableFeatures",
+					MAX(tag_len,3))) {
 			node_msg.features = val;
 			update_cnt++;
 		} else if (strncasecmp(tag, "Gres", MAX(tag_len, 1)) == 0) {
@@ -99,8 +104,8 @@ scontrol_update_node (int argc, char *argv[])
 			}
 			if ((num == 0 && errno == EINVAL)
         		            || (*endptr != '\0')) {
-				if ((strcasecmp(val, "UNLIMITED") == 0) ||
-				    (strcasecmp(val, "INFINITE")  == 0)) {
+				if ((xstrcasecmp(val, "UNLIMITED") == 0) ||
+				    (xstrcasecmp(val, "INFINITE")  == 0)) {
 					num = (uint32_t) INFINITE;
 				} else {
 					error("Weight value (%s) is not a "
diff --git a/src/scontrol/update_part.c b/src/scontrol/update_part.c
index 43d9fbe43..b5af4ca30 100644
--- a/src/scontrol/update_part.c
+++ b/src/scontrol/update_part.c
@@ -100,8 +100,8 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
 		}
 		else if (strncasecmp(tag, "MaxCPUsPerNode", MAX(taglen, 4))
 			  == 0) {
-			if ((strcasecmp(val,"UNLIMITED") == 0) ||
-			    (strcasecmp(val,"INFINITE") == 0)) {
+			if ((xstrcasecmp(val,"UNLIMITED") == 0) ||
+			    (xstrcasecmp(val,"INFINITE") == 0)) {
 				part_msg_ptr->max_cpus_per_node =
 					(uint32_t) INFINITE;
 			} else if (parse_uint32(val, &part_msg_ptr->
@@ -112,8 +112,8 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
 			(*update_cnt_ptr)++;
 		}
 		else if (strncasecmp(tag, "MaxNodes", MAX(taglen, 4)) == 0) {
-			if ((strcasecmp(val,"UNLIMITED") == 0) ||
-			    (strcasecmp(val,"INFINITE") == 0))
+			if ((xstrcasecmp(val,"UNLIMITED") == 0) ||
+			    (xstrcasecmp(val,"INFINITE") == 0))
 				part_msg_ptr->max_nodes = (uint32_t) INFINITE;
 			else {
 				min = 1;
@@ -227,7 +227,8 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
 			}
 			(*update_cnt_ptr)++;
 		}
-		else if (strncasecmp(tag, "Shared", MAX(taglen, 2)) == 0) {
+		else if (!strncasecmp(tag, "OverSubscribe", MAX(taglen, 2)) ||
+			 !strncasecmp(tag, "Shared", MAX(taglen, 2))) {
 			char *colon_pos = strchr(val, ':');
 			if (colon_pos) {
 				*colon_pos = '\0';
@@ -263,7 +264,7 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
 			} else {
 				exit_code = 1;
 				error("Invalid input: %s", argv[i]);
-				error("Acceptable Shared values are "
+				error("Acceptable OverSubscribe values are "
 					"NO, EXCLUSIVE, YES:#, and FORCE:#");
 				return -1;
 			}
@@ -279,9 +280,27 @@ scontrol_parse_part_options (int argc, char *argv[], int *update_cnt_ptr,
 			}
 			(*update_cnt_ptr)++;
 		}
-		else if (strncasecmp(tag, "Priority", MAX(taglen, 3)) == 0) {
-			if (parse_uint16(val, &part_msg_ptr->priority)) {
-				error ("Invalid Priority value: %s", val);
+		else if (!strncasecmp(tag, "Priority", MAX(taglen, 3))) {
+			if (parse_uint16(val, &part_msg_ptr->priority_tier)) {
+				error("Invalid Priority value: %s", val);
+				return -1;
+			}
+			part_msg_ptr->priority_job_factor =
+				part_msg_ptr->priority_tier;
+			(*update_cnt_ptr)++;
+		}
+		else if (!strncasecmp(tag,"PriorityJobFactor",MAX(taglen, 3))) {
+			if (parse_uint16(val,
+					 &part_msg_ptr->priority_job_factor)) {
+				error("Invalid PriorityJobFactor value: %s",
+				      val);
+				return -1;
+			}
+			(*update_cnt_ptr)++;
+		}
+		else if (!strncasecmp(tag, "PriorityTier", MAX(taglen, 3))) {
+			if (parse_uint16(val, &part_msg_ptr->priority_tier)) {
+				error("Invalid PriorityTier value: %s", val);
 				return -1;
 			}
 			(*update_cnt_ptr)++;
@@ -448,7 +467,7 @@ scontrol_create_part (int argc, char *argv[])
 		exit_code = 1;
 		error("PartitionName must be given.");
 		return 0;
-	} else if (strcasecmp(part_msg.name, "default") == 0) {
+	} else if (xstrcasecmp(part_msg.name, "default") == 0) {
 		exit_code = 1;
 		error("PartitionName cannot be \"DEFAULT\".");
 		return 0;
diff --git a/src/scontrol/update_powercap.c b/src/scontrol/update_powercap.c
index 7b04a47e9..c4e73d888 100644
--- a/src/scontrol/update_powercap.c
+++ b/src/scontrol/update_powercap.c
@@ -42,9 +42,9 @@ static uint32_t _parse_watts(char * watts_str)
 	uint32_t watts_num = 0;
 	char *end_ptr = NULL;
 
-	if (!strcasecmp(watts_str, "n/a") || !strcasecmp(watts_str, "none"))
+	if (!xstrcasecmp(watts_str, "n/a") || !xstrcasecmp(watts_str, "none"))
 		return watts_num;
-	if (!strcasecmp(watts_str, "INFINITE"))
+	if (!xstrcasecmp(watts_str, "INFINITE"))
 		return INFINITE;
 	watts_num = strtol(watts_str, &end_ptr, 10);
 	if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K'))
diff --git a/src/sdiag/Makefile.in b/src/sdiag/Makefile.in
index 39ae5888f..8c054e4c3 100644
--- a/src/sdiag/Makefile.in
+++ b/src/sdiag/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 bin_PROGRAMS = sdiag$(EXEEXT)
 subdir = src/sdiag
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -225,8 +226,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -326,6 +325,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -364,6 +367,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -407,6 +413,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -457,6 +466,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sinfo/Makefile.in b/src/sinfo/Makefile.in
index c76639665..f1f20ac47 100644
--- a/src/sinfo/Makefile.in
+++ b/src/sinfo/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 bin_PROGRAMS = sinfo$(EXEEXT)
 subdir = src/sinfo
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -229,8 +230,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +329,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +371,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +417,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +470,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sinfo/opts.c b/src/sinfo/opts.c
index bd0657d14..96b171c6f 100644
--- a/src/sinfo/opts.c
+++ b/src/sinfo/opts.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Joey Ekstrom <ekstrom1@llnl.gov>, Morris Jette <jette1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -391,7 +391,7 @@ _build_state_list (char *state_str)
 
 	if (state_str == NULL)
 		return NULL;
-	if (strcasecmp (state_str, "all") == 0 )
+	if (xstrcasecmp (state_str, "all") == 0 )
 		return _build_all_states_list ();
 
 	orig = str = xstrdup (state_str);
@@ -578,7 +578,7 @@ _parse_format( char* format )
 	if ((prefix = _get_prefix(format)))
 		format_add_prefix( params.format_list, 0, 0, prefix);
 
-	if (!strcasecmp(format, "%all")) {
+	if (!xstrcasecmp(format, "%all")) {
 		xstrfmtcat(tmp_format, "%c%c", '%', 'a');
 		for (i = 'b'; i <= 'z'; i++)
 			xstrfmtcat(tmp_format, "|%c%c", '%', (char) i);
@@ -605,6 +605,12 @@ _parse_format( char* format )
 					field_size,
 					right_justify,
 					suffix );
+		} else if (field[0] == 'b') {
+			params.match_flags.features_act_flag = true;
+			format_add_features_act( params.format_list,
+					field_size,
+					right_justify,
+					suffix );
 		} else if (field[0] == 'B') {
 			params.match_flags.max_cpus_per_node_flag = true;
 			format_add_max_cpus_per_node( params.format_list,
@@ -634,6 +640,12 @@ _parse_format( char* format )
 					field_size,
 					right_justify,
 					suffix );
+		} else if (field[0] == 'e') {
+			params.match_flags.free_mem_flag = true;
+			format_add_free_mem( params.format_list,
+					field_size,
+					right_justify,
+					suffix );
 		} else if (field[0] == 'E') {
 			params.match_flags.reason_flag = true;
 			format_add_reason( params.format_list,
@@ -664,17 +676,23 @@ _parse_format( char* format )
 					right_justify,
 					suffix );
 		} else if (field[0] == 'h') {
-			params.match_flags.share_flag = true;
-			format_add_share( params.format_list,
-					field_size,
-					right_justify,
-					suffix );
+			params.match_flags.oversubscribe_flag = true;
+			format_add_oversubscribe( params.format_list,
+						  field_size,
+						  right_justify,
+						  suffix );
 		} else if (field[0] == 'H') {
 			params.match_flags.reason_timestamp_flag = true;
 			format_add_timestamp( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
+		} else if (field[0] == 'I') {
+			params.match_flags.priority_job_factor_flag = true;
+			format_add_priority_job_factor(params.format_list,
+					field_size,
+					right_justify,
+					suffix);
 		} else if (field[0] == 'l') {
 			params.match_flags.max_time_flag = true;
 			format_add_time( params.format_list,
@@ -722,18 +740,12 @@ _parse_format( char* format )
 					field_size,
 					right_justify,
 					suffix );
-		} else if (field[0] == 'e') {
-			params.match_flags.free_mem_flag = true;
-			format_add_free_mem( params.format_list,
-					field_size,
-					right_justify,
-					suffix );
 		} else if (field[0] == 'p') {
-			params.match_flags.priority_flag = true;
-			format_add_priority( params.format_list,
+			params.match_flags.priority_tier_flag = true;
+			format_add_priority_tier(params.format_list,
 					field_size,
 					right_justify,
-					suffix );
+					suffix);
 		} else if (field[0] == 'P') {
 			params.match_flags.partition_flag = true;
 			format_add_partition( params.format_list,
@@ -865,238 +877,251 @@ static int _parse_long_format (char* format_long)
 		_parse_long_token( token, sep, &field_size, &right_justify,
 				   &suffix);
 
-		if (!strcasecmp(token, "all")) {
+		if (!xstrcasecmp(token, "all")) {
 			_parse_format ("%all");
-		} else if (!strcasecmp(token, "allocmem")) {
+		} else if (!xstrcasecmp(token, "allocmem")) {
 			params.match_flags.alloc_mem_flag = true;
 			format_add_alloc_mem( params.format_list,
 						field_size,
 						right_justify,
 						suffix );
-		} else if (!strcasecmp(token, "allocnodes")) {
+		} else if (!xstrcasecmp(token, "allocnodes")) {
 			format_add_alloc_nodes( params.format_list,
 						field_size,
 						right_justify,
 						suffix );
-		} else if (!strcasecmp(token, "available")) {
+		} else if (!xstrcasecmp(token, "available")) {
 			params.match_flags.avail_flag = true;
 			format_add_avail( params.format_list,
 					  field_size,
 					  right_justify,
 					  suffix );
-		} else if (!strcasecmp(token, "cpus")) {
+		} else if (!xstrcasecmp(token, "cpus")) {
 			params.match_flags.cpus_flag = true;
 			format_add_cpus( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "cpusload")) {
+		} else if (!xstrcasecmp(token, "cpusload")) {
 			params.match_flags.cpu_load_flag = true;
 			format_add_cpu_load( params.format_list,
 					     field_size,
 					     right_justify,
 					     suffix );
-		} else if (!strcasecmp(token, "freemem")) {
+		} else if (!xstrcasecmp(token, "freemem")) {
 			params.match_flags.free_mem_flag = true;
 			format_add_free_mem( params.format_list,
 					     field_size,
 					     right_justify,
 					     suffix );
-		} else if (!strcasecmp(token, "cpusstate")) {
+		} else if (!xstrcasecmp(token, "cpusstate")) {
 			params.match_flags.cpus_flag = true;
 			format_add_cpus_aiot( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
-		} else if (!strcasecmp(token, "cores")) {
+		} else if (!xstrcasecmp(token, "cores")) {
 			params.match_flags.cores_flag = true;
 			format_add_cores( params.format_list,
 					  field_size,
 					  right_justify,
 					  suffix );
-		} else if (!strcasecmp(token, "defaulttime")) {
+		} else if (!xstrcasecmp(token, "defaulttime")) {
 			params.match_flags.default_time_flag = true;
 			format_add_default_time( params.format_list,
 						 field_size,
 						 right_justify,
 						 suffix );
-		} else if (!strcasecmp(token, "disk")) {
+		} else if (!xstrcasecmp(token, "disk")) {
 			params.match_flags.disk_flag = true;
 			format_add_disk( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "features")) {
+		} else if (!xstrcasecmp(token, "features")) {
 			params.match_flags.features_flag = true;
 			format_add_features( params.format_list,
 					     field_size,
 					     right_justify,
 					     suffix );
-		} else if (!strcasecmp(token, "groups")) {
+		} else if (!xstrcasecmp(token, "features_act")) {
+			params.match_flags.features_act_flag = true;
+			format_add_features_act( params.format_list,
+					field_size,
+					right_justify,
+					suffix );
+		} else if (!xstrcasecmp(token, "groups")) {
 			params.match_flags.groups_flag = true;
 			format_add_groups( params.format_list,
 					   field_size,
 					   right_justify,
 					   suffix );
-		} else if (!strcasecmp(token, "gres")) {
+		} else if (!xstrcasecmp(token, "gres")) {
 			params.match_flags.gres_flag = true;
 			format_add_gres( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "maxcpuspernode")) {
+		} else if (!xstrcasecmp(token, "maxcpuspernode")) {
 			params.match_flags.max_cpus_per_node_flag = true;
 			format_add_max_cpus_per_node( params.format_list,
 						      field_size,
 						      right_justify,
 						      suffix );
-		} else if (!strcasecmp(token, "memory")) {
+		} else if (!xstrcasecmp(token, "memory")) {
 			params.match_flags.memory_flag = true;
 			format_add_memory( params.format_list,
 					   field_size,
 					   right_justify,
 					   suffix );
-		} else if (!strcasecmp(token, "nodes")) {
+		} else if (!xstrcasecmp(token, "nodes")) {
 			format_add_nodes( params.format_list,
 					  field_size,
 					  right_justify,
 					  suffix );
-		} else if (!strcasecmp(token, "nodeaddr")) {
+		} else if (!xstrcasecmp(token, "nodeaddr")) {
 			params.match_flags.node_addr_flag = true;
 			format_add_node_address( params.format_list,
 						 field_size,
 						 right_justify,
 						 suffix );
-		} else if (!strcasecmp(token, "nodeai")) {
+		} else if (!xstrcasecmp(token, "nodeai")) {
 			format_add_nodes_ai( params.format_list,
 					     field_size,
 					     right_justify,
 					     suffix );
-		} else if (!strcasecmp(token, "nodeaiot")) {
+		} else if (!xstrcasecmp(token, "nodeaiot")) {
 			format_add_nodes_aiot( params.format_list,
 					       field_size,
 					       right_justify,
 					       suffix );
-		} else if (!strcasecmp(token, "nodehost")) {
+		} else if (!xstrcasecmp(token, "nodehost")) {
 			params.match_flags.hostnames_flag = true;
 			format_add_node_hostnames( params.format_list,
 						   field_size,
 						   right_justify,
 						   suffix );
-		} else if (!strcasecmp(token, "nodelist")) {
+		} else if (!xstrcasecmp(token, "nodelist")) {
 			format_add_node_list( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
-		} else if (!strcasecmp(token, "partition")) {
+		} else if (!xstrcasecmp(token, "partition")) {
 			params.match_flags.partition_flag = true;
 			format_add_partition( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
-		} else if (!strcasecmp(token, "partitionname")) {
+		} else if (!xstrcasecmp(token, "partitionname")) {
 			params.match_flags.partition_flag = true;
 			format_add_partition_name( params.format_list,
 						   field_size,
 						   right_justify,
 						   suffix );
-		} else if (!strcasecmp(token, "preemptmode")) {
+		} else if (!xstrcasecmp(token, "preemptmode")) {
 			params.match_flags.preempt_mode_flag = true;
 			format_add_preempt_mode( params.format_list,
 						 field_size,
 						 right_justify,
 						 suffix );
-		} else if (!strcasecmp(token, "priority")) {
-			params.match_flags.priority_flag = true;
-			format_add_priority( params.format_list,
-					     field_size,
-					     right_justify,
-					     suffix );
-		} else if (!strcasecmp(token, "reason")) {
+		} else if (!xstrcasecmp(token, "priorityjobfactor")) {
+			params.match_flags.priority_job_factor_flag = true;
+			format_add_priority_job_factor(params.format_list,
+						       field_size,
+						       right_justify,
+						       suffix );
+		} else if (!xstrcasecmp(token, "prioritytier")) {
+			params.match_flags.priority_tier_flag = true;
+			format_add_priority_tier(params.format_list,
+						 field_size,
+						 right_justify,
+						 suffix );
+		} else if (!xstrcasecmp(token, "reason")) {
 			params.match_flags.reason_flag = true;
 			format_add_reason( params.format_list,
 					   field_size,
 					   right_justify,
 					   suffix );
-		} else if (!strcasecmp(token, "root")) {
+		} else if (!xstrcasecmp(token, "root")) {
 			params.match_flags.root_flag = true;
 			format_add_root( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "share")) {
-			params.match_flags.share_flag = true;
-			format_add_share( params.format_list,
-					  field_size,
-					  right_justify,
-					  suffix );
-		} else if (!strcasecmp(token, "size")) {
+		} else if (!xstrcasecmp(token, "oversubscribe") ||
+			   !xstrcasecmp(token, "share")) {
+			params.match_flags.oversubscribe_flag = true;
+			format_add_oversubscribe( params.format_list,
+						  field_size,
+						  right_justify,
+						  suffix );
+		} else if (!xstrcasecmp(token, "size")) {
 			params.match_flags.job_size_flag = true;
 			format_add_size( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "statecompact")) {
+		} else if (!xstrcasecmp(token, "statecompact")) {
 			params.match_flags.state_flag = true;
 			format_add_state_compact( params.format_list,
 						  field_size,
 						  right_justify,
 						  suffix );
-		} else if (!strcasecmp(token, "statelong")) {
+		} else if (!xstrcasecmp(token, "statelong")) {
 			params.match_flags.state_flag = true;
 			format_add_state_long( params.format_list,
 					       field_size,
 					       right_justify,
 					       suffix );
-		} else if (!strcasecmp(token, "sockets")) {
+		} else if (!xstrcasecmp(token, "sockets")) {
 			params.match_flags.sockets_flag = true;
 			format_add_sockets( params.format_list,
 					    field_size,
 					    right_justify,
 					    suffix );
-		} else if (!strcasecmp(token, "socketcorethread")) {
+		} else if (!xstrcasecmp(token, "socketcorethread")) {
 			params.match_flags.sct_flag = true;
 			format_add_sct( params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-		} else if (!strcasecmp(token, "time")) {
+		} else if (!xstrcasecmp(token, "time")) {
 			params.match_flags.max_time_flag = true;
 			format_add_time( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "timestamp")) {
+		} else if (!xstrcasecmp(token, "timestamp")) {
 			params.match_flags.reason_timestamp_flag = true;
 			format_add_timestamp( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
-		} else if (!strcasecmp(token, "threads")) {
+		} else if (!xstrcasecmp(token, "threads")) {
 			params.match_flags.threads_flag = true;
 			format_add_threads( params.format_list,
 					    field_size,
 					    right_justify,
 					    suffix );
-		} else if (!strcasecmp(token, "user")) {
+		} else if (!xstrcasecmp(token, "user")) {
 			params.match_flags.reason_user_flag = true;
 			format_add_user( params.format_list,
 					 field_size,
 					 right_justify,
 					 suffix );
-		} else if (!strcasecmp(token, "userlong")) {
+		} else if (!xstrcasecmp(token, "userlong")) {
 			params.match_flags.reason_user_flag = true;
 			format_add_user_long( params.format_list,
 					      field_size,
 					      right_justify,
 					      suffix );
-		} else if (!strcasecmp(token, "version")) {
+		} else if (!xstrcasecmp(token, "version")) {
 			params.match_flags.version_flag = true;
 			format_add_version( params.format_list,
 					    field_size,
 					    right_justify,
 					    suffix);
-		} else if (!strcasecmp(token, "weight")) {
+		} else if (!xstrcasecmp(token, "weight")) {
 			params.match_flags.weight_flag = true;
 			format_add_weight( params.format_list,
 					   field_size,
@@ -1236,6 +1261,8 @@ void _print_options( void )
 			"true" : "false");
 	printf("features_flag   = %s\n", params.match_flags.features_flag ?
 			"true" : "false");
+	printf("features_flag_act = %s\n", params.match_flags.features_act_flag?
+			"true" : "false");
 	printf("groups_flag     = %s\n", params.match_flags.groups_flag ?
 					"true" : "false");
 	printf("gres_flag       = %s\n", params.match_flags.gres_flag ?
@@ -1248,19 +1275,25 @@ void _print_options( void )
 			"true" : "false");
 	printf("partition_flag  = %s\n", params.match_flags.partition_flag ?
 			"true" : "false");
-	printf("priority_flag   = %s\n", params.match_flags.priority_flag ?
+	printf("priority_job_factor_flag   = %s\n",
+			params.match_flags.priority_job_factor_flag ?
+			"true" : "false");
+	printf("priority_tier_flag   = %s\n",
+			params.match_flags.priority_tier_flag ?
 			"true" : "false");
 	printf("reason_flag     = %s\n", params.match_flags.reason_flag ?
 			"true" : "false");
 	printf("reason_timestamp_flag = %s\n",
-			params.match_flags.reason_timestamp_flag ?  "true" : "false");
+			params.match_flags.reason_timestamp_flag ?
+			"true" : "false");
 	printf("reason_user_flag = %s\n",
 			params.match_flags.reason_user_flag ?  "true" : "false");
 	printf("reservation_flag = %s\n", params.reservation_flag ?
 			"true" : "false");
 	printf("root_flag       = %s\n", params.match_flags.root_flag ?
 			"true" : "false");
-	printf("share_flag      = %s\n", params.match_flags.share_flag ?
+	printf("oversubscribe_flag      = %s\n",
+			params.match_flags.oversubscribe_flag ?
 			"true" : "false");
 	printf("state_flag      = %s\n", params.match_flags.state_flag ?
 			"true" : "false");
diff --git a/src/sinfo/print.c b/src/sinfo/print.c
index b9e05f838..117151d16 100644
--- a/src/sinfo/print.c
+++ b/src/sinfo/print.c
@@ -243,9 +243,9 @@ _build_min_max_16_string(char *buffer, int buf_size, uint16_t min, uint16_t max,
 	char tmp_min[8];
 	char tmp_max[8];
 	convert_num_unit((float)min, tmp_min, sizeof(tmp_min), UNIT_NONE,
-			 params.convert_flags);
+			 NO_VAL, params.convert_flags);
 	convert_num_unit((float)max, tmp_max, sizeof(tmp_max), UNIT_NONE,
-			 params.convert_flags);
+			 NO_VAL, params.convert_flags);
 
 	if (max == min)
 		return snprintf(buffer, buf_size, "%s", tmp_max);
@@ -270,9 +270,9 @@ _build_min_max_32_string(char *buffer, int buf_size,
 
 	if (use_suffix) {
 		convert_num_unit((float)min, tmp_min, sizeof(tmp_min),
-				 UNIT_NONE, params.convert_flags);
+				 UNIT_NONE, NO_VAL, params.convert_flags);
 		convert_num_unit((float)max, tmp_max, sizeof(tmp_max),
-				 UNIT_NONE, params.convert_flags);
+				 UNIT_NONE, NO_VAL, params.convert_flags);
 	} else {
 		snprintf(tmp_min, sizeof(tmp_min), "%u", min);
 		snprintf(tmp_max, sizeof(tmp_max), "%u", max);
@@ -478,16 +478,16 @@ int _print_cpus_aiot(sinfo_data_t * sinfo_data, int width,
 	if (sinfo_data) {
 		if (params.cluster_flags & CLUSTER_FLAG_BG) {
 			convert_num_unit((float)sinfo_data->cpus_alloc,
-					 tmpa, sizeof(tmpa), UNIT_NONE,
+					 tmpa, sizeof(tmpa), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->cpus_idle,
-					 tmpi, sizeof(tmpi), UNIT_NONE,
+					 tmpi, sizeof(tmpi), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->cpus_other,
-					 tmpo, sizeof(tmpo), UNIT_NONE,
+					 tmpo, sizeof(tmpo), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->cpus_total,
-					 tmpt, sizeof(tmpt), UNIT_NONE,
+					 tmpt, sizeof(tmpt), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		} else {
 			snprintf(tmpa, sizeof(tmpa), "%u",
@@ -620,7 +620,20 @@ int _print_features(sinfo_data_t * sinfo_data, int width,
 	if (sinfo_data)
 		_print_str(sinfo_data->features, width, right_justify, true);
 	else
-		_print_str("FEATURES", width, right_justify, true);
+		_print_str("AVAIL_FEATURES", width, right_justify, true);
+
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
+
+int _print_features_act(sinfo_data_t * sinfo_data, int width,
+			bool right_justify, char *suffix)
+{
+	if (sinfo_data)
+		_print_str(sinfo_data->features_act, width, right_justify, true);
+	else
+		_print_str("ACTIVE_FEATURES", width, right_justify, true);
 
 	if (suffix)
 		printf("%s", suffix);
@@ -770,7 +783,7 @@ int _print_nodes_t(sinfo_data_t * sinfo_data, int width,
 	if (sinfo_data) {
 		if (params.cluster_flags & CLUSTER_FLAG_BG)
 			convert_num_unit((float)sinfo_data->nodes_total,
-					 tmp, sizeof(tmp), UNIT_NONE,
+					 tmp, sizeof(tmp), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		else
 			snprintf(tmp, sizeof(tmp), "%d",
@@ -794,10 +807,10 @@ int _print_nodes_ai(sinfo_data_t * sinfo_data, int width,
 	if (sinfo_data) {
 		if (params.cluster_flags & CLUSTER_FLAG_BG) {
 			convert_num_unit((float)sinfo_data->nodes_alloc,
-					 tmpa, sizeof(tmpa), UNIT_NONE,
+					 tmpa, sizeof(tmpa), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->nodes_idle,
-					 tmpi, sizeof(tmpi), UNIT_NONE,
+					 tmpi, sizeof(tmpi), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		} else {
 			snprintf(tmpa, sizeof(tmpa), "%d",
@@ -827,16 +840,16 @@ int _print_nodes_aiot(sinfo_data_t * sinfo_data, int width,
 	if (sinfo_data) {
 		if (params.cluster_flags & CLUSTER_FLAG_BG) {
 			convert_num_unit((float)sinfo_data->nodes_alloc,
-					 tmpa, sizeof(tmpa), UNIT_NONE,
+					 tmpa, sizeof(tmpa), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->nodes_idle,
-					 tmpi, sizeof(tmpi), UNIT_NONE,
+					 tmpi, sizeof(tmpi), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->nodes_other,
-					 tmpo, sizeof(tmpo), UNIT_NONE,
+					 tmpo, sizeof(tmpo), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 			convert_num_unit((float)sinfo_data->nodes_total,
-					 tmpt, sizeof(tmpt), UNIT_NONE,
+					 tmpt, sizeof(tmpt), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		} else {
 			snprintf(tmpa, sizeof(tmpa), "%u",
@@ -932,18 +945,38 @@ int _print_preempt_mode(sinfo_data_t * sinfo_data, int width,
 	return SLURM_SUCCESS;
 }
 
-int _print_priority(sinfo_data_t * sinfo_data, int width,
-			bool right_justify, char *suffix)
+int _print_priority_job_factor(sinfo_data_t * sinfo_data, int width,
+			       bool right_justify, char *suffix)
 {
 	char id[FORMAT_STRING_SIZE];
 
 	if (sinfo_data) {
 		_build_min_max_16_string(id, FORMAT_STRING_SIZE,
-				      sinfo_data->part_info->priority,
-				      sinfo_data->part_info->priority, true);
+				sinfo_data->part_info->priority_job_factor,
+				sinfo_data->part_info->priority_job_factor,
+				true);
 		_print_str(id, width, right_justify, true);
 	} else
-		_print_str("PRIORITY", width, right_justify, true);
+		_print_str("PRIO_JOB_FACTOR", width, right_justify, true);
+
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
+
+int _print_priority_tier(sinfo_data_t * sinfo_data, int width,
+			 bool right_justify, char *suffix)
+{
+	char id[FORMAT_STRING_SIZE];
+
+	if (sinfo_data) {
+		_build_min_max_16_string(id, FORMAT_STRING_SIZE,
+				sinfo_data->part_info->priority_tier,
+				sinfo_data->part_info->priority_tier,
+				true);
+		_print_str(id, width, right_justify, true);
+	} else
+		_print_str("PRIO_TIER", width, right_justify, true);
 
 	if (suffix)
 		printf("%s", suffix);
@@ -955,7 +988,7 @@ int _print_reason(sinfo_data_t * sinfo_data, int width,
 {
 	if (sinfo_data) {
 		char * reason = sinfo_data->reason ? sinfo_data->reason:"none";
-		if (strncmp(reason, "(null)", 6) == 0)
+		if (xstrncmp(reason, "(null)", 6) == 0)
 			reason = "none";
 		_print_str(reason, width, right_justify, true);
 	} else
@@ -984,8 +1017,8 @@ int _print_root(sinfo_data_t * sinfo_data, int width,
 	return SLURM_SUCCESS;
 }
 
-int _print_share(sinfo_data_t * sinfo_data, int width,
-			bool right_justify, char *suffix)
+int _print_oversubscribe(sinfo_data_t * sinfo_data, int width,
+			 bool right_justify, char *suffix)
 {
 	char id[FORMAT_STRING_SIZE];
 
@@ -1002,7 +1035,7 @@ int _print_share(sinfo_data_t * sinfo_data, int width,
 			snprintf(id, sizeof(id), "YES:%u", val);
 		_print_str(id, width, right_justify, true);
 	} else
-		_print_str("SHARE", width, right_justify, true);
+		_print_str("OVERSUBSCRIBE", width, right_justify, true);
 
 	if (suffix)
 		printf("%s", suffix);
diff --git a/src/sinfo/print.h b/src/sinfo/print.h
index 2100c834c..e91fe4dcb 100644
--- a/src/sinfo/print.h
+++ b/src/sinfo/print.h
@@ -88,6 +88,8 @@ void print_sinfo_reservation(reserve_info_msg_t *resv_ptr);
 	format_add_function(list,wid,right,suffix,_print_disk)
 #define format_add_features(list,wid,right,suffix) \
 	format_add_function(list,wid,right,suffix,_print_features)
+#define format_add_features_act(list,wid,right,suffix) \
+	format_add_function(list,wid,right,suffix,_print_features_act)
 #define format_add_groups(list,wid,right,suffix) \
 	format_add_function(list,wid,right,suffix,_print_groups)
 #define format_add_gres(list,wid,right,suffix) \
@@ -114,14 +116,16 @@ void print_sinfo_reservation(reserve_info_msg_t *resv_ptr);
 	format_add_function(list,wid,right,suffix,_print_prefix)
 #define format_add_preempt_mode(list,wid,right,suffix) \
 	format_add_function(list,wid,right,suffix,_print_preempt_mode)
-#define format_add_priority(list,wid,right,suffix) \
-	format_add_function(list,wid,right,suffix,_print_priority)
+#define format_add_priority_job_factor(list,wid,right,suffix) \
+	format_add_function(list,wid,right,suffix,_print_priority_job_factor)
+#define format_add_priority_tier(list,wid,right,suffix) \
+	format_add_function(list,wid,right,suffix,_print_priority_tier)
 #define format_add_reason(list,wid,right,suffix) \
 	format_add_function(list,wid,right,suffix,_print_reason)
 #define format_add_root(list,wid,right,prefix) \
 	format_add_function(list,wid,right,prefix,_print_root)
-#define format_add_share(list,wid,right,suffix) \
-	format_add_function(list,wid,right,suffix,_print_share)
+#define format_add_oversubscribe(list,wid,right,suffix) \
+	format_add_function(list,wid,right,suffix,_print_oversubscribe)
 #define format_add_size(list,wid,right,suffix) \
 	format_add_function(list,wid,right,suffix,_print_size)
 #define format_add_state_compact(list,wid,right,suffix) \
@@ -177,6 +181,8 @@ int _print_disk(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_features(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
+int _print_features_act(sinfo_data_t * sinfo_data, int width,
+			bool right_justify, char *suffix);
 int _print_groups(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_gres(sinfo_data_t * sinfo_data, int width,
@@ -195,6 +201,8 @@ int _print_nodes_ai(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_nodes_aiot(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
+int _print_oversubscribe(sinfo_data_t * sinfo_data, int width,
+			bool right_justify, char *suffix);
 int _print_partition(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_partition_name(sinfo_data_t * sinfo_data, int width,
@@ -203,14 +211,14 @@ int _print_prefix(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_preempt_mode(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
-int _print_priority(sinfo_data_t * sinfo_data, int width,
+int _print_priority_job_factor(sinfo_data_t * sinfo_data, int width,
+			bool right_justify, char *suffix);
+int _print_priority_tier(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_reason(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_root(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
-int _print_share(sinfo_data_t * sinfo_data, int width,
-			bool right_justify, char *suffix);
 int _print_size(sinfo_data_t * sinfo_data, int width,
 			bool right_justify, char *suffix);
 int _print_state_compact(sinfo_data_t * sinfo_data, int width,
diff --git a/src/sinfo/sinfo.c b/src/sinfo/sinfo.c
index b3a7a40a2..dbcfbdd0d 100644
--- a/src/sinfo/sinfo.c
+++ b/src/sinfo/sinfo.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2011 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Joey Ekstrom <ekstrom1@llnl.gov>, Morris Jette <jette1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -754,6 +754,11 @@ static bool _match_node_data(sinfo_data_t *sinfo_ptr, node_info_t *node_ptr)
 	    (xstrcmp(node_ptr->features, sinfo_ptr->features)))
 		return false;
 
+	if (sinfo_ptr->nodes &&
+	    params.match_flags.features_act_flag &&
+	    (xstrcmp(node_ptr->features_act, sinfo_ptr->features_act)))
+		return false;
+
 	if (sinfo_ptr->nodes &&
 	    params.match_flags.gres_flag &&
 	    (xstrcmp(node_ptr->gres, sinfo_ptr->gres)))
@@ -892,7 +897,7 @@ static bool _match_part_data(sinfo_data_t *sinfo_ptr,
 	     (sinfo_ptr->part_info->flags & PART_FLAG_ROOT_ONLY)))
 		return false;
 
-	if (params.match_flags.share_flag &&
+	if (params.match_flags.oversubscribe_flag &&
 	    (part_ptr->max_share != sinfo_ptr->part_info->max_share))
 		return false;
 
@@ -900,8 +905,13 @@ static bool _match_part_data(sinfo_data_t *sinfo_ptr,
 	    (part_ptr->preempt_mode != sinfo_ptr->part_info->preempt_mode))
 		return false;
 
-	if (params.match_flags.priority_flag &&
-	    (part_ptr->priority != sinfo_ptr->part_info->priority))
+	if (params.match_flags.priority_tier_flag &&
+	    (part_ptr->priority_tier != sinfo_ptr->part_info->priority_tier))
+		return false;
+
+	if (params.match_flags.priority_job_factor_flag &&
+	    (part_ptr->priority_job_factor !=
+	     sinfo_ptr->part_info->priority_job_factor))
 		return false;
 
 	if (params.match_flags.max_cpus_per_node_flag &&
@@ -927,6 +937,7 @@ static void _update_sinfo(sinfo_data_t *sinfo_ptr, node_info_t *node_ptr,
 	if (sinfo_ptr->nodes_total == 0) {	/* first node added */
 		sinfo_ptr->node_state = node_ptr->node_state;
 		sinfo_ptr->features   = node_ptr->features;
+		sinfo_ptr->features_act = node_ptr->features_act;
 		sinfo_ptr->gres       = node_ptr->gres;
 		sinfo_ptr->reason     = node_ptr->reason;
 		sinfo_ptr->reason_time= node_ptr->reason_time;
@@ -1250,7 +1261,7 @@ static void _sinfo_list_delete(void *data)
 /* Find the given partition name in the list */
 static int _find_part_list(void *x, void *key)
 {
-	if (!strcmp((char *)x, (char *)key))
+	if (!xstrcmp((char *)x, (char *)key))
 		return 1;
 	return 0;
 }
diff --git a/src/sinfo/sinfo.h b/src/sinfo/sinfo.h
index 5652fe1ea..3c8f685d2 100644
--- a/src/sinfo/sinfo.h
+++ b/src/sinfo/sinfo.h
@@ -108,6 +108,7 @@ typedef struct {
 
 	char *version;
 	char *features;
+	char *features_act;
 	char *gres;
 	char *reason;
 	time_t reason_time;
@@ -119,7 +120,7 @@ typedef struct {
 	hostlist_t ionodes;
 
 	/* part_info contains partition, avail, max_time, job_size,
-	 * root, share, groups, priority */
+	 * root, share/oversubscribe, groups, priority */
 	partition_info_t* part_info;
 	uint16_t part_inx;
 } sinfo_data_t;
@@ -136,6 +137,7 @@ struct sinfo_match_flags {
 	bool sct_flag;
 	bool disk_flag;
 	bool features_flag;
+	bool features_act_flag;
 	bool groups_flag;
 	bool gres_flag;
 	bool hostnames_flag;
@@ -146,10 +148,11 @@ struct sinfo_match_flags {
 	bool node_addr_flag;
 	bool partition_flag;
 	bool preempt_mode_flag;
-	bool priority_flag;
+	bool priority_job_factor_flag;
+	bool priority_tier_flag;
 	bool reason_flag;
 	bool root_flag;
-	bool share_flag;
+	bool oversubscribe_flag;
 	bool state_flag;
 	bool weight_flag;
 	bool reason_timestamp_flag;
diff --git a/src/sinfo/sort.c b/src/sinfo/sort.c
index 12ca54ad7..e10798f1c 100644
--- a/src/sinfo/sort.c
+++ b/src/sinfo/sort.c
@@ -62,6 +62,7 @@ static int _sort_by_cores(void *void1, void *void2);
 static int _sort_by_threads(void *void1, void *void2);
 static int _sort_by_disk(void *void1, void *void2);
 static int _sort_by_features(void *void1, void *void2);
+static int _sort_by_features_act(void *void1, void *void2);
 static int _sort_by_groups(void *void1, void *void2);
 static int _sort_by_hostnames(void *void1, void *void2);
 static int _sort_by_job_size(void *void1, void *void2);
@@ -71,14 +72,15 @@ static int _sort_by_node_list(void *void1, void *void2);
 static int _sort_by_node_addr(void *void1, void *void2);
 static int _sort_by_nodes_ai(void *void1, void *void2);
 static int _sort_by_nodes(void *void1, void *void2);
+static int _sort_by_oversubscribe(void *void1, void *void2);
 static int _sort_by_partition(void *void1, void *void2);
 static int _sort_by_preempt_mode(void *void1, void *void2);
-static int _sort_by_priority(void *void1, void *void2);
+static int _sort_by_priority_job_factor(void *void1, void *void2);
+static int _sort_by_priority_tier(void *void1, void *void2);
 static int _sort_by_reason(void *void1, void *void2);
 static int _sort_by_reason_time(void *void1, void *void2);
 static int _sort_by_reason_user(void *void1, void *void2);
 static int _sort_by_root(void *void1, void *void2);
-static int _sort_by_share(void *void1, void *void2);
 static int _sort_by_state(void *void1, void *void2);
 static int _sort_by_weight(void *void1, void *void2);
 
@@ -112,6 +114,8 @@ void sort_sinfo_list(List sinfo_list)
 			list_sort(sinfo_list, _sort_by_avail);
 		else if (params.sort[i] == 'A')
 			list_sort(sinfo_list, _sort_by_nodes_ai);
+		else if (params.sort[i] == 'b')
+			list_sort(sinfo_list, _sort_by_features_act);
 		else if (params.sort[i] == 'c')
 			list_sort(sinfo_list, _sort_by_cpus);
 		else if (params.sort[i] == 'd')
@@ -127,7 +131,7 @@ void sort_sinfo_list(List sinfo_list)
 		else if (params.sort[i] == 'g')
 			list_sort(sinfo_list, _sort_by_groups);
 		else if (params.sort[i] == 'h')
-			list_sort(sinfo_list, _sort_by_share);
+			list_sort(sinfo_list, _sort_by_oversubscribe);
 		else if (params.sort[i] == 'H')
 			list_sort(sinfo_list, _sort_by_reason_time);
 		else if (params.sort[i] == 'l')
@@ -147,7 +151,7 @@ void sort_sinfo_list(List sinfo_list)
 		else if (params.sort[i] == 'e')
 			list_sort(sinfo_list, _sort_by_free_mem);
 		else if (params.sort[i] == 'p')
-			list_sort(sinfo_list, _sort_by_priority);
+			list_sort(sinfo_list, _sort_by_priority_tier);
 		else if (params.sort[i] == 'P')
 			list_sort(sinfo_list, _sort_by_partition);
 		else if (params.sort[i] == 'r')
@@ -156,6 +160,8 @@ void sort_sinfo_list(List sinfo_list)
 			list_sort(sinfo_list, _sort_by_partition);
 		else if (params.sort[i] == 's')
 			list_sort(sinfo_list, _sort_by_job_size);
+		else if (params.sort[i] == 'S')
+			list_sort(sinfo_list, _sort_by_priority_job_factor);
 		else if (params.sort[i] == 't')
 			list_sort(sinfo_list, _sort_by_state);
 		else if (params.sort[i] == 'T')
@@ -358,7 +364,27 @@ static int _sort_by_features(void *void1, void *void2)
 		val1 = sinfo1->features;
 	if (sinfo2->features)
 		val2 = sinfo2->features;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
+
+	if (reverse_order)
+		diff = -diff;
+	return diff;
+}
+
+static int _sort_by_features_act(void *void1, void *void2)
+{
+	int diff;
+	sinfo_data_t *sinfo1;
+	sinfo_data_t *sinfo2;
+	char *val1 = "", *val2 = "";
+
+	_get_sinfo_from_void(&sinfo1, &sinfo2, void1, void2);
+
+	if (sinfo1->features_act)
+		val1 = sinfo1->features_act;
+	if (sinfo2->features_act)
+		val2 = sinfo2->features_act;
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -378,7 +404,7 @@ static int _sort_by_groups(void *void1, void *void2)
 		val1 = sinfo1->part_info->allow_groups;
 	if (sinfo2->part_info && sinfo2->part_info->allow_groups)
 		val2 = sinfo2->part_info->allow_groups;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -412,7 +438,7 @@ static int _sort_by_node_addr(void *void1, void *void2)
 		val2 = "";
 
 #if	PURE_ALPHA_SORT
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 #else
 	for (inx=0; ; inx++) {
 		if (val1[inx] == val2[inx]) {
@@ -427,7 +453,7 @@ static int _sort_by_node_addr(void *void1, void *void2)
 			num2 = atoi(val2+inx);
 			diff = num1 - num2;
 		} else
-			diff = strcmp(val1, val2);
+			diff = xstrcmp(val1, val2);
 		break;
 	}
 #endif
@@ -469,7 +495,7 @@ static int _sort_by_hostnames(void *void1, void *void2)
 		val2 = "";
 
 #if	PURE_ALPHA_SORT
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 #else
 	for (inx=0; ; inx++) {
 		if (val1[inx] == val2[inx]) {
@@ -484,7 +510,7 @@ static int _sort_by_hostnames(void *void1, void *void2)
 			num2 = atoi(val2+inx);
 			diff = num1 - num2;
 		} else
-			diff = strcmp(val1, val2);
+			diff = xstrcmp(val1, val2);
 		break;
 	}
 #endif
@@ -587,7 +613,7 @@ static int _sort_by_node_list(void *void1, void *void2)
 		val2 = "";
 
 #if	PURE_ALPHA_SORT
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 #else
 	for (inx=0; ; inx++) {
 		if (val1[inx] == val2[inx]) {
@@ -602,7 +628,7 @@ static int _sort_by_node_list(void *void1, void *void2)
 			num2 = atoi(val2+inx);
 			diff = num1 - num2;
 		} else
-			diff = strcmp(val1, val2);
+			diff = xstrcmp(val1, val2);
 		break;
 	}
 #endif
@@ -663,7 +689,7 @@ static int _sort_by_partition(void *void1, void *void2)
 			val1 = sinfo1->part_info->name;
 		if (sinfo2->part_info && sinfo2->part_info->name)
 			val2 = sinfo2->part_info->name;
-		diff = strcmp(val1, val2);
+		diff = xstrcmp(val1, val2);
 	}
 
 	if (reverse_order)
@@ -684,7 +710,7 @@ static int _sort_by_reason(void *void1, void *void2)
 		val1 = sinfo1->reason;
 	if (sinfo2->reason)
 		val2 = sinfo2->reason;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -751,7 +777,7 @@ static int _sort_by_root(void *void1, void *void2)
 	return diff;
 }
 
-static int _sort_by_share(void *void1, void *void2)
+static int _sort_by_oversubscribe(void *void1, void *void2)
 {
 	int diff;
 	sinfo_data_t *sinfo1;
@@ -791,7 +817,27 @@ static int _sort_by_preempt_mode(void *void1, void *void2)
 	return diff;
 }
 
-static int _sort_by_priority(void *void1, void *void2)
+static int _sort_by_priority_job_factor(void *void1, void *void2)
+{
+	int diff;
+	sinfo_data_t *sinfo1;
+	sinfo_data_t *sinfo2;
+	uint32_t val1 = 0, val2 = 0;
+
+	_get_sinfo_from_void(&sinfo1, &sinfo2, void1, void2);
+
+	if (sinfo1->part_info)
+		val1 = sinfo1->part_info->priority_job_factor;
+	if (sinfo2->part_info)
+		val2 = sinfo2->part_info->priority_job_factor;
+	diff = _diff_uint32(val1, val2);
+
+	if (reverse_order)
+		diff = -diff;
+	return diff;
+}
+
+static int _sort_by_priority_tier(void *void1, void *void2)
 {
 	int diff;
 	sinfo_data_t *sinfo1;
@@ -801,9 +847,9 @@ static int _sort_by_priority(void *void1, void *void2)
 	_get_sinfo_from_void(&sinfo1, &sinfo2, void1, void2);
 
 	if (sinfo1->part_info)
-		val1 = sinfo1->part_info->priority;
+		val1 = sinfo1->part_info->priority_tier;
 	if (sinfo2->part_info)
-		val2 = sinfo2->part_info->priority;
+		val2 = sinfo2->part_info->priority_tier;
 	diff = _diff_uint32(val1, val2);
 
 	if (reverse_order)
diff --git a/src/slurmctld/Makefile.am b/src/slurmctld/Makefile.am
index 5eb2c9242..6a32f24eb 100644
--- a/src/slurmctld/Makefile.am
+++ b/src/slurmctld/Makefile.am
@@ -39,11 +39,10 @@ slurmctld_SOURCES =     \
 	partition_mgr.c \
 	ping_nodes.c	\
 	ping_nodes.h	\
-	slurmctld_plugstack.c \
-	slurmctld_plugstack.h \
 	port_mgr.c	\
 	port_mgr.h	\
 	power_save.c	\
+	power_save.h	\
 	powercapping.c	\
 	powercapping.h	\
 	preempt.c	\
@@ -56,9 +55,9 @@ slurmctld_SOURCES =     \
 	reservation.h	\
 	sched_plugin.c	\
 	sched_plugin.h	\
-	sicp.c		\
-	sicp.h		\
 	slurmctld.h	\
+	slurmctld_plugstack.c \
+	slurmctld_plugstack.h \
 	srun_comm.c	\
 	srun_comm.h	\
 	state_save.c	\
diff --git a/src/slurmctld/Makefile.in b/src/slurmctld/Makefile.in
index 2717b5c5c..a1db79de6 100644
--- a/src/slurmctld/Makefile.in
+++ b/src/slurmctld/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 sbin_PROGRAMS = slurmctld$(EXEEXT)
 subdir = src/slurmctld
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -153,10 +154,10 @@ am_slurmctld_OBJECTS = acct_policy.$(OBJEXT) agent.$(OBJEXT) \
 	job_mgr.$(OBJEXT) job_scheduler.$(OBJEXT) job_submit.$(OBJEXT) \
 	licenses.$(OBJEXT) locks.$(OBJEXT) node_mgr.$(OBJEXT) \
 	node_scheduler.$(OBJEXT) partition_mgr.$(OBJEXT) \
-	ping_nodes.$(OBJEXT) slurmctld_plugstack.$(OBJEXT) \
-	port_mgr.$(OBJEXT) power_save.$(OBJEXT) powercapping.$(OBJEXT) \
-	preempt.$(OBJEXT) proc_req.$(OBJEXT) read_config.$(OBJEXT) \
-	reservation.$(OBJEXT) sched_plugin.$(OBJEXT) sicp.$(OBJEXT) \
+	ping_nodes.$(OBJEXT) port_mgr.$(OBJEXT) power_save.$(OBJEXT) \
+	powercapping.$(OBJEXT) preempt.$(OBJEXT) proc_req.$(OBJEXT) \
+	read_config.$(OBJEXT) reservation.$(OBJEXT) \
+	sched_plugin.$(OBJEXT) slurmctld_plugstack.$(OBJEXT) \
 	srun_comm.$(OBJEXT) state_save.$(OBJEXT) statistics.$(OBJEXT) \
 	step_mgr.$(OBJEXT) trigger_mgr.$(OBJEXT)
 slurmctld_OBJECTS = $(am_slurmctld_OBJECTS)
@@ -236,8 +237,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -337,6 +336,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -375,6 +378,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -418,6 +424,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -468,6 +477,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -517,11 +527,10 @@ slurmctld_SOURCES = \
 	partition_mgr.c \
 	ping_nodes.c	\
 	ping_nodes.h	\
-	slurmctld_plugstack.c \
-	slurmctld_plugstack.h \
 	port_mgr.c	\
 	port_mgr.h	\
 	power_save.c	\
+	power_save.h	\
 	powercapping.c	\
 	powercapping.h	\
 	preempt.c	\
@@ -534,9 +543,9 @@ slurmctld_SOURCES = \
 	reservation.h	\
 	sched_plugin.c	\
 	sched_plugin.h	\
-	sicp.c		\
-	sicp.h		\
 	slurmctld.h	\
+	slurmctld_plugstack.c \
+	slurmctld_plugstack.h \
 	srun_comm.c	\
 	srun_comm.h	\
 	state_save.c	\
@@ -669,7 +678,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_config.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reservation.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_plugin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sicp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slurmctld_plugstack.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srun_comm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/state_save.Po@am__quote@
diff --git a/src/slurmctld/acct_policy.c b/src/slurmctld/acct_policy.c
index 8e9def4b4..c50b8fe59 100644
--- a/src/slurmctld/acct_policy.c
+++ b/src/slurmctld/acct_policy.c
@@ -84,6 +84,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 			return WAIT_QOS_MAX_CPU_PER_JOB;
 		case WAIT_QOS_MAX_UNK_PER_NODE:
 			return WAIT_QOS_MAX_CPU_PER_NODE;
+		case WAIT_QOS_MAX_UNK_PER_ACCT:
+			return WAIT_QOS_MAX_CPU_PER_ACCT;
 		case WAIT_QOS_MAX_UNK_PER_USER:
 			return WAIT_QOS_MAX_CPU_PER_USER;
 		case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -117,6 +119,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 			return WAIT_QOS_MAX_MEM_PER_JOB;
 		case WAIT_QOS_MAX_UNK_PER_NODE:
 			return WAIT_QOS_MAX_MEM_PER_NODE;
+		case WAIT_QOS_MAX_UNK_PER_ACCT:
+			return WAIT_QOS_MAX_MEM_PER_ACCT;
 		case WAIT_QOS_MAX_UNK_PER_USER:
 			return WAIT_QOS_MAX_MEM_PER_USER;
 		case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -150,6 +154,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 			return WAIT_QOS_MAX_ENERGY_PER_JOB;
 		case WAIT_QOS_MAX_UNK_PER_NODE:
 			return WAIT_QOS_MAX_ENERGY_PER_NODE;
+		case WAIT_QOS_MAX_UNK_PER_ACCT:
+			return WAIT_QOS_MAX_ENERGY_PER_ACCT;
 		case WAIT_QOS_MAX_UNK_PER_USER:
 			return WAIT_QOS_MAX_ENERGY_PER_USER;
 		case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -181,6 +187,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 			return WAIT_QOS_GRP_NODE_RUN_MIN;
 		case WAIT_QOS_MAX_UNK_PER_JOB:
 			return WAIT_QOS_MAX_NODE_PER_JOB;
+		case WAIT_QOS_MAX_UNK_PER_ACCT:
+			return WAIT_QOS_MAX_NODE_PER_ACCT;
 		case WAIT_QOS_MAX_UNK_PER_USER:
 			return WAIT_QOS_MAX_NODE_PER_USER;
 		case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -215,6 +223,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 				return WAIT_QOS_MAX_GRES_PER_JOB;
 			case WAIT_QOS_MAX_UNK_PER_NODE:
 				return WAIT_QOS_MAX_GRES_PER_NODE;
+			case WAIT_QOS_MAX_UNK_PER_ACCT:
+				return WAIT_QOS_MAX_GRES_PER_ACCT;
 			case WAIT_QOS_MAX_UNK_PER_USER:
 				return WAIT_QOS_MAX_GRES_PER_USER;
 			case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -246,6 +256,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 				return WAIT_QOS_GRP_LIC_RUN_MIN;
 			case WAIT_QOS_MAX_UNK_PER_JOB:
 				return WAIT_QOS_MAX_LIC_PER_JOB;
+			case WAIT_QOS_MAX_UNK_PER_ACCT:
+				return WAIT_QOS_MAX_LIC_PER_ACCT;
 			case WAIT_QOS_MAX_UNK_PER_USER:
 				return WAIT_QOS_MAX_LIC_PER_USER;
 			case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -278,6 +290,8 @@ static int _get_tres_state_reason(int tres_pos, int unk_reason)
 				return WAIT_QOS_MAX_BB_PER_JOB;
 			case WAIT_QOS_MAX_UNK_PER_NODE:
 				return WAIT_QOS_MAX_BB_PER_NODE;
+			case WAIT_QOS_MAX_UNK_PER_ACCT:
+				return WAIT_QOS_MAX_BB_PER_ACCT;
 			case WAIT_QOS_MAX_UNK_PER_USER:
 				return WAIT_QOS_MAX_BB_PER_USER;
 			case WAIT_QOS_MAX_UNK_MINS_PER_JOB:
@@ -333,6 +347,49 @@ static void _set_qos_order(struct job_record *job_ptr,
 	return;
 }
 
+static int _find_used_limits_for_acct(void *x, void *key)
+{
+	slurmdb_used_limits_t *used_limits = (slurmdb_used_limits_t *)x;
+	char *account = (char *)key;
+
+	if (!xstrcmp(account, used_limits->acct))
+		return 1;
+
+	return 0;
+}
+
+/* Checks for record in *user_limit_list of user_id if
+ * *user_limit_list doesn't exist it will create it, if the user_id
+ * record doesn't exist it will add it to the list.
+ * In all cases the user record is returned.
+ */
+static slurmdb_used_limits_t *_get_acct_used_limits(
+	List *acct_limit_list, char *acct)
+{
+	slurmdb_used_limits_t *used_limits;
+
+	xassert(acct_limit_list);
+
+	if (!*acct_limit_list)
+		*acct_limit_list = list_create(slurmdb_destroy_used_limits);
+
+	if (!(used_limits = list_find_first(*acct_limit_list,
+					    _find_used_limits_for_acct,
+					    acct))) {
+		int i = sizeof(uint64_t) * slurmctld_tres_cnt;
+
+		used_limits = xmalloc(sizeof(slurmdb_used_limits_t));
+		used_limits->acct = xstrdup(acct);
+
+		used_limits->tres = xmalloc(i);
+		used_limits->tres_run_mins = xmalloc(i);
+
+		list_append(*acct_limit_list, used_limits);
+	}
+
+	return used_limits;
+}
+
 static int _find_used_limits_for_user(void *x, void *key)
 {
 	slurmdb_used_limits_t *used_limits = (slurmdb_used_limits_t *)x;
@@ -411,32 +468,24 @@ static void _qos_adjust_limit_usage(int type, struct job_record *job_ptr,
 				    uint64_t *used_tres_run_secs,
 				    uint32_t job_cnt)
 {
-	slurmdb_used_limits_t *used_limits = NULL;
+	slurmdb_used_limits_t *used_limits = NULL, *used_limits_a = NULL;
+	slurmdb_assoc_rec_t *assoc_ptr = job_ptr->assoc_ptr;
 	int i;
 
-	if (!qos_ptr)
+	if (!qos_ptr || !assoc_ptr)
 		return;
 
-	if (!qos_ptr->usage->user_limit_list)
-		qos_ptr->usage->user_limit_list =
-			list_create(slurmdb_destroy_used_limits);
-	if (!(used_limits = list_find_first(qos_ptr->usage->user_limit_list,
-					    _find_used_limits_for_user,
-					    &job_ptr->user_id))) {
-		used_limits = xmalloc(sizeof(slurmdb_used_limits_t));
-		used_limits->uid = job_ptr->user_id;
+	used_limits_a =	_get_acct_used_limits(&qos_ptr->usage->acct_limit_list,
+					      assoc_ptr->acct);
 
-		i = sizeof(uint64_t) * slurmctld_tres_cnt;
-		used_limits->tres = xmalloc(i);
-		used_limits->tres_run_mins = xmalloc(i);
-
-		list_append(qos_ptr->usage->user_limit_list, used_limits);
-	}
+	used_limits = _get_user_used_limits(&qos_ptr->usage->user_limit_list,
+					    job_ptr->user_id);
 
 	switch(type) {
 	case ACCT_POLICY_ADD_SUBMIT:
 		qos_ptr->usage->grp_used_submit_jobs += job_cnt;
 		used_limits->submit_jobs += job_cnt;
+		used_limits_a->submit_jobs += job_cnt;
 		break;
 	case ACCT_POLICY_REM_SUBMIT:
 		if (qos_ptr->usage->grp_used_submit_jobs)
@@ -453,11 +502,20 @@ static void _qos_adjust_limit_usage(int type, struct job_record *job_ptr,
 			       "used_submit_jobs underflow for "
 			       "qos %s user %d",
 			       qos_ptr->name, used_limits->uid);
+
+		if (used_limits_a->submit_jobs)
+			used_limits_a->submit_jobs -= job_cnt;
+		else
+			debug2("acct_policy_remove_job_submit: "
+			       "used_submit_jobs underflow for "
+			       "qos %s account %s",
+			       qos_ptr->name, used_limits_a->acct);
 		break;
 	case ACCT_POLICY_JOB_BEGIN:
 		qos_ptr->usage->grp_used_jobs++;
 		for (i=0; i<slurmctld_tres_cnt; i++) {
 			used_limits->tres[i] += job_ptr->tres_alloc_cnt[i];
+			used_limits_a->tres[i] += job_ptr->tres_alloc_cnt[i];
 
 			qos_ptr->usage->grp_used_tres[i] +=
 				job_ptr->tres_alloc_cnt[i];
@@ -474,6 +532,7 @@ static void _qos_adjust_limit_usage(int type, struct job_record *job_ptr,
 		}
 
 		used_limits->jobs++;
+		used_limits_a->jobs++;
 		break;
 	case ACCT_POLICY_JOB_FINI:
 		qos_ptr->usage->grp_used_jobs--;
@@ -506,15 +565,33 @@ static void _qos_adjust_limit_usage(int type, struct job_record *job_ptr,
 			} else
 				used_limits->tres[i] -=
 					job_ptr->tres_alloc_cnt[i];
+
+			if (job_ptr->tres_alloc_cnt[i] >
+			    used_limits_a->tres[i]) {
+				used_limits_a->tres[i] = 0;
+				debug2("acct_policy_job_fini: "
+				       "used_limits->tres(%s) "
+				       "underflow for qos %s account %s",
+				       assoc_mgr_tres_name_array[i],
+				       qos_ptr->name, used_limits_a->acct);
+			} else
+				used_limits_a->tres[i] -=
+					job_ptr->tres_alloc_cnt[i];
 		}
 
-		used_limits->jobs--;
-		if ((int32_t)used_limits->jobs < 0) {
-			used_limits->jobs = 0;
+		if (used_limits->jobs)
+			used_limits->jobs--;
+		else
 			debug2("acct_policy_job_fini: used_jobs "
 			       "underflow for qos %s user %d",
 			       qos_ptr->name, used_limits->uid);
-		}
+
+		if (used_limits_a->jobs)
+			used_limits_a->jobs--;
+		else
+			debug2("acct_policy_job_fini: used_jobs "
+			       "underflow for qos %s account %s",
+			       qos_ptr->name, used_limits_a->acct);
 
 		break;
 	default:
@@ -874,8 +951,60 @@ static bool _validate_tres_limits_for_qos(
 	return true;
 }
 
+/* Only check the time_limits if the admin didn't set
+ * the timelimit.
+ * It is important we look at these even if strict_checking
+ * isn't set so we get the correct time_limit from the job.
+ */
+static bool _validate_time_limit(uint32_t *time_limit_in,
+				 uint32_t part_max_time,
+				 uint64_t tres_req_cnt,
+				 uint64_t max_limit,
+				 void *out_max_limit,
+				 uint16_t *limit_set_time,
+				 bool strict_checking,
+				 bool is64)
+{
+	uint32_t max_time_limit;
+	uint64_t out_max_64 = *(uint64_t *)out_max_limit;
+	uint32_t out_max_32 = *(uint32_t *)out_max_limit;
+
+	if (!tres_req_cnt ||
+	    !strict_checking || (*limit_set_time) == ADMIN_SET_LIMIT)
+		return true;
+
+	if (is64) {
+		if ((out_max_64 != INFINITE64) ||
+		    (max_limit == INFINITE64) ||
+		    (tres_req_cnt == NO_VAL64))
+			return true;
+	} else {
+		if ((out_max_32 != INFINITE) ||
+		    ((uint32_t)max_limit == INFINITE) ||
+		    ((uint32_t)tres_req_cnt == NO_VAL))
+			return true;
+	}
+
+	max_time_limit = (uint32_t)(max_limit / tres_req_cnt);
+
+	_set_time_limit(time_limit_in, part_max_time, max_time_limit,
+			limit_set_time);
+
+	if (is64)
+		(*(uint64_t *)out_max_limit) = max_limit;
+	else
+		(*(uint32_t *)out_max_limit) = (uint32_t)max_limit;
+
+	if ((*time_limit_in) > max_time_limit)
+		return false;
+
+	return true;
+}
+
+
+
 /*
- * _validate_tres_time_limits_for_qos - validate the tres requested
+ * _validate_tres_time_limits - validate the tres requested
  * against limits of an association as well as qos skipping any limit
  * an admin set
  *
@@ -891,7 +1020,7 @@ static bool _validate_tres_limits_for_qos(
  * RET - True if no limit is violated, false otherwise with tres_pos
  * being set to the position of the failed limit.
  */
-static bool _validate_tres_time_limits_for_qos(
+static bool _validate_tres_time_limits(
 	int *tres_pos,
 	uint32_t *time_limit_in,
 	uint32_t part_max_time,
@@ -902,7 +1031,7 @@ static bool _validate_tres_time_limits_for_qos(
 	bool strict_checking)
 {
 	int i;
-	uint32_t max_time_limit;
+//	uint32_t max_time_limit;
 
 	if (!strict_checking || (*limit_set_time) == ADMIN_SET_LIMIT)
 		return true;
@@ -910,23 +1039,30 @@ static bool _validate_tres_time_limits_for_qos(
 	for (i = 0; i < g_tres_count; i++) {
 		(*tres_pos) = i;
 
-		if ((out_max_tres_array[i] != INFINITE64) ||
-		    (max_tres_array[i] == INFINITE64) ||
-		    (job_tres_array[i] == NO_VAL64) ||
-		    (job_tres_array[i] == 0))
-			continue;
+		if (!_validate_time_limit(time_limit_in, part_max_time,
+					  job_tres_array[i],
+					  max_tres_array[i],
+					  &out_max_tres_array[i],
+					  limit_set_time,
+					  strict_checking, true))
+			return false;
+		/* if ((out_max_tres_array[i] != INFINITE64) || */
+		/*     (max_tres_array[i] == INFINITE64) || */
+		/*     (job_tres_array[i] == NO_VAL64) || */
+		/*     (job_tres_array[i] == 0)) */
+		/* 	continue; */
 
-		max_time_limit = (uint32_t)(max_tres_array[i] /
-					    job_tres_array[i]);
+		/* max_time_limit = (uint32_t)(max_tres_array[i] / */
+		/* 			    job_tres_array[i]); */
 
-		_set_time_limit(time_limit_in,
-				part_max_time, max_time_limit,
-				limit_set_time);
+		/* _set_time_limit(time_limit_in, */
+		/* 		part_max_time, max_time_limit, */
+		/* 		limit_set_time); */
 
-		out_max_tres_array[i] = max_tres_array[i];
+		/* out_max_tres_array[i] = max_tres_array[i]; */
 
-		if ((*time_limit_in) > max_time_limit)
-			return false;
+		/* if ((*time_limit_in) > max_time_limit) */
+		/* 	return false; */
 	}
 
 	return true;
@@ -997,6 +1133,7 @@ static int _validate_tres_usage_limits_for_qos(
 }
 
 static int _qos_policy_validate(job_desc_msg_t *job_desc,
+				slurmdb_assoc_rec_t *assoc_ptr,
 				struct part_record *part_ptr,
 				slurmdb_qos_rec_t *qos_ptr,
 				slurmdb_qos_rec_t *qos_out_ptr,
@@ -1013,9 +1150,33 @@ static int _qos_policy_validate(job_desc_msg_t *job_desc,
 	if (!qos_ptr || !qos_out_ptr)
 		return rc;
 
-	/* for validation we don't need to look at
-	 * qos_ptr->grp_tres_mins.
-	 */
+	if (!_validate_tres_limits_for_qos(&tres_pos,
+					   job_desc->tres_req_cnt, 0,
+					   NULL,
+					   qos_ptr->max_tres_pa_ctld,
+					   NULL,
+					   qos_out_ptr->max_tres_pa_ctld,
+					   acct_policy_limit_set->tres,
+					   strict_checking, 1)) {
+		if (job_desc->tres_req_cnt[tres_pos] >
+		    qos_ptr->max_tres_pa_ctld[tres_pos]) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos, WAIT_QOS_MAX_UNK_PER_ACCT);
+
+			debug2("job submit for user %s(%u): "
+			       "min tres(%s) request %"PRIu64" exceeds "
+			       "per-acct max tres limit %"PRIu64" for qos '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       job_desc->tres_req_cnt[tres_pos],
+			       qos_ptr->max_tres_pa_ctld[tres_pos],
+			       qos_ptr->name);
+			rc = false;
+			goto end_it;
+		}
+	}
 
 	if (!_validate_tres_limits_for_qos(&tres_pos,
 					   job_desc->tres_req_cnt, 0,
@@ -1092,7 +1253,7 @@ static int _qos_policy_validate(job_desc_msg_t *job_desc,
 	 * isn't set so we get the correct time_limit from the job.
 	 */
 	if (acct_policy_limit_set->time != ADMIN_SET_LIMIT) {
-		if (!_validate_tres_time_limits_for_qos(
+		if (!_validate_tres_time_limits(
 			    &tres_pos,
 			    &job_desc->time_limit,
 			    part_ptr->max_time,
@@ -1120,6 +1281,60 @@ static int _qos_policy_validate(job_desc_msg_t *job_desc,
 			goto end_it;
 		}
 
+		if (!_validate_tres_time_limits(
+			    &tres_pos,
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    job_desc->tres_req_cnt,
+			    qos_ptr->grp_tres_mins_ctld,
+			    qos_out_ptr->grp_tres_mins_ctld,
+			    &acct_policy_limit_set->time,
+			    strict_checking)) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos, WAIT_QOS_GRP_UNK_MIN);
+			debug2("job submit for user %s(%u): "
+			       "tres(%s) time limit request %"PRIu64" "
+			       "exceeds group max limit %"PRIu64" "
+			       "for qos '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       ((uint64_t)job_desc->time_limit *
+				job_desc->tres_req_cnt[tres_pos]),
+			       qos_ptr->grp_tres_mins_ctld[tres_pos],
+			       qos_ptr->name);
+			rc = false;
+			goto end_it;
+		}
+
+		if (!_validate_tres_time_limits(
+			    &tres_pos,
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    job_desc->tres_req_cnt,
+			    qos_ptr->grp_tres_run_mins_ctld,
+			    qos_out_ptr->grp_tres_run_mins_ctld,
+			    &acct_policy_limit_set->time,
+			    strict_checking)) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos, WAIT_QOS_GRP_UNK_RUN_MIN);
+			debug2("job submit for user %s(%u): "
+			       "tres(%s) time limit request %"PRIu64" "
+			       "exceeds group max running limit %"PRIu64" "
+			       "for qos '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       ((uint64_t)job_desc->time_limit *
+				job_desc->tres_req_cnt[tres_pos]),
+			       qos_ptr->grp_tres_run_mins_ctld[tres_pos],
+			       qos_ptr->name);
+			rc = false;
+			goto end_it;
+		}
+
 		if ((qos_out_ptr->max_wall_pj == INFINITE) &&
 		    (qos_ptr->max_wall_pj != INFINITE)) {
 			_set_time_limit(&job_desc->time_limit,
@@ -1225,6 +1440,28 @@ static int _qos_policy_validate(job_desc_msg_t *job_desc,
 	 * qos_ptr->max_jobs.
 	 */
 
+	if ((qos_out_ptr->max_submit_jobs_pa == INFINITE) &&
+	    (qos_ptr->max_submit_jobs_pa != INFINITE)) {
+		slurmdb_used_limits_t *used_limits =
+			_get_acct_used_limits(
+				&qos_ptr->usage->acct_limit_list,
+				assoc_ptr->acct);
+
+		qos_out_ptr->max_submit_jobs_pa = qos_ptr->max_submit_jobs_pa;
+
+		if ((used_limits->submit_jobs + job_cnt) >
+		    qos_ptr->max_submit_jobs_pa) {
+			if (reason)
+				*reason = WAIT_QOS_MAX_SUB_JOB_PER_ACCT;
+			debug2("job submit for account %s: "
+			       "qos max submit job limit exceeded %u",
+			       assoc_ptr->acct,
+			       qos_ptr->max_submit_jobs_pa);
+			rc = false;
+			goto end_it;
+		}
+	}
+
 	if ((qos_out_ptr->max_submit_jobs_pu == INFINITE) &&
 	    (qos_ptr->max_submit_jobs_pu != INFINITE)) {
 		slurmdb_used_limits_t *used_limits =
@@ -1278,17 +1515,17 @@ end_it:
 }
 
 static int _qos_job_runnable_pre_select(struct job_record *job_ptr,
-					 slurmdb_qos_rec_t *qos_ptr,
-					 slurmdb_qos_rec_t *qos_out_ptr)
+					slurmdb_qos_rec_t *qos_ptr,
+					slurmdb_qos_rec_t *qos_out_ptr)
 {
 	uint32_t wall_mins;
 	uint32_t time_limit = NO_VAL;
 	int rc = true;
-	slurmdb_used_limits_t *used_limits = NULL;
-	bool free_used_limits = false;
+	slurmdb_used_limits_t *used_limits = NULL, *used_limits_a = NULL;
 	bool safe_limits = false;
+	slurmdb_assoc_rec_t *assoc_ptr = job_ptr->assoc_ptr;
 
-	if (!qos_ptr || !qos_out_ptr)
+	if (!qos_ptr || !qos_out_ptr || !assoc_ptr)
 		return rc;
 
 	/* check to see if we should be using safe limits, if so we
@@ -1299,18 +1536,12 @@ static int _qos_job_runnable_pre_select(struct job_record *job_ptr,
 
 	wall_mins = qos_ptr->usage->grp_used_wall / 60;
 
-	/*
-	 * Try to get the used limits for the user or initialise a local
-	 * nullified one if not available.
-	 */
-	if (!qos_ptr->usage->user_limit_list ||
-	    !(used_limits = list_find_first(qos_ptr->usage->user_limit_list,
-					    _find_used_limits_for_user,
-					    &job_ptr->user_id))) {
-		used_limits = xmalloc(sizeof(slurmdb_used_limits_t));
-		used_limits->uid = job_ptr->user_id;
-		free_used_limits = true;
-	}
+	used_limits_a =	_get_acct_used_limits(&qos_ptr->usage->acct_limit_list,
+					      assoc_ptr->acct);
+
+	used_limits = _get_user_used_limits(&qos_ptr->usage->user_limit_list,
+					    job_ptr->user_id);
+
 
 	/* we don't need to check grp_tres_mins here */
 
@@ -1393,8 +1624,32 @@ static int _qos_job_runnable_pre_select(struct job_record *job_ptr,
 
 	/* we don't need to check min_tres_pj here */
 
+	/* we don't need to check max_tres_pa here */
+
 	/* we don't need to check max_tres_pu here */
 
+	if ((qos_out_ptr->max_jobs_pa == INFINITE)
+	    && (qos_ptr->max_jobs_pa != INFINITE)) {
+
+		qos_out_ptr->max_jobs_pa = qos_ptr->max_jobs_pa;
+
+		if (used_limits_a->jobs >= qos_ptr->max_jobs_pa) {
+			xfree(job_ptr->state_desc);
+			job_ptr->state_reason =
+				WAIT_QOS_MAX_JOB_PER_ACCT;
+			debug2("job %u being held, "
+			       "the job is at or exceeds "
+			       "max jobs per-acct (%s) limit "
+			       "%u with %u for QOS %s",
+			       job_ptr->job_id,
+			       used_limits_a->acct,
+			       qos_ptr->max_jobs_pa,
+			       used_limits_a->jobs, qos_ptr->name);
+			rc = false;
+			goto end_it;
+		}
+	}
+
 	if ((qos_out_ptr->max_jobs_pu == INFINITE)
 	    && (qos_ptr->max_jobs_pu != INFINITE)) {
 
@@ -1416,6 +1671,8 @@ static int _qos_job_runnable_pre_select(struct job_record *job_ptr,
 		}
 	}
 
+	/* we don't need to check submit_jobs_pa here */
+
 	/* we don't need to check submit_jobs_pu here */
 
 	/* if the qos limits have changed since job
@@ -1449,9 +1706,6 @@ static int _qos_job_runnable_pre_select(struct job_record *job_ptr,
 	}
 end_it:
 
-	if (free_used_limits)
-		xfree(used_limits);
-
 	return rc;
 }
 
@@ -1463,13 +1717,13 @@ static int _qos_job_runnable_post_select(struct job_record *job_ptr,
 {
 	uint64_t tres_usage_mins[slurmctld_tres_cnt];
 	uint64_t tres_run_mins[slurmctld_tres_cnt];
-	slurmdb_used_limits_t *used_limits = NULL;
-	bool free_used_limits = false;
+	slurmdb_used_limits_t *used_limits = NULL, *used_limits_a = NULL;
 	bool safe_limits = false;
 	int rc = true;
 	int i, tres_pos = 0;
+	slurmdb_assoc_rec_t *assoc_ptr = job_ptr->assoc_ptr;
 
-	if (!qos_ptr || !qos_out_ptr)
+	if (!qos_ptr || !qos_out_ptr || !assoc_ptr)
 		return rc;
 
 	/* check to see if we should be using safe limits, if so we
@@ -1488,18 +1742,11 @@ static int _qos_job_runnable_post_select(struct job_record *job_ptr,
 			(uint64_t)(qos_ptr->usage->usage_tres_raw[i] / 60.0);
 	}
 
-	/*
-	 * Try to get the used limits for the user or initialize a local
-	 * nullified one if not available.
-	 */
-	if (!qos_ptr->usage->user_limit_list ||
-	    !(used_limits = list_find_first(qos_ptr->usage->user_limit_list,
-					    _find_used_limits_for_user,
-					    &job_ptr->user_id))) {
-		used_limits = xmalloc(sizeof(slurmdb_used_limits_t));
-		used_limits->uid = job_ptr->user_id;
-		free_used_limits = true;
-	}
+	used_limits_a =	_get_acct_used_limits(&qos_ptr->usage->acct_limit_list,
+					      assoc_ptr->acct);
+
+	used_limits = _get_user_used_limits(&qos_ptr->usage->user_limit_list,
+					    job_ptr->user_id);
 
 	i = _validate_tres_usage_limits_for_qos(
 		&tres_pos, qos_ptr->grp_tres_mins_ctld,
@@ -1777,6 +2024,61 @@ static int _qos_job_runnable_post_select(struct job_record *job_ptr,
 		goto end_it;
 	}
 
+	i = _validate_tres_usage_limits_for_qos(
+		&tres_pos,
+		qos_ptr->max_tres_pa_ctld, qos_out_ptr->max_tres_pa_ctld,
+		tres_req_cnt, used_limits_a->tres,
+		NULL, job_ptr->limit_set.tres, 1);
+	switch (i) {
+	case 1:
+		/* not possible because the curr_usage sent in is NULL */
+		break;
+	case 2:
+		/* Hold the job if it exceeds the per-acct
+		 * TRES limit for the given QOS
+		 */
+		xfree(job_ptr->state_desc);
+		job_ptr->state_reason = _get_tres_state_reason(
+			tres_pos, WAIT_QOS_MAX_UNK_PER_ACCT);
+		debug2("job %u is being held, "
+		       "QOS %s min tres(%s) "
+		       "request %"PRIu64" exceeds "
+		       "max tres per account (%s) limit %"PRIu64,
+		       job_ptr->job_id,
+		       qos_ptr->name,
+		       assoc_mgr_tres_name_array[tres_pos],
+		       tres_req_cnt[tres_pos],
+		       used_limits_a->acct,
+		       qos_ptr->max_tres_pa_ctld[tres_pos]);
+		rc = false;
+		goto end_it;
+		break;
+	case 3:
+		/* Hold the job if the user has exceeded
+		 * the QOS per-user TRES limit with their
+		 * current usage */
+		xfree(job_ptr->state_desc);
+		job_ptr->state_reason = _get_tres_state_reason(
+			tres_pos, WAIT_QOS_MAX_UNK_PER_ACCT);
+		debug2("job %u being held, "
+		       "if allowed the job request will exceed "
+		       "QOS %s max tres(%s) per account (%s) limit "
+		       "%"PRIu64" with already used %"PRIu64" + "
+		       "requested %"PRIu64,
+		       job_ptr->job_id,
+		       qos_ptr->name,
+		       assoc_mgr_tres_name_array[tres_pos],
+		       used_limits_a->acct,
+		       qos_ptr->max_tres_pa_ctld[tres_pos],
+		       used_limits_a->tres[tres_pos],
+		       tres_req_cnt[tres_pos]);
+		rc = false;
+		goto end_it;
+	default:
+		/* all good */
+		break;
+	}
+
 	i = _validate_tres_usage_limits_for_qos(
 		&tres_pos,
 		qos_ptr->max_tres_pu_ctld, qos_out_ptr->max_tres_pu_ctld,
@@ -1830,15 +2132,17 @@ static int _qos_job_runnable_post_select(struct job_record *job_ptr,
 		break;
 	}
 
+	/* We do not need to check max_jobs_pa here */
+
 	/* We do not need to check max_jobs_pu here */
 
-end_it:
+	/* we don't need to check submit_jobs_pa here */
+
 	/* we don't need to check submit_jobs_pu here */
 
 	/* we don't need to check max_wall_pj here */
 
-	if (free_used_limits)
-		xfree(used_limits);
+end_it:
 
 	return rc;
 }
@@ -2108,12 +2412,14 @@ extern bool acct_policy_validate(job_desc_msg_t *job_desc,
 				qos_ptr_2->flags & QOS_FLAG_DENY_LIMIT;
 
 		if (!(rc = _qos_policy_validate(
-			      job_desc, part_ptr, qos_ptr_1, &qos_rec,
+			      job_desc, assoc_ptr, part_ptr,
+			      qos_ptr_1, &qos_rec,
 			      reason, acct_policy_limit_set, update_call,
 			      user_name, job_cnt, strict_checking)))
 			goto end_it;
 		if (!(rc = _qos_policy_validate(
-			      job_desc, part_ptr, qos_ptr_2, &qos_rec,
+			      job_desc, assoc_ptr,
+			      part_ptr, qos_ptr_2, &qos_rec,
 			      reason, acct_policy_limit_set, update_call,
 			      user_name, job_cnt, strict_checking)))
 			goto end_it;
@@ -2124,10 +2430,6 @@ extern bool acct_policy_validate(job_desc_msg_t *job_desc,
 	while (assoc_ptr) {
 		int tres_pos = 0;
 
-		/* for validation we don't need to look at
-		 * assoc_ptr->grp_cpu_mins.
-		 */
-
 		if (!_validate_tres_limits_for_assoc(
 			    &tres_pos, job_desc->tres_req_cnt, 0,
 			    assoc_ptr->grp_tres_ctld,
@@ -2172,10 +2474,87 @@ extern bool acct_policy_validate(job_desc_msg_t *job_desc,
 			break;
 		}
 
+		tres_pos = 0;
+		if (!update_call && !_validate_tres_time_limits(
+			    &tres_pos,
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    job_desc->tres_req_cnt,
+			    assoc_ptr->grp_tres_mins_ctld,
+			    qos_rec.grp_tres_mins_ctld,
+			    &acct_policy_limit_set->time,
+			    strict_checking)) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos,
+					WAIT_ASSOC_GRP_UNK_MIN);
+			debug2("job submit for user %s(%u): "
+			       "tres(%s) time limit request %"PRIu64" "
+			       "exceeds group max limit %"PRIu64" "
+			       "for account '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       ((uint64_t)job_desc->time_limit *
+				job_desc->tres_req_cnt[tres_pos]),
+			       assoc_ptr->
+			       grp_tres_mins_ctld[tres_pos],
+			       assoc_ptr->acct);
+			rc = false;
+			goto end_it;
+		}
 
-		/* for validation we don't need to look at
-		 * assoc_ptr->grp_wall. It is checked while the job is running.
-		 */
+		tres_pos = 0;
+		if (!update_call && !_validate_tres_time_limits(
+			    &tres_pos,
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    job_desc->tres_req_cnt,
+			    assoc_ptr->grp_tres_run_mins_ctld,
+			    qos_rec.grp_tres_run_mins_ctld,
+			    &acct_policy_limit_set->time,
+			    strict_checking)) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos,
+					WAIT_ASSOC_GRP_UNK_RUN_MIN);
+			debug2("job submit for user %s(%u): "
+			       "tres(%s) time limit request %"PRIu64" "
+			       "exceeds group max running "
+			       "limit %"PRIu64" for account '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       ((uint64_t)job_desc->time_limit *
+				job_desc->tres_req_cnt[tres_pos]),
+			       assoc_ptr->
+			       grp_tres_run_mins_ctld[tres_pos],
+			       assoc_ptr->acct);
+			rc = false;
+			goto end_it;
+		}
+
+		if (!update_call && !_validate_time_limit(
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    1,
+			    assoc_ptr->grp_wall,
+			    &qos_rec.grp_wall,
+			    &acct_policy_limit_set->time,
+			    strict_checking, false)) {
+			if (reason)
+				*reason = WAIT_ASSOC_GRP_WALL;
+			debug2("job submit for user %s(%u): "
+			       "time limit %u exceeds max group %u for "
+			       "account '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       job_desc->time_limit,
+			       assoc_ptr->grp_wall,
+			       assoc_ptr->acct);
+			rc = false;
+			break;
+		}
 
 		/* We don't need to look at the regular limits for
 		 * parents since we have pre-propogated them, so just
@@ -2246,7 +2625,8 @@ extern bool acct_policy_validate(job_desc_msg_t *job_desc,
 		 * assoc_ptr->max_jobs.
 		 */
 
-		if ((qos_rec.max_submit_jobs_pu == INFINITE) &&
+		if ((qos_rec.max_submit_jobs_pa == INFINITE) &&
+		    (qos_rec.max_submit_jobs_pu == INFINITE) &&
 		    (assoc_ptr->max_submit_jobs != INFINITE) &&
 		    ((assoc_ptr->usage->used_submit_jobs + job_cnt)
 		     > assoc_ptr->max_submit_jobs)) {
@@ -2261,36 +2641,54 @@ extern bool acct_policy_validate(job_desc_msg_t *job_desc,
 			break;
 		}
 
-		if ((acct_policy_limit_set->time == ADMIN_SET_LIMIT)
-		    || (qos_rec.max_wall_pj != INFINITE)
-		    || (assoc_ptr->max_wall_pj == INFINITE)
-		    || (update_call && (job_desc->time_limit == NO_VAL))) {
-			/* no need to check/set */
-		} else {
-			uint32_t time_limit = assoc_ptr->max_wall_pj;
-			if (job_desc->time_limit == NO_VAL) {
-				if (part_ptr->max_time == INFINITE)
-					job_desc->time_limit = time_limit;
-				else
-					job_desc->time_limit =
-						MIN(time_limit,
-						    part_ptr->max_time);
-				acct_policy_limit_set->time = 1;
-			} else if (acct_policy_limit_set->time &&
-				   job_desc->time_limit > time_limit) {
-				job_desc->time_limit = time_limit;
-			} else if (strict_checking &&
-				   (job_desc->time_limit > time_limit)) {
-				if (reason)
-					*reason = WAIT_ASSOC_MAX_WALL_PER_JOB;
-				debug2("job submit for user %s(%u): "
-				       "time limit %u exceeds account max %u",
-				       user_name,
-				       job_desc->user_id,
-				       job_desc->time_limit, time_limit);
-				rc = false;
-				break;
-			}
+		if (!update_call && !_validate_tres_time_limits(
+			    &tres_pos,
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    job_desc->tres_req_cnt,
+			    assoc_ptr->max_tres_mins_ctld,
+			    qos_rec.max_tres_mins_pj_ctld,
+			    &acct_policy_limit_set->time,
+			    strict_checking)) {
+			if (reason)
+				*reason = _get_tres_state_reason(
+					tres_pos,
+					WAIT_ASSOC_MAX_UNK_MINS_PER_JOB);
+			debug2("job submit for user %s(%u): "
+			       "tres(%s) time limit request %"PRIu64" "
+			       "exceeds max per-job limit %"PRIu64" "
+			       "for account '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       assoc_mgr_tres_name_array[tres_pos],
+			       ((uint64_t)job_desc->time_limit *
+				job_desc->tres_req_cnt[tres_pos]),
+			       assoc_ptr->max_tres_mins_ctld[tres_pos],
+			       assoc_ptr->acct);
+			rc = false;
+			break;
+		}
+
+		if (!update_call && !_validate_time_limit(
+			    &job_desc->time_limit,
+			    part_ptr->max_time,
+			    1,
+			    assoc_ptr->max_wall_pj,
+			    &qos_rec.max_wall_pj,
+			    &acct_policy_limit_set->time,
+			    strict_checking, false)) {
+			if (reason)
+				*reason = WAIT_ASSOC_MAX_WALL_PER_JOB;
+			debug2("job submit for user %s(%u): "
+			       "time limit %u exceeds max %u for "
+			       "account '%s'",
+			       user_name,
+			       job_desc->user_id,
+			       job_desc->time_limit,
+			       assoc_ptr->max_wall_pj,
+			       assoc_ptr->acct);
+			rc = false;
+			break;
 		}
 
 		assoc_ptr = assoc_ptr->usage->parent_assoc_ptr;
@@ -2486,7 +2884,8 @@ extern bool acct_policy_job_runnable_pre_select(struct job_record *job_ptr)
 
 		/* we don't need to check max_cpus_pj here */
 
-		if ((qos_rec.max_jobs_pu == INFINITE) &&
+		if ((qos_rec.max_jobs_pa == INFINITE) &&
+		    (qos_rec.max_jobs_pu == INFINITE) &&
 		    (assoc_ptr->max_jobs != INFINITE) &&
 		    (assoc_ptr->usage->used_jobs >= assoc_ptr->max_jobs)) {
 			xfree(job_ptr->state_desc);
@@ -2963,10 +3362,15 @@ extern uint32_t acct_policy_get_max_nodes(struct job_record *job_ptr,
 			qos_ptr_1->max_tres_pj_ctld[TRES_ARRAY_NODE];
 		uint64_t max_nodes_pu =
 			qos_ptr_1->max_tres_pu_ctld[TRES_ARRAY_NODE];
+		uint64_t max_nodes_pa =
+			qos_ptr_1->max_tres_pa_ctld[TRES_ARRAY_NODE];
 
 		grp_nodes = qos_ptr_1->grp_tres_ctld[TRES_ARRAY_NODE];
 
 		if (qos_ptr_2) {
+			if (max_nodes_pa == INFINITE64)
+				max_nodes_pa = qos_ptr_2->max_tres_pa_ctld[
+					TRES_ARRAY_NODE];
 			if (max_nodes_pj == INFINITE64)
 				max_nodes_pj = qos_ptr_2->max_tres_pj_ctld[
 					TRES_ARRAY_NODE];
@@ -2978,10 +3382,17 @@ extern uint32_t acct_policy_get_max_nodes(struct job_record *job_ptr,
 					TRES_ARRAY_NODE];
 		}
 
-		if (max_nodes_pj < max_nodes_pu) {
+		if (max_nodes_pa < max_nodes_limit) {
+			max_nodes_limit = max_nodes_pa;
+			*wait_reason = WAIT_QOS_MAX_NODE_PER_ACCT;
+		}
+
+		if (max_nodes_pj < max_nodes_limit) {
 			max_nodes_limit = max_nodes_pj;
 			*wait_reason = WAIT_QOS_MAX_NODE_PER_JOB;
-		} else if (max_nodes_pu != INFINITE64) {
+		}
+
+		if (max_nodes_pu < max_nodes_limit) {
 			max_nodes_limit = max_nodes_pu;
 			*wait_reason = WAIT_QOS_MAX_NODE_PER_USER;
 		}
diff --git a/src/slurmctld/agent.c b/src/slurmctld/agent.c
index 6fdc1a503..97c15537d 100644
--- a/src/slurmctld/agent.c
+++ b/src/slurmctld/agent.c
@@ -234,9 +234,8 @@ void *agent(void *args)
 	int rpc_thread_cnt;
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_agent", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_agent");
+	if (prctl(PR_SET_NAME, "agent", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "agent");
 	}
 #endif
 
@@ -248,7 +247,7 @@ void *agent(void *args)
 	slurm_mutex_lock(&agent_cnt_mutex);
 	if (!wiki2_sched_test) {
 		char *sched_type = slurm_get_sched_type();
-		if (strcmp(sched_type, "sched/wiki2") == 0)
+		if (xstrcmp(sched_type, "sched/wiki2") == 0)
 			wiki2_sched = true;
 		xfree(sched_type);
 		wiki2_sched_test = true;
@@ -386,17 +385,17 @@ void *agent(void *args)
 /* Basic validity test of agent argument */
 static int _valid_agent_arg(agent_arg_t *agent_arg_ptr)
 {
+	int hostlist_cnt;
+
 	xassert(agent_arg_ptr);
 	xassert(agent_arg_ptr->hostlist);
 
 	if (agent_arg_ptr->node_count == 0)
 		return SLURM_FAILURE;	/* no messages to be sent */
-	if (agent_arg_ptr->node_count
-	    != hostlist_count(agent_arg_ptr->hostlist)) {
-		error("you said you were going to send to %d "
-		     "hosts but I only have %d",
-		     agent_arg_ptr->node_count,
-		     hostlist_count(agent_arg_ptr->hostlist));
+	hostlist_cnt = hostlist_count(agent_arg_ptr->hostlist);
+	if (agent_arg_ptr->node_count != hostlist_cnt) {
+		error("%s: node_count RPC different from hosts listed (%d!=%d)",
+		     __func__, agent_arg_ptr->node_count, hostlist_cnt);
 		return SLURM_FAILURE;	/* no messages to be sent */
 	}
 	return SLURM_SUCCESS;
@@ -1757,7 +1756,8 @@ extern void mail_job_info (struct job_record *job_ptr, uint16_t mail_type)
 		mi->user_name = xstrdup(job_ptr->mail_user);
 
 	/* Use job array master record, if available */
-	if ((job_ptr->array_task_id != NO_VAL) && !job_ptr->array_recs) {
+	if (!(job_ptr->mail_type & MAIL_ARRAY_TASKS) &&
+	    (job_ptr->array_task_id != NO_VAL) && !job_ptr->array_recs) {
 		struct job_record *master_job_ptr;
 		master_job_ptr = find_job_record(job_ptr->array_job_id);
 		if (master_job_ptr && master_job_ptr->array_recs)
@@ -1766,7 +1766,7 @@ extern void mail_job_info (struct job_record *job_ptr, uint16_t mail_type)
 
 	_set_job_time(job_ptr, mail_type, job_time, sizeof(job_time));
 	_set_job_term_info(job_ptr, mail_type, term_msg, sizeof(term_msg));
-	if (job_ptr->array_recs) {
+	if (job_ptr->array_recs && !(job_ptr->mail_type & MAIL_ARRAY_TASKS)) {
 		mi->message = xstrdup_printf("SLURM Job_id=%u_* (%u) Name=%s "
 					     "%s%s%s",
 					     job_ptr->array_job_id,
@@ -1808,7 +1808,7 @@ static int _batch_launch_defer(queued_request_t *queued_req_ptr)
 	batch_job_launch_msg_t *launch_msg_ptr;
 	time_t now = time(NULL);
 	struct job_record  *job_ptr;
-	int delay_time, nodes_ready = 0, tmp;
+	int nodes_ready = 0, tmp = 0;
 
 	agent_arg_ptr = queued_req_ptr->agent_arg_ptr;
 	if (agent_arg_ptr->msg_type != REQUEST_BATCH_JOB_LAUNCH)
@@ -1834,7 +1834,7 @@ static int _batch_launch_defer(queued_request_t *queued_req_ptr)
 		if (tmp == (READY_JOB_STATE | READY_NODE_STATE)) {
 			nodes_ready = 1;
 			if (launch_msg_ptr->alias_list &&
-			    !strcmp(launch_msg_ptr->alias_list, "TBD")) {
+			    !xstrcmp(launch_msg_ptr->alias_list, "TBD")) {
 				/* Update launch RPC with correct node
 				 * aliases */
 				struct job_record *job_ptr;
@@ -1870,17 +1870,8 @@ static int _batch_launch_defer(queued_request_t *queued_req_ptr)
 #endif
 	}
 
-	delay_time = difftime(now, job_ptr->start_time);
 	if (nodes_ready) {
-		/* ready to launch, adjust time limit for boot time */
-		if (delay_time && (job_ptr->time_limit != INFINITE) &&
-		    (!wiki2_sched)) {
-			verbose("Job %u launch delayed by %d secs, "
-				"updating end_time",
-				launch_msg_ptr->job_id, delay_time);
-			job_ptr->end_time += delay_time;
-			job_ptr->end_time_exp = job_ptr->end_time;
-		}
+		job_config_fini(job_ptr);
 		queued_req_ptr->last_attempt = (time_t) 0;
 		return 0;
 	}
@@ -1890,18 +1881,10 @@ static int _batch_launch_defer(queued_request_t *queued_req_ptr)
 		queued_req_ptr->last_attempt  = now;
 	} else if (difftime(now, queued_req_ptr->first_attempt) >=
 				 slurm_get_resume_timeout()) {
-		error("agent waited too long for nodes to respond, "
-		      "sending batch request anyway...");
-		if (delay_time && (job_ptr->time_limit != INFINITE) &&
-		    (!wiki2_sched)) {
-			verbose("Job %u launch delayed by %d secs, "
-				"updating end_time",
-				launch_msg_ptr->job_id, delay_time);
-			job_ptr->end_time += delay_time;
-			job_ptr->end_time_exp = job_ptr->end_time;
-		}
-		queued_req_ptr->last_attempt = (time_t) 0;
-		return 0;
+		/* Nodes will get marked DOWN and job requeued, if possible */
+		error("agent waited too long for nodes to respond, abort launch of job %u",
+		      job_ptr->job_id);
+		return -1;
 	}
 
 	queued_req_ptr->last_attempt  = now;
diff --git a/src/slurmctld/backup.c b/src/slurmctld/backup.c
index 1db689af5..df69d3a58 100644
--- a/src/slurmctld/backup.c
+++ b/src/slurmctld/backup.c
@@ -334,8 +334,8 @@ static void *_background_rpc_mgr(void *no_data)
 	lock_slurmctld(config_read_lock);
 
 	/* set node_addr to bind to (NULL means any) */
-	if ((strcmp(slurmctld_conf.backup_controller,
-		    slurmctld_conf.backup_addr) != 0)) {
+	if ((xstrcmp(slurmctld_conf.backup_controller,
+		     slurmctld_conf.backup_addr) != 0)) {
 		node_addr = slurmctld_conf.backup_addr ;
 	}
 
diff --git a/src/slurmctld/burst_buffer.c b/src/slurmctld/burst_buffer.c
index 8e3489322..13c0e5ba5 100644
--- a/src/slurmctld/burst_buffer.c
+++ b/src/slurmctld/burst_buffer.c
@@ -158,7 +158,7 @@ extern int bb_g_init(void)
 		xrealloc(ops, (sizeof(slurm_bb_ops_t) * (g_context_cnt + 1)));
 		xrealloc(g_context,
 			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
-		if (strncmp(type, "burst_buffer/", 13) == 0)
+		if (xstrncmp(type, "burst_buffer/", 13) == 0)
 			type += 13; /* backward compatibility */
 		type = xstrdup_printf("burst_buffer/%s", type);
 		g_context[g_context_cnt] = plugin_context_create(
@@ -321,7 +321,7 @@ extern uint64_t bb_g_get_system_size(char *name)
 
 	(void) bb_g_init();
 
-	if (strncmp(name, "burst_buffer/", 13))
+	if (xstrncmp(name, "burst_buffer/", 13))
 		offset = 13;
 
 	slurm_mutex_lock(&g_context_lock);
diff --git a/src/slurmctld/controller.c b/src/slurmctld/controller.c
index 73b9da4bb..7dfbcd34b 100644
--- a/src/slurmctld/controller.c
+++ b/src/slurmctld/controller.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2015 SchedMD LLC.
+ *  Portions Copyright (C) 2010-2016 SchedMD LLC.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov>, Kevin Tew <tew1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -71,6 +71,7 @@
 #include "src/common/layouts_mgr.h"
 #include "src/common/log.h"
 #include "src/common/macros.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/pack.h"
 #include "src/common/power.h"
@@ -82,6 +83,7 @@
 #include "src/common/slurm_ext_sensors.h"
 #include "src/common/slurm_jobacct_gather.h"
 #include "src/common/slurm_jobcomp.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_priority.h"
 #include "src/common/slurm_protocol_api.h"
 #include "src/common/slurm_protocol_interface.h"
@@ -103,12 +105,12 @@
 #include "src/slurmctld/locks.h"
 #include "src/slurmctld/ping_nodes.h"
 #include "src/slurmctld/port_mgr.h"
+#include "src/slurmctld/power_save.h"
 #include "src/slurmctld/powercapping.h"
 #include "src/slurmctld/preempt.h"
 #include "src/slurmctld/proc_req.h"
 #include "src/slurmctld/read_config.h"
 #include "src/slurmctld/reservation.h"
-#include "src/slurmctld/sicp.h"
 #include "src/slurmctld/slurmctld.h"
 #include "src/slurmctld/slurmctld_plugstack.h"
 #include "src/slurmctld/sched_plugin.h"
@@ -145,8 +147,6 @@
  *
  * The OpenSSL code produces a bunch of errors related to use of
  *    non-initialized memory use.
- * The switch/elan functions will report one block "possibly lost"
- *    (640 bytes), it is really not lost.
  * The _keyvalue_regex_init() function will generate two blocks "definitely
  *    lost", both of size zero. We haven't bothered to address this.
  * On some systems dlopen() will generate a small number of "definitely
@@ -190,7 +190,8 @@ static int      job_sched_cnt = 0;
 static uint32_t max_server_threads = MAX_SERVER_THREADS;
 static time_t	next_stats_reset = 0;
 static int	new_nice = 0;
-static char	node_name[MAX_SLURM_NAME];
+static char	node_name_short[MAX_SLURM_NAME];
+static char	node_name_long[MAX_SLURM_NAME];
 static int	recover   = DEFAULT_RECOVER;
 static pthread_mutex_t sched_cnt_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t server_thread_cond = PTHREAD_COND_INITIALIZER;
@@ -233,7 +234,8 @@ static void *       _slurmctld_rpc_mgr(void *no_data);
 static void *       _slurmctld_signal_hand(void *no_data);
 static void         _test_thread_limit(void);
 inline static void  _update_cred_key(void);
-static void	    _verify_clustername(void);
+static bool	    _verify_clustername(void);
+static void	    _create_clustername_file(void);
 static void         _update_nice(void);
 inline static void  _usage(char *prog_name);
 static bool         _valid_controller(void);
@@ -250,7 +252,7 @@ int main(int argc, char *argv[])
 		WRITE_LOCK, WRITE_LOCK, WRITE_LOCK, WRITE_LOCK };
 	slurm_trigger_callbacks_t callbacks;
 	char *dir_name;
-
+	bool create_clustername_file;
 	/*
 	 * Make sure we have no extra open files which
 	 * would be propagated to spawned tasks.
@@ -273,9 +275,11 @@ int main(int argc, char *argv[])
 
 	update_logging();
 
-	/* verify clustername from conf matches value in spool dir
-	 * exit if inconsistent to protect state files from corruption */
-	_verify_clustername();
+	/* Verify clustername from conf matches value in spool dir
+	 * exit if inconsistent to protect state files from corruption.
+	 * This needs to be done before we kill the old one just incase we
+	 * fail. */
+	create_clustername_file = _verify_clustername();
 
 	_update_nice();
 	_kill_old_slurmctld();
@@ -307,21 +311,25 @@ int main(int argc, char *argv[])
 	 */
 	_init_pidfile();
 	_become_slurm_user();
+
+	if (create_clustername_file)
+		_create_clustername_file();
+
 	if (daemonize)
 		_set_work_dir();
 
 	if (stat(slurmctld_conf.mail_prog, &stat_buf) != 0)
 		error("Configured MailProg is invalid");
 
-	if (!strcmp(slurmctld_conf.accounting_storage_type,
-		    "accounting_storage/none")) {
-		if (strcmp(slurmctld_conf.job_acct_gather_type,
-			   "jobacct_gather/none"))
+	if (!xstrcmp(slurmctld_conf.accounting_storage_type,
+		     "accounting_storage/none")) {
+		if (xstrcmp(slurmctld_conf.job_acct_gather_type,
+			    "jobacct_gather/none"))
 			error("Job accounting information gathered, "
 			      "but not stored");
 	} else {
-		if (!strcmp(slurmctld_conf.job_acct_gather_type,
-			    "jobacct_gather/none"))
+		if (!xstrcmp(slurmctld_conf.job_acct_gather_type,
+			     "jobacct_gather/none"))
 			info("Job accounting information stored, "
 			     "but details not gathered");
 	}
@@ -354,8 +362,8 @@ int main(int argc, char *argv[])
 	association_based_accounting =
 		slurm_get_is_association_based_accounting();
 	accounting_enforce = slurmctld_conf.accounting_storage_enforce;
-	if (!strcasecmp(slurmctld_conf.accounting_storage_type,
-		       "accounting_storage/slurmdbd")) {
+	if (!xstrcasecmp(slurmctld_conf.accounting_storage_type,
+			 "accounting_storage/slurmdbd")) {
 		with_slurmdbd = 1;
 		/* we need job_list not to be NULL */
 		init_job_conf();
@@ -385,7 +393,9 @@ int main(int argc, char *argv[])
 	info("%s version %s started on cluster %s",
 	     slurm_prog_name, SLURM_VERSION_STRING, slurmctld_cluster_name);
 
-	if ((error_code = gethostname_short(node_name, MAX_SLURM_NAME)))
+	if ((error_code = gethostname_short(node_name_short, MAX_SLURM_NAME)))
+		fatal("getnodename_short error %s", slurm_strerror(error_code));
+	if ((error_code = gethostname(node_name_long, MAX_SLURM_NAME)))
 		fatal("getnodename error %s", slurm_strerror(error_code));
 
 	/* init job credential stuff */
@@ -398,7 +408,8 @@ int main(int argc, char *argv[])
 
 	/* Must set before plugins are loaded. */
 	if (slurmctld_conf.backup_controller &&
-	    (strcmp(node_name, slurmctld_conf.backup_controller) == 0)) {
+	    ((xstrcmp(node_name_short,slurmctld_conf.backup_controller) == 0) ||
+	     (xstrcmp(node_name_long, slurmctld_conf.backup_controller) == 0))) {
 #ifndef HAVE_ALPS_CRAY
 		char *sched_params = NULL;
 #endif
@@ -441,8 +452,16 @@ int main(int argc, char *argv[])
 		fatal( "failed to initialize job_submit plugin");
 	if (ext_sensors_init() != SLURM_SUCCESS )
 		fatal( "failed to initialize ext_sensors plugin");
+	if (node_features_g_init() != SLURM_SUCCESS )
+		fatal( "failed to initialize node_features plugin");	
 	if (switch_g_slurmctld_init() != SLURM_SUCCESS )
 		fatal( "failed to initialize switch plugin");
+	config_power_mgr();
+	if (node_features_g_node_power() && !power_save_test()) {
+		fatal("PowerSave required with NodeFeatures plugin, "
+		      "but not fully configured (SuspendProgram, "
+		      "ResumeProgram and SuspendTime all required)");
+	}
 
 	while (1) {
 		/* initialization for each primary<->backup switch */
@@ -486,9 +505,10 @@ int main(int argc, char *argv[])
 				_accounting_mark_all_nodes_down("cold-start");
 			}
 		} else {
-			error("this host (%s) not valid controller (%s or %s)",
-				node_name, slurmctld_conf.control_machine,
-				slurmctld_conf.backup_controller);
+			error("this host (%s/%s) not a valid controller "
+			      "(%s or %s)", node_name_short, node_name_long,
+			      slurmctld_conf.control_machine,
+			      slurmctld_conf.backup_controller);
 			exit(0);
 		}
 
@@ -532,8 +552,8 @@ int main(int argc, char *argv[])
 			fatal( "failed to initialize burst buffer plugin");
 		if (power_g_init() != SLURM_SUCCESS )
 			fatal( "failed to initialize power management plugin");
-		sicp_init();
-
+		if (slurm_mcs_init() != SLURM_SUCCESS)
+			fatal("failed to initialize mcs plugin");
 
 		/*
 		 * create attached thread to process RPCs
@@ -597,7 +617,7 @@ int main(int argc, char *argv[])
 		slurmctld_config.thread_id_save = (pthread_t) 0;
 		bb_g_fini();
 		power_g_fini();
-		sicp_fini();
+		slurm_mcs_fini();
 
 		if (running_cache) {
 			/* break out and end the association cache
@@ -666,6 +686,7 @@ int main(int argc, char *argv[])
 	job_fini();
 	part_fini();	/* part_fini() must precede node_fini() */
 	node_fini();
+	node_features_g_fini();
 	purge_front_end_state();
 	resv_fini();
 	trigger_fini();
@@ -768,7 +789,7 @@ static void  _init_config(void)
 	slurmctld_config.thread_id_main = pthread_self();
 	slurmctld_config.scheduling_disabled = false;
 #ifdef WITH_PTHREADS
-	pthread_mutex_init(&slurmctld_config.thread_count_lock, NULL);
+	slurm_mutex_init(&slurmctld_config.thread_count_lock);
 	slurmctld_config.thread_id_main    = (pthread_t) 0;
 	slurmctld_config.thread_id_sig     = (pthread_t) 0;
 	slurmctld_config.thread_id_rpc     = (pthread_t) 0;
@@ -837,9 +858,8 @@ static void *_slurmctld_signal_hand(void *no_data)
 	sigset_t set;
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_sigmgr", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_sigmgr");
+	if (prctl(PR_SET_NAME, "sigmgr", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "sigmgr");
 	}
 #endif
 	(void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
@@ -918,9 +938,8 @@ static void *_slurmctld_rpc_mgr(void *no_data)
 	char* node_addr = NULL;
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_rpcmgr", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_rpcmgr");
+	if (prctl(PR_SET_NAME, "rpcmgr", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "rpcmgr");
 	}
 #endif
 
@@ -936,13 +955,14 @@ static void *_slurmctld_rpc_mgr(void *no_data)
 
 	/* set node_addr to bind to (NULL means any) */
 	if (slurmctld_conf.backup_controller && slurmctld_conf.backup_addr &&
-	    (strcmp(node_name, slurmctld_conf.backup_controller) == 0) &&
-	    (strcmp(slurmctld_conf.backup_controller,
-		    slurmctld_conf.backup_addr) != 0)) {
+	    ((xstrcmp(node_name_short,slurmctld_conf.backup_controller) == 0) ||
+	     (xstrcmp(node_name_long, slurmctld_conf.backup_controller) == 0))&&
+	    (xstrcmp(slurmctld_conf.backup_controller,
+		     slurmctld_conf.backup_addr) != 0)) {
 		node_addr = slurmctld_conf.backup_addr ;
 	}
 	else if (_valid_controller() &&
-		 strcmp(slurmctld_conf.control_machine,
+		 xstrcmp(slurmctld_conf.control_machine,
 			 slurmctld_conf.control_addr)) {
 		node_addr = slurmctld_conf.control_addr ;
 	}
@@ -1069,9 +1089,8 @@ static void *_service_connection(void *arg)
 	slurm_msg_t *msg = xmalloc(sizeof(slurm_msg_t));
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_srvcn", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_srvcn");
+	if (prctl(PR_SET_NAME, "srvcn", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "srvcn");
 	}
 #endif
 	slurm_msg_t_init(msg);
@@ -1080,7 +1099,10 @@ static void *_service_connection(void *arg)
 	 * possibility for slurmctld_req() to close accepted connection.
 	 */
 	if (slurm_receive_msg(conn->newsockfd, msg, 0) != 0) {
-		error("slurm_receive_msg: %m");
+		char addr_buf[32];
+		slurm_print_slurm_addr(&conn->cli_addr, addr_buf,
+				       sizeof(addr_buf));
+		error("slurm_receive_msg [%s]: %m", addr_buf);
 		/* close the new socket */
 		slurm_close(conn->newsockfd);
 		goto cleanup;
@@ -1382,13 +1404,13 @@ static int _init_tres(void)
 
 		tres_rec->type = temp_char;
 
-		if (!strcasecmp(temp_char, "cpu"))
+		if (!xstrcasecmp(temp_char, "cpu"))
 			tres_rec->id = TRES_CPU;
-		else if (!strcasecmp(temp_char, "mem"))
+		else if (!xstrcasecmp(temp_char, "mem"))
 			tres_rec->id = TRES_MEM;
-		else if (!strcasecmp(temp_char, "energy"))
+		else if (!xstrcasecmp(temp_char, "energy"))
 			tres_rec->id = TRES_ENERGY;
-		else if (!strcasecmp(temp_char, "node"))
+		else if (!xstrcasecmp(temp_char, "node"))
 			tres_rec->id = TRES_NODE;
 		else if (!strncasecmp(temp_char, "bb/", 3)) {
 			tres_rec->type[2] = '\0';
@@ -1931,7 +1953,8 @@ static void *_slurmctld_background(void *no_data)
 		    (difftime(now, last_assert_primary_time) >=
 		     slurmctld_conf.slurmctld_timeout) &&
 		    slurmctld_conf.backup_controller &&
-		    strcmp(node_name, slurmctld_conf.backup_controller)) {
+		    xstrcmp(node_name_short,slurmctld_conf.backup_controller) &&
+		    xstrcmp(node_name_long, slurmctld_conf.backup_controller)) {
 			now = time(NULL);
 			last_assert_primary_time = now;
 			(void) _shutdown_backup_controller(0);
@@ -2137,13 +2160,13 @@ extern void set_cluster_tres(bool assoc_mgr_locked)
 		} else if (tres_rec->id == TRES_MEM) {
 			mem_tres = tres_rec;
 			continue;
-		} else if (!strcmp(tres_rec->type, "bb")) {
+		} else if (!xstrcmp(tres_rec->type, "bb")) {
 			tres_rec->count = bb_g_get_system_size(tres_rec->name);
 			continue;
-		} else if (!strcmp(tres_rec->type, "gres")) {
+		} else if (!xstrcmp(tres_rec->type, "gres")) {
 			tres_rec->count = gres_get_system_cnt(tres_rec->name);
 			continue;
-		} else if (!strcmp(tres_rec->type, "license")) {
+		} else if (!xstrcmp(tres_rec->type, "license")) {
 			tres_rec->count = get_total_license_cnt(
 				tres_rec->name);
 			continue;
@@ -2190,9 +2213,10 @@ extern void set_cluster_tres(bool assoc_mgr_locked)
 							   true);
 		xfree(node_ptr->tres_fmt_str);
 		node_ptr->tres_fmt_str =
-			assoc_mgr_make_tres_str_from_array(node_ptr->tres_cnt,
-							   0,
-							   true);
+			assoc_mgr_make_tres_str_from_array(
+				node_ptr->tres_cnt,
+				TRES_STR_CONVERT_UNITS,
+				true);
 	}
 
 	/* FIXME: cluster_cpus probably needs to be removed and handled
@@ -2542,14 +2566,17 @@ static void _update_nice(void)
 
 /* Verify that ClusterName from slurm.conf matches the state directory.
  * If mismatched exit to protect state files from corruption.
- * If the clustername file does not exist, create it. */
-static void _verify_clustername(void)
+ * If the clustername file does not exist, return true so we can create it later
+ * after dropping privileges. */
+static bool _verify_clustername(void)
 {
 	FILE *fp;
 	char *filename = NULL;
 	char name[512];
+	bool create_file = false;
+
 	xstrfmtcat(filename, "%s/clustername",
-				slurmctld_conf.state_save_location);
+		   slurmctld_conf.state_save_location);
 
 	if ((fp = fopen(filename, "r"))) {
 		/* read value and compare */
@@ -2557,32 +2584,47 @@ static void _verify_clustername(void)
 		fclose(fp);
 		if (xstrcmp(name, slurmctld_conf.cluster_name)) {
 			fatal("CLUSTER NAME MISMATCH.\n"
-				"slurmctld has been started with \""
-				"ClusterName=%s\", but read \"%s\" from "
-				"the state files in StateSaveLocation.\n"
-				"Running multiple clusters from a shared "
-				"StateSaveLocation WILL CAUSE CORRUPTION.\n"
-				"Remove %s to override this safety check if "
-				"this is intentional (e.g., the ClusterName "
-				"has changed).", name,
-				slurmctld_conf.cluster_name, filename);
-			exit(1);
-		}
-	} else if (slurmctld_conf.cluster_name) {
-		debug("creating clustername file: %s", filename);
-		if (!(fp = fopen(filename, "w"))) {
-			fatal("%s: failed to create file %s",
-				__FUNCTION__, filename);
+			      "slurmctld has been started with \""
+			      "ClusterName=%s\", but read \"%s\" from "
+			      "the state files in StateSaveLocation.\n"
+			      "Running multiple clusters from a shared "
+			      "StateSaveLocation WILL CAUSE CORRUPTION.\n"
+			      "Remove %s to override this safety check if "
+			      "this is intentional (e.g., the ClusterName "
+			      "has changed).", name,
+			      slurmctld_conf.cluster_name, filename);
 			exit(1);
 		}
+	} else if (slurmctld_conf.cluster_name)
+		create_file = true;
 
-		if (fputs(slurmctld_conf.cluster_name, fp) < 0) {
-			fatal("%s: failed to write to file %s",
-				__FUNCTION__, filename);
-			exit(1);
-		}
-		fclose(fp);
+	xfree(filename);
+
+	return create_file;
+}
+
+static void _create_clustername_file(void)
+{
+	FILE *fp;
+	char *filename = NULL;
+
+	if (!slurmctld_conf.cluster_name)
+		return;
+
+	filename = xstrdup_printf("%s/clustername",
+				  slurmctld_conf.state_save_location);
+
+	debug("creating clustername file: %s", filename);
+	if (!(fp = fopen(filename, "w"))) {
+		fatal("%s: failed to create file %s", __func__, filename);
+		exit(1);
+	}
+
+	if (fputs(slurmctld_conf.cluster_name, fp) < 0) {
+		fatal("%s: failed to write to file %s", __func__, filename);
+		exit(1);
 	}
+	fclose(fp);
 
 	xfree(filename);
 }
@@ -2609,7 +2651,7 @@ static void _kill_old_slurmctld(void)
 /* NOTE: No need to lock the config data since we are still single-threaded */
 static void _init_pidfile(void)
 {
-	if (strcmp(slurmctld_conf.slurmctld_pidfile,
+	if (xstrcmp(slurmctld_conf.slurmctld_pidfile,
 		   slurmctld_conf.slurmd_pidfile) == 0)
 		error("SlurmctldPid == SlurmdPid, use different names");
 
@@ -2676,6 +2718,18 @@ static void *_assoc_cache_mgr(void *no_data)
 		assoc_mgr_refresh_lists(acct_db_conn, 0);
 		if (running_cache)
 			unlock_slurmctld(job_write_lock);
+		else if (g_tres_count != slurmctld_tres_cnt) {
+			/* This has to be done outside of the job write lock.
+			 * This should only happen in very rare situations
+			 * where we have state, but the database some how has
+			 * changed out from under us. */
+			unlock_slurmctld(job_write_lock);
+			info("TRES in database does not match cache "
+			     "(%u != %u).  Updating...",
+			     g_tres_count, slurmctld_tres_cnt);
+			_init_tres();
+			lock_slurmctld(job_write_lock);
+		}
 		slurm_mutex_unlock(&assoc_cache_mutex);
 	}
 
@@ -2835,7 +2889,8 @@ static bool  _valid_controller(void)
 	if (slurmctld_conf.control_machine == NULL)
 		return match;
 
-	if (strcmp(node_name, slurmctld_conf.control_machine) == 0)
+	if ((xstrcmp(node_name_short,slurmctld_conf.control_machine) == 0) ||
+	    (xstrcmp(node_name_long, slurmctld_conf.control_machine) == 0))
 		match = true;
 	else if (strchr(slurmctld_conf.control_machine, ',')) {
 		char *token, *last = NULL;
@@ -2843,7 +2898,8 @@ static bool  _valid_controller(void)
 
 		token = strtok_r(tmp_name, ",", &last);
 		while (token) {
-			if (strcmp(node_name, token) == 0) {
+			if ((xstrcmp(node_name_short, token) == 0) ||
+			    (xstrcmp(node_name_long, token) == 0)) {
 				match = true;
 				break;
 			}
diff --git a/src/slurmctld/front_end.c b/src/slurmctld/front_end.c
index 0682786ee..a3fe8af20 100644
--- a/src/slurmctld/front_end.c
+++ b/src/slurmctld/front_end.c
@@ -127,7 +127,7 @@ static int _open_front_end_state_file(char **state_file)
 static void _pack_front_end(struct front_end_record *dump_front_end_ptr,
 			    Buf buffer, uint16_t protocol_version)
 {
-	if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		packstr(dump_front_end_ptr->allow_groups, buffer);
 		packstr(dump_front_end_ptr->allow_users, buffer);
 		pack_time(dump_front_end_ptr->boot_time, buffer);
@@ -141,21 +141,6 @@ static void _pack_front_end(struct front_end_record *dump_front_end_ptr,
 		pack_time(dump_front_end_ptr->reason_time, buffer);
 		pack32(dump_front_end_ptr->reason_uid, buffer);
 
-		pack_time(dump_front_end_ptr->slurmd_start_time, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		packstr(dump_front_end_ptr->allow_groups, buffer);
-		packstr(dump_front_end_ptr->allow_users, buffer);
-		pack_time(dump_front_end_ptr->boot_time, buffer);
-		packstr(dump_front_end_ptr->deny_groups, buffer);
-		packstr(dump_front_end_ptr->deny_users, buffer);
-		packstr(dump_front_end_ptr->name, buffer);
-		pack16(dump_front_end_ptr->node_state, buffer);
-		packstr(dump_front_end_ptr->version, buffer);
-
-		packstr(dump_front_end_ptr->reason, buffer);
-		pack_time(dump_front_end_ptr->reason_time, buffer);
-		pack32(dump_front_end_ptr->reason_uid, buffer);
-
 		pack_time(dump_front_end_ptr->slurmd_start_time, buffer);
 	} else {
 		error("_pack_front_end: Unsupported slurm version %u",
@@ -236,7 +221,7 @@ extern front_end_record_t *assign_front_end(struct job_record *job_ptr)
 		for (i = 0, front_end_ptr = front_end_nodes;
 		     i < front_end_node_cnt; i++, front_end_ptr++) {
 			if (job_ptr->batch_host) { /* Find specific front-end */
-				if (strcmp(job_ptr->batch_host,
+				if (xstrcmp(job_ptr->batch_host,
 					   front_end_ptr->name))
 					continue;
 				if (!_front_end_access(front_end_ptr, job_ptr))
@@ -322,7 +307,7 @@ extern int update_front_end(update_front_end_msg_t *msg_ptr)
 		for (i = 0, front_end_ptr = front_end_nodes;
 		     i < front_end_node_cnt; i++, front_end_ptr++) {
 			xassert(front_end_ptr->magic == FRONT_END_MAGIC);
-			if (strcmp(this_node_name, front_end_ptr->name))
+			if (xstrcmp(this_node_name, front_end_ptr->name))
 				continue;
 			if (msg_ptr->node_state == (uint32_t)NO_VAL) {
 				;	/* No change in node state */
@@ -382,7 +367,7 @@ extern front_end_record_t *find_front_end_record(char *name)
 	for (i = 0, front_end_ptr = front_end_nodes;
 	     i < front_end_node_cnt; i++, front_end_ptr++) {
 		xassert(front_end_ptr->magic == FRONT_END_MAGIC);
-		if (strcmp(front_end_ptr->name, name) == 0)
+		if (xstrcmp(front_end_ptr->name, name) == 0)
 			return front_end_ptr;
 	}
 #endif
@@ -531,8 +516,8 @@ extern void restore_front_end_state(int recover)
 			return;	/* Prevent CLANG false positive */
 		}
 		for (i = 0; i < front_end_node_cnt; i++) {
-			if (strcmp(front_end_nodes[i].name,
-				   slurm_conf_fe_ptr->frontends) == 0)
+			if (xstrcmp(front_end_nodes[i].name,
+				    slurm_conf_fe_ptr->frontends) == 0)
 				break;
 		}
 		if (i >= front_end_node_cnt) {
@@ -832,7 +817,7 @@ extern int load_all_front_end_state(bool state_only)
 
 	safe_unpackstr_xmalloc( &ver_str, &name_len, buffer);
 	debug3("Version string in front_end_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, FRONT_END_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, FRONT_END_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t) NO_VAL) {
@@ -849,10 +834,9 @@ extern int load_all_front_end_state(bool state_only)
 
 	while (remaining_buf (buffer) > 0) {
 		uint32_t base_state = (uint32_t)NO_VAL;
-		uint16_t tmp_state;
 		uint16_t obj_protocol_version = (uint16_t)NO_VAL;;
 
-		if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc (&node_name, &name_len, buffer);
 			safe_unpack32 (&node_state,  buffer);
 			safe_unpackstr_xmalloc (&reason,    &name_len, buffer);
@@ -860,15 +844,6 @@ extern int load_all_front_end_state(bool state_only)
 			safe_unpack32 (&reason_uid,  buffer);
 			safe_unpack16 (&obj_protocol_version, buffer);
 			base_state = node_state & NODE_STATE_BASE;
-		} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-			safe_unpackstr_xmalloc (&node_name, &name_len, buffer);
-			safe_unpack16 (&tmp_state,  buffer);
-			safe_unpackstr_xmalloc (&reason,    &name_len, buffer);
-			safe_unpack_time (&reason_time, buffer);
-			safe_unpack32 (&reason_uid,  buffer);
-			safe_unpack16 (&obj_protocol_version, buffer);
-			node_state = tmp_state;
-			base_state = node_state & NODE_STATE_BASE;
 		} else
 			goto unpack_error;
 
@@ -961,7 +936,7 @@ extern void set_front_end_down (front_end_record_t *front_end_ptr,
 	trigger_front_end_down(front_end_ptr);
 	(void) kill_job_by_front_end_name(front_end_ptr->name);
 	if ((front_end_ptr->reason == NULL) ||
-	    (strncmp(front_end_ptr->reason, "Not responding", 14) == 0)) {
+	    (xstrncmp(front_end_ptr->reason, "Not responding", 14) == 0)) {
 		xfree(front_end_ptr->reason);
 		front_end_ptr->reason = xstrdup(reason);
 		front_end_ptr->reason_time = now;
diff --git a/src/slurmctld/gang.c b/src/slurmctld/gang.c
index 696e93d73..469c1c964 100644
--- a/src/slurmctld/gang.c
+++ b/src/slurmctld/gang.c
@@ -92,7 +92,7 @@ struct gs_job {
 
 struct gs_part {
 	char *part_name;
-	uint16_t priority;
+	uint16_t priority;	/* Job priority tier */
 	uint32_t num_jobs;
 	struct gs_job **job_list;
 	uint32_t job_list_size;
@@ -213,7 +213,7 @@ static uint16_t _get_gr_type(void)
 	if (slurmctld_conf.select_type_param & CR_CORE)
 		return GS_CORE;
 	if (slurmctld_conf.select_type_param & CR_CPU) {
-		if (!strcmp(slurmctld_conf.task_plugin, "task/none"))
+		if (!xstrcmp(slurmctld_conf.task_plugin, "task/none"))
 			return GS_CPU;
 		return GS_CPU2;
 	}
@@ -231,7 +231,7 @@ static uint16_t _get_part_gr_type(struct part_record *part_ptr)
 		if (part_ptr->cr_type & CR_CORE)
 			return GS_CORE;
 		if (part_ptr->cr_type & CR_CPU) {
-			if (!strcmp(slurmctld_conf.task_plugin, "task/none"))
+			if (!xstrcmp(slurmctld_conf.task_plugin, "task/none"))
 				return GS_CPU;
 			return GS_CPU2;
 		}
@@ -353,7 +353,7 @@ static void _build_parts(void)
 	while ((p_ptr = (struct part_record *) list_next(part_iterator))) {
 		gs_part_ptr = xmalloc(sizeof(struct gs_part));
 		gs_part_ptr->part_name = xstrdup(p_ptr->name);
-		gs_part_ptr->priority = p_ptr->priority;
+		gs_part_ptr->priority = p_ptr->priority_tier;
 		/* everything else is already set to zero/NULL */
 		list_append(gs_part_list, gs_part_ptr);
 	}
@@ -365,7 +365,7 @@ static int _find_gs_part(void *x, void *key)
 {
 	struct gs_part *gs_part_ptr = (struct gs_part *) x;
 	char *name = (char *) key;
-	if (!strcmp(name, gs_part_ptr->part_name))
+	if (!xstrcmp(name, gs_part_ptr->part_name))
 		return 1;
 	return 0;
 }
@@ -1157,11 +1157,11 @@ static void _spawn_timeslicer_thread(void)
 {
 	pthread_attr_t thread_attr_msg;
 
-	pthread_mutex_lock( &thread_flag_mutex );
+	slurm_mutex_lock( &thread_flag_mutex );
 	if (thread_running) {
 		error("timeslicer thread already running, not starting "
 		      "another");
-		pthread_mutex_unlock(&thread_flag_mutex);
+		slurm_mutex_unlock(&thread_flag_mutex);
 		return;
 	}
 
@@ -1172,7 +1172,7 @@ static void _spawn_timeslicer_thread(void)
 
 	slurm_attr_destroy(&thread_attr_msg);
 	thread_running = true;
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 }
 
 /* Initialize data structures and start the gang scheduling thread */
@@ -1195,11 +1195,11 @@ extern int gs_init(void)
 	/* load the physical resource count data */
 	_load_phys_res_cnt();
 
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 	_build_parts();
 	/* load any currently running jobs */
 	_scan_slurm_job_list();
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 
 	/* spawn the timeslicer thread */
 	_spawn_timeslicer_thread();
@@ -1211,28 +1211,31 @@ extern int gs_init(void)
 /* Terminate the gang scheduling thread and free its data structures */
 extern int gs_fini(void)
 {
+	if (!(slurmctld_conf.preempt_mode & PREEMPT_MODE_GANG))
+		return SLURM_SUCCESS;
+
 	/* terminate the timeslicer thread */
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 		info("gang: entering gs_fini");
-	pthread_mutex_lock(&thread_flag_mutex);
+	slurm_mutex_lock(&thread_flag_mutex);
 	if (thread_running) {
-		pthread_mutex_lock(&term_lock);
+		slurm_mutex_lock(&term_lock);
 		thread_shutdown = true;
 		pthread_cond_signal(&term_cond);
-		pthread_mutex_unlock(&term_lock);
+		slurm_mutex_unlock(&term_lock);
 		usleep(120000);
 		if (timeslicer_thread_id)
 			error("gang: timeslicer pthread still running");
 	}
-	pthread_mutex_unlock(&thread_flag_mutex);
+	slurm_mutex_unlock(&thread_flag_mutex);
 
 	FREE_NULL_LIST(preempt_job_list);
 
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 	FREE_NULL_LIST(gs_part_list);
 	gs_part_list = NULL;
 	xfree(gs_bits_per_node);
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 		info("gang: leaving gs_fini");
 
@@ -1257,7 +1260,7 @@ extern int gs_job_start(struct job_record *job_ptr)
 		part_name = job_ptr->part_ptr->name;
 	else
 		part_name = job_ptr->partition;
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 	p_ptr = list_find_first(gs_part_list, _find_gs_part, part_name);
 	if (p_ptr) {
 		job_sig_state = _add_job_to_part(p_ptr, job_ptr);
@@ -1265,7 +1268,7 @@ extern int gs_job_start(struct job_record *job_ptr)
 		if (job_sig_state == GS_RESUME)
 			_update_all_active_rows();
 	}
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 
 	if (!p_ptr) {
 		/* No partition was found for this job, so let it run
@@ -1291,9 +1294,9 @@ extern int gs_job_scan(void)
 
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 		info("gang: entering gs_job_scan");
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 	_scan_slurm_job_list();
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 
 	_preempt_job_dequeue();	/* MUST BE OUTSIDE OF data_mutex lock */
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
@@ -1341,10 +1344,10 @@ extern int gs_job_fini(struct job_record *job_ptr)
 		part_name = job_ptr->part_ptr->name;
 	else
 		part_name = job_ptr->partition;
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 	p_ptr = list_find_first(gs_part_list, _find_gs_part, part_name);
 	if (!p_ptr) {
-		pthread_mutex_unlock(&data_mutex);
+		slurm_mutex_unlock(&data_mutex);
 		if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 			info("gang: leaving gs_job_fini");
 		return SLURM_SUCCESS;
@@ -1355,7 +1358,7 @@ extern int gs_job_fini(struct job_record *job_ptr)
 	/* this job may have preempted other jobs, so
 	 * check by updating all active rows */
 	_update_all_active_rows();
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 		info("gang: leaving gs_job_fini");
 
@@ -1403,7 +1406,7 @@ extern int gs_reconfig(void)
 
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
 		info("gang: entering gs_reconfig");
-	pthread_mutex_lock(&data_mutex);
+	slurm_mutex_lock(&data_mutex);
 
 	old_part_list = gs_part_list;
 	gs_part_list = NULL;
@@ -1471,7 +1474,7 @@ extern int gs_reconfig(void)
 	_scan_slurm_job_list();
 
 	FREE_NULL_LIST(old_part_list);
-	pthread_mutex_unlock(&data_mutex);
+	slurm_mutex_unlock(&data_mutex);
 
 	_preempt_job_dequeue();	/* MUST BE OUTSIDE OF data_mutex lock */
 	if (slurmctld_conf.debug_flags & DEBUG_FLAG_GANG)
@@ -1609,10 +1612,10 @@ static void _slice_sleep(void)
 	gettimeofday(&now, NULL);
 	ts.tv_sec = now.tv_sec + timeslicer_seconds;
 	ts.tv_nsec = now.tv_usec * 1000;
-	pthread_mutex_lock(&term_lock);
+	slurm_mutex_lock(&term_lock);
 	if (!thread_shutdown)
 		pthread_cond_timedwait(&term_cond, &term_lock, &ts);
-	pthread_mutex_unlock(&term_lock);
+	slurm_mutex_unlock(&term_lock);
 }
 
 /* The timeslicer thread */
@@ -1632,7 +1635,7 @@ static void *_timeslicer_thread(void *arg)
 			break;
 
 		lock_slurmctld(job_write_lock);
-		pthread_mutex_lock(&data_mutex);
+		slurm_mutex_lock(&data_mutex);
 		list_sort(gs_part_list, _sort_partitions);
 
 		/* scan each partition... */
@@ -1651,7 +1654,7 @@ static void *_timeslicer_thread(void *arg)
 			}
 		}
 		list_iterator_destroy(part_iterator);
-		pthread_mutex_unlock(&data_mutex);
+		slurm_mutex_unlock(&data_mutex);
 
 		/* Preempt jobs that were formerly only suspended */
 		_preempt_job_dequeue();	/* MUST BE OUTSIDE data_mutex lock */
diff --git a/src/slurmctld/groups.c b/src/slurmctld/groups.c
index dffb434a2..09c765ba6 100644
--- a/src/slurmctld/groups.c
+++ b/src/slurmctld/groups.c
@@ -158,6 +158,11 @@ extern uid_t *get_group_members(char *group_name)
 		group_uids[j++] = my_uid;
 	}
 
+	/* Note that in environments where user/group enumeration has
+	 * been disabled (typically necessary for large user/group
+	 * databases), the rest of this function essentially does
+	 * nothing.  */
+
 #ifdef HAVE_AIX
 	setgrent_r(&fp);
 	while (1) {
@@ -198,7 +203,7 @@ extern uid_t *get_group_members(char *group_name)
 		}
 #endif
 	        if (grp_result->gr_gid == my_gid) {
-			if (strcmp(grp_result->gr_name, group_name)) {
+			if (xstrcmp(grp_result->gr_name, group_name)) {
 				debug("including members of group '%s' as it "
 				      "corresponds to the same gid as group"
 				      " '%s'",grp_result->gr_name,group_name);
@@ -264,9 +269,9 @@ extern uid_t *get_group_members(char *group_name)
 /* Delete our group/uid cache */
 extern void clear_group_cache(void)
 {
-	pthread_mutex_lock(&group_cache_mutex);
+	slurm_mutex_lock(&group_cache_mutex);
 	FREE_NULL_LIST(group_cache_list);
-	pthread_mutex_unlock(&group_cache_mutex);
+	slurm_mutex_unlock(&group_cache_mutex);
 }
 
 /* Get a record from our group/uid cache.
@@ -278,15 +283,15 @@ static uid_t *_get_group_cache(char *group_name)
 	uid_t *group_uids = NULL;
 	int sz;
 
-	pthread_mutex_lock(&group_cache_mutex);
+	slurm_mutex_lock(&group_cache_mutex);
 	if (!group_cache_list) {
-		pthread_mutex_unlock(&group_cache_mutex);
+		slurm_mutex_unlock(&group_cache_mutex);
 		return NULL;
 	}
 
 	iter = list_iterator_create(group_cache_list);
 	while ((cache_rec = (struct group_cache_rec *) list_next(iter))) {
-		if (strcmp(group_name, cache_rec->group_name))
+		if (xstrcmp(group_name, cache_rec->group_name))
 			continue;
 		sz = sizeof(uid_t) * (cache_rec->uid_cnt + 1);
 		group_uids = (uid_t *) xmalloc(sz);
@@ -294,7 +299,7 @@ static uid_t *_get_group_cache(char *group_name)
 		break;
 	}
 	list_iterator_destroy(iter);
-	pthread_mutex_unlock(&group_cache_mutex);
+	slurm_mutex_unlock(&group_cache_mutex);
 	return group_uids;
 }
 
@@ -315,7 +320,7 @@ static void _put_group_cache(char *group_name, void *group_uids, int uid_cnt)
 	struct group_cache_rec *cache_rec;
 	int sz;
 
-	pthread_mutex_lock(&group_cache_mutex);
+	slurm_mutex_lock(&group_cache_mutex);
 	if (!group_cache_list) {
 		group_cache_list = list_create(_cache_del_func);
 	}
@@ -328,7 +333,7 @@ static void _put_group_cache(char *group_name, void *group_uids, int uid_cnt)
 	if (uid_cnt > 0)
 		memcpy(cache_rec->group_uids, group_uids, sz);
 	list_append(group_cache_list, cache_rec);
-	pthread_mutex_unlock(&group_cache_mutex);
+	slurm_mutex_unlock(&group_cache_mutex);
 }
 
 static void _log_group_members(char *group_name, uid_t *group_uids)
diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c
index 4e00fefe6..a9945c3cd 100644
--- a/src/slurmctld/job_mgr.c
+++ b/src/slurmctld/job_mgr.c
@@ -69,11 +69,13 @@
 #include "src/common/forward.h"
 #include "src/common/gres.h"
 #include "src/common/hostlist.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/parse_time.h"
 #include "src/common/power.h"
 #include "src/common/slurm_accounting_storage.h"
 #include "src/common/slurm_jobcomp.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_priority.h"
 #include "src/common/slurm_protocol_pack.h"
 #include "src/common/switch.h"
@@ -219,7 +221,7 @@ static job_array_resp_msg_t *_resp_array_xlate(resp_array_struct_t *resp,
 					       uint32_t job_id);
 static int  _resume_job_nodes(struct job_record *job_ptr, bool indf_susp);
 static void _send_job_kill(struct job_record *job_ptr);
-static int  _set_job_id(struct job_record *job_ptr, bool global_job);
+static int  _set_job_id(struct job_record *job_ptr);
 static void _set_job_requeue_exit_value(struct job_record *job_ptr);
 static void _signal_batch_job(struct job_record *job_ptr,
 			      uint16_t signal,
@@ -548,8 +550,8 @@ static void _delete_job_desc_files(uint32_t job_id)
 	f_dir = opendir(dir_name);
 	if (f_dir) {
 		while ((dir_ent = readdir(f_dir))) {
-			if (!strcmp(dir_ent->d_name, ".") ||
-			    !strcmp(dir_ent->d_name, ".."))
+			if (!xstrcmp(dir_ent->d_name, ".") ||
+			    !xstrcmp(dir_ent->d_name, ".."))
 				continue;
 			xstrfmtcat(file_name, "%s/%s", dir_name,
 				   dir_ent->d_name);
@@ -863,7 +865,7 @@ static time_t _get_last_state_write_time(void)
 
 	buffer = create_buf(data, data_size);
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
-	if (ver_str && !strcmp(ver_str, JOB_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, JOB_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 	safe_unpack_time(&buf_time, buffer);
 
@@ -932,7 +934,7 @@ extern int load_all_job_state(void)
 	buffer = create_buf(data, data_size);
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
 	debug3("Version string in job_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, JOB_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, JOB_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 	xfree(ver_str);
 
@@ -1028,7 +1030,7 @@ extern int load_last_job_id( void )
 	buffer = create_buf(data, data_size);
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
 	debug3("Version string in job_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, JOB_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, JOB_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 	xfree(ver_str);
 
@@ -1154,6 +1156,7 @@ static void _dump_job_state(struct job_record *dump_job_ptr, Buf buffer)
 	pack_time(dump_job_ptr->pre_sus_time, buffer);
 	pack_time(dump_job_ptr->resize_time, buffer);
 	pack_time(dump_job_ptr->tot_sus_time, buffer);
+	pack_time(dump_job_ptr->deadline, buffer);
 
 	pack16(dump_job_ptr->direct_set_prio, buffer);
 	pack32(dump_job_ptr->job_state, buffer);
@@ -1177,7 +1180,6 @@ static void _dump_job_state(struct job_record *dump_job_ptr, Buf buffer)
 	pack16(dump_job_ptr->alloc_resp_port, buffer);
 	pack16(dump_job_ptr->other_port, buffer);
 	pack8(dump_job_ptr->power_flags, buffer);
-	pack8(dump_job_ptr->sicp_mode, buffer);
 	pack16(dump_job_ptr->start_protocol_ver, buffer);
 	packdouble(dump_job_ptr->billable_tres, buffer);
 
@@ -1202,6 +1204,7 @@ static void _dump_job_state(struct job_record *dump_job_ptr, Buf buffer)
 	packstr(dump_job_ptr->network, buffer);
 	packstr(dump_job_ptr->licenses, buffer);
 	packstr(dump_job_ptr->mail_user, buffer);
+	packstr(dump_job_ptr->mcs_label, buffer);
 	packstr(dump_job_ptr->resv_name, buffer);
 	packstr(dump_job_ptr->batch_host, buffer);
 	packstr(dump_job_ptr->burst_buffer, buffer);
@@ -1260,9 +1263,10 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	uint32_t profile = ACCT_GATHER_PROFILE_NOT_SET;
 	uint32_t job_state;
 	time_t start_time, end_time, suspend_time, pre_sus_time, tot_sus_time;
-	time_t preempt_time = 0;
+	time_t preempt_time = 0, deadline = 0;
 	time_t resize_time = 0, now = time(NULL);
-	uint8_t reboot = 0, power_flags = 0, sicp_mode = 0;
+	uint8_t reboot = 0, power_flags = 0;
+	uint8_t uint8_tmp = 0;
 	uint32_t array_task_id = NO_VAL;
 	uint32_t array_flags = 0, max_run_tasks = 0, tot_run_tasks = 0;
 	uint32_t min_exit_code = 0, max_exit_code = 0, tot_comp_tasks = 0;
@@ -1280,7 +1284,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	char *licenses = NULL, *state_desc = NULL, *wckey = NULL;
 	char *resv_name = NULL, *gres = NULL, *batch_host = NULL;
 	char *gres_alloc = NULL, *gres_req = NULL, *gres_used = NULL;
-	char *burst_buffer = NULL, *task_id_str = NULL;
+	char *burst_buffer = NULL, *task_id_str = NULL, *mcs_label = NULL;
 	uint32_t task_id_size = NO_VAL;
 	char **spank_job_env = (char **) NULL;
 	List gres_list = NULL, part_ptr_list = NULL;
@@ -1301,7 +1305,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	memset(&limit_set, 0, sizeof(acct_policy_limit_set_t));
 	limit_set.tres = xmalloc(sizeof(uint16_t) * slurmctld_tres_cnt);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		safe_unpack32(&array_job_id, buffer);
 		safe_unpack32(&array_task_id, buffer);
 
@@ -1368,6 +1372,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack_time(&pre_sus_time, buffer);
 		safe_unpack_time(&resize_time, buffer);
 		safe_unpack_time(&tot_sus_time, buffer);
+		safe_unpack_time(&deadline, buffer);
 
 		safe_unpack16(&direct_set_prio, buffer);
 		safe_unpack32(&job_state, buffer);
@@ -1391,7 +1396,6 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack16(&alloc_resp_port, buffer);
 		safe_unpack16(&other_port, buffer);
 		safe_unpack8(&power_flags, buffer);
-		safe_unpack8(&sicp_mode, buffer);
 		safe_unpack16(&start_protocol_ver, buffer);
 		safe_unpackdouble(&billable_tres, buffer);
 
@@ -1433,6 +1437,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpackstr_xmalloc(&network, &name_len, buffer);
 		safe_unpackstr_xmalloc(&licenses, &name_len, buffer);
 		safe_unpackstr_xmalloc(&mail_user, &name_len, buffer);
+		safe_unpackstr_xmalloc(&mcs_label, &name_len, buffer);
 		safe_unpackstr_xmalloc(&resv_name, &name_len, buffer);
 		safe_unpackstr_xmalloc(&batch_host, &name_len, buffer);
 		safe_unpackstr_xmalloc(&burst_buffer, &name_len, buffer);
@@ -1489,14 +1494,17 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 				       &name_len, buffer);
 		safe_unpackstr_xmalloc(&tres_req_str, &name_len, buffer);
 		safe_unpackstr_xmalloc(&tres_fmt_req_str, &name_len, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpack32(&array_job_id, buffer);
 		safe_unpack32(&array_task_id, buffer);
 
 		/* Job Array record */
 		safe_unpack32(&task_id_size, buffer);
 		if (task_id_size != NO_VAL) {
-			safe_unpackstr_xmalloc(&task_id_str, &name_len, buffer);
+			if (task_id_size) {
+				safe_unpackstr_xmalloc(&task_id_str, &name_len,
+						       buffer);
+			}
 			safe_unpack32(&array_flags,    buffer);
 			safe_unpack32(&max_run_tasks,  buffer);
 			safe_unpack32(&tot_run_tasks,  buffer);
@@ -1555,8 +1563,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack_time(&tot_sus_time, buffer);
 
 		safe_unpack16(&direct_set_prio, buffer);
-		safe_unpack16(&uint16_tmp, buffer);
-		job_state = uint16_tmp;
+		safe_unpack32(&job_state, buffer);
 		safe_unpack16(&kill_on_node_fail, buffer);
 		safe_unpack16(&batch_flag, buffer);
 		safe_unpack16(&mail_type, buffer);
@@ -1567,28 +1574,19 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack16(&warn_flags, buffer);
 		safe_unpack16(&warn_signal, buffer);
 		safe_unpack16(&warn_time, buffer);
-		safe_unpack16(&uint16_tmp, buffer);
-		limit_set.tres[TRES_ARRAY_CPU] = uint16_tmp;
-		safe_unpack16(&uint16_tmp, buffer);
-		limit_set.tres[TRES_ARRAY_NODE] = uint16_tmp;
-		safe_unpack16(&uint16_tmp, buffer);
-		if (!limit_set.tres[TRES_ARRAY_CPU] && uint16_tmp)
-			limit_set.tres[TRES_ARRAY_CPU] = uint16_tmp;
-		safe_unpack16(&uint16_tmp, buffer);
-		if (!limit_set.tres[TRES_ARRAY_NODE] && uint16_tmp)
-			limit_set.tres[TRES_ARRAY_NODE] = uint16_tmp;
-		safe_unpack16(&uint16_tmp, buffer);
-		limit_set.tres[TRES_ARRAY_MEM] = uint16_tmp;
-		safe_unpack16(&limit_set.time, buffer);
-		safe_unpack16(&limit_set.qos, buffer);
 
+		_unpack_acct_policy_limit_members(&limit_set, buffer,
+						  protocol_version);
 
 		safe_unpackstr_xmalloc(&state_desc, &name_len, buffer);
 		safe_unpackstr_xmalloc(&resp_host, &name_len, buffer);
 
 		safe_unpack16(&alloc_resp_port, buffer);
 		safe_unpack16(&other_port, buffer);
+		safe_unpack8(&power_flags, buffer);
+		safe_unpack8(&uint8_tmp, buffer);
 		safe_unpack16(&start_protocol_ver, buffer);
+		safe_unpackdouble(&billable_tres, buffer);
 
 		if (job_state & JOB_COMPLETING) {
 			safe_unpackstr_xmalloc(&nodes_completing,
@@ -1630,6 +1628,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpackstr_xmalloc(&mail_user, &name_len, buffer);
 		safe_unpackstr_xmalloc(&resv_name, &name_len, buffer);
 		safe_unpackstr_xmalloc(&batch_host, &name_len, buffer);
+		safe_unpackstr_xmalloc(&burst_buffer, &name_len, buffer);
 
 		if (select_g_select_jobinfo_unpack(&select_jobinfo, buffer,
 						   protocol_version))
@@ -1675,18 +1674,29 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 				goto unpack_error;
 			safe_unpack16(&step_flag, buffer);
 		}
-		if (job_id > 0x7fffffff) {
-			error("JobID %u can not be recovered, JobID too high",
-			      job_id);
-			job_ptr->job_state = JOB_FAILED;
-			job_ptr->exit_code = 1;
-			job_ptr->state_reason = FAIL_SYSTEM;
-			xfree(job_ptr->state_desc);
-			job_ptr->end_time = now;
-		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		safe_unpack32(&job_ptr->bit_flags, buffer);
+		safe_unpackstr_xmalloc(&tres_alloc_str,
+				       &name_len, buffer);
+		safe_unpackstr_xmalloc(&tres_fmt_alloc_str,
+				       &name_len, buffer);
+		safe_unpackstr_xmalloc(&tres_req_str, &name_len, buffer);
+		safe_unpackstr_xmalloc(&tres_fmt_req_str, &name_len, buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpack32(&array_job_id, buffer);
 		safe_unpack32(&array_task_id, buffer);
+
+		/* Job Array record */
+		safe_unpack32(&task_id_size, buffer);
+		if (task_id_size != NO_VAL) {
+			safe_unpackstr_xmalloc(&task_id_str, &name_len, buffer);
+			safe_unpack32(&array_flags,    buffer);
+			safe_unpack32(&max_run_tasks,  buffer);
+			safe_unpack32(&tot_run_tasks,  buffer);
+			safe_unpack32(&min_exit_code,  buffer);
+			safe_unpack32(&max_exit_code,  buffer);
+			safe_unpack32(&tot_comp_tasks, buffer);
+		}
+
 		safe_unpack32(&assoc_id, buffer);
 		safe_unpack32(&job_id, buffer);
 
@@ -1743,6 +1753,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack16(&batch_flag, buffer);
 		safe_unpack16(&mail_type, buffer);
 		safe_unpack16(&state_reason, buffer);
+		safe_unpack8 (&reboot, buffer);
 		safe_unpack16(&restart_cnt, buffer);
 		safe_unpack16(&wait_all_nodes, buffer);
 		safe_unpack16(&warn_flags, buffer);
@@ -1763,11 +1774,13 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 		safe_unpack16(&limit_set.time, buffer);
 		safe_unpack16(&limit_set.qos, buffer);
 
+
 		safe_unpackstr_xmalloc(&state_desc, &name_len, buffer);
 		safe_unpackstr_xmalloc(&resp_host, &name_len, buffer);
 
 		safe_unpack16(&alloc_resp_port, buffer);
 		safe_unpack16(&other_port, buffer);
+		safe_unpack16(&start_protocol_ver, buffer);
 
 		if (job_state & JOB_COMPLETING) {
 			safe_unpackstr_xmalloc(&nodes_completing,
@@ -1954,6 +1967,9 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	xfree(job_ptr->mail_user);
 	job_ptr->mail_user    = mail_user;
 	mail_user             = NULL;	/* reused, nothing left to free */
+	xfree(job_ptr->mcs_label);
+	job_ptr->mcs_label    = mcs_label;
+	mcs_label	      = NULL;   /* reused, nothing left to free */
 	xfree(job_ptr->name);		/* in case duplicate record */
 	job_ptr->name         = name;
 	name                  = NULL;	/* reused, nothing left to free */
@@ -1975,7 +1991,6 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	}
 	job_ptr->other_port   = other_port;
 	job_ptr->power_flags  = power_flags;
-	job_ptr->sicp_mode    = sicp_mode;
 	xfree(job_ptr->partition);
 	job_ptr->partition    = partition;
 	partition             = NULL;	/* reused, nothing left to free */
@@ -2004,6 +2019,7 @@ static int _load_job_state(Buf buffer, uint16_t protocol_version)
 	job_ptr->state_desc   = state_desc;
 	state_desc            = NULL;	/* reused, nothing left to free */
 	job_ptr->suspend_time = suspend_time;
+	job_ptr->deadline     = deadline;
 	if (task_id_size != NO_VAL) {
 		if (!job_ptr->array_recs)
 			job_ptr->array_recs=xmalloc(sizeof(job_array_struct_t));
@@ -2175,6 +2191,7 @@ unpack_error:
 	xfree(licenses);
 	xfree(limit_set.tres);
 	xfree(mail_user);
+	xfree(mcs_label);
 	xfree(name);
 	xfree(nodes);
 	xfree(nodes_completing);
@@ -2219,7 +2236,7 @@ void _dump_job_details(struct job_details *detail_ptr, Buf buffer)
 	pack16(detail_ptr->contiguous, buffer);
 	pack16(detail_ptr->core_spec, buffer);
 	pack16(detail_ptr->cpus_per_task, buffer);
-	pack16(detail_ptr->nice, buffer);
+	pack32(detail_ptr->nice, buffer);
 	pack16(detail_ptr->ntasks_per_node, buffer);
 	pack16(detail_ptr->requeue, buffer);
 	pack32(detail_ptr->task_dist, buffer);
@@ -2280,9 +2297,9 @@ static int _load_job_details(struct job_record *job_ptr, Buf buffer,
 	uint32_t pn_min_cpus, pn_min_memory, pn_min_tmp_disk;
 	uint32_t cpu_freq_min = NO_VAL;
 	uint32_t cpu_freq_max = NO_VAL;
-	uint32_t cpu_freq_gov = NO_VAL;
+	uint32_t cpu_freq_gov = NO_VAL, nice = 0;
 	uint32_t num_tasks, name_len, argc = 0, env_cnt = 0, task_dist;
-	uint16_t contiguous, core_spec = (uint16_t) NO_VAL, nice;
+	uint16_t contiguous, core_spec = (uint16_t) NO_VAL;
 	uint16_t ntasks_per_node, cpus_per_task, requeue;
 	uint16_t cpu_bind_type, mem_bind_type, plane_size;
 	uint8_t open_mode, overcommit, prolog_running;
@@ -2292,7 +2309,63 @@ static int _load_job_details(struct job_record *job_ptr, Buf buffer,
 	multi_core_data_t *mc_ptr;
 
 	/* unpack the job's details from the buffer */
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpack32(&min_cpus, buffer);
+		safe_unpack32(&max_cpus, buffer);
+		safe_unpack32(&min_nodes, buffer);
+		safe_unpack32(&max_nodes, buffer);
+		safe_unpack32(&num_tasks, buffer);
+
+		safe_unpackstr_xmalloc(&acctg_freq, &name_len, buffer);
+		safe_unpack16(&contiguous, buffer);
+		safe_unpack16(&core_spec, buffer);
+		safe_unpack16(&cpus_per_task, buffer);
+		safe_unpack32(&nice, buffer);
+		safe_unpack16(&ntasks_per_node, buffer);
+		safe_unpack16(&requeue, buffer);
+		safe_unpack32(&task_dist, buffer);
+
+		safe_unpack8(&share_res, buffer);
+		safe_unpack8(&whole_node, buffer);
+
+		safe_unpackstr_xmalloc(&cpu_bind, &name_len, buffer);
+		safe_unpack16(&cpu_bind_type, buffer);
+		safe_unpackstr_xmalloc(&mem_bind, &name_len, buffer);
+		safe_unpack16(&mem_bind_type, buffer);
+		safe_unpack16(&plane_size, buffer);
+
+		safe_unpack8(&open_mode, buffer);
+		safe_unpack8(&overcommit, buffer);
+		safe_unpack8(&prolog_running, buffer);
+
+		safe_unpack32(&pn_min_cpus, buffer);
+		safe_unpack32(&pn_min_memory, buffer);
+		safe_unpack32(&pn_min_tmp_disk, buffer);
+		safe_unpack32(&cpu_freq_min, buffer);
+		safe_unpack32(&cpu_freq_max, buffer);
+		safe_unpack32(&cpu_freq_gov, buffer);
+		safe_unpack_time(&begin_time, buffer);
+		safe_unpack_time(&submit_time, buffer);
+
+		safe_unpackstr_xmalloc(&req_nodes,  &name_len, buffer);
+		safe_unpackstr_xmalloc(&exc_nodes,  &name_len, buffer);
+		safe_unpackstr_xmalloc(&features,   &name_len, buffer);
+		safe_unpackstr_xmalloc(&dependency, &name_len, buffer);
+		safe_unpackstr_xmalloc(&orig_dependency, &name_len, buffer);
+
+		safe_unpackstr_xmalloc(&err, &name_len, buffer);
+		safe_unpackstr_xmalloc(&in,  &name_len, buffer);
+		safe_unpackstr_xmalloc(&out, &name_len, buffer);
+		safe_unpackstr_xmalloc(&work_dir, &name_len, buffer);
+		safe_unpackstr_xmalloc(&ckpt_dir, &name_len, buffer);
+		safe_unpackstr_xmalloc(&restart_dir, &name_len, buffer);
+
+		if (unpack_multi_core_data(&mc_ptr, buffer, protocol_version))
+			goto unpack_error;
+		safe_unpackstr_array(&argv, &argc, buffer);
+		safe_unpackstr_array(&env_sup, &env_cnt, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		uint16_t old_nice = 0;
 		safe_unpack32(&min_cpus, buffer);
 		safe_unpack32(&max_cpus, buffer);
 		safe_unpack32(&min_nodes, buffer);
@@ -2303,7 +2376,8 @@ static int _load_job_details(struct job_record *job_ptr, Buf buffer,
 		safe_unpack16(&contiguous, buffer);
 		safe_unpack16(&core_spec, buffer);
 		safe_unpack16(&cpus_per_task, buffer);
-		safe_unpack16(&nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		nice = xlate_nice_old2new(old_nice);
 		safe_unpack16(&ntasks_per_node, buffer);
 		safe_unpack16(&requeue, buffer);
 		safe_unpack32(&task_dist, buffer);
@@ -2347,8 +2421,9 @@ static int _load_job_details(struct job_record *job_ptr, Buf buffer,
 			goto unpack_error;
 		safe_unpackstr_array(&argv, &argc, buffer);
 		safe_unpackstr_array(&env_sup, &env_cnt, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint16_t old_task_dist = 0;
+		uint16_t old_nice = 0;
 		safe_unpack32(&min_cpus, buffer);
 		safe_unpack32(&max_cpus, buffer);
 		safe_unpack32(&min_nodes, buffer);
@@ -2359,7 +2434,8 @@ static int _load_job_details(struct job_record *job_ptr, Buf buffer,
 		safe_unpack16(&contiguous, buffer);
 		safe_unpack16(&core_spec, buffer);
 		safe_unpack16(&cpus_per_task, buffer);
-		safe_unpack16(&nice, buffer);
+		safe_unpack16(&old_nice, buffer);
+		nice = xlate_nice_old2new(old_nice);
 		safe_unpack16(&ntasks_per_node, buffer);
 		safe_unpack16(&requeue, buffer);
 		safe_unpack16(&old_task_dist, buffer);
@@ -2980,7 +3056,7 @@ extern int kill_job_by_front_end_name(char *node_name)
 		    !IS_JOB_COMPLETING(job_ptr))
 			continue;
 		if ((job_ptr->batch_host == NULL) ||
-		    strcmp(job_ptr->batch_host, node_name))
+		    xstrcmp(job_ptr->batch_host, node_name))
 			continue;	/* no match on node name */
 
 		if (IS_JOB_SUSPENDED(job_ptr)) {
@@ -3177,7 +3253,7 @@ extern bool allocated_session_in_use(job_desc_msg_t *new_alloc)
 		if (job_ptr->batch_flag || IS_JOB_FINISHED(job_ptr))
 			continue;
 		if (job_ptr->alloc_node &&
-		    (strcmp(job_ptr->alloc_node, new_alloc->alloc_node) == 0) &&
+		    (xstrcmp(job_ptr->alloc_node, new_alloc->alloc_node) == 0) &&
 		    (job_ptr->alloc_sid == new_alloc->alloc_sid))
 			break;
 	}
@@ -3540,8 +3616,8 @@ void dump_job_desc(job_desc_msg_t * job_specs)
 	       job_specs->work_dir,
 	       job_specs->alloc_node, job_specs->alloc_sid);
 
-	debug3("   sicp_mode=%u power_flags=%s",
-	       job_specs->sicp_mode, power_flags_str(job_specs->power_flags));
+	debug3("   power_flags=%s",
+	       power_flags_str(job_specs->power_flags));
 
 	debug3("   resp_host=%s alloc_resp_port=%u other_port=%u",
 	       job_specs->resp_host,
@@ -3554,7 +3630,7 @@ void dump_job_desc(job_desc_msg_t * job_specs)
 		(long) job_specs->num_tasks : -1L;
 	overcommit = (job_specs->overcommit != (uint8_t) NO_VAL) ?
 		(long) job_specs->overcommit : -1L;
-	nice = (job_specs->nice != (uint16_t) NO_VAL) ?
+	nice = (job_specs->nice != NO_VAL) ?
 		(job_specs->nice - NICE_OFFSET) : 0;
 	debug3("   mail_type=%u mail_user=%s nice=%ld num_tasks=%ld "
 	       "open_mode=%u overcommit=%ld acctg_freq=%s",
@@ -3601,6 +3677,10 @@ void dump_job_desc(job_desc_msg_t * job_specs)
 	       job_specs->plane_size);
 	debug3("   array_inx=%s", job_specs->array_inx);
 	debug3("   burst_buffer=%s", job_specs->burst_buffer);
+	debug3("   mcs_label=%s", job_specs->mcs_label);
+	slurm_make_time_str(&job_specs->deadline, buf, sizeof(buf));
+	debug3("   deadline=%s", buf);
+	debug3("   bitflags=%u", job_specs->bitflags);
 
 	select_g_select_jobinfo_sprint(job_specs->select_jobinfo,
 				       buf, sizeof(buf), SELECT_PRINT_MIXED);
@@ -3667,7 +3747,6 @@ extern struct job_record *job_array_split(struct job_record *job_ptr)
 	priority_factors_object_t *save_prio_factors;
 	List save_step_list;
 	int error_code = SLURM_SUCCESS;
-	bool global_job = false;
 	int i;
 
 	job_ptr_pend = _create_job_record(&error_code, 0);
@@ -3678,9 +3757,7 @@ extern struct job_record *job_array_split(struct job_record *job_ptr)
 
 	_remove_job_hash(job_ptr);
 	job_ptr_pend->job_id = job_ptr->job_id;
-	if (job_ptr->sicp_mode)
-		global_job = true;
-	if (_set_job_id(job_ptr, global_job) != SLURM_SUCCESS)
+	if (_set_job_id(job_ptr) != SLURM_SUCCESS)
 		fatal("%s: _set_job_id error", __func__);
 	if (!job_ptr->array_recs) {
 		fatal("%s: job %u record lacks array structure",
@@ -3763,6 +3840,7 @@ extern struct job_record *job_array_split(struct job_record *job_ptr)
 	job_ptr_pend->licenses = xstrdup(job_ptr->licenses);
 	job_ptr_pend->license_list = license_job_copy(job_ptr->license_list);
 	job_ptr_pend->mail_user = xstrdup(job_ptr->mail_user);
+	job_ptr_pend->mcs_label = xstrdup(job_ptr->mcs_label);
 	job_ptr_pend->name = xstrdup(job_ptr->name);
 	job_ptr_pend->network = xstrdup(job_ptr->network);
 	job_ptr_pend->node_addr = NULL;
@@ -3807,6 +3885,7 @@ extern struct job_record *job_array_split(struct job_record *job_ptr)
 	job_ptr_pend->tres_fmt_alloc_str = NULL;
 
 	job_ptr_pend->wckey = xstrdup(job_ptr->wckey);
+	job_ptr_pend->deadline = job_ptr->deadline;
 
 	job_details = job_ptr->details;
 	details_new = job_ptr_pend->details;
@@ -3979,6 +4058,15 @@ static int _select_nodes_parts(struct job_record *job_ptr, bool test_only,
 	return rc;
 }
 
+static inline bool _has_deadline(struct job_record *job_ptr)
+{
+	if ((job_ptr->deadline) && (job_ptr->deadline != NO_VAL)) {
+		queue_job_scheduler();
+		return true;
+	}
+	return false;
+}
+
 /*
  * job_allocate - create job_records for the supplied job specification and
  *	allocate nodes for it.
@@ -4078,13 +4166,12 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 			defer_sched = 1;
 		else
 			defer_sched = 0;
+		bf_min_age_reserve = 0;
 		if (sched_params &&
 		    (tmp_ptr = strstr(sched_params, "bf_min_age_reserve="))) {
-			bf_min_age_reserve = atoi(tmp_ptr + 19);
-			if (bf_min_age_reserve < 0)
-				bf_min_age_reserve = 0;
-		} else {
-			bf_min_age_reserve = 0;
+			int min_age = atoi(tmp_ptr + 19);
+			if (min_age > 0)
+				bf_min_age_reserve = min_age;
 		}
 		xfree(sched_params);
 	}
@@ -4125,9 +4212,9 @@ extern int job_allocate(job_desc_msg_t * job_specs, int immediate,
 		return rc;
 	}
 
-	test_only = will_run || (allocate == 0);
+	test_only = will_run || job_ptr->deadline || (allocate == 0);
 
-	no_alloc = test_only || too_fragmented ||
+	no_alloc = test_only || too_fragmented || _has_deadline(job_ptr) ||
 		   (!top_prio) || (!independent) || !avail_front_end(job_ptr);
 
 	no_alloc = no_alloc || (bb_g_job_test_stage_in(job_ptr, no_alloc) != 1);
@@ -4269,6 +4356,8 @@ extern int job_fail(uint32_t job_id, uint32_t job_state)
 static int _job_signal(struct job_record *job_ptr, uint16_t signal,
 		       uint16_t flags, uid_t uid, bool preempt)
 {
+	ListIterator step_iterator;
+	struct step_record *step_ptr;
 	uint16_t job_term_state;
 	char jbuf[JBUFSIZ];
 	time_t now = time(NULL);
@@ -4278,7 +4367,7 @@ static int _job_signal(struct job_record *job_ptr, uint16_t signal,
 	if (IS_JOB_FINISHED(job_ptr))
 		return ESLURM_ALREADY_DONE;
 
-	if (job_ptr->details && job_ptr->details->prolog_running)
+	if (IS_JOB_CONFIGURING(job_ptr))
 		return ESLURM_TRANSITION_STATE_NO_UPDATE;
 
 	/* let node select plugin do any state-dependent signalling actions */
@@ -4311,6 +4400,15 @@ static int _job_signal(struct job_record *job_ptr, uint16_t signal,
 		return SLURM_SUCCESS;
 	}
 
+	if ((IS_JOB_RUNNING(job_ptr) || IS_JOB_SUSPENDED(job_ptr)) &&
+	    (signal == SIGKILL)) {
+		step_iterator = list_iterator_create(job_ptr->step_list);
+		while ((step_ptr =
+		       (struct step_record *) list_next(step_iterator)))
+			select_g_step_finish(step_ptr, true);
+		list_iterator_destroy(step_iterator);
+	}
+
 	if (preempt)
 		job_term_state = JOB_PREEMPTED;
 	else
@@ -4392,9 +4490,9 @@ extern int job_signal(uint32_t job_id, uint16_t signal, uint16_t flags,
 	 * Moab command for accurate job records */
 	if (!wiki_sched_test) {
 		char *sched_type = slurm_get_sched_type();
-		if (strcmp(sched_type, "sched/wiki") == 0)
+		if (xstrcmp(sched_type, "sched/wiki") == 0)
 			wiki_sched  = true;
-		if (strcmp(sched_type, "sched/wiki2") == 0) {
+		if (xstrcmp(sched_type, "sched/wiki2") == 0) {
 			wiki_sched  = true;
 			wiki2_sched = true;
 		}
@@ -4454,9 +4552,9 @@ extern int job_str_signal(char *job_id_str, uint16_t signal, uint16_t flags,
 	 * Moab command for accurate job records */
 	if (!wiki_sched_test) {
 		char *sched_type = slurm_get_sched_type();
-		if (strcmp(sched_type, "sched/wiki") == 0)
+		if (xstrcmp(sched_type, "sched/wiki") == 0)
 			wiki_sched  = true;
-		if (strcmp(sched_type, "sched/wiki2") == 0) {
+		if (xstrcmp(sched_type, "sched/wiki2") == 0) {
 			wiki_sched  = true;
 			wiki2_sched = true;
 		}
@@ -5010,7 +5108,7 @@ static int _part_access_check(struct part_record *part_ptr,
 			      uid_t submit_uid, slurmdb_qos_rec_t *qos_ptr,
 			      char *acct)
 {
-	uint32_t total_nodes;
+	uint32_t total_nodes, min_nodes_tmp, max_nodes_tmp;
 	size_t resv_name_leng = 0;
 	int rc = SLURM_SUCCESS;
 
@@ -5066,15 +5164,27 @@ static int _part_access_check(struct part_record *part_ptr,
 	}
 
 	if ((part_ptr->state_up & PARTITION_SCHED) &&
-	    (job_desc->min_cpus != NO_VAL) &&
-	    (job_desc->min_cpus >  part_ptr->total_cpus)) {
-		info("_part_access_check: Job requested too many cpus (%u) of "
-		     "partition %s(%u)",
-		     job_desc->min_cpus, part_ptr->name,
-		     part_ptr->total_cpus);
-		return ESLURM_TOO_MANY_REQUESTED_CPUS;
-	}
-
+	    (job_desc->min_cpus != NO_VAL)) {
+
+		if (job_desc->min_cpus > part_ptr->total_cpus) {
+			info("_part_access_check: Job requested too many "
+			     "cpus (%u) of partition %s(%u)",
+			     job_desc->min_cpus, part_ptr->name,
+			     part_ptr->total_cpus);
+			return ESLURM_TOO_MANY_REQUESTED_CPUS;
+		} else if (job_desc->min_cpus >
+			   (part_ptr->max_cpus_per_node *
+			    part_ptr->total_nodes)) {
+			info("_part_access_check: Job requested too many "
+			     "cpus (%u) of partition %s(%u)",
+			     job_desc->min_cpus, part_ptr->name,
+			     (part_ptr->max_cpus_per_node *
+			     part_ptr->total_nodes));
+			return ESLURM_TOO_MANY_REQUESTED_CPUS;
+		}
+	}
+
+	/* Check against total nodes on the partition */
 	total_nodes = part_ptr->total_nodes;
 	select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, &total_nodes);
 	if ((part_ptr->state_up & PARTITION_SCHED) &&
@@ -5092,6 +5202,36 @@ static int _part_access_check(struct part_record *part_ptr,
 		return ESLURM_REQUESTED_NODES_NOT_IN_PARTITION;
 	}
 
+	/* Check against min/max node limits in the partition */
+	min_nodes_tmp = part_ptr->min_nodes;
+	max_nodes_tmp = part_ptr->max_nodes;
+	if ((part_ptr->state_up & PARTITION_SCHED) &&
+	    (job_desc->min_nodes != NO_VAL) &&
+	    (job_desc->min_nodes < min_nodes_tmp)) {
+		info("_part_access_check: Job requested for nodes (%u) "
+		     "smaller than partition %s(%u) min nodes",
+		     job_desc->min_nodes, part_ptr->name, min_nodes_tmp);
+		return  ESLURM_INVALID_NODE_COUNT;
+	}
+
+	if ((part_ptr->state_up & PARTITION_SCHED) &&
+	    (job_desc->min_nodes != NO_VAL) &&
+	    (job_desc->max_nodes > max_nodes_tmp)) {
+		info("_part_access_check: Job requested for nodes (%u) "
+		     "greater than partition %s(%u) max nodes",
+		     job_desc->max_nodes, part_ptr->name, max_nodes_tmp);
+		return ESLURM_INVALID_NODE_COUNT;
+	}
+
+	if ((part_ptr->state_up & PARTITION_SCHED) &&
+	    (job_desc->time_limit != NO_VAL) &&
+	    (job_desc->time_limit > part_ptr->max_time)) {
+		info("_part_access_check: Job time limit (%u) exceeds limit of "
+		     "partition %s(%u)",
+		     job_desc->time_limit, part_ptr->name, part_ptr->max_time);
+		return ESLURM_INVALID_TIME_LIMIT;
+	}
+
 	if (slurmctld_conf.enforce_part_limits) {
 		if ((rc = part_policy_valid_acct(part_ptr, acct))
 		    != SLURM_SUCCESS)
@@ -5220,11 +5360,11 @@ static int _valid_job_part(job_desc_msg_t * job_desc,
 	slurmdb_assoc_rec_t assoc_rec;
 	uint32_t min_nodes_orig = INFINITE, max_nodes_orig = 1;
 	uint32_t max_time = 0;
+	bool any_check = false;
 
 	/* Change partition pointer(s) to alternates as needed */
 	if (part_ptr_list) {
 		int fail_rc = SLURM_SUCCESS;
-		bool rebuild_name_list = false;
 		ListIterator iter = list_iterator_create(part_ptr_list);
 
 		while ((part_ptr_tmp = (struct part_record *)list_next(iter))) {
@@ -5255,13 +5395,24 @@ static int _valid_job_part(job_desc_msg_t * job_desc,
 							qos_ptr, assoc_ptr ?
 							assoc_ptr->acct : NULL);
 
-			if (rc != SLURM_SUCCESS) {
+			if ((rc != SLURM_SUCCESS) &&
+			    ((rc == ESLURM_ACCESS_DENIED) ||
+			     (rc == ESLURM_USER_ID_MISSING) ||
+			     (rc == ESLURM_JOB_MISSING_REQUIRED_PARTITION_GROUP) ||
+			     (slurmctld_conf.enforce_part_limits ==
+			      PARTITION_ENFORCE_ALL))) {
+				break;
+			} else if (rc != SLURM_SUCCESS) {
 				fail_rc = rc;
-				list_remove(iter);
-				rebuild_name_list = true;
-				continue;
+			} else {
+				any_check = true;
 			}
 
+			// Set to success since we found a usable partition
+			if (any_check && slurmctld_conf.enforce_part_limits ==
+			    PARTITION_ENFORCE_ANY)
+				fail_rc = SLURM_SUCCESS;
+
 			min_nodes_orig = MIN(min_nodes_orig,
 					     part_ptr_tmp->min_nodes_orig);
 			max_nodes_orig = MAX(max_nodes_orig,
@@ -5269,28 +5420,23 @@ static int _valid_job_part(job_desc_msg_t * job_desc,
 			max_time = MAX(max_time, part_ptr_tmp->max_time);
 		}
 		list_iterator_destroy(iter);
-		if (list_is_empty(part_ptr_list)) {
-			if (fail_rc != SLURM_SUCCESS)
+
+		if (list_is_empty(part_ptr_list) ||
+		    (slurmctld_conf.enforce_part_limits &&
+		     (fail_rc != SLURM_SUCCESS))) {
+			if (slurmctld_conf.enforce_part_limits ==
+			    PARTITION_ENFORCE_ALL)
 				rc = fail_rc;
-			else
+			else if (slurmctld_conf.enforce_part_limits ==
+				 PARTITION_ENFORCE_ANY && !any_check)
+				rc = fail_rc;
+			else {
 				rc = ESLURM_PARTITION_NOT_AVAIL;
-			goto fini;
-		}
-		rc = SLURM_SUCCESS;	/* At least some partition usable */
-		if (rebuild_name_list) {
-			*part_pptr = part_ptr = NULL;
-			xfree(job_desc->partition);
-			iter = list_iterator_create(part_ptr_list);
-			while ((part_ptr_tmp = list_next(iter))) {
-				if (job_desc->partition)
-					xstrcat(job_desc->partition, ",");
-				else
-					*part_pptr = part_ptr = part_ptr_tmp;
-				xstrcat(job_desc->partition,
-					part_ptr_tmp->name);
 			}
-			list_iterator_destroy(iter);
+			goto fini;
 		}
+		rc = SLURM_SUCCESS;	/* At least some partition
+					 * usable */
 	} else {
 		min_nodes_orig = part_ptr->min_nodes_orig;
 		max_nodes_orig = part_ptr->max_nodes_orig;
@@ -5298,11 +5444,20 @@ static int _valid_job_part(job_desc_msg_t * job_desc,
 		rc = _part_access_check(part_ptr, job_desc, req_bitmap,
 					submit_uid, qos_ptr,
 					assoc_ptr ? assoc_ptr->acct : NULL);
-		if (rc != SLURM_SUCCESS)
+		if ((rc != SLURM_SUCCESS) &&
+		    ((rc == ESLURM_ACCESS_DENIED) ||
+		     (rc == ESLURM_USER_ID_MISSING) ||
+		     (rc == ESLURM_JOB_MISSING_REQUIRED_PARTITION_GROUP) ||
+		     slurmctld_conf.enforce_part_limits))
 			goto fini;
+		// Enforce Part Limit = no
+		rc = SLURM_SUCCESS;
 	}
 
 	/* Validate job limits against partition limits */
+
+	// Check Partition with the highest limits when there are
+	// muliple
 	if (job_desc->min_nodes == NO_VAL) {
 		/* Avoid setting the job request to 0 nodes if the
 		   user didn't ask for 0.
@@ -5388,6 +5543,38 @@ static int _valid_job_part(job_desc_msg_t * job_desc,
 		rc = ESLURM_INVALID_TIME_LIMIT;
 		goto fini;
 	}
+	if ((job_desc->deadline) && (job_desc->deadline != NO_VAL)) {
+		char time_str_now[32];
+		char time_str_deadline[32];
+		time_t now = time(NULL);
+		slurm_make_time_str(&job_desc->deadline, time_str_deadline,
+				    sizeof(time_str_deadline));
+		slurm_make_time_str(&now, time_str_now, sizeof(time_str_now));
+		if (job_desc->deadline < now) {
+			info("_valid_job_part: job's deadline smaller than now "
+			     "(%s < %s)",
+			     time_str_deadline, time_str_now);
+			rc = ESLURM_INVALID_TIME_LIMIT;
+			goto fini;
+		}
+		if ((job_desc->time_min) && (job_desc->time_min != NO_VAL) &&
+		    (job_desc->deadline < (now + job_desc->time_min * 60))) {
+			info("_valid_job_part: job's min_time greater than "
+			     "deadline (%u > %s)",
+			     job_desc->time_min, time_str_deadline);
+			rc = ESLURM_INVALID_TIME_LIMIT;
+			goto fini;
+		}
+		if ((job_desc->time_min == 0) && (job_desc->time_limit) &&
+		    (job_desc->time_limit != NO_VAL) &&
+		    (job_desc->deadline < (now + job_desc->time_limit * 60))) {
+			info("_valid_job_part: job's time_limit greater than "
+			     "deadline (%u > %s)",
+			     job_desc->time_limit, time_str_deadline);
+			rc = ESLURM_INVALID_TIME_LIMIT;
+			goto fini;
+		}
+	}
 
 fini:
 	return rc;
@@ -5555,7 +5742,7 @@ static int _job_create(job_desc_msg_t *job_desc, int allocate, int will_run,
 #endif
 
 	if (select_serial == -1) {
-		if (strcmp(slurmctld_conf.select_type, "select/serial"))
+		if (xstrcmp(slurmctld_conf.select_type, "select/serial"))
 			select_serial = 0;
 		else
 			select_serial = 1;
@@ -5711,6 +5898,9 @@ static int _job_create(job_desc_msg_t *job_desc, int allocate, int will_run,
 	    != SLURM_SUCCESS)
 		goto cleanup_fail;
 
+	if (job_desc->deadline && (job_desc->time_limit == NO_VAL) &&
+	    (job_desc->time_min == NO_VAL))
+		job_desc->time_min = 1;
 	if ((accounting_enforce & ACCOUNTING_ENFORCE_LIMITS) &&
 	    (!acct_policy_validate(job_desc, part_ptr,
 				   assoc_ptr, qos_ptr, NULL,
@@ -5865,9 +6055,19 @@ static int _job_create(job_desc_msg_t *job_desc, int allocate, int will_run,
 	job_ptr->qos_ptr = (void *) qos_ptr;
 	job_ptr->qos_id = qos_rec.id;
 
+	if (mcs_g_set_mcs_label(job_ptr, job_desc->mcs_label) != 0 ) {
+		if (job_desc->mcs_label == NULL)
+			error("Failed to create job : no valid mcs_label found");
+		else
+			error("Failed to create job : invalid mcs-label : %s",
+				job_desc->mcs_label);
+		error_code = ESLURM_INVALID_MCS_LABEL;
+		goto cleanup_fail;
+	}
+
 	if (launch_type_poe == -1) {
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/poe"))
+		if (!xstrcmp(launch_type, "launch/poe"))
 			launch_type_poe = 1;
 		else
 			launch_type_poe = 0;
@@ -6097,6 +6297,7 @@ static int _test_job_desc_fields(job_desc_msg_t * job_desc)
 	    _test_strlen(job_desc->licenses, "licenses", 1024)		||
 	    _test_strlen(job_desc->linuximage, "linuximage", 1024)	||
 	    _test_strlen(job_desc->mail_user, "mail_user", 1024)	||
+	    _test_strlen(job_desc->mcs_label, "mcs_label", 1024)	||
 	    _test_strlen(job_desc->mem_bind, "mem_bind", 1024)		||
 	    _test_strlen(job_desc->mloaderimage, "mloaderimage", 1024)	||
 	    _test_strlen(job_desc->name, "name", 1024)			||
@@ -6139,6 +6340,9 @@ extern int validate_job_create_req(job_desc_msg_t * job_desc, uid_t submit_uid,
 			job_desc->nice = NICE_OFFSET;
 	}
 	rc = job_submit_plugin_submit(job_desc, (uint32_t) submit_uid, err_msg);
+	if (rc != SLURM_SUCCESS)
+		return rc;
+	rc = node_features_g_job_valid(job_desc->features);
 	if (rc != SLURM_SUCCESS)
 		return rc;
 
@@ -6626,9 +6830,9 @@ _read_data_array_from_file(int fd, char *file_name, char ***data,
 			name_len = tmp_chr - job_ptr->details->env_sup[j] + 1;
 			/* search for duplicate */
 			for (i = 0; i < rec_cnt; i++) {
-				if (strncmp(array_ptr[i],
-					    job_ptr->details->env_sup[j],
-					    name_len)) {
+				if (xstrncmp(array_ptr[i],
+					     job_ptr->details->env_sup[j],
+					     name_len)) {
 					continue;
 				}
 				/* over-write duplicate */
@@ -6662,29 +6866,39 @@ _read_data_array_from_file(int fd, char *file_name, char ***data,
  */
 static int _read_data_from_file(int fd, char *file_name, char **data)
 {
-	int pos, buf_size, amount;
+	struct stat stat_buf;
+	int pos, buf_size, amount, count;
 	char *buffer;
 
 	xassert(file_name);
 	xassert(data);
 	*data = NULL;
 
+	if (fstat(fd, &stat_buf)) {
+		error("%s: Unable to stat file %s", __func__, file_name);
+		return -1;
+	}
+
 	pos = 0;
-	buf_size = BUF_SIZE;
+	buf_size = stat_buf.st_size;
 	buffer = xmalloc(buf_size);
-	while (1) {
-		amount = read(fd, &buffer[pos], BUF_SIZE);
+	while (pos < buf_size) {
+		count = buf_size - pos;
+		amount = read(fd, &buffer[pos], count);
 		if (amount < 0) {
-			error("Error reading file %s, %m", file_name);
+			if (errno == EINTR)
+				continue;
+			error("%s: Error reading file %s, %m",
+			      __func__, file_name);
 			xfree(buffer);
 			close(fd);
 			return -1;
 		}
-		if (amount < BUF_SIZE)	/* end of file */
+		if (amount < count) {	/* end of file */
+			error("%s: File %s shortened??", __func__, file_name);
 			break;
+		}
 		pos += amount;
-		buf_size += amount;
-		xrealloc(buffer, buf_size);
 	}
 
 	*data = buffer;
@@ -6739,7 +6953,6 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	int error_code;
 	struct job_details *detail_ptr;
 	struct job_record *job_ptr;
-	bool global_job = false;
 
 	if (slurm_get_track_wckey()) {
 		if (!job_desc->wckey) {
@@ -6799,9 +7012,7 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	if (job_desc->job_id != NO_VAL) {	/* already confirmed unique */
 		job_ptr->job_id = job_desc->job_id;
 	} else {
-		if (job_desc->sicp_mode || job_desc->clusters)
-			global_job = true;
-		error_code = _set_job_id(job_ptr, global_job);
+		error_code = _set_job_id(job_ptr);
 		if (error_code)
 			return error_code;
 	}
@@ -6826,6 +7037,7 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	job_ptr->group_id   = (gid_t) job_desc->group_id;
 	job_ptr->job_state  = JOB_PENDING;
 	job_ptr->time_limit = job_desc->time_limit;
+	job_ptr->deadline   = job_desc->deadline;
 	if (job_desc->time_min != NO_VAL)
 		job_ptr->time_min = job_desc->time_min;
 	job_ptr->alloc_sid  = job_desc->alloc_sid;
@@ -6838,9 +7050,9 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	job_ptr->comment    = xstrdup(job_desc->comment);
 	if (!wiki_sched_test) {
 		char *sched_type = slurm_get_sched_type();
-		if (strcmp(sched_type, "sched/wiki") == 0)
+		if (xstrcmp(sched_type, "sched/wiki") == 0)
 			wiki_sched  = true;
-		if (strcmp(sched_type, "sched/wiki2") == 0) {
+		if (xstrcmp(sched_type, "sched/wiki2") == 0) {
 			wiki_sched  = true;
 			wiki2_sched = true;
 		}
@@ -6855,7 +7067,6 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	job_ptr->alloc_resp_port = job_desc->alloc_resp_port;
 	job_ptr->other_port = job_desc->other_port;
 	job_ptr->power_flags = job_desc->power_flags;
-	job_ptr->sicp_mode = job_desc->sicp_mode;
 	job_ptr->time_last_active = time(NULL);
 	job_ptr->cr_enabled = 0;
 	job_ptr->derived_ec = 0;
@@ -6870,6 +7081,7 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	job_ptr->spank_job_env_size = job_desc->spank_job_env_size;
 	job_desc->spank_job_env = (char **) NULL; /* nothing left to free */
 	job_desc->spank_job_env_size = 0;         /* nothing left to free */
+	job_ptr->mcs_label = xstrdup(job_desc->mcs_label);
 
 	if (job_desc->wait_all_nodes == (uint16_t) NO_VAL)
 		job_ptr->wait_all_nodes = DEFAULT_WAIT_ALL_NODES;
@@ -6912,15 +7124,18 @@ _copy_job_desc_to_job_record(job_desc_msg_t * job_desc,
 	}
 	if (job_desc->features)
 		detail_ptr->features = xstrdup(job_desc->features);
-	if ((job_desc->shared == 0) && (select_serial == 0)) {
+	if ((job_desc->shared == JOB_SHARED_NONE) && (select_serial == 0)) {
 		detail_ptr->share_res  = 0;
 		detail_ptr->whole_node = 1;
-	} else if (job_desc->shared == 1) {
+	} else if (job_desc->shared == JOB_SHARED_OK) {
 		detail_ptr->share_res  = 1;
 		detail_ptr->whole_node = 0;
-	} else if (job_desc->shared == 2) {
+	} else if (job_desc->shared == JOB_SHARED_USER) {
 		detail_ptr->share_res  = (uint8_t) NO_VAL;
-		detail_ptr->whole_node = 2;
+		detail_ptr->whole_node = JOB_SHARED_USER;
+	} else if (job_desc->shared == JOB_SHARED_MCS) {
+		detail_ptr->share_res  = (uint8_t) NO_VAL;
+		detail_ptr->whole_node = JOB_SHARED_MCS;
 	} else {
 		detail_ptr->share_res  = (uint8_t) NO_VAL;
 		detail_ptr->whole_node = 0;
@@ -7110,6 +7325,35 @@ static bool _valid_pn_min_mem(job_desc_msg_t * job_desc_msg,
 	return false;
 }
 
+/* Clear job's CONFIGURING flag and advance end time as needed */
+extern void job_config_fini(struct job_record *job_ptr)
+{
+	time_t now = time(NULL);
+
+	job_ptr->job_state &= (~JOB_CONFIGURING);
+	job_ptr->tot_sus_time = difftime(now, job_ptr->start_time);
+	if ((job_ptr->time_limit != INFINITE) && (job_ptr->tot_sus_time != 0)) {
+		verbose("Extending job %u time limit by %u secs for configuration",
+			job_ptr->job_id, (uint32_t) job_ptr->tot_sus_time);
+		job_ptr->end_time_exp = job_ptr->end_time =
+			now + (job_ptr->time_limit * 60);
+	}
+}
+
+#ifndef HAVE_BG
+static bool _test_nodes_ready(struct job_record *job_ptr)
+{
+	if (bit_overlap(job_ptr->node_bitmap, power_node_bitmap))
+		return false;
+
+	if (job_ptr->wait_all_nodes && 
+	    ((select_g_job_ready(job_ptr) & READY_NODE_STATE) == 0))
+		return false;
+
+	return true;
+}
+#endif
+
 /*
  * job_time_limit - terminate jobs which have exceeded their time limit
  * global: job_list - pointer global job list
@@ -7149,24 +7393,18 @@ void job_time_limit(void)
 		prolog = 0;
 		if (job_ptr->details)
 			prolog = job_ptr->details->prolog_running;
-
-		if (prolog == 0
-		    && IS_JOB_CONFIGURING(job_ptr)) {
-			if (!IS_JOB_RUNNING(job_ptr) ||
-			    (bit_overlap(job_ptr->node_bitmap,
-					 power_node_bitmap) == 0)) {
-				debug("%s: Configuration for job %u is "
-				      "complete",
-				      __func__, job_ptr->job_id);
-				job_ptr->job_state &= (~JOB_CONFIGURING);
-			}
+		if ((prolog == 0) && IS_JOB_CONFIGURING(job_ptr) &&
+		    _test_nodes_ready(job_ptr)) {
+			info("%s: Configuration for job %u is complete",
+			      __func__, job_ptr->job_id);
+			job_config_fini(job_ptr);
 		}
 #endif
 		/* This needs to be near the top of the loop, checks every
 		 * running, suspended and pending job */
 		resv_status = job_resv_check(job_ptr);
 
-		if (job_ptr->details && job_ptr->details->prolog_running)
+		if (IS_JOB_CONFIGURING(job_ptr))
 			continue;
 
 		if (job_ptr->preempt_time &&
@@ -7366,7 +7604,7 @@ extern void job_set_req_tres(
 		job_ptr->tres_req_cnt, TRES_STR_FLAG_SIMPLE, true);
 
 	job_ptr->tres_fmt_req_str = assoc_mgr_make_tres_str_from_array(
-		job_ptr->tres_req_cnt, 0, true);
+		job_ptr->tres_req_cnt, TRES_STR_CONVERT_UNITS, true);
 
 	if (!assoc_mgr_locked)
 		assoc_mgr_unlock(&locks);
@@ -7432,7 +7670,7 @@ extern void job_set_alloc_tres(struct job_record *job_ptr,
 		job_ptr->tres_alloc_cnt, TRES_STR_FLAG_SIMPLE, true);
 
 	job_ptr->tres_fmt_alloc_str = assoc_mgr_make_tres_str_from_array(
-		job_ptr->tres_alloc_cnt, 0, true);
+		job_ptr->tres_alloc_cnt, TRES_STR_CONVERT_UNITS, true);
 
 	if (!assoc_mgr_locked)
 		assoc_mgr_unlock(&locks);
@@ -7500,8 +7738,16 @@ extern int job_update_tres_cnt(struct job_record *job_ptr, int node_inx)
 /* Terminate a job that has exhausted its time limit */
 static void _job_timed_out(struct job_record *job_ptr)
 {
+	ListIterator step_iterator;
+	struct step_record *step_ptr;
+
 	xassert(job_ptr);
 
+	step_iterator = list_iterator_create(job_ptr->step_list);
+	while ((step_ptr = (struct step_record *) list_next(step_iterator)))
+		select_g_step_finish(step_ptr, true);
+	list_iterator_destroy(step_iterator);
+
 	srun_timeout(job_ptr);
 	if (job_ptr->details) {
 		time_t now      = time(NULL);
@@ -7580,7 +7826,7 @@ static int _validate_job_desc(job_desc_msg_t * job_desc_msg, int allocate,
 	}
 
 
-	if (job_desc_msg->nice == (uint16_t) NO_VAL)
+	if (job_desc_msg->nice == NO_VAL)
 		job_desc_msg->nice = NICE_OFFSET;
 
 	if (job_desc_msg->pn_min_memory == NO_VAL) {
@@ -7592,8 +7838,10 @@ static int _validate_job_desc(job_desc_msg_t * job_desc_msg, int allocate,
 			job_desc_msg->pn_min_memory =
 					slurmctld_conf.def_mem_per_cpu;
 		}
-	} else if (!_validate_min_mem_partition(job_desc_msg, part_ptr, part_list))
+	} else if (!_validate_min_mem_partition(
+			   job_desc_msg, part_ptr, part_list))
 		return ESLURM_INVALID_TASK_MEMORY;
+
 	if (job_desc_msg->pn_min_memory == MEM_PER_CPU) {
 		/* Map --mem-per-cpu=0 to --mem=0 for simpler logic */
 		job_desc_msg->pn_min_memory = 0;
@@ -7630,14 +7878,32 @@ _validate_min_mem_partition(job_desc_msg_t *job_desc_msg,
 	struct part_record *part;
 	bool cc;
 
+	/* no reason to check them here as we aren't enforcing them */
+	if (!slurmctld_conf.enforce_part_limits)
+		return true;
+
 	if (part_list == NULL)
 		return _valid_pn_min_mem(job_desc_msg, part_ptr);
 
 	cc = false;
 	iter = list_iterator_create(part_list);
 	while ((part = list_next(iter))) {
-		if ((cc = _valid_pn_min_mem(job_desc_msg, part)))
+		cc = _valid_pn_min_mem(job_desc_msg, part);
+
+		/* for ALL we have to test them all */
+		if (slurmctld_conf.enforce_part_limits ==
+		    PARTITION_ENFORCE_ALL) {
+			if (!cc)
+				break;
+		} else if (cc) /* break, we found one! */
 			break;
+		else if (slurmctld_conf.enforce_part_limits ==
+			 PARTITION_ENFORCE_ANY) {
+			debug("%s: Job requested for (%u)MB is invalid"
+			      " for partition %s",
+			      __func__, job_desc_msg->pn_min_memory,
+			      part->name);
+		}
 	}
 	list_iterator_destroy(iter);
 
@@ -7730,6 +7996,7 @@ static void _list_delete_job(void *job_entry)
 	FREE_NULL_LIST(job_ptr->license_list);
 	xfree(job_ptr->limit_set.tres);
 	xfree(job_ptr->mail_user);
+	xfree(job_ptr->mcs_label);
 	xfree(job_ptr->name);
 	xfree(job_ptr->network);
 	xfree(job_ptr->node_addr);
@@ -7884,22 +8151,31 @@ static bool _hide_job(struct job_record *job_ptr, uid_t uid)
 {
 	if ((slurmctld_conf.private_data & PRIVATE_DATA_JOBS) &&
 	    (job_ptr->user_id != uid) && !validate_operator(uid) &&
-	    !assoc_mgr_is_user_acct_coord(acct_db_conn, uid, job_ptr->account))
+	    (((slurm_mcs_get_privatedata() == 0) &&
+	      !assoc_mgr_is_user_acct_coord(acct_db_conn, uid,
+					    job_ptr->account)) ||
+	     ((slurm_mcs_get_privatedata() == 1) &&
+	      (mcs_g_check_mcs_label(uid, job_ptr->mcs_label) != 0))))
 		return true;
 	return false;
 }
 
 /*
- * pack_all_sicp - dump inter-cluster job state information
+ * pack_all_jobs - dump all job information for all jobs in
+ *	machine independent form (for network transmission)
  * OUT buffer_ptr - the pointer is set to the allocated buffer.
  * OUT buffer_size - set to size of the buffer in bytes
- * IN uid - uid of user making request (for job/partition filtering)
+ * IN show_flags - job filtering options
+ * IN uid - uid of user making request (for partition filtering)
+ * IN filter_uid - pack only jobs belonging to this user if not NO_VAL
+ * global: job_list - global list of job records
  * NOTE: the buffer at *buffer_ptr must be xfreed by the caller
- * NOTE: change _unpack_sicp_msg() in common/slurm_protocol_pack.c
+ * NOTE: change _unpack_job_desc_msg() in common/slurm_protocol_pack.c
  *	whenever the data format changes
  */
-extern void pack_all_sicp(char **buffer_ptr, int *buffer_size,
-			  uid_t uid, uint16_t protocol_version)
+extern void pack_all_jobs(char **buffer_ptr, int *buffer_size,
+			  uint16_t show_flags, uid_t uid, uint32_t filter_uid,
+			  uint16_t protocol_version)
 {
 	ListIterator job_iterator;
 	struct job_record *job_ptr;
@@ -7911,81 +8187,21 @@ extern void pack_all_sicp(char **buffer_ptr, int *buffer_size,
 
 	buffer = init_buf(BUF_SIZE);
 
-	/* write message body header : size */
+	/* write message body header : size and time */
 	/* put in a place holder job record count of 0 for now */
 	pack32(jobs_packed, buffer);
+	pack_time(time(NULL), buffer);
 
 	/* write individual job records */
 	part_filter_set(uid);
 	job_iterator = list_iterator_create(job_list);
 	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
 		xassert (job_ptr->magic == JOB_MAGIC);
-		if ((job_ptr->job_id & 0x80000000) == 0)
-			continue;
-		if ((uid != 0) && _all_parts_hidden(job_ptr))
+
+		if (((show_flags & SHOW_ALL) == 0) && (uid != 0) &&
+		    _all_parts_hidden(job_ptr))
 			continue;
-		if (_hide_job(job_ptr, uid))
-			continue;
-
-		pack32(job_ptr->job_id,    buffer);
-		pack32(job_ptr->job_state, buffer);
-		jobs_packed++;
-	}
-	list_iterator_destroy(job_iterator);
-	part_filter_clear();
-
-	/* put the real record count in the message body header */
-	tmp_offset = get_buf_offset(buffer);
-	set_buf_offset(buffer, 0);
-	pack32(jobs_packed, buffer);
-	set_buf_offset(buffer, tmp_offset);
-
-	*buffer_size = get_buf_offset(buffer);
-	buffer_ptr[0] = xfer_buf_data(buffer);
-}
-
-/*
- * pack_all_jobs - dump all job information for all jobs in
- *	machine independent form (for network transmission)
- * OUT buffer_ptr - the pointer is set to the allocated buffer.
- * OUT buffer_size - set to size of the buffer in bytes
- * IN show_flags - job filtering options
- * IN uid - uid of user making request (for partition filtering)
- * IN filter_uid - pack only jobs belonging to this user if not NO_VAL
- * global: job_list - global list of job records
- * NOTE: the buffer at *buffer_ptr must be xfreed by the caller
- * NOTE: change _unpack_job_desc_msg() in common/slurm_protocol_pack.c
- *	whenever the data format changes
- */
-extern void pack_all_jobs(char **buffer_ptr, int *buffer_size,
-			  uint16_t show_flags, uid_t uid, uint32_t filter_uid,
-			  uint16_t protocol_version)
-{
-	ListIterator job_iterator;
-	struct job_record *job_ptr;
-	uint32_t jobs_packed = 0, tmp_offset;
-	Buf buffer;
-
-	buffer_ptr[0] = NULL;
-	*buffer_size = 0;
-
-	buffer = init_buf(BUF_SIZE);
-
-	/* write message body header : size and time */
-	/* put in a place holder job record count of 0 for now */
-	pack32(jobs_packed, buffer);
-	pack_time(time(NULL), buffer);
-
-	/* write individual job records */
-	part_filter_set(uid);
-	job_iterator = list_iterator_create(job_list);
-	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
-		xassert (job_ptr->magic == JOB_MAGIC);
-
-		if (((show_flags & SHOW_ALL) == 0) && (uid != 0) &&
-		    _all_parts_hidden(job_ptr))
-			continue;
-
+
 		if (_hide_job(job_ptr, uid))
 			continue;
 
@@ -8107,11 +8323,12 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 {
 	struct job_details *detail_ptr;
 	time_t begin_time = 0;
+	uint8_t uint8_tmp = 0;
 	char *nodelist = NULL;
 	assoc_mgr_lock_t locks = { NO_LOCK, NO_LOCK, READ_LOCK, NO_LOCK,
 				   NO_LOCK, NO_LOCK, NO_LOCK };
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		detail_ptr = dump_job_ptr->details;
 		pack32(dump_job_ptr->array_job_id, buffer);
 		pack32(dump_job_ptr->array_task_id, buffer);
@@ -8140,9 +8357,9 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 			pack16(dump_job_ptr->state_reason, buffer);
 		pack8(dump_job_ptr->power_flags,   buffer);
 		pack8(dump_job_ptr->reboot,        buffer);
-		pack8(dump_job_ptr->sicp_mode,     buffer);
 		pack16(dump_job_ptr->restart_cnt,  buffer);
 		pack16(show_flags,  buffer);
+		pack_time(dump_job_ptr->deadline, buffer);
 
 		pack32(dump_job_ptr->alloc_sid, buffer);
 		if ((dump_job_ptr->time_limit == NO_VAL)
@@ -8153,12 +8370,12 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		pack32(dump_job_ptr->time_min, buffer);
 
 		if (dump_job_ptr->details) {
-			pack16(dump_job_ptr->details->nice,  buffer);
+			pack32(dump_job_ptr->details->nice,  buffer);
 			pack_time(dump_job_ptr->details->submit_time, buffer);
 			/* Earliest possible begin time */
 			begin_time = dump_job_ptr->details->begin_time;
 		} else {   /* Some job details may be purged after completion */
-			pack16(NICE_OFFSET, buffer);	/* Best guess */
+			pack32(NICE_OFFSET, buffer);	/* Best guess */
 			pack_time((time_t) 0, buffer);
 		}
 
@@ -8222,6 +8439,7 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		packstr(dump_job_ptr->licenses, buffer);
 		packstr(dump_job_ptr->state_desc, buffer);
 		packstr(dump_job_ptr->resv_name, buffer);
+		packstr(dump_job_ptr->mcs_label, buffer);
 
 		pack32(dump_job_ptr->exit_code, buffer);
 		pack32(dump_job_ptr->derived_ec, buffer);
@@ -8263,7 +8481,9 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		pack32(dump_job_ptr->bit_flags, buffer);
 		packstr(dump_job_ptr->tres_fmt_alloc_str, buffer);
 		packstr(dump_job_ptr->tres_fmt_req_str, buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		pack16(dump_job_ptr->start_protocol_ver, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		uint16_t old_nice;
 		detail_ptr = dump_job_ptr->details;
 		pack32(dump_job_ptr->array_job_id, buffer);
 		pack32(dump_job_ptr->array_task_id, buffer);
@@ -8275,16 +8495,24 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 			packnull(buffer);
 			pack32((uint32_t) 0, buffer);
 		}
+
 		pack32(dump_job_ptr->assoc_id, buffer);
 		pack32(dump_job_ptr->job_id,   buffer);
 		pack32(dump_job_ptr->user_id,  buffer);
 		pack32(dump_job_ptr->group_id, buffer);
 		pack32(dump_job_ptr->profile,  buffer);
 
-		pack16(dump_job_ptr->job_state,    buffer);
+		pack32(dump_job_ptr->job_state,    buffer);
 		pack16(dump_job_ptr->batch_flag,   buffer);
-		pack16(dump_job_ptr->state_reason, buffer);
+		if ((dump_job_ptr->state_reason == WAIT_NO_REASON) &&
+		    IS_JOB_PENDING(dump_job_ptr)) {
+			/* Scheduling cycle in progress, send latest reason */
+			pack16(dump_job_ptr->state_reason_prev, buffer);
+		} else
+			pack16(dump_job_ptr->state_reason, buffer);
+		pack8(dump_job_ptr->power_flags,   buffer);
 		pack8(dump_job_ptr->reboot,        buffer);
+		pack8(uint8_tmp,    buffer);
 		pack16(dump_job_ptr->restart_cnt,  buffer);
 		pack16(show_flags,  buffer);
 
@@ -8297,12 +8525,15 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		pack32(dump_job_ptr->time_min, buffer);
 
 		if (dump_job_ptr->details) {
-			pack16(dump_job_ptr->details->nice,  buffer);
+			old_nice = xlate_nice_new2old(
+					dump_job_ptr->details->nice);
+			pack16(old_nice,  buffer);
 			pack_time(dump_job_ptr->details->submit_time, buffer);
 			/* Earliest possible begin time */
 			begin_time = dump_job_ptr->details->begin_time;
-		} else {
-			pack16(0, buffer);
+		} else {   /* Some job details may be purged after completion */
+			old_nice = xlate_nice_new2old(NICE_OFFSET);
+			pack16(old_nice, buffer);	/* Best guess */
 			pack_time((time_t) 0, buffer);
 		}
 
@@ -8319,6 +8550,7 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		pack_time(dump_job_ptr->resize_time, buffer);
 		pack_time(dump_job_ptr->preempt_time, buffer);
 		pack32(dump_job_ptr->priority, buffer);
+		packdouble(dump_job_ptr->billable_tres, buffer);
 
 		/* Only send the allocated nodelist since we are only sending
 		 * the number of cpus and nodes that are currently allocated. */
@@ -8352,6 +8584,7 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		} else {
 			packnull(buffer);
 		}
+		packstr(dump_job_ptr->burst_buffer, buffer);
 
 		assoc_mgr_lock(&locks);
 		if (assoc_mgr_qos_list) {
@@ -8402,19 +8635,32 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		else
 			_pack_pending_job_details(NULL, buffer,
 						  protocol_version);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		pack32(dump_job_ptr->bit_flags, buffer);
+		packstr(dump_job_ptr->tres_fmt_alloc_str, buffer);
+		packstr(dump_job_ptr->tres_fmt_req_str, buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		uint16_t old_nice;
 		detail_ptr = dump_job_ptr->details;
 		pack32(dump_job_ptr->array_job_id, buffer);
 		pack32(dump_job_ptr->array_task_id, buffer);
+		if (dump_job_ptr->array_recs) {
+			build_array_str(dump_job_ptr);
+			packstr(dump_job_ptr->array_recs->task_id_str, buffer);
+			pack32(dump_job_ptr->array_recs->max_run_tasks, buffer);
+		} else {
+			packnull(buffer);
+			pack32((uint32_t) 0, buffer);
+		}
 		pack32(dump_job_ptr->assoc_id, buffer);
-		pack32(dump_job_ptr->job_id, buffer);
-		pack32(dump_job_ptr->user_id, buffer);
+		pack32(dump_job_ptr->job_id,   buffer);
+		pack32(dump_job_ptr->user_id,  buffer);
 		pack32(dump_job_ptr->group_id, buffer);
-		pack32(dump_job_ptr->profile, buffer);
+		pack32(dump_job_ptr->profile,  buffer);
 
 		pack16(dump_job_ptr->job_state,    buffer);
 		pack16(dump_job_ptr->batch_flag,   buffer);
 		pack16(dump_job_ptr->state_reason, buffer);
+		pack8(dump_job_ptr->reboot,        buffer);
 		pack16(dump_job_ptr->restart_cnt,  buffer);
 		pack16(show_flags,  buffer);
 
@@ -8427,12 +8673,15 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 		pack32(dump_job_ptr->time_min, buffer);
 
 		if (dump_job_ptr->details) {
-			pack16(dump_job_ptr->details->nice,  buffer);
+			old_nice = xlate_nice_new2old(
+					dump_job_ptr->details->nice);
+			pack16(old_nice,  buffer);
 			pack_time(dump_job_ptr->details->submit_time, buffer);
 			/* Earliest possible begin time */
 			begin_time = dump_job_ptr->details->begin_time;
 		} else {
-			pack16(0, buffer);
+			old_nice = xlate_nice_new2old(NICE_OFFSET);
+			pack16(old_nice, buffer);	/* Best guess */
 			pack_time((time_t) 0, buffer);
 		}
 
@@ -8461,6 +8710,8 @@ void pack_job(struct job_record *dump_job_ptr, uint16_t show_flags, Buf buffer,
 			xfree(nodelist);
 		}
 
+		packstr(dump_job_ptr->sched_nodes, buffer);
+
 		if (!IS_JOB_PENDING(dump_job_ptr) && dump_job_ptr->part_ptr)
 			packstr(dump_job_ptr->part_ptr->name, buffer);
 		else
@@ -8588,6 +8839,8 @@ static void _pack_default_job_details(struct job_record *job_ptr,
 		shared = 0;
 	else if (detail_ptr->whole_node == 2)	/* User --exclusive=user */
 		shared = 2;
+	else if (detail_ptr->whole_node == 3)   /* User --exclusive=mcs */
+		shared = 3;
 	else if (job_ptr->part_ptr) {
 		/* Report shared status based upon latest partition info */
 		if (job_ptr->part_ptr->flags & PART_FLAG_EXCLUSIVE_USER)
@@ -8608,7 +8861,154 @@ static void _pack_default_job_details(struct job_record *job_ptr,
 	} else
 		_find_node_config(&max_cpu_cnt, &max_core_cnt);
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (detail_ptr) {
+			packstr(detail_ptr->features,   buffer);
+			packstr(detail_ptr->work_dir,   buffer);
+			packstr(detail_ptr->dependency, buffer);
+
+			if (detail_ptr->argv) {
+				/* Determine size needed for a string
+				 * containing all arguments */
+				for (i =0; detail_ptr->argv[i]; i++) {
+					len += strlen(detail_ptr->argv[i]);
+				}
+				len += i;
+
+				cmd_line = xmalloc(len*sizeof(char));
+				tmp = cmd_line;
+				for (i = 0; detail_ptr->argv[i]; i++) {
+					if (i != 0) {
+						*tmp = ' ';
+						tmp++;
+					}
+					strcpy(tmp,detail_ptr->argv[i]);
+					tmp += strlen(detail_ptr->argv[i]);
+				}
+				packstr(cmd_line, buffer);
+				xfree(cmd_line);
+			} else
+				packnull(buffer);
+
+			if (IS_JOB_COMPLETING(job_ptr) && job_ptr->cpu_cnt) {
+				pack32(job_ptr->cpu_cnt, buffer);
+				pack32((uint32_t) 0, buffer);
+			} else if (job_ptr->total_cpus &&
+				   !IS_JOB_PENDING(job_ptr)) {
+				/* If job is PENDING ignore total_cpus,
+				 * which may have been set by previous run
+				 * followed by job requeue. */
+				pack32(job_ptr->total_cpus, buffer);
+				pack32((uint32_t) 0, buffer);
+			} else {
+				pack32(detail_ptr->min_cpus, buffer);
+				if (detail_ptr->max_cpus != NO_VAL)
+					pack32(detail_ptr->max_cpus, buffer);
+				else
+					pack32((uint32_t) 0, buffer);
+			}
+
+			if (IS_JOB_COMPLETING(job_ptr) && job_ptr->node_cnt) {
+				pack32(job_ptr->node_cnt, buffer);
+				pack32((uint32_t) 0, buffer);
+			} else if (job_ptr->total_nodes) {
+				pack32(job_ptr->total_nodes, buffer);
+				pack32((uint32_t) 0, buffer);
+			} else if (job_ptr->node_cnt_wag) {
+				/* This should catch everything else, but
+				 * just incase this is 0 (startup or
+				 * whatever) we will keep the rest of
+				 * this if statement around.
+				 */
+				pack32(job_ptr->node_cnt_wag, buffer);
+				pack32((uint32_t) detail_ptr->max_nodes,
+				       buffer);
+			} else if (detail_ptr->ntasks_per_node) {
+				/* min_nodes based upon task count and ntasks
+				 * per node */
+				uint32_t min_nodes;
+				min_nodes = detail_ptr->num_tasks /
+					    detail_ptr->ntasks_per_node;
+				min_nodes = MAX(min_nodes,
+						detail_ptr->min_nodes);
+				pack32(min_nodes, buffer);
+				pack32(detail_ptr->max_nodes, buffer);
+			} else if (detail_ptr->cpus_per_task > 1) {
+				/* min_nodes based upon task count and cpus
+				 * per task */
+				uint32_t min_cpus, min_nodes;
+				min_cpus = detail_ptr->num_tasks *
+					   detail_ptr->cpus_per_task;
+				min_nodes = min_cpus + max_cpu_cnt - 1;
+				min_nodes /= max_cpu_cnt;
+				min_nodes = MAX(min_nodes,
+						detail_ptr->min_nodes);
+				pack32(min_nodes, buffer);
+				pack32(detail_ptr->max_nodes, buffer);
+			} else if (detail_ptr->mc_ptr &&
+				   detail_ptr->mc_ptr->ntasks_per_core &&
+				   (detail_ptr->mc_ptr->ntasks_per_core
+				    != (uint16_t)INFINITE)) {
+				/* min_nodes based upon task count and ntasks
+				 * per core */
+				uint32_t min_cores, min_nodes;
+				min_cores = detail_ptr->num_tasks +
+					    detail_ptr->mc_ptr->ntasks_per_core
+					    - 1;
+				min_cores /= detail_ptr->mc_ptr->ntasks_per_core;
+
+				min_nodes = min_cores + max_core_cnt - 1;
+				min_nodes /= max_core_cnt;
+				min_nodes = MAX(min_nodes,
+						detail_ptr->min_nodes);
+				pack32(min_nodes, buffer);
+				pack32(detail_ptr->max_nodes, buffer);
+			} else {
+				/* min_nodes based upon task count only */
+				uint32_t min_nodes;
+				min_nodes = detail_ptr->num_tasks +
+					    max_cpu_cnt - 1;
+				min_nodes /= max_cpu_cnt;
+				min_nodes = MAX(min_nodes,
+						detail_ptr->min_nodes);
+				pack32(min_nodes, buffer);
+				pack32(detail_ptr->max_nodes, buffer);
+			}
+
+			pack16(detail_ptr->requeue,   buffer);
+			pack16(detail_ptr->ntasks_per_node, buffer);
+			if (detail_ptr->num_tasks)
+				pack32(detail_ptr->num_tasks, buffer);
+			else if (IS_JOB_PENDING(job_ptr))
+				pack32(detail_ptr->min_nodes, buffer);
+			else
+				pack32(job_ptr->node_cnt, buffer);
+			pack16(shared, buffer);
+			pack32(detail_ptr->cpu_freq_min, buffer);
+			pack32(detail_ptr->cpu_freq_max, buffer);
+			pack32(detail_ptr->cpu_freq_gov, buffer);
+		} else {
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+			packnull(buffer);
+
+			if (job_ptr->total_cpus)
+				pack32(job_ptr->total_cpus, buffer);
+			else
+				pack32(job_ptr->cpu_cnt, buffer);
+			pack32((uint32_t) 0, buffer);
+
+			pack32(job_ptr->node_cnt, buffer);
+			pack32((uint32_t) 0, buffer);
+			pack16((uint16_t) 0, buffer);
+			pack16((uint16_t) 0, buffer);
+			pack16((uint16_t) 0, buffer);
+			pack32((uint32_t) 0, buffer);
+			pack32((uint32_t) 0, buffer);
+			pack32((uint32_t) 0, buffer);
+		}
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		if (detail_ptr) {
 			packstr(detail_ptr->features,   buffer);
 			packstr(detail_ptr->work_dir,   buffer);
@@ -8940,49 +9340,7 @@ static void _pack_pending_job_details(struct job_details *detail_ptr,
 
 			pack_multi_core_data(NULL, buffer, protocol_version);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
-		if (detail_ptr) {
-			pack16(detail_ptr->contiguous, buffer);
-			pack16(detail_ptr->core_spec, buffer);
-			pack16(detail_ptr->cpus_per_task, buffer);
-			pack16(detail_ptr->pn_min_cpus, buffer);
-
-			pack32(detail_ptr->pn_min_memory, buffer);
-			pack32(detail_ptr->pn_min_tmp_disk, buffer);
-
-			packstr(detail_ptr->req_nodes, buffer);
-			pack_bit_fmt(detail_ptr->req_node_bitmap, buffer);
-			/* detail_ptr->req_node_layout is not packed */
-			packstr(detail_ptr->exc_nodes, buffer);
-			pack_bit_fmt(detail_ptr->exc_node_bitmap, buffer);
-
-			packstr(detail_ptr->std_err, buffer);
-			packstr(detail_ptr->std_in, buffer);
-			packstr(detail_ptr->std_out, buffer);
-
-			pack_multi_core_data(detail_ptr->mc_ptr, buffer,
-					     protocol_version);
-		} else {
-			pack16((uint16_t) 0, buffer);
-			pack16((uint16_t) 0, buffer);
-			pack16((uint16_t) 0, buffer);
-			pack16((uint16_t) 0, buffer);
-
-			pack32((uint32_t) 0, buffer);
-			pack32((uint32_t) 0, buffer);
-
-			packnull(buffer);
-			packnull(buffer);
-			packnull(buffer);
-			packnull(buffer);
-
-			packnull(buffer);
-			packnull(buffer);
-			packnull(buffer);
-
-			pack_multi_core_data(NULL, buffer, protocol_version);
-		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		if (detail_ptr) {
 			pack16(detail_ptr->contiguous, buffer);
 			pack16(detail_ptr->core_spec, buffer);
@@ -9138,7 +9496,7 @@ void reset_job_bitmaps(void)
 		}
 
 	}
-	if (slurm_get_preempt_mode() == PREEMPT_MODE_GANG)
+	if (slurmctld_conf.preempt_mode & PREEMPT_MODE_GANG)
 		gang_flag = true;
 
 	job_iterator = list_iterator_create(job_list);
@@ -9347,70 +9705,39 @@ extern uint32_t get_next_job_id(void)
  * _set_job_id - set a default job_id, insure that it is unique
  * IN job_ptr - pointer to the job_record
  */
-static int _set_job_id(struct job_record *job_ptr, bool global_job)
+static int _set_job_id(struct job_record *job_ptr)
 {
 	int i;
-	uint32_t global_base, new_id, max_jobs;
+	uint32_t new_id, max_jobs;
 
 	xassert(job_ptr);
 	xassert (job_ptr->magic == JOB_MAGIC);
 
 	max_jobs = slurmctld_conf.max_job_id - slurmctld_conf.first_job_id;
-	if (global_job) {
-uint16_t cluster_id = 0;	/* FIXME: Temporary value */
-		/* 0x80000000 set for global jobs
-		 * 0x7E000000 contains the cluster ID (0 t0 63)
-		 * 0x01ffffff contains a sequence number (1 to 33,554,431) */
-		global_base = 0x80000000 | (cluster_id << 25);
-		max_jobs = MIN(max_jobs, 0x01ffffff);
-		for (i = 0; i < max_jobs; i++) {
-			if (++job_id_sequence >= slurmctld_conf.max_job_id)
-				job_id_sequence = slurmctld_conf.first_job_id;
-			new_id = job_id_sequence + global_base;
-			if (find_job_record(new_id))
-				continue;
-			if (_dup_job_file_test(new_id))
-				continue;
+	job_id_sequence = MAX(job_id_sequence, slurmctld_conf.first_job_id);
 
-			job_ptr->job_id = new_id;
-			/* When we get a new job id might as well make sure
-			 * the db_index is 0 since there is no way it will be
-			 * correct otherwise :).
-			 */
-			job_ptr->db_index = 0;
-			return SLURM_SUCCESS;
-		}
-		error("We have exhausted our supply of global job id values");
-		job_ptr->job_id = NO_VAL;
-		return EAGAIN;
-	} else {
-		job_id_sequence = MAX(job_id_sequence,
-				      slurmctld_conf.first_job_id);
-
-		/* Insure no conflict in job id if we roll over 32 bits */
-		for (i = 0; i < max_jobs; i++) {
-			if (++job_id_sequence >= slurmctld_conf.max_job_id)
-				job_id_sequence = slurmctld_conf.first_job_id;
-			new_id = job_id_sequence;
-			if (find_job_record(new_id))
-				continue;
-			if (_dup_job_file_test(new_id))
-				continue;
+	/* Insure no conflict in job id if we roll over 32 bits */
+	for (i = 0; i < max_jobs; i++) {
+		if (++job_id_sequence >= slurmctld_conf.max_job_id)
+			job_id_sequence = slurmctld_conf.first_job_id;
+		new_id = job_id_sequence;
+		if (find_job_record(new_id))
+			continue;
+		if (_dup_job_file_test(new_id))
+			continue;
 
-			job_ptr->job_id = new_id;
-			/* When we get a new job id might as well make sure
-			 * the db_index is 0 since there is no way it will be
-			 * correct otherwise :).
-			 */
-			job_ptr->db_index = 0;
-			return SLURM_SUCCESS;
-		}
-		error("We have exhausted our supply of valid job id values. "
-		      "FirstJobId=%u MaxJobId=%u", slurmctld_conf.first_job_id,
-		      slurmctld_conf.max_job_id);
-		job_ptr->job_id = NO_VAL;
-		return EAGAIN;
+		job_ptr->job_id = new_id;
+		/* When we get a new job id might as well make sure
+		 * the db_index is 0 since there is no way it will be
+		 * correct otherwise :). */
+		job_ptr->db_index = 0;
+		return SLURM_SUCCESS;
 	}
+	error("We have exhausted our supply of valid job id values. "
+	      "FirstJobId=%u MaxJobId=%u", slurmctld_conf.first_job_id,
+	      slurmctld_conf.max_job_id);
+	job_ptr->job_id = NO_VAL;
+	return EAGAIN;
 }
 
 
@@ -9434,7 +9761,7 @@ extern void set_job_prio(struct job_record *job_ptr)
 
 	relative_prio = job_ptr->priority;
 	if (job_ptr->details && (job_ptr->details->nice != NICE_OFFSET)) {
-		int offset = job_ptr->details->nice;
+		int64_t offset = job_ptr->details->nice;
 		offset -= NICE_OFFSET;
 		relative_prio += offset;
 	}
@@ -9451,7 +9778,7 @@ extern void sync_job_priorities(void)
 
 	if ((highest_prio != 0) && (highest_prio < TOP_PRIORITY))
 		prio_boost = TOP_PRIORITY - highest_prio;
-	if (strcmp(slurmctld_conf.priority_type, "priority/basic") ||
+	if (xstrcmp(slurmctld_conf.priority_type, "priority/basic") ||
 	    (prio_boost < 1000000))
 		return;
 
@@ -9533,8 +9860,8 @@ static bool _top_priority(struct job_record *job_ptr)
 			    ((!job_ptr2->resv_name) && job_ptr->resv_name))
 				continue;	/* different reservation */
 			if (job_ptr2->resv_name && job_ptr->resv_name &&
-			    (!strcmp(job_ptr2->resv_name,
-				     job_ptr->resv_name))) {
+			    (!xstrcmp(job_ptr2->resv_name,
+				      job_ptr->resv_name))) {
 				/* same reservation */
 				if (job_ptr2->priority <= job_ptr->priority)
 					continue;
@@ -9555,10 +9882,10 @@ static bool _top_priority(struct job_record *job_ptr)
 			if (bit_overlap(job_ptr->part_ptr->node_bitmap,
 					job_ptr2->part_ptr->node_bitmap) == 0)
 				continue;   /* no node overlap in partitions */
-			if ((job_ptr2->part_ptr->priority >
-			     job_ptr ->part_ptr->priority) ||
-			    ((job_ptr2->part_ptr->priority ==
-			      job_ptr ->part_ptr->priority) &&
+			if ((job_ptr2->part_ptr->priority_tier >
+			     job_ptr ->part_ptr->priority_tier) ||
+			    ((job_ptr2->part_ptr->priority_tier ==
+			      job_ptr ->part_ptr->priority_tier) &&
 			     (job_ptr2->priority >  job_ptr->priority))) {
 				top = false;
 				break;
@@ -9687,6 +10014,9 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 					      (uint32_t) uid);
 	if (error_code != SLURM_SUCCESS)
 		return error_code;
+	error_code = node_features_g_job_valid(job_specs->features);
+	if (error_code != SLURM_SUCCESS)
+		return error_code;
 
 	error_code = _test_job_desc_fields(job_specs);
 	if (error_code != SLURM_SUCCESS)
@@ -9800,9 +10130,9 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 
 	if (!wiki_sched_test) {
 		char *sched_type = slurm_get_sched_type();
-		if (strcmp(sched_type, "sched/wiki") == 0)
+		if (xstrcmp(sched_type, "sched/wiki") == 0)
 			wiki_sched  = true;
-		if (strcmp(sched_type, "sched/wiki2") == 0) {
+		if (xstrcmp(sched_type, "sched/wiki2") == 0) {
 			wiki_sched  = true;
 			wiki2_sched = true;
 		}
@@ -9965,7 +10295,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 	/* NOTE: Update QOS before updating partition in order to enforce
 	 * AllowQOS and DenyQOS partition configuration options */
 	if (job_specs->qos) {
-		if (!authorized && !IS_JOB_PENDING(job_ptr))
+		if (!authorized || !IS_JOB_PENDING(job_ptr))
 			error_code = ESLURM_JOB_NOT_PENDING;
 		else {
 			slurmdb_qos_rec_t qos_rec;
@@ -9992,11 +10322,13 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 				     __func__, new_qos_ptr->name,
 				     job_ptr->job_id);
 				if (job_ptr->qos_id != qos_rec.id) {
+					acct_policy_remove_job_submit(job_ptr);
 					job_ptr->qos_id = qos_rec.id;
 					job_ptr->qos_ptr = new_qos_ptr;
 					job_ptr->limit_set.qos =
 						acct_policy_limit_set.qos;
 					update_accounting = true;
+					acct_policy_add_job_submit(job_ptr);
 				} else {
 					debug("sched: %s: new QOS identical "
 					      "to old QOS %u",
@@ -10240,7 +10572,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			job_ptr->tres_fmt_req_str =
 				assoc_mgr_make_tres_str_from_array(
 					job_ptr->tres_req_cnt,
-					0, false);
+					TRES_STR_CONVERT_UNITS, false);
 		}
 	}
 	if (job_specs->max_cpus != NO_VAL) {
@@ -10269,7 +10601,8 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			xfree(job_ptr->tres_fmt_req_str);
 			job_ptr->tres_fmt_req_str =
 				assoc_mgr_make_tres_str_from_array(
-					job_ptr->tres_req_cnt, 0, false);
+					job_ptr->tres_req_cnt,
+					TRES_STR_CONVERT_UNITS, false);
 		}
 		if (save_max_cpus) {
 			detail_ptr->max_cpus = save_max_cpus;
@@ -10336,7 +10669,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			   job_specs->cpus_per_task) {
 			info("%s: setting cpus_per_task from %u to %u for "
 			     "job_id %u", __func__, detail_ptr->cpus_per_task,
-			     job_specs->pn_min_cpus,
+			     job_specs->cpus_per_task,
 			     job_ptr->job_id);
 			detail_ptr->cpus_per_task = job_specs->cpus_per_task;
 		}
@@ -10405,7 +10738,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 		job_ptr->tres_fmt_req_str =
 			assoc_mgr_make_tres_str_from_array(
 				job_ptr->tres_req_cnt,
-				0, false);
+				TRES_STR_CONVERT_UNITS, false);
 		update_accounting = true;
 	}
 	if (save_max_nodes && (save_max_nodes != detail_ptr->max_nodes)) {
@@ -10548,6 +10881,29 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			error_code = ESLURM_ACCESS_DENIED;
 		}
 	}
+
+	if ((job_specs->deadline) && (!IS_JOB_RUNNING(job_ptr))) {
+		char time_str[32];
+		slurm_make_time_str(&job_ptr->deadline,time_str,
+				    sizeof(time_str));
+		if (job_specs->deadline < now) {
+			error_code = ESLURM_INVALID_TIME_VALUE;
+		} else if (authorized) {
+			/* update deadline */
+			job_ptr->deadline = job_specs->deadline;
+			info("sched: update_job: setting deadline to %s for "
+			     "job_id %u", time_str,
+			     job_specs->job_id);
+			/* Always use the acct_policy_limit_set.*
+			 * since if set by a super user it be set correctly */
+			job_ptr->limit_set.time = acct_policy_limit_set.time;
+			update_accounting = true;
+		} else {
+			info("sched: Attempt to extend end time for job %u",
+			     job_specs->job_id);
+			error_code = ESLURM_ACCESS_DENIED;
+		}
+	}
 	if (error_code != SLURM_SUCCESS)
 		goto fini;
 
@@ -10688,7 +11044,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 	if (error_code != SLURM_SUCCESS)
 		goto fini;
 
-	if (job_specs->nice != (uint16_t) NO_VAL) {
+	if (job_specs->nice != NO_VAL) {
 		if (IS_JOB_FINISHED(job_ptr) || (job_ptr->details == NULL))
 			error_code = ESLURM_JOB_FINISHED;
 		else if (job_ptr->details &&
@@ -10752,7 +11108,8 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			xfree(job_ptr->tres_fmt_req_str);
 			job_ptr->tres_fmt_req_str =
 				assoc_mgr_make_tres_str_from_array(
-					job_ptr->tres_req_cnt, 0, false);
+					job_ptr->tres_req_cnt,
+					TRES_STR_CONVERT_UNITS, false);
 		}
 	}
 	if (error_code != SLURM_SUCCESS)
@@ -10928,18 +11285,18 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 
 		xfree(job_ptr->tres_fmt_req_str);
 		job_ptr->tres_fmt_req_str = assoc_mgr_make_tres_str_from_array(
-				job_ptr->tres_req_cnt, 0, false);
+				job_ptr->tres_req_cnt,
+				TRES_STR_CONVERT_UNITS, false);
 		assoc_mgr_unlock(&locks);
 	}
 
-	if (job_specs->name
-	    && !xstrcmp(job_specs->name, job_ptr->name)) {
-		debug("sched: update_job: new name identical to "
-		      "old name %u", job_ptr->job_id);
-	} if (job_specs->name) {
+	if (job_specs->name) {
 		if (IS_JOB_FINISHED(job_ptr)) {
 			error_code = ESLURM_JOB_FINISHED;
 			goto fini;
+		} else if (!xstrcmp(job_specs->name, job_ptr->name)) {
+			debug("sched: update_job: new name identical to "
+			      "old name %u", job_ptr->job_id);
 		} else {
 			xfree(job_ptr->name);
 			job_ptr->name = xstrdup(job_specs->name);
@@ -11191,7 +11548,8 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 			xfree(job_ptr->tres_fmt_req_str);
 			job_ptr->tres_fmt_req_str =
 				assoc_mgr_make_tres_str_from_array(
-					job_ptr->tres_req_cnt, 0, false);
+					job_ptr->tres_req_cnt,
+					TRES_STR_CONVERT_UNITS, false);
 			assoc_mgr_unlock(&locks);
 		} else if (IS_JOB_RUNNING(job_ptr) &&
 			   (authorized || (license_list == NULL))) {
@@ -11453,7 +11811,7 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs,
 	if (job_specs->network) {
 		xfree(job_ptr->network);
 		if (!strlen(job_specs->network)
-		    || !strcmp(job_specs->network, "none")) {
+		    || !xstrcmp(job_specs->network, "none")) {
 			info("sched: update_job: clearing Network option "
 			     "for jobid %u", job_ptr->job_id);
 		} else {
@@ -11484,7 +11842,7 @@ fini:
 	 * many factors of an update may affect priority considerations.
 	 * If job has a hold then do nothing */
 	if ((error_code == SLURM_SUCCESS) && (job_ptr->priority != 0) &&
-	    strcmp(slurmctld_conf.priority_type, "priority/basic"))
+	    xstrcmp(slurmctld_conf.priority_type, "priority/basic"))
 		set_job_prio(job_ptr);
 
 	return error_code;
@@ -11736,7 +12094,7 @@ static void _send_job_kill(struct job_record *job_ptr)
 #endif
 
 	if (select_serial == -1) {
-		if (strcmp(slurmctld_conf.select_type, "select/serial"))
+		if (xstrcmp(slurmctld_conf.select_type, "select/serial"))
 			select_serial = 0;
 		else
 			select_serial = 1;
@@ -11863,6 +12221,16 @@ extern void job_post_resize_acctg(struct job_record *job_ptr)
 	job_ptr->end_time_exp = job_ptr->end_time;
 }
 
+static char *_build_step_id(char *buf, int buf_len,
+			    uint32_t job_id, uint32_t step_id)
+{
+	if (step_id == SLURM_BATCH_SCRIPT)
+		snprintf(buf, buf_len, "%u.batch", job_id);
+	else
+		snprintf(buf, buf_len, "%u.%u", job_id, step_id);
+	return buf;
+}
+
 /*
  * validate_jobs_on_node - validate that any jobs that should be on the node
  *	are actually running, if not clean up the job records and/or node
@@ -11877,7 +12245,8 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 	struct node_record *node_ptr;
 	struct job_record *job_ptr;
 	struct step_record *step_ptr;
-	time_t now = time(NULL);
+	char step_str[64];
+	time_t boot_req_time, now = time(NULL);
 
 	node_ptr = find_node_record(reg_msg->node_name);
 	if (node_ptr == NULL) {
@@ -11903,6 +12272,15 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 		error("Node up_time is invalid: %u>%u", reg_msg->up_time,
 		      (uint32_t) now);
 	}
+	if (IS_NODE_POWER_UP(node_ptr)) {
+		boot_req_time = node_ptr->last_response -
+				slurm_get_resume_timeout();
+		if (node_ptr->boot_time < boot_req_time) {
+			debug("Still waiting for boot of node %s",
+			      node_ptr->name);
+			return;
+		}
+	}
 
 	node_inx = node_ptr - node_record_table_ptr;
 
@@ -11910,8 +12288,10 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 	for (i = 0; i < reg_msg->job_count; i++) {
 		if ( (reg_msg->job_id[i] >= MIN_NOALLOC_JOBID) &&
 		     (reg_msg->job_id[i] <= MAX_NOALLOC_JOBID) ) {
-			info("NoAllocate job %u.%u reported on node %s",
-			     reg_msg->job_id[i], reg_msg->step_id[i],
+			info("NoAllocate job %s reported on node %s",
+			     _build_step_id(step_str, sizeof(step_str),
+					    reg_msg->job_id[i],
+					    reg_msg->step_id[i]),
 			     reg_msg->node_name);
 			continue;
 		}
@@ -11920,8 +12300,10 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 
 		job_ptr = find_job_record(reg_msg->job_id[i]);
 		if (job_ptr == NULL) {
-			error("Orphan job %u.%u reported on node %s",
-			      reg_msg->job_id[i], reg_msg->step_id[i],
+			error("Orphan job %s reported on node %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
 			      reg_msg->node_name);
 			abort_job_on_node(reg_msg->job_id[i],
 					  job_ptr, node_ptr->name);
@@ -11930,9 +12312,11 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 		else if (IS_JOB_RUNNING(job_ptr) ||
 			 IS_JOB_SUSPENDED(job_ptr)) {
 			if (bit_test(job_ptr->node_bitmap, node_inx)) {
-				debug3("Registered job %u.%u on node %s ",
-				       reg_msg->job_id[i],
-				       reg_msg->step_id[i],
+				debug3("Registered job %s on node %s ",
+				       _build_step_id(step_str,
+						      sizeof(step_str),
+						      reg_msg->job_id[i],
+						      reg_msg->step_id[i]),
 				       reg_msg->node_name);
 				if ((job_ptr->batch_flag) &&
 				    (node_inx == bit_ffs(
@@ -11950,9 +12334,11 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 				/* Typically indicates a job requeue and
 				 * restart on another nodes. A node from the
 				 * original allocation just responded here. */
-				error("Registered job %u.%u on wrong node %s ",
-				      reg_msg->job_id[i],
-				      reg_msg->step_id[i],
+				error("Registered job %s on wrong node %s ",
+				       _build_step_id(step_str,
+						      sizeof(step_str),
+						      reg_msg->job_id[i],
+						      reg_msg->step_id[i]),
 				      reg_msg->node_name);
 				info("%s: job nodes %s count %d inx %d",
 				     __func__, job_ptr->nodes,
@@ -11973,8 +12359,10 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 		else if (IS_JOB_PENDING(job_ptr)) {
 			/* Typically indicates a job requeue and the hung
 			 * slurmd that went DOWN is now responding */
-			error("Registered PENDING job %u.%u on node %s ",
-			      reg_msg->job_id[i], reg_msg->step_id[i],
+			error("Registered PENDING job %s on node %s ",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
 			      reg_msg->node_name);
 			abort_job_on_node(reg_msg->job_id[i],
 					  job_ptr, node_ptr->name);
@@ -11982,14 +12370,18 @@ validate_jobs_on_node(slurm_node_registration_status_msg_t *reg_msg)
 
 		else if (difftime(now, job_ptr->end_time) <
 			 slurm_get_msg_timeout()) {	/* Race condition */
-			debug("Registered newly completed job %u.%u on %s",
-				reg_msg->job_id[i], reg_msg->step_id[i],
-				node_ptr->name);
+			debug("Registered newly completed job %s on %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
+			      node_ptr->name);
 		}
 
 		else {		/* else job is supposed to be done */
-			error("Registered job %u.%u in state %s on node %s ",
-			      reg_msg->job_id[i], reg_msg->step_id[i],
+			error("Registered job %s in state %s on node %s ",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
 			      job_state_string(job_ptr->job_state),
 			      reg_msg->node_name);
 			kill_job_on_node(reg_msg->job_id[i], job_ptr,
@@ -12042,13 +12434,8 @@ static void _purge_missing_jobs(int node_inx, time_t now)
 
 	job_iterator = list_iterator_create(job_list);
 	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
-		bool job_active = IS_JOB_RUNNING(job_ptr) ||
-				  IS_JOB_SUSPENDED(job_ptr);
-
-		if (job_ptr->details && job_ptr->details->prolog_running)
-			continue;
-
-		if ((!job_active) ||
+		if ((IS_JOB_CONFIGURING(job_ptr) ||
+		    (!IS_JOB_RUNNING(job_ptr) && !IS_JOB_SUSPENDED(job_ptr))) ||
 		    (!bit_test(job_ptr->node_bitmap, node_inx)))
 			continue;
 		if ((job_ptr->batch_flag != 0)			&&
@@ -12245,7 +12632,11 @@ job_alloc_info(uint32_t uid, uint32_t job_id, struct job_record **job_pptr)
 		return ESLURM_INVALID_JOB_ID;
 	if ((slurmctld_conf.private_data & PRIVATE_DATA_JOBS) &&
 	    (job_ptr->user_id != uid) && !validate_operator(uid) &&
-	    !assoc_mgr_is_user_acct_coord(acct_db_conn, uid, job_ptr->account))
+	    (((slurm_mcs_get_privatedata() == 0) &&
+	      !assoc_mgr_is_user_acct_coord(acct_db_conn, uid,
+					    job_ptr->account)) ||
+	     ((slurm_mcs_get_privatedata() == 1) &&
+	      (mcs_g_check_mcs_label(uid, job_ptr->mcs_label) != 0))))
 		return ESLURM_ACCESS_DENIED;
 	if (IS_JOB_PENDING(job_ptr))
 		return ESLURM_JOB_PENDING;
@@ -12254,7 +12645,7 @@ job_alloc_info(uint32_t uid, uint32_t job_id, struct job_record **job_pptr)
 	if (job_ptr->details)
 		prolog = job_ptr->details->prolog_running;
 
-	if (job_ptr->alias_list && !strcmp(job_ptr->alias_list, "TBD") &&
+	if (job_ptr->alias_list && !xstrcmp(job_ptr->alias_list, "TBD") &&
 	    (prolog == 0) && job_ptr->node_bitmap &&
 	    (bit_overlap(power_node_bitmap, job_ptr->node_bitmap) == 0)) {
 		job_ptr->job_state &= (~JOB_CONFIGURING);
@@ -12307,7 +12698,7 @@ static void _get_batch_job_dir_ids(List batch_dirs)
 	}
 
 	while ((dir_ent = readdir(f_dir))) {
-		if (!strncmp("job.#", dir_ent->d_name, 4)) {
+		if (!xstrncmp("job.#", dir_ent->d_name, 4)) {
 			/* Read version 14.03 or earlier format state */
 			long_job_id = strtol(&dir_ent->d_name[4], &endptr, 10);
 			if ((long_job_id == 0) || (endptr[0] != '\0'))
@@ -12317,7 +12708,7 @@ static void _get_batch_job_dir_ids(List batch_dirs)
 			job_id_ptr = xmalloc(sizeof(uint32_t));
 			*job_id_ptr = long_job_id;
 			list_append(batch_dirs, job_id_ptr);
-		} else if (!strncmp("hash.#", dir_ent->d_name, 5)) {
+		} else if (!xstrncmp("hash.#", dir_ent->d_name, 5)) {
 			char *h_path = NULL;
 			xstrfmtcat(h_path, "%s/%s",
 				   slurmctld_conf.state_save_location,
@@ -12327,7 +12718,7 @@ static void _get_batch_job_dir_ids(List batch_dirs)
 			if (!h_dir)
 				continue;
 			while ((hash_ent = readdir(h_dir))) {
-				if (strncmp("job.#", hash_ent->d_name, 4))
+				if (xstrncmp("job.#", hash_ent->d_name, 4))
 					continue;
 				long_job_id = strtol(&hash_ent->d_name[4],
 						     &endptr, 10);
@@ -12808,6 +13199,7 @@ extern void job_completion_logger(struct job_record *job_ptr, bool requeue)
 
 	if (!IS_JOB_RESIZING(job_ptr) &&
 	    ((job_ptr->array_task_id == NO_VAL) ||
+	     (job_ptr->mail_type & MAIL_ARRAY_TASKS) ||
 	     test_job_array_finished(job_ptr->array_job_id))) {
 		/* Remove configuring state just to make sure it isn't there
 		 * since it will throw off displays of the job. */
@@ -12979,7 +13371,7 @@ extern int job_node_ready(uint32_t job_id, int *ready)
 	if (IS_JOB_RUNNING(job_ptr) || IS_JOB_SUSPENDED(job_ptr))
 		rc |= READY_JOB_STATE;
 	if ((rc == (READY_NODE_STATE | READY_JOB_STATE)) &&
-	    job_ptr->alias_list && !strcmp(job_ptr->alias_list, "TBD") &&
+	    job_ptr->alias_list && !xstrcmp(job_ptr->alias_list, "TBD") &&
 	    job_ptr->node_bitmap &&
 	    (bit_overlap(power_node_bitmap, job_ptr->node_bitmap) == 0)) {
 		job_ptr->job_state &= (~JOB_CONFIGURING);
@@ -13004,7 +13396,7 @@ static void _signal_job(struct job_record *job_ptr, int signal)
 	if (notify_srun_static == -1) {
 		char *launch_type = slurm_get_launch_type();
 		/* do this for all but slurm (poe, aprun, etc...) */
-		if (strcmp(launch_type, "launch/slurm"))
+		if (xstrcmp(launch_type, "launch/slurm"))
 			notify_srun_static = 1;
 		else
 			notify_srun_static = 0;
@@ -13388,9 +13780,9 @@ static int _job_suspend(struct job_record *job_ptr, uint16_t op, bool indf_susp)
 			difftime(now, job_ptr->suspend_time);
 		if (!wiki_sched_test) {
 			char *sched_type = slurm_get_sched_type();
-			if (strcmp(sched_type, "sched/wiki") == 0)
+			if (xstrcmp(sched_type, "sched/wiki") == 0)
 				wiki_sched  = true;
-			if (strcmp(sched_type, "sched/wiki2") == 0) {
+			if (xstrcmp(sched_type, "sched/wiki2") == 0) {
 				wiki_sched  = true;
 				wiki2_sched = true;
 			}
@@ -13980,6 +14372,165 @@ extern int job_requeue2(uid_t uid, requeue_msg_t *req_ptr,
 	return rc;
 }
 
+static int _set_top(struct job_record *job_ptr, uid_t uid)
+{
+	ListIterator job_iterator;
+	struct job_record *job_test_ptr, **job_adj_list;
+	uint32_t adj_prio, high_prio = 0, delta_nice, max_delta;
+	int i, high_prio_job_cnt = 0, max_adj_jobs = 1024;
+
+	xassert(job_list);
+
+	if ((job_ptr->user_id != uid) && (uid != 0)) {
+		error("Security violation: REQUEST_TOP_JOB for job %u "
+		      "from uid=%d", job_ptr->job_id, uid);
+		return ESLURM_ACCESS_DENIED;
+	}
+
+	if (!IS_JOB_PENDING(job_ptr) || (job_ptr->details == NULL))
+		return ESLURM_JOB_NOT_PENDING;
+
+	if (job_ptr->part_ptr_list)
+		return ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE;
+
+	if (job_ptr->priority == 0)
+		return ESLURM_JOB_HELD;
+
+	/* Identify the jobs which we can adjust the nice value of */
+	job_adj_list = xmalloc(sizeof(struct job_record *) * max_adj_jobs);
+	job_iterator = list_iterator_create(job_list);
+	while ((job_test_ptr = (struct job_record *) list_next(job_iterator))) {
+		if ((job_test_ptr == job_ptr) ||
+		    (job_test_ptr->details == NULL) ||
+		    (job_test_ptr->part_ptr_list) ||
+		    (job_test_ptr->priority == 0) ||
+		    (job_test_ptr->assoc_ptr != job_ptr->assoc_ptr) ||
+		    (job_test_ptr->part_ptr  != job_ptr->part_ptr)  ||
+		    (job_test_ptr->priority  <  job_ptr->priority)  ||
+		    (job_test_ptr->qos_ptr   != job_ptr->qos_ptr)   ||
+		    (job_test_ptr->user_id   != job_ptr->user_id)   ||
+		    (!IS_JOB_PENDING(job_test_ptr)))
+			continue;
+		high_prio = MAX(job_test_ptr->priority, high_prio);
+		job_adj_list[high_prio_job_cnt++] = job_test_ptr;
+		if (high_prio_job_cnt >= max_adj_jobs) {
+			max_adj_jobs *= 2;
+			job_adj_list = xrealloc(job_adj_list,
+						sizeof(struct job_record *) *
+						max_adj_jobs);
+		}
+	}
+	list_iterator_destroy(job_iterator);
+
+	/* Now adjust nice values and priorities of effected jobs */
+	if (high_prio > job_ptr->priority) {
+		delta_nice = high_prio - job_ptr->priority;
+		delta_nice = MIN(job_ptr->details->nice, delta_nice);
+		job_ptr->priority += delta_nice;
+		job_ptr->details->nice -= delta_nice;
+		for (i = 0; i < high_prio_job_cnt; i++) {
+			adj_prio = delta_nice / (high_prio_job_cnt - i);
+			job_test_ptr = job_adj_list[i];
+			adj_prio = MIN(job_test_ptr->priority, adj_prio);
+			max_delta = (uint32_t) 0xffffffff -
+				    job_test_ptr->details->nice;
+			adj_prio = MIN(max_delta, adj_prio);
+			job_test_ptr->priority -= adj_prio;
+			job_test_ptr->details->nice += adj_prio;
+			delta_nice -= adj_prio;
+		}
+		last_job_update = time(NULL);
+	}
+	xfree(job_adj_list);
+
+	return SLURM_SUCCESS;
+}
+
+/*
+ * job_set_top - Move the specified job to the top of the queue (at least
+ *	for that user ID, partition, account, and QOS).
+ *
+ * IN top_ptr - user request
+ * IN uid - user id of the user issuing the RPC
+ * IN conn_fd - file descriptor on which to send reply,
+ *              -1 if none
+ * IN protocol_version - slurm protocol version of client
+ * RET 0 on success, otherwise ESLURM error code
+ */
+extern int job_set_top(top_job_msg_t *top_ptr, uid_t uid, slurm_fd_t conn_fd,
+		       uint16_t protocol_version)
+{
+	int rc = SLURM_SUCCESS;
+	struct job_record *job_ptr = NULL;
+	long int long_id;
+	uint32_t job_id = 0, task_id = 0;
+	char *end_ptr = NULL;
+	slurm_msg_t resp_msg;
+	return_code_msg_t rc_msg;
+
+	if (validate_operator(uid)) {
+		uid = 0;
+	} else {
+		char *sched_params;
+		bool disable_user_top = false;
+		sched_params = slurm_get_sched_params();
+		if (sched_params && strstr(sched_params, "disable_user_top"))
+			disable_user_top = true;
+		xfree(sched_params);
+		if (disable_user_top) {
+			rc = ESLURM_ACCESS_DENIED;
+			goto reply;
+		}
+	}
+
+	long_id = strtol(top_ptr->job_id_str, &end_ptr, 10);
+	if ((long_id <= 0) || (long_id == LONG_MAX) ||
+	    ((end_ptr[0] != '\0') && (end_ptr[0] != '_'))) {
+		info("%s: invalid job id %s", __func__, top_ptr->job_id_str);
+		rc = ESLURM_INVALID_JOB_ID;
+		goto reply;
+	}
+	job_id = (uint32_t) long_id;
+	if ((end_ptr[0] == '\0') ||	/* Single job (or full job array) */
+	    ((end_ptr[0] == '_') && (end_ptr[1] == '*') &&
+	     (end_ptr[2] == '\0'))) {
+		job_ptr = find_job_record(job_id);
+		if (!job_ptr) {
+			rc = ESLURM_INVALID_JOB_ID;
+			goto reply;
+		}
+		rc = _set_top(job_ptr, uid);
+		goto reply;
+	}
+	if (end_ptr[0] != '_') {	/* Invalid job ID specification */
+		rc = ESLURM_INVALID_JOB_ID;
+		goto reply;
+	}
+	task_id = strtol(end_ptr + 1, &end_ptr, 10);
+	if (end_ptr[0] != '\0') {	/* Invalid job ID specification */
+		rc = ESLURM_INVALID_JOB_ID;
+		goto reply;
+	}
+	job_ptr = find_job_array_rec(job_id, task_id);
+	if (!job_ptr) {
+		rc = ESLURM_INVALID_JOB_ID;
+		goto reply;
+	}
+	rc = _set_top(job_ptr, uid);
+
+    reply:
+	if (conn_fd >= 0) {
+		slurm_msg_t_init(&resp_msg);
+		resp_msg.protocol_version = protocol_version;
+		resp_msg.msg_type  = RESPONSE_SLURM_RC;
+		rc_msg.return_code = rc;
+		resp_msg.data      = &rc_msg;
+		slurm_send_node_msg(conn_fd, &resp_msg);
+	}
+
+	return rc;
+}
+
 /*
  * job_end_time - Process JOB_END_TIME
  * IN time_req_msg - job end time request
@@ -14607,6 +15158,7 @@ _copy_job_record_to_job_desc(struct job_record *job_ptr)
 	job_desc->cpu_freq_min      = details->cpu_freq_min;
 	job_desc->cpu_freq_max      = details->cpu_freq_max;
 	job_desc->cpu_freq_gov      = details->cpu_freq_gov;
+	job_desc->deadline          = job_ptr->deadline;
 	job_desc->dependency        = xstrdup(details->dependency);
 	job_desc->end_time          = 0; /* Unused today */
 	job_desc->environment       = get_job_env(job_ptr,
@@ -14621,6 +15173,7 @@ _copy_job_record_to_job_desc(struct job_record *job_ptr)
 	job_desc->licenses          = xstrdup(job_ptr->licenses);
 	job_desc->mail_type         = job_ptr->mail_type;
 	job_desc->mail_user         = xstrdup(job_ptr->mail_user);
+	job_desc->mcs_label	    = xstrdup(job_ptr->mcs_label);
 	job_desc->mem_bind          = xstrdup(details->mem_bind);
 	job_desc->mem_bind_type     = details->mem_bind_type;
 	job_desc->name              = xstrdup(job_ptr->name);
@@ -14630,7 +15183,6 @@ _copy_job_record_to_job_desc(struct job_record *job_ptr)
 	job_desc->open_mode         = details->open_mode;
 	job_desc->other_port        = job_ptr->other_port;
 	job_desc->power_flags       = job_ptr->power_flags;
-	job_desc->sicp_mode         = job_ptr->sicp_mode;
 	job_desc->overcommit        = details->overcommit;
 	job_desc->partition         = xstrdup(job_ptr->partition);
 	job_desc->plane_size        = details->plane_size;
@@ -14651,6 +15203,8 @@ _copy_job_record_to_job_desc(struct job_record *job_ptr)
 		job_desc->shared     = 0;
 	else if (details->whole_node == 2)
 		job_desc->shared     = 2;
+	else if (details->whole_node == 3)
+		job_desc->shared     = 3;
 	else
 		job_desc->shared     = (uint16_t) NO_VAL;
 	job_desc->spank_job_env_size = job_ptr->spank_job_env_size;
@@ -14781,7 +15335,7 @@ extern int job_restart(checkpoint_msg_t *ckpt_ptr, uid_t uid, slurm_fd_t conn_fd
 	/* unpack version string */
 	safe_unpackstr_xmalloc(&ver_str, &tmp_uint32, buffer);
 	debug3("Version string in job_ckpt header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, JOB_CKPT_VERSION))
+	if (ver_str && !xstrcmp(ver_str, JOB_CKPT_VERSION))
 		safe_unpack16(&ckpt_version, buffer);
 
 	if (ckpt_version == (uint16_t)NO_VAL) {
diff --git a/src/slurmctld/job_scheduler.c b/src/slurmctld/job_scheduler.c
index 12997e8df..d8d3e7b97 100644
--- a/src/slurmctld/job_scheduler.c
+++ b/src/slurmctld/job_scheduler.c
@@ -4,6 +4,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -58,17 +59,20 @@
 #include "src/common/assoc_mgr.h"
 #include "src/common/env.h"
 #include "src/common/gres.h"
+#include "src/common/layouts_mgr.h"
 #include "src/common/list.h"
 #include "src/common/macros.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/power.h"
 #include "src/common/slurm_accounting_storage.h"
 #include "src/common/slurm_acct_gather.h"
+#include "src/common/strlcpy.h"
+#include "src/common/parse_time.h"
 #include "src/common/timers.h"
 #include "src/common/uid.h"
 #include "src/common/xassert.h"
 #include "src/common/xstring.h"
-#include "src/common/layouts_mgr.h"
 
 #include "src/slurmctld/acct_policy.h"
 #include "src/slurmctld/agent.h"
@@ -78,6 +82,7 @@
 #include "src/slurmctld/licenses.h"
 #include "src/slurmctld/locks.h"
 #include "src/slurmctld/node_scheduler.h"
+#include "src/slurmctld/power_save.h"
 #include "src/slurmctld/preempt.h"
 #include "src/slurmctld/proc_req.h"
 #include "src/slurmctld/reservation.h"
@@ -91,6 +96,9 @@
 #ifndef BB_STAGE_ARRAY_TASK_CNT
 #  define BB_STAGE_ARRAY_TASK_CNT 4
 #endif
+#ifndef CORRESPOND_ARRAY_TASK_CNT
+#  define CORRESPOND_ARRAY_TASK_CNT 10
+#endif
 #define BUILD_TIMEOUT 2000000	/* Max build_job_queue() run time in usec */
 #define MAX_FAILED_RESV 10
 #define MAX_RETRIES 10
@@ -116,8 +124,9 @@ static void *	_run_prolog(void *arg);
 static bool	_scan_depend(List dependency_list, uint32_t job_id);
 static void *	_sched_agent(void *args);
 static int	_schedule(uint32_t job_limit);
-static int	_valid_feature_list(uint32_t job_id, List feature_list);
-static int	_valid_node_feature(char *feature);
+static int	_valid_feature_list(struct job_record *job_ptr,
+				    List feature_list);
+static int	_valid_node_feature(char *feature, bool can_reboot);
 #ifndef HAVE_FRONT_END
 static void *	_wait_boot(void *arg);
 #endif
@@ -157,7 +166,7 @@ static List _build_user_job_list(uint32_t user_id, char* job_name)
 		if (job_ptr->user_id != user_id)
 			continue;
 		if (job_name && job_ptr->name &&
-		    strcmp(job_name, job_ptr->name))
+		    xstrcmp(job_name, job_ptr->name))
 			continue;
 		list_append(job_queue, job_ptr);
 	}
@@ -200,6 +209,7 @@ static bool _job_runnable_test1(struct job_record *job_ptr, bool sched_plugin)
 				    SELECT_JOBDATA_CLEANING,
 				    &cleaning);
 	if (cleaning ||
+	    (job_ptr->details && job_ptr->details->prolog_running) ||
 	    (job_ptr->step_list && list_count(job_ptr->step_list))) {
 		/* Job's been requeued and the
 		 * previous run hasn't finished yet */
@@ -309,10 +319,11 @@ extern List build_job_queue(bool clear_start, bool backfill)
 {
 	static time_t last_log_time = 0;
 	List job_queue;
-	ListIterator job_iterator, part_iterator;
+	ListIterator depend_iter, job_iterator, part_iterator;
 	struct job_record *job_ptr = NULL, *new_job_ptr;
 	struct part_record *part_ptr;
-	int i, pend_cnt, reason;
+	struct depend_spec *dep_ptr;
+	int i, pend_cnt, reason, dep_corr;
 	struct timeval start_tv = {0, 0};
 	int tested_jobs = 0;
 	char jobid_buf[32];
@@ -359,6 +370,58 @@ extern List build_job_queue(bool clear_start, bool backfill)
 	}
 	list_iterator_destroy(job_iterator);
 
+	/* Create individual job records for job arrays with
+	 * depend_type == SLURM_DEPEND_AFTER_CORRESPOND */
+	job_iterator = list_iterator_create(job_list);
+	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
+		if (!IS_JOB_PENDING(job_ptr) ||
+		    !job_ptr->array_recs ||
+		    !job_ptr->array_recs->task_id_bitmap ||
+		    (job_ptr->array_task_id != NO_VAL))
+			continue;
+		if ((i = bit_ffs(job_ptr->array_recs->task_id_bitmap)) < 0)
+			continue;
+		if ((job_ptr->details == NULL) ||
+		    (job_ptr->details->depend_list == NULL) ||
+		    (list_count(job_ptr->details->depend_list) == 0))
+			continue;
+	        depend_iter = list_iterator_create(job_ptr->details->depend_list);
+		dep_corr = 0;
+	        while ((dep_ptr = list_next(depend_iter))) {
+	                if (dep_ptr->depend_type == SLURM_DEPEND_AFTER_CORRESPOND) {
+				dep_corr = 1;
+				break;
+			}
+	        }
+		if (!dep_corr)
+			continue;
+		pend_cnt = num_pending_job_array_tasks(job_ptr->array_job_id);
+		if (pend_cnt >= CORRESPOND_ARRAY_TASK_CNT)
+			continue;
+		if (job_ptr->array_recs->task_cnt < 1)
+			continue;
+		if (job_ptr->array_recs->task_cnt == 1) {
+			job_ptr->array_task_id = i;
+			job_array_post_sched(job_ptr);
+			continue;
+		}
+		job_ptr->array_task_id = i;
+		new_job_ptr = job_array_split(job_ptr);
+		if (new_job_ptr) {
+			info("%s: Split out %s for SLURM_DEPEND_AFTER_CORRESPOND use",
+			      __func__,
+			      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
+			new_job_ptr->job_state = JOB_PENDING;
+			new_job_ptr->start_time = (time_t) 0;
+			/* Do NOT clear db_index here, it is handled when
+			 * task_id_str is created elsewhere */
+		} else {
+			error("%s: Unable to copy record for %s", __func__,
+			      jobid2fmt(job_ptr, jobid_buf, sizeof(jobid_buf)));
+		}
+	}
+	list_iterator_destroy(job_iterator);
+
 	job_iterator = list_iterator_create(job_list);
 	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
 		if (((tested_jobs % 100) == 0) &&
@@ -582,7 +645,7 @@ extern bool replace_batch_job(slurm_msg_t * msg, void *fini_job, bool locked)
 	int error_code;
 
 	if (select_serial == -1) {
-		if (strcmp(slurmctld_conf.select_type, "select/serial"))
+		if (xstrcmp(slurmctld_conf.select_type, "select/serial"))
 			select_serial = 0;
 		else
 			select_serial = 1;
@@ -833,9 +896,9 @@ static bool _all_partition_priorities_same(void)
 	iter = list_iterator_create(part_list);
 	while ((part_ptr = (struct part_record *) list_next(iter))) {
 		if (!part_priority_set) {
-			part_priority = part_ptr->priority;
+			part_priority = part_ptr->priority_tier;
 			part_priority_set = true;
-		} else if (part_priority != part_ptr->priority) {
+		} else if (part_priority != part_ptr->priority_tier) {
 			result = false;
 			break;
 		}
@@ -971,6 +1034,60 @@ static void *_sched_agent(void *args)
 	return NULL;
 }
 
+/* Determine if job's deadline specification is still valid, kill job if not
+ * job_ptr IN - Job to test
+ * func IN - function named used for logging, "sched" or "backfill"
+ * RET - true of valid, false if invalid and job cancelled
+ */
+extern bool deadline_ok(struct job_record *job_ptr, char *func)
+{
+	time_t now;
+	char time_str_deadline[32];
+	bool fail_job = false;
+	time_t inter;
+
+	now = time(NULL);
+	if ((job_ptr->time_min) && (job_ptr->time_min != NO_VAL)) {
+		inter = now + job_ptr->time_min * 60;
+		if (job_ptr->deadline < inter) {
+			slurm_make_time_str(&job_ptr->deadline,
+					    time_str_deadline,
+					    sizeof(time_str_deadline));
+			info("%s: JobId %u with time_min %u exceeded deadline "
+			     "%s and cancelled ",
+			     func, job_ptr->job_id, job_ptr->time_min,
+			     time_str_deadline);
+			fail_job = true;
+		}
+	} else if ((job_ptr->time_limit != NO_VAL) &&
+		   (job_ptr->time_limit != INFINITE)) {
+		inter = now + job_ptr->time_limit * 60;
+		if (job_ptr->deadline < inter) {
+			slurm_make_time_str(&job_ptr->deadline,
+					   time_str_deadline,
+					   sizeof(time_str_deadline));
+			info("%s: JobId %u with time_limit %u exceeded "
+			     "deadline %s and cancelled ",
+			     func, job_ptr->job_id, job_ptr->time_limit,
+			    time_str_deadline);
+			fail_job = true;
+		}
+	}
+	if (fail_job) {
+		last_job_update = now;
+		job_ptr->job_state = JOB_DEADLINE;
+		job_ptr->exit_code = 1;
+		job_ptr->state_reason = FAIL_DEADLINE;
+		xfree(job_ptr->state_desc);
+		job_ptr->start_time = now;
+		job_ptr->end_time = now;
+		srun_allocate_abort(job_ptr);
+		job_completion_logger(job_ptr, false);
+		return false;
+	}
+	return true;
+}
+
 static int _schedule(uint32_t job_limit)
 {
 	ListIterator job_iterator = NULL, part_iterator = NULL;
@@ -999,10 +1116,11 @@ static int _schedule(uint32_t job_limit)
 	static time_t sched_update = 0;
 	static bool wiki_sched = false;
 	static bool fifo_sched = false;
-	static bool assoc_limit_continue = false;
+	static bool assoc_limit_stop = false;
 	static int sched_timeout = 0;
 	static int sched_max_job_start = 0;
 	static int bf_min_age_reserve = 0;
+	static uint32_t bf_min_prio_reserve = 0;
 	static int def_job_limit = 100;
 	static int max_jobs_per_part = 0;
 	static int defer_rpc_cnt = 0;
@@ -1013,6 +1131,7 @@ static int _schedule(uint32_t job_limit)
 	char job_id_buf[32];
 	char *unavail_node_str = NULL;
 	bool fail_by_part;
+	uint32_t deadline_time_limit, save_time_limit;
 #if HAVE_SYS_PRCTL_H
 	char get_name[16];
 #endif
@@ -1024,11 +1143,10 @@ static int _schedule(uint32_t job_limit)
 #if HAVE_SYS_PRCTL_H
 	if (prctl(PR_GET_NAME, get_name, NULL, NULL, NULL) < 0) {
 		error("%s: cannot get my name %m", __func__);
-			strcpy(get_name, "slurmctld");
+		strlcpy(get_name, "slurmctld", sizeof(get_name));
 	}
-	if (prctl(PR_SET_NAME, "slurmctld_sched", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_sched");
+	if (prctl(PR_SET_NAME, "sched", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "sched");
 	}
 #endif
 
@@ -1038,18 +1156,18 @@ static int _schedule(uint32_t job_limit)
 		char *prio_type = slurm_get_priority_type();
 #ifdef HAVE_BG
 		/* On BlueGene, do FIFO only with sched/backfill */
-		if (strcmp(sched_type, "sched/backfill") == 0)
+		if (xstrcmp(sched_type, "sched/backfill") == 0)
 			backfill_sched = true;
 #endif
-		if ((strcmp(sched_type, "sched/builtin") == 0) &&
-		    (strcmp(prio_type, "priority/basic") == 0) &&
+		if ((xstrcmp(sched_type, "sched/builtin") == 0) &&
+		    (xstrcmp(prio_type, "priority/basic") == 0) &&
 		    _all_partition_priorities_same())
 			fifo_sched = true;
 		else
 			fifo_sched = false;
 		/* Disable avoiding of fragmentation with sched/wiki */
-		if ((strcmp(sched_type, "sched/wiki") == 0) ||
-		    (strcmp(sched_type, "sched/wiki2") == 0))
+		if ((xstrcmp(sched_type, "sched/wiki") == 0) ||
+		    (xstrcmp(sched_type, "sched/wiki2") == 0))
 			wiki_sched = true;
 		xfree(sched_type);
 		xfree(prio_type);
@@ -1057,69 +1175,85 @@ static int _schedule(uint32_t job_limit)
 		sched_params = slurm_get_sched_params();
 
 		if (sched_params &&
-		    (strstr(sched_params, "assoc_limit_continue")))
-			assoc_limit_continue = true;
+		    (strstr(sched_params, "assoc_limit_stop")))
+			assoc_limit_stop = true;
 		else
-			assoc_limit_continue = false;
+			assoc_limit_stop = false;
 
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "batch_sched_delay=")))
-		/*                                 012345678901234567 */
+		    (tmp_ptr=strstr(sched_params, "batch_sched_delay="))) {
 			batch_sched_delay = atoi(tmp_ptr + 18);
-		if (batch_sched_delay < 0) {
-			error("Invalid batch_sched_delay: %d",
-			      batch_sched_delay);
+			if (batch_sched_delay < 0) {
+				error("Invalid batch_sched_delay: %d",
+				      batch_sched_delay);
+				batch_sched_delay = 3;
+			}
+		} else {
 			batch_sched_delay = 3;
 		}
 
+		bf_min_age_reserve = 0;
 		if (sched_params &&
 		    (tmp_ptr = strstr(sched_params, "bf_min_age_reserve="))) {
-			bf_min_age_reserve = atoi(tmp_ptr + 19);
-			if (bf_min_age_reserve < 0)
-				bf_min_age_reserve = 0;
-		} else {
-			bf_min_age_reserve = 0;
+			int min_age = atoi(tmp_ptr + 19);
+			if (min_age > 0)
+				bf_min_age_reserve = min_age;
 		}
 
+		bf_min_prio_reserve = 0;
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "build_queue_timeout=")))
-		/*                                 01234567890123456789 */
+		    (tmp_ptr = strstr(sched_params, "bf_min_prio_reserve="))) {
+			int64_t min_prio = (int64_t) atoll(tmp_ptr + 20);
+			if (min_prio > 0)
+				bf_min_prio_reserve = (uint32_t) min_prio;
+		}
+
+		if (sched_params &&
+		    (tmp_ptr = strstr(sched_params, "build_queue_timeout="))) {
 			build_queue_timeout = atoi(tmp_ptr + 20);
-		if (build_queue_timeout < 100) {
-			error("Invalid build_queue_time: %d",
-			      build_queue_timeout);
+			if (build_queue_timeout < 100) {
+				error("Invalid build_queue_time: %d",
+				      build_queue_timeout);
+				build_queue_timeout = BUILD_TIMEOUT;
+			}
+		} else {
 			build_queue_timeout = BUILD_TIMEOUT;
 		}
 
 		if (sched_params &&
 		    (tmp_ptr = strstr(sched_params, "default_queue_depth="))) {
-		/*                                   01234567890123456789 */
-			i = atoi(tmp_ptr + 20);
-			if (i < 0) {
+			def_job_limit = atoi(tmp_ptr + 20);
+			if (def_job_limit < 0) {
 				error("ignoring SchedulerParameters: "
-				      "default_queue_depth value of %d", i);
-			} else {
-				def_job_limit = i;
+				      "default_queue_depth value of %d",
+				      def_job_limit);
+				def_job_limit = 100;
 			}
+		} else {
+			def_job_limit = 100;
 		}
 
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "partition_job_depth="))) {
-		/*                                 01234567890123456789 */
-			i = atoi(tmp_ptr + 20);
-			if (i < 0) {
+		    (tmp_ptr = strstr(sched_params, "partition_job_depth="))) {
+			max_jobs_per_part = atoi(tmp_ptr + 20);
+			if (max_jobs_per_part < 0) {
 				error("ignoring SchedulerParameters: "
-				      "partition_job_depth value of %d", i);
-			} else {
-				max_jobs_per_part = i;
+				      "partition_job_depth value of %d",
+				      max_jobs_per_part);
+				max_jobs_per_part = 0;
 			}
+		} else {
+			max_jobs_per_part = 0;
 		}
+
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "max_rpc_cnt=")))
+		    (tmp_ptr = strstr(sched_params, "max_rpc_cnt=")))
 			defer_rpc_cnt = atoi(tmp_ptr + 12);
 		else if (sched_params &&
-			 (tmp_ptr=strstr(sched_params, "max_rpc_count=")))
+			 (tmp_ptr = strstr(sched_params, "max_rpc_count=")))
 			defer_rpc_cnt = atoi(tmp_ptr + 14);
+		else
+			defer_rpc_cnt = 0;
 		if (defer_rpc_cnt < 0) {
 			error("Invalid max_rpc_cnt: %d", defer_rpc_cnt);
 			defer_rpc_cnt = 0;
@@ -1127,7 +1261,7 @@ static int _schedule(uint32_t job_limit)
 
 		time_limit = slurm_get_msg_timeout() / 2;
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "max_sched_time="))) {
+		    (tmp_ptr = strstr(sched_params, "max_sched_time="))) {
 			sched_timeout = atoi(tmp_ptr + 15);
 			if ((sched_timeout <= 0) ||
 			    (sched_timeout > time_limit)) {
@@ -1135,6 +1269,8 @@ static int _schedule(uint32_t job_limit)
 				      sched_timeout);
 				sched_timeout = 0;
 			}
+		} else {
+			sched_timeout = 0;
 		}
 		if (sched_timeout == 0) {
 			sched_timeout = MAX(time_limit, 1);
@@ -1142,10 +1278,14 @@ static int _schedule(uint32_t job_limit)
 		}
 
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "sched_interval=")))
+		    (tmp_ptr = strstr(sched_params, "sched_interval="))) {
 			sched_interval = atoi(tmp_ptr + 15);
-		if (sched_interval < 0) {
-			error("Invalid sched_interval: %d", sched_interval);
+			if (sched_interval < 0) {
+				error("Invalid sched_interval: %d",
+				      sched_interval);
+				sched_interval = 60;
+			}
+		} else {
 			sched_interval = 60;
 		}
 
@@ -1159,11 +1299,14 @@ static int _schedule(uint32_t job_limit)
 		}
 
 		if (sched_params &&
-		    (tmp_ptr=strstr(sched_params, "sched_max_job_start=")))
+		    (tmp_ptr = strstr(sched_params, "sched_max_job_start="))) {
 			sched_max_job_start = atoi(tmp_ptr + 20);
-		if (sched_max_job_start < 0) {
-			error("Invalid sched_max_job_start: %d",
-			      sched_max_job_start);
+			if (sched_max_job_start < 0) {
+				error("Invalid sched_max_job_start: %d",
+				      sched_max_job_start);
+				sched_max_job_start = 0;
+			}
+		} else {
 			sched_max_job_start = 0;
 		}
 
@@ -1316,6 +1459,7 @@ next_part:			part_ptr = (struct part_record *)
 			array_task_id = job_queue_rec->array_task_id;
 			job_ptr  = job_queue_rec->job_ptr;
 			part_ptr = job_queue_rec->part_ptr;
+			job_ptr->priority = job_queue_rec->priority;
 			xfree(job_queue_rec);
 			if (!avail_front_end(job_ptr)) {
 				job_ptr->state_reason = WAIT_FRONT_END;
@@ -1483,6 +1627,32 @@ next_task:
 			}
 		}
 
+		deadline_time_limit = 0;
+		if ((job_ptr->deadline) && (job_ptr->deadline != NO_VAL)) {
+			if (!deadline_ok(job_ptr, "sched"))
+				continue;
+
+			deadline_time_limit = job_ptr->deadline - now;
+			deadline_time_limit /= 60;
+			if ((job_ptr->time_limit != NO_VAL) &&
+			    (job_ptr->time_limit != INFINITE)) {
+				deadline_time_limit = MIN(job_ptr->time_limit,
+							  deadline_time_limit);
+			} else {
+				if ((job_ptr->part_ptr->default_time != NO_VAL) &&
+				    (job_ptr->part_ptr->default_time != INFINITE)){
+					deadline_time_limit = MIN(
+						job_ptr->part_ptr->default_time,
+						deadline_time_limit);
+				} else if ((job_ptr->part_ptr->max_time != NO_VAL) &&
+					   (job_ptr->part_ptr->max_time != INFINITE)){
+					deadline_time_limit = MIN(
+						job_ptr->part_ptr->max_time,
+						deadline_time_limit);
+				}
+			}
+		}
+
 		if (!acct_policy_job_runnable_state(job_ptr) &&
 		    !acct_policy_job_runnable_pre_select(job_ptr))
 			continue;
@@ -1568,9 +1738,15 @@ next_task:
 			continue;
 		}
 
+		if (deadline_time_limit) {
+			save_time_limit = job_ptr->time_limit;
+			job_ptr->time_limit = deadline_time_limit;
+		}
 		error_code = select_nodes(job_ptr, false, NULL,
 					  unavail_node_str, NULL);
 		fail_by_part = false;
+		if ((error_code != SLURM_SUCCESS) && deadline_time_limit)
+			job_ptr->time_limit = save_time_limit;
 		if ((error_code == ESLURM_NODES_BUSY) ||
 		    (error_code == ESLURM_POWER_NOT_AVAIL) ||
 		    (error_code == ESLURM_POWER_RESERVED)) {
@@ -1667,14 +1843,14 @@ next_task:
 		} else if (error_code == ESLURM_ACCOUNTING_POLICY) {
 			debug3("sched: JobId=%u delayed for accounting policy",
 			       job_ptr->job_id);
-			/* potentially stall the queue */
-			if (!assoc_limit_continue)
+			/* potentially starve this job */
+			if (assoc_limit_stop)
 				fail_by_part = true;
 		} else if ((error_code !=
 			    ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE) &&
 			   (error_code != ESLURM_NODE_NOT_AVAIL)      &&
 			   (error_code != ESLURM_INVALID_BURST_BUFFER_REQUEST)){
-			info("sched: schedule: %s non-runnable:%s",
+			info("sched: schedule: %s non-runnable: %s",
 			     jobid2str(job_ptr, jbuf, sizeof(jbuf)),
 			     slurm_strerror(error_code));
 			if (!wiki_sched) {
@@ -1729,6 +1905,9 @@ next_task:
 					fail_by_part = false;
 			}
 		}
+		if (fail_by_part && bf_min_prio_reserve &&
+		    (job_ptr->priority < bf_min_prio_reserve))
+			fail_by_part = false;
 		if (fail_by_part) {
 		 	/* do not schedule more jobs in this partition or on
 			 * nodes in this partition */
@@ -1829,8 +2008,8 @@ extern int sort_job_queue2(void *x, void *y)
 		return 1;
 
 	if (job_rec1->part_ptr && job_rec2->part_ptr) {
-		p1 = job_rec1->part_ptr->priority;
-		p2 = job_rec2->part_ptr->priority;
+		p1 = job_rec1->part_ptr->priority_tier;
+		p2 = job_rec2->part_ptr->priority_tier;
 		if (p1 < p2)
 			return 1;
 		if (p1 > p2)
@@ -1934,6 +2113,7 @@ extern batch_job_launch_msg_t *build_launch_job_msg(struct job_record *job_ptr,
 	launch_msg_ptr->cpus_per_task = job_ptr->details->cpus_per_task;
 	launch_msg_ptr->pn_min_memory = job_ptr->details->pn_min_memory;
 	launch_msg_ptr->restart_cnt   = job_ptr->restart_cnt;
+	launch_msg_ptr->profile       = job_ptr->profile;
 
 	if (make_batch_job_cred(launch_msg_ptr, job_ptr, protocol_version)) {
 		/* FIXME: This is a kludge, but this event indicates a serious
@@ -1998,7 +2178,7 @@ extern batch_job_launch_msg_t *build_launch_job_msg(struct job_record *job_ptr,
 		slurmdb_qos_rec_t *qos;
 
 		qos = (slurmdb_qos_rec_t *)job_ptr->qos_ptr;
-		if (strcmp(qos->description, "Normal QOS default") == 0)
+		if (xstrcmp(qos->description, "Normal QOS default") == 0)
 			launch_msg_ptr->qos = xstrdup("normal");
 		else
 			launch_msg_ptr->qos = xstrdup(qos->description);
@@ -2171,6 +2351,8 @@ extern void print_job_dependency(struct job_record *job_ptr)
 			dep_str = "afternotok";
 		else if (dep_ptr->depend_type == SLURM_DEPEND_AFTER_OK)
 			dep_str = "afterok";
+		else if (dep_ptr->depend_type == SLURM_DEPEND_AFTER_CORRESPOND)
+			dep_str = "aftercorr";
 		else if (dep_ptr->depend_type == SLURM_DEPEND_EXPAND)
 			dep_str = "expand";
 		else
@@ -2221,6 +2403,8 @@ static void _depend_list2str(struct job_record *job_ptr, bool set_or_flag)
 			dep_str = "afternotok";
 		else if (dep_ptr->depend_type == SLURM_DEPEND_AFTER_OK)
 			dep_str = "afterok";
+		else if (dep_ptr->depend_type == SLURM_DEPEND_AFTER_CORRESPOND)
+			dep_str = "aftercorr";
 		else if (dep_ptr->depend_type == SLURM_DEPEND_EXPAND)
 			dep_str = "expand";
 		else
@@ -2262,33 +2446,13 @@ extern int test_job_dependency(struct job_record *job_ptr)
  	List job_queue = NULL;
  	bool run_now;
 	int results = 0;
-	struct job_record *qjob_ptr, *djob_ptr;
-	time_t now = time(NULL);
-	/* For performance reasons with job arrays, we cache dependency
-	 * results and re-use them whenever possible */
-	static uint32_t cache_job_id = 0;
-	static struct job_record *cache_job_ptr = NULL;
-	static int cache_results;
-	static time_t cache_time = 0;
+	struct job_record *qjob_ptr, *djob_ptr, *dcjob_ptr;
 
 	if ((job_ptr->details == NULL) ||
 	    (job_ptr->details->depend_list == NULL) ||
 	    (list_count(job_ptr->details->depend_list) == 0))
 		return 0;
 
-	if ((job_ptr->array_task_id != NO_VAL) &&
-	    (cache_time == now) &&
-	    (cache_job_ptr->magic == JOB_MAGIC) &&
-	    (cache_job_ptr->job_id == cache_job_id) &&
-	    (cache_job_ptr->array_job_id == job_ptr->array_job_id) &&
-	    (cache_job_ptr->details) &&
-	    (cache_job_ptr->details->orig_dependency) &&
-	    (job_ptr->details->orig_dependency) &&
-	    (!strcmp(cache_job_ptr->details->orig_dependency,
-		     job_ptr->details->orig_dependency))) {
-		return cache_results;
-	}
-
 	depend_iter = list_iterator_create(job_ptr->details->depend_list);
 	while ((dep_ptr = list_next(depend_iter))) {
 		bool clear_dep = false;
@@ -2367,7 +2531,37 @@ extern int test_job_dependency(struct job_record *job_ptr)
 					failure = true;
 					break;
 				}
+			} else if (dep_ptr->depend_type ==
+				   SLURM_DEPEND_AFTER_CORRESPOND) {
+				if ((job_ptr->array_task_id == NO_VAL) ||
+				    (job_ptr->array_task_id == INFINITE)) {
+					dcjob_ptr = NULL;
+				} else {
+					dcjob_ptr = find_job_array_rec(
+							dep_ptr->job_id,
+							job_ptr->array_task_id);
+				}
+				if (dcjob_ptr) {
+					if (!IS_JOB_COMPLETED(dcjob_ptr))
+						depends = true;
+					else if (IS_JOB_COMPLETE(dcjob_ptr))
+						clear_dep = true;
+					else {
+						failure = true;
+						break;
+					}
+				} else {
+					if (!array_completed)
+						depends = true;
+					else if (array_complete)
+						clear_dep = true;
+					else {
+						failure = true;
+						break;
+					}
+				}
 			}
+
 		} else if (dep_ptr->depend_type == SLURM_DEPEND_AFTER) {
 			if (!IS_JOB_PENDING(djob_ptr))
 				clear_dep = true;
@@ -2398,6 +2592,16 @@ extern int test_job_dependency(struct job_record *job_ptr)
 				failure = true;
 				break;
 			}
+		} else if (dep_ptr->depend_type ==
+			   SLURM_DEPEND_AFTER_CORRESPOND) {
+			if (!IS_JOB_COMPLETED(djob_ptr))
+				depends = true;
+			else if (IS_JOB_COMPLETE(djob_ptr))
+				clear_dep = true;
+			else {
+				failure = true;
+				break;
+			}
 		} else if (dep_ptr->depend_type == SLURM_DEPEND_EXPAND) {
 			time_t now = time(NULL);
 			if (IS_JOB_PENDING(djob_ptr)) {
@@ -2438,14 +2642,6 @@ extern int test_job_dependency(struct job_record *job_ptr)
 	else if (depends)
 		results = 1;
 
-	if ((job_ptr->array_task_id != NO_VAL) &&
-	    (job_ptr->array_recs == NULL)) {
-		cache_job_id  = job_ptr->job_id;
-		cache_job_ptr = job_ptr;
-		cache_results = results;
-		cache_time = now;
-	}
-
 	return results;
 }
 
@@ -2569,6 +2765,8 @@ extern int update_job_dependency(struct job_record *job_ptr, char *new_depend)
 		/* New format, <test>:job_ID */
 		if      (strncasecmp(tok, "afternotok", 10) == 0)
 			depend_type = SLURM_DEPEND_AFTER_NOT_OK;
+		else if (strncasecmp(tok, "aftercorr", 9) == 0)
+			depend_type = SLURM_DEPEND_AFTER_CORRESPOND;
 		else if (strncasecmp(tok, "afterany", 8) == 0)
 			depend_type = SLURM_DEPEND_AFTER_ANY;
 		else if (strncasecmp(tok, "afterok", 7) == 0)
@@ -2836,7 +3034,8 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg,
 {
 	struct job_record *job_ptr;
 	struct part_record *part_ptr;
-	bitstr_t *avail_bitmap = NULL, *resv_bitmap = NULL;
+	bitstr_t *active_bitmap = NULL, *avail_bitmap = NULL;
+	bitstr_t *resv_bitmap = NULL;
 	bitstr_t *exc_core_bitmap = NULL;
 	uint32_t min_nodes, max_nodes, req_nodes;
 	int i, rc = SLURM_SUCCESS;
@@ -2870,7 +3069,7 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg,
 		bit_and(avail_bitmap, part_ptr->node_bitmap);
 	else
 		rc = ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE;
-	if (job_req_node_filter(job_ptr, avail_bitmap))
+	if (job_req_node_filter(job_ptr, avail_bitmap, true))
 		rc = ESLURM_REQUESTED_PART_CONFIG_UNAVAILABLE;
 	if (job_ptr->details->exc_node_bitmap) {
 		bitstr_t *exc_node_mask = NULL;
@@ -2891,6 +3090,7 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg,
 		start_res = job_ptr->details->begin_time;
 	else
 		start_res = now;
+
 	i = job_test_resv(job_ptr, &start_res, false, &resv_bitmap,
 			  &exc_core_bitmap, &resv_overlap);
 	if (i != SLURM_SUCCESS)
@@ -2902,6 +3102,8 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg,
 	bit_and(avail_bitmap, avail_node_bitmap);
 
 	if (rc == SLURM_SUCCESS) {
+		int test_fini = -1;
+		uint8_t save_share_res, save_whole_node;
 		/* On BlueGene systems don't adjust the min/max node limits
 		   here.  We are working on midplane values. */
 		min_nodes = MAX(job_ptr->details->min_nodes,
@@ -2925,11 +3127,41 @@ extern int job_start_data(job_desc_msg_t *job_desc_msg,
 		 * start time will almost certainly be earlier and not as
 		 * accurate, but this algorithm is much faster. */
 		orig_start_time = job_ptr->start_time;
-		rc = select_g_job_test(job_ptr, avail_bitmap,
-				       min_nodes, max_nodes, req_nodes,
-				       SELECT_MODE_WILL_RUN,
-				       preemptee_candidates,
-				       &preemptee_job_list, exc_core_bitmap);
+		build_active_feature_bitmap(job_ptr, avail_bitmap,
+					    &active_bitmap);
+		if (active_bitmap) {
+			rc = select_g_job_test(job_ptr, active_bitmap,
+					       min_nodes, max_nodes, req_nodes,
+					       SELECT_MODE_WILL_RUN,
+					       preemptee_candidates,
+					       &preemptee_job_list,
+					       exc_core_bitmap);
+			if (rc == SLURM_SUCCESS) {
+				FREE_NULL_BITMAP(avail_bitmap);
+				avail_bitmap = active_bitmap;
+				active_bitmap = NULL;
+				test_fini = 1;
+			} else {
+				FREE_NULL_BITMAP(active_bitmap);
+				save_share_res  = job_ptr->details->share_res;
+				save_whole_node = job_ptr->details->whole_node;
+				job_ptr->details->share_res = 0;
+				job_ptr->details->whole_node = 1;
+				test_fini = 0;
+			}
+		}
+		if (test_fini != 1) {
+			rc = select_g_job_test(job_ptr, avail_bitmap,
+					       min_nodes, max_nodes, req_nodes,
+					       SELECT_MODE_WILL_RUN,
+					       preemptee_candidates,
+					       &preemptee_job_list,
+					       exc_core_bitmap);
+			if (test_fini == 0) {
+				job_ptr->details->share_res = save_share_res;
+				job_ptr->details->whole_node = save_whole_node;
+			}
+		}
 	}
 
 	if (rc == SLURM_SUCCESS) {
@@ -3091,8 +3323,8 @@ static char **_build_env(struct job_record *job_ptr)
 		if (job_ptr->details && job_ptr->details->env_sup &&
 		    job_ptr->details->env_cnt) {
 			for (i = 0; i < job_ptr->details->env_cnt; i++) {
-				if (strncmp(job_ptr->details->env_sup[i],
-					    "SLURM_ARRAY_TASK", 16))
+				if (xstrncmp(job_ptr->details->env_sup[i],
+					     "SLURM_ARRAY_TASK", 16))
 					continue;
 				eq = strchr(job_ptr->details->env_sup[i], '=');
 				if (!eq)
@@ -3210,6 +3442,40 @@ static void *_run_epilog(void *arg)
 	return NULL;
 }
 
+/* Return a node bitmap identifying which nodes must be rebooted for a job
+ * to start. */
+extern bitstr_t *node_features_reboot(struct job_record *job_ptr)
+{
+	bitstr_t *active_bitmap = NULL, *boot_node_bitmap = NULL;
+
+	if (job_ptr->reboot) {
+		boot_node_bitmap = bit_copy(job_ptr->node_bitmap);
+		return boot_node_bitmap;
+	}
+
+	if ((node_features_g_count() == 0) ||
+	    !node_features_g_user_update(job_ptr->user_id))
+		return NULL;
+
+	build_active_feature_bitmap(job_ptr, job_ptr->node_bitmap,
+				    &active_bitmap);
+	boot_node_bitmap = bit_copy(job_ptr->node_bitmap);
+	if (active_bitmap == NULL) {
+		FREE_NULL_BITMAP(boot_node_bitmap);
+		return boot_node_bitmap;
+	}
+
+	bit_not(active_bitmap);	/* Change to INactive_bitmap */
+	bit_and(boot_node_bitmap, active_bitmap);
+	FREE_NULL_BITMAP(active_bitmap);
+	if (bit_set_count(boot_node_bitmap) == 0)
+		FREE_NULL_BITMAP(boot_node_bitmap);
+	else
+		job_ptr->wait_all_nodes = 1;
+
+	return boot_node_bitmap;
+}
+
 /*
  * reboot_job_nodes - Reboot the compute nodes allocated to a job.
  * IN job_ptr - pointer to job that will be initiated
@@ -3223,38 +3489,62 @@ extern int reboot_job_nodes(struct job_record *job_ptr)
 #else
 extern int reboot_job_nodes(struct job_record *job_ptr)
 {
-	int i, rc;
+	int i, i_first, i_last, rc;
 	pthread_t thread_id_prolog;
 	pthread_attr_t thread_attr_prolog;
 	agent_arg_t *reboot_agent_args = NULL;
+	reboot_msg_t *reboot_msg;
 	struct node_record *node_ptr;
 	time_t now = time(NULL);
-	uint16_t resume_timeout = slurm_get_resume_timeout();
+	bitstr_t *boot_node_bitmap = NULL;
 
-	if ((job_ptr->reboot == 0) || (job_ptr->node_bitmap == NULL) ||
-	    (slurmctld_conf.reboot_program == NULL) ||
+	if ((job_ptr->details == NULL) || (job_ptr->node_bitmap == NULL))
+		return SLURM_SUCCESS;
+	if (power_save_test())
+		return power_job_reboot(job_ptr);
+	if ((slurmctld_conf.reboot_program == NULL) ||
 	    (slurmctld_conf.reboot_program[0] == '\0'))
 		return SLURM_SUCCESS;
 
+	boot_node_bitmap = node_features_reboot(job_ptr);
+	if (boot_node_bitmap == NULL)
+		return SLURM_SUCCESS;
+
 	reboot_agent_args = xmalloc(sizeof(agent_arg_t));
 	reboot_agent_args->msg_type = REQUEST_REBOOT_NODES;
 	reboot_agent_args->retry = 0;
 	reboot_agent_args->protocol_version = SLURM_PROTOCOL_VERSION;
 	reboot_agent_args->hostlist = hostlist_create(NULL);
-	for (i = 0, node_ptr = node_record_table_ptr; i < node_record_count;
-	     i++, node_ptr++) {
-		if (!bit_test(job_ptr->node_bitmap, i))
+	reboot_msg = xmalloc(sizeof(reboot_msg_t));
+	if (job_ptr->details->features &&
+	    node_features_g_user_update(job_ptr->user_id)) {
+		reboot_msg->features = node_features_g_job_xlate(
+					job_ptr->details->features);
+	}
+	reboot_agent_args->msg_args = reboot_msg;
+	i_first = bit_ffs(boot_node_bitmap);
+	if (i_first >= 0)
+		i_last = bit_fls(boot_node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first; i <= i_last; i++) {
+		if (!bit_test(boot_node_bitmap, i))
 			continue;
+		node_ptr = node_record_table_ptr + i;
 		if (reboot_agent_args->protocol_version
-		    > node_ptr->protocol_version)
+		    > node_ptr->protocol_version) {
 			reboot_agent_args->protocol_version =
 				node_ptr->protocol_version;
+		}
 		hostlist_push_host(reboot_agent_args->hostlist, node_ptr->name);
 		reboot_agent_args->node_count++;
 		node_ptr->node_state |= NODE_STATE_NO_RESPOND;
+		node_ptr->node_state |= NODE_STATE_POWER_UP;
 		bit_clear(avail_node_bitmap, i);
-		node_ptr->last_response = now + resume_timeout;
+		node_ptr->last_response = now + slurmctld_conf.resume_timeout -
+					  slurmctld_conf.slurmd_timeout;
 	}
+	FREE_NULL_BITMAP(boot_node_bitmap);
 	agent_queue_request(reboot_agent_args);
 
 	if (job_ptr->details)
@@ -3475,7 +3765,9 @@ static void *_run_prolog(void *arg)
 			error("prolog_slurmctld job %u now defunct", job_id);
 	}
 	prolog_running_decr(job_ptr);
-	if (job_ptr && job_ptr->node_bitmap) {
+	if (power_save_test()) {
+		/* Wait for node to register after booting */
+	} else if (job_ptr && job_ptr->node_bitmap) {
 		for (i=0; i<node_record_count; i++) {
 			if (bit_test(job_ptr->node_bitmap, i) == 0)
 				continue;
@@ -3520,7 +3812,7 @@ extern void prolog_running_decr(struct job_record *job_ptr)
  */
 extern List feature_list_copy(List feature_list_src)
 {
-	struct feature_record *feat_src, *feat_dest;
+	job_feature_t *feat_src, *feat_dest;
 	ListIterator iter;
 	List feature_list_dest = NULL;
 
@@ -3529,9 +3821,9 @@ extern List feature_list_copy(List feature_list_src)
 
 	feature_list_dest = list_create(_feature_list_delete);
 	iter = list_iterator_create(feature_list_src);
-	while ((feat_src = (struct feature_record *) list_next(iter))) {
-		feat_dest = xmalloc(sizeof(struct feature_record));
-		memcpy(feat_dest, feat_src, sizeof(struct feature_record));
+	while ((feat_src = (job_feature_t *) list_next(iter))) {
+		feat_dest = xmalloc(sizeof(job_feature_t));
+		memcpy(feat_dest, feat_src, sizeof(job_feature_t));
 		feat_dest->name = xstrdup(feat_src->name);
 		list_append(feature_list_dest, feat_dest);
 	}
@@ -3551,13 +3843,17 @@ extern int build_feature_list(struct job_record *job_ptr)
 	char *tmp_requested, *str_ptr, *feature = NULL;
 	int bracket = 0, count = 0, i;
 	bool have_count = false, have_or = false;
-	struct feature_record *feat;
+	job_feature_t *feat;
 
 	if (!detail_ptr || !detail_ptr->features)	/* no constraints */
 		return SLURM_SUCCESS;
 	if (detail_ptr->feature_list)		/* already processed */
 		return SLURM_SUCCESS;
 
+	/* Use of commas separator is a common error. Replace them with '&' */
+	while ((str_ptr = strstr(detail_ptr->features, ",")))
+		str_ptr[0] = '&';
+
 	tmp_requested = xstrdup(detail_ptr->features);
 	detail_ptr->feature_list = list_create(_feature_list_delete);
 	for (i=0; ; i++) {
@@ -3580,7 +3876,7 @@ extern int build_feature_list(struct job_record *job_ptr)
 				xfree(tmp_requested);
 				return ESLURM_INVALID_FEATURE;
 			}
-			feat = xmalloc(sizeof(struct feature_record));
+			feat = xmalloc(sizeof(job_feature_t));
 			feat->name = xstrdup(feature);
 			feat->count = count;
 			if (bracket)
@@ -3599,7 +3895,7 @@ extern int build_feature_list(struct job_record *job_ptr)
 				xfree(tmp_requested);
 				return ESLURM_INVALID_FEATURE;
 			}
-			feat = xmalloc(sizeof(struct feature_record));
+			feat = xmalloc(sizeof(job_feature_t));
 			feat->name = xstrdup(feature);
 			feat->count = count;
 			if (bracket)
@@ -3629,7 +3925,7 @@ extern int build_feature_list(struct job_record *job_ptr)
 			bracket = 0;
 		} else if (tmp_requested[i] == '\0') {
 			if (feature) {
-				feat = xmalloc(sizeof(struct feature_record));
+				feat = xmalloc(sizeof(job_feature_t));
 				feat->name = xstrdup(feature);
 				feat->count = count;
 				feat->op_code = FEATURE_OP_END;
@@ -3652,31 +3948,34 @@ extern int build_feature_list(struct job_record *job_ptr)
 		return ESLURM_INVALID_FEATURE;
 	}
 
-	return _valid_feature_list(job_ptr->job_id, detail_ptr->feature_list);
+	return _valid_feature_list(job_ptr, detail_ptr->feature_list);
 }
 
 static void _feature_list_delete(void *x)
 {
-	struct feature_record *feature = (struct feature_record *)x;
+	job_feature_t *feature = (job_feature_t *)x;
 	xfree(feature->name);
 	xfree(feature);
 }
 
-static int _valid_feature_list(uint32_t job_id, List feature_list)
+static int _valid_feature_list(struct job_record *job_ptr, List feature_list)
 {
 	ListIterator feat_iter;
-	struct feature_record *feat_ptr;
+	job_feature_t *feat_ptr;
 	char *buf = NULL, tmp[16];
 	int bracket = 0;
 	int rc = SLURM_SUCCESS;
+	bool can_reboot;
 
 	if (feature_list == NULL) {
-		debug2("Job %u feature list is empty", job_id);
+		debug2("Job %u feature list is empty", job_ptr->job_id);
 		return rc;
 	}
 
+	can_reboot = node_features_g_user_update(job_ptr->user_id);
+
 	feat_iter = list_iterator_create(feature_list);
-	while ((feat_ptr = (struct feature_record *)list_next(feat_iter))) {
+	while ((feat_ptr = (job_feature_t *)list_next(feat_iter))) {
 		if ((feat_ptr->op_code == FEATURE_OP_XOR) ||
 		    (feat_ptr->op_code == FEATURE_OP_XAND)) {
 			if (bracket == 0)
@@ -3685,7 +3984,7 @@ static int _valid_feature_list(uint32_t job_id, List feature_list)
 		}
 		xstrcat(buf, feat_ptr->name);
 		if (rc == SLURM_SUCCESS)
-			rc = _valid_node_feature(feat_ptr->name);
+			rc = _valid_node_feature(feat_ptr->name, can_reboot);
 		if (feat_ptr->count) {
 			snprintf(tmp, sizeof(tmp), "*%u", feat_ptr->count);
 			xstrcat(buf, tmp);
@@ -3704,26 +4003,31 @@ static int _valid_feature_list(uint32_t job_id, List feature_list)
 			xstrcat(buf, "|");
 	}
 	list_iterator_destroy(feat_iter);
-	if (rc == SLURM_SUCCESS)
-		debug("Job %u feature list: %s", job_id, buf);
-	else
-		info("Job %u has invalid feature list: %s", job_id, buf);
+
+	if (rc == SLURM_SUCCESS) {
+		debug("Job %u feature list: %s", job_ptr->job_id, buf);
+	} else {
+		info("Job %u has invalid feature list: %s",
+		     job_ptr->job_id, buf);
+	}
 	xfree(buf);
+
 	return rc;
 }
 
-static int _valid_node_feature(char *feature)
+/* Validate that job's feature is available on some node(s) */
+static int _valid_node_feature(char *feature, bool can_reboot)
 {
 	int rc = ESLURM_INVALID_FEATURE;
-	struct features_record *feature_ptr;
+	node_feature_t *feature_ptr;
 	ListIterator feature_iter;
 
-	/* Clear these nodes from the feature_list record,
-	 * then restore as needed */
-	feature_iter = list_iterator_create(feature_list);
-	while ((feature_ptr = (struct features_record *)
-			list_next(feature_iter))) {
-		if (strcmp(feature_ptr->name, feature))
+	if (can_reboot)
+		feature_iter = list_iterator_create(avail_feature_list);
+	else
+		feature_iter = list_iterator_create(active_feature_list);
+	while ((feature_ptr = (node_feature_t *)list_next(feature_iter))) {
+		if (xstrcmp(feature_ptr->name, feature))
 			continue;
 		rc = SLURM_SUCCESS;
 		break;
diff --git a/src/slurmctld/job_scheduler.h b/src/slurmctld/job_scheduler.h
index 6913e9eb6..160404aa7 100644
--- a/src/slurmctld/job_scheduler.h
+++ b/src/slurmctld/job_scheduler.h
@@ -73,7 +73,15 @@ extern List build_job_queue(bool clear_start, bool backfill);
 /* Given a scheduled job, return a pointer to it batch_job_launch_msg_t data */
 extern batch_job_launch_msg_t *build_launch_job_msg(
 					struct job_record *job_ptr,
-					uint16_t protocol_versin);
+					uint16_t protocol_version);
+
+/* Determine if job's deadline specification is still valid, kill job if not
+ * job_ptr IN - Job to test
+ * func IN - function named used for logging, "sched" or "backfill"
+ * RET - true of valid, false if invalid and job cancelled
+ */
+extern bool deadline_ok(struct job_record *job_ptr, char *func);
+
 /*
  * epilog_slurmctld - execute the prolog_slurmctld for a job that has just
  *	terminated.
@@ -115,6 +123,10 @@ extern int make_batch_job_cred(batch_job_launch_msg_t *launch_msg_ptr,
 			       struct job_record *job_ptr,
 			       uint16_t protocol_version);
 
+/* Return a node bitmap identifying which nodes must be rebooted for a job
+ * to start. */
+extern bitstr_t *node_features_reboot(struct job_record *job_ptr);
+
 /* Print a job's dependency information based upon job_ptr->depend_list */
 extern void print_job_dependency(struct job_record *job_ptr);
 
diff --git a/src/slurmctld/job_submit.c b/src/slurmctld/job_submit.c
index a066141ae..7216d5535 100644
--- a/src/slurmctld/job_submit.c
+++ b/src/slurmctld/job_submit.c
@@ -128,7 +128,7 @@ extern int job_submit_plugin_init(void)
 			 (sizeof(slurm_submit_ops_t) * (g_context_cnt + 1)));
 		xrealloc(g_context,
 			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
-		if (strncmp(type, "job_submit/", 11) == 0)
+		if (xstrncmp(type, "job_submit/", 11) == 0)
 			type += 11; /* backward compatibility */
 		type = xstrdup_printf("job_submit/%s", type);
 		g_context[g_context_cnt] = plugin_context_create(
@@ -144,7 +144,7 @@ extern int job_submit_plugin_init(void)
 
 		xfree(type);
 		g_context_cnt++;
-		names = NULL; /* for next iteration */
+		names = NULL; /* for next strtok_r() iteration */
 	}
 	init_run = true;
 
@@ -207,7 +207,7 @@ extern int job_submit_plugin_reconfig(void)
 
 	slurm_mutex_lock(&g_context_lock);
 	if (plugin_names && submit_plugin_list &&
-	    strcmp(plugin_names, submit_plugin_list))
+	    xstrcmp(plugin_names, submit_plugin_list))
 		plugin_change = true;
 	else
 		plugin_change = false;
diff --git a/src/slurmctld/licenses.c b/src/slurmctld/licenses.c
index abb95b2ca..af5a1c63a 100644
--- a/src/slurmctld/licenses.c
+++ b/src/slurmctld/licenses.c
@@ -418,7 +418,7 @@ extern void license_remove_remote(slurmdb_res_rec_t *rec)
 	while ((license_entry = list_next(iter))) {
 		if (!license_entry->remote)
 			continue;
-		if (!strcmp(license_entry->name, name)) {
+		if (!xstrcmp(license_entry->name, name)) {
 			info("license_remove_remote: license %s "
 			     "removed with %u in use",
 			     license_entry->name, license_entry->used);
@@ -459,7 +459,7 @@ extern void license_sync_remote(List res_list)
 			while ((license_entry = list_next(iter))) {
 				if (!license_entry->remote)
 					continue;
-				if (!strcmp(license_entry->name, name)) {
+				if (!xstrcmp(license_entry->name, name)) {
 					license_entry->remote = 2;
 					license_entry->total =
 						((rec->count *
@@ -962,7 +962,7 @@ extern void license_set_job_tres_cnt(List license_list,
 static void
 _pack_license(struct licenses *lic, Buf buffer, uint16_t protocol_version)
 {
-	if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_MIN_PROTOCOL_VERSION) {
 		packstr(lic->name, buffer);
 		pack32(lic->total, buffer);
 		pack32(lic->used, buffer);
diff --git a/src/slurmctld/node_mgr.c b/src/slurmctld/node_mgr.c
index 61374d1c8..adca5e66b 100644
--- a/src/slurmctld/node_mgr.c
+++ b/src/slurmctld/node_mgr.c
@@ -55,17 +55,21 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include "src/common/bitstring.h"
 #include "src/common/gres.h"
 #include "src/common/hostlist.h"
 #include "src/common/macros.h"
+#include "src/common/node_features.h"
 #include "src/common/pack.h"
 #include "src/common/parse_time.h"
 #include "src/common/power.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/read_config.h"
 #include "src/common/slurm_accounting_storage.h"
 #include "src/common/slurm_acct_gather_energy.h"
 #include "src/common/slurm_ext_sensors.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/xassert.h"
 #include "src/common/xstring.h"
 #include "src/slurmctld/agent.h"
@@ -73,6 +77,7 @@
 #include "src/slurmctld/locks.h"
 #include "src/slurmctld/ping_nodes.h"
 #include "src/slurmctld/proc_req.h"
+#include "src/slurmctld/read_config.h"
 #include "src/slurmctld/reservation.h"
 #include "src/slurmctld/sched_plugin.h"
 #include "src/slurmctld/slurmctld.h"
@@ -103,14 +108,17 @@ static front_end_record_t * _front_end_reg(
 static bool	_is_cloud_hidden(struct node_record *node_ptr);
 static void 	_make_node_down(struct node_record *node_ptr,
 				time_t event_time);
-static bool	_node_is_hidden(struct node_record *node_ptr);
+static bool	_node_is_hidden(struct node_record *node_ptr, uid_t uid);
 static int	_open_node_state_file(char **state_file);
 static void 	_pack_node(struct node_record *dump_node_ptr, Buf buffer,
 			   uint16_t protocol_version, uint16_t show_flags);
 static void	_sync_bitmaps(struct node_record *node_ptr, int job_count);
 static void	_update_config_ptr(bitstr_t *bitmap,
 				struct config_record *config_ptr);
-static int	_update_node_features(char *node_names, char *features);
+static int	_update_node_active_features(char *node_names,
+				char *active_features);
+static int	_update_node_avail_features(char *node_names,
+				char *avail_features);
 static int	_update_node_gres(char *node_names, char *gres);
 static int	_update_node_weight(char *node_names, uint32_t weight);
 static bool 	_valid_node_state_change(uint32_t old, uint32_t new);
@@ -214,6 +222,7 @@ _dump_node_state (struct node_record *dump_node_ptr, Buf buffer)
 	packstr (dump_node_ptr->node_hostname, buffer);
 	packstr (dump_node_ptr->reason, buffer);
 	packstr (dump_node_ptr->features, buffer);
+	packstr (dump_node_ptr->features_act, buffer);
 	packstr (dump_node_ptr->gres, buffer);
 	packstr (dump_node_ptr->cpu_spec_list, buffer);
 	pack32  (dump_node_ptr->node_state, buffer);
@@ -229,6 +238,7 @@ _dump_node_state (struct node_record *dump_node_ptr, Buf buffer)
 	pack32  (dump_node_ptr->reason_uid, buffer);
 	pack_time(dump_node_ptr->reason_time, buffer);
 	pack16  (dump_node_ptr->protocol_version, buffer);
+	packstr (dump_node_ptr->mcs_label, buffer);
 	(void) gres_plugin_node_state_pack(dump_node_ptr->gres_list, buffer,
 					   dump_node_ptr->name);
 }
@@ -276,9 +286,11 @@ extern int load_all_node_state ( bool state_only )
 {
 	char *comm_name = NULL, *node_hostname = NULL;
 	char *node_name = NULL, *reason = NULL, *data = NULL, *state_file;
-	char *features = NULL, *gres = NULL, *cpu_spec_list = NULL;
+	char *features = NULL, *features_act = NULL;
+	char *gres = NULL, *cpu_spec_list = NULL;
+	char *mcs_label = NULL;
 	int data_allocated, data_read = 0, error_code = 0, node_cnt = 0;
-	uint16_t node_state2, core_spec_cnt = 0;
+	uint16_t core_spec_cnt = 0;
 	uint32_t node_state;
 	uint16_t cpus = 1, boards = 1, sockets = 1, cores = 1, threads = 1;
 	uint32_t real_memory, tmp_disk, data_size = 0, name_len;
@@ -349,15 +361,15 @@ extern int load_all_node_state ( bool state_only )
 
 	while (remaining_buf (buffer) > 0) {
 		uint32_t base_state;
-		uint16_t base_state2;
 		uint16_t obj_protocol_version = (uint16_t)NO_VAL;
-		if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc (&comm_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_hostname,
 							    &name_len, buffer);
 			safe_unpackstr_xmalloc (&reason,    &name_len, buffer);
 			safe_unpackstr_xmalloc (&features,  &name_len, buffer);
+			safe_unpackstr_xmalloc (&features_act,&name_len,buffer);
 			safe_unpackstr_xmalloc (&gres,      &name_len, buffer);
 			safe_unpackstr_xmalloc (&cpu_spec_list,
 							    &name_len, buffer);
@@ -374,12 +386,13 @@ extern int load_all_node_state ( bool state_only )
 			safe_unpack32 (&reason_uid,  buffer);
 			safe_unpack_time (&reason_time, buffer);
 			safe_unpack16 (&obj_protocol_version, buffer);
+			safe_unpackstr_xmalloc (&mcs_label, &name_len, buffer);
 			if (gres_plugin_node_state_unpack(
 				    &gres_list, buffer, node_name,
 				    protocol_version) != SLURM_SUCCESS)
 				goto unpack_error;
 			base_state = node_state & NODE_STATE_BASE;
-		} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+		} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc (&comm_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_hostname,
@@ -407,7 +420,7 @@ extern int load_all_node_state ( bool state_only )
 				    protocol_version) != SLURM_SUCCESS)
 				goto unpack_error;
 			base_state = node_state & NODE_STATE_BASE;
-		} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc (&comm_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_name, &name_len, buffer);
 			safe_unpackstr_xmalloc (&node_hostname,
@@ -415,13 +428,17 @@ extern int load_all_node_state ( bool state_only )
 			safe_unpackstr_xmalloc (&reason,    &name_len, buffer);
 			safe_unpackstr_xmalloc (&features,  &name_len, buffer);
 			safe_unpackstr_xmalloc (&gres,      &name_len, buffer);
-			safe_unpack16 (&node_state2,  buffer);
+			safe_unpackstr_xmalloc (&cpu_spec_list,
+							    &name_len, buffer);
+			safe_unpack32 (&node_state,  buffer);
 			safe_unpack16 (&cpus,        buffer);
 			safe_unpack16 (&boards,     buffer);
 			safe_unpack16 (&sockets,     buffer);
 			safe_unpack16 (&cores,       buffer);
+			safe_unpack16 (&core_spec_cnt, buffer);
 			safe_unpack16 (&threads,     buffer);
 			safe_unpack32 (&real_memory, buffer);
+			safe_unpack32 (&mem_spec_limit, buffer);
 			safe_unpack32 (&tmp_disk,    buffer);
 			safe_unpack32 (&reason_uid,  buffer);
 			safe_unpack_time (&reason_time, buffer);
@@ -430,12 +447,7 @@ extern int load_all_node_state ( bool state_only )
 				    &gres_list, buffer, node_name,
 				    protocol_version) != SLURM_SUCCESS)
 				goto unpack_error;
-			base_state2 = node_state2 & NODE_STATE_BASE;
-			/* First decode the quantities as 16 bit
-			 * then assign to 32 bit.
-			 */
-			node_state = node_state2;
-			base_state = base_state2;
+			base_state = node_state & NODE_STATE_BASE;
 		} else {
 			error("load_all_node_state: protocol_version "
 			      "%hu not supported", protocol_version);
@@ -557,6 +569,7 @@ extern int load_all_node_state ( bool state_only )
 				node_ptr->reason_time = reason_time;
 				node_ptr->reason_uid = reason_uid;
 			}
+
 			if (!slurmctld_conf.fast_schedule) {
 				/* Accounting will need to know the
 				 * last state here otherwise we will
@@ -578,6 +591,10 @@ extern int load_all_node_state ( bool state_only )
 					mem_spec_limit;
 				node_ptr->tmp_disk      = tmp_disk;
 			}
+
+			xfree(node_ptr->features_act);
+			node_ptr->features_act	= features_act;
+			features_act		= NULL;	/* Nothing to free */
 			node_ptr->gres_list	= gres_list;
 			gres_list		= NULL;	/* Nothing to free */
 		} else {
@@ -613,6 +630,9 @@ extern int load_all_node_state ( bool state_only )
 			xfree(node_ptr->features);
 			node_ptr->features	= features;
 			features		= NULL;	/* Nothing to free */
+			xfree(node_ptr->features_act);
+			node_ptr->features_act	= features_act;
+			features_act		= NULL;	/* Nothing to free */
 			xfree(node_ptr->gres);
 			node_ptr->gres 		= gres;
 			gres			= NULL;	/* Nothing to free */
@@ -633,6 +653,9 @@ extern int load_all_node_state ( bool state_only )
 			node_ptr->mem_spec_limit = mem_spec_limit;
 			node_ptr->tmp_disk      = tmp_disk;
 			node_ptr->last_response = (time_t) 0;
+			xfree(node_ptr->mcs_label);
+			node_ptr->mcs_label	= mcs_label;
+			mcs_label		= NULL; /* Nothing to free */
 		}
 
 		if (node_ptr) {
@@ -650,6 +673,7 @@ extern int load_all_node_state ( bool state_only )
 		}
 
 		xfree(features);
+		xfree(features_act);
 		xfree(gres);
 		FREE_NULL_LIST(gres_list);
 		xfree (comm_name);
@@ -709,20 +733,26 @@ static bool _is_cloud_hidden(struct node_record *node_ptr)
 	return false;
 }
 
-static bool _node_is_hidden(struct node_record *node_ptr)
+static bool _node_is_hidden(struct node_record *node_ptr, uid_t uid)
 {
 	int i;
 	bool shown = false;
 
+	if ((slurmctld_conf.private_data & PRIVATE_DATA_NODES)
+	    && (slurm_mcs_get_privatedata() == 1)
+	    && !validate_operator(uid)
+	    && (mcs_g_check_mcs_label(uid, node_ptr->mcs_label) != 0))
+		return true;
+
 	for (i=0; i<node_ptr->part_cnt; i++) {
 		if (!(node_ptr->part_pptr[i]->flags & PART_FLAG_HIDDEN)) {
 			shown = true;
 			break;
 		}
 	}
-
 	if (shown || (node_ptr->part_cnt == 0))
 		return false;
+
 	return true;
 }
 
@@ -778,7 +808,7 @@ extern void pack_all_node (char **buffer_ptr, int *buffer_size,
 			 * with it. */
 			hidden = false;
 			if (((show_flags & SHOW_ALL) == 0) && (uid != 0) &&
-			    (_node_is_hidden(node_ptr)))
+			    (_node_is_hidden(node_ptr, uid)))
 				hidden = true;
 			else if (IS_NODE_FUTURE(node_ptr))
 				hidden = true;
@@ -864,7 +894,7 @@ extern void pack_one_node (char **buffer_ptr, int *buffer_size,
 		if (node_ptr) {
 			hidden = false;
 			if (((show_flags & SHOW_ALL) == 0) && (uid != 0) &&
-			    (_node_is_hidden(node_ptr)))
+			    (_node_is_hidden(node_ptr, uid)))
 				hidden = true;
 			else if (IS_NODE_FUTURE(node_ptr))
 				hidden = true;
@@ -912,7 +942,7 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 {
 	char *gres_drain = NULL, *gres_used = NULL;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
 		packstr (dump_node_ptr->name, buffer);
 		packstr (dump_node_ptr->node_hostname, buffer);
 		packstr (dump_node_ptr->comm_name, buffer);
@@ -943,6 +973,7 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 #ifndef HAVE_BG
 		}
 #endif
+		packstr(dump_node_ptr->mcs_label, buffer);
 		pack32(dump_node_ptr->owner, buffer);
 		pack16(dump_node_ptr->core_spec_cnt, buffer);
 		pack32(dump_node_ptr->mem_spec_limit, buffer);
@@ -962,6 +993,7 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 
 		packstr(dump_node_ptr->arch, buffer);
 		packstr(dump_node_ptr->features, buffer);
+		packstr(dump_node_ptr->features_act, buffer);
 		if (dump_node_ptr->gres)
 			packstr(dump_node_ptr->gres, buffer);
 		else
@@ -989,7 +1021,7 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 				     protocol_version);
 
 		packstr(dump_node_ptr->tres_fmt_str,buffer);
-	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		packstr (dump_node_ptr->name, buffer);
 		packstr (dump_node_ptr->node_hostname, buffer);
 		packstr (dump_node_ptr->comm_name, buffer);
@@ -1020,11 +1052,13 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 #ifndef HAVE_BG
 		}
 #endif
+		pack32(dump_node_ptr->owner, buffer);
 		pack16(dump_node_ptr->core_spec_cnt, buffer);
 		pack32(dump_node_ptr->mem_spec_limit, buffer);
 		packstr(dump_node_ptr->cpu_spec_list, buffer);
 
 		pack32(dump_node_ptr->cpu_load, buffer);
+		pack32(dump_node_ptr->free_mem, buffer);
 		pack32(dump_node_ptr->config_ptr->weight, buffer);
 		pack32(dump_node_ptr->reason_uid, buffer);
 
@@ -1059,16 +1093,19 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 		acct_gather_energy_pack(dump_node_ptr->energy, buffer,
 					protocol_version);
 		ext_sensors_data_pack(dump_node_ptr->ext_sensors, buffer,
-					protocol_version);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+				      protocol_version);
+		power_mgmt_data_pack(dump_node_ptr->power, buffer,
+				     protocol_version);
+
+		packstr(dump_node_ptr->tres_fmt_str,buffer);
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		packstr (dump_node_ptr->name, buffer);
 		packstr (dump_node_ptr->node_hostname, buffer);
 		packstr (dump_node_ptr->comm_name, buffer);
-		pack16  (dump_node_ptr->node_state, buffer);
+		pack32(dump_node_ptr->node_state, buffer);
 		packstr (dump_node_ptr->version, buffer);
 		/* On a bluegene system always use the regular node
-		* infomation not what is in the config_ptr.
-		*/
+		* infomation not what is in the config_ptr. */
 #ifndef HAVE_BG
 		if (slurmctld_conf.fast_schedule) {
 			/* Only data from config_record used for scheduling */
@@ -1092,6 +1129,10 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 #ifndef HAVE_BG
 		}
 #endif
+		pack16(dump_node_ptr->core_spec_cnt, buffer);
+		pack32(dump_node_ptr->mem_spec_limit, buffer);
+		packstr(dump_node_ptr->cpu_spec_list, buffer);
+
 		pack32(dump_node_ptr->cpu_load, buffer);
 		pack32(dump_node_ptr->config_ptr->weight, buffer);
 		pack32(dump_node_ptr->reason_uid, buffer);
@@ -1109,6 +1150,19 @@ static void _pack_node (struct node_record *dump_node_ptr, Buf buffer,
 			packstr(dump_node_ptr->gres, buffer);
 		else
 			packstr(dump_node_ptr->config_ptr->gres, buffer);
+
+		/* Gathering GRES deails is slow, so don't by default */
+		if (show_flags & SHOW_DETAIL) {
+			gres_drain =
+				gres_get_node_drain(dump_node_ptr->gres_list);
+			gres_used  =
+				gres_get_node_used(dump_node_ptr->gres_list);
+		}
+		packstr(gres_drain, buffer);
+		packstr(gres_used, buffer);
+		xfree(gres_drain);
+		xfree(gres_used);
+
 		packstr(dump_node_ptr->os, buffer);
 		packstr(dump_node_ptr->reason, buffer);
 		acct_gather_energy_pack(dump_node_ptr->energy, buffer,
@@ -1189,6 +1243,41 @@ _equivalent_node_state(struct node_record *node_ptr, uint32_t new_state)
 	return false;
 }
 
+/* Confirm that the selected ActiveFeatures are a subset of AvailableFeatures */
+static bool _valid_features_act(char *features_act, char *features)
+{
+	bool valid_subset = true;
+	char *tmp_act, *last_act = NULL, *tok_act;
+	char *tmp_avail, *last_avail = NULL, *tok_avail;
+
+	if (!features_act || (features_act[0] == '\0'))
+		return true;
+	if (!features || (features[0] == '\0'))
+		return false;
+
+	tmp_act = xstrdup(features_act);
+        tok_act = strtok_r(tmp_act, ",", &last_act);
+        while (tok_act) {
+		last_avail = NULL;
+		tmp_avail = xstrdup(features);
+		tok_avail = strtok_r(tmp_avail, ",", &last_avail);
+		while (tok_avail) {
+			if (!xstrcmp(tok_act, tok_avail))
+				break;
+		        tok_avail = strtok_r(NULL, ",", &last_avail);
+		}
+		xfree(tmp_avail);
+		if (!tok_avail) {	/* No match found */
+			valid_subset = false;
+			break;
+		}
+                tok_act = strtok_r(NULL, ",", &last_act);
+	}
+	xfree(tmp_act);
+
+	return valid_subset;
+}
+
 /*
  * update_node - update the configuration data for one or more nodes
  * IN update_node_msg - update node request
@@ -1285,10 +1374,32 @@ int update_node ( update_node_msg_t * update_node_msg )
 
 		if (update_node_msg->features) {
 			xfree(node_ptr->features);
-			if (update_node_msg->features[0])
-				node_ptr->features = xstrdup(update_node_msg->
-							     features);
-			/* _update_node_features() logs and updates config */
+			if (update_node_msg->features[0]) {
+				node_ptr->features =
+					xstrdup(update_node_msg->features);
+			}
+			/* _update_node_avail_features() logs and updates
+			 * avail_feature_list */
+		}
+
+		if (update_node_msg->features_act &&
+		    !_valid_features_act(update_node_msg->features_act,
+					 node_ptr->features)) {
+			info("Invalid node ActiveFeatures (%s not subset of %s)",
+			     update_node_msg->features_act,
+			     node_ptr->features);
+			error_code = ESLURM_INVALID_FEATURE;
+		} else if (update_node_msg->features_act) {
+			xfree(node_ptr->features_act);
+			node_ptr->features_act =
+				node_features_g_node_xlate(
+					update_node_msg->features_act,
+					node_ptr->features);
+			xfree(update_node_msg->features_act);
+			update_node_msg->features_act =
+				xstrdup(node_ptr->features_act);
+			/* _update_node_active_features() logs and updates
+			 * active_feature_list */
 		}
 
 		if (update_node_msg->gres) {
@@ -1539,9 +1650,15 @@ int update_node ( update_node_msg_t * update_node_msg )
 	FREE_NULL_HOSTLIST(hostname_list);
 	last_node_update = now;
 
+	if ((error_code == 0) && (update_node_msg->features_act)) {
+		error_code = _update_node_active_features(
+					update_node_msg->node_names,
+					update_node_msg->features_act);
+	}
 	if ((error_code == 0) && (update_node_msg->features)) {
-		error_code = _update_node_features(update_node_msg->node_names,
-						   update_node_msg->features);
+		error_code = _update_node_avail_features(
+					update_node_msg->node_names,
+					update_node_msg->features);
 	}
 	if ((error_code == 0) && (update_node_msg->gres)) {
 		error_code = _update_node_gres(update_node_msg->node_names,
@@ -1576,7 +1693,6 @@ extern void restore_node_features(int recover)
 
 	for (i=0, node_ptr=node_record_table_ptr; i<node_record_count;
 	     i++, node_ptr++) {
-
 		if (node_ptr->weight != node_ptr->config_ptr->weight) {
 			error("Node %s Weight(%u) differ from slurm.conf",
 			      node_ptr->name, node_ptr->weight);
@@ -1593,8 +1709,8 @@ extern void restore_node_features(int recover)
 			error("Node %s Features(%s) differ from slurm.conf",
 			      node_ptr->name, node_ptr->features);
 			if (recover == 2) {
-				_update_node_features(node_ptr->name,
-						      node_ptr->features);
+				_update_node_avail_features(node_ptr->name,
+							    node_ptr->features);
 			} else {
 				xfree(node_ptr->features);
 				node_ptr->features = xstrdup(node_ptr->
@@ -1687,7 +1803,6 @@ static int _update_node_weight(char *node_names, uint32_t weight)
 			new_config_ptr->node_bitmap = bit_copy(tmp_bitmap);
 			new_config_ptr->nodes = bitmap2node_name(tmp_bitmap);
 
-			build_config_feature_list(new_config_ptr);
 			_update_config_ptr(tmp_bitmap, new_config_ptr);
 
 			/* Update remaining records */
@@ -1708,13 +1823,38 @@ static int _update_node_weight(char *node_names, uint32_t weight)
 }
 
 /*
- * _update_node_features - Update features associated with nodes
- *	build new config list records as needed
+ * _update_node_active_features - Update active features associated with nodes
+ * IN node_names - List of nodes to update
+ * IN active_features - New active features value
+ * RET: SLURM_SUCCESS or error code
+ */
+static int _update_node_active_features(char *node_names, char *active_features)
+{
+	bitstr_t *node_bitmap = NULL;
+	int rc;
+
+	rc = node_name2bitmap(node_names, false, &node_bitmap);
+	if (rc) {
+		info("%s: invalid node_name (%s)", __func__, node_names);
+		return rc;
+	}
+	update_feature_list(active_feature_list, active_features, node_bitmap);
+	(void) node_features_g_node_update(active_features, node_bitmap);
+	FREE_NULL_BITMAP(node_bitmap);
+
+	info("%s: nodes %s active features set to: %s",
+	     __func__, node_names, active_features);
+	return SLURM_SUCCESS;
+}
+
+/*
+ * _update_node_avail_features - Update available features associated with
+ *	nodes, build new config list records as needed
  * IN node_names - List of nodes to update
- * IN features - New features value
+ * IN avail_features - New available features value
  * RET: SLURM_SUCCESS or error code
  */
-static int _update_node_features(char *node_names, char *features)
+static int _update_node_avail_features(char *node_names, char *avail_features)
 {
 	bitstr_t *node_bitmap = NULL, *tmp_bitmap;
 	ListIterator config_iterator;
@@ -1724,7 +1864,7 @@ static int _update_node_features(char *node_names, char *features)
 
 	rc = node_name2bitmap(node_names, false, &node_bitmap);
 	if (rc) {
-		info("_update_node_features: invalid node_name");
+		info("%s: invalid node_name (%s)", __func__, node_names);
 		return rc;
 	}
 
@@ -1746,21 +1886,20 @@ static int _update_node_features(char *node_names, char *features)
 		} else if (tmp_cnt == config_cnt) {
 			/* all nodes changed, update in situ */
 			xfree(config_ptr->feature);
-			if (features && features[0])
-				config_ptr->feature = xstrdup(features);
-			build_config_feature_list(config_ptr);
+			if (avail_features && avail_features[0])
+				config_ptr->feature = xstrdup(avail_features);
 		} else {
 			/* partial update, split config_record */
 			new_config_ptr = _dup_config(config_ptr);
 			if (first_new == NULL)
 				first_new = new_config_ptr;
 			xfree(new_config_ptr->feature);
-			if (features && features[0])
-				new_config_ptr->feature = xstrdup(features);
+			if (avail_features && avail_features[0]) {
+				new_config_ptr->feature =
+					xstrdup(avail_features);
+			}
 			new_config_ptr->node_bitmap = bit_copy(tmp_bitmap);
 			new_config_ptr->nodes = bitmap2node_name(tmp_bitmap);
-
-			build_config_feature_list(new_config_ptr);
 			_update_config_ptr(tmp_bitmap, new_config_ptr);
 
 			/* Update remaining records */
@@ -1773,10 +1912,11 @@ static int _update_node_features(char *node_names, char *features)
 		FREE_NULL_BITMAP(tmp_bitmap);
 	}
 	list_iterator_destroy(config_iterator);
+	update_feature_list(avail_feature_list, avail_features, node_bitmap);
 	FREE_NULL_BITMAP(node_bitmap);
 
-	info("_update_node_features: nodes %s features set to: %s",
-		node_names, features);
+	info("%s: nodes %s available features set to: %s",
+	     __func__, node_names, avail_features);
 	return SLURM_SUCCESS;
 }
 
@@ -1848,8 +1988,11 @@ static int _update_node_gres(char *node_names, char *gres)
 	list_iterator_destroy(config_iterator);
 
 	i_first = bit_ffs(node_bitmap);
-	i_last  = bit_fls(node_bitmap);
-	for (i=i_first; i<=i_last; i++) {
+	if (i_first >= 0)
+		i_last = bit_fls(node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first; i <= i_last; i++) {
 		node_ptr = node_record_table_ptr + i;
 		(void) gres_plugin_node_reconfig(node_ptr->name,
 						 node_ptr->config_ptr->gres,
@@ -1885,7 +2028,7 @@ static void _update_config_ptr(bitstr_t *bitmap,
  * RET SLURM_SUCCESS or error code
  * global: node_record_table_ptr - pointer to global node table
  */
-extern int drain_nodes ( char *nodes, char *reason, uint32_t reason_uid )
+extern int drain_nodes(char *nodes, char *reason, uint32_t reason_uid)
 {
 	int error_code = 0, node_inx;
 	struct node_record *node_ptr;
@@ -1931,7 +2074,7 @@ extern int drain_nodes ( char *nodes, char *reason, uint32_t reason_uid )
 		info ("drain_nodes: node %s state set to DRAIN",
 			this_node_name);
 		if ((node_ptr->reason == NULL) ||
-		    (strncmp(node_ptr->reason, "Not responding", 14) == 0)) {
+		    (xstrncmp(node_ptr->reason, "Not responding", 14) == 0)) {
 			xfree(node_ptr->reason);
 			node_ptr->reason = xstrdup(reason);
 			node_ptr->reason_time = now;
@@ -2057,6 +2200,43 @@ extern int update_node_record_acct_gather_data(
 	return SLURM_SUCCESS;
 }
 
+/* A node's socket/core configuration has changed could be due to KNL NUMA
+ * mode change and reboot. Update this node's config record, splitting an
+ * existing record if needed. */
+static void _split_node_config(struct node_record *node_ptr,
+			       slurm_node_registration_status_msg_t *reg_msg)
+{
+	struct config_record *config_ptr, *new_config_ptr;
+	int node_inx;
+
+	if (!node_ptr)
+		return;
+	config_ptr = node_ptr->config_ptr;
+	if (!config_ptr)
+		return;
+
+	node_inx = node_ptr - node_record_table_ptr;
+	if ((bit_set_count(config_ptr->node_bitmap) > 1) &&
+	    bit_test(config_ptr->node_bitmap, node_inx)) {
+		new_config_ptr = create_config_record();
+		memcpy(new_config_ptr, config_ptr, sizeof(struct config_record));
+		new_config_ptr->cpu_spec_list =
+			xstrdup(config_ptr->cpu_spec_list);
+		new_config_ptr->feature = xstrdup(config_ptr->feature);
+		new_config_ptr->gres = xstrdup(config_ptr->gres);
+		bit_clear(config_ptr->node_bitmap, node_inx);
+		xfree(config_ptr->nodes);
+		config_ptr->nodes = bitmap2node_name(config_ptr->node_bitmap);
+		new_config_ptr->node_bitmap = bit_alloc(node_record_count);
+		bit_set(new_config_ptr->node_bitmap, node_inx);
+		new_config_ptr->nodes = xstrdup(node_ptr->name);
+		node_ptr->config_ptr = new_config_ptr;
+		config_ptr = new_config_ptr;
+	}
+	config_ptr->cores = reg_msg->cores;
+	config_ptr->sockets = reg_msg->sockets;
+}
+
 /*
  * validate_node_specs - validate the node's specifications as valid,
  *	if not set state to down, in any case update last_response
@@ -2072,9 +2252,9 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 	int error_code, i, node_inx;
 	struct config_record *config_ptr;
 	struct node_record *node_ptr;
-	char *reason_down = NULL;
+	char *reason_down = NULL, *tmp_str;
 	uint32_t node_flags;
-	time_t now = time(NULL);
+	time_t boot_req_time, now = time(NULL);
 	bool gang_flag = false;
 	bool orig_node_avail;
 	static uint32_t cr_flag = NO_VAL;
@@ -2094,6 +2274,16 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 	node_ptr->version = reg_msg->version;
 	reg_msg->version = NULL;
 
+	if (IS_NODE_POWER_UP(node_ptr)) {
+		boot_req_time = node_ptr->last_response -
+				slurm_get_resume_timeout();
+		if (node_ptr->boot_time < boot_req_time) {
+			debug("Still waiting for boot of node %s",
+			      node_ptr->name);
+			return SLURM_SUCCESS;
+		}
+	}
+
 	if (cr_flag == NO_VAL) {
 		cr_flag = 0;  /* call is no-op for select/linear and bluegene */
 		if (select_g_get_info_from_plugin(SELECT_CR_PLUGIN,
@@ -2104,6 +2294,23 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 	if (slurm_get_preempt_mode() != PREEMPT_MODE_OFF)
 		gang_flag = true;
 
+	if (reg_msg->features_active) {
+		tmp_str = node_features_g_node_xlate(reg_msg->features_active,
+						     node_ptr->features_act);
+		xfree(node_ptr->features_act);
+		node_ptr->features_act = tmp_str;
+		(void) _update_node_active_features(node_ptr->name,
+						    node_ptr->features_act);
+	}
+	if (reg_msg->features_avail) {
+		tmp_str = node_features_g_node_xlate(reg_msg->features_avail,
+						     node_ptr->features);
+		xfree(node_ptr->features);
+		node_ptr->features = tmp_str;
+		(void) _update_node_avail_features(node_ptr->name,
+						   node_ptr->features);
+	}
+
 	if (gres_plugin_node_config_unpack(reg_msg->gres_info,
 					   node_ptr->name) != SLURM_SUCCESS) {
 		error_code = SLURM_ERROR;
@@ -2177,6 +2384,13 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 			      config_ptr->cpus);
 			reg_msg->cpus    = config_ptr->cpus;
 		}
+		if ((error_code == SLURM_SUCCESS) && (cr_flag == 1) &&
+		    (reg_msg->sockets != config_ptr->sockets) &&
+		    (reg_msg->cores   != config_ptr->cores) &&
+		    ((reg_msg->sockets * reg_msg->cores) ==
+		     (config_ptr->sockets * config_ptr->cores))) {
+			_split_node_config(node_ptr, reg_msg);
+		}
 	}
 
 	/* reset partition and node config (in that order) */
@@ -2268,12 +2482,13 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 		last_node_update = now;
 	}
 
-	if (IS_NODE_NO_RESPOND(node_ptr)) {
-		if (IS_NODE_POWER_UP(node_ptr))
-			node_ptr->last_response = now;
+	if (IS_NODE_NO_RESPOND(node_ptr) || IS_NODE_POWER_UP(node_ptr)) {
+		info("Node %s now responding", node_ptr->name);
 		node_ptr->node_state &= (~NODE_STATE_NO_RESPOND);
 		node_ptr->node_state &= (~NODE_STATE_POWER_UP);
-		last_node_update = time (NULL);
+		if (!is_node_in_maint_reservation(node_inx))
+			node_ptr->node_state &= (~NODE_STATE_MAINT);
+		last_node_update = now;
 	}
 
 	node_flags = node_ptr->node_state & NODE_STATE_FLAGS;
@@ -2289,11 +2504,18 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 						slurmctld_conf.slurm_user_id);
 		}
 		last_node_update = time (NULL);
-	} else if (reg_msg->status == ESLURMD_PROLOG_FAILED) {
+	} else if (reg_msg->status == ESLURMD_PROLOG_FAILED
+		   || reg_msg->status == ESLURMD_SETUP_ENVIRONMENT_ERROR) {
 		if (!IS_NODE_DRAIN(node_ptr) && !IS_NODE_FAIL(node_ptr)) {
-			error("Prolog failure on node %s, draining the node",
-			      reg_msg->node_name);
-			drain_nodes(reg_msg->node_name, "Prolog error",
+			char *reason;
+			error("%s: Prolog or job env setup failure on node %s, "
+			      "draining the node",
+			      __func__, reg_msg->node_name);
+			if (reg_msg->status == ESLURMD_PROLOG_FAILED)
+				reason = "Prolog error";
+			else
+				reason = "Job env setup error";
+			drain_nodes(reg_msg->node_name, reason,
 				    slurm_get_slurm_user_id());
 			last_node_update = time (NULL);
 		}
@@ -2372,11 +2594,11 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 				node_ptr->reason = xstrdup(
 					"Node unexpectedly rebooted");
 			}
-			info("%s: Node %s unexpectedly rebooted boot_time %d "
-			     "last response %d",
+			info("%s: Node %s unexpectedly rebooted boot_time=%u "
+			     "last response=%u",
 			     __func__, reg_msg->node_name,
-			     (int)node_ptr->boot_time,
-			     (int)node_ptr->last_response);
+			     (uint32_t)node_ptr->boot_time,
+			     (uint32_t)node_ptr->last_response);
 			_make_node_down(node_ptr, now);
 			kill_running_job_by_node_name(reg_msg->node_name);
 			last_node_update = now;
@@ -2411,8 +2633,10 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 			}
 			last_node_update = now;
 		}
-		if (IS_NODE_IDLE(node_ptr))
+		if (IS_NODE_IDLE(node_ptr)) {
 			node_ptr->owner = NO_VAL;
+			xfree(node_ptr->mcs_label);
+		}
 
 		select_g_update_node_config(node_inx);
 		select_g_update_node_state(node_ptr);
@@ -2424,7 +2648,7 @@ extern int validate_node_specs(slurm_node_registration_status_msg_t *reg_msg,
 		memcpy(node_ptr->energy, reg_msg->energy,
 		       sizeof(acct_gather_energy_t));
 
-	node_ptr->last_response = now;
+	node_ptr->last_response = MAX(now, node_ptr->last_response);
 
 	*newly_up = (!orig_node_avail && bit_test(avail_node_bitmap, node_inx));
 
@@ -2459,12 +2683,12 @@ static front_end_record_t * _front_end_reg(
 		reg_msg->job_count = 0;
 	}
 
-	front_end_ptr->last_response = now;
+	front_end_ptr->last_response = MAX(now, front_end_ptr->last_response);
 	front_end_ptr->slurmd_start_time = reg_msg->slurmd_start_time;
 	state_base  = front_end_ptr->node_state & JOB_STATE_BASE;
 	state_flags = front_end_ptr->node_state & JOB_STATE_FLAGS;
 	if ((state_base == NODE_STATE_DOWN) && (front_end_ptr->reason) &&
-	    (!strncmp(front_end_ptr->reason, "Not responding", 14))) {
+	    (!xstrncmp(front_end_ptr->reason, "Not responding", 14))) {
 		error("front end node %s returned to service",
 		      reg_msg->node_name);
 		state_base = NODE_STATE_IDLE;
@@ -2482,6 +2706,16 @@ static front_end_record_t * _front_end_reg(
 	return front_end_ptr;
 }
 
+static char *_build_step_id(char *buf, int buf_len,
+			    uint32_t job_id, uint32_t step_id)
+{
+	if (step_id == SLURM_BATCH_SCRIPT)
+		snprintf(buf, buf_len, "%u.batch", job_id);
+	else
+		snprintf(buf, buf_len, "%u.%u", job_id, step_id);
+	return buf;
+}
+
 /*
  * validate_nodes_via_front_end - validate all nodes on a cluster as having
  *	a valid configuration as soon as the front-end registers. Individual
@@ -2507,6 +2741,7 @@ extern int validate_nodes_via_front_end(
 	char *host_str = NULL, *reason_down = NULL;
 	uint32_t node_flags;
 	front_end_record_t *front_end_ptr;
+	char step_str[64];
 
 	if (reg_msg->up_time > now) {
 		error("Node up_time on %s is invalid: %u>%u",
@@ -2536,8 +2771,10 @@ extern int validate_nodes_via_front_end(
 	for (i = 0; i < reg_msg->job_count; i++) {
 		if ( (reg_msg->job_id[i] >= MIN_NOALLOC_JOBID) &&
 		     (reg_msg->job_id[i] <= MAX_NOALLOC_JOBID) ) {
-			info("NoAllocate job %u.%u reported",
-				reg_msg->job_id[i], reg_msg->step_id[i]);
+			info("NoAllocate job %s reported",
+			     _build_step_id(step_str, sizeof(step_str),
+					    reg_msg->job_id[i],
+					    reg_msg->step_id[i]));
 			continue;
 		}
 
@@ -2548,8 +2785,10 @@ extern int validate_nodes_via_front_end(
 			node_ptr += j;
 
 		if (job_ptr == NULL) {
-			error("Orphan job %u.%u reported on %s",
-			      reg_msg->job_id[i], reg_msg->step_id[i],
+			error("Orphan job %s reported on node %s",
+			     _build_step_id(step_str, sizeof(step_str),
+					    reg_msg->job_id[i],
+					    reg_msg->step_id[i]),
 			      front_end_ptr->name);
 			abort_job_on_node(reg_msg->job_id[i],
 					  job_ptr, front_end_ptr->name);
@@ -2562,8 +2801,10 @@ extern int validate_nodes_via_front_end(
 
 
 		if (IS_JOB_RUNNING(job_ptr) || IS_JOB_SUSPENDED(job_ptr)) {
-			debug3("Registered job %u.%u on %s",
-			       reg_msg->job_id[i], reg_msg->step_id[i],
+			debug3("Registered job %s on %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
 			       front_end_ptr->name);
 			if (job_ptr->batch_flag) {
 				/* NOTE: Used for purging defunct batch jobs */
@@ -2581,8 +2822,10 @@ extern int validate_nodes_via_front_end(
 		else if (IS_JOB_PENDING(job_ptr)) {
 			/* Typically indicates a job requeue and the hung
 			 * slurmd that went DOWN is now responding */
-			error("Registered PENDING job %u.%u on %s",
-			      reg_msg->job_id[i], reg_msg->step_id[i],
+			error("Registered PENDING job %s on %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
 			      front_end_ptr->name);
 			abort_job_on_node(reg_msg->job_id[i], job_ptr,
 					  front_end_ptr->name);
@@ -2590,16 +2833,20 @@ extern int validate_nodes_via_front_end(
 
 		else if (difftime(now, job_ptr->end_time) <
 			 slurm_get_msg_timeout()) {	/* Race condition */
-			debug("Registered newly completed job %u.%u on %s",
-				reg_msg->job_id[i], reg_msg->step_id[i],
-				front_end_ptr->name);
+			debug("Registered newly completed job %s on %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
+			      front_end_ptr->name);
 		}
 
 		else {		/* else job is supposed to be done */
-			error("Registered job %u.%u in state %s on %s",
-				reg_msg->job_id[i], reg_msg->step_id[i],
-				job_state_string(job_ptr->job_state),
-				front_end_ptr->name);
+			error("Registered job %s in state %s on %s",
+			      _build_step_id(step_str, sizeof(step_str),
+					     reg_msg->job_id[i],
+					     reg_msg->step_id[i]),
+			      job_state_string(job_ptr->job_state),
+			      front_end_ptr->name);
 			kill_job_on_node(reg_msg->job_id[i], job_ptr,
 					 node_ptr);
 		}
@@ -2637,7 +2884,7 @@ extern int validate_nodes_via_front_end(
 	for (i = 0, node_ptr = node_record_table_ptr; i < node_record_count;
 	     i++, node_ptr++) {
 		config_ptr = node_ptr->config_ptr;
-		node_ptr->last_response = now;
+		node_ptr->last_response = MAX(now, node_ptr->last_response);
 
 		rc = gres_plugin_node_config_validate(node_ptr->name,
 						      config_ptr->gres,
@@ -2754,8 +3001,10 @@ extern int validate_nodes_via_front_end(
 				      "with %u running jobs",
 				      node_ptr->name, reg_msg->job_count);
 			}
-			if (IS_NODE_IDLE(node_ptr))
+			if (IS_NODE_IDLE(node_ptr)) {
 				node_ptr->owner = NO_VAL;
+				xfree(node_ptr->mcs_label);
+			}
 
 			select_g_update_node_config(i);
 			select_g_update_node_state(node_ptr);
@@ -2818,7 +3067,7 @@ static void _node_did_resp(front_end_record_t *fe_ptr)
 	uint32_t node_flags;
 	time_t now = time(NULL);
 
-	fe_ptr->last_response = now;
+	fe_ptr->last_response = MAX(now, fe_ptr->last_response);
 
 	if (IS_NODE_NO_RESPOND(fe_ptr)) {
 		info("Node %s now responding", fe_ptr->name);
@@ -2859,8 +3108,9 @@ static void _node_did_resp(struct node_record *node_ptr)
 	node_inx = node_ptr - node_record_table_ptr;
 	/* Do not change last_response value (in the future) for nodes being
 	 *  booted so unexpected reboots are recognized */
-	if (IS_NODE_DOWN(node_ptr) &&
-	    !xstrcmp(node_ptr->reason, "Scheduled reboot")) {
+	if (IS_NODE_POWER_UP(node_ptr) ||
+	    (IS_NODE_DOWN(node_ptr) &&
+	     !xstrcmp(node_ptr->reason, "Scheduled reboot"))) {
 		boot_req_time = node_ptr->last_response -
 				slurm_get_resume_timeout();
 		if (node_ptr->boot_time < boot_req_time) {
@@ -2869,8 +3119,7 @@ static void _node_did_resp(struct node_record *node_ptr)
 			return;
 		}
 	}
-	if (node_ptr->last_response < now)
-		node_ptr->last_response = now;
+	node_ptr->last_response = MAX(now, node_ptr->last_response);
 	if (IS_NODE_NO_RESPOND(node_ptr) || IS_NODE_POWER_UP(node_ptr)) {
 		info("Node %s now responding", node_ptr->name);
 		node_ptr->node_state &= (~NODE_STATE_NO_RESPOND);
@@ -2980,9 +3229,12 @@ void node_not_resp (char *name, time_t msg_time, slurm_msg_type_t resp_type)
 	 * version or munge issue or whatever) so we don't kill
 	 * any running jobs.  RESPONSE_FORWARD_FAILED means we
 	 * couldn't contact the slurmd.
+	 * last_response could be in the future if boot in progress.
 	 */
-	if (resp_type != RESPONSE_FORWARD_FAILED)
-		node_ptr->last_response = msg_time - 1;
+	if (resp_type != RESPONSE_FORWARD_FAILED) {
+		node_ptr->last_response = MAX(msg_time - 1,
+					      node_ptr->last_response);
+	}
 
 	if (!IS_NODE_DOWN(node_ptr)) {
 		/* Logged by node_no_resp_msg() on periodic basis */
@@ -3072,7 +3324,7 @@ void set_node_down_ptr (struct node_record *node_ptr, char *reason)
 	time_t now = time(NULL);
 
 	if ((node_ptr->reason == NULL) ||
-	    (strncmp(node_ptr->reason, "Not responding", 14) == 0)) {
+	    (xstrncmp(node_ptr->reason, "Not responding", 14) == 0)) {
 		xfree(node_ptr->reason);
 		node_ptr->reason = xstrdup(reason);
 		node_ptr->reason_time = now;
@@ -3237,6 +3489,11 @@ extern void make_node_alloc(struct node_record *node_ptr,
 		node_ptr->owner = job_ptr->user_id;
 	}
 
+	if (slurm_mcs_get_select(job_ptr) == 1) {
+		xfree(node_ptr->mcs_label);
+		node_ptr->mcs_label = xstrdup(job_ptr->mcs_label);
+	}
+
 	node_flags = node_ptr->node_state & NODE_STATE_FLAGS;
 	node_ptr->node_state = NODE_STATE_ALLOCATED | node_flags;
 	xfree(node_ptr->reason);
@@ -3326,6 +3583,7 @@ static void _make_node_down(struct node_record *node_ptr, time_t event_time)
 	node_flags &= (~NODE_STATE_COMPLETING);
 	node_ptr->node_state = NODE_STATE_DOWN | node_flags;
 	node_ptr->owner = NO_VAL;
+	xfree(node_ptr->mcs_label);
 	bit_clear (avail_node_bitmap, inx);
 	bit_clear (cg_node_bitmap,    inx);
 	bit_set   (idle_node_bitmap,  inx);
@@ -3424,13 +3682,17 @@ void make_node_idle(struct node_record *node_ptr,
 	if (node_ptr->comp_job_cnt == 0) {
 		node_ptr->node_state &= (~NODE_STATE_COMPLETING);
 		bit_clear(cg_node_bitmap, inx);
-		if (IS_NODE_IDLE(node_ptr))
+		if (IS_NODE_IDLE(node_ptr)) {
 			node_ptr->owner = NO_VAL;
+			xfree(node_ptr->mcs_label);
+		}
 	}
 
 	if (job_ptr && job_ptr->details && (job_ptr->details->whole_node == 2)){
-		if (--node_ptr->owner_job_cnt == 0)
+		if (--node_ptr->owner_job_cnt == 0) {
 			node_ptr->owner = NO_VAL;
+			xfree(node_ptr->mcs_label);
+		}
 	}
 
 	node_flags = node_ptr->node_state & NODE_STATE_FLAGS;
@@ -3557,6 +3819,8 @@ extern int send_nodes_to_accounting(time_t event_time)
 /* node_fini - free all memory associated with node records */
 extern void node_fini (void)
 {
+	FREE_NULL_LIST(active_feature_list);
+	FREE_NULL_LIST(avail_feature_list);
 	FREE_NULL_BITMAP(avail_node_bitmap);
 	FREE_NULL_BITMAP(cg_node_bitmap);
 	FREE_NULL_BITMAP(idle_node_bitmap);
diff --git a/src/slurmctld/node_scheduler.c b/src/slurmctld/node_scheduler.c
index 026de5ff3..b77d99b59 100644
--- a/src/slurmctld/node_scheduler.c
+++ b/src/slurmctld/node_scheduler.c
@@ -4,7 +4,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2015 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov>
  *  CODE-OCEC-09-009. All rights reserved.
@@ -61,16 +61,19 @@
 #include "src/common/assoc_mgr.h"
 #include "src/common/gres.h"
 #include "src/common/hostlist.h"
+#include "src/common/layouts_mgr.h"
 #include "src/common/list.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/power.h"
 #include "src/common/slurm_accounting_storage.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_priority.h"
 #include "src/common/slurm_topology.h"
+#include "src/common/uid.h"
 #include "src/common/xassert.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
-#include "src/common/layouts_mgr.h"
 
 #include "src/slurmctld/acct_policy.h"
 #include "src/slurmctld/agent.h"
@@ -107,20 +110,27 @@ struct node_set {		/* set of nodes with same configuration */
 static int  _build_node_list(struct job_record *job_ptr,
 			     struct node_set **node_set_pptr,
 			     int *node_set_size, char **err_msg,
-			     bool test_only);
+			     bool test_only, bool can_reboot);
 static int  _fill_in_gres_fields(struct job_record *job_ptr);
-static void _filter_by_node_owner(struct job_record *job_ptr,
-				  bitstr_t *usable_node_mask);
 static void _filter_nodes_in_set(struct node_set *node_set_ptr,
 				 struct job_details *detail_ptr,
 				 char **err_msg);
 
 static bool _first_array_task(struct job_record *job_ptr);
 static void _launch_prolog(struct job_record *job_ptr);
-static int  _match_feature(char *seek, struct node_set *node_set_ptr);
+static void _log_node_set(uint32_t job_id, struct node_set *node_set_ptr,
+			  int node_set_size);
+static int  _match_feature(char *seek, struct node_set *node_set_ptr,
+			   bool can_reboot);
+static int  _match_feature2(char *seek, struct node_set *node_set_ptr,
+			    bitstr_t **inactive_bitmap);
+static int  _match_feature3(struct job_record *job_ptr,
+			    struct node_set *node_set_ptr,
+			    bitstr_t **inactive_bitmap);
 static int _nodes_in_sets(bitstr_t *req_bitmap,
 			  struct node_set * node_set_ptr,
 			  int node_set_size);
+static int _sort_node_set(const void *x, const void *y);
 static int _pick_best_nodes(struct node_set *node_set_ptr,
 			    int node_set_size, bitstr_t ** select_bitmap,
 			    struct job_record *job_ptr,
@@ -132,10 +142,11 @@ static int _pick_best_nodes(struct node_set *node_set_ptr,
 			    bitstr_t *exc_node_bitmap, bool resv_overlap);
 static void _set_err_msg(bool cpus_ok, bool mem_ok, bool disk_ok,
 			 bool job_mc_ok, char **err_msg);
-static bool _valid_feature_counts(struct job_details *detail_ptr,
+static bool _valid_feature_counts(struct job_record *job_ptr,
 				  bitstr_t *node_bitmap, bool *has_xor);
-static bitstr_t *_valid_features(struct job_details *detail_ptr,
-				 struct config_record *config_ptr);
+static bitstr_t *_valid_features(struct job_record *job_ptr,
+				 struct config_record *config_ptr,
+				 bool can_reboot);
 
 /*
  * _get_ntasks_per_core - Retrieve the value of ntasks_per_core from
@@ -363,7 +374,7 @@ static int _build_gres_alloc_string(struct job_record *job_ptr)
 		char *select_type = slurm_get_select_type();
 		/* Find out which select type plugin we have so we can decide
 		 * what value to look for. */
-		if (!strcmp(select_type, "select/cray"))
+		if (!xstrcmp(select_type, "select/cray"))
 			val_type = GRES_VAL_TYPE_CONFIG;
 		else
 			val_type = GRES_VAL_TYPE_ALLOC;
@@ -474,7 +485,7 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
 	trace_job(job_ptr, __func__, "");
 
 	if (select_serial == -1) {
-		if (strcmp(slurmctld_conf.select_type, "select/serial"))
+		if (xstrcmp(slurmctld_conf.select_type, "select/serial"))
 			select_serial = 0;
 		else
 			select_serial = 1;
@@ -624,18 +635,25 @@ extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
  * _match_feature - determine if the desired feature is one of those available
  * IN seek - desired feature
  * IN node_set_ptr - Pointer to node_set being searched
+ * IN can_reboot - if true node can use any available feature,
+ *	else job can use only active features
  * RET 1 if found, 0 otherwise
  */
-static int _match_feature(char *seek, struct node_set *node_set_ptr)
+static int _match_feature(char *seek, struct node_set *node_set_ptr,
+			  bool can_reboot)
 {
-	struct features_record *feat_ptr;
+	node_feature_t *feat_ptr;
 
 	if (seek == NULL)
 		return 1;	/* nothing to look for */
-
-	feat_ptr = list_find_first(feature_list, list_find_feature,
-				   (void *) seek);
-	if (feat_ptr == NULL)
+	if (can_reboot) {
+		feat_ptr = list_find_first(avail_feature_list,
+					   list_find_feature, (void *) seek);
+	} else {
+		feat_ptr = list_find_first(active_feature_list,
+					   list_find_feature, (void *) seek);
+	}
+	if ((feat_ptr == NULL) || (feat_ptr->node_bitmap == NULL))
 		return 0;	/* no such feature */
 
 	if (bit_super_set(node_set_ptr->my_bitmap, feat_ptr->node_bitmap))
@@ -643,6 +661,148 @@ static int _match_feature(char *seek, struct node_set *node_set_ptr)
 	return 0;
 }
 
+/*
+ * _match_feature2 - determine which of the desired features is now inactive
+ * IN seek - desired feature
+ * IN node_set_ptr - Pointer to node_set being searched
+ * OUT inactive_bitmap - Nodes with this as inactive feature
+ * RET 1 if some nodes with this inactive feature, 0 no such inactive feature
+ */
+static int _match_feature2(char *seek, struct node_set *node_set_ptr,
+			   bitstr_t **inactive_bitmap)
+{
+	node_feature_t *feat_ptr;
+
+	if ((seek == NULL) ||			/* nothing to look for */
+	    (node_features_g_count() == 0))	/* No inactive features */
+		return 0;
+
+	feat_ptr = list_find_first(active_feature_list, list_find_feature,
+				   (void *) seek);
+	if ((feat_ptr == NULL) || (feat_ptr->node_bitmap == NULL)) {
+		if (bit_set_count(node_set_ptr->my_bitmap) > 0) {
+			*inactive_bitmap = bit_copy(node_set_ptr->my_bitmap);
+			return 1;
+		}
+		return 0;
+	}
+
+	*inactive_bitmap = bit_copy(feat_ptr->node_bitmap);
+	bit_not(*inactive_bitmap);
+	bit_and(*inactive_bitmap, node_set_ptr->my_bitmap);
+	if (bit_set_count(*inactive_bitmap) != 0)
+		return 1;
+	FREE_NULL_BITMAP(*inactive_bitmap);
+	return 0;
+}
+
+/*
+ * _match_feature3 - determine which of the job features are now inactive
+ * IN job_ptr - job requesting resource allocation
+ * IN node_set_ptr - Pointer to node_set being searched
+ * OUT inactive_bitmap - Nodes with this as inactive feature
+ * RET 1 if some nodes with this inactive feature, 0 no such inactive feature
+ * NOTE: Currently supports only simple AND of features
+ */
+static int _match_feature3(struct job_record *job_ptr,
+			   struct node_set *node_set_ptr,
+			   bitstr_t **inactive_bitmap)
+{
+	struct job_details *details_ptr = job_ptr->details;
+	ListIterator feat_iter;
+	job_feature_t *job_feat_ptr;
+	node_feature_t *node_feat_ptr;
+	bitstr_t *tmp_bitmap = NULL;
+
+	if ((details_ptr->feature_list == NULL) ||   /* nothing to look for */
+	    (node_features_g_count() == 0))	/* No inactive features */
+		return 0;
+
+	feat_iter = list_iterator_create(details_ptr->feature_list);
+	while ((job_feat_ptr = (job_feature_t *) list_next(feat_iter))) {
+		node_feat_ptr = list_find_first(active_feature_list,
+						list_find_feature,
+						(void *)job_feat_ptr->name);
+		if ((node_feat_ptr == NULL) ||
+		    (node_feat_ptr->node_bitmap == NULL)) {
+			if (!tmp_bitmap)
+				tmp_bitmap = bit_alloc(node_record_count);
+			bit_nset(tmp_bitmap, 0, node_record_count - 1);
+		} else if (!tmp_bitmap) {
+			tmp_bitmap = bit_copy(node_feat_ptr->node_bitmap);
+			bit_not(tmp_bitmap);
+		} else {
+			bit_not(node_feat_ptr->node_bitmap);
+			bit_or(tmp_bitmap, node_feat_ptr->node_bitmap);
+			bit_not(node_feat_ptr->node_bitmap);
+		}
+	}
+	list_iterator_destroy(feat_iter);
+
+	*inactive_bitmap = tmp_bitmap;
+	if (tmp_bitmap)
+		return 1;
+	return 0;
+}
+
+/* For a given job, if the available nodes differ from those with currently
+ *	active features, return a bitmap of nodes with the job's required
+ *	features currently active
+ * IN job_ptr - job requesting resource allocation
+ * IN avail_bitmap - nodes currently available for this job
+ * OUT active_bitmap - nodes with job's features currently active, NULL if
+ *	identical to avail_bitmap
+ * NOTE: Currently supports only simple AND of features
+ */
+extern void build_active_feature_bitmap(struct job_record *job_ptr,
+					bitstr_t *avail_bitmap,
+					bitstr_t **active_bitmap)
+{
+	struct job_details *details_ptr = job_ptr->details;
+	ListIterator feat_iter;
+	job_feature_t *job_feat_ptr;
+	node_feature_t *node_feat_ptr;
+	bitstr_t *tmp_bitmap = NULL;
+
+	*active_bitmap = NULL;
+	if (details_ptr->feature_list == NULL)
+		return;	/* nothing to look for */
+
+	feat_iter = list_iterator_create(details_ptr->feature_list);
+	while ((job_feat_ptr = (job_feature_t *) list_next(feat_iter))) {
+		node_feat_ptr = list_find_first(active_feature_list,
+						list_find_feature,
+						(void *)job_feat_ptr->name);
+		if ((node_feat_ptr == NULL) ||
+		    (node_feat_ptr->node_bitmap == NULL)) {
+			if (!tmp_bitmap)
+				tmp_bitmap = bit_alloc(node_record_count);
+			bit_nset(tmp_bitmap, 0, node_record_count-1);
+			continue;
+		}
+		if (!tmp_bitmap) {
+			tmp_bitmap = bit_copy(node_feat_ptr->node_bitmap);
+			bit_not(tmp_bitmap);
+		} else {
+			bit_not(node_feat_ptr->node_bitmap);
+			bit_or(tmp_bitmap, node_feat_ptr->node_bitmap);
+			bit_not(node_feat_ptr->node_bitmap);
+		}
+	}
+	list_iterator_destroy(feat_iter);
+
+	if (tmp_bitmap) {
+		bit_not(tmp_bitmap);
+		if (bit_super_set(avail_bitmap, tmp_bitmap)) {
+			FREE_NULL_BITMAP(tmp_bitmap);
+		} else {
+			bit_and(tmp_bitmap, avail_bitmap);
+			*active_bitmap = tmp_bitmap;
+		}
+	}
+
+	return;
+}
 
 /*
  * Decide if a job can share nodes with other jobs based on the
@@ -737,8 +897,8 @@ _resolve_shared_status(struct job_record *job_ptr, uint16_t part_max_share,
  * job_ptr IN - Job to be scheduled
  * usable_node_mask IN/OUT - Nodes available for use by this job's user
  */
-static void _filter_by_node_owner(struct job_record *job_ptr,
-				  bitstr_t *usable_node_mask)
+extern void filter_by_node_owner(struct job_record *job_ptr,
+				 bitstr_t *usable_node_mask)
 {
 	ListIterator job_iterator;
 	struct job_record *job_ptr2;
@@ -777,6 +937,45 @@ static void _filter_by_node_owner(struct job_record *job_ptr,
 	}
 }
 
+/* Remove nodes from consideration for allocation based upon "mcs" by
+ * other users
+ * job_ptr IN - Job to be scheduled
+ * usable_node_mask IN/OUT - Nodes available for use by this job's mcs
+ */
+extern void filter_by_node_mcs(struct job_record *job_ptr, int mcs_select,
+			       bitstr_t *usable_node_mask)
+{
+	struct node_record *node_ptr;
+	int i;
+
+	if (mcs_select != 1)
+		return;
+
+	/* Need to filter out any nodes allocated with other mcs */
+	if (job_ptr->mcs_label != NULL) {
+		for (i = 0, node_ptr = node_record_table_ptr;
+		     i < node_record_count; i++, node_ptr++) {
+			/* if there is a mcs_label -> OK if it's the same */
+			if ((node_ptr->mcs_label != NULL) &&
+			     xstrcmp(node_ptr->mcs_label,job_ptr->mcs_label)) {
+				bit_clear(usable_node_mask, i);
+			}
+			/* if no mcs_label -> OK if no jobs running */
+			if ((node_ptr->mcs_label == NULL) &&
+			    (node_ptr->run_job_cnt != 0)) {
+				bit_clear(usable_node_mask, i);
+			}
+		}
+	} else {
+		for (i = 0, node_ptr = node_record_table_ptr;
+		     i < node_record_count;i++, node_ptr++) {
+			 if (node_ptr->mcs_label != NULL) {
+				bit_clear(usable_node_mask, i);
+			}
+		}
+	}
+}
+
 /*
  * If the job has required feature counts, then accumulate those
  * required resources using multiple calls to _pick_best_nodes()
@@ -787,16 +986,18 @@ static void _filter_by_node_owner(struct job_record *job_ptr,
  */
 static int
 _get_req_features(struct node_set *node_set_ptr, int node_set_size,
-		  bitstr_t ** select_bitmap, struct job_record *job_ptr,
+		  bitstr_t **select_bitmap, struct job_record *job_ptr,
 		  struct part_record *part_ptr,
 		  uint32_t min_nodes, uint32_t max_nodes, uint32_t req_nodes,
-		  bool test_only, List *preemptee_job_list)
+		  bool test_only, List *preemptee_job_list, bool can_reboot)
 {
 	uint32_t saved_min_nodes, saved_job_min_nodes;
 	bitstr_t *saved_req_node_bitmap = NULL;
+	bitstr_t *inactive_bitmap = NULL;
 	uint32_t saved_min_cpus, saved_req_nodes;
 	int rc, tmp_node_set_size;
-	struct node_set *tmp_node_set_ptr;
+	int mcs_select = 0;
+	struct node_set *tmp_node_set_ptr, *prev_node_set_ptr;
 	int error_code = SLURM_SUCCESS, i;
 	bitstr_t *feature_bitmap, *accumulate_bitmap = NULL;
 	bitstr_t *save_avail_node_bitmap = NULL, *resv_bitmap = NULL;
@@ -852,7 +1053,11 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 
 	if (!save_avail_node_bitmap)
 		save_avail_node_bitmap = bit_copy(avail_node_bitmap);
-	_filter_by_node_owner(job_ptr, avail_node_bitmap);
+	filter_by_node_owner(job_ptr, avail_node_bitmap);
+
+	/* get mcs_select */
+	mcs_select = slurm_mcs_get_select(job_ptr);
+	filter_by_node_mcs(job_ptr, mcs_select, avail_node_bitmap);
 
 	/* save job and request state */
 	saved_min_nodes = min_nodes;
@@ -867,7 +1072,7 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 	/* Don't mess with max_cpus here since it is only set (as of
 	 * 2.2 to be a limit and not user configurable. */
 	job_ptr->details->min_cpus = 1;
-	tmp_node_set_ptr = xmalloc(sizeof(struct node_set) * node_set_size);
+	tmp_node_set_ptr = xmalloc(sizeof(struct node_set) * node_set_size * 2);
 
 	/* Accumulate nodes with required feature counts.
 	 * Ignored if job_ptr->details->req_node_layout is set (by wiki2).
@@ -876,11 +1081,14 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 	if (job_ptr->details->feature_list &&
 	    (job_ptr->details->req_node_layout == NULL)) {
 		ListIterator feat_iter;
-		struct feature_record *feat_ptr;
+		job_feature_t *feat_ptr;
+		uint32_t smallest_min_mem = INFINITE;
+		uint32_t orig_req_mem = job_ptr->details->pn_min_memory;
+
 		feat_iter = list_iterator_create(
 				job_ptr->details->feature_list);
-		while ((feat_ptr = (struct feature_record *)
-				list_next(feat_iter))) {
+		while ((feat_ptr = (job_feature_t *) list_next(feat_iter))) {
+			bool sort_again = false;
 			if (feat_ptr->count == 0)
 				continue;
 			tmp_node_set_size = 0;
@@ -889,7 +1097,8 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 			 * purge it */
 			for (i = 0; i < node_set_size; i++) {
 				if (!_match_feature(feat_ptr->name,
-						    node_set_ptr+i))
+						    node_set_ptr+i,
+						    can_reboot))
 					continue;
 				tmp_node_set_ptr[tmp_node_set_size].
 					cpus_per_node =
@@ -908,7 +1117,52 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 					bit_copy(node_set_ptr[i].feature_bits);
 				tmp_node_set_ptr[tmp_node_set_size].my_bitmap =
 					bit_copy(node_set_ptr[i].my_bitmap);
+				prev_node_set_ptr = tmp_node_set_ptr +
+						    tmp_node_set_size;
 				tmp_node_set_size++;
+
+				if (test_only || !can_reboot ||
+				    (prev_node_set_ptr->weight == INFINITE))
+					continue;
+				if (!_match_feature2(feat_ptr->name,
+						     node_set_ptr+i,
+						     &inactive_bitmap))
+					continue;
+				sort_again = true;
+				if (bit_equal(prev_node_set_ptr->my_bitmap,
+					      inactive_bitmap)) {
+					prev_node_set_ptr->weight = INFINITE;
+					continue;
+				}
+				tmp_node_set_ptr[tmp_node_set_size].
+					cpus_per_node =
+					node_set_ptr[i].cpus_per_node;
+				tmp_node_set_ptr[tmp_node_set_size].
+					real_memory =
+					node_set_ptr[i].real_memory;
+				tmp_node_set_ptr[tmp_node_set_size].weight =
+					INFINITE;
+				tmp_node_set_ptr[tmp_node_set_size].features =
+					xstrdup(node_set_ptr[i].features);
+				tmp_node_set_ptr[tmp_node_set_size].
+					feature_bits =
+					bit_copy(node_set_ptr[i].feature_bits);
+				tmp_node_set_ptr[tmp_node_set_size].my_bitmap =
+					bit_copy(tmp_node_set_ptr
+					[tmp_node_set_size-1].my_bitmap);
+				bit_and(tmp_node_set_ptr[tmp_node_set_size].
+					my_bitmap, inactive_bitmap);
+				tmp_node_set_ptr[tmp_node_set_size].nodes =
+					bit_set_count(tmp_node_set_ptr
+					[tmp_node_set_size].my_bitmap);
+				bit_not(inactive_bitmap);
+				bit_and(tmp_node_set_ptr[tmp_node_set_size-1].
+					my_bitmap, inactive_bitmap);
+				tmp_node_set_ptr[tmp_node_set_size-1].nodes =
+					bit_set_count(tmp_node_set_ptr
+					[tmp_node_set_size-1].my_bitmap);
+				tmp_node_set_size++;
+				FREE_NULL_BITMAP(inactive_bitmap);
 			}
 			feature_bitmap = NULL;
 			min_nodes = feat_ptr->count;
@@ -916,6 +1170,11 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 			job_ptr->details->min_nodes = feat_ptr->count;
 			job_ptr->details->min_cpus = feat_ptr->count;
 			FREE_NULL_LIST(*preemptee_job_list);
+			job_ptr->details->pn_min_memory = orig_req_mem;
+			if (sort_again) {
+				qsort(tmp_node_set_ptr, tmp_node_set_size,
+				      sizeof(struct node_set), _sort_node_set);
+			}
 			error_code = _pick_best_nodes(tmp_node_set_ptr,
 					tmp_node_set_size, &feature_bitmap,
 					job_ptr, part_ptr, min_nodes,
@@ -923,6 +1182,15 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 					preemptee_candidates,
 					preemptee_job_list, false,
 					exc_core_bitmap, resv_overlap);
+			if (job_ptr->details->pn_min_memory) {
+				if (job_ptr->details->pn_min_memory <
+				    smallest_min_mem)
+					smallest_min_mem =
+						job_ptr->details->pn_min_memory;
+				else
+					job_ptr->details->pn_min_memory =
+						smallest_min_mem;
+			}
 #if 0
 {
 			char *tmp_str = bitmap2node_name(feature_bitmap);
@@ -1034,13 +1302,13 @@ _get_req_features(struct node_set *node_set_ptr, int node_set_size,
 	 *                           reservations are blocking
 	 */
 	if (error_code != SLURM_SUCCESS) {
-		debug3("powercapping: checking job %u : skipped, not eligible",
+		debug5("powercapping: checking job %u : skipped, not eligible",
 		       job_ptr->job_id);
 	} else if ((powercap = powercap_get_cluster_current_cap()) == 0) {
-		debug3("powercapping: checking job %u : skipped, capping "
+		debug5("powercapping: checking job %u : skipped, capping "
 		       "disabled", job_ptr->job_id);
 	} else if ((layout_power = which_power_layout()) == 0) {
-		debug3("powercapping disabled %d", which_power_layout());
+		debug5("powercapping disabled %d", which_power_layout());
 	} else if (!power_layout_ready()){
 		debug3("powercapping:checking job %u : skipped, problems with"
 		       "layouts, capping disabled", job_ptr->job_id);
@@ -1270,6 +1538,24 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 	int shared = 0, select_mode;
 	List preemptee_cand;
 
+	/* Since you could potentially have multiple features and the
+	 * job might not request memory we need to keep track of a minimum
+	 * from the selected features.  This is to fulfill commit
+	 * 700e7b1d4e9.
+	 * If no memory is requested but we are running with
+	 * CR_*_MEMORY and the request is for
+	 * nodes of different memory sizes we need to reset the
+	 * pn_min_memory as select_g_job_test can
+	 * alter that making it so the order of contraints
+	 * matter since the first pass through this will set the
+	 * pn_min_memory based on that first constraint and if
+	 * it isn't smaller than all the other requests they
+	 * will fail.  We have to keep track of the
+	 * memory for accounting, these next 2 variables do this for us.
+	 */
+	uint32_t smallest_min_mem = INFINITE;
+	uint32_t orig_req_mem = job_ptr->details->pn_min_memory;
+
 	if (test_only)
 		select_mode = SELECT_MODE_TEST_ONLY;
 	else
@@ -1445,6 +1731,18 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 						node_set_ptr[i].my_bitmap);
 			}
 
+			if (node_set_ptr[i].weight == INFINITE) {
+				/* Node reboot required */
+				count1 = bit_set_count(node_set_ptr[i].
+						       my_bitmap);
+				bit_and(node_set_ptr[i].my_bitmap,
+					idle_node_bitmap);
+				count2 = bit_set_count(node_set_ptr[i].
+						       my_bitmap);
+				if (count1 != count2)
+					nodes_busy = true;
+			}
+
 			bit_and(node_set_ptr[i].my_bitmap, avail_node_bitmap);
 			if (!nodes_busy) {
 				count1 = bit_set_count(node_set_ptr[i].
@@ -1520,6 +1818,8 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 				preemptee_cand = NULL;
 			else
 				preemptee_cand = preemptee_candidates;
+
+			job_ptr->details->pn_min_memory = orig_req_mem;
 			pick_code = select_g_job_test(job_ptr,
 						      avail_bitmap,
 						      min_nodes,
@@ -1529,6 +1829,16 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 						      preemptee_cand,
 						      preemptee_job_list,
 						      exc_core_bitmap);
+			if (job_ptr->details->pn_min_memory) {
+				if (job_ptr->details->pn_min_memory <
+				    smallest_min_mem)
+					smallest_min_mem =
+						job_ptr->details->pn_min_memory;
+				else
+					job_ptr->details->pn_min_memory =
+						smallest_min_mem;
+			}
+
 #if 0
 {
 			char *tmp_str1 = bitmap2node_name(backup_bitmap);
@@ -1567,6 +1877,7 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 		     bit_super_set(job_ptr->details->req_node_bitmap,
 				   avail_bitmap))) {
 			FREE_NULL_LIST(*preemptee_job_list);
+			job_ptr->details->pn_min_memory = orig_req_mem;
 			pick_code = select_g_job_test(job_ptr, avail_bitmap,
 						      min_nodes, max_nodes,
 						      req_nodes,
@@ -1574,6 +1885,17 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 						      preemptee_candidates,
 						      preemptee_job_list,
 						      exc_core_bitmap);
+
+			if (job_ptr->details->pn_min_memory) {
+				if (job_ptr->details->pn_min_memory <
+				    smallest_min_mem)
+					smallest_min_mem =
+						job_ptr->details->pn_min_memory;
+				else
+					job_ptr->details->pn_min_memory =
+						smallest_min_mem;
+			}
+
 			if ((pick_code == SLURM_SUCCESS) &&
 			     (bit_set_count(avail_bitmap) <= max_nodes)) {
 				FREE_NULL_BITMAP(total_bitmap);
@@ -1598,6 +1920,7 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 				FREE_NULL_BITMAP(avail_bitmap);
 				avail_bitmap = bit_copy(total_bitmap);
 				bit_and(avail_bitmap, avail_node_bitmap);
+				job_ptr->details->pn_min_memory = orig_req_mem;
 				pick_code = select_g_job_test(job_ptr,
 						avail_bitmap,
 						min_nodes,
@@ -1606,6 +1929,19 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 						SELECT_MODE_TEST_ONLY,
 						preemptee_candidates, NULL,
 						exc_core_bitmap);
+
+				if (job_ptr->details->pn_min_memory) {
+					if (job_ptr->details->pn_min_memory <
+					    smallest_min_mem)
+						smallest_min_mem =
+							job_ptr->details->
+							pn_min_memory;
+					else
+						job_ptr->details->
+							pn_min_memory =
+							smallest_min_mem;
+				}
+
 				if (pick_code == SLURM_SUCCESS) {
 					runable_ever  = true;
 					if (bit_set_count(avail_bitmap) <=
@@ -1617,6 +1953,7 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 				}
 			}
 			if (!runable_ever) {
+				job_ptr->details->pn_min_memory = orig_req_mem;
 				pick_code = select_g_job_test(job_ptr,
 						total_bitmap,
 						min_nodes,
@@ -1625,6 +1962,19 @@ _pick_best_nodes(struct node_set *node_set_ptr, int node_set_size,
 						SELECT_MODE_TEST_ONLY,
 						preemptee_candidates, NULL,
 						exc_core_bitmap);
+
+				if (job_ptr->details->pn_min_memory) {
+					if (job_ptr->details->pn_min_memory <
+					    smallest_min_mem)
+						smallest_min_mem =
+							job_ptr->details->
+							pn_min_memory;
+					else
+						job_ptr->details->
+							pn_min_memory =
+							smallest_min_mem;
+				}
+
 				if (pick_code == SLURM_SUCCESS) {
 					FREE_NULL_BITMAP(possible_bitmap);
 					possible_bitmap = total_bitmap;
@@ -1717,7 +2067,7 @@ static void _preempt_jobs(List preemptee_job_list, bool kill_pending,
 				     job_ptr->job_id);
 			}
 		} else if ((mode == PREEMPT_MODE_SUSPEND) &&
-			   (slurm_get_preempt_mode() & PREEMPT_MODE_GANG)) {
+			   (slurmctld_conf.preempt_mode & PREEMPT_MODE_GANG)) {
 			debug("preempted job %u suspended by gang scheduler",
 			      job_ptr->job_id);
 		} else if (mode == PREEMPT_MODE_OFF) {
@@ -1811,6 +2161,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 	slurmdb_assoc_rec_t *assoc_ptr = NULL;
 	uint32_t selected_node_cnt = NO_VAL;
 	uint64_t tres_req_cnt[slurmctld_tres_cnt];
+	bool can_reboot;
 
 	xassert(job_ptr);
 	xassert(job_ptr->magic == JOB_MAGIC);
@@ -1865,10 +2216,17 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 	}
 
 	/* build sets of usable nodes based upon their configuration */
+	can_reboot = node_features_g_user_update(job_ptr->user_id);
 	error_code = _build_node_list(job_ptr, &node_set_ptr, &node_set_size,
-				      err_msg, test_only);
+				      err_msg, test_only, can_reboot);
 	if (error_code)
 		return error_code;
+	if (node_set_ptr == NULL)	/* Should never be true */
+		return ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE;
+
+	qsort(node_set_ptr, node_set_size, sizeof(struct node_set),
+	      _sort_node_set);
+	_log_node_set(job_ptr->job_id, node_set_ptr, node_set_size);
 
 	/* insure that selected nodes are in these node sets */
 	if (job_ptr->details->req_node_bitmap) {
@@ -1940,7 +2298,7 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 					       &select_bitmap, job_ptr,
 					       part_ptr, min_nodes, max_nodes,
 					       req_nodes, test_only,
-					       &preemptee_job_list);
+					       &preemptee_job_list, can_reboot);
 	}
 
 
@@ -2176,14 +2534,13 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 	if (nonstop_ops.job_begin)
 		(nonstop_ops.job_begin)(job_ptr);
 
-	if (configuring
-	    || bit_overlap(job_ptr->node_bitmap, power_node_bitmap))
-		job_ptr->job_state |= JOB_CONFIGURING;
 	if (select_g_select_nodeinfo_set(job_ptr) != SLURM_SUCCESS) {
 		error("select_g_select_nodeinfo_set(%u): %m", job_ptr->job_id);
 		/* not critical ... by now */
 	}
-	if ((job_ptr->mail_type & MAIL_JOB_BEGIN) && _first_array_task(job_ptr))
+	if ((job_ptr->mail_type & MAIL_JOB_BEGIN) &&
+	    ((job_ptr->mail_type & MAIL_ARRAY_TASKS) ||
+	     _first_array_task(job_ptr)))
 		mail_job_info(job_ptr, MAIL_JOB_BEGIN);
 
 	slurmctld_diag_stats.jobs_started++;
@@ -2215,6 +2572,12 @@ extern int select_nodes(struct job_record *job_ptr, bool test_only,
 	slurm_sched_g_newalloc(job_ptr);
 	power_g_job_start(job_ptr);
 
+	if (configuring ||
+	    bit_overlap(job_ptr->node_bitmap, power_node_bitmap) ||
+	    !bit_super_set(job_ptr->node_bitmap, avail_node_bitmap)) {
+		job_ptr->job_state |= JOB_CONFIGURING;
+}
+
 	/* Request asynchronous launch of a prolog for a
 	 * non batch job. */
 	if ((slurmctld_conf.prolog_flags & PROLOG_FLAG_ALLOC) ||
@@ -2284,6 +2647,7 @@ static void _launch_prolog(struct job_record *job_ptr)
 	prolog_msg_ptr->job_id = job_ptr->job_id;
 	prolog_msg_ptr->uid = job_ptr->user_id;
 	prolog_msg_ptr->gid = job_ptr->group_id;
+	prolog_msg_ptr->user_name = uid_to_string(job_ptr->user_id);
 	prolog_msg_ptr->alias_list = xstrdup(job_ptr->alias_list);
 	prolog_msg_ptr->nodes = xstrdup(job_ptr->nodes);
 	prolog_msg_ptr->partition = xstrdup(job_ptr->partition);
@@ -2451,13 +2815,13 @@ static int _fill_in_gres_fields(struct job_record *job_ptr)
  */
 extern int list_find_feature(void *feature_entry, void *key)
 {
-	struct features_record *feature_ptr;
+	node_feature_t *feature_ptr;
 
 	if (key == NULL)
 		return 1;
 
-	feature_ptr = (struct features_record *) feature_entry;
-	if (strcmp(feature_ptr->name, (char *) key) == 0)
+	feature_ptr = (node_feature_t *) feature_entry;
+	if (xstrcmp(feature_ptr->name, (char *) key) == 0)
 		return 1;
 	return 0;
 }
@@ -2465,16 +2829,18 @@ extern int list_find_feature(void *feature_entry, void *key)
 /*
  * _valid_feature_counts - validate a job's features can be satisfied
  *	by the selected nodes (NOTE: does not process XOR or XAND operators)
- * IN detail_ptr - job details
+ * IN job_ptr - job to operate on
  * IN/OUT node_bitmap - nodes available for use, clear if unusable
  * RET true if valid, false otherwise
  */
-static bool _valid_feature_counts(struct job_details *detail_ptr,
+static bool _valid_feature_counts(struct job_record *job_ptr,
 				  bitstr_t *node_bitmap, bool *has_xor)
 {
+	struct job_details *detail_ptr = job_ptr->details;
+	List feature_list;
 	ListIterator job_feat_iter;
-	struct feature_record *job_feat_ptr;
-	struct features_record *feat_ptr;
+	job_feature_t *job_feat_ptr;
+	node_feature_t *node_feat_ptr;
 	int have_count = false, last_op = FEATURE_OP_AND;
 	bitstr_t *feature_bitmap, *tmp_bitmap;
 	bool rc = true;
@@ -2487,20 +2853,28 @@ static bool _valid_feature_counts(struct job_details *detail_ptr,
 	if (detail_ptr->feature_list == NULL)	/* no constraints */
 		return rc;
 
+	if (node_features_g_user_update(job_ptr->user_id))
+		feature_list = avail_feature_list;
+	else
+		feature_list = active_feature_list;
+
 	feature_bitmap = bit_copy(node_bitmap);
 	job_feat_iter = list_iterator_create(detail_ptr->feature_list);
-	while ((job_feat_ptr = (struct feature_record *)
-			list_next(job_feat_iter))) {
-		feat_ptr = list_find_first(feature_list, list_find_feature,
-					   (void *) job_feat_ptr->name);
-		if (feat_ptr) {
-			if (last_op == FEATURE_OP_AND)
-				bit_and(feature_bitmap, feat_ptr->node_bitmap);
-			else if (last_op == FEATURE_OP_OR)
-				bit_or(feature_bitmap, feat_ptr->node_bitmap);
-			else {	/* FEATURE_OP_XOR or FEATURE_OP_XAND */
+	while ((job_feat_ptr = (job_feature_t *) list_next(job_feat_iter))) {
+		node_feat_ptr = list_find_first(feature_list,
+					list_find_feature,
+					(void *) job_feat_ptr->name);
+		if (node_feat_ptr) {
+			if (last_op == FEATURE_OP_AND) {
+				bit_and(feature_bitmap,
+					node_feat_ptr->node_bitmap);
+			} else if (last_op == FEATURE_OP_OR) {
+				bit_or(feature_bitmap,
+				       node_feat_ptr->node_bitmap);
+			} else {	/* FEATURE_OP_XOR or FEATURE_OP_XAND */
 				*has_xor = true;
-				bit_or(feature_bitmap, feat_ptr->node_bitmap);
+				bit_or(feature_bitmap,
+				       node_feat_ptr->node_bitmap);
 			}
 		} else {	/* feature not found */
 			if (last_op == FEATURE_OP_AND) {
@@ -2517,19 +2891,19 @@ static bool _valid_feature_counts(struct job_details *detail_ptr,
 	if (have_count) {
 		job_feat_iter = list_iterator_create(detail_ptr->
 						     feature_list);
-		while ((job_feat_ptr = (struct feature_record *)
+		while ((job_feat_ptr = (job_feature_t *)
 				list_next(job_feat_iter))) {
 			if (job_feat_ptr->count == 0)
 				continue;
-			feat_ptr = list_find_first(feature_list,
-						   list_find_feature,
-						   (void *)job_feat_ptr->name);
-			if (!feat_ptr) {
+			node_feat_ptr = list_find_first(feature_list,
+						list_find_feature,
+						(void *)job_feat_ptr->name);
+			if (!node_feat_ptr) {
 				rc = false;
 				break;
 			}
 			tmp_bitmap = bit_copy(feature_bitmap);
-			bit_and(tmp_bitmap, feat_ptr->node_bitmap);
+			bit_and(tmp_bitmap, node_feat_ptr->node_bitmap);
 			if (bit_set_count(tmp_bitmap) < job_feat_ptr->count)
 				rc = false;
 			FREE_NULL_BITMAP(tmp_bitmap);
@@ -2557,7 +2931,7 @@ static bool _valid_feature_counts(struct job_details *detail_ptr,
  * RET SLURM_SUCCESS or EINVAL if can't filter (exclusive OR of features)
  */
 extern int job_req_node_filter(struct job_record *job_ptr,
-			       bitstr_t *avail_bitmap)
+			       bitstr_t *avail_bitmap, bool test_only)
 {
 	int i;
 	struct job_details *detail_ptr = job_ptr->details;
@@ -2573,7 +2947,7 @@ extern int job_req_node_filter(struct job_record *job_ptr,
 	}
 
 	mc_ptr = detail_ptr->mc_ptr;
-	for (i=0; i< node_record_count; i++) {
+	for (i = 0; i < node_record_count; i++) {
 		if (!bit_test(avail_bitmap, i))
 			continue;
 		node_ptr = node_record_table_ptr + i;
@@ -2627,7 +3001,7 @@ extern int job_req_node_filter(struct job_record *job_ptr,
 		}
 	}
 
-	if (!_valid_feature_counts(detail_ptr, avail_bitmap, &has_xor))
+	if (!_valid_feature_counts(job_ptr, avail_bitmap, &has_xor))
 		return EINVAL;
 
 	return SLURM_SUCCESS;
@@ -2662,26 +3036,34 @@ static int _no_reg_nodes(void)
  * OUT node_set_size - number of node_set entries
  * OUT err_msg - error message for job, caller must xfree
  * IN  test_only - true if only testing if job can be started at some point
+ * IN can_reboot - if true node can use any available feature,
+ *     else job can use only active features
  * RET error code
  */
 static int _build_node_list(struct job_record *job_ptr,
 			    struct node_set **node_set_pptr,
-			    int *node_set_size, char **err_msg, bool test_only)
+			    int *node_set_size, char **err_msg, bool test_only,
+			    bool can_reboot)
 {
-	int adj_cpus, i, node_set_inx, power_cnt, rc;
-	struct node_set *node_set_ptr;
+	int adj_cpus, i, node_set_inx, node_set_len, power_cnt, rc;
+	struct node_set *node_set_ptr, *prev_node_set_ptr;
 	struct config_record *config_ptr;
 	struct part_record *part_ptr = job_ptr->part_ptr;
 	ListIterator config_iterator;
 	int check_node_config;
 	struct job_details *detail_ptr = job_ptr->details;
 	bitstr_t *power_up_bitmap = NULL, *usable_node_mask = NULL;
+	bitstr_t *inactive_bitmap = NULL;
 	multi_core_data_t *mc_ptr = detail_ptr->mc_ptr;
 	bitstr_t *tmp_feature;
-	uint32_t max_weight = 0;
 	bool has_xor = false;
 	bool resv_overlap = false;
 
+	if ((job_ptr->details->min_nodes == 0) &&
+	    (job_ptr->details->max_nodes == 0)) {
+		return ESLURM_INVALID_NODE_COUNT;
+	}
+
 	if (job_ptr->resv_name) {
 		/* Limit node selection to those in selected reservation */
 		time_t start_res = time(NULL);
@@ -2716,18 +3098,8 @@ static int _build_node_list(struct job_record *job_ptr,
 			return ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE;
 		}
 	}
-	if ((job_ptr->details->min_nodes == 0) &&
-	    (job_ptr->details->max_nodes == 0)) {
-		FREE_NULL_BITMAP(usable_node_mask);
-		*node_set_pptr = NULL;
-		*node_set_size = 0;
-		return SLURM_SUCCESS;
-	}
 
-	node_set_inx = 0;
-	node_set_ptr = (struct node_set *)
-			xmalloc(sizeof(struct node_set) * 2);
-	node_set_ptr[node_set_inx+1].my_bitmap = NULL;
+
 	if (detail_ptr->exc_node_bitmap) {
 		if (usable_node_mask) {
 			bit_not(detail_ptr->exc_node_bitmap);
@@ -2743,7 +3115,7 @@ static int _build_node_list(struct job_record *job_ptr,
 		bit_nset(usable_node_mask, 0, (node_record_count - 1));
 	}
 
-	if (!_valid_feature_counts(detail_ptr, usable_node_mask, &has_xor)) {
+	if (!_valid_feature_counts(job_ptr, usable_node_mask, &has_xor)) {
 		info("No job %u feature requirements can not be met",
 		     job_ptr->job_id);
 		FREE_NULL_BITMAP(usable_node_mask);
@@ -2755,8 +3127,11 @@ static int _build_node_list(struct job_record *job_ptr,
 		return ESLURM_REQUESTED_NODE_CONFIG_UNAVAILABLE;
 	}
 
+	node_set_inx = 0;
+	node_set_len = list_count(config_list) * 4 + 1;
+	node_set_ptr = (struct node_set *)
+			xmalloc(sizeof(struct node_set) * node_set_len);
 	config_iterator = list_iterator_create(config_list);
-
 	while ((config_ptr = (struct config_record *)
 			list_next(config_iterator))) {
 		bool cpus_ok = false, mem_ok = false, disk_ok = false;
@@ -2819,8 +3194,8 @@ static int _build_node_list(struct job_record *job_ptr,
 		}
 
 		if (has_xor) {
-			tmp_feature = _valid_features(job_ptr->details,
-						      config_ptr);
+			tmp_feature = _valid_features(job_ptr, config_ptr,
+						      can_reboot);
 			if (tmp_feature == NULL) {
 				FREE_NULL_BITMAP(node_set_ptr[node_set_inx].
 						 my_bitmap);
@@ -2837,22 +3212,57 @@ static int _build_node_list(struct job_record *job_ptr,
 			config_ptr->cpus;
 		node_set_ptr[node_set_inx].real_memory =
 			config_ptr->real_memory;
-		node_set_ptr[node_set_inx].weight =
-			config_ptr->weight;
-		max_weight = MAX(max_weight, config_ptr->weight);
+		node_set_ptr[node_set_inx].weight = config_ptr->weight;
 		node_set_ptr[node_set_inx].features =
 			xstrdup(config_ptr->feature);
 		node_set_ptr[node_set_inx].feature_bits = tmp_feature;
 		debug2("found %d usable nodes from config containing %s",
 		       node_set_ptr[node_set_inx].nodes, config_ptr->nodes);
+		prev_node_set_ptr = node_set_ptr + node_set_inx;
+		node_set_inx++;
+		if (node_set_inx >= node_set_len) {
+			error("%s: node_set buffer filled", __func__);
+			break;
+		}
+		if (test_only || !can_reboot)
+			continue;
+		if (!_match_feature3(job_ptr, prev_node_set_ptr,
+				     &inactive_bitmap))
+			continue;
 
+		if (bit_equal(prev_node_set_ptr->my_bitmap, inactive_bitmap)) {
+			/* All nodes require reboot, just change weight */
+			prev_node_set_ptr->weight = INFINITE;
+			FREE_NULL_BITMAP(inactive_bitmap);
+			continue;
+		}
+		/* Split the node set record in two:
+		 * one set to reboot, one set available now */
+		node_set_ptr[node_set_inx].cpus_per_node = config_ptr->cpus;
+		node_set_ptr[node_set_inx].features =
+			xstrdup(config_ptr->feature);
+		node_set_ptr[node_set_inx].feature_bits = bit_copy(tmp_feature);
+		node_set_ptr[node_set_inx].my_bitmap =
+			bit_copy(node_set_ptr[node_set_inx-1].my_bitmap);
+		bit_and(node_set_ptr[node_set_inx].my_bitmap, inactive_bitmap);
+		node_set_ptr[node_set_inx].nodes = bit_set_count(
+			node_set_ptr[node_set_inx].my_bitmap);
+		node_set_ptr[node_set_inx].real_memory =
+			config_ptr->real_memory;
+		node_set_ptr[node_set_inx].weight = INFINITE;
+		bit_not(inactive_bitmap);
+		bit_and(node_set_ptr[node_set_inx-1].my_bitmap,inactive_bitmap);
+		node_set_ptr[node_set_inx-1].nodes -= bit_set_count(
+			node_set_ptr[node_set_inx-1].my_bitmap);
+		FREE_NULL_BITMAP(inactive_bitmap);
 		node_set_inx++;
-		xrealloc(node_set_ptr,
-			 sizeof(struct node_set) * (node_set_inx + 2));
-		node_set_ptr[node_set_inx + 1].my_bitmap = NULL;
+		if (node_set_inx >= node_set_len) {
+			error("%s: node_set buffer filled", __func__);
+			break;
+		}
 	}
 	list_iterator_destroy(config_iterator);
-	/* eliminate last (incomplete) node_set record */
+	/* eliminate any incomplete node_set record */
 	xfree(node_set_ptr[node_set_inx].features);
 	FREE_NULL_BITMAP(node_set_ptr[node_set_inx].my_bitmap);
 	FREE_NULL_BITMAP(node_set_ptr[node_set_inx].feature_bits);
@@ -2890,7 +3300,8 @@ static int _build_node_list(struct job_record *job_ptr,
 		if (power_cnt == 0)
 			continue;	/* no nodes powered down */
 		if (power_cnt == node_set_ptr[i].nodes) {
-			node_set_ptr[i].weight += max_weight;	/* avoid all */
+			if (node_set_ptr[i].weight != INFINITE)
+				node_set_ptr[i].weight = INFINITE;
 			continue;	/* all nodes powered down */
 		}
 
@@ -2901,8 +3312,9 @@ static int _build_node_list(struct job_record *job_ptr,
 			node_set_ptr[i].real_memory;
 		node_set_ptr[node_set_inx].nodes = power_cnt;
 		node_set_ptr[i].nodes -= power_cnt;
-		node_set_ptr[node_set_inx].weight =
-			node_set_ptr[i].weight + max_weight;
+		node_set_ptr[node_set_inx].weight = node_set_ptr[i].weight;
+		if (node_set_ptr[node_set_inx].weight != INFINITE)
+			node_set_ptr[node_set_inx].weight = INFINITE;
 		node_set_ptr[node_set_inx].features =
 			xstrdup(node_set_ptr[i].features);
 		node_set_ptr[node_set_inx].feature_bits =
@@ -2918,9 +3330,10 @@ static int _build_node_list(struct job_record *job_ptr,
 		bit_and(node_set_ptr[i].my_bitmap, power_up_bitmap);
 
 		node_set_inx++;
-		xrealloc(node_set_ptr,
-			 sizeof(struct node_set) * (node_set_inx + 2));
-		node_set_ptr[node_set_inx + 1].my_bitmap = NULL;
+		if (node_set_inx >= node_set_len) {
+			error("%s: node_set buffer filled", __func__);
+			break;
+		}
 	}
 	FREE_NULL_BITMAP(power_up_bitmap);
 
@@ -2929,6 +3342,36 @@ static int _build_node_list(struct job_record *job_ptr,
 	return SLURM_SUCCESS;
 }
 
+static int _sort_node_set(const void *x, const void *y)
+{
+	struct node_set *node_set_ptr1 = (struct node_set *) x;
+	struct node_set *node_set_ptr2 = (struct node_set *) y;
+
+	if (node_set_ptr1->weight < node_set_ptr2->weight)
+		return -1;
+	if (node_set_ptr1->weight > node_set_ptr2->weight)
+		return 1;
+	return 0;
+}
+
+static void _log_node_set(uint32_t job_id, struct node_set *node_set_ptr,
+			  int node_set_size)
+{
+/* Used for debugging purposes only */
+#if 0
+	char *node_list;
+	int i;
+
+	info("NodeSet for job %u", job_id);
+	for (i = 0; i < node_set_size; i++) {
+		node_list = bitmap2node_name(node_set_ptr[i].my_bitmap);
+		info("NodeSet[%d] Nodes:%s Weight:%u", i, node_list,
+		     node_set_ptr[i].weight);
+		xfree(node_list);
+	}
+#endif
+}
+
 static void _set_err_msg(bool cpus_ok, bool mem_ok, bool disk_ok,
 			 bool job_mc_ok, char **err_msg)
 {
@@ -3138,8 +3581,10 @@ extern void build_node_details(struct job_record *job_ptr, bool new_alloc)
 /*
  * _valid_features - Determine if the requested features are satisfied by
  *	the available nodes. This is only used for XOR operators.
- * IN details_ptr - job requirement details, includes requested features
+ * IN job_ptr - job being scheduled
  * IN config_ptr - node's configuration record
+ * IN can_reboot - if true node can use any available feature,
+ *	else job can use only active features
  * RET NULL if request is not satisfied, otherwise a bitmap indicating
  *	which mutually exclusive features are satisfied. For example
  *	_valid_features("[fs1|fs2|fs3|fs4]", "fs3") returns a bitmap with
@@ -3149,14 +3594,17 @@ extern void build_node_details(struct job_record *job_ptr, bool new_alloc)
  *	with the first bit set if requirements are satisfied without a
  *	mutually exclusive feature list.
  */
-static bitstr_t *_valid_features(struct job_details *details_ptr,
-				 struct config_record *config_ptr)
+static bitstr_t *_valid_features(struct job_record *job_ptr,
+				 struct config_record *config_ptr,
+				 bool can_reboot)
 {
+	struct job_details *details_ptr = job_ptr->details;
 	bitstr_t *result_bits = (bitstr_t *) NULL;
 	ListIterator feat_iter;
-	struct feature_record *job_feat_ptr;
-	struct features_record *feat_ptr;
+	job_feature_t *job_feat_ptr;
+	node_feature_t *node_feat_ptr;
 	int last_op = FEATURE_OP_AND, position = 0;
+	List feature_list;
 
 	result_bits = bit_alloc(MAX_FEATURES);
 	if (details_ptr->feature_list == NULL) {	/* no constraints */
@@ -3164,19 +3612,23 @@ static bitstr_t *_valid_features(struct job_details *details_ptr,
 		return result_bits;
 	}
 
+	if (can_reboot)
+		feature_list = avail_feature_list;
+	else
+		feature_list = active_feature_list;
+
 	feat_iter = list_iterator_create(details_ptr->feature_list);
-	while ((job_feat_ptr = (struct feature_record *)
-			list_next(feat_iter))) {
+	while ((job_feat_ptr = (job_feature_t *) list_next(feat_iter))) {
 		if ((job_feat_ptr->op_code == FEATURE_OP_XAND) ||
 		    (job_feat_ptr->op_code == FEATURE_OP_XOR)  ||
 		    (last_op == FEATURE_OP_XAND) ||
 		    (last_op == FEATURE_OP_XOR)) {
-			feat_ptr = list_find_first(feature_list,
+			node_feat_ptr = list_find_first(feature_list,
 						   list_find_feature,
 						   (void *)job_feat_ptr->name);
-			if (feat_ptr &&
+			if (node_feat_ptr &&
 			    bit_super_set(config_ptr->node_bitmap,
-					  feat_ptr->node_bitmap)) {
+					  node_feat_ptr->node_bitmap)) {
 				bit_set(result_bits, position);
 			}
 			position++;
diff --git a/src/slurmctld/node_scheduler.h b/src/slurmctld/node_scheduler.h
index 58e24e9e5..bcc4586a6 100644
--- a/src/slurmctld/node_scheduler.h
+++ b/src/slurmctld/node_scheduler.h
@@ -47,6 +47,19 @@
  */
 extern void allocate_nodes(struct job_record *job_ptr);
 
+/* For a given job, if the available nodes differ from those with currently
+ *	active features, return a bitmap of nodes with the job's required
+ *	features currently active
+ * IN job_ptr - job requesting resource allocation
+ * IN avail_bitmap - nodes currently available for this job
+ * OUT active_bitmap - nodes with job's features currently active, NULL if
+ *	identical to avail_bitmap
+ * NOTE: Currently supports only simple AND of features
+ */
+extern void build_active_feature_bitmap(struct job_record *job_ptr,
+					bitstr_t *avail_bitmap,
+					bitstr_t **active_bitmap);
+
 /*
  * build_node_details - sets addresses for allocated nodes
  * IN job_ptr - pointer to a job record
@@ -68,6 +81,22 @@ extern void build_node_details(struct job_record *job_ptr, bool new_alloc);
 extern void deallocate_nodes(struct job_record *job_ptr, bool timeout,
 		bool suspended, bool preempted);
 
+/* Remove nodes from consideration for allocation based upon "mcs" by
+ * other users
+ * job_ptr IN - Job to be scheduled
+ * usable_node_mask IN/OUT - Nodes available for use by this job's mcs
+ */
+extern void filter_by_node_mcs(struct job_record *job_ptr, int mcs_select,
+			       bitstr_t *usable_node_mask);
+
+/* Remove nodes from consideration for allocation based upon "ownership" by
+ * other users
+ * job_ptr IN - Job to be scheduled
+ * usable_node_mask IN/OUT - Nodes available for use by this job's user
+ */
+extern void filter_by_node_owner(struct job_record *job_ptr,
+				 bitstr_t *usable_node_mask);
+
 /*
  * re_kill_job - for a given job, deallocate its nodes for a second time,
  *	basically a cleanup for failed deallocate() calls
diff --git a/src/slurmctld/partition_mgr.c b/src/slurmctld/partition_mgr.c
index 667d603bc..890899cdc 100644
--- a/src/slurmctld/partition_mgr.c
+++ b/src/slurmctld/partition_mgr.c
@@ -5,7 +5,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette@llnl.gov> et. al.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -53,6 +53,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
+#include <grp.h>
 
 #include "src/common/hostlist.h"
 #include "src/common/list.h"
@@ -83,7 +84,7 @@ List part_list = NULL;			/* partition list */
 char *default_part_name = NULL;		/* name of default partition */
 struct part_record *default_part_loc = NULL; /* default partition location */
 time_t last_part_update;	/* time of last update to partition records */
-uint16_t part_max_priority = 0;         /* max priority in all partitions */
+uint16_t part_max_priority = 0;         /* max priority_job_factor in all parts */
 
 static int    _delete_part_record(char *name);
 static void   _dump_part_state(struct part_record *part_ptr,
@@ -91,6 +92,7 @@ static void   _dump_part_state(struct part_record *part_ptr,
 static uid_t *_get_groups_members(char *group_names);
 static time_t _get_group_tlm(void);
 static void   _list_delete_part(void *part_entry);
+static int    _match_part_ptr(void *part_ptr, void *key);
 static int    _open_part_state_file(char **state_file);
 static int    _uid_list_size(uid_t * uid_list_ptr);
 static void   _unlink_free_nodes(bitstr_t *old_bitmap,
@@ -125,13 +127,15 @@ static void _calc_part_tres(struct part_record *part_ptr)
 	for(i = 0; i < slurmctld_tres_cnt; i++) {
 		slurmdb_tres_rec_t *tres_rec = assoc_mgr_tres_array[i];
 
-		if (!strcasecmp(tres_rec->type, "bb") ||
-		    !strcasecmp(tres_rec->type, "license"))
+		if (!xstrcasecmp(tres_rec->type, "bb") ||
+		    !xstrcasecmp(tres_rec->type, "license"))
 			tres_cnt[i] = tres_rec->count;
 	}
 
 	part_ptr->tres_fmt_str =
-		assoc_mgr_make_tres_str_from_array(part_ptr->tres_cnt, 0, true);
+		assoc_mgr_make_tres_str_from_array(part_ptr->tres_cnt,
+						   TRES_STR_CONVERT_UNITS,
+						   true);
 }
 
 /*
@@ -188,7 +192,7 @@ extern int build_part_bitmap(struct part_record *part_ptr)
 		return 0;
 	}
 
-	if (!strcmp(part_ptr->nodes, "ALL")) {
+	if (!xstrcmp(part_ptr->nodes, "ALL")) {
 		bit_nset(part_ptr->node_bitmap, 0, node_record_count - 1);
 		xfree(part_ptr->nodes);
 		part_ptr->nodes = bitmap2node_name(part_ptr->node_bitmap);
@@ -306,11 +310,14 @@ struct part_record *create_part_record(void)
 	part_ptr->state_up          = default_part.state_up;
 	part_ptr->max_share         = default_part.max_share;
 	part_ptr->preempt_mode      = default_part.preempt_mode;
-	part_ptr->priority          = default_part.priority;
+	part_ptr->priority_job_factor = default_part.priority_job_factor;
+	part_ptr->priority_tier     = default_part.priority_tier;
 	part_ptr->grace_time 	    = default_part.grace_time;
-	if (part_max_priority)
-		part_ptr->norm_priority = (double)default_part.priority
-			/ (double)part_max_priority;
+	if (part_max_priority) {
+		part_ptr->norm_priority =
+			(double)default_part.priority_job_factor /
+			(double)part_max_priority;
+	}
 	part_ptr->node_bitmap       = NULL;
 
 	if (default_part.allow_accounts) {
@@ -518,7 +525,8 @@ static void _dump_part_state(struct part_record *part_ptr, Buf buffer)
 	pack16(part_ptr->flags,          buffer);
 	pack16(part_ptr->max_share,      buffer);
 	pack16(part_ptr->preempt_mode,   buffer);
-	pack16(part_ptr->priority,       buffer);
+	pack16(part_ptr->priority_job_factor, buffer);
+	pack16(part_ptr->priority_tier,  buffer);
 
 	pack16(part_ptr->state_up,       buffer);
 	pack16(part_ptr->cr_type,        buffer);
@@ -580,8 +588,8 @@ int load_all_part_state(void)
 	uint32_t max_time, default_time, max_nodes, min_nodes;
 	uint32_t max_cpus_per_node = INFINITE, grace_time = 0;
 	time_t time;
-	uint16_t flags;
-	uint16_t max_share, preempt_mode, priority, state_up, cr_type;
+	uint16_t flags, priority_job_factor, priority_tier;
+	uint16_t max_share, preempt_mode, state_up, cr_type;
 	struct part_record *part_ptr;
 	uint32_t data_size = 0, name_len;
 	int data_allocated, data_read = 0, error_code = 0, part_cnt = 0;
@@ -628,7 +636,7 @@ int load_all_part_state(void)
 
 	safe_unpackstr_xmalloc(&ver_str, &name_len, buffer);
 	debug3("Version string in part_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, PART_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, PART_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t)NO_VAL) {
@@ -643,7 +651,55 @@ int load_all_part_state(void)
 	safe_unpack_time(&time, buffer);
 
 	while (remaining_buf(buffer) > 0) {
-		if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+		if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+			safe_unpackstr_xmalloc(&part_name, &name_len, buffer);
+			safe_unpack32(&grace_time, buffer);
+			safe_unpack32(&max_time, buffer);
+			safe_unpack32(&default_time, buffer);
+			safe_unpack32(&max_cpus_per_node, buffer);
+			safe_unpack32(&max_nodes, buffer);
+			safe_unpack32(&min_nodes, buffer);
+
+			safe_unpack16(&flags,        buffer);
+			safe_unpack16(&max_share,    buffer);
+			safe_unpack16(&preempt_mode, buffer);
+
+			safe_unpack16(&priority_job_factor, buffer);
+			safe_unpack16(&priority_tier, buffer);
+			if (priority_job_factor > part_max_priority)
+				part_max_priority = priority_job_factor;
+
+			safe_unpack16(&state_up, buffer);
+			safe_unpack16(&cr_type, buffer);
+
+			safe_unpackstr_xmalloc(&allow_accounts,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&allow_groups,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&allow_qos,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&qos_char,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&deny_accounts,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&deny_qos,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&allow_alloc_nodes,
+					       &name_len, buffer);
+			safe_unpackstr_xmalloc(&alternate, &name_len, buffer);
+			safe_unpackstr_xmalloc(&nodes, &name_len, buffer);
+			if ((flags & PART_FLAG_DEFAULT_CLR)   ||
+			    (flags & PART_FLAG_EXC_USER_CLR)  ||
+			    (flags & PART_FLAG_HIDDEN_CLR)    ||
+			    (flags & PART_FLAG_NO_ROOT_CLR)   ||
+			    (flags & PART_FLAG_ROOT_ONLY_CLR) ||
+			    (flags & PART_FLAG_REQ_RESV_CLR)  ||
+			    (flags & PART_FLAG_LLN_CLR)) {
+				error("Invalid data for partition %s: flags=%u",
+				      part_name, flags);
+				error_code = EINVAL;
+			}
+		} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc(&part_name, &name_len, buffer);
 			safe_unpack32(&grace_time, buffer);
 			safe_unpack32(&max_time, buffer);
@@ -655,10 +711,11 @@ int load_all_part_state(void)
 			safe_unpack16(&flags,        buffer);
 			safe_unpack16(&max_share,    buffer);
 			safe_unpack16(&preempt_mode, buffer);
-			safe_unpack16(&priority,     buffer);
 
-			if (priority > part_max_priority)
-				part_max_priority = priority;
+			safe_unpack16(&priority_tier, buffer);
+			priority_job_factor = priority_tier;
+			if (priority_job_factor > part_max_priority)
+				part_max_priority = priority_job_factor;
 
 			safe_unpack16(&state_up, buffer);
 			safe_unpack16(&cr_type, buffer);
@@ -690,7 +747,7 @@ int load_all_part_state(void)
 				      part_name, flags);
 				error_code = EINVAL;
 			}
-		} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+		} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 			safe_unpackstr_xmalloc(&part_name, &name_len, buffer);
 			safe_unpack32(&grace_time, buffer);
 			safe_unpack32(&max_time, buffer);
@@ -702,10 +759,11 @@ int load_all_part_state(void)
 			safe_unpack16(&flags,        buffer);
 			safe_unpack16(&max_share,    buffer);
 			safe_unpack16(&preempt_mode, buffer);
-			safe_unpack16(&priority,     buffer);
 
-			if (priority > part_max_priority)
-				part_max_priority = priority;
+			safe_unpack16(&priority_tier, buffer);
+			priority_job_factor = priority_tier;
+			if (priority_job_factor > part_max_priority)
+				part_max_priority = priority_job_factor;
 
 			safe_unpack16(&state_up, buffer);
 			safe_unpack16(&cr_type, buffer);
@@ -792,7 +850,8 @@ int load_all_part_state(void)
 		part_ptr->grace_time     = grace_time;
 		if (preempt_mode != (uint16_t) NO_VAL)
 			part_ptr->preempt_mode   = preempt_mode;
-		part_ptr->priority       = priority;
+		part_ptr->priority_job_factor = priority_job_factor;
+		part_ptr->priority_tier  = priority_tier;
 		part_ptr->state_up       = state_up;
 		part_ptr->cr_type	 = cr_type;
 		xfree(part_ptr->allow_accounts);
@@ -910,7 +969,10 @@ extern List get_part_list(char *name, char **err_part)
 			if (job_part_list == NULL) {
 				job_part_list = list_create(NULL);
 			}
-			list_append(job_part_list, part_ptr);
+			if (!list_find_first(job_part_list, &_match_part_ptr,
+					     part_ptr)) {
+				list_append(job_part_list, part_ptr);
+			}
 		} else {
 			FREE_NULL_LIST(job_part_list);
 			if (err_part) {
@@ -952,7 +1014,8 @@ int init_part_conf(void)
 	default_part.state_up       = PARTITION_UP;
 	default_part.max_share      = 1;
 	default_part.preempt_mode   = (uint16_t) NO_VAL;
-	default_part.priority       = 1;
+	default_part.priority_tier  = 1;
+	default_part.priority_job_factor = 1;
 	default_part.norm_priority  = 0;
 	default_part.total_nodes    = 0;
 	default_part.total_cpus     = 0;
@@ -1050,10 +1113,25 @@ int list_find_part(void *part_entry, void *key)
 	if (key == NULL)
 		return 0;
 
-	if (strcmp(key, "universal_key") == 0)
+	if (xstrcmp(key, "universal_key") == 0)
 		return 1;
 
-	if (strcmp(((struct part_record *)part_entry)->name, (char *) key) == 0)
+	if (xstrcmp(((struct part_record *)part_entry)->name,
+		    (char *) key) == 0)
+		return 1;
+
+	return 0;
+}
+
+/*
+ * _match_part_ptr - find an entry in the partition list, see common/list.h
+ *	for documentation
+ * IN key - partition pointer
+ * RET 1 if partition pointer matches, 0 otherwise
+ */
+static int _match_part_ptr(void *part_ptr, void *key)
+{
+	if (part_ptr == key)
 		return 1;
 
 	return 0;
@@ -1166,7 +1244,47 @@ void pack_part(struct part_record *part_ptr, Buf buffer,
 {
 	uint32_t altered;
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		if (default_part_loc == part_ptr)
+			part_ptr->flags |= PART_FLAG_DEFAULT;
+		else
+			part_ptr->flags &= (~PART_FLAG_DEFAULT);
+
+		packstr(part_ptr->name, buffer);
+		pack32(part_ptr->grace_time, buffer);
+		pack32(part_ptr->max_time, buffer);
+		pack32(part_ptr->default_time, buffer);
+		pack32(part_ptr->max_nodes_orig, buffer);
+		pack32(part_ptr->min_nodes_orig, buffer);
+		altered = part_ptr->total_nodes;
+		select_g_alter_node_cnt(SELECT_APPLY_NODE_MAX_OFFSET, &altered);
+		pack32(altered,              buffer);
+		pack32(part_ptr->total_cpus, buffer);
+		pack32(part_ptr->def_mem_per_cpu, buffer);
+		pack32(part_ptr->max_cpus_per_node, buffer);
+		pack32(part_ptr->max_mem_per_cpu, buffer);
+
+		pack16(part_ptr->flags,      buffer);
+		pack16(part_ptr->max_share,  buffer);
+		pack16(part_ptr->preempt_mode, buffer);
+		pack16(part_ptr->priority_job_factor, buffer);
+		pack16(part_ptr->priority_tier, buffer);
+		pack16(part_ptr->state_up, buffer);
+		pack16(part_ptr->cr_type, buffer);
+
+		packstr(part_ptr->allow_accounts, buffer);
+		packstr(part_ptr->allow_groups, buffer);
+		packstr(part_ptr->allow_alloc_nodes, buffer);
+		packstr(part_ptr->allow_qos, buffer);
+		packstr(part_ptr->qos_char, buffer);
+		packstr(part_ptr->alternate, buffer);
+		packstr(part_ptr->deny_accounts, buffer);
+		packstr(part_ptr->deny_qos, buffer);
+		packstr(part_ptr->nodes, buffer);
+		pack_bit_fmt(part_ptr->node_bitmap, buffer);
+		packstr(part_ptr->billing_weights_str, buffer);
+		packstr(part_ptr->tres_fmt_str, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		if (default_part_loc == part_ptr)
 			part_ptr->flags |= PART_FLAG_DEFAULT;
 		else
@@ -1189,7 +1307,7 @@ void pack_part(struct part_record *part_ptr, Buf buffer,
 		pack16(part_ptr->flags,      buffer);
 		pack16(part_ptr->max_share,  buffer);
 		pack16(part_ptr->preempt_mode, buffer);
-		pack16(part_ptr->priority,   buffer);
+		pack16(part_ptr->priority_tier, buffer);
 		pack16(part_ptr->state_up, buffer);
 		pack16(part_ptr->cr_type, buffer);
 
@@ -1205,7 +1323,7 @@ void pack_part(struct part_record *part_ptr, Buf buffer,
 		pack_bit_fmt(part_ptr->node_bitmap, buffer);
 		packstr(part_ptr->billing_weights_str, buffer);
 		packstr(part_ptr->tres_fmt_str, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		if (default_part_loc == part_ptr)
 			part_ptr->flags |= PART_FLAG_DEFAULT;
 		else
@@ -1228,7 +1346,7 @@ void pack_part(struct part_record *part_ptr, Buf buffer,
 		pack16(part_ptr->flags,      buffer);
 		pack16(part_ptr->max_share,  buffer);
 		pack16(part_ptr->preempt_mode, buffer);
-		pack16(part_ptr->priority,   buffer);
+		pack16(part_ptr->priority_tier, buffer);
 		pack16(part_ptr->state_up, buffer);
 		pack16(part_ptr->cr_type, buffer);
 
@@ -1392,7 +1510,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 		if (default_part_name == NULL) {
 			info("update_part: setting default partition to %s",
 			     part_desc->name);
-		} else if (strcmp(default_part_name, part_desc->name) != 0) {
+		} else if (xstrcmp(default_part_name, part_desc->name) != 0) {
 			info("update_part: changing default "
 			     "partition from %s to %s",
 			     default_part_name, part_desc->name);
@@ -1456,35 +1574,43 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 		}
 	}
 
-	if (part_desc->priority != (uint16_t) NO_VAL) {
-		info("update_part: setting priority to %u for partition %s",
-		     part_desc->priority, part_desc->name);
-		part_ptr->priority = part_desc->priority;
+	if (part_desc->priority_tier != (uint16_t) NO_VAL) {
+		info("update_part: setting PriorityTier to %u for partition %s",
+		     part_desc->priority_tier, part_desc->name);
+		part_ptr->priority_tier = part_desc->priority_tier;
+	}
+
+	if (part_desc->priority_job_factor != (uint16_t) NO_VAL) {
+		info("update_part: setting PriorityJobFactor to %u for partition %s",
+		     part_desc->priority_job_factor, part_desc->name);
+		part_ptr->priority_job_factor = part_desc->priority_job_factor;
 
 		/* If the max_priority changes we need to change all
 		 * the normalized priorities of all the other
 		 * partitions. If not then just set this partition.
 		 */
-		if (part_ptr->priority > part_max_priority) {
+		if (part_ptr->priority_job_factor > part_max_priority) {
 			ListIterator itr = list_iterator_create(part_list);
 			struct part_record *part2 = NULL;
 
-			part_max_priority = part_ptr->priority;
+			part_max_priority = part_ptr->priority_job_factor;
 
-			while((part2 = list_next(itr))) {
-				part2->norm_priority = (double)part2->priority
-					/ (double)part_max_priority;
+			while ((part2 = list_next(itr))) {
+				part2->norm_priority =
+					(double)part2->priority_job_factor /
+					(double)part_max_priority;
 			}
 			list_iterator_destroy(itr);
 		} else {
-			part_ptr->norm_priority = (double)part_ptr->priority
-				/ (double)part_max_priority;
+			part_ptr->norm_priority =
+				(double)part_ptr->priority_job_factor /
+				(double)part_max_priority;
 		}
 	}
 
 	if (part_desc->allow_accounts != NULL) {
 		xfree(part_ptr->allow_accounts);
-		if ((strcasecmp(part_desc->allow_accounts, "ALL") == 0) ||
+		if ((xstrcasecmp(part_desc->allow_accounts, "ALL") == 0) ||
 		    (part_desc->allow_accounts[0] == '\0')) {
 			info ("update_part: setting AllowAccounts to ALL for "
 			      "partition %s",
@@ -1503,7 +1629,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 	if (part_desc->allow_groups != NULL) {
 		xfree(part_ptr->allow_groups);
 		xfree(part_ptr->allow_uids);
-		if ((strcasecmp(part_desc->allow_groups, "ALL") == 0) ||
+		if ((xstrcasecmp(part_desc->allow_groups, "ALL") == 0) ||
 		    (part_desc->allow_groups[0] == '\0')) {
 			info("update_part: setting allow_groups to ALL for "
 				"partition %s",
@@ -1522,7 +1648,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 
 	if (part_desc->allow_qos != NULL) {
 		xfree(part_ptr->allow_qos);
-		if ((strcasecmp(part_desc->allow_qos, "ALL") == 0) ||
+		if ((xstrcasecmp(part_desc->allow_qos, "ALL") == 0) ||
 		    (part_desc->allow_qos[0] == '\0')) {
 			info("update_partition: setting AllowQOS to ALL for "
 			     "partition %s",
@@ -1569,7 +1695,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 	if (part_desc->allow_alloc_nodes != NULL) {
 		xfree(part_ptr->allow_alloc_nodes);
 		if ((part_desc->allow_alloc_nodes[0] == '\0') ||
-		    (strcasecmp(part_desc->allow_alloc_nodes, "ALL") == 0)) {
+		    (xstrcasecmp(part_desc->allow_alloc_nodes, "ALL") == 0)) {
 			part_ptr->allow_alloc_nodes = NULL;
 			info("update_part: setting allow_alloc_nodes to ALL"
 			     " for partition %s",part_desc->name);
@@ -1585,7 +1711,7 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
 	}
 	if (part_desc->alternate != NULL) {
 		xfree(part_ptr->alternate);
-		if ((strcasecmp(part_desc->alternate, "NONE") == 0) ||
+		if ((xstrcasecmp(part_desc->alternate, "NONE") == 0) ||
 		    (part_desc->alternate[0] == '\0'))
 			part_ptr->alternate = NULL;
 		else
@@ -1706,7 +1832,17 @@ extern int update_part (update_part_msg_t * part_desc, bool create_flag)
  */
 extern int validate_group(struct part_record *part_ptr, uid_t run_uid)
 {
-	int i = 0;
+#if defined(_SC_GETPW_R_SIZE_MAX)
+	long ii;
+#endif
+	int i = 0, res;
+	size_t buflen;
+	struct passwd pwd, *pwd_result;
+	char *buf;
+	char *grp_buffer;
+	struct group grp, *grp_result;
+	char *groups, *saveptr, *one_group_name;
+	int ret = 0;
 
 	if (part_ptr->allow_groups == NULL)
 		return 1;	/* all users allowed */
@@ -1719,8 +1855,96 @@ extern int validate_group(struct part_record *part_ptr, uid_t run_uid)
 		if (part_ptr->allow_uids[i] == run_uid)
 			return 1;
 	}
-	return 0;		/* not in this group's list */
 
+	/* The allow_uids list is built from the allow_groups list,
+	 * and if user/group enumeration has been disabled, it's
+	 * possible that the users primary group is not returned as a
+	 * member of a group.  Enumeration is problematic if the
+	 * user/group database is large (think university-wide central
+	 * account database or such), as in such environments
+	 * enumeration would load the directory servers a lot, so the
+	 * recommendation is to have it disabled (e.g. enumerate=False
+	 * in sssd.conf).  So check explicitly whether the primary
+	 * group is allowed as a final resort.  This should
+	 * (hopefully) not happen that often, and anyway the
+	 * getpwuid_r and getgrgid_r calls should be cached by
+	 * sssd/nscd/etc. so should be fast.  */
+
+	/* First figure out the primary GID.  */
+	buflen = PW_BUF_SIZE;
+#if defined(_SC_GETPW_R_SIZE_MAX)
+	ii = sysconf(_SC_GETPW_R_SIZE_MAX);
+	if (ii > buflen)
+		buflen = ii;
+#endif
+	buf = xmalloc(buflen);
+	while (1) {
+		slurm_seterrno(0);
+		res = getpwuid_r(run_uid, &pwd, buf, buflen, &pwd_result);
+		/* We need to check for !pwd_result, since it appears some
+		 * versions of this function do not return an error on
+		 * failure.
+		 */
+		if (res != 0 || !pwd_result) {
+			if (errno == ERANGE) {
+				buflen *= 2;
+				xrealloc(buf, buflen);
+				continue;
+			}
+			error("%s: Could not find passwd entry for uid %ld",
+			      __func__, (long) run_uid);
+			xfree(buf);
+			return 0;
+		}
+		break;
+	}
+
+	/* Then use the primary GID to figure out the name of the
+	 * group with that GID.  */
+#ifdef _SC_GETGR_R_SIZE_MAX
+	ii = sysconf(_SC_GETGR_R_SIZE_MAX);
+	buflen = MAX(PW_BUF_SIZE, ii);
+#endif
+	grp_buffer = xmalloc(buflen);
+	while (1) {
+		slurm_seterrno(0);
+		res = getgrgid_r(pwd.pw_gid, &grp, grp_buffer, buflen,
+				 &grp_result);
+
+		/* We need to check for !grp_result, since it appears some
+		 * versions of this function do not return an error on
+		 * failure.
+		 */
+		if (res != 0 || !grp_result) {
+			if (errno == ERANGE) {
+				buflen *= 2;
+				xrealloc(grp_buffer, buflen);
+				continue;
+			}
+			error("%s: Could not find group with gid %ld",
+			      __func__, (long) pwd.pw_gid);
+			xfree(buf);
+			xfree(grp_buffer);
+			return 0;
+		}
+		break;
+	}
+
+	/* And finally check the name of the primary group against the
+	 * list of allowed group names.  */
+	groups = xstrdup(part_ptr->allow_groups);
+	one_group_name = strtok_r(groups, ",", &saveptr);
+	while (one_group_name) {
+		if (xstrcmp (one_group_name, grp.gr_name) == 0) {
+			ret = 1;
+			break;
+		}
+		one_group_name = strtok_r(NULL, ",", &saveptr);
+	}
+	xfree(groups);
+	xfree(buf);
+	xfree(grp_buffer);
+	return ret;
 }
 
 /*
@@ -2004,7 +2228,7 @@ extern int part_policy_valid_acct(
 		}
 
 		for (i = 0; part_ptr->allow_account_array[i]; i++) {
-			if (strcmp(part_ptr->allow_account_array[i], acct))
+			if (xstrcmp(part_ptr->allow_account_array[i], acct))
 				continue;
 			match = 1;
 			break;
@@ -2026,7 +2250,7 @@ extern int part_policy_valid_acct(
 			return SLURM_SUCCESS;
 		}
 		for (i = 0; part_ptr->deny_account_array[i]; i++) {
-			if (strcmp(part_ptr->deny_account_array[i], acct))
+			if (xstrcmp(part_ptr->deny_account_array[i], acct))
 				continue;
 			match = 1;
 			break;
diff --git a/src/slurmctld/ping_nodes.c b/src/slurmctld/ping_nodes.c
index e437c7ef6..b3f6ddc39 100644
--- a/src/slurmctld/ping_nodes.c
+++ b/src/slurmctld/ping_nodes.c
@@ -266,8 +266,8 @@ void ping_nodes (void)
 		ping_agent_args->node_count++;
 	}
 #else
-	for (i=0, node_ptr=node_record_table_ptr;
-	     i<node_record_count; i++, node_ptr++) {
+	for (i = 0, node_ptr = node_record_table_ptr;
+	     i < node_record_count; i++, node_ptr++) {
 		if (IS_NODE_FUTURE(node_ptr) || IS_NODE_POWER_SAVE(node_ptr))
 			continue;
 		if ((slurmctld_conf.slurmd_timeout == 0) &&
diff --git a/src/slurmctld/port_mgr.c b/src/slurmctld/port_mgr.c
index 015a3e13c..1d55b5069 100644
--- a/src/slurmctld/port_mgr.c
+++ b/src/slurmctld/port_mgr.c
@@ -270,10 +270,8 @@ extern int resv_port_alloc(struct step_record *step_ptr)
 
 	if (step_ptr->resv_ports[0] == '[') {
 		/* Remove brackets from hostlist */
-		i = strlen(step_ptr->resv_ports);
 		step_ptr->resv_ports[i-1] = '\0';
-		tmp_str = xmalloc(i);
-		strcpy(tmp_str, step_ptr->resv_ports + 1);
+		tmp_str = xstrdup(step_ptr->resv_ports + 1);
 		xfree(step_ptr->resv_ports);
 		step_ptr->resv_ports = tmp_str;
 	}
diff --git a/src/slurmctld/power_save.c b/src/slurmctld/power_save.c
index 5db7f7474..ac2fc312e 100644
--- a/src/slurmctld/power_save.c
+++ b/src/slurmctld/power_save.c
@@ -61,8 +61,12 @@
 
 #include "src/common/bitstring.h"
 #include "src/common/macros.h"
+#include "src/common/node_features.h"
+#include "src/common/read_config.h"
 #include "src/common/xstring.h"
+#include "src/slurmctld/job_scheduler.h"
 #include "src/slurmctld/locks.h"
+#include "src/slurmctld/power_save.h"
 #include "src/slurmctld/slurmctld.h"
 
 #if defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL
@@ -73,7 +77,7 @@
 
 #define _DEBUG			0
 #define PID_CNT			10
-#define MAX_SHUTDOWN_DELAY	120	/* seconds to wait for child procs
+#define MAX_SHUTDOWN_DELAY	10	/* seconds to wait for child procs
 					 * to exit after daemon shutdown
 					 * request, then orphan or kill proc */
 
@@ -81,8 +85,11 @@
 pid_t  child_pid[PID_CNT];	/* pid of process		*/
 time_t child_time[PID_CNT];	/* start time of process	*/
 
+pthread_cond_t power_cond = PTHREAD_COND_INITIALIZER;
 pthread_mutex_t power_mutex = PTHREAD_MUTEX_INITIALIZER;
+bool power_save_config = false;
 bool power_save_enabled = false;
+bool power_save_started = false;
 
 int idle_time, suspend_rate, resume_timeout, resume_rate, suspend_timeout;
 char *suspend_prog = NULL, *resume_prog = NULL;
@@ -104,7 +111,7 @@ static void *_init_power_save(void *arg);
 static int   _kill_procs(void);
 static int   _reap_procs(void);
 static void  _re_wake(void);
-static pid_t _run_prog(char *prog, char *arg);
+static pid_t _run_prog(char *prog, char *arg1, char *arg2);
 static void  _shutdown_power(void);
 static bool  _valid_prog(char *file_name);
 
@@ -147,8 +154,8 @@ static void _do_power_work(time_t now)
 	last_work_scan = now;
 
 	/* Build bitmaps identifying each node which should change state */
-	for (i=0, node_ptr=node_record_table_ptr;
-	     i<node_record_count; i++, node_ptr++) {
+	for (i = 0, node_ptr = node_record_table_ptr;
+	     i < node_record_count; i++, node_ptr++) {
 		susp_state = IS_NODE_POWER_SAVE(node_ptr);
 
 		if (susp_state)
@@ -185,6 +192,7 @@ static void _do_power_work(time_t now)
 		    (node_ptr->sus_job_cnt == 0)			&&
 		    (!IS_NODE_COMPLETING(node_ptr))			&&
 		    (!IS_NODE_POWER_UP(node_ptr))			&&
+		    (node_ptr->last_idle != 0)				&&
 		    (node_ptr->last_idle < (now - idle_time))		&&
 		    ((exc_node_bitmap == NULL) ||
 		     (bit_test(exc_node_bitmap, i) == 0))) {
@@ -238,6 +246,70 @@ static void _do_power_work(time_t now)
 	}
 }
 
+/* power_job_reboot - Reboot compute nodes for a job from the head node */
+extern int power_job_reboot(struct job_record *job_ptr)
+{
+	int rc = SLURM_SUCCESS;
+	int i, i_first, i_last;
+	struct node_record *node_ptr;
+	bitstr_t *boot_node_bitmap = NULL;
+	time_t now = time(NULL);
+	char *nodes, *features = NULL;
+	pid_t pid;
+
+	boot_node_bitmap = node_features_reboot(job_ptr);
+	if (boot_node_bitmap == NULL)
+		return SLURM_SUCCESS;
+
+	i_first = bit_ffs(boot_node_bitmap);
+	if (i_first >= 0)
+		i_last = bit_fls(boot_node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first; i <= i_last; i++) {
+		if (!bit_test(boot_node_bitmap, i))
+			continue;
+		node_ptr = node_record_table_ptr + i;
+		resume_cnt++;
+		resume_cnt_f++;
+		node_ptr->node_state &= (~NODE_STATE_POWER_SAVE);
+		node_ptr->node_state |=   NODE_STATE_POWER_UP;
+		node_ptr->node_state |=   NODE_STATE_NO_RESPOND;
+		bit_clear(power_node_bitmap, i);
+		bit_clear(avail_node_bitmap, i);
+		node_ptr->last_response = now + resume_timeout;
+		bit_set(resume_node_bitmap,  i);
+	}
+
+	nodes = bitmap2node_name(boot_node_bitmap);
+	if (nodes) {
+		job_ptr->job_state |= JOB_CONFIGURING;
+		job_ptr->wait_all_nodes = 1;
+		if (job_ptr->details && job_ptr->details->features &&
+		    node_features_g_user_update(job_ptr->user_id)) {
+			features = node_features_g_job_xlate(
+					job_ptr->details->features);
+		}
+		pid = _run_prog(resume_prog, nodes, features);
+#if _DEBUG
+		info("power_save: pid %d reboot nodes %s features %s",
+		     (int) pid, nodes, features);
+#else
+		verbose("power_save: pid %d reboot nodes %s features %s",
+			(int) pid, nodes, features);
+#endif
+		xfree(features);
+	} else {
+		error("power_save: bitmap2nodename");
+		rc = SLURM_ERROR;
+	}
+	xfree(nodes);
+	FREE_NULL_BITMAP(boot_node_bitmap);
+	last_node_update = now;
+
+	return rc;
+}
+
 /* If slurmctld crashes, the node state that it recovers could differ
  * from the actual hardware state (e.g. ResumeProgram failed to complete).
  * To address that, when a node that should be powered up for a running
@@ -267,8 +339,9 @@ static void _re_wake(void)
 		char *nodes;
 		nodes = bitmap2node_name(wake_node_bitmap);
 		if (nodes) {
-			info("power_save: rewaking nodes %s", nodes);
-			_run_prog(resume_prog, nodes);
+			pid_t pid = _run_prog(resume_prog, nodes, NULL);
+			info("power_save: pid %d rewaking nodes %s",
+			     (int) pid, nodes);
 		} else
 			error("power_save: bitmap2nodename");
 		xfree(nodes);
@@ -278,46 +351,47 @@ static void _re_wake(void)
 
 static void _do_resume(char *host)
 {
+	pid_t pid = _run_prog(resume_prog, host, NULL);
 #if _DEBUG
-	info("power_save: waking nodes %s", host);
+	info("power_save: pid %d waking nodes %s", (int) pid, host);
 #else
-	verbose("power_save: waking nodes %s", host);
+	verbose("power_save: pid %d waking nodes %s", (int) pid, host);
 #endif
-	_run_prog(resume_prog, host);
 }
 
 static void _do_suspend(char *host)
 {
+	pid_t pid = _run_prog(suspend_prog, host, NULL);
 #if _DEBUG
-	info("power_save: suspending nodes %s", host);
+	info("power_save: pid %d suspending nodes %s", (int) pid, host);
 #else
-	verbose("power_save: suspending nodes %s", host);
+	verbose("power_save: pid %d suspending nodes %s", (int) pid, host);
 #endif
-	_run_prog(suspend_prog, host);
 }
 
 /* run a suspend or resume program
  * prog IN	- program to run
- * arg IN	- program arguments, the hostlist expression
+ * arg1 IN	- first program argument, the hostlist expression
+ * arg2 IN	- second program argumentor NULL
  */
-static pid_t _run_prog(char *prog, char *arg)
+static pid_t _run_prog(char *prog, char *arg1, char *arg2)
 {
 	int i;
-	char program[1024], arg0[1024], arg1[1024], *pname;
+	char *argv[4], *pname;
 	pid_t child;
 	slurm_ctl_conf_t *ctlconf;
 
 	if (prog == NULL)	/* disabled, useful for testing */
 		return -1;
 
-	strncpy(program, prog, sizeof(program));
-	pname = strrchr(program, '/');
+	pname = strrchr(prog, '/');
 	if (pname == NULL)
-		pname = program;
+		argv[0] = prog;
 	else
-		pname++;
-	strncpy(arg0, pname, sizeof(arg0));
-	strncpy(arg1, arg, sizeof(arg1));
+		argv[0] = pname + 1;
+	argv[1] = arg1;
+	argv[2] = arg2;
+	argv[3] = NULL;
 
 	child = fork();
 	if (child == 0) {
@@ -331,13 +405,13 @@ static pid_t _run_prog(char *prog, char *arg)
 		ctlconf = slurm_conf_lock();
 		setenv("SLURM_CONF", ctlconf->slurm_conf, 1);
 		slurm_conf_unlock();
-		execl(program, arg0, arg1, NULL);
+		execv(prog, argv);
 		exit(1);
 	} else if (child < 0) {
 		error("fork: %m");
 	} else {
 		/* save the pid */
-		for (i=0; i<PID_CNT; i++) {
+		for (i = 0; i < PID_CNT; i++) {
 			if (child_pid[i])
 				continue;
 			child_pid[i]  = child;
@@ -426,6 +500,7 @@ static void _shutdown_power(void)
 	int i, proc_cnt, max_timeout;
 
 	max_timeout = MAX(suspend_timeout, resume_timeout);
+	max_timeout = MIN(max_timeout, MAX_SHUTDOWN_DELAY);
 	/* Try to avoid orphan processes */
 	for (i=0; ; i++) {
 		proc_cnt = PID_CNT - _reap_procs();
@@ -583,6 +658,21 @@ static bool _valid_prog(char *file_name)
 	return true;
 }
 
+/*
+ * config_power_mgr - Read power management configuration
+ */
+extern void config_power_mgr(void)
+{
+	slurm_mutex_lock(&power_mutex);
+	if (!power_save_config) {
+		if (_init_power_config() == 0)
+			power_save_enabled = true;
+		power_save_config = true;
+	}
+	pthread_cond_signal(&power_cond);
+	slurm_mutex_unlock(&power_mutex);
+}
+
 /* start_power_mgr - Start power management thread as needed. The thread
  *	terminates automatically at slurmctld shutdown time.
  * IN thread_id - pointer to thread ID of the started pthread.
@@ -592,11 +682,11 @@ extern void start_power_mgr(pthread_t *thread_id)
 	pthread_attr_t thread_attr;
 
 	slurm_mutex_lock(&power_mutex);
-	if (power_save_enabled) {     /* Already running */
+	if (power_save_started) {     /* Already running */
 		slurm_mutex_unlock(&power_mutex);
 		return;
 	}
-	power_save_enabled = true;
+	power_save_started = true;
 	slurm_mutex_unlock(&power_mutex);
 
 	slurm_attr_init(&thread_attr);
@@ -608,6 +698,21 @@ extern void start_power_mgr(pthread_t *thread_id)
 	slurm_attr_destroy(&thread_attr);
 }
 
+/* Report if node power saving is enabled */
+extern bool power_save_test(void)
+{
+	bool rc;
+
+	slurm_mutex_lock(&power_mutex);
+	while (!power_save_config) {
+		pthread_cond_wait(&power_cond, &power_mutex);
+	}
+	rc = power_save_enabled;
+	slurm_mutex_unlock(&power_mutex);
+
+	return rc;
+}
+
 /*
  * init_power_save - Initialize the power save module. Started as a
  *	pthread. Terminates automatically at slurmctld shutdown time.
@@ -623,8 +728,10 @@ static void *_init_power_save(void *arg)
                 NO_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK };
 	time_t now, boot_time = 0, last_power_scan = 0;
 
-	if (_init_power_config())
-		goto fini;
+	if (power_save_config && !power_save_enabled) {
+		debug("power_save mode not enabled");
+		return NULL;
+	}
 
 	suspend_node_bitmap = bit_alloc(node_record_count);
 	resume_node_bitmap  = bit_alloc(node_record_count);
@@ -675,6 +782,7 @@ fini:	_clear_power_config();
 	_shutdown_power();
 	slurm_mutex_lock(&power_mutex);
 	power_save_enabled = false;
+	pthread_cond_signal(&power_cond);
 	slurm_mutex_unlock(&power_mutex);
 	pthread_exit(NULL);
 	return NULL;
diff --git a/src/slurmctld/power_save.h b/src/slurmctld/power_save.h
new file mode 100644
index 000000000..f6ab61c5e
--- /dev/null
+++ b/src/slurmctld/power_save.h
@@ -0,0 +1,63 @@
+/*****************************************************************************\
+ *  power_save.h - Support node power saving mode. Nodes which have been
+ *  idle for an extended period of time will be placed into a power saving
+ *  mode by running an arbitrary script. This script can lower the voltage
+ *  or frequency of the nodes or can completely power the nodes off.
+ *  When the node is restored to normal operation, another script will be
+ *  executed. Many parameters are available to control this mode of operation.
+ *****************************************************************************
+ *  Copyright (C) 2016 SchedMD LLC
+ *
+ *  This file is part of SLURM, a resource management program.
+ *  For details, see <http://slurm.schedmd.com/>.
+ *  Please also read the included file: DISCLAIMER.
+ *
+ *  SLURM is free software; you can redistribute it and/or modify it under
+ *  the terms of the GNU General Public License as published by the Free
+ *  Software Foundation; either version 2 of the License, or (at your option)
+ *  any later version.
+ *
+ *  In addition, as a special exception, the copyright holders give permission
+ *  to link the code of portions of this program with the OpenSSL library under
+ *  certain conditions as described in each individual source file, and
+ *  distribute linked combinations including the two. You must obey the GNU
+ *  General Public License in all respects for all of the code used other than
+ *  OpenSSL. If you modify file(s) with this exception, you may extend this
+ *  exception to your version of the file(s), but you are not obligated to do
+ *  so. If you do not wish to do so, delete this exception statement from your
+ *  version.  If you delete this exception statement from all source files in
+ *  the program, then also delete it here.
+ *
+ *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+ *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+ *  details.
+ *
+ *  You should have received a copy of the GNU General Public License along
+ *  with SLURM; if not, write to the Free Software Foundation, Inc.,
+ *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+\*****************************************************************************/
+
+#include "src/slurmctld/slurmctld.h"
+
+#ifndef _HAVE_POWER_SAVE_H
+#define _HAVE_POWER_SAVE_H
+
+/*
+ * config_power_mgr - Read power management configuration
+ */
+extern void config_power_mgr(void);
+
+/* start_power_mgr - Start power management thread as needed. The thread
+ *	terminates automatically at slurmctld shutdown time.
+ * IN thread_id - pointer to thread ID of the started pthread.
+ */
+extern void start_power_mgr(pthread_t *thread_id);
+
+/* Report if node power saving is enabled */
+extern bool power_save_test(void);
+
+/* power_job_reboot - Reboot compute nodes for a job from the head node */
+extern int power_job_reboot(struct job_record *job_ptr);
+
+#endif /* _HAVE_POWER_SAVE_H */
diff --git a/src/slurmctld/powercapping.c b/src/slurmctld/powercapping.c
index 9c8ad73cc..3b63521e1 100644
--- a/src/slurmctld/powercapping.c
+++ b/src/slurmctld/powercapping.c
@@ -91,9 +91,9 @@ int which_power_layout(void)
 
 	if (layout == NULL)
 		return 0;
-	else if (strcmp(layout->name,"default") == 0)
+	else if (xstrcmp(layout->name,"default") == 0)
 		return 1;
-	else if (strcmp(layout->name,"cpufreq") == 0)
+	else if (xstrcmp(layout->name,"cpufreq") == 0)
 		return 2;
 	
 	return 0;
diff --git a/src/slurmctld/preempt.c b/src/slurmctld/preempt.c
index a15bd52ea..af1cf3721 100644
--- a/src/slurmctld/preempt.c
+++ b/src/slurmctld/preempt.c
@@ -110,10 +110,10 @@ extern int slurm_job_check_grace(struct job_record *job_ptr)
 
 	if (last_update_time != slurmctld_conf.last_update) {
 		char *preempt_type = slurm_get_preempt_type();
-		if (!strcmp(preempt_type, "preempt/partition_prio"))
+		if (!xstrcmp(preempt_type, "preempt/partition_prio"))
 			preempt_mode = 1;
-		else if (!strcmp(preempt_type, "preempt/qos") ||
-			 !strcmp(preempt_type, "preempt/job_prio"))
+		else if (!xstrcmp(preempt_type, "preempt/qos") ||
+			 !xstrcmp(preempt_type, "preempt/job_prio"))
 			preempt_mode = 2;
 		else
 			preempt_mode = 0;
diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c
index 5ec5d55d3..7ac3cc7d6 100644
--- a/src/slurmctld/proc_req.c
+++ b/src/slurmctld/proc_req.c
@@ -85,6 +85,7 @@
 #include "src/slurmctld/job_scheduler.h"
 #include "src/slurmctld/licenses.h"
 #include "src/slurmctld/locks.h"
+#include "src/slurmctld/power_save.h"
 #include "src/slurmctld/powercapping.h"
 #include "src/slurmctld/proc_req.h"
 #include "src/slurmctld/read_config.h"
@@ -145,7 +146,6 @@ inline static void  _slurm_rpc_dump_licenses(slurm_msg_t * msg);
 inline static void  _slurm_rpc_dump_nodes(slurm_msg_t * msg);
 inline static void  _slurm_rpc_dump_node_single(slurm_msg_t * msg);
 inline static void  _slurm_rpc_dump_partitions(slurm_msg_t * msg);
-inline static void  _slurm_rpc_dump_sicp(slurm_msg_t * msg);
 inline static void  _slurm_rpc_dump_spank(slurm_msg_t * msg);
 inline static void  _slurm_rpc_dump_stats(slurm_msg_t * msg);
 inline static void  _slurm_rpc_end_time(slurm_msg_t * msg);
@@ -189,6 +189,7 @@ inline static void  _slurm_rpc_step_layout(slurm_msg_t * msg);
 inline static void  _slurm_rpc_step_update(slurm_msg_t * msg);
 inline static void  _slurm_rpc_submit_batch_job(slurm_msg_t * msg);
 inline static void  _slurm_rpc_suspend(slurm_msg_t * msg);
+inline static void  _slurm_rpc_top_job(slurm_msg_t * msg);
 inline static void  _slurm_rpc_trigger_clear(slurm_msg_t * msg);
 inline static void  _slurm_rpc_trigger_get(slurm_msg_t * msg);
 inline static void  _slurm_rpc_trigger_set(slurm_msg_t * msg);
@@ -278,182 +279,138 @@ void slurmctld_req(slurm_msg_t *msg, connection_arg_t *arg)
 	switch (msg->msg_type) {
 	case REQUEST_RESOURCE_ALLOCATION:
 		_slurm_rpc_allocate_resources(msg);
-		slurm_free_job_desc_msg(msg->data);
 		break;
 	case REQUEST_BUILD_INFO:
 		_slurm_rpc_dump_conf(msg);
-		slurm_free_last_update_msg(msg->data);
 		break;
 	case REQUEST_JOB_INFO:
 		_slurm_rpc_dump_jobs(msg);
-		slurm_free_job_info_request_msg(msg->data);
 		break;
 	case REQUEST_JOB_USER_INFO:
 		_slurm_rpc_dump_jobs_user(msg);
-		slurm_free_job_user_id_msg(msg->data);
 		break;
 	case REQUEST_JOB_INFO_SINGLE:
 		_slurm_rpc_dump_job_single(msg);
-		slurm_free_job_id_msg(msg->data);
 		break;
 	case REQUEST_SHARE_INFO:
 		_slurm_rpc_get_shares(msg);
-		slurm_free_shares_request_msg(msg->data);
 		break;
 	case REQUEST_PRIORITY_FACTORS:
 		_slurm_rpc_get_priority_factors(msg);
-		slurm_free_priority_factors_request_msg(msg->data);
 		break;
 	case REQUEST_JOB_END_TIME:
 		_slurm_rpc_end_time(msg);
-		slurm_free_job_alloc_info_msg(msg->data);
 		break;
 	case REQUEST_FRONT_END_INFO:
 		_slurm_rpc_dump_front_end(msg);
-		slurm_free_front_end_info_request_msg(msg->data);
 		break;
 	case REQUEST_NODE_INFO:
 		_slurm_rpc_dump_nodes(msg);
-		slurm_free_node_info_request_msg(msg->data);
 		break;
 	case REQUEST_NODE_INFO_SINGLE:
 		_slurm_rpc_dump_node_single(msg);
-		slurm_free_node_info_single_msg(msg->data);
 		break;
 	case REQUEST_PARTITION_INFO:
 		_slurm_rpc_dump_partitions(msg);
-		slurm_free_part_info_request_msg(msg->data);
 		break;
 	case MESSAGE_EPILOG_COMPLETE:
 		i = 0;
 		_slurm_rpc_epilog_complete(msg, (bool *)&i, 0);
-		slurm_free_epilog_complete_msg(msg->data);
 		break;
 	case REQUEST_CANCEL_JOB_STEP:
 		_slurm_rpc_job_step_kill(msg);
-		slurm_free_job_step_kill_msg(msg->data);
 		break;
 	case REQUEST_COMPLETE_JOB_ALLOCATION:
 		_slurm_rpc_complete_job_allocation(msg);
-		slurm_free_complete_job_allocation_msg(msg->data);
 		break;
 	case REQUEST_COMPLETE_PROLOG:
 		_slurm_rpc_complete_prolog(msg);
-		slurm_free_complete_prolog_msg(msg->data);
 		break;
 	case REQUEST_COMPLETE_BATCH_JOB:
 	case REQUEST_COMPLETE_BATCH_SCRIPT:
 		_slurm_rpc_complete_batch_script(msg, 0);
-		slurm_free_complete_batch_script_msg(msg->data);
 		break;
 	case REQUEST_JOB_STEP_CREATE:
 		_slurm_rpc_job_step_create(msg);
-		slurm_free_job_step_create_request_msg(msg->data);
 		break;
 	case REQUEST_JOB_STEP_INFO:
 		_slurm_rpc_job_step_get_info(msg);
-		slurm_free_job_step_info_request_msg(msg->data);
 		break;
 	case REQUEST_JOB_WILL_RUN:
 		_slurm_rpc_job_will_run(msg);
-		slurm_free_job_desc_msg(msg->data);
 		break;
 	case MESSAGE_NODE_REGISTRATION_STATUS:
 		_slurm_rpc_node_registration(msg, 0);
-		slurm_free_node_registration_status_msg(msg->data);
 		break;
 	case REQUEST_JOB_ALLOCATION_INFO:
 		_slurm_rpc_job_alloc_info(msg);
-		slurm_free_job_alloc_info_msg(msg->data);
 		break;
 	case REQUEST_JOB_ALLOCATION_INFO_LITE:
 		_slurm_rpc_job_alloc_info_lite(msg);
-		slurm_free_job_alloc_info_msg(msg->data);
 		break;
 	case REQUEST_JOB_SBCAST_CRED:
 		_slurm_rpc_job_sbcast_cred(msg);
-		slurm_free_step_alloc_info_msg(msg->data);
 		break;
 	case REQUEST_PING:
 		_slurm_rpc_ping(msg);
-		/* No body to free */
 		break;
 	case REQUEST_RECONFIGURE:
 		_slurm_rpc_reconfigure_controller(msg);
-		/* No body to free */
 		break;
 	case REQUEST_CONTROL:
 		_slurm_rpc_shutdown_controller(msg);
-		/* No body to free */
 		break;
 	case REQUEST_TAKEOVER:
 		_slurm_rpc_takeover(msg);
-		/* No body to free */
 		break;
 	case REQUEST_SHUTDOWN:
 		_slurm_rpc_shutdown_controller(msg);
-		slurm_free_shutdown_msg(msg->data);
 		break;
 	case REQUEST_SHUTDOWN_IMMEDIATE:
 		_slurm_rpc_shutdown_controller_immediate(msg);
-		/* No body to free */
 		break;
 	case REQUEST_SUBMIT_BATCH_JOB:
 		_slurm_rpc_submit_batch_job(msg);
-		slurm_free_job_desc_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_FRONT_END:
 		_slurm_rpc_update_front_end(msg);
-		slurm_free_update_front_end_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_JOB:
 		_slurm_rpc_update_job(msg);
-		slurm_free_job_desc_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_NODE:
 		_slurm_rpc_update_node(msg);
-		slurm_free_update_node_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_LAYOUT:
 		_slurm_rpc_update_layout(msg);
-		slurm_free_update_layout_msg(msg->data);
 		break;
 	case REQUEST_CREATE_PARTITION:
 	case REQUEST_UPDATE_PARTITION:
 		_slurm_rpc_update_partition(msg);
-		slurm_free_update_part_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_POWERCAP:
 		_slurm_rpc_update_powercap(msg);
-		slurm_free_powercap_info_msg(msg->data);
 		break;
 	case REQUEST_DELETE_PARTITION:
 		_slurm_rpc_delete_partition(msg);
-		slurm_free_delete_part_msg(msg->data);
 		break;
 	case REQUEST_CREATE_RESERVATION:
 		_slurm_rpc_resv_create(msg);
-		slurm_free_resv_desc_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_RESERVATION:
 		_slurm_rpc_resv_update(msg);
-		slurm_free_resv_desc_msg(msg->data);
 		break;
 	case REQUEST_DELETE_RESERVATION:
 		_slurm_rpc_resv_delete(msg);
-		slurm_free_resv_name_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_BLOCK:
 		_slurm_rpc_update_block(msg);
-		slurm_free_block_info(msg->data);
 		break;
 	case REQUEST_RESERVATION_INFO:
 		_slurm_rpc_resv_show(msg);
-		slurm_free_resv_info_request_msg(msg->data);
 		break;
 	case REQUEST_LAYOUT_INFO:
 		_slurm_rpc_layout_show(msg);
-		slurm_free_layout_info_request_msg(msg->data);
 		break;
 	case REQUEST_NODE_REGISTRATION_STATUS:
 		error("slurmctld is talking with itself. "
@@ -462,131 +419,99 @@ void slurmctld_req(slurm_msg_t *msg, connection_arg_t *arg)
 		break;
 	case REQUEST_CHECKPOINT:
 		_slurm_rpc_checkpoint(msg);
-		slurm_free_checkpoint_msg(msg->data);
 		break;
 	case REQUEST_CHECKPOINT_COMP:
 		_slurm_rpc_checkpoint_comp(msg);
-		slurm_free_checkpoint_comp_msg(msg->data);
 		break;
 	case REQUEST_CHECKPOINT_TASK_COMP:
 		_slurm_rpc_checkpoint_task_comp(msg);
-		slurm_free_checkpoint_task_comp_msg(msg->data);
 		break;
 	case REQUEST_SUSPEND:
 		_slurm_rpc_suspend(msg);
-		slurm_free_suspend_msg(msg->data);
+		break;
+	case REQUEST_TOP_JOB:
+		_slurm_rpc_top_job(msg);
 		break;
 	case REQUEST_JOB_REQUEUE:
 		_slurm_rpc_requeue(msg);
-		slurm_free_requeue_msg(msg->data);
 		break;
 	case REQUEST_JOB_READY:
 		_slurm_rpc_job_ready(msg);
-		slurm_free_job_id_msg(msg->data);
 		break;
 	case REQUEST_BLOCK_INFO:
 		_slurm_rpc_block_info(msg);
-		slurm_free_block_info_request_msg(msg->data);
 		break;
 	case REQUEST_BURST_BUFFER_INFO:
 		_slurm_rpc_burst_buffer_info(msg);
-		/* No body to free */
 		break;
 	case REQUEST_STEP_COMPLETE:
 		_slurm_rpc_step_complete(msg, 0);
-		slurm_free_step_complete_msg(msg->data);
 		break;
 	case REQUEST_STEP_LAYOUT:
 		_slurm_rpc_step_layout(msg);
-		slurm_free_job_step_id_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_JOB_STEP:
 		_slurm_rpc_step_update(msg);
-		slurm_free_update_step_msg(msg->data);
 		break;
 	case REQUEST_TRIGGER_SET:
 		_slurm_rpc_trigger_set(msg);
-		slurm_free_trigger_msg(msg->data);
 		break;
 	case REQUEST_TRIGGER_GET:
 		_slurm_rpc_trigger_get(msg);
-		slurm_free_trigger_msg(msg->data);
 		break;
 	case REQUEST_TRIGGER_CLEAR:
 		_slurm_rpc_trigger_clear(msg);
-		slurm_free_trigger_msg(msg->data);
 		break;
 	case REQUEST_TRIGGER_PULL:
 		_slurm_rpc_trigger_pull(msg);
-		slurm_free_trigger_msg(msg->data);
 		break;
 	case REQUEST_JOB_NOTIFY:
 		_slurm_rpc_job_notify(msg);
-		slurm_free_job_notify_msg(msg->data);
 		break;
 	case REQUEST_SET_DEBUG_FLAGS:
 		_slurm_rpc_set_debug_flags(msg);
-		slurm_free_set_debug_flags_msg(msg->data);
 		break;
 	case REQUEST_SET_DEBUG_LEVEL:
 		_slurm_rpc_set_debug_level(msg);
-		slurm_free_set_debug_level_msg(msg->data);
 		break;
 	case REQUEST_SET_SCHEDLOG_LEVEL:
 		_slurm_rpc_set_schedlog_level(msg);
-		slurm_free_set_debug_level_msg(msg->data);
 		break;
 	case ACCOUNTING_UPDATE_MSG:
 		_slurm_rpc_accounting_update_msg(msg);
-		slurm_free_accounting_update_msg(msg->data);
 		break;
 	case ACCOUNTING_FIRST_REG:
 		_slurm_rpc_accounting_first_reg(msg);
-		/* No body to free */
 		break;
 	case ACCOUNTING_REGISTER_CTLD:
 		_slurm_rpc_accounting_register_ctld(msg);
-		slurm_free_reboot_msg(msg->data);
 		break;
 	case REQUEST_TOPO_INFO:
 		_slurm_rpc_get_topo(msg);
-		/* No body to free */
 		break;
 	case REQUEST_POWERCAP_INFO:
 		_slurm_rpc_get_powercap(msg);
-		/* No body to free */
 		break;
 	case REQUEST_SPANK_ENVIRONMENT:
 		_slurm_rpc_dump_spank(msg);
-		slurm_free_spank_env_request_msg(msg->data);
 		break;
 	case REQUEST_REBOOT_NODES:
 		_slurm_rpc_reboot_nodes(msg);
-		/* No body to free */
 		break;
 	case REQUEST_STATS_INFO:
 		_slurm_rpc_dump_stats(msg);
-		slurm_free_stats_info_request_msg(msg->data);
 		break;
 	case REQUEST_LICENSE_INFO:
 		_slurm_rpc_dump_licenses(msg);
-		slurm_free_license_info_request_msg(msg->data);
 		break;
-	 case REQUEST_KILL_JOB:
+	case REQUEST_KILL_JOB:
 		_slurm_rpc_kill_job2(msg);
-		slurm_free_job_step_kill_msg(msg->data);
 		break;
 	case MESSAGE_COMPOSITE:
 		_slurm_rpc_composite_msg(msg);
-		slurm_free_composite_msg(msg->data);
 		break;
 	case REQUEST_ASSOC_MGR_INFO:
 		_slurm_rpc_assoc_mgr_info(msg);
-		slurm_free_assoc_mgr_info_request_msg(msg->data);
-		break;
-	case REQUEST_SICP_INFO:
-		_slurm_rpc_dump_sicp(msg);
-		/* No body to free */
 		break;
 	default:
 		error("invalid RPC msg_type=%u", msg->msg_type);
@@ -774,6 +699,8 @@ static void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
 	conf_ptr->max_mem_per_cpu     = conf->max_mem_per_cpu;
 	conf_ptr->max_step_cnt        = conf->max_step_cnt;
 	conf_ptr->max_tasks_per_node  = conf->max_tasks_per_node;
+	conf_ptr->mcs_plugin          = xstrdup(conf->mcs_plugin);
+	conf_ptr->mcs_plugin_params   = xstrdup(conf->mcs_plugin_params);
 	conf_ptr->mem_limit_enforce   = conf->mem_limit_enforce;
 	conf_ptr->min_job_age         = conf->min_job_age;
 	conf_ptr->mpi_default         = xstrdup(conf->mpi_default);
@@ -782,6 +709,7 @@ static void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
 	conf_ptr->msg_timeout         = conf->msg_timeout;
 
 	conf_ptr->next_job_id         = get_next_job_id();
+	conf_ptr->node_features_plugins = xstrdup(conf->node_features_plugins);
 	conf_ptr->node_prefix         = xstrdup(conf->node_prefix);
 
 	conf_ptr->over_time_limit     = conf->over_time_limit;
@@ -893,6 +821,7 @@ static void _fill_ctld_conf(slurm_ctl_conf_t * conf_ptr)
 	conf_ptr->task_prolog         = xstrdup(conf->task_prolog);
 	conf_ptr->task_plugin         = xstrdup(conf->task_plugin);
 	conf_ptr->task_plugin_param   = conf->task_plugin_param;
+	conf_ptr->tcp_timeout         = conf->tcp_timeout;
 	conf_ptr->tmp_fs              = xstrdup(conf->tmp_fs);
 	conf_ptr->topology_param      = xstrdup(conf->topology_param);
 	conf_ptr->topology_plugin     = xstrdup(conf->topology_plugin);
@@ -1148,15 +1077,7 @@ static void _slurm_rpc_allocate_resources(slurm_msg_t * msg)
 			       (sizeof(uint16_t) * job_ptr->job_resrcs->
 				cpu_array_cnt));
 		}
-		if (job_ptr->details->env_cnt) {
-			alloc_msg.env_size = job_ptr->details->env_cnt;
-			alloc_msg.environment = xmalloc(sizeof(char *) *
-							alloc_msg.env_size);
-			for (i = 0; i < alloc_msg.env_size; i++) {
-				alloc_msg.environment[i] =
-					xstrdup(job_ptr->details->env_sup[i]);
-			}
-		}
+
 		alloc_msg.error_code     = error_code;
 		alloc_msg.job_id         = job_ptr->job_id;
 		alloc_msg.node_cnt       = job_ptr->node_cnt;
@@ -1168,8 +1089,35 @@ static void _slurm_rpc_allocate_resources(slurm_msg_t * msg)
 		if (job_ptr->details) {
 			alloc_msg.pn_min_memory = job_ptr->details->
 						  pn_min_memory;
+
+			if (job_ptr->details->mc_ptr) {
+				alloc_msg.ntasks_per_board =
+					job_ptr->details->mc_ptr->
+					ntasks_per_board;
+				alloc_msg.ntasks_per_core =
+					job_ptr->details->mc_ptr->
+					ntasks_per_core;
+				alloc_msg.ntasks_per_socket =
+					job_ptr->details->mc_ptr->
+					ntasks_per_socket;
+			}
+
+			if (job_ptr->details->env_cnt) {
+				alloc_msg.env_size = job_ptr->details->env_cnt;
+				alloc_msg.environment =
+					xmalloc(sizeof(char *) *
+						alloc_msg.env_size);
+				for (i = 0; i < alloc_msg.env_size; i++) {
+					alloc_msg.environment[i] =
+						xstrdup(job_ptr->details->
+							env_sup[i]);
+				}
+			}
 		} else {
 			alloc_msg.pn_min_memory = 0;
+			alloc_msg.ntasks_per_board = (uint16_t)NO_VAL;
+			alloc_msg.ntasks_per_core = (uint16_t)NO_VAL;
+			alloc_msg.ntasks_per_socket = (uint16_t)NO_VAL;
 		}
 		if (job_ptr->account)
 			alloc_msg.account = xstrdup(job_ptr->account);
@@ -1177,7 +1125,8 @@ static void _slurm_rpc_allocate_resources(slurm_msg_t * msg)
 			slurmdb_qos_rec_t *qos;
 
 			qos = (slurmdb_qos_rec_t *)job_ptr->qos_ptr;
-			if (strcmp(qos->description, "Normal QOS default") == 0)
+			if (xstrcmp(qos->description,
+				    "Normal QOS default") == 0)
 				alloc_msg.qos = xstrdup("normal");
 			else
 				alloc_msg.qos = xstrdup(qos->description);
@@ -1311,41 +1260,6 @@ static void _slurm_rpc_dump_jobs(slurm_msg_t * msg)
 	}
 }
 
-/* _slurm_rpc_dump_sicp - process RPC for SICP job state information */
-static void _slurm_rpc_dump_sicp(slurm_msg_t * msg)
-{
-	DEF_TIMERS;
-	char *dump;
-	int dump_size;
-	slurm_msg_t response_msg;
-	/* Locks: Read config job, write partition (for hiding) */
-	slurmctld_lock_t job_read_lock = {
-		READ_LOCK, READ_LOCK, NO_LOCK, WRITE_LOCK };
-	uid_t uid = g_slurm_auth_get_uid(msg->auth_cred, slurm_get_auth_info());
-
-	START_TIMER;
-	debug2("Processing RPC: REQUEST_SICP_INFO from uid=%d", uid);
-	lock_slurmctld(job_read_lock);
-	pack_all_sicp(&dump, &dump_size,
-		      g_slurm_auth_get_uid(msg->auth_cred, slurm_get_auth_info()),
-		      msg->protocol_version);
-	unlock_slurmctld(job_read_lock);
-	END_TIMER2("_slurm_rpc_dump_sicp");
-
-	/* init response_msg structure */
-	slurm_msg_t_init(&response_msg);
-	response_msg.flags = msg->flags;
-	response_msg.protocol_version = msg->protocol_version;
-	response_msg.address = msg->address;
-	response_msg.msg_type = RESPONSE_SICP_INFO;
-	response_msg.data = dump;
-	response_msg.data_size = dump_size;
-
-	/* send message */
-	slurm_send_node_msg(msg->conn_fd, &response_msg);
-	xfree(dump);
-}
-
 /* _slurm_rpc_dump_jobs - process RPC for job state information */
 static void _slurm_rpc_dump_jobs_user(slurm_msg_t * msg)
 {
@@ -2080,7 +1994,7 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg, bool locked)
 	job_ptr = find_job_record(comp_msg->job_id);
 
 	if (job_ptr && job_ptr->batch_host && comp_msg->node_name &&
-	    strcmp(job_ptr->batch_host, comp_msg->node_name)) {
+	    xstrcmp(job_ptr->batch_host, comp_msg->node_name)) {
 		/* This can be the result of the slurmd on the batch_host
 		 * failing, but the slurmstepd continuing to run. Then the
 		 * batch job is requeued and started on a different node.
@@ -2099,11 +2013,17 @@ static void _slurm_rpc_complete_batch_script(slurm_msg_t * msg, bool locked)
 	}
 
 	/* Send batch step info to accounting, only if the job is
-	 * still completing.  If the job was requeued because of node
-	 * failure (state == pending) an epilog script might not of
-	 * ran so we already finished the last instance of the job so
-	 * this would be put on the requeued instance which is
-	 * incorrect.
+	 * still completing.
+	 *
+	 * When a job is requeued because of node failure, and there is no
+	 * epilog, both EPILOG_COMPLETE and COMPLETE_BATCH_SCRIPT_COMPLETE
+	 * messages are sent at the same time and receieved on different
+	 * threads. EPILOG_COMPLETE will grab a new db_index for the job. So if
+	 * COMPLETE_BATCH_SCRIPT happens after EPILOG_COMPLETE, then adding the
+	 * batch step would happen on the new db instance -- which is incorrect.
+	 * Rather than try to ensure that COMPLETE_BATCH_SCRIPT happens after
+	 * EPILOG_COMPLETE, just throw away the batch step for node failures.
+	 *
 	 * NOTE: Do not use IS_JOB_PENDING since that doesn't take
 	 * into account the COMPLETING FLAG which is valid, but not
 	 * always set yet when the step exits normally.
@@ -2805,7 +2725,8 @@ static void _slurm_rpc_job_alloc_info_lite(slurm_msg_t * msg)
 		if (job_ptr->qos_ptr) {
 			slurmdb_qos_rec_t *qos;
 			qos = (slurmdb_qos_rec_t *)job_ptr->qos_ptr;
-			if (strcmp(qos->description, "Normal QOS default") == 0)
+			if (xstrcmp(qos->description,
+				    "Normal QOS default") == 0)
 				job_info_resp_msg.qos = xstrdup("normal");
 			else
 				job_info_resp_msg.qos=xstrdup(qos->description);
@@ -4118,7 +4039,7 @@ static void _slurm_rpc_layout_show(slurm_msg_t * msg)
 		if ( layouts_pack_layout(layout_req_msg->layout_type,
 					 layout_req_msg->entities,
 					 layout_req_msg->type,
-					 layout_req_msg->no_relation,
+					 layout_req_msg->flags,
 					 buffer) != SLURM_SUCCESS) {
 			debug2("%s: unable to get layout[%s]",
 			       __func__, layout_req_msg->layout_type);
@@ -4407,6 +4328,34 @@ inline static void _slurm_rpc_suspend(slurm_msg_t * msg)
 	}
 }
 
+inline static void _slurm_rpc_top_job(slurm_msg_t * msg)
+{
+	int error_code = SLURM_SUCCESS;
+	DEF_TIMERS;
+	top_job_msg_t *top_ptr = (top_job_msg_t *) msg->data;
+	/* Locks: write job */
+	slurmctld_lock_t job_write_lock = {
+		NO_LOCK, WRITE_LOCK, NO_LOCK, NO_LOCK };
+	uid_t uid = g_slurm_auth_get_uid(msg->auth_cred, slurm_get_auth_info());
+
+	debug("Processing RPC: REQUEST_TOP_JOB from uid=%u", (unsigned int)uid);
+
+	START_TIMER;
+	lock_slurmctld(job_write_lock);
+	error_code = job_set_top(top_ptr, uid, msg->conn_fd,
+				 msg->protocol_version);
+	unlock_slurmctld(job_write_lock);
+	END_TIMER2("_slurm_rpc_top");
+
+	if (error_code) {
+		info("%s for %s %s",
+		     __func__, top_ptr->job_id_str, slurm_strerror(error_code));
+	} else {
+		info("%s for %s %s",
+		     __func__, top_ptr->job_id_str, TIME_STR);
+	}
+}
+
 inline static void _slurm_rpc_requeue(slurm_msg_t * msg)
 {
 	int error_code = SLURM_SUCCESS;
@@ -4734,6 +4683,7 @@ static int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid,
 	launch_msg_ptr->uid = uid;
 	launch_msg_ptr->nodes = xstrdup(job_ptr->alias_list);
 	launch_msg_ptr->partition = xstrdup(job_ptr->partition);
+
 	launch_msg_ptr->restart_cnt = job_ptr->restart_cnt;
 	if (job_ptr->details) {
 		launch_msg_ptr->pn_min_memory = job_ptr->details->
@@ -4794,6 +4744,11 @@ static int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid,
 	launch_msg_ptr->select_jobinfo = select_g_select_jobinfo_copy(
 		job_ptr->select_jobinfo);
 
+	if (job_desc_msg->profile != ACCT_GATHER_PROFILE_NOT_SET)
+		launch_msg_ptr->profile = job_desc_msg->profile;
+	else
+		launch_msg_ptr->profile = job_ptr->profile;
+
 	/* FIXME: for some reason these CPU arrays total all the CPUs
 	 * actually allocated, rather than totaling up to the requested
 	 * CPU count for the allocation.
@@ -5250,7 +5205,7 @@ inline static void _slurm_rpc_reboot_nodes(slurm_msg_t * msg)
 	/* do RPC call */
 	if (reboot_msg)
 		nodelist = reboot_msg->node_list;
-	if (!nodelist || !strcasecmp(nodelist, "ALL")) {
+	if (!nodelist || !xstrcasecmp(nodelist, "ALL")) {
 		bitmap = bit_alloc(node_record_count);
 		bit_nset(bitmap, 0, (node_record_count - 1));
 	} else if (node_name2bitmap(nodelist, false, &bitmap) != 0) {
diff --git a/src/slurmctld/read_config.c b/src/slurmctld/read_config.c
index 7bbb37bf9..271ce971a 100644
--- a/src/slurmctld/read_config.c
+++ b/src/slurmctld/read_config.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Morris Jette <jette1@llnl.gov>.
  *  CODE-OCEC-09-009. All rights reserved.
@@ -65,11 +65,13 @@
 #include "src/common/layouts_mgr.h"
 #include "src/common/list.h"
 #include "src/common/macros.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/parse_spec.h"
 #include "src/common/power.h"
 #include "src/common/read_config.h"
 #include "src/common/slurm_jobcomp.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_topology.h"
 #include "src/common/slurm_rlimits_info.h"
 #include "src/common/slurm_route.h"
@@ -96,13 +98,23 @@
 #include "src/slurmctld/srun_comm.h"
 #include "src/slurmctld/trigger_mgr.h"
 
+#define FEATURE_MAGIC	0x34dfd8b5
+
+/* Global variables */
+List active_feature_list;	/* list of currently active features_records */
+List avail_feature_list;	/* list of available features_records */
 bool slurmctld_init_db = 1;
 
 static void _acct_restore_active_jobs(void);
+static void _add_config_feature(List feature_list, char *feature,
+				bitstr_t *node_bitmap);
+static void _add_config_feature_inx(List feature_list, char *feature,
+				    int node_inx);
 static int  _build_bitmaps(void);
 static void _build_bitmaps_pre_select(void);
 static void _gres_reconfig(bool reconfig);
 static int  _init_all_slurm_conf(void);
+static void _list_delete_feature(void *feature_entry);
 static int  _preserve_select_type_param(slurm_ctl_conf_t * ctl_conf_ptr,
 					uint16_t old_select_type_p);
 static int  _preserve_plugins(slurm_ctl_conf_t * ctl_conf_ptr,
@@ -126,9 +138,6 @@ static int  _sync_nodes_to_active_job(struct job_record *job_ptr);
 static void _sync_nodes_to_suspended_job(struct job_record *job_ptr);
 static void _sync_part_prio(void);
 static int  _update_preempt(uint16_t old_enable_preempt);
-#ifdef 	HAVE_ELAN
-static void _validate_node_proc_count(void);
-#endif
 static int _compare_hostnames(struct node_record *old_node_table,
 							  int old_node_count,
 							  struct node_record *node_table,
@@ -338,8 +347,8 @@ static int _build_bitmaps(void)
 
 	/* scan all nodes and identify which are up, idle and
 	 * their configuration, resync DRAINED vs. DRAINING state */
-	for (i=0, node_ptr=node_record_table_ptr;
-	     i<node_record_count; i++, node_ptr++) {
+	for (i = 0, node_ptr = node_record_table_ptr;
+	     i < node_record_count; i++, node_ptr++) {
 		uint32_t drain_flag, job_cnt;
 
 		if (node_ptr->name[0] == '\0')
@@ -365,13 +374,6 @@ static int _build_bitmaps(void)
 			bit_set(node_ptr->config_ptr->node_bitmap, i);
 	}
 
-	config_iterator = list_iterator_create(config_list);
-	while ((config_ptr = (struct config_record *)
-				      list_next(config_iterator))) {
-		build_config_feature_list(config_ptr);
-	}
-	list_iterator_destroy(config_iterator);
-
 	return error_code;
 }
 
@@ -683,7 +685,8 @@ static int _build_single_partitionline_info(slurm_conf_partition_t *part)
 	part_ptr->min_nodes      = part->min_nodes;
 	part_ptr->min_nodes_orig = part->min_nodes;
 	part_ptr->preempt_mode   = part->preempt_mode;
-	part_ptr->priority       = part->priority;
+	part_ptr->priority_job_factor = part->priority_job_factor;
+	part_ptr->priority_tier  = part->priority_tier;
 	part_ptr->qos_char       = xstrdup(part->qos_char);
 	part_ptr->state_up       = part->state_up;
 	part_ptr->grace_time     = part->grace_time;
@@ -832,16 +835,17 @@ static void _sync_part_prio(void)
 	part_max_priority = 0;
 	itr = list_iterator_create(part_list);
 	while ((part_ptr = list_next(itr))) {
-		if (part_ptr->priority > part_max_priority)
-			part_max_priority = part_ptr->priority;
+		if (part_ptr->priority_job_factor > part_max_priority)
+			part_max_priority = part_ptr->priority_job_factor;
 	}
 	list_iterator_destroy(itr);
 
 	if (part_max_priority) {
 		itr = list_iterator_create(part_list);
 		while ((part_ptr = list_next(itr))) {
-			part_ptr->norm_priority = (double)part_ptr->priority /
-						  (double)part_max_priority;
+			part_ptr->norm_priority =
+				(double)part_ptr->priority_job_factor /
+				(double)part_max_priority;
 		}
 		list_iterator_destroy(itr);
 	}
@@ -1083,9 +1087,21 @@ int read_slurm_conf(int recover, bool reconfig)
 
 	/* NOTE: Run restore_node_features before _restore_job_dependencies */
 	restore_node_features(recover);
-#ifdef 	HAVE_ELAN
-	_validate_node_proc_count();
-#endif
+
+	if (node_features_g_count() > 0) {
+		if (node_features_g_get_node(NULL) != SLURM_SUCCESS)
+			error("failed to initialize node features");
+		build_feature_list_ne();
+	} else {
+		/* Copy node's available_features to active_features */
+		for (i=0, node_ptr=node_record_table_ptr; i<node_record_count;
+		     i++, node_ptr++) {
+			xfree(node_ptr->features_act);
+			node_ptr->features_act = xstrdup(node_ptr->features);
+		}
+		build_feature_list_eq();
+	}
+
 	(void) _sync_nodes_to_comp_job();/* must follow select_g_node_init() */
 	load_part_uid_allow_list(1);
 
@@ -1128,6 +1144,8 @@ int read_slurm_conf(int recover, bool reconfig)
 	error_code = MAX(error_code, rc);	/* not fatal */
 	rc = switch_g_reconfig();
 	error_code = MAX(error_code, rc);	/* not fatal */
+	rc = node_features_g_reconfig();
+	error_code = MAX(error_code, rc);	/* not fatal */
 	rc = _preserve_select_type_param(&slurmctld_conf, old_select_type_p);
 	error_code = MAX(error_code, rc);	/* not fatal */
 	if (reconfig)
@@ -1143,12 +1161,209 @@ int read_slurm_conf(int recover, bool reconfig)
 
 	/* Sync select plugin with synchronized job/node/part data */
 	select_g_reconfigure();
+	if (reconfig) {
+		if (slurm_mcs_reconfig() != SLURM_SUCCESS)
+			fatal("Failed to reconfigure mcs plugin");
+	}
 
 	slurmctld_conf.last_update = time(NULL);
 	END_TIMER2("read_slurm_conf");
 	return error_code;
 }
 
+/* Add feature to list
+ * feature_list IN - destination list, either active_feature_list or
+ *	avail_feature_list
+ * feature IN - name of the feature to add
+ * node_bitmap IN - bitmap of nodes with named feature */
+static void _add_config_feature(List feature_list, char *feature,
+				bitstr_t *node_bitmap)
+{
+	node_feature_t *feature_ptr;
+	ListIterator feature_iter;
+	bool match = false;
+
+	/* If feature already in avail_feature_list, just update the bitmap */
+	feature_iter = list_iterator_create(feature_list);
+	while ((feature_ptr = (node_feature_t *) list_next(feature_iter))) {
+		if (xstrcmp(feature, feature_ptr->name))
+			continue;
+		bit_or(feature_ptr->node_bitmap, node_bitmap);
+		match = true;
+		break;
+	}
+	list_iterator_destroy(feature_iter);
+
+	if (!match) {	/* Need to create new avail_feature_list record */
+		feature_ptr = xmalloc(sizeof(node_feature_t));
+		feature_ptr->magic = FEATURE_MAGIC;
+		feature_ptr->name = xstrdup(feature);
+		feature_ptr->node_bitmap = bit_copy(node_bitmap);
+		list_append(feature_list, feature_ptr);
+	}
+}
+
+/* Add feature to list
+ * feature_list IN - destination list, either active_feature_list or
+ *	avail_feature_list
+ * feature IN - name of the feature to add
+ * node_inx IN - index of the node with named feature */
+static void _add_config_feature_inx(List feature_list, char *feature,
+				    int node_inx)
+{
+	node_feature_t *feature_ptr;
+	ListIterator feature_iter;
+	bool match = false;
+
+	/* If feature already in avail_feature_list, just update the bitmap */
+	feature_iter = list_iterator_create(feature_list);
+	while ((feature_ptr = (node_feature_t *) list_next(feature_iter))) {
+		if (xstrcmp(feature, feature_ptr->name))
+			continue;
+		bit_set(feature_ptr->node_bitmap, node_inx);
+		match = true;
+		break;
+	}
+	list_iterator_destroy(feature_iter);
+
+	if (!match) {	/* Need to create new avail_feature_list record */
+		feature_ptr = xmalloc(sizeof(node_feature_t));
+		feature_ptr->magic = FEATURE_MAGIC;
+		feature_ptr->name = xstrdup(feature);
+		feature_ptr->node_bitmap = bit_alloc(node_record_count);
+		bit_set(feature_ptr->node_bitmap, node_inx);
+		list_append(feature_list, feature_ptr);
+	}
+}
+
+/* _list_delete_feature - delete an entry from the feature list,
+ *	see list.h for documentation */
+static void _list_delete_feature(void *feature_entry)
+{
+	node_feature_t *feature_ptr = (node_feature_t *) feature_entry;
+
+	xassert(feature_ptr);
+	xassert(feature_ptr->magic == FEATURE_MAGIC);
+	xfree (feature_ptr->name);
+	FREE_NULL_BITMAP (feature_ptr->node_bitmap);
+	xfree (feature_ptr);
+}
+
+/* For a configuration where available_features == active_features,
+ * build new active and available feature lists */
+extern void build_feature_list_eq(void)
+{
+	ListIterator config_iterator;
+	struct config_record *config_ptr;
+	node_feature_t *active_feature_ptr, *avail_feature_ptr;
+	ListIterator feature_iter;
+
+	char *tmp_str, *token, *last = NULL;
+
+	FREE_NULL_LIST(active_feature_list);
+	FREE_NULL_LIST(avail_feature_list);
+	active_feature_list = list_create(_list_delete_feature);
+	avail_feature_list = list_create(_list_delete_feature);
+
+	config_iterator = list_iterator_create(config_list);
+	while ((config_ptr = (struct config_record *)
+			list_next(config_iterator))) {
+		if (config_ptr->feature) {
+			tmp_str = xstrdup(config_ptr->feature);
+			token = strtok_r(tmp_str, ",", &last);
+			while (token) {
+				_add_config_feature(avail_feature_list, token,
+						    config_ptr->node_bitmap);
+				token = strtok_r(NULL, ",", &last);
+			}
+			xfree(tmp_str);
+		}
+	}
+	list_iterator_destroy(config_iterator);
+
+	/* Copy avail_feature_list to active_feature_list */
+	feature_iter = list_iterator_create(avail_feature_list);
+	while ((avail_feature_ptr = (node_feature_t *)list_next(feature_iter))){
+		active_feature_ptr = xmalloc(sizeof(node_feature_t));
+		active_feature_ptr->magic = FEATURE_MAGIC;
+		active_feature_ptr->name = xstrdup(avail_feature_ptr->name);
+		active_feature_ptr->node_bitmap =
+			bit_copy(avail_feature_ptr->node_bitmap);
+		list_append(active_feature_list, active_feature_ptr);
+	}
+	list_iterator_destroy(feature_iter);
+}
+
+/* For a configuration where available_features != active_features,
+ * build new active and available feature lists */
+extern void build_feature_list_ne(void)
+{
+	struct node_record *node_ptr;
+	char *tmp_str, *token, *last = NULL;
+	int i;
+
+	FREE_NULL_LIST(active_feature_list);
+	FREE_NULL_LIST(avail_feature_list);
+	active_feature_list = list_create(_list_delete_feature);
+	avail_feature_list = list_create(_list_delete_feature);
+
+	for (i = 0, node_ptr = node_record_table_ptr; i < node_record_count;
+	     i++, node_ptr++) {
+		if (node_ptr->features_act) {
+			tmp_str = xstrdup(node_ptr->features_act);
+			token = strtok_r(tmp_str, ",", &last);
+			while (token) {
+				_add_config_feature_inx(active_feature_list,
+							token, i);
+				token = strtok_r(NULL, ",", &last);
+			}
+			xfree(tmp_str);
+		}
+		if (node_ptr->features) {
+			tmp_str = xstrdup(node_ptr->features);
+			token = strtok_r(tmp_str, ",", &last);
+			while (token) {
+				_add_config_feature_inx(avail_feature_list,
+							token, i);
+				token = strtok_r(NULL, ",", &last);
+			}
+			xfree(tmp_str);
+		}
+	}
+}
+
+/* Update active_feature_list or avail_feature_list
+ * feature_list IN - List to update: active_feature_list or avail_feature_list
+ * new_features IN - New active_features
+ * node_bitmap IN - Nodes with the new active_features value */
+extern void update_feature_list(List feature_list, char *new_features,
+				bitstr_t *node_bitmap)
+{
+	node_feature_t *feature_ptr;
+	ListIterator feature_iter;
+	char *tmp_str, *token, *last = NULL;
+
+	/* Clear these nodes from the feature_list record,
+	 * then restore as needed */
+	feature_iter = list_iterator_create(feature_list);
+	bit_not(node_bitmap);
+	while ((feature_ptr = (node_feature_t *) list_next(feature_iter))) {
+		bit_and(feature_ptr->node_bitmap, node_bitmap);
+	}
+	list_iterator_destroy(feature_iter);
+	bit_not(node_bitmap);
+
+	if (new_features) {
+		tmp_str = xstrdup(new_features);
+		token = strtok_r(tmp_str, ",", &last);
+		while (token) {
+			_add_config_feature(feature_list, token, node_bitmap);
+			token = strtok_r(NULL, ",", &last);
+		}
+		xfree(tmp_str);
+	}
+}
+
 static void _gres_reconfig(bool reconfig)
 {
 	struct node_record *node_ptr;
@@ -1251,6 +1466,7 @@ static int _restore_node_state(int recover,
 
 		node_ptr->last_response = old_node_ptr->last_response;
 		node_ptr->protocol_version = old_node_ptr->protocol_version;
+		node_ptr->cpu_load = old_node_ptr->cpu_load;
 
 		/* make sure we get the old state from the select
 		 * plugin, just swap it out to avoid possible memory leak */
@@ -1582,10 +1798,19 @@ static int  _restore_part_state(List old_part_list, char *old_def_part_name,
 				part_ptr->preempt_mode = old_part_ptr->
 							 preempt_mode;
 			}
-			if (part_ptr->priority != old_part_ptr->priority) {
-				error("Partition %s Priority differs from "
+			if (part_ptr->priority_job_factor !=
+			    old_part_ptr->priority_job_factor) {
+				error("Partition %s PriorityJobFactor differs "
+				      "from slurm.conf", part_ptr->name);
+				part_ptr->priority_job_factor =
+					old_part_ptr->priority_job_factor;
+			}
+			if (part_ptr->priority_tier !=
+			    old_part_ptr->priority_tier) {
+				error("Partition %s PriorityTier differs from "
 				      "slurm.conf", part_ptr->name);
-				part_ptr->priority = old_part_ptr->priority;
+				part_ptr->priority_tier =
+					old_part_ptr->priority_tier;
 			}
 			if (part_ptr->state_up != old_part_ptr->state_up) {
 				error("Partition %s State differs from "
@@ -1638,7 +1863,9 @@ static int  _restore_part_state(List old_part_list, char *old_def_part_name,
 			part_ptr->min_nodes_orig = old_part_ptr->
 						   min_nodes_orig;
 			part_ptr->nodes = xstrdup(old_part_ptr->nodes);
-			part_ptr->priority = old_part_ptr->priority;
+			part_ptr->priority_job_factor =
+				old_part_ptr->priority_job_factor;
+			part_ptr->priority_tier = old_part_ptr->priority_tier;
 			part_ptr->state_up = old_part_ptr->state_up;
 		}
 	}
@@ -1911,6 +2138,11 @@ static int _sync_nodes_to_active_job(struct job_record *job_ptr)
 			node_ptr->owner = job_ptr->user_id;
 		}
 
+		if (slurm_mcs_get_select(job_ptr) == 1) {
+			xfree(node_ptr->mcs_label);
+			node_ptr->mcs_label = xstrdup(job_ptr->mcs_label);
+		}
+
 		node_flags = node_ptr->node_state & NODE_STATE_FLAGS;
 
 		node_ptr->run_job_cnt++; /* NOTE:
@@ -1983,46 +2215,6 @@ static void _sync_nodes_to_suspended_job(struct job_record *job_ptr)
 	return;
 }
 
-#ifdef 	HAVE_ELAN
-/* Every node in a given partition must have the same processor count
- * at present, ensured by this function. */
-static void _validate_node_proc_count(void)
-{
-	ListIterator part_iterator;
-	struct part_record *part_ptr;
-	struct node_record *node_ptr;
-	int first_bit, last_bit, i, node_size, part_size;
-
-	part_iterator = list_iterator_create(part_list);
-	while ((part_ptr = (struct part_record *) list_next(part_iterator))) {
-		first_bit = bit_ffs(part_ptr->node_bitmap);
-		last_bit = bit_fls(part_ptr->node_bitmap);
-		part_size = -1;
-		for (i = first_bit; i <= last_bit; i++) {
-			if (bit_test(part_ptr->node_bitmap, i) == 0)
-				continue;
-			node_ptr = node_record_table_ptr + i;
-
-			if (slurmctld_conf.fast_schedule)
-				node_size = node_ptr->config_ptr->cpus;
-			else if (node_ptr->cpus < node_ptr->config_ptr->cpus)
-				continue;    /* node too small, will be DOWN */
-			else if (IS_NODE_DOWN(node_ptr))
-				continue;
-			else
-				node_size = node_ptr->cpus;
-
-			if (part_size == -1)
-				part_size = node_size;
-			else if (part_size != node_size)
-				fatal("Partition %s has inconsistent "
-					"processor count", part_ptr->name);
-		}
-	}
-	list_iterator_destroy(part_iterator);
-}
-#endif
-
 /*
  * _restore_job_dependencies - Build depend_list and license_list for every job
  *	also reset the running job count for scheduling policy
diff --git a/src/slurmctld/read_config.h b/src/slurmctld/read_config.h
index 50fd003f2..9a5e05b8c 100644
--- a/src/slurmctld/read_config.h
+++ b/src/slurmctld/read_config.h
@@ -67,4 +67,19 @@ extern int read_slurm_conf(int recover, bool reconfig);
 extern int dump_config_state_lite(void);
 extern int load_config_state_lite(void);
 
+/* For a configuration where available_features == active_features,
+ * build new active and available feature lists */
+extern void build_feature_list_eq(void);
+
+/* For a configuration where available_features != active_features,
+ * build new active and available feature lists */
+extern void build_feature_list_ne(void);
+
+/* Update active_feature_list or avail_feature_list
+ * feature_list IN - List to update: active_feature_list or avail_feature_list
+ * new_features IN - New active_features
+ * node_bitmap IN - Nodes with the new active_features value */
+extern void update_feature_list(List feature_list, char *new_features,
+				bitstr_t *node_bitmap);
+
 #endif /* !_HAVE_READ_CONFIG_H */
diff --git a/src/slurmctld/reservation.c b/src/slurmctld/reservation.c
index 98f4a64e3..0597b278b 100644
--- a/src/slurmctld/reservation.c
+++ b/src/slurmctld/reservation.c
@@ -151,6 +151,7 @@ static void *_fork_script(void *x);
 static void _free_script_arg(resv_thread_args_t *args);
 static void _generate_resv_id(void);
 static void _generate_resv_name(resv_desc_msg_t *resv_ptr);
+static int  _get_core_resrcs(slurmctld_resv_t *resv_ptr);
 static uint32_t _get_job_duration(struct job_record *job_ptr);
 static bool _is_account_valid(char *account);
 static bool _is_resv_used(slurmctld_resv_t *resv_ptr);
@@ -171,7 +172,6 @@ static int  _post_resv_create(slurmctld_resv_t *resv_ptr);
 static int  _post_resv_delete(slurmctld_resv_t *resv_ptr);
 static int  _post_resv_update(slurmctld_resv_t *resv_ptr,
 			      slurmctld_resv_t *old_resv_ptr);
-static void _rebuild_core_bitmap(slurmctld_resv_t *resv_ptr);
 static int  _resize_resv(slurmctld_resv_t *resv_ptr, uint32_t node_cnt);
 static void _restore_resv(slurmctld_resv_t *dest_resv,
 			  slurmctld_resv_t *src_resv);
@@ -183,6 +183,7 @@ static int  _select_nodes(resv_desc_msg_t *resv_desc_ptr,
 			  struct part_record **part_ptr,
 			  bitstr_t **resv_bitmap, bitstr_t **core_bitmap);
 static int  _set_assoc_list(slurmctld_resv_t *resv_ptr);
+static void _set_core_resrcs(slurmctld_resv_t *resv_ptr);
 static void _set_tres_cnt(slurmctld_resv_t *resv_ptr,
 			  slurmctld_resv_t *old_resv_ptr);
 static void _set_nodes_flags(slurmctld_resv_t *resv_ptr, time_t now,
@@ -274,6 +275,10 @@ static slurmctld_resv_t *_copy_resv(slurmctld_resv_t *resv_orig_ptr)
 						      core_bitmap);
 	}
 	resv_copy_ptr->core_cnt = resv_orig_ptr->core_cnt;
+	if (resv_orig_ptr->core_resrcs) {
+		resv_copy_ptr->core_resrcs = copy_job_resources(resv_orig_ptr->
+								core_resrcs);
+	}
 	resv_copy_ptr->duration = resv_orig_ptr->duration;
 	resv_copy_ptr->end_time = resv_orig_ptr->end_time;
 	resv_copy_ptr->features = xstrdup(resv_orig_ptr->features);
@@ -349,6 +354,11 @@ static void _restore_resv(slurmctld_resv_t *dest_resv,
 	src_resv->core_bitmap = NULL;
 
 	dest_resv->core_cnt = src_resv->core_cnt;
+
+	free_job_resources(&dest_resv->core_resrcs);
+	dest_resv->core_resrcs = src_resv->core_resrcs;
+	src_resv->core_resrcs = NULL;
+
 	dest_resv->duration = src_resv->duration;
 	dest_resv->end_time = src_resv->end_time;
 
@@ -424,12 +434,13 @@ static void _del_resv_rec(void *x)
 		xassert(resv_ptr->magic == RESV_MAGIC);
 		resv_ptr->magic = 0;
 		xfree(resv_ptr->accounts);
-		for (i=0; i<resv_ptr->account_cnt; i++)
+		for (i = 0; i < resv_ptr->account_cnt; i++)
 			xfree(resv_ptr->account_list[i]);
 		xfree(resv_ptr->account_list);
 		xfree(resv_ptr->assoc_list);
 		xfree(resv_ptr->burst_buffer);
 		FREE_NULL_BITMAP(resv_ptr->core_bitmap);
+		free_job_resources(&resv_ptr->core_resrcs);
 		xfree(resv_ptr->features);
 		FREE_NULL_LIST(resv_ptr->license_list);
 		xfree(resv_ptr->licenses);
@@ -464,7 +475,7 @@ static int _find_resv_name(void *x, void *key)
 
 	xassert(resv_ptr->magic == RESV_MAGIC);
 
-	if (strcmp(resv_ptr->name, (char *) key))
+	if (xstrcmp(resv_ptr->name, (char *) key))
 		return 0;
 	else
 		return 1;	/* match */
@@ -840,8 +851,7 @@ static int _post_resv_update(slurmctld_resv_t *resv_ptr,
 	resv.time_end = resv_ptr->end_time;
 
 	if (old_resv_ptr->assoc_list && resv_ptr->assoc_list) {
-		if (strcmp(old_resv_ptr->assoc_list,
-			   resv_ptr->assoc_list))
+		if (xstrcmp(old_resv_ptr->assoc_list, resv_ptr->assoc_list))
 			resv.assocs = resv_ptr->assoc_list;
 	} else if (resv_ptr->assoc_list)
 		resv.assocs = resv_ptr->assoc_list;
@@ -855,8 +865,7 @@ static int _post_resv_update(slurmctld_resv_t *resv_ptr,
 		resv.flags = NO_VAL;
 
 	if (old_resv_ptr->node_list && resv_ptr->node_list) {
-		if (strcmp(old_resv_ptr->node_list,
-			   resv_ptr->node_list))
+		if (xstrcmp(old_resv_ptr->node_list, resv_ptr->node_list))
 			resv.nodes = resv_ptr->node_list;
 	} else if (resv_ptr->node_list)
 		resv.nodes = resv_ptr->node_list;
@@ -1049,7 +1058,7 @@ static int  _update_account_list(slurmctld_resv_t *resv_ptr,
 				char *test_name = resv_ptr->account_list[j];
 				if (test_name[0] == '-')
 					test_name++;
-				if (strcmp(test_name, ac_list[i]))
+				if (xstrcmp(test_name, ac_list[i]))
 					continue;
 				found_it = true;
 				xfree(resv_ptr->account_list[j]);
@@ -1082,7 +1091,7 @@ static int  _update_account_list(slurmctld_resv_t *resv_ptr,
 				char *test_name = resv_ptr->account_list[j];
 				if (test_name[0] == '-')
 					test_name++;
-				if (strcmp(test_name, ac_list[i]))
+				if (xstrcmp(test_name, ac_list[i]))
 					continue;
 				found_it = true;
 				break;
@@ -1356,6 +1365,115 @@ static int _update_uid_list(slurmctld_resv_t *resv_ptr, char *users)
 	return ESLURM_USER_ID_MISSING;
 }
 
+/* Given a core_resrcs data structure (which has information only about the
+ * nodes in that reservation), build a global core_bitmap (which includes
+ * information about all nodes in the system).
+ * RET SLURM_SUCCESS or error code */
+static int _get_core_resrcs(slurmctld_resv_t *resv_ptr)
+{
+	int i, i_first, i_last, j, node_inx;
+	int c, core_offset_local, core_offset_global, core_end;
+
+	if (!resv_ptr->core_resrcs || resv_ptr->core_bitmap ||
+	    !resv_ptr->core_resrcs->core_bitmap ||
+	    (bit_ffs(resv_ptr->core_resrcs->core_bitmap) == -1))
+		return SLURM_SUCCESS;
+
+	FREE_NULL_BITMAP(resv_ptr->core_resrcs->node_bitmap);
+	if (resv_ptr->core_resrcs->nodes &&
+	    (node_name2bitmap(resv_ptr->core_resrcs->nodes, false,
+			      &resv_ptr->core_resrcs->node_bitmap))) {
+		error("Invalid nodes (%s) for reservation %s",
+		      resv_ptr->core_resrcs->nodes, resv_ptr->name);
+		return SLURM_ERROR;
+	} else if (resv_ptr->core_resrcs->nodes == NULL) {
+		resv_ptr->core_resrcs->node_bitmap =
+			bit_alloc(node_record_count);
+	}
+
+	i = bit_set_count(resv_ptr->core_resrcs->node_bitmap);
+	if (resv_ptr->core_resrcs->nhosts != i) {
+		error("Invalid change in resource allocation node count for "
+		      "reservation %s, %u to %d",
+		      resv_ptr->name, resv_ptr->core_resrcs->nhosts, i);
+		return SLURM_ERROR;
+	}
+
+	_create_cluster_core_bitmap(&resv_ptr->core_bitmap);
+	i_first = bit_ffs(resv_ptr->core_resrcs->node_bitmap);
+	if (i_first >= 0)
+		i_last = bit_fls(resv_ptr->core_resrcs->node_bitmap);
+	else
+		i_last = i_first - 1;
+	for (i = i_first, node_inx = -1; i <= i_last; i++) {
+		if (!bit_test(resv_ptr->core_resrcs->node_bitmap, i))
+			continue;
+		node_inx++;
+		core_offset_global = cr_get_coremap_offset(i);
+		core_end = cr_get_coremap_offset(i + 1);
+		core_offset_local = get_job_resources_offset(
+					resv_ptr->core_resrcs, node_inx, 0, 0);
+		for (c = core_offset_global, j = core_offset_local;
+	 	     c < core_end; c++, j++) {
+			if (!bit_test(resv_ptr->core_resrcs->core_bitmap, j))
+				continue;
+			bit_set(resv_ptr->core_bitmap, c);
+		}
+	}
+
+	return SLURM_SUCCESS;
+}
+
+/* Build core_resrcs based upon node_bitmap and core_bitmap as needed.
+ * This translates a global core_bitmap (including all nodes) to a
+ * core_bitmap for only those nodes in the reservation. This is needed to
+ * handle nodes being added or removed from the system or their core count
+ * changing. */
+static void _set_core_resrcs(slurmctld_resv_t *resv_ptr)
+{
+	int i, i_first, i_last, j, node_inx, rc;
+	int c, core_offset_local, core_offset_global, core_end;
+
+	if (!resv_ptr->core_bitmap || resv_ptr->core_resrcs ||
+	    !resv_ptr->node_bitmap ||
+	    ((i_first = bit_ffs(resv_ptr->node_bitmap)) == -1))
+		return;
+
+	resv_ptr->core_resrcs = create_job_resources();
+	resv_ptr->core_resrcs->nodes = xstrdup(resv_ptr->node_list);
+	resv_ptr->core_resrcs->node_bitmap = bit_copy(resv_ptr->node_bitmap);
+	resv_ptr->core_resrcs->nhosts = bit_set_count(resv_ptr->node_bitmap);
+	rc = build_job_resources(resv_ptr->core_resrcs, node_record_table_ptr,
+				 slurmctld_conf.fast_schedule);
+	if (rc != SLURM_SUCCESS) {
+		free_job_resources(&resv_ptr->core_resrcs);
+		return;
+	}
+	resv_ptr->core_resrcs->cpus = xmalloc(sizeof(uint16_t) *
+					      resv_ptr->core_resrcs->nhosts);
+
+	core_offset_local = -1;
+	node_inx = -1;
+	i_last = bit_fls(resv_ptr->node_bitmap);
+	for (i = i_first; i <= i_last; i++) {
+		if (!bit_test(resv_ptr->node_bitmap, i))
+			continue;
+		node_inx++;
+		core_offset_global = cr_get_coremap_offset(i);
+		core_end = cr_get_coremap_offset(i + 1);
+		for (c = core_offset_global, j = core_offset_local;
+		     c < core_end; c++, j++) {
+			core_offset_local++;
+			if (!bit_test(resv_ptr->core_bitmap, c))
+				continue;
+			if (resv_ptr->core_resrcs->core_bitmap)
+				bit_set(resv_ptr->core_resrcs->core_bitmap,
+					core_offset_local);
+			resv_ptr->core_resrcs->cpus[node_inx]++;
+		}
+	}
+}
+
 /*
  * _pack_resv - dump configuration information about a specific reservation
  *	in machine independent form (for network transmission or state save)
@@ -1390,7 +1508,44 @@ static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer,
 		end_relative = resv_ptr->end_time;
 	}
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		packstr(resv_ptr->accounts,	buffer);
+		packstr(resv_ptr->burst_buffer,	buffer);
+		pack32(resv_ptr->core_cnt,	buffer);
+		pack_time(end_relative,		buffer);
+		packstr(resv_ptr->features,	buffer);
+		pack32(resv_ptr->flags,		buffer);
+		packstr(resv_ptr->licenses,	buffer);
+		packstr(resv_ptr->name,		buffer);
+		pack32(resv_ptr->node_cnt,	buffer);
+		packstr(resv_ptr->node_list,	buffer);
+		packstr(resv_ptr->partition,	buffer);
+		pack32(resv_ptr->resv_watts,    buffer);
+		pack_time(start_relative,	buffer);
+		packstr(resv_ptr->tres_fmt_str,	buffer);
+		packstr(resv_ptr->users,	buffer);
+
+		if (internal) {
+			pack8(resv_ptr->account_not,	buffer);
+			packstr(resv_ptr->assoc_list,	buffer);
+			/* NOTE: Restoring core_bitmap directly only works if
+			 * the system's node and core counts don't change.
+			 * core_resrcs is used so configuration changes can be
+			 * supported */
+			_set_core_resrcs(resv_ptr);
+			pack_job_resources(resv_ptr->core_resrcs, buffer,
+					   protocol_version);
+			pack32(resv_ptr->duration,	buffer);
+			pack8(resv_ptr->full_nodes,	buffer);
+			pack32(resv_ptr->resv_id,	buffer);
+			pack_time(resv_ptr->start_time_prev,	buffer);
+			pack_time(resv_ptr->start_time,	buffer);
+			packstr(resv_ptr->tres_str,	buffer);
+			pack8(resv_ptr->user_not,	buffer);
+		} else {
+			pack_bit_fmt(resv_ptr->node_bitmap, buffer);
+		}
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		packstr(resv_ptr->accounts,	buffer);
 		packstr(resv_ptr->burst_buffer,	buffer);
 		pack32(resv_ptr->core_cnt,	buffer);
@@ -1425,7 +1580,7 @@ static void _pack_resv(slurmctld_resv_t *resv_ptr, Buf buffer,
 		} else {
 			pack_bit_fmt(resv_ptr->node_bitmap, buffer);
 		}
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		packstr(resv_ptr->accounts,	buffer);
 		pack32(resv_ptr->core_cnt,	buffer);
 		pack_time(end_relative,		buffer);
@@ -1468,7 +1623,48 @@ slurmctld_resv_t *_load_reservation_state(Buf buffer,
 
 	resv_ptr = xmalloc(sizeof(slurmctld_resv_t));
 	xassert(resv_ptr->magic = RESV_MAGIC);	/* Sets value */
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		safe_unpackstr_xmalloc(&resv_ptr->accounts,
+				       &uint32_tmp,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
+				       &uint32_tmp,	buffer);
+		safe_unpack32(&resv_ptr->core_cnt,	buffer);
+		safe_unpack_time(&resv_ptr->end_time,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->features,
+				       &uint32_tmp, 	buffer);
+		safe_unpack32(&resv_ptr->flags,		buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->licenses,
+				       &uint32_tmp, 	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->name,	&uint32_tmp, buffer);
+
+		safe_unpack32(&resv_ptr->node_cnt,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->node_list,
+				       &uint32_tmp,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->partition,
+				       &uint32_tmp, 	buffer);
+		safe_unpack32(&resv_ptr->resv_watts,    buffer);
+		safe_unpack_time(&resv_ptr->start_time_first,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->tres_fmt_str,
+				       &uint32_tmp, 	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->users, &uint32_tmp, buffer);
+
+		/* Fields saved for internal use only (save state) */
+		safe_unpack8((uint8_t *)&resv_ptr->account_not,	buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->assoc_list,
+				       &uint32_tmp,	buffer);
+		resv_ptr->core_resrcs = create_job_resources();
+		if (unpack_job_resources(&resv_ptr->core_resrcs, buffer,
+					 protocol_version) != SLURM_SUCCESS)
+			goto unpack_error;
+		safe_unpack32(&resv_ptr->duration,	buffer);
+		safe_unpack8((uint8_t *)&resv_ptr->full_nodes,	buffer);
+		safe_unpack32(&resv_ptr->resv_id,	buffer);
+		safe_unpack_time(&resv_ptr->start_time_prev, buffer);
+		safe_unpack_time(&resv_ptr->start_time, buffer);
+		safe_unpackstr_xmalloc(&resv_ptr->tres_str,
+				       &uint32_tmp, 	buffer);
+		safe_unpack8((uint8_t *)&resv_ptr->user_not,	buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&resv_ptr->accounts,
 				       &uint32_tmp,	buffer);
 		safe_unpackstr_xmalloc(&resv_ptr->burst_buffer,
@@ -1520,7 +1716,7 @@ slurmctld_resv_t *_load_reservation_state(Buf buffer,
 		safe_unpack8((uint8_t *)&resv_ptr->user_not,	buffer);
 		safe_unpackstr_xmalloc(&resv_ptr->tres_str,
 				       &uint32_tmp, 	buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		safe_unpackstr_xmalloc(&resv_ptr->accounts,
 				       &uint32_tmp,	buffer);
 		safe_unpack32(&resv_ptr->core_cnt,	buffer);
@@ -1744,7 +1940,7 @@ static void _set_tres_cnt(slurmctld_resv_t *resv_ptr,
 				}
 				offset = cr_get_coremap_offset(i);
 
-				for (core=0; core < cores; core++) {
+				for (core = 0; core < cores; core++) {
 					if (!bit_test(resv_ptr->core_bitmap,
 						     core + offset))
 						continue;
@@ -1791,7 +1987,8 @@ static void _set_tres_cnt(slurmctld_resv_t *resv_ptr,
 	xfree(resv_ptr->tres_fmt_str);
 	assoc_mgr_lock(&locks);
 	resv_ptr->tres_fmt_str = slurmdb_make_tres_string_from_simple(
-		resv_ptr->tres_str, assoc_mgr_tres_list);
+		resv_ptr->tres_str, assoc_mgr_tres_list, NO_VAL,
+		CONVERT_NUM_UNIT_EXACT);
 	assoc_mgr_unlock(&locks);
 
 	slurm_make_time_str(&resv_ptr->start_time, start_time,
@@ -1844,7 +2041,7 @@ static List _license_validate2(resv_desc_msg_t *resv_desc_ptr, bool *valid)
 		    (resv_ptr->start_time >= resv_desc_ptr->end_time))
 			continue;	/* No overlap */
 		if (resv_desc_ptr->name &&
-		    !strcmp(resv_desc_ptr->name, resv_ptr->name))
+		    !xstrcmp(resv_desc_ptr->name, resv_ptr->name))
 			continue;	/* Modifying this reservation */
 		xstrcat(merged_licenses, ",");
 		xstrcat(merged_licenses, resv_ptr->licenses);
@@ -1918,6 +2115,7 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr)
 					RESERVE_FLAG_PART_NODES  |
 					RESERVE_FLAG_FIRST_CORES |
 					RESERVE_FLAG_TIME_FLOAT  |
+					RESERVE_FLAG_PURGE_COMP  |
 					RESERVE_FLAG_REPLACE;
 	}
 	if (resv_desc_ptr->flags & RESERVE_FLAG_REPLACE) {
@@ -2002,34 +2200,53 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr)
 	if (resv_desc_ptr->node_cnt && cnodes_per_mp) {
 		/* Pack multiple small blocks into midplane rather than
 		 * allocating a whole midplane for each small block */
-		int small_block_nodes = 0, small_block_count = 0;
+		int small_block_nodes = 0, first_small = -1;
+		bool req_mixed = false;
+
 		for (i = 0; resv_desc_ptr->node_cnt[i]; i++) {
-			if (resv_desc_ptr->node_cnt[i] < cnodes_per_mp)
+			if (resv_desc_ptr->node_cnt[i] < cnodes_per_mp) {
+				if (first_small == -1)
+					first_small = i;
 				small_block_nodes += resv_desc_ptr->node_cnt[i];
+			} else
+				req_mixed = true;
+		}
+
+		if (small_block_nodes) {
+			if (req_mixed)
+				resv_desc_ptr->node_cnt[first_small] =
+					small_block_nodes < cnodes_per_mp ?
+					cnodes_per_mp : small_block_nodes;
+			else
+				resv_desc_ptr->node_cnt[first_small] =
+					small_block_nodes;
+
+			small_block_nodes = 0;
+			/* Since there will only ever be 1 small block we can
+			 * set the the one after the first small to 0.
+			 */
+			resv_desc_ptr->node_cnt[first_small+1] = 0;
 		}
-		small_block_count  =  small_block_nodes;
-		small_block_count += (cnodes_per_mp - 1);
-		small_block_count /=  cnodes_per_mp;
 
 		/* Convert c-node count to midplane count */
-		total_node_cnt = 0;
+
 		for (i = 0; resv_desc_ptr->node_cnt[i]; i++) {
+			if (!resv_desc_ptr->node_cnt[i])
+				break;
+
 			if (resv_desc_ptr->node_cnt[i] < cnodes_per_mp) {
+				/* There will only ever be one here */
 				if (!resv_desc_ptr->core_cnt)
 					resv_desc_ptr->core_cnt =
 						xmalloc(sizeof(uint32_t) * 2);
-				resv_desc_ptr->core_cnt[0] +=
+				resv_desc_ptr->core_cnt[0] =
 					resv_desc_ptr->node_cnt[i];
-				if (small_block_count == 0) {
-					resv_desc_ptr->node_cnt[i] = 0;
-					break;
-				}
-				small_block_count--;
+				resv_desc_ptr->node_cnt[i] = 1;
+			} else {
+				resv_desc_ptr->node_cnt[i] +=
+					(cnodes_per_mp - 1);
+				resv_desc_ptr->node_cnt[i] /= cnodes_per_mp;
 			}
-
-			resv_desc_ptr->node_cnt[i] += (cnodes_per_mp - 1);
-			resv_desc_ptr->node_cnt[i] /=  cnodes_per_mp;
-			total_node_cnt += resv_desc_ptr->node_cnt[i];
 		}
 	}
 #endif
@@ -2055,7 +2272,7 @@ extern int create_resv(resv_desc_msg_t *resv_desc_ptr)
 #endif
 
 		resv_desc_ptr->flags |= RESERVE_FLAG_SPEC_NODES;
-		if (strcasecmp(resv_desc_ptr->node_list, "ALL") == 0) {
+		if (xstrcasecmp(resv_desc_ptr->node_list, "ALL") == 0) {
 			if ((resv_desc_ptr->partition) &&
 			    (resv_desc_ptr->flags & RESERVE_FLAG_PART_NODES)) {
 				part_ptr = find_part_record(
@@ -2383,6 +2600,8 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr)
 			error_code = ESLURM_INVALID_TIME_VALUE;
 			goto update_failure;
 		}
+		if (resv_desc_ptr->flags & RESERVE_FLAG_PURGE_COMP)
+			resv_ptr->flags |= RESERVE_FLAG_PURGE_COMP;
 	}
 	if (resv_desc_ptr->partition && (resv_desc_ptr->partition[0] == '\0')) {
 		/* Clear the partition */
@@ -2529,6 +2748,7 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr)
 		xfree(resv_ptr->node_list);
 		FREE_NULL_BITMAP(resv_ptr->node_bitmap);
 		FREE_NULL_BITMAP(resv_ptr->core_bitmap);
+		free_job_resources(&resv_ptr->core_resrcs);
 		resv_ptr->node_bitmap = bit_alloc(node_record_count);
 		if ((resv_desc_ptr->node_cnt == NULL) ||
 		    (resv_desc_ptr->node_cnt[0] == 0)) {
@@ -2541,7 +2761,7 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr)
 	if (resv_desc_ptr->node_list) {		/* Change bitmap last */
 		bitstr_t *node_bitmap;
 		resv_ptr->flags |= RESERVE_FLAG_SPEC_NODES;
-		if (strcasecmp(resv_desc_ptr->node_list, "ALL") == 0) {
+		if (xstrcasecmp(resv_desc_ptr->node_list, "ALL") == 0) {
 			if ((resv_ptr->partition) &&
 			    (resv_ptr->flags & RESERVE_FLAG_PART_NODES)) {
 				struct part_record *part_ptr = NULL;
@@ -2579,6 +2799,7 @@ extern int update_resv(resv_desc_msg_t *resv_desc_ptr)
 		resv_desc_ptr->node_list = NULL;  /* Nothing left to free */
 		FREE_NULL_BITMAP(resv_ptr->node_bitmap);
 		FREE_NULL_BITMAP(resv_ptr->core_bitmap);
+		free_job_resources(&resv_ptr->core_resrcs);
 		resv_ptr->node_bitmap = node_bitmap;
 		resv_ptr->node_cnt = bit_set_count(resv_ptr->node_bitmap);
 	}
@@ -2727,7 +2948,7 @@ extern int delete_resv(reservation_name_msg_t *resv_desc_ptr)
 
 	iter = list_iterator_create(resv_list);
 	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
-		if (strcmp(resv_ptr->name, resv_desc_ptr->name))
+		if (xstrcmp(resv_ptr->name, resv_desc_ptr->name))
 			continue;
 		if (_is_resv_used(resv_ptr)) {
 			rc = ESLURM_RESERVATION_BUSY;
@@ -2973,93 +3194,6 @@ extern int dump_all_resv_state(void)
 	return 0;
 }
 
-/* Unfortunately the reservation's core_bitmap is a global bitmap and the nodes
- * in the system have changed in terms of their node count or nodes have been
- * added or removed. Make best effort to rebuild the reservation's core_bitmap
- * on the limited information currently available. The specific cores might
- * change, but this logic at least leaves their count constant and uses the
- * same nodes. */
-static void _rebuild_core_bitmap(slurmctld_resv_t *resv_ptr)
-{
-	int i_first, i_last, i, j, k, core_offset, node_offset;
-	uint32_t core_cnt, core_inx, node_inx;
-	ListIterator job_iterator;
-	struct job_record  *job_ptr;
-
-	info("Core_bitmap for reservation %s no longer valid, cores added or removed, rebuilding",
-	     resv_ptr->name);
-
-	core_cnt = bit_set_count(resv_ptr->core_bitmap);      /* Cores needed */
-	FREE_NULL_BITMAP(resv_ptr->core_bitmap);
-
-	_create_cluster_core_bitmap(&resv_ptr->core_bitmap);
-
-	/* Try to use any cores in use by jobs running in this reservation */
-	job_iterator = list_iterator_create(job_list);
-	while ((job_ptr = (struct job_record *) list_next(job_iterator))) {
-		if (!IS_JOB_RUNNING(job_ptr)      ||
-		    (job_ptr->node_bitmap == NULL)||
-		    (job_ptr->job_resrcs == NULL) ||
-		    (job_ptr->resv_name == NULL)  ||
-		    strcmp(job_ptr->resv_name, resv_ptr->name))
-			continue;
-		/* This job is currently running in this reservation */
-		i_first = bit_ffs(job_ptr->node_bitmap);
-		if (i_first >= 0)
-			i_last = bit_fls(job_ptr->node_bitmap);
-		else
-			i_last = i_first - 1;
-		node_offset = -1;
-		for (node_inx = i_first;
-		     ((core_cnt > 0) && (node_inx <= i_last)); node_inx++) {
-			if (!bit_test(job_ptr->node_bitmap, node_inx))
-				continue;
-			node_offset++;
-			core_offset = get_job_resources_offset(
-						job_ptr->job_resrcs,
-						node_offset, 0, 0);
-			if (core_offset < 0)
-				break;
-			j = cr_get_coremap_offset(node_inx);
-			k = cr_get_coremap_offset(node_inx + 1);
-			k -= j;	/* core count on this node */
-			for (i = 0; i < k; i++) {
-				if (!bit_test(job_ptr->job_resrcs->core_bitmap,
-					      core_offset + i))
-					continue;
-				bit_set(resv_ptr->core_bitmap, j + i);
-				if (--core_cnt == 0)
-					break;
-			}
-		}
-	}
-	list_iterator_destroy(job_iterator);
-
-	/* Use any other available cores, evenly distributing across nodes */
-	i_first = bit_ffs(resv_ptr->node_bitmap);
-	if (i_first >= 0)
-		i_last = bit_fls(resv_ptr->node_bitmap);
-	else
-		i_last = i_first - 1;
-	for (core_inx = 0; ((core_cnt > 0) && (core_inx <= core_cnt));
-	     core_inx++) {
-		for (node_inx = i_first; node_inx <= i_last; node_inx++) {
-			if (!bit_test(resv_ptr->node_bitmap, node_inx))
-				continue;
-			j = cr_get_coremap_offset(node_inx);
-			k = cr_get_coremap_offset(node_inx + 1);
-			j += core_inx;	/* Core offset on this node */
-			if (j >= k)
-				continue;
-			if (bit_test(resv_ptr->core_bitmap, j))
-				continue;	/* Already set by job */
-			bit_set(resv_ptr->core_bitmap, j);
-			if (--core_cnt == 0)
-				break;
-		}
-	}
-}
-
 /* Validate one reservation record, return true if good */
 static bool _validate_one_reservation(slurmctld_resv_t *resv_ptr)
 {
@@ -3071,6 +3205,8 @@ static bool _validate_one_reservation(slurmctld_resv_t *resv_ptr)
 		error("Read reservation without name");
 		return false;
 	}
+	if (_get_core_resrcs(resv_ptr) != SLURM_SUCCESS)
+		return false;
 	if (resv_ptr->partition) {
 		struct part_record *part_ptr = NULL;
 		part_ptr = find_part_record(resv_ptr->partition);
@@ -3167,7 +3303,7 @@ static bool _validate_one_reservation(slurmctld_resv_t *resv_ptr)
 			}
 		}
 #endif
-		if (strcasecmp(resv_ptr->node_list, "ALL") == 0) {
+		if (xstrcasecmp(resv_ptr->node_list, "ALL") == 0) {
 			node_bitmap = bit_alloc(node_record_count);
 			bit_nset(node_bitmap, 0, (node_record_count - 1));
 		} else if (node_name2bitmap(resv_ptr->node_list,
@@ -3186,12 +3322,6 @@ static bool _validate_one_reservation(slurmctld_resv_t *resv_ptr)
 		resv_ptr->node_bitmap = node_bitmap;
 	}
 
-	if (!resv_ptr->full_nodes && resv_ptr->core_bitmap &&
-	    (bit_size(resv_ptr->core_bitmap) !=
-	     cr_get_coremap_offset(node_record_count))) {
-		_rebuild_core_bitmap(resv_ptr);
-	}
-
 	return true;
 }
 
@@ -3301,6 +3431,7 @@ static void _resv_node_replace(slurmctld_resv_t *resv_ptr)
 			FREE_NULL_BITMAP(new_bitmap);
 			FREE_NULL_BITMAP(resv_ptr->core_bitmap);
 			resv_ptr->core_bitmap = core_bitmap;	/* is NULL */
+			free_job_resources(&resv_ptr->core_resrcs);
 			xfree(resv_ptr->node_list);
 			resv_ptr->node_list = bitmap2node_name(resv_ptr->
 							       node_bitmap);
@@ -3373,6 +3504,7 @@ static void _validate_node_choice(slurmctld_resv_t *resv_ptr)
 		FREE_NULL_BITMAP(tmp_bitmap);
 		FREE_NULL_BITMAP(resv_ptr->core_bitmap);
 		resv_ptr->core_bitmap = core_bitmap;
+		free_job_resources(&resv_ptr->core_resrcs);
 		xfree(resv_ptr->node_list);
 		resv_ptr->node_list = bitmap2node_name(resv_ptr->node_bitmap);
 		info("modified reservation %s due to unusable nodes, "
@@ -3485,7 +3617,7 @@ extern int load_all_resv_state(int recover)
 
 	safe_unpackstr_xmalloc( &ver_str, &uint32_tmp, buffer);
 	debug3("Version string in resv_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, RESV_STATE_VERSION))
+	if (ver_str && !xstrcmp(ver_str, RESV_STATE_VERSION))
 		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t) NO_VAL) {
@@ -3630,6 +3762,7 @@ static int  _resize_resv(slurmctld_resv_t *resv_ptr, uint32_t node_cnt)
 		FREE_NULL_BITMAP(tmp1_bitmap);
 		FREE_NULL_BITMAP(resv_ptr->core_bitmap);
 		resv_ptr->core_bitmap = core_bitmap;
+		free_job_resources(&resv_ptr->core_resrcs);
 		xfree(resv_ptr->node_list);
 		resv_ptr->node_list = bitmap2node_name(resv_ptr->node_bitmap);
 		resv_ptr->node_cnt = node_cnt;
@@ -3718,7 +3851,7 @@ static int  _select_nodes(resv_desc_msg_t *resv_desc_ptr,
 		char *features = xstrdup(resv_desc_ptr->features);
 		char *sep_ptr, *token = features;
 		bitstr_t *feature_bitmap = bit_copy(node_bitmap);
-		struct features_record *feature_ptr;
+		node_feature_t *feature_ptr;
 		ListIterator feature_iter;
 		bool match;
 
@@ -3742,10 +3875,10 @@ static int  _select_nodes(resv_desc_msg_t *resv_desc_ptr,
 			}
 
 			match = false;
-			feature_iter = list_iterator_create(feature_list);
-			while ((feature_ptr = (struct features_record *)
+			feature_iter = list_iterator_create(avail_feature_list);
+			while ((feature_ptr = (node_feature_t *)
 					list_next(feature_iter))) {
-				if (strcmp(token, feature_ptr->name))
+				if (xstrcmp(token, feature_ptr->name))
 					continue;
 				if (last_op_code == FEATURE_OP_OR) {
 					bit_or(feature_bitmap,
@@ -3816,6 +3949,7 @@ static bitstr_t *_pick_idle_nodes(bitstr_t *avail_bitmap,
 	bool resv_debug;
 
 #ifdef HAVE_BG
+	hostlist_t hl = NULL;
 	static uint16_t static_blocks = (uint16_t)NO_VAL;
 	if (static_blocks == (uint16_t)NO_VAL) {
 		/* Since this never changes we can just set it once
@@ -3882,8 +4016,24 @@ static bitstr_t *_pick_idle_nodes(bitstr_t *avail_bitmap,
 		bit_not(tmp_bitmap);
 		bit_and(avail_bitmap, tmp_bitmap);
 		FREE_NULL_BITMAP(tmp_bitmap);
+
+#ifdef HAVE_BG
+		if (!hl)
+			hl = hostlist_create(resv_desc_ptr->node_list);
+		else
+			hostlist_push(hl, resv_desc_ptr->node_list);
+#endif
+	}
+#ifdef HAVE_BG
+	if (hl) {
+		hostlist_uniq(hl);
+		hostlist_sort(hl);
+		xfree(resv_desc_ptr->node_list);
+		resv_desc_ptr->node_list = hostlist_ranged_string_xmalloc(hl);
+		hostlist_destroy(hl);
 	}
 
+#endif
 	return ret_bitmap;
 }
 
@@ -4180,7 +4330,7 @@ no_assocs:	if ((resv_ptr->user_cnt == 0) || resv_ptr->user_not)
 			account_good = true;
 		for (i=0; (i<resv_ptr->account_cnt) && job_ptr->account; i++) {
 			if (resv_ptr->account_list[i] &&
-			    (strcmp(job_ptr->account,
+			    (xstrcmp(job_ptr->account,
 				    resv_ptr->account_list[i]) == 0)) {
 				if (resv_ptr->account_not)
 					account_good = false;
@@ -4312,7 +4462,7 @@ static int _license_cnt(List license_list, char *lic_name)
 
 	iter = list_iterator_create(license_list);
 	while ((license_ptr = list_next(iter))) {
-		if (strcmp(license_ptr->name, lic_name) == 0)
+		if (xstrcmp(license_ptr->name, lic_name) == 0)
 			lic_cnt += license_ptr->total;
 	}
 	list_iterator_destroy(iter);
@@ -4338,7 +4488,7 @@ static uint32_t _get_job_duration(struct job_record *job_ptr)
 	if (job_ptr->part_ptr)
 		time_slices = job_ptr->part_ptr->max_share & ~SHARED_FORCE;
 	if ((duration != ONE_YEAR) && (time_slices > 1) &&
-	    (slurm_get_preempt_mode() & PREEMPT_MODE_GANG)) {
+	    (slurmctld_conf.preempt_mode & PREEMPT_MODE_GANG)) {
 		/* FIXME: Ideally we figure out how many jobs are actually
 		 * time-slicing on each node rather than using the maximum
 		 * value. */
@@ -4351,7 +4501,7 @@ static void _add_bb_resv(burst_buffer_info_msg_t **bb_resv, char *plugin,
 			 char *type, uint64_t cnt)
 {
 	burst_buffer_info_t *bb_array;
-	burst_buffer_gres_t *gres_ptr;
+	burst_buffer_pool_t *pool_ptr;
 	int i;
 
 	if (*bb_resv == NULL)
@@ -4377,19 +4527,19 @@ static void _add_bb_resv(burst_buffer_info_msg_t **bb_resv, char *plugin,
 		return;
 	}
 
-	for (i = 0, gres_ptr = bb_array->gres_ptr; i < bb_array->gres_cnt; i++){
-		if ((gres_ptr->name == NULL) || !strcmp(type, gres_ptr->name))
+	for (i = 0, pool_ptr = bb_array->pool_ptr; i < bb_array->pool_cnt; i++){
+		if ((pool_ptr->name == NULL) || !xstrcmp(type, pool_ptr->name))
 			break;
 	}
-	if (i >= bb_array->gres_cnt) {
-		bb_array->gres_cnt++;
-		bb_array->gres_ptr = xrealloc(bb_array->gres_ptr,
-					      sizeof(burst_buffer_gres_t) *
-					      bb_array->gres_cnt);
-		gres_ptr = bb_array->gres_ptr + bb_array->gres_cnt - 1;
-		gres_ptr->name = xstrdup(type);
+	if (i >= bb_array->pool_cnt) {
+		bb_array->pool_cnt++;
+		bb_array->pool_ptr = xrealloc(bb_array->pool_ptr,
+					      sizeof(burst_buffer_pool_t) *
+					      bb_array->pool_cnt);
+		pool_ptr = bb_array->pool_ptr + bb_array->pool_cnt - 1;
+		pool_ptr->name = xstrdup(type);
 	}
-	gres_ptr->used_cnt += cnt;
+	pool_ptr->used_space += cnt;
 }
 
 static void _update_bb_resv(burst_buffer_info_msg_t **bb_resv, char *bb_spec)
@@ -4404,10 +4554,10 @@ static void _update_bb_resv(burst_buffer_info_msg_t **bb_resv, char *bb_spec)
 	tmp_spec = xstrdup(bb_spec);
 	tok = strtok_r(tmp_spec, ",", &end_ptr);
 	while (tok) {
-		if (!strncmp(tok, "cray:", 5)) {
+		if (!xstrncmp(tok, "cray:", 5)) {
 			plugin = "cray";
 			tok += 5;
-		} else if (!strncmp(tok, "generic:", 8)) {
+		} else if (!xstrncmp(tok, "generic:", 8)) {
 			plugin = "generic";
 			tok += 8;
 		} else
@@ -4435,8 +4585,6 @@ static void _update_bb_resv(burst_buffer_info_msg_t **bb_resv, char *bb_spec)
 			cnt *= ((uint64_t) 1024 * 1024 * 1024 * 1024);
 		} else if ((end_ptr2[0] == 'p') || (end_ptr2[0] == 'P')) {
 			cnt *= ((uint64_t) 1024 * 1024 * 1024 * 1024 * 1024);
-		} else {	/* Default GB */
-			cnt *= ((uint64_t) 1024 * 1024 * 1024);
 		}
 
 		if (cnt)
@@ -4517,7 +4665,7 @@ extern int job_test_lic_resv(struct job_record *job_ptr, char *lic_name,
 			continue;	/* reservation at different time */
 
 		if (job_ptr->resv_name &&
-		    (strcmp(job_ptr->resv_name, resv_ptr->name) == 0))
+		    (xstrcmp(job_ptr->resv_name, resv_ptr->name) == 0))
 			continue;	/* job can use this reservation */
 
 		resv_cnt += _license_cnt(resv_ptr->license_list, lic_name);
@@ -4729,7 +4877,7 @@ extern uint32_t job_test_watts_resv(struct job_record *job_ptr, time_t when)
 			continue;	/* reservation at different time */
 
 		if (job_ptr->resv_name &&
-		    (strcmp(job_ptr->resv_name, resv_ptr->name) == 0))
+		    (xstrcmp(job_ptr->resv_name, resv_ptr->name) == 0))
 			continue;	/* job can use this reservation */
 
 		_update_constraint_planning(&wsched, resv_ptr->resv_watts,
@@ -5193,6 +5341,24 @@ static void _run_script(char *script, slurmctld_resv_t *resv_ptr)
 		_free_script_arg(args);
 }
 
+/* Return the count of incomplete jobs associated with a given reservation */
+static int _resv_job_count(slurmctld_resv_t *resv_ptr)
+{
+	int cnt = 0;
+	ListIterator iter;
+	struct job_record *job_ptr;
+
+	iter = list_iterator_create(job_list);
+	while ((job_ptr = (struct job_record *) list_next(iter))) {
+		if (!IS_JOB_FINISHED(job_ptr) &&
+		    !xstrcmp(job_ptr->resv_name, resv_ptr->name))
+			cnt++;
+	}
+	list_iterator_destroy(iter);
+
+	return cnt;
+}
+
 /* Finish scan of all jobs for valid reservations
  *
  * Purge vestigial reservation records.
@@ -5202,7 +5368,7 @@ static void _run_script(char *script, slurmctld_resv_t *resv_ptr)
 extern void fini_job_resv_check(void)
 {
 	ListIterator iter;
-	slurmctld_resv_t *resv_ptr;
+	slurmctld_resv_t *resv_backup, *resv_ptr;
 	time_t now = time(NULL);
 
 	if (!resv_list)
@@ -5210,6 +5376,19 @@ extern void fini_job_resv_check(void)
 
 	iter = list_iterator_create(resv_list);
 	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
+		if ((resv_ptr->start_time <= (now - 300)) &&
+		    (resv_ptr->end_time > now) &&
+		    (resv_ptr->flags & RESERVE_FLAG_PURGE_COMP) &&
+		    (_resv_job_count(resv_ptr) == 0)) {
+			info("Reservation %s has no more jobs, ending it",
+			     resv_ptr->name);
+			resv_backup = _copy_resv(resv_ptr);
+			resv_ptr->end_time = now;
+			_post_resv_update(resv_ptr, resv_backup); /* accounting */
+			_del_resv_rec(resv_backup);
+			last_resv_update = now;
+			schedule_resv_save();
+		}
 		if (!resv_ptr->run_prolog || !resv_ptr->run_epilog)
 			continue;
 		if ((resv_ptr->end_time >= now) ||
@@ -5392,7 +5571,7 @@ extern void update_part_nodes_in_resv(struct part_record *part_ptr)
 	while ((resv_ptr = (slurmctld_resv_t *) list_next(iter))) {
 		if ((resv_ptr->flags & RESERVE_FLAG_PART_NODES) &&
 		    (resv_ptr->partition != NULL) &&
-		    (strcmp(resv_ptr->partition, part_ptr->name) == 0)) {
+		    (xstrcmp(resv_ptr->partition, part_ptr->name) == 0)) {
 			slurmctld_resv_t old_resv_ptr;
 			memset(&old_resv_ptr, 0, sizeof(slurmctld_resv_t));
 
diff --git a/src/slurmctld/sched_plugin.c b/src/slurmctld/sched_plugin.c
index bc08ff72d..424028009 100644
--- a/src/slurmctld/sched_plugin.c
+++ b/src/slurmctld/sched_plugin.c
@@ -146,8 +146,7 @@ slurm_sched_fini( void )
 	rc = plugin_context_destroy(g_context);
 	g_context = NULL;
 
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_fini() != SLURM_SUCCESS))
+	if (gs_fini() != SLURM_SUCCESS)
 		error( "cannot stop gang scheduler" );
 
 	return rc;
@@ -163,8 +162,7 @@ slurm_sched_g_reconfig( void )
 	if ( slurm_sched_init() < 0 )
 		return SLURM_ERROR;
 
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_reconfig() != SLURM_SUCCESS))
+	if (gs_reconfig() != SLURM_SUCCESS)
 		error( "cannot reconfigure gang scheduler" );
 
 	return (*(ops.reconfig))();
@@ -181,8 +179,7 @@ slurm_sched_g_schedule( void )
 
 #if 0
 	/* Must have job write lock and node read lock set here */
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_job_scan() != SLURM_SUCCESS))
+	if (gs_job_scan() != SLURM_SUCCESS)
 		error( "gang scheduler could not rescan jobs" );
 #endif
 
@@ -198,8 +195,7 @@ slurm_sched_g_newalloc( struct job_record *job_ptr )
 	if ( slurm_sched_init() < 0 )
 		return SLURM_ERROR;
 
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_job_start( job_ptr ) != SLURM_SUCCESS)) {
+	if (gs_job_start( job_ptr ) != SLURM_SUCCESS) {
 		error( "gang scheduler problem starting job %u",
 		       job_ptr->job_id);
 	}
@@ -216,8 +212,7 @@ slurm_sched_g_freealloc( struct job_record *job_ptr )
 	if ( slurm_sched_init() < 0 )
 		return SLURM_ERROR;
 
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_job_fini( job_ptr ) != SLURM_SUCCESS)) {
+	if (gs_job_fini( job_ptr ) != SLURM_SUCCESS) {
 		error( "gang scheduler problem finishing job %u",
 		       job_ptr->job_id);
 	}
@@ -260,8 +255,7 @@ slurm_sched_g_partition_change( void )
 	if ( slurm_sched_init() < 0 )
 		return;
 
-	if ( (slurm_get_preempt_mode() & PREEMPT_MODE_GANG) &&
-	     (gs_reconfig() != SLURM_SUCCESS))
+	if (gs_reconfig() != SLURM_SUCCESS)
 		error( "cannot reconfigure gang scheduler" );
 
 	(*(ops.partition_change))();
diff --git a/src/slurmctld/sicp.c b/src/slurmctld/sicp.c
deleted file mode 100644
index a2d031de9..000000000
--- a/src/slurmctld/sicp.c
+++ /dev/null
@@ -1,480 +0,0 @@
-/*****************************************************************************\
- *  sicp.c - Inter-cluster job management functions
- *****************************************************************************
- *  Copyright (C) 2015 SchedMD LLC (http://www.schedmd.com).
- *  Written by Morris Jette
- *
- *  This file is part of SLURM, a resource management program.
- *  For details, see <http://slurm.schedmd.com/>.
- *  Please also read the included file: DISCLAIMER.
- *
- *  SLURM is free software; you can redistribute it and/or modify it under
- *  the terms of the GNU General Public License as published by the Free
- *  Software Foundation; either version 2 of the License, or (at your option)
- *  any later version.
- *
- *  In addition, as a special exception, the copyright holders give permission
- *  to link the code of portions of this program with the OpenSSL library under
- *  certain conditions as described in each individual source file, and
- *  distribute linked combinations including the two. You must obey the GNU
- *  General Public License in all respects for all of the code used other than
- *  OpenSSL. If you modify file(s) with this exception, you may extend this
- *  exception to your version of the file(s), but you are not obligated to do
- *  so. If you do not wish to do so, delete this exception statement from your
- *  version.  If you delete this exception statement from all source files in
- *  the program, then also delete it here.
- *
- *  SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
- *  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- *  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
- *  details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with SLURM; if not, write to the Free Software Foundation, Inc.,
- *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
-\*****************************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#  include "config.h"
-#endif
-
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "slurm/slurm.h"
-#include "slurm/slurm_errno.h"
-
-#include "src/common/fd.h"
-#include "src/common/macros.h"
-#include "src/common/xassert.h"
-#include "src/common/xmalloc.h"
-#include "src/common/xstring.h"
-#include "src/slurmctld/locks.h"
-#include "src/slurmctld/sicp.h"
-#include "src/slurmctld/slurmctld.h"
-#include "src/slurmctld/state_save.h"
-
-#define JOB_HASH_INX(_job_id)	(_job_id % hash_table_size)
-#define JOB_ARRAY_HASH_INX(_job_id, _task_id) \
-	((_job_id + _task_id) % hash_table_size)
-
-static int		hash_table_size = 1000;
-static sicp_job_t **	sicp_hash = NULL;
-static List		sicp_job_list = NULL;
-
-static int		sicp_interval = 600;
-static bool		sicp_stop = false;
-static pthread_t	sicp_thread = 0;
-static pthread_mutex_t	sicp_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t	sicp_cond = PTHREAD_COND_INITIALIZER;
-static pthread_mutex_t	thread_lock = PTHREAD_MUTEX_INITIALIZER;
-
-static void		_add_job_hash(sicp_job_t *sicp_ptr);
-static void		_dump_sicp_state(void);
-static sicp_job_t *	_find_sicp(uint32_t job_id);
-static void		_list_delete_sicp(void *sicp_entry);
-static int		_list_find_sicp_old(void *sicp_entry, void *key);
-static void		_load_sicp_state(void);
-static void		_log_sicp_recs(void);
-static void		_my_sleep(int add_secs);
-
-/* _add_sicp_hash - add a sicp job to hash table */
-static void _add_job_hash(sicp_job_t *sicp_ptr)
-{
-	int inx;
-
-	inx = JOB_HASH_INX(sicp_ptr->job_id);
-	sicp_ptr->sicp_next = sicp_hash[inx];
-	sicp_hash[inx] = sicp_ptr;
-}
-
-static sicp_job_t *_find_sicp(uint32_t job_id)
-{
-	sicp_job_t *sicp_ptr;
-
-	sicp_ptr = sicp_hash[JOB_HASH_INX(job_id)];
-	while (sicp_ptr) {
-		if (sicp_ptr->job_id == job_id)
-			break;
-		sicp_ptr = sicp_ptr->sicp_next;
-	}
-	return sicp_ptr;
-}
-
-static void _list_delete_sicp(void *sicp_entry)
-{
-	sicp_job_t *sicp_ptr = (sicp_job_t *) sicp_entry;
-	sicp_job_t **sicp_pptr, *tmp_ptr;
-
-	/* Remove the record from sicp hash table */
-	sicp_pptr = &sicp_hash[JOB_HASH_INX(sicp_ptr->job_id)];
-	while ((sicp_pptr != NULL) && (*sicp_pptr != NULL) &&
-	       ((tmp_ptr = *sicp_pptr) != (sicp_job_t *) sicp_entry)) {
-		sicp_pptr = &tmp_ptr->sicp_next;
-	}
-	if (sicp_pptr == NULL)
-		error("sicp hash error");
-	else
-		*sicp_pptr = sicp_ptr->sicp_next;
-	xfree(sicp_ptr);
-}
-
-static void _my_sleep(int add_secs)
-{
-	struct timespec ts = {0, 0};
-	struct timeval  tv = {0, 0};
-
-	if (gettimeofday(&tv, NULL)) {		/* Some error */
-		sleep(1);
-		return;
-	}
-
-	ts.tv_sec  = tv.tv_sec + add_secs;
-	ts.tv_nsec = tv.tv_usec * 1000;
-	pthread_mutex_lock(&sicp_lock);
-	if (!sicp_stop)
-		pthread_cond_timedwait(&sicp_cond, &sicp_lock, &ts);
-	pthread_mutex_unlock(&sicp_lock);
-}
-
-static int _list_find_sicp_old(void *sicp_entry, void *key)
-{
-	sicp_job_t *sicp_ptr = (sicp_job_t *)sicp_entry;
-	time_t old;
-
-//FIXME: Do not purge if we lack current information from this cluster
-	if (!(IS_JOB_FINISHED(sicp_ptr)))
-		return 0;	/* Job still active */
-
-	old = time(NULL) - (24 * 60 * 60);	/* One day */
-	if (sicp_ptr->update_time > old)
-		return 0;	/* Job still active */
-
-	return 1;
-}
-
-/* Log all SICP job records */
-static void _log_sicp_recs(void)
-{
-	ListIterator sicp_iterator;
-	sicp_job_t *sicp_ptr;
-
-	sicp_iterator = list_iterator_create(sicp_job_list);
-	while ((sicp_ptr = (sicp_job_t *) list_next(sicp_iterator))) {
-		info("SICP: Job_ID:%u State:%s", sicp_ptr->job_id,
-		     job_state_string(sicp_ptr->job_state));
-	}
-	list_iterator_destroy(sicp_iterator);
-}
-
-static void _load_sicp_other_cluster(void)
-{
-int cluster_cnt = 0;
-	sicp_info_msg_t * sicp_buffer_ptr = NULL;
-	sicp_info_t *remote_sicp_ptr = NULL;
-	sicp_job_t *sicp_ptr;
-	int i, j, error_code;
-	time_t now;
-
-	for (i = 0; i < cluster_cnt; i++) {
-//FIXME: Issue RPC to load table from every _other_ cluster
-//This is just loading from the current cluster for testing purposes
-		error_code = slurm_load_sicp(&sicp_buffer_ptr);
-		if (error_code) {
-			error("slurm_load_sicp(HOSTNAME) error: %s",
-			      slurm_strerror(error_code));
-			continue;
-		}
-
-		pthread_mutex_lock(&sicp_lock);
-		now = time(NULL);
-		for (j = 0, remote_sicp_ptr = sicp_buffer_ptr->sicp_array;
-		     j < sicp_buffer_ptr->record_count;
-		     j++, remote_sicp_ptr++) {
-			sicp_ptr = _find_sicp(remote_sicp_ptr->job_id);
-			if (!sicp_ptr) {
-				sicp_ptr = xmalloc(sizeof(sicp_job_t));
-				sicp_ptr->job_id = remote_sicp_ptr->job_id;
-				sicp_ptr->job_state = remote_sicp_ptr->job_state;
-				list_append(sicp_job_list, sicp_ptr);
-				_add_job_hash(sicp_ptr);
-			}
-			sicp_ptr->update_time = now;
-		}
-		pthread_mutex_unlock(&sicp_lock);
-		slurm_free_sicp_msg(sicp_buffer_ptr);
-	}
-}
-
-extern void *_sicp_agent(void *args)
-{
-	static time_t last_sicp_time = 0;
-	time_t now;
-	double wait_time;
-
-	while (!sicp_stop) {
-		_my_sleep(1);
-		if (sicp_stop)
-			break;
-
-		now = time(NULL);
-		wait_time = difftime(now, last_sicp_time);
-		if (wait_time < sicp_interval)
-			continue;
-		last_sicp_time = now;
-
-		_load_sicp_other_cluster();
-
-		pthread_mutex_lock(&sicp_lock);
-		list_delete_all(sicp_job_list, &_list_find_sicp_old, "");
-		if (slurm_get_debug_flags() & DEBUG_FLAG_SICP)
-			_log_sicp_recs();
-		pthread_mutex_unlock(&sicp_lock);
-
-		_dump_sicp_state();	/* Has own locking */
-	}
-	return NULL;
-}
-
-static void _dump_sicp_state(void)
-{
-	char *old_file, *new_file, *reg_file;
-	ListIterator sicp_iterator;
-	sicp_job_t *sicp_ptr;
-	Buf buffer;
-	time_t now = time(NULL);
-	int error_code = SLURM_SUCCESS, len, log_fd;
-
-	pthread_mutex_lock(&sicp_lock);
-	len = list_count(sicp_job_list) * 4 + 128;
-	buffer = init_buf(len);
-
-	packstr("PROTOCOL_VERSION", buffer);
-	pack16(SLURM_PROTOCOL_VERSION, buffer);
-	pack_time(now, buffer);
-
-	sicp_iterator = list_iterator_create(sicp_job_list);
-	while ((sicp_ptr = (sicp_job_t *) list_next(sicp_iterator))) {
-		pack32(sicp_ptr->job_id, buffer);
-		pack16(sicp_ptr->job_state, buffer);
-	}
-	list_iterator_destroy(sicp_iterator);
-	pthread_mutex_unlock(&sicp_lock);
-
-	old_file = xstrdup(slurmctld_conf.state_save_location);
-	xstrcat(old_file, "/sicp_state.old");
-	reg_file = xstrdup(slurmctld_conf.state_save_location);
-	xstrcat(reg_file, "/sicp_state");
-	new_file = xstrdup(slurmctld_conf.state_save_location);
-	xstrcat(new_file, "/sicp_state.new");
-
-	lock_state_files();
-	log_fd = creat(new_file, 0600);
-	if (log_fd < 0) {
-		error("Can't save state, create file %s error %m",
-		      new_file);
-		error_code = errno;
-	} else {
-		int pos = 0, nwrite, amount, rc;
-		char *data;
-
-		fd_set_close_on_exec(log_fd);
-		nwrite = get_buf_offset(buffer);
-		data = (char *)get_buf_data(buffer);
-		while (nwrite > 0) {
-			amount = write(log_fd, &data[pos], nwrite);
-			if ((amount < 0) && (errno != EINTR)) {
-				error("Error writing file %s, %m", new_file);
-				error_code = errno;
-				break;
-			}
-			nwrite -= amount;
-			pos    += amount;
-		}
-
-		rc = fsync_and_close(log_fd, "sicp");
-		if (rc && !error_code)
-			error_code = rc;
-	}
-	if (error_code) {
-		(void) unlink(new_file);
-	} else {			/* file shuffle */
-		(void) unlink(old_file);
-		if (link(reg_file, old_file))
-			debug4("unable to create link for %s -> %s: %m",
-			       reg_file, old_file);
-		(void) unlink(reg_file);
-		if (link(new_file, reg_file))
-			debug4("unable to create link for %s -> %s: %m",
-			       new_file, reg_file);
-		(void) unlink(new_file);
-	}
-	xfree(old_file);
-	xfree(reg_file);
-	xfree(new_file);
-	unlock_state_files();
-
-	free_buf(buffer);
-}
-
-static void _load_sicp_state(void)
-{
-	int data_allocated, data_read = 0;
-	uint32_t data_size = 0;
-	int state_fd, sicp_cnt = 0;
-	char *data = NULL, *state_file;
-	struct stat stat_buf;
-	Buf buffer;
-	char *ver_str = NULL;
-	uint32_t ver_str_len;
-	uint16_t protocol_version = (uint16_t)NO_VAL;
-	uint32_t job_id = 0;
-	uint32_t job_state = 0;
-	sicp_job_t *sicp_ptr;
-	time_t buf_time, now;
-
-	/* read the file */
-	lock_state_files();
-	state_file = xstrdup(slurmctld_conf.state_save_location);
-	xstrcat(state_file, "/sicp_state");
-	state_fd = open(state_file, O_RDONLY);
-	if (state_fd < 0) {
-		error("Could not open job state file %s: %m", state_file);
-		unlock_state_files();
-		xfree(state_file);
-		return;
-	} else if (fstat(state_fd, &stat_buf) < 0) {
-		error("Could not stat job state file %s: %m", state_file);
-		unlock_state_files();
-		(void) close(state_fd);
-		xfree(state_file);
-		return;
-	} else if (stat_buf.st_size < 10) {
-		error("Job state file %s too small", state_file);
-		unlock_state_files();
-		(void) close(state_fd);
-		xfree(state_file);
-		return;
-	}
-
-	data_allocated = BUF_SIZE;
-	data = xmalloc(data_allocated);
-	while (1) {
-		data_read = read(state_fd, &data[data_size], BUF_SIZE);
-		if (data_read < 0) {
-			if (errno == EINTR)
-				continue;
-			else {
-				error("Read error on %s: %m", state_file);
-				break;
-			}
-		} else if (data_read == 0)	/* eof */
-			break;
-		data_size      += data_read;
-		data_allocated += data_read;
-		xrealloc(data, data_allocated);
-	}
-	close(state_fd);
-	xfree(state_file);
-	unlock_state_files();
-
-	buffer = create_buf(data, data_size);
-	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
-	debug3("Version string in sicp_state header is %s", ver_str);
-	if (ver_str && !strcmp(ver_str, "PROTOCOL_VERSION"))
-		safe_unpack16(&protocol_version, buffer);
-	xfree(ver_str);
-
-	if (protocol_version == (uint16_t)NO_VAL) {
-		error("************************************************");
-		error("Can not recover SICP state, incompatible version");
-		error("************************************************");
-		xfree(ver_str);
-		free_buf(buffer);
-		return;
-	}
-	safe_unpack_time(&buf_time, buffer);
-
-	now = time(NULL);
-	while (remaining_buf(buffer) > 0) {
-		safe_unpack32(&job_id,    buffer);
-		safe_unpack32(&job_state, buffer);
-		sicp_ptr = xmalloc(sizeof(sicp_job_t));
-		sicp_ptr->job_id      = job_id;
-		sicp_ptr->job_state   = job_state;
-		sicp_ptr->update_time = now;
-		list_append(sicp_job_list, sicp_ptr);
-		_add_job_hash(sicp_ptr);
-		sicp_cnt++;
-	}
-
-	free_buf(buffer);
-	info("Recovered information about %d sicp jobs", sicp_cnt);
-	if (slurm_get_debug_flags() & DEBUG_FLAG_SICP)
-		_log_sicp_recs();
-	return;
-
-unpack_error:
-	error("Incomplete sicp data checkpoint file");
-	info("Recovered information about %d sicp jobs", sicp_cnt);
-	free_buf(buffer);
-	return;
-}
-
-/* Start a thread to poll other clusters for inter-cluster job status */
-extern void sicp_init(void)
-{
-	pthread_attr_t attr;
-
-	pthread_mutex_lock(&thread_lock);
-	if (sicp_thread) {
-		error("%s: sicp thread already running", __func__);
-		pthread_mutex_unlock(&thread_lock);
-	}
-
-	pthread_mutex_lock(&sicp_lock);
-	sicp_stop = false;
-	sicp_hash = xmalloc(sizeof(sicp_job_t) * hash_table_size);
-	sicp_job_list = list_create(_list_delete_sicp);
-	_load_sicp_state();
-	pthread_mutex_unlock(&sicp_lock);
-	slurm_attr_init(&attr);
-	/* Since we do a join on thread later, don't make it detached */
-	if (pthread_create(&sicp_thread, &attr, _sicp_agent, NULL))
-		error("Unable to start power thread: %m");
-	slurm_attr_destroy(&attr);
-	pthread_mutex_unlock(&thread_lock);
-}
-
-/* Shutdown the inter-cluster job status thread */
-extern void sicp_fini(void)
-{
-	pthread_mutex_lock(&thread_lock);
-	pthread_mutex_lock(&sicp_lock);
-	sicp_stop = true;
-	pthread_cond_signal(&sicp_cond);
-	pthread_mutex_unlock(&sicp_lock);
-
-	pthread_join(sicp_thread, NULL);
-	sicp_thread = 0;
-	FREE_NULL_LIST(sicp_job_list);
-	xfree(sicp_hash);
-	pthread_mutex_unlock(&thread_lock);
-}
-
-/* For a given inter-cluster job ID, return its state (if found) or NO_VAL */
-extern uint32_t sicp_get_state(uint32_t job_id)
-{
-	sicp_job_t *sicp_ptr;
-	uint32_t job_state = NO_VAL;
-
-	pthread_mutex_lock(&sicp_lock);
-	sicp_ptr = _find_sicp(job_id);
-	if (sicp_ptr)
-		job_state = sicp_ptr->job_state;
-	pthread_mutex_unlock(&sicp_lock);
-
-	return job_state;
-}
diff --git a/src/slurmctld/slurmctld.h b/src/slurmctld/slurmctld.h
index b50b6200f..dba1df43f 100644
--- a/src/slurmctld/slurmctld.h
+++ b/src/slurmctld/slurmctld.h
@@ -244,6 +244,15 @@ extern uint32_t total_cpus;		/* count of CPUs in the entire cluster */
 extern bool ping_nodes_now;		/* if set, ping nodes immediately */
 extern bool want_nodes_reboot;		/* if set, check for idle nodes */
 
+typedef struct node_features {
+	uint32_t magic;		/* magic cookie to test data integrity */
+	char *name;		/* name of a feature */
+	bitstr_t *node_bitmap;	/* bitmap of nodes with this feature */
+} node_feature_t;
+
+extern List active_feature_list;/* list of currently active node features */
+extern List avail_feature_list;	/* list of available node features */
+
 /*****************************************************************************\
  *  NODE states and bitmaps
  *
@@ -358,7 +367,8 @@ struct part_record {
 	double   norm_priority;	/* normalized scheduling priority for
 				 * jobs (DON'T PACK) */
 	uint16_t preempt_mode;	/* See PREEMPT_MODE_* in slurm/slurm.h */
-	uint16_t priority;	/* scheduling priority for jobs */
+	uint16_t priority_job_factor;	/* job priority weight factor */
+	uint16_t priority_tier;	/* tier for scheduling and preemption */
 	char *qos_char;         /* requested QOS from slurm.conf */
 	void *qos_ptr;          /* pointer to the quality of
 				 * service record attached to this
@@ -380,7 +390,7 @@ extern time_t last_part_update;		/* time of last part_list update */
 extern struct part_record default_part;	/* default configuration values */
 extern char *default_part_name;		/* name of default partition */
 extern struct part_record *default_part_loc;	/* default partition ptr */
-extern uint16_t part_max_priority;      /* max priority in all partitions */
+extern uint16_t part_max_priority;      /* max priority_job_factor in all parts */
 
 /*****************************************************************************\
  *  RESERVATION parameters and data structures
@@ -392,9 +402,10 @@ typedef struct slurmctld_resv {
 	char **account_list;	/* list of accounts permitted to use	*/
 	bool account_not;	/* account_list users NOT permitted to use */
 	char *assoc_list;	/* list of associations			*/
-	uint32_t core_cnt;	/* number of reserved cores		*/
 	char *burst_buffer;	/* burst buffer resources		*/
 	bitstr_t *core_bitmap;	/* bitmap of reserved cores		*/
+	uint32_t core_cnt;	/* number of reserved cores		*/
+	job_resources_t *core_resrcs;	/* details of allocated cores	*/
 	uint32_t duration;	/* time in seconds for this
 				 * reservation to last                  */
 	time_t end_time;	/* end time of reservation		*/
@@ -448,11 +459,11 @@ extern time_t last_job_update;	/* time of last update to job records */
 #define FEATURE_OP_XOR  2
 #define FEATURE_OP_XAND 3
 #define FEATURE_OP_END  4		/* last entry lacks separator */
-struct feature_record {
+typedef struct job_feature {
 	char *name;			/* name of feature */
 	uint16_t count;			/* count of nodes with this feature */
 	uint8_t op_code;		/* separator, see FEATURE_OP_ above */
-};
+} job_feature_t;
 
 /* job_details - specification of a job's constraints,
  * can be purged after initiation */
@@ -501,7 +512,7 @@ struct job_details {
 	uint16_t mem_bind_type;		/* see mem_bind_type_t */
 	uint32_t min_cpus;		/* minimum number of cpus */
 	uint32_t min_nodes;		/* minimum number of nodes */
-	uint16_t nice;			/* requested priority change,
+	uint32_t nice;			/* requested priority change,
 					 * NICE_OFFSET == no change */
 	uint16_t ntasks_per_node;	/* number of tasks on each node */
 	uint32_t num_tasks;		/* number of tasks to start */
@@ -538,7 +549,8 @@ struct job_details {
 					 * is enabled */
 	uint32_t usable_nodes;		/* node count needed by preemption */
 	uint8_t whole_node;		/* 1: --exclusive
-					 * 2: --exclusive=user */
+					 * 2: --exclusive=user
+					 * 3: --exclusive=mcs */
 	char *work_dir;			/* pathname of working directory */
 };
 
@@ -609,6 +621,7 @@ struct job_record {
 					 * bluegene and the linear plugins
 					 * 0 if cr is NOT enabled,
 					 * 1 if cr is enabled */
+	time_t deadline;		/* deadline */
 	uint32_t db_index;              /* used only for database
 					 * plugins */
 	uint32_t derived_ec;		/* highest exit code of all job steps */
@@ -653,6 +666,7 @@ struct job_record {
 	uint16_t mail_type;		/* see MAIL_JOB_* in slurm.h */
 	char *mail_user;		/* user to get e-mail notification */
 	uint32_t magic;			/* magic cookie for data integrity */
+	char *mcs_label;		/* mcs_label if mcs plugin in use */
 	char *name;			/* name of the job */
 	char *network;			/* network/switch requirement spec */
 	uint32_t next_step_id;		/* next step id to be used */
@@ -711,7 +725,6 @@ struct job_record {
 	char *resp_host;		/* host for srun communications */
 	char *sched_nodes;		/* list of nodes scheduled for job */
 	dynamic_plugin_data_t *select_jobinfo;/* opaque data, BlueGene */
-	uint8_t sicp_mode;		/* set for inter-cluster jobs */
 	char **spank_job_env;		/* environment variables for job prolog
 					 * and epilog scripts as set by SPANK
 					 * plugins */
@@ -780,6 +793,8 @@ struct job_record {
 #define SLURM_DEPEND_SINGLETON		5	/* Only one job for this
 						 * user/name at a time */
 #define SLURM_DEPEND_EXPAND		6	/* Expand running job */
+#define SLURM_DEPEND_AFTER_CORRESPOND	7	/* After corresponding job array
+						 * elements completes */
 
 #define SLURM_FLAGS_OR			1	/* OR job dependencies */
 
@@ -1222,6 +1237,9 @@ extern void job_array_start(struct job_record *job_ptr);
 /* Return true if a job array task can be started */
 extern bool job_array_start_test(struct job_record *job_ptr);
 
+/* Clear job's CONFIGURING flag and advance end time as needed */
+extern void job_config_fini(struct job_record *job_ptr);
+
 /* Reset a job's end_time based upon it's start_time and time_limit.
  * NOTE: Do not reset the end_time if already being preempted */
 extern void job_end_time_reset(struct job_record  *job_ptr);
@@ -1430,14 +1448,16 @@ extern bool job_independent(struct job_record *job_ptr, int will_run);
 
 /*
  * job_req_node_filter - job reqeust node filter.
- * clear from a bitmap the nodes which can not be used for a job
- * test memory size, required features, processor count, etc.
+ *	clear from a bitmap the nodes which can not be used for a job
+ *	test memory size, required features, processor count, etc.
+ * NOTE: Does not support exclusive OR of features.
+ *	It just matches first element of XOR and ignores count.
  * IN job_ptr - pointer to node to be scheduled
  * IN/OUT bitmap - set of nodes being considered for use
  * RET SLURM_SUCCESS or EINVAL if can't filter (exclusive OR of features)
  */
 extern int job_req_node_filter(struct job_record *job_ptr,
-			       bitstr_t *avail_bitmap);
+			       bitstr_t *avail_bitmap, bool test_only);
 
 /*
  * job_requeue - Requeue a running or pending batch job
@@ -1466,6 +1486,20 @@ extern int job_requeue2(uid_t uid, requeue_msg_t *req_ptr,
                        slurm_fd_t conn_fd, uint16_t protocol_version,
                        bool preempt);
 
+/*
+ * job_set_top - Move the specified job to the top of the queue (at least
+ *	for that user ID, partition, account, and QOS).
+ *
+ * IN top_ptr - user request
+ * IN uid - user id of the user issuing the RPC
+ * IN conn_fd - file descriptor on which to send reply,
+ *              -1 if none
+ * IN protocol_version - slurm protocol version of client
+ * RET 0 on success, otherwise ESLURM error code
+ */
+extern int job_set_top(top_job_msg_t *top_ptr, uid_t uid, slurm_fd_t conn_fd,
+		       uint16_t protocol_version);
+
 /*
  * job_step_complete - note normal completion the specified job step
  * IN job_id - id of the job to be completed
@@ -1734,18 +1768,6 @@ extern void pack_all_node (char **buffer_ptr, int *buffer_size,
 			   uint16_t show_flags, uid_t uid,
 			   uint16_t protocol_version);
 
-/*
- * pack_all_sicp - dump inter-cluster job state information
- * OUT buffer_ptr - the pointer is set to the allocated buffer.
- * OUT buffer_size - set to size of the buffer in bytes
- * IN uid - uid of user making request (for job/partition filtering)
- * NOTE: the buffer at *buffer_ptr must be xfreed by the caller
- * NOTE: change _unpack_sicp_msg() in common/slurm_protocol_pack.c
- *	whenever the data format changes
- */
-extern void pack_all_sicp(char **buffer_ptr, int *buffer_size,
-			  uid_t uid, uint16_t protocol_version);
-
 /* Pack all scheduling statistics */
 extern void pack_all_stat(int resp, char **buffer_ptr, int *buffer_size,
 			  uint16_t protocol_version);
@@ -2110,12 +2132,6 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr,
  */
 extern void step_list_purge(struct job_record *job_ptr);
 
-/* start_power_mgr - Start power management thread as needed. The thread
- *	terminates automatically at slurmctld shutdown time.
- * IN thread_id - pointer to thread ID of the started pthread.
- */
-extern void start_power_mgr(pthread_t *thread_id);
-
 /*
  * step_epilog_complete - note completion of epilog on some node and
  *	release it's switch windows if appropriate. can perform partition
diff --git a/src/slurmctld/slurmctld_plugstack.c b/src/slurmctld/slurmctld_plugstack.c
index c28c6552b..bc134d1e5 100644
--- a/src/slurmctld/slurmctld_plugstack.c
+++ b/src/slurmctld/slurmctld_plugstack.c
@@ -122,7 +122,7 @@ extern int slurmctld_plugstack_init(void)
 			      (g_context_cnt + 1)));
 		xrealloc(g_context,
 			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
-		if (strncmp(type, "slurmctld/", 10) == 0)
+		if (xstrncmp(type, "slurmctld/", 10) == 0)
 			type += 10; /* backward compatibility */
 		type = xstrdup_printf("slurmctld/%s", type);
 		g_context[g_context_cnt] = plugin_context_create(
diff --git a/src/slurmctld/state_save.c b/src/slurmctld/state_save.c
index 20832ac41..3f9d15e95 100644
--- a/src/slurmctld/state_save.c
+++ b/src/slurmctld/state_save.c
@@ -176,9 +176,8 @@ extern void *slurmctld_state_save(void *no_data)
 	int save_count;
 
 #if HAVE_SYS_PRCTL_H
-	if (prctl(PR_SET_NAME, "slurmctld_sstate", NULL, NULL, NULL) < 0) {
-		error("%s: cannot set my name to %s %m",
-		      __func__, "slurmctld_sstate");
+	if (prctl(PR_SET_NAME, "sstate", NULL, NULL, NULL) < 0) {
+		error("%s: cannot set my name to %s %m", __func__, "sstate");
 	}
 #endif
 
diff --git a/src/slurmctld/step_mgr.c b/src/slurmctld/step_mgr.c
index 9c7a3b08b..d82f6878b 100644
--- a/src/slurmctld/step_mgr.c
+++ b/src/slurmctld/step_mgr.c
@@ -64,6 +64,7 @@
 #include "src/common/node_select.h"
 #include "src/common/slurm_accounting_storage.h"
 #include "src/common/slurm_jobacct_gather.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_protocol_interface.h"
 #include "src/common/switch.h"
 #include "src/common/xstring.h"
@@ -227,10 +228,8 @@ static void _internal_step_complete(struct job_record *job_ptr,
 		job_ptr->derived_ec = MAX(job_ptr->derived_ec,
 					  step_ptr->exit_code);
 
-		/* This operations are needed for Cray systems and also provide
-		 * a cleaner state for requeued jobs. */
-		step_ptr->state = JOB_COMPLETING;
-		select_g_step_finish(step_ptr);
+		step_ptr->state |= JOB_COMPLETING;
+		select_g_step_finish(step_ptr, false);
 #if !defined(HAVE_NATIVE_CRAY) && !defined(HAVE_CRAY_NETWORK)
 		/* On native Cray, post_job_step is called after NHC completes.
 		 * IF SIMULATING A CRAY THIS NEEDS TO BE COMMENTED OUT!!!! */
@@ -474,7 +473,7 @@ int job_step_signal(uint32_t job_id, uint32_t step_id,
 	if (notify_srun == -1) {
 		char *launch_type = slurm_get_launch_type();
 		/* do this for all but slurm (poe, aprun, etc...) */
-		if (strcmp(launch_type, "launch/slurm")) {
+		if (xstrcmp(launch_type, "launch/slurm")) {
 			notify_srun = 1;
 			notify_slurmd = false;
 		} else
@@ -563,6 +562,11 @@ int job_step_signal(uint32_t job_id, uint32_t step_id,
 	} else if ((signal == SIGKILL) || notify_slurmd)
 		signal_step_tasks(step_ptr, signal, REQUEST_SIGNAL_TASKS);
 
+	/* This has to be done last or we have a race condition with the
+	 * step_ptr not being around after this is called.  */
+	if (signal == SIGKILL)
+		select_g_step_finish(step_ptr, true);
+
 	return SLURM_SUCCESS;
 }
 
@@ -889,8 +893,8 @@ _pick_step_nodes (struct job_record  *job_ptr,
 {
 	int node_inx, first_bit, last_bit;
 	struct node_record *node_ptr;
-	bitstr_t *nodes_avail = NULL, *nodes_idle = NULL,
-		*select_nodes_avail = NULL;
+	bitstr_t *nodes_avail = NULL, *nodes_idle = NULL;
+	bitstr_t *select_nodes_avail = NULL;
 	bitstr_t *nodes_picked = NULL, *node_tmp = NULL;
 	int error_code, nodes_picked_cnt = 0, cpus_picked_cnt = 0;
 	int cpu_cnt, i, task_cnt;
@@ -933,9 +937,10 @@ _pick_step_nodes (struct job_record  *job_ptr,
 	bit_and (nodes_avail, up_node_bitmap);
 	if (step_spec->features) {
 		/* We only select for a single feature name here.
-		 * Add support for AND, OR, etc. here if desired */
-		struct features_record *feat_ptr;
-		feat_ptr = list_find_first(feature_list, list_find_feature,
+		 * FIXME: Add support for AND, OR, etc. here if desired */
+		node_feature_t *feat_ptr;
+		feat_ptr = list_find_first(active_feature_list,
+					   list_find_feature,
 					   (void *) step_spec->features);
 		if (feat_ptr && feat_ptr->node_bitmap)
 			bit_and(nodes_avail, feat_ptr->node_bitmap);
@@ -972,20 +977,14 @@ _pick_step_nodes (struct job_record  *job_ptr,
 				FREE_NULL_BITMAP(nodes_avail);
 				FREE_NULL_BITMAP(select_nodes_avail);
 				*return_code = ESLURM_NODES_BUSY;
-				/* Update job's end-time to allow for node
-				 * boot time. */
-				if ((job_ptr->time_limit != INFINITE) &&
-				    (!job_ptr->preempt_time)) {
-					job_ptr->end_time = time(NULL) +
-						(job_ptr->time_limit * 60);
-				}
 				return NULL;
 			}
 		}
 		if (job_ptr->details
 		    && job_ptr->details->prolog_running == 0) {
-			job_ptr->job_state &= (~JOB_CONFIGURING);
-			debug("Configuration for job %u complete", job_ptr->job_id);
+			info("%s: Configuration for job %u is complete",
+			      __func__, job_ptr->job_id);
+			job_config_fini(job_ptr);
 		}
 	}
 
@@ -1182,6 +1181,7 @@ _pick_step_nodes (struct job_record  *job_ptr,
 		if (tasks_picked_cnt >= step_spec->num_tasks)
 			return nodes_avail;
 		FREE_NULL_BITMAP(nodes_avail);
+		FREE_NULL_BITMAP(select_nodes_avail);
 
 		if (total_task_cnt >= step_spec->num_tasks)
 			*return_code = ESLURM_NODES_BUSY;
@@ -1196,6 +1196,18 @@ _pick_step_nodes (struct job_record  *job_ptr,
 		uint32_t tmp_mem, tmp_cpus, avail_cpus, total_cpus;
 		uint32_t avail_tasks, total_tasks;
 
+		if (_is_mem_resv() && step_spec->pn_min_memory &&
+		    ((step_spec->pn_min_memory & MEM_PER_CPU) == 0) &&
+		    job_ptr->details && job_ptr->details->pn_min_memory &&
+		    ((job_ptr->details->pn_min_memory & MEM_PER_CPU) == 0) &&
+		    (step_spec->pn_min_memory >
+		     job_ptr->details->pn_min_memory)) {
+			FREE_NULL_BITMAP(nodes_avail);
+			FREE_NULL_BITMAP(select_nodes_avail);
+			*return_code = ESLURM_INVALID_TASK_MEMORY;
+			return NULL;
+		}
+
 		usable_cpu_cnt = xmalloc(sizeof(uint32_t) * node_record_count);
 		first_bit = bit_ffs(job_resrcs_ptr->node_bitmap);
 		last_bit  = bit_fls(job_resrcs_ptr->node_bitmap);
@@ -1271,7 +1283,9 @@ _pick_step_nodes (struct job_record  *job_ptr,
 				total_tasks /= cpus_per_task;
 			}
 			if (avail_tasks == 0) {
-				if (step_spec->min_nodes == INFINITE) {
+				if ((step_spec->min_nodes == INFINITE) ||
+				    (step_spec->min_nodes ==
+				     job_ptr->node_cnt)) {
 					FREE_NULL_BITMAP(nodes_avail);
 					FREE_NULL_BITMAP(select_nodes_avail);
 					xfree(usable_cpu_cnt);
@@ -1345,27 +1359,7 @@ _pick_step_nodes (struct job_record  *job_ptr,
 		}
 		if ((step_spec->task_dist & SLURM_DIST_STATE_BASE) ==
 		    SLURM_DIST_ARBITRARY) {
-			/* if we are in arbitrary mode we need to make
-			 * sure we aren't running on an elan switch.
-			 * If we aren't change the number of nodes
-			 * available to the number we were given since
-			 * that is what the user wants to run on.
-			 */
-			if (!strcmp(slurmctld_conf.switch_type,
-				    "switch/elan")) {
-				info("Can't do an ARBITRARY task layout with "
-				     "switch type elan. Switching DIST type "
-				     "to BLOCK");
-				xfree(step_spec->node_list);
-				step_spec->task_dist &= SLURM_DIST_STATE_FLAGS;
-				step_spec->task_dist |= SLURM_DIST_BLOCK;
-				FREE_NULL_BITMAP(selected_nodes);
-				step_spec->min_nodes =
-					bit_set_count(nodes_avail);
-			} else {
-				step_spec->min_nodes =
-					bit_set_count(selected_nodes);
-			}
+			step_spec->min_nodes = bit_set_count(selected_nodes);
 		}
 		if (selected_nodes) {
 			int node_cnt = 0;
@@ -2106,6 +2100,35 @@ static int _test_strlen(char *test_str, char *str_name, int max_str_len)
 	return SLURM_SUCCESS;
 }
 
+/* Calculate a step's cpus_per_task value. Set to zero if we can't distributed
+ * the tasks evenly over the nodes (heterogeneous job allocation). */
+static int _calc_cpus_per_task(job_step_create_request_msg_t *step_specs,
+			       struct job_record  *job_ptr)
+{
+	int cpus_per_task = 0, i;
+
+	if ((step_specs->cpu_count == 0) ||
+	    (step_specs->cpu_count % step_specs->num_tasks))
+		return cpus_per_task;
+
+	cpus_per_task = step_specs->cpu_count / step_specs->num_tasks;
+	if (cpus_per_task < 1)
+		cpus_per_task = 1;
+
+	if (!job_ptr->job_resrcs)
+		return cpus_per_task;
+
+	for (i = 0; i < job_ptr->job_resrcs->cpu_array_cnt; i++) {
+		if ((cpus_per_task > job_ptr->job_resrcs->cpu_array_value[i]) ||
+		    (job_ptr->job_resrcs->cpu_array_value[i] % cpus_per_task)) {
+			cpus_per_task = 0;
+			break;
+		}
+	}
+
+	return cpus_per_task;
+}
+
 /*
  * step_create - creates a step_record in step_specs->job_id, sets up the
  *	according to the step_specs.
@@ -2215,11 +2238,6 @@ step_create(job_step_create_request_msg_t *step_specs,
 	    (task_dist != SLURM_DIST_ARBITRARY))
 		return ESLURM_BAD_DIST;
 
-	if ((task_dist == SLURM_DIST_ARBITRARY) &&
-	    (!strcmp(slurmctld_conf.switch_type, "switch/elan"))) {
-		return ESLURM_TASKDIST_ARBITRARY_UNSUPPORTED;
-	}
-
 	if (_test_strlen(step_specs->ckpt_dir, "ckpt_dir", MAXPATHLEN)	||
 	    _test_strlen(step_specs->gres, "gres", 1024)		||
 	    _test_strlen(step_specs->host, "host", 1024)		||
@@ -2292,21 +2310,12 @@ step_create(job_step_create_request_msg_t *step_specs,
 	if (step_specs->num_tasks < 1)
 		return ESLURM_BAD_TASK_COUNT;
 
-	/* we set cpus_per_task to 0 if we can't spread them evenly
-	 * over the nodes (hetergeneous systems) */
-	if (!step_specs->cpu_count
-	    || (step_specs->cpu_count % step_specs->num_tasks))
-		cpus_per_task = 0;
-	else {
-		cpus_per_task = step_specs->cpu_count / step_specs->num_tasks;
-		if (cpus_per_task < 1)
-			cpus_per_task = 1;
-	}
+	cpus_per_task = _calc_cpus_per_task(step_specs, job_ptr);
 
 	if (step_specs->no_kill > 1)
 		step_specs->no_kill = 1;
 
-	if (step_specs->gres && !strcasecmp(step_specs->gres, "NONE"))
+	if (step_specs->gres && !xstrcasecmp(step_specs->gres, "NONE"))
 		xfree(step_specs->gres);
 	else if (step_specs->gres == NULL)
 		step_specs->gres = xstrdup(job_ptr->gres);
@@ -2557,6 +2566,7 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr,
 					       uint32_t task_dist,
 					       uint16_t plane_size)
 {
+	slurm_step_layout_t *step_layout = NULL;
 	uint16_t cpus_per_node[node_count];
 	struct job_record *job_ptr = step_ptr->job_ptr;
 	job_resources_t *job_resrcs_ptr = job_ptr->job_resrcs;
@@ -2726,12 +2736,15 @@ extern slurm_step_layout_t *step_layout_create(struct step_record *step_ptr,
 	/* } */
 
 	/* layout the tasks on the nodes */
-	return slurm_step_layout_create(step_node_list,
-					cpus_per_node, cpu_count_reps,
-					node_count, num_tasks,
-					cpus_per_task,
-					task_dist,
-					plane_size);
+	if ((step_layout = slurm_step_layout_create(step_node_list,
+						    cpus_per_node,
+						    cpu_count_reps, node_count,
+						    num_tasks, cpus_per_task,
+						    task_dist, plane_size))) {
+		step_layout->start_protocol_ver = step_ptr->start_protocol_ver;
+	}
+
+	return step_layout;
 }
 
 /* Translate v14.11 CPU frequency data between old and new formats */
@@ -2809,7 +2822,52 @@ static void _pack_ctld_job_step_info(struct step_record *step_ptr, Buf buffer,
 	cpu_cnt = step_ptr->cpu_count;
 #endif
 
-	if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
+	if (protocol_version >= SLURM_16_05_PROTOCOL_VERSION) {
+		pack32(step_ptr->job_ptr->array_job_id, buffer);
+		pack32(step_ptr->job_ptr->array_task_id, buffer);
+		pack32(step_ptr->job_ptr->job_id, buffer);
+		pack32(step_ptr->step_id, buffer);
+		pack16(step_ptr->ckpt_interval, buffer);
+		pack32(step_ptr->job_ptr->user_id, buffer);
+		pack32(cpu_cnt, buffer);
+		pack32(step_ptr->cpu_freq_min, buffer);
+		pack32(step_ptr->cpu_freq_max, buffer);
+		pack32(step_ptr->cpu_freq_gov, buffer);
+		pack32(task_cnt, buffer);
+		if (step_ptr->step_layout)
+			pack32(step_ptr->step_layout->task_dist, buffer);
+		else
+			pack32((uint32_t) SLURM_DIST_UNKNOWN, buffer);
+		pack32(step_ptr->time_limit, buffer);
+		pack32(step_ptr->state, buffer);
+
+		pack_time(step_ptr->start_time, buffer);
+		if (IS_JOB_SUSPENDED(step_ptr->job_ptr)) {
+			run_time = step_ptr->pre_sus_time;
+		} else {
+			begin_time = MAX(step_ptr->start_time,
+					 step_ptr->job_ptr->suspend_time);
+			run_time = step_ptr->pre_sus_time +
+				difftime(time(NULL), begin_time);
+		}
+		pack_time(run_time, buffer);
+
+		if (step_ptr->job_ptr->part_ptr)
+			packstr(step_ptr->job_ptr->part_ptr->name, buffer);
+		else
+			packstr(step_ptr->job_ptr->partition, buffer);
+		packstr(step_ptr->resv_ports, buffer);
+		packstr(node_list, buffer);
+		packstr(step_ptr->name, buffer);
+		packstr(step_ptr->network, buffer);
+		pack_bit_fmt(pack_bitstr, buffer);
+		packstr(step_ptr->ckpt_dir, buffer);
+		packstr(step_ptr->gres, buffer);
+		select_g_select_jobinfo_pack(step_ptr->select_jobinfo, buffer,
+					     protocol_version);
+		packstr(step_ptr->tres_fmt_alloc_str, buffer);
+		pack16(step_ptr->start_protocol_ver, buffer);
+	} else if (protocol_version >= SLURM_15_08_PROTOCOL_VERSION) {
 		pack32(step_ptr->job_ptr->array_job_id, buffer);
 		pack32(step_ptr->job_ptr->array_task_id, buffer);
 		pack32(step_ptr->job_ptr->job_id, buffer);
@@ -2853,7 +2911,7 @@ static void _pack_ctld_job_step_info(struct step_record *step_ptr, Buf buffer,
 		select_g_select_jobinfo_pack(step_ptr->select_jobinfo, buffer,
 					     protocol_version);
 		packstr(step_ptr->tres_fmt_alloc_str, buffer);
-	} else if (protocol_version >= SLURM_14_03_PROTOCOL_VERSION) {
+	} else if (protocol_version >= SLURM_14_11_PROTOCOL_VERSION) {
 		uint32_t utmp32 = 0;
 		pack32(step_ptr->job_ptr->array_job_id, buffer);
 		pack32(step_ptr->job_ptr->array_task_id, buffer);
@@ -2943,8 +3001,11 @@ extern int pack_ctld_job_step_info_response_msg(
 
 		if ((slurmctld_conf.private_data & PRIVATE_DATA_JOBS) &&
 		    (job_ptr->user_id != uid) && !validate_operator(uid) &&
-		    !assoc_mgr_is_user_acct_coord(acct_db_conn, uid,
-						  job_ptr->account))
+		    (((slurm_mcs_get_privatedata() == 0) &&
+		      !assoc_mgr_is_user_acct_coord(acct_db_conn, uid,
+						    job_ptr->account)) ||
+		     ((slurm_mcs_get_privatedata() == 1) &&
+		      (mcs_g_check_mcs_label(uid, job_ptr->mcs_label) != 0))))
 			continue;
 
 		step_iterator = list_iterator_create(job_ptr->step_list);
@@ -3453,7 +3514,8 @@ extern void step_set_alloc_tres(
 
 		step_ptr->tres_fmt_alloc_str =
 			slurmdb_make_tres_string_from_simple(
-				step_ptr->tres_alloc_str, assoc_mgr_tres_list);
+				step_ptr->tres_alloc_str, assoc_mgr_tres_list,
+				NO_VAL, CONVERT_NUM_UNIT_EXACT);
 
 		if (!assoc_mgr_locked)
 			assoc_mgr_unlock(&locks);
@@ -3980,7 +4042,11 @@ extern int load_step_state(struct job_record *job_ptr, Buf buffer,
 	step_ptr->cpu_freq_max = cpu_freq_max;
 	step_ptr->cpu_freq_gov = cpu_freq_gov;
 	step_ptr->state        = state;
-	step_ptr->start_protocol_ver = start_protocol_ver;
+	/* Prior to 16.05, the step_layout->start_protocol_version isn't set on
+	 * creation of the layout. After 16.05 is EOL'ed then the step_layout's
+	 * start_protocol_version doesn't need to be set here anymore. */
+	step_ptr->step_layout->start_protocol_ver = step_ptr->start_protocol_ver
+		= start_protocol_ver;
 
 	if (!step_ptr->ext_sensors)
 		step_ptr->ext_sensors = ext_sensors_alloc();
@@ -4006,12 +4072,9 @@ extern int load_step_state(struct job_record *job_ptr, Buf buffer,
 		xfree(core_job);
 	}
 
-	if (step_ptr->step_layout && step_ptr->step_layout->node_list) {
-		switch_g_job_step_allocated(switch_tmp,
-					    step_ptr->step_layout->node_list);
-	} else {
-		switch_g_job_step_allocated(switch_tmp, NULL);
-	}
+	switch_g_job_step_allocated(switch_tmp,
+				    step_ptr->step_layout->node_list);
+
 	info("recovered job step %u.%u", job_ptr->job_id, step_id);
 	return SLURM_SUCCESS;
 
@@ -4052,7 +4115,7 @@ extern void step_checkpoint(void)
 	/* Exit if "checkpoint/none" is configured */
 	if (ckpt_run == -1) {
 		char *ckpt_type = slurm_get_checkpoint_type();
-		if (strcasecmp(ckpt_type, "checkpoint/none"))
+		if (xstrcasecmp(ckpt_type, "checkpoint/none"))
 			ckpt_run = 1;
 		else
 			ckpt_run = 0;
@@ -4146,7 +4209,7 @@ static void _signal_step_timelimit(struct job_record *job_ptr,
 #else
 		char *launch_type = slurm_get_launch_type();
 		/* do this for all but slurm (poe, aprun, etc...) */
-		if (strcmp(launch_type, "launch/slurm"))
+		if (xstrcmp(launch_type, "launch/slurm"))
 			notify_srun = 1;
 		else
 			notify_srun = 0;
@@ -4156,8 +4219,9 @@ static void _signal_step_timelimit(struct job_record *job_ptr,
 
 	step_ptr->state = JOB_TIMEOUT;
 
-	if (notify_srun) {
+	if (notify_srun) {	/* Handle termination from srun, not slurmd */
 		srun_step_timeout(step_ptr, now);
+		(void) select_g_step_finish(step_ptr, true);
 		return;
 	}
 
@@ -4199,6 +4263,8 @@ static void _signal_step_timelimit(struct job_record *job_ptr,
 	}
 #endif
 
+	(void) select_g_step_finish(step_ptr, true);
+
 	if (agent_args->node_count == 0) {
 		hostlist_destroy(agent_args->hostlist);
 		xfree(agent_args);
@@ -4485,7 +4551,8 @@ extern int post_job_step(struct step_record *step_ptr)
 				 step_ptr->step_id);
 
 	last_job_update = time(NULL);
-	step_ptr->state = JOB_COMPLETE;
+	/* Don't need to set state. Will be destroyed in next steps. */
+	/* step_ptr->state = JOB_COMPLETE; */
 
 	error_code = delete_step_record(job_ptr, step_ptr->step_id);
 	if (error_code == ENOENT) {
diff --git a/src/slurmctld/trigger_mgr.c b/src/slurmctld/trigger_mgr.c
index 534b07615..f5806e41a 100644
--- a/src/slurmctld/trigger_mgr.c
+++ b/src/slurmctld/trigger_mgr.c
@@ -71,7 +71,6 @@
 
 /* Change TRIGGER_STATE_VERSION value when changing the state save format */
 #define TRIGGER_STATE_VERSION        "PROTOCOL_VERSION"
-#define TRIGGER_14_03_STATE_VERSION  "VER004"	/* SLURM version 14.03 */
 
 List trigger_list;
 uint32_t next_trigger_id = 1;
@@ -960,15 +959,8 @@ extern void trigger_state_restore(void)
 
 	buffer = create_buf(data, data_size);
 	safe_unpackstr_xmalloc(&ver_str, &ver_str_len, buffer);
-	if (ver_str) {
-		/* 14.03 and 2.6 all had the same version, so just go
-		   with 14.03 here.
-		*/
-		if (!strcmp(ver_str, TRIGGER_STATE_VERSION))
-			safe_unpack16(&protocol_version, buffer);
-		else if (!strcmp(ver_str, TRIGGER_14_03_STATE_VERSION))
-			protocol_version = SLURM_14_03_PROTOCOL_VERSION;
-	}
+	if (ver_str && !xstrcmp(ver_str, TRIGGER_STATE_VERSION))
+		safe_unpack16(&protocol_version, buffer);
 
 	if (protocol_version == (uint16_t) NO_VAL) {
 		error("Can't recover trigger state, data version "
@@ -1007,7 +999,7 @@ static bool _front_end_job_test(bitstr_t *front_end_bitmap,
 
 	for (i = 0; i < front_end_node_cnt; i++) {
 		if (bit_test(front_end_bitmap, i) &&
-		    !strcmp(front_end_nodes[i].name, job_ptr->batch_host)) {
+		    !xstrcmp(front_end_nodes[i].name, job_ptr->batch_host)) {
 			return true;
 		}
 	}
diff --git a/src/slurmd/Makefile.in b/src/slurmd/Makefile.in
index e08a88921..c54db43fc 100644
--- a/src/slurmd/Makefile.in
+++ b/src/slurmd/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/slurmd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/slurmd/common/Makefile.in b/src/slurmd/common/Makefile.in
index 3f38e09c8..983286471 100644
--- a/src/slurmd/common/Makefile.in
+++ b/src/slurmd/common/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 noinst_PROGRAMS = libslurmd_common.o$(EXEEXT)
 subdir = src/slurmd/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -238,8 +239,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -339,6 +338,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -377,6 +380,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -420,6 +426,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -470,6 +479,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/slurmd/common/core_spec_plugin.c b/src/slurmd/common/core_spec_plugin.c
index 2f6209f07..9dfdb9f7d 100644
--- a/src/slurmd/common/core_spec_plugin.c
+++ b/src/slurmd/common/core_spec_plugin.c
@@ -103,7 +103,7 @@ extern int core_spec_g_init(void)
 			 (g_core_spec_context_num + 1));
 		xrealloc(g_core_spec_context, (sizeof(plugin_context_t *)
 					  * (g_core_spec_context_num + 1)));
-		if (strncmp(core_spec, "core_spec/", 10) == 0)
+		if (xstrncmp(core_spec, "core_spec/", 10) == 0)
 			core_spec += 10; /* backward compatibility */
 		core_spec = xstrdup_printf("core_spec/%s",
 					       core_spec);
diff --git a/src/slurmd/common/job_container_plugin.c b/src/slurmd/common/job_container_plugin.c
index fb6f2de5f..2aa7ce2f9 100644
--- a/src/slurmd/common/job_container_plugin.c
+++ b/src/slurmd/common/job_container_plugin.c
@@ -109,7 +109,7 @@ extern int job_container_init(void)
 			 (g_container_context_num + 1));
 		xrealloc(g_container_context, (sizeof(plugin_context_t *)
 					  * (g_container_context_num + 1)));
-		if (strncmp(job_container, "job_container/", 14) == 0)
+		if (xstrncmp(job_container, "job_container/", 14) == 0)
 			job_container += 14; /* backward compatibility */
 		job_container = xstrdup_printf("job_container/%s",
 					       job_container);
diff --git a/src/slurmd/common/reverse_tree.h b/src/slurmd/common/reverse_tree.h
index 52b81b45f..7d3681306 100644
--- a/src/slurmd/common/reverse_tree.h
+++ b/src/slurmd/common/reverse_tree.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/common/reverse_tree.h
- * $Id: slurmd.h 7501 2006-03-14 20:05:50Z morrone $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/common/reverse_tree_math.c b/src/slurmd/common/reverse_tree_math.c
index 5347d8c32..d10eea5ba 100644
--- a/src/slurmd/common/reverse_tree_math.c
+++ b/src/slurmd/common/reverse_tree_math.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmd/reverse_tree_math.c
- *  $Id: slurmd.c 7507 2006-03-15 00:57:30Z morrone $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/common/reverse_tree_math.h b/src/slurmd/common/reverse_tree_math.h
index f11d6869f..40d7bc6e7 100644
--- a/src/slurmd/common/reverse_tree_math.h
+++ b/src/slurmd/common/reverse_tree_math.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/common/reverse_tree_math.h
- * $Id: slurmd.h 7501 2006-03-14 20:05:50Z morrone $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/common/setproctitle.c b/src/slurmd/common/setproctitle.c
index 184c1fd58..47fea2020 100644
--- a/src/slurmd/common/setproctitle.c
+++ b/src/slurmd/common/setproctitle.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/common/setproctitle.c - argv manipulation
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
diff --git a/src/slurmd/common/setproctitle.h b/src/slurmd/common/setproctitle.h
index 2e48644fa..5eac8ac7a 100644
--- a/src/slurmd/common/setproctitle.h
+++ b/src/slurmd/common/setproctitle.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/common/setproctitle.h - Emulation of BSD setproctitle()
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/common/slurmd_cgroup.c b/src/slurmd/common/slurmd_cgroup.c
index 0d9b6dc09..27d560998 100644
--- a/src/slurmd/common/slurmd_cgroup.c
+++ b/src/slurmd/common/slurmd_cgroup.c
@@ -167,7 +167,7 @@ again:
 			   getuid(),getgid()) != XCGROUP_SUCCESS) {
 		goto error;
 	}
-	if (xcgroup_instanciate(&system_cpuset_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&system_cpuset_cg) != XCGROUP_SUCCESS) {
 		goto error;
 	}
 	if (_xcgroup_cpuset_init(&system_cpuset_cg) != XCGROUP_SUCCESS) {
@@ -273,7 +273,7 @@ extern int init_system_memory_cgroup(void)
 			   getuid(), getgid()) != XCGROUP_SUCCESS) {
 		goto error;
 	}
-	if (xcgroup_instanciate(&system_memory_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&system_memory_cg) != XCGROUP_SUCCESS) {
 		goto error;
 	}
 
@@ -329,7 +329,7 @@ static char* _system_cgroup_create_slurm_cg (xcgroup_ns_t* ns)
 		return pre;
 	}
 	slurm_cg.notify = 0;
-	if (xcgroup_instanciate(&slurm_cg) != XCGROUP_SUCCESS) {
+	if (xcgroup_instantiate(&slurm_cg) != XCGROUP_SUCCESS) {
 		error("system cgroup: unable to build slurm cgroup for "
 		      "ns %s: %m",
 		      ns->subsystems);
@@ -459,7 +459,23 @@ extern int attach_system_memory_pid(pid_t pid)
 	return SLURM_SUCCESS;
 }
 
-extern bool check_cgroup_job_confinement(void)
+extern bool check_memspec_cgroup_job_confinement(void)
+{
+	char *task_plugin_type = NULL;
+	bool status = false;
+
+	if (read_slurm_cgroup_conf(&slurm_cgroup_conf))
+		return false;
+	task_plugin_type = slurm_get_task_plugin();
+	if (slurm_cgroup_conf.constrain_ram_space &&
+	    strstr(task_plugin_type, "cgroup"))
+		status = true;
+	xfree(task_plugin_type);
+	free_slurm_cgroup_conf(&slurm_cgroup_conf);
+	return status;
+}
+
+extern bool check_corespec_cgroup_job_confinement(void)
 {
 	char *task_plugin_type = NULL;
 	bool status = FALSE;
diff --git a/src/slurmd/common/slurmd_cgroup.h b/src/slurmd/common/slurmd_cgroup.h
index 8224cd3fa..4b5bbd91b 100644
--- a/src/slurmd/common/slurmd_cgroup.h
+++ b/src/slurmd/common/slurmd_cgroup.h
@@ -67,8 +67,11 @@ extern int attach_system_cpuset_pid(pid_t pid);
 /* Attach a pid to system memory cgroup */
 extern int attach_system_memory_pid(pid_t pid);
 
-/* Check that cgroup job confinement is configured */
-extern bool check_cgroup_job_confinement(void);
+/* Check that corespec cgroup job confinement is configured */
+extern bool check_corespec_cgroup_job_confinement(void);
+
+/* Check that memspec cgroup job confinement is configured */
+extern bool check_memspec_cgroup_job_confinement(void);
 
 /* Attach a pid to the system cgroups */
 extern void attach_system_cgroup_pid(pid_t pid);
diff --git a/src/slurmd/common/task_plugin.c b/src/slurmd/common/task_plugin.c
index 88572e21e..e0847c64d 100644
--- a/src/slurmd/common/task_plugin.c
+++ b/src/slurmd/common/task_plugin.c
@@ -126,7 +126,7 @@ extern int slurmd_task_init(void)
 			 sizeof(slurmd_task_ops_t) * (g_task_context_num + 1));
 		xrealloc(g_task_context, (sizeof(plugin_context_t *)
 					  * (g_task_context_num + 1)));
-		if (strncmp(type, "task/", 5) == 0)
+		if (xstrncmp(type, "task/", 5) == 0)
 			type += 5; /* backward compatibility */
 		type = xstrdup_printf("task/%s", type);
 		g_task_context[g_task_context_num] = plugin_context_create(
diff --git a/src/slurmd/common/xcgroup.c b/src/slurmd/common/xcgroup.c
index 088e94e60..ba164a024 100644
--- a/src/slurmd/common/xcgroup.c
+++ b/src/slurmd/common/xcgroup.c
@@ -129,19 +129,13 @@ clean:
 
 /*
  * destroy a cgroup namespace
- *
- * returned values:
- *  - XCGROUP_ERROR
- *  - XCGROUP_SUCCESS
  */
-int xcgroup_ns_destroy(xcgroup_ns_t* cgns)
+void xcgroup_ns_destroy(xcgroup_ns_t* cgns)
 {
 	xfree(cgns->mnt_point);
 	xfree(cgns->mnt_args);
 	xfree(cgns->subsystems);
 	xfree(cgns->notify_prog);
-
-	return XCGROUP_SUCCESS;
 }
 
 /*
@@ -340,7 +334,7 @@ int xcgroup_ns_find_by_pid(xcgroup_ns_t* cgns, xcgroup_t* cg, pid_t pid)
 				continue;
 			*entry='\0';
 			/* check subsystem versus ns one */
-			if (strcmp(cgns->subsystems, subsys) != 0) {
+			if (xstrcmp(cgns->subsystems, subsys) != 0) {
 				debug("skipping cgroup subsys %s(%s)",
 				      subsys, cgns->subsystems);
 				continue;
@@ -399,14 +393,13 @@ int xcgroup_create(xcgroup_ns_t* cgns, xcgroup_t* cg,
 	return XCGROUP_SUCCESS;
 }
 
-int xcgroup_destroy(xcgroup_t* cg)
+void xcgroup_destroy(xcgroup_t* cg)
 {
 	cg->ns = NULL;
 	xfree(cg->name);
 	xfree(cg->path);
 	cg->uid = -1;
 	cg->gid = -1;
-	return XCGROUP_SUCCESS;
 }
 
 int xcgroup_lock(xcgroup_t* cg)
@@ -417,17 +410,16 @@ int xcgroup_lock(xcgroup_t* cg)
 		return fstatus;
 
 	if ((cg->fd = open(cg->path, O_RDONLY)) < 0) {
-		debug2("xcgroup_lock: error from open of cgroup '%s' : %m",
-		       cg->path);
+		debug2("%s: error from open of cgroup '%s' : %m",
+		       __func__, cg->path);
 		return fstatus;
 	}
 
 	if (flock(cg->fd,  LOCK_EX) < 0) {
-		debug2("xcgroup_lock: error locking cgroup '%s' : %m",
-		       cg->path);
+		debug2("%s: error locking cgroup '%s' : %m",
+		       __func__, cg->path);
 		close(cg->fd);
-	}
-	else
+	} else
 		fstatus = XCGROUP_SUCCESS;
 
 	return fstatus;
@@ -438,17 +430,16 @@ int xcgroup_unlock(xcgroup_t* cg)
 	int fstatus = XCGROUP_ERROR;
 
 	if (flock(cg->fd,  LOCK_UN) < 0) {
-		debug2("xcgroup_lock: error unlocking cgroup '%s' : %m",
-		       cg->path);
-	}
-	else
+		debug2("%s: error unlocking cgroup '%s' : %m",
+		       __func__, cg->path);
+	} else
 		fstatus = XCGROUP_SUCCESS;
 
 	close(cg->fd);
 	return fstatus;
 }
 
-int xcgroup_instanciate(xcgroup_t* cg)
+int xcgroup_instantiate(xcgroup_t* cg)
 {
 	int fstatus = XCGROUP_ERROR;
 	mode_t cmask;
@@ -486,8 +477,8 @@ int xcgroup_instanciate(xcgroup_t* cg)
 
 	/* change cgroup ownership as requested */
 	if (chown(file_path, uid, gid)) {
-		debug2("unable to chown %d:%d cgroup '%s' : %m",
-		       uid, gid, file_path);
+		debug2("%s: unable to chown %d:%d cgroup '%s' : %m",
+		       __func__, uid, gid, file_path);
 		return fstatus;
 	}
 
@@ -519,8 +510,8 @@ int xcgroup_load(xcgroup_ns_t* cgns, xcgroup_t* cg, char* uri)
 	}
 
 	if (stat((const char*)file_path, &buf)) {
-		debug2("unable to get cgroup '%s' entry '%s' properties"
-		       ": %m", cgns->mnt_point, file_path);
+		debug2("%s: unable to get cgroup '%s' entry '%s' properties"
+		       ": %m", __func__, cgns->mnt_point, file_path);
 		return fstatus;
 	}
 
@@ -544,36 +535,33 @@ int xcgroup_delete(xcgroup_t* cg)
 	 *   exist, do not propagate error back to caller.
 	 */
 	if (cg && cg->path && (rmdir(cg->path) < 0) && (errno != ENOENT)) {
-		debug2("xcgroup: rmdir(%s): %m", cg->path);
+		debug2("%s: rmdir(%s): %m", __func__, cg->path);
 		return XCGROUP_ERROR;
 	}
 	return XCGROUP_SUCCESS;
 }
 
-static int cgroup_procs_readable (xcgroup_t *cg)
+static char *_cgroup_procs_check (xcgroup_t *cg, int check_mode)
 {
 	struct stat st;
-	char *path = NULL;
-	int rc = 0;
-
-	xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs");
-	if ((stat (path, &st) >= 0) && (st.st_mode & S_IRUSR))
-		rc = 1;
-	xfree (path);
-	return (rc);
+	// If possible use cgroup.procs to add the processes atomically
+	char *path = xstrdup_printf("%s/%s", cg->path, "cgroup.procs");
+	if (!((stat (path, &st) >= 0) && (st.st_mode & check_mode))) {
+		xfree(path);
+		path = xstrdup_printf("%s/%s", cg->path, "tasks");
+	}
+
+	return path;
 }
 
-static int cgroup_procs_writable (xcgroup_t *cg)
+static char *_cgroup_procs_readable_path (xcgroup_t *cg)
 {
-	struct stat st;
-	char *path = NULL;
-	int rc = 0;
-
-	xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs");
-	if ((stat (path, &st) >= 0) && (st.st_mode & S_IWUSR))
-		rc = 1;
-	xfree (path);
-	return (rc);
+	return _cgroup_procs_check(cg, S_IRUSR);
+}
+
+static char *_cgroup_procs_writable_path (xcgroup_t *cg)
+{
+	return _cgroup_procs_check(cg, S_IWUSR);
 }
 
 /* This call is not intended to be used to move thread pids
@@ -581,17 +569,11 @@ static int cgroup_procs_writable (xcgroup_t *cg)
 int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids)
 {
 	int fstatus = XCGROUP_ERROR;
-	char* path = NULL;
-
-	// If possible use cgroup.procs to add the processes atomically
-	if (cgroup_procs_writable (cg))
-		xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs");
-	else
-		xstrfmtcat (path, "%s/%s", cg->path, "tasks");
+	char* path = _cgroup_procs_writable_path(cg);
 
 	fstatus = _file_write_uint32s(path, (uint32_t*)pids, npids);
 	if (fstatus != XCGROUP_SUCCESS)
-		debug2("unable to add pids to '%s'", cg->path);
+		debug2("%s: unable to add pids to '%s'", __func__, cg->path);
 
 	xfree(path);
 	return fstatus;
@@ -607,14 +589,11 @@ int xcgroup_get_pids(xcgroup_t* cg, pid_t **pids, int *npids)
 	if (pids == NULL || npids == NULL)
 		return SLURM_ERROR;
 
-	if (cgroup_procs_readable (cg))
-		xstrfmtcat (path, "%s/%s", cg->path, "cgroup.procs");
-	else
-		xstrfmtcat (path, "%s/%s", cg->path, "tasks");
+	path = _cgroup_procs_readable_path(cg);
 
 	fstatus = _file_read_uint32s(path, (uint32_t**)pids, npids);
 	if (fstatus != XCGROUP_SUCCESS)
-		debug2("unable to get pids of '%s'", cg->path);
+		debug2("%s: unable to get pids of '%s'", __func__, cg->path);
 
 	xfree(path);
 	return fstatus;
@@ -654,14 +633,15 @@ int xcgroup_set_params(xcgroup_t* cg, char* parameters)
 			fstatus = _file_write_content(file_path, value,
 						      strlen(value));
 			if (fstatus != XCGROUP_SUCCESS)
-				debug2("unable to set parameter '%s' to "
-				       "'%s' for '%s'", p, value, cpath);
+				debug2("%s: unable to set parameter '%s' to "
+					"'%s' for '%s'", __func__, p, value,
+					cpath);
 			else
-				debug3("parameter '%s' set to '%s' for '%s'",
-				       p, value, cpath);
-		}
-		else
-			debug2("bad parameters format for entry '%s'", p);
+				debug3("%s: parameter '%s' set to '%s' for '%s'",
+					__func__, p, value, cpath);
+		} else
+			debug2("%s: bad parameters format for entry '%s'",
+				__func__, p);
 	next_loop:
 		p = next;
 	}
@@ -684,11 +664,11 @@ int xcgroup_set_param(xcgroup_t* cg, char* param, char* content)
 
 	fstatus = _file_write_content(file_path, content, strlen(content));
 	if (fstatus != XCGROUP_SUCCESS)
-		debug2("unable to set parameter '%s' to "
-		       "'%s' for '%s'", param, content, cpath);
+		debug2("%s: unable to set parameter '%s' to '%s' for '%s'",
+			__func__, param, content, cpath);
 	else
-		debug3("parameter '%s' set to '%s' for '%s'",
-		       param, content, cpath);
+		debug3("%s: parameter '%s' set to '%s' for '%s'",
+			__func__, param, content, cpath);
 
 	return fstatus;
 }
@@ -705,8 +685,8 @@ int xcgroup_get_param(xcgroup_t* cg, char* param, char **content, size_t *csize)
 	} else {
 		fstatus = _file_read_content(file_path, content, csize);
 		if (fstatus != XCGROUP_SUCCESS)
-			debug2("unable to get parameter '%s' for '%s'",
-			       param, cpath);
+			debug2("%s: unable to get parameter '%s' for '%s'",
+				__func__, param, cpath);
 	}
 	return fstatus;
 }
@@ -725,11 +705,11 @@ int xcgroup_set_uint32_param(xcgroup_t* cg, char* param, uint32_t value)
 
 	fstatus = _file_write_uint32s(file_path, &value, 1);
 	if (fstatus != XCGROUP_SUCCESS)
-		debug2("unable to set parameter '%s' to "
-		       "'%u' for '%s'", param, value, cpath);
+		debug2("%s: unable to set parameter '%s' to '%u' for '%s'",
+			__func__, param, value, cpath);
 	else
-		debug3("parameter '%s' set to '%u' for '%s'",
-		       param, value, cpath);
+		debug3("%s: parameter '%s' set to '%u' for '%s'",
+			__func__, param, value, cpath);
 
 	return fstatus;
 }
@@ -745,17 +725,15 @@ int xcgroup_get_uint32_param(xcgroup_t* cg, char* param, uint32_t* value)
 	if (snprintf(file_path, PATH_MAX, "%s/%s", cpath, param) >= PATH_MAX) {
 		debug2("unable to build filepath for '%s' and"
 		       " parameter '%s' : %m", cpath, param);
-	}
-	else {
+	} else {
 		fstatus = _file_read_uint32s(file_path, &values, &vnb);
-		if (fstatus != XCGROUP_SUCCESS)
-			debug2("unable to get parameter '%s' for '%s'",
-			       param, cpath);
-		else if (vnb < 1) {
-			debug2("empty parameter '%s' for '%s'",
-			       param, cpath);
-		}
-		else {
+		if (fstatus != XCGROUP_SUCCESS) {
+			debug2("%s: unable to get parameter '%s' for '%s'",
+				__func__, param, cpath);
+		} else if (vnb < 1) {
+			debug2("%s: empty parameter '%s' for '%s'",
+				__func__, param, cpath);
+		} else {
 			*value = values[0];
 			xfree(values);
 			fstatus = XCGROUP_SUCCESS;
@@ -778,11 +756,11 @@ int xcgroup_set_uint64_param(xcgroup_t* cg, char* param, uint64_t value)
 
 	fstatus = _file_write_uint64s(file_path, &value, 1);
 	if (fstatus != XCGROUP_SUCCESS)
-		debug2("unable to set parameter '%s' to "
-		       "'%"PRIu64"' for '%s'", param, value, cpath);
+		debug2("%s: unable to set parameter '%s' to '%"PRIu64"' for "
+			"'%s'", __func__, param, value, cpath);
 	else
-		debug3("parameter '%s' set to '%"PRIu64"' for '%s'",
-		       param, value, cpath);
+		debug3("%s: parameter '%s' set to '%"PRIu64"' for '%s'",
+			__func__, param, value, cpath);
 
 	return fstatus;
 }
@@ -801,14 +779,13 @@ int xcgroup_get_uint64_param(xcgroup_t* cg, char* param, uint64_t* value)
 	}
 	else {
 		fstatus = _file_read_uint64s(file_path, &values, &vnb);
-		if (fstatus != XCGROUP_SUCCESS)
-			debug2("unable to get parameter '%s' for '%s'",
-			       param, cpath);
-		else if (vnb < 1) {
-			debug2("empty parameter '%s' for '%s'",
-			       param, cpath);
-		}
-		else {
+		if (fstatus != XCGROUP_SUCCESS) {
+			debug2("%s: unable to get parameter '%s' for '%s'",
+				__func__, param, cpath);
+		} else if (vnb < 1) {
+			debug2("%s: empty parameter '%s' for '%s'",
+				__func__, param, cpath);
+		} else {
 			*value = values[0];
 			xfree(values);
 			fstatus = XCGROUP_SUCCESS;
@@ -821,32 +798,36 @@ static int cgroup_move_process_by_task (xcgroup_t *cg, pid_t pid)
 {
 	DIR *dir;
 	struct dirent *entry;
-	char path [PATH_MAX];
+	char path[PATH_MAX];
 
-	if (snprintf (path, PATH_MAX, "/proc/%d/task", (int) pid) >= PATH_MAX) {
-		error ("xcgroup: move_process_by_task: path overflow!");
+	if (snprintf(path, PATH_MAX, "/proc/%d/task", (int) pid) >= PATH_MAX) {
+		error("xcgroup: move_process_by_task: path overflow!");
 		return XCGROUP_ERROR;
 	}
 
-	dir = opendir (path);
+	dir = opendir(path);
 	if (!dir) {
-		error ("xcgroup: opendir(%s): %m", path);
+		error("%s: opendir(%s): %m", __func__, path);
 		return XCGROUP_ERROR;
 	}
 
-	while ((entry = readdir (dir))) {
+	while ((entry = readdir(dir))) {
 		if (entry->d_name[0] != '.')
-			xcgroup_set_param (cg, "tasks", entry->d_name);
+			xcgroup_set_param(cg, "tasks", entry->d_name);
 	}
-	closedir (dir);
+	closedir(dir);
 	return XCGROUP_SUCCESS;
 }
 
 int xcgroup_move_process (xcgroup_t *cg, pid_t pid)
 {
-	if (!cgroup_procs_writable (cg))
+	char *path = _cgroup_procs_writable_path(cg);
+
+	if (!path)
 		return cgroup_move_process_by_task (cg, pid);
 
+	xfree(path);
+
 	return xcgroup_set_uint32_param (cg, "cgroup.procs", pid);
 }
 
@@ -878,8 +859,7 @@ size_t _file_getsize(int fd)
 		rc = read(fd, (void*)&c, 1);
 		if (rc > 0)
 			fsize++;
-	}
-	while ((rc < 0 && errno == EINTR) || rc > 0);
+	} while ((rc < 0 && errno == EINTR) || rc > 0);
 
 	/* restore position */
 	lseek(fd, offset, SEEK_SET);
@@ -902,7 +882,8 @@ int _file_write_uint64s(char* file_path, uint64_t* values, int nb)
 	/* open file for writing */
 	fd = open(file_path, O_WRONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for writing : %m", file_path);
+		debug2("%s: unable to open '%s' for writing : %m",
+			__func__, file_path);
 		return XCGROUP_ERROR;
 	}
 
@@ -925,9 +906,9 @@ int _file_write_uint64s(char* file_path, uint64_t* values, int nb)
 		}
 		while (rc < 0 && errno == EINTR);
 		if (rc < 1) {
-			debug2("unable to add value '%s' to file '%s' : %m",
-			       tstr, file_path);
-			if ( errno != ESRCH )
+			debug2("%s: unable to add value '%s' to file '%s' : %m",
+				__func__, tstr, file_path);
+			if (errno != ESRCH)
 				fstatus = XCGROUP_ERROR;
 		}
 
@@ -958,7 +939,8 @@ int _file_read_uint64s(char* file_path, uint64_t** pvalues, int* pnb)
 	/* open file for reading */
 	fd = open(file_path, O_RDONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for reading : %m", file_path);
+		debug2("%s: unable to open '%s' for reading : %m",
+			__func__, file_path);
 		return XCGROUP_ERROR;
 	}
 
@@ -973,8 +955,7 @@ int _file_read_uint64s(char* file_path, uint64_t** pvalues, int* pnb)
 	buf = (char*) xmalloc((fsize+1)*sizeof(char));
 	do {
 		rc = read(fd, buf, fsize);
-	}
-	while (rc < 0 && errno == EINTR);
+	} while (rc < 0 && errno == EINTR);
 	close(fd);
 	buf[fsize]='\0';
 
@@ -1023,7 +1004,8 @@ int _file_write_uint32s(char* file_path, uint32_t* values, int nb)
 	/* open file for writing */
 	fd = open(file_path, O_WRONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for writing : %m", file_path);
+		debug2("%s: unable to open '%s' for writing : %m",
+			__func__, file_path);
 		return XCGROUP_ERROR;
 	}
 
@@ -1046,9 +1028,9 @@ int _file_write_uint32s(char* file_path, uint32_t* values, int nb)
 		}
 		while (rc < 0 && errno == EINTR);
 		if (rc < 1) {
-			debug2("unable to add value '%s' to file '%s' : %m",
-			       tstr, file_path);
-			if ( errno != ESRCH )
+			debug2("%s: unable to add value '%s' to file '%s' : %m",
+				__func__, tstr, file_path);
+			if (errno != ESRCH)
 				fstatus = XCGROUP_ERROR;
 		}
 
@@ -1079,7 +1061,8 @@ int _file_read_uint32s(char* file_path, uint32_t** pvalues, int* pnb)
 	/* open file for reading */
 	fd = open(file_path, O_RDONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for reading : %m", file_path);
+		debug2("%s: unable to open '%s' for reading : %m",
+			__func__, file_path);
 		return XCGROUP_ERROR;
 	}
 
@@ -1094,8 +1077,7 @@ int _file_read_uint32s(char* file_path, uint32_t** pvalues, int* pnb)
 	buf = (char*) xmalloc((fsize+1)*sizeof(char));
 	do {
 		rc = read(fd, buf, fsize);
-	}
-	while (rc < 0 && errno == EINTR);
+	} while (rc < 0 && errno == EINTR);
 	close(fd);
 	buf[fsize]='\0';
 
@@ -1140,23 +1122,22 @@ int _file_write_content(char* file_path, char* content, size_t csize)
 	/* open file for writing */
 	fd = open(file_path, O_WRONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for writing : %m", file_path);
+		debug2("%s: unable to open '%s' for writing : %m",
+			__func__, file_path);
 		return XCGROUP_ERROR;
 	}
 
 	/* write content */
 	do {
 		rc = write(fd, content, csize);
-	}
-	while (rc < 0 && errno == EINTR);
+	} while (rc < 0 && errno == EINTR);
 
 	/* check read size */
 	if (rc < csize) {
-		debug2("unable to write %lu bytes to file '%s' : %m",
-		       (long unsigned int) csize, file_path);
+		debug2("%s: unable to write %lu bytes to file '%s' : %m",
+			__func__, (long unsigned int) csize, file_path);
 		fstatus = XCGROUP_ERROR;
-	}
-	else
+	} else
 		fstatus = XCGROUP_SUCCESS;
 
 	/* close file */
@@ -1183,7 +1164,8 @@ int _file_read_content(char* file_path, char** content, size_t *csize)
 	/* open file for reading */
 	fd = open(file_path, O_RDONLY, 0700);
 	if (fd < 0) {
-		debug2("unable to open '%s' for reading : %m", file_path);
+		debug2("%s: unable to open '%s' for reading : %m",
+			__func__, file_path);
 		return fstatus;
 	}
 
@@ -1199,8 +1181,7 @@ int _file_read_content(char* file_path, char** content, size_t *csize)
 	buf[fsize]='\0';
 	do {
 		rc = read(fd, buf, fsize);
-	}
-	while (rc < 0 && errno == EINTR);
+	} while (rc < 0 && errno == EINTR);
 
 	/* set output values */
 	if (rc >= 0) {
diff --git a/src/slurmd/common/xcgroup.h b/src/slurmd/common/xcgroup.h
index a37248052..3bf46a190 100644
--- a/src/slurmd/common/xcgroup.h
+++ b/src/slurmd/common/xcgroup.h
@@ -93,12 +93,8 @@ int xcgroup_ns_create(slurm_cgroup_conf_t *conf,
 
 /*
  * destroy a cgroup namespace
- *
- * returned values:
- *  - XCGROUP_ERROR
- *  - XCGROUP_SUCCESS
  */
-int xcgroup_ns_destroy(xcgroup_ns_t* cgns);
+void xcgroup_ns_destroy(xcgroup_ns_t* cgns);
 
 /*
  * mount a cgroup namespace
@@ -156,17 +152,13 @@ int xcgroup_ns_load(slurm_cgroup_conf_t *conf, xcgroup_ns_t *cgns, char *subsys)
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_create(xcgroup_ns_t* cgns,xcgroup_t* cg,
-		   char* uri,uid_t uid, gid_t gid);
+int xcgroup_create(xcgroup_ns_t* cgns, xcgroup_t* cg,
+		   char* uri, uid_t uid, gid_t gid);
 
 /*
  * destroy a cgroup internal structure
- *
- * returned values:
- *  - XCGROUP_ERROR
- *  - XCGROUP_SUCCESS
  */
-int xcgroup_destroy(xcgroup_t* cg);
+void xcgroup_destroy(xcgroup_t* cg);
 
 /*
  * lock a cgroup (must have been instanciated)
@@ -194,7 +186,7 @@ int xcgroup_unlock(xcgroup_t* cg);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_instanciate(xcgroup_t* cg);
+int xcgroup_instantiate(xcgroup_t* cg);
 
 /*
  * load a cgroup from a cgroup namespace into a structure
@@ -221,7 +213,7 @@ int xcgroup_delete(xcgroup_t* cg);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_add_pids(xcgroup_t* cg,pid_t* pids,int npids);
+int xcgroup_add_pids(xcgroup_t* cg, pid_t* pids, int npids);
 
 /*
  * extract the pids list of a cgroup
@@ -247,7 +239,7 @@ int xcgroup_get_pids(xcgroup_t* cg, pid_t **pids, int *npids);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_set_params(xcgroup_t* cg,char* parameters);
+int xcgroup_set_params(xcgroup_t* cg, char* parameters);
 
 /*
  * set a cgroup parameter
@@ -261,7 +253,7 @@ int xcgroup_set_params(xcgroup_t* cg,char* parameters);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_set_param(xcgroup_t* cg,char* parameter,char* content);
+int xcgroup_set_param(xcgroup_t* cg, char* parameter, char* content);
 
 /*
  * get a cgroup parameter
@@ -277,7 +269,8 @@ int xcgroup_set_param(xcgroup_t* cg,char* parameter,char* content);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_get_param(xcgroup_t* cg,char* param,char **content,size_t *csize);
+int xcgroup_get_param(xcgroup_t* cg, char* param, char **content,
+		      size_t *csize);
 
 /*
  * set a cgroup parameter in the form of a uint32_t
@@ -291,7 +284,7 @@ int xcgroup_get_param(xcgroup_t* cg,char* param,char **content,size_t *csize);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_set_uint32_param(xcgroup_t* cg,char* parameter,uint32_t value);
+int xcgroup_set_uint32_param(xcgroup_t* cg, char* parameter, uint32_t value);
 
 /*
  * get a cgroup parameter in the form of a uint32_t
@@ -305,7 +298,7 @@ int xcgroup_set_uint32_param(xcgroup_t* cg,char* parameter,uint32_t value);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_get_uint32_param(xcgroup_t* cg,char* param,uint32_t* value);
+int xcgroup_get_uint32_param(xcgroup_t* cg, char* param, uint32_t* value);
 
 /*
  * set a cgroup parameter in the form of a uint64_t
@@ -319,7 +312,7 @@ int xcgroup_get_uint32_param(xcgroup_t* cg,char* param,uint32_t* value);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_set_uint64_param(xcgroup_t* cg,char* parameter,uint64_t value);
+int xcgroup_set_uint64_param(xcgroup_t* cg, char* parameter, uint64_t value);
 
 /*
  * get a cgroup parameter in the form of a uint64_t
@@ -333,7 +326,7 @@ int xcgroup_set_uint64_param(xcgroup_t* cg,char* parameter,uint64_t value);
  *  - XCGROUP_ERROR
  *  - XCGROUP_SUCCESS
  */
-int xcgroup_get_uint64_param(xcgroup_t* cg,char* param,uint64_t* value);
+int xcgroup_get_uint64_param(xcgroup_t* cg, char* param, uint64_t* value);
 
 
 /*
diff --git a/src/slurmd/common/xcpuinfo.c b/src/slurmd/common/xcpuinfo.c
index ee213d3da..0789745d6 100644
--- a/src/slurmd/common/xcpuinfo.c
+++ b/src/slurmd/common/xcpuinfo.c
@@ -174,6 +174,19 @@ static void hwloc_children(hwloc_topology_t topology, hwloc_obj_t obj,
 }
 #endif
 
+/* Return the number of cores which are decentdents of the given objecdt */
+static int _core_child_count(hwloc_topology_t topology, hwloc_obj_t obj)
+{
+	int count = 0, i;
+
+	if (obj->type == HWLOC_OBJ_CORE)
+		return 1;
+
+	for (i = 0; i < obj->arity; i++)
+		count += _core_child_count(topology, obj->children[i]);
+	return count;
+}
+
 extern int
 get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
 	    uint16_t *p_sockets, uint16_t *p_cores, uint16_t *p_threads,
@@ -247,7 +260,17 @@ get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
 		actual_boards = MAX(hwloc_get_nbobjs_by_depth(topology, depth),
 				    1);
 	}
-	nobj[SOCKET] = hwloc_get_nbobjs_by_type(topology, objtype[SOCKET]);
+
+	/* Count sockets/NUMA containing any cores.
+	 * KNL NUMA with no cores are NOT counted. */
+	nobj[SOCKET] = 0;
+	depth = hwloc_get_type_depth(topology, objtype[SOCKET]);
+	for (i = 0; i < hwloc_get_nbobjs_by_depth(topology, depth); i++) {
+		obj = hwloc_get_obj_by_depth(topology, depth, i);
+		if ((obj->type == objtype[SOCKET]) &&
+		    (_core_child_count(topology, obj) > 0))
+			nobj[SOCKET]++;
+	}
 	nobj[CORE]   = hwloc_get_nbobjs_by_type(topology, objtype[CORE]);
 	/*
 	 * Workaround for hwloc
@@ -271,10 +294,19 @@ get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
 	info("CORE = %d SOCKET = %d actual_cpus = %d nobj[CORE] = %d",
 	     CORE, SOCKET, actual_cpus, nobj[CORE]);
 #endif
-	nobj[PU]     = actual_cpus/nobj[CORE];  /* threads per core */
-	nobj[CORE]  /= nobj[SOCKET];            /* cores per socket */
+	if ((actual_cpus % nobj[CORE]) != 0) {
+		error("Thread count (%d) not multiple of core count (%d)",
+		      actual_cpus, nobj[CORE]);
+	}
+	nobj[PU] = actual_cpus / nobj[CORE];	/* threads per core */
+
+	if ((nobj[CORE] % nobj[SOCKET]) != 0) {
+		error("Core count (%d) not multiple of socket count (%d)",
+		      nobj[CORE], nobj[SOCKET]);
+	}
+	nobj[CORE] /= nobj[SOCKET];		/* cores per socket */
 
-	debug("CPUs:%d Boards:%u Sockets:%d CoresPerSocket:%d ThreadsPerCore:%d",
+	debug("CPUs:%d Boards:%d Sockets:%d CoresPerSocket:%d ThreadsPerCore:%d",
 	      actual_cpus, actual_boards, nobj[SOCKET], nobj[CORE], nobj[PU]);
 
 	/* allocate block_map */
@@ -436,7 +468,7 @@ get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
 #if defined (__sun)
 	ksp = kstat_lookup(kc, "cpu_info", -1, NULL);
 	for (; ksp != NULL; ksp = ksp->ks_next) {
-		if (strcmp(ksp->ks_module, "cpu_info"))
+		if (xstrcmp(ksp->ks_module, "cpu_info"))
 			continue;
 
 		numcpu++;
@@ -678,7 +710,7 @@ get_cpuinfo(uint16_t *p_cpus, uint16_t *p_boards,
 static int _chk_cpuinfo_str(char *buffer, char *keyword, char **valptr)
 {
 	char *ptr;
-	if (strncmp(buffer, keyword, strlen(keyword)))
+	if (xstrncmp(buffer, keyword, strlen(keyword)))
 		return false;
 
 	ptr = strstr(buffer, ":");
diff --git a/src/slurmd/slurmd/Makefile.am b/src/slurmd/slurmd/Makefile.am
index 8e82a16f6..0e73c0b03 100644
--- a/src/slurmd/slurmd/Makefile.am
+++ b/src/slurmd/slurmd/Makefile.am
@@ -10,10 +10,19 @@ AM_CPPFLAGS = -DLIBSLURM_SO=\"$(libdir)/libslurm.so\" \
 
 slurmd_LDADD = 					   \
 	$(top_builddir)/src/common/libdaemonize.la \
-	../common/libslurmd_common.o $(HWLOC_LDFLAGS) $(HWLOC_LIBS) \
-	$(top_builddir)/src/api/libslurm.o $(DL_LIBS)	   \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
+	../common/libslurmd_common.o $(HWLOC_LIBS) \
+	$(top_builddir)/src/api/libslurm.o $(DL_LIBS)  \
 	../common/libslurmd_reverse_tree_math.la
 
+slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(HWLOC_LDFLAGS)
+
+if HAVE_AIX
+# We need to set maxdata back to 0 because this effects the "max memory size"
+# ulimit, and the ulimit is inherited by child processes.
+slurmd_LDFLAGS += -Wl,-bmaxdata:0x0
+endif
+
 SLURMD_SOURCES = \
 	slurmd.c slurmd.h \
 	req.c req.h \
@@ -23,14 +32,6 @@ SLURMD_SOURCES = \
 
 slurmd_SOURCES = $(SLURMD_SOURCES)
 
-if HAVE_AIX
-# We need to set maxdata back to 0 because this effects the "max memory size"
-# ulimit, and the ulimit is inherited by child processes.
-slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0
-else
-slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
-endif
-
 force:
 $(slurmd_LDADD) : force
 	@cd `dirname $@` && $(MAKE) `basename $@`
diff --git a/src/slurmd/slurmd/Makefile.in b/src/slurmd/slurmd/Makefile.in
index 9ef77d4bc..3a56f9559 100644
--- a/src/slurmd/slurmd/Makefile.in
+++ b/src/slurmd/slurmd/Makefile.in
@@ -93,9 +93,14 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 sbin_PROGRAMS = slurmd$(EXEEXT)
+
+# We need to set maxdata back to 0 because this effects the "max memory size"
+# ulimit, and the ulimit is inherited by child processes.
+@HAVE_AIX_TRUE@am__append_1 = -Wl,-bmaxdata:0x0
 subdir = src/slurmd/slurmd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +113,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +133,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +142,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -153,9 +158,10 @@ am_slurmd_OBJECTS = $(am__objects_1)
 slurmd_OBJECTS = $(am_slurmd_OBJECTS)
 am__DEPENDENCIES_1 =
 slurmd_DEPENDENCIES = $(top_builddir)/src/common/libdaemonize.la \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
 	../common/libslurmd_common.o $(am__DEPENDENCIES_1) \
-	$(am__DEPENDENCIES_1) $(top_builddir)/src/api/libslurm.o \
-	$(am__DEPENDENCIES_1) ../common/libslurmd_reverse_tree_math.la
+	$(top_builddir)/src/api/libslurm.o $(am__DEPENDENCIES_1) \
+	../common/libslurmd_reverse_tree_math.la
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -229,8 +235,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +334,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +376,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +422,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +475,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -479,10 +494,13 @@ AM_CPPFLAGS = -DLIBSLURM_SO=\"$(libdir)/libslurm.so\" \
 
 slurmd_LDADD = \
 	$(top_builddir)/src/common/libdaemonize.la \
-	../common/libslurmd_common.o $(HWLOC_LDFLAGS) $(HWLOC_LIBS) \
-	$(top_builddir)/src/api/libslurm.o $(DL_LIBS)	   \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
+	../common/libslurmd_common.o $(HWLOC_LIBS) \
+	$(top_builddir)/src/api/libslurm.o $(DL_LIBS)  \
 	../common/libslurmd_reverse_tree_math.la
 
+slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) $(HWLOC_LDFLAGS) \
+	$(am__append_1)
 SLURMD_SOURCES = \
 	slurmd.c slurmd.h \
 	req.c req.h \
@@ -491,11 +509,6 @@ SLURMD_SOURCES = \
 	slurmd_plugstack.c slurmd_plugstack.h
 
 slurmd_SOURCES = $(SLURMD_SOURCES)
-@HAVE_AIX_FALSE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
-
-# We need to set maxdata back to 0 because this effects the "max memory size"
-# ulimit, and the ulimit is inherited by child processes.
-@HAVE_AIX_TRUE@slurmd_LDFLAGS = -export-dynamic $(CMD_LDFLAGS) -Wl,-bmaxdata:0x0
 all: all-am
 
 .SUFFIXES:
diff --git a/src/slurmd/slurmd/get_mach_stat.c b/src/slurmd/slurmd/get_mach_stat.c
index 78fe80328..d76915ff4 100644
--- a/src/slurmd/slurmd/get_mach_stat.c
+++ b/src/slurmd/slurmd/get_mach_stat.c
@@ -105,6 +105,7 @@
 #include "src/common/read_config.h"
 #include "src/slurmctld/slurmctld.h"
 #include "src/slurmd/slurmd/get_mach_stat.h"
+#include "src/slurmd/slurmd/slurmd.h"
 
 /* #define DEBUG_DETAIL	1 */	/* enable detailed debugging within SLURM */
 
@@ -308,17 +309,17 @@ extern int get_up_time(uint32_t *up_time)
 		*up_time = 0;
 		return errno;
 	}
-#if defined(_TEST_REBOOT)
-{
-	/* Make node look like it rebooted when slurmd started, for testing */
-	static uint32_t orig_uptime = 0;
-	if (orig_uptime == 0)
-		orig_uptime = info.uptime;
-	*up_time = info.uptime - orig_uptime;
-}
-#else
-	*up_time = info.uptime;
-#endif
+
+
+	if (conf->boot_time) {
+		/* Make node look like it rebooted when slurmd started */
+		static uint32_t orig_uptime = 0;
+		if (orig_uptime == 0)
+			orig_uptime = info.uptime;
+		*up_time = info.uptime - orig_uptime;
+	} else {
+		*up_time = info.uptime;
+	}
 #endif
 	return 0;
 }
@@ -392,7 +393,7 @@ extern int get_free_mem(uint32_t *free_mem)
 static int _chk_cpuinfo_str(char *buffer, char *keyword, char **valptr)
 {
 	char *ptr;
-	if (strncmp(buffer, keyword, strlen(keyword)))
+	if (xstrncmp(buffer, keyword, strlen(keyword)))
 		return false;
 
 	ptr = strstr(buffer, ":");
diff --git a/src/slurmd/slurmd/req.c b/src/slurmd/slurmd/req.c
index ef9a420eb..e9d948580 100644
--- a/src/slurmd/slurmd/req.c
+++ b/src/slurmd/slurmd/req.c
@@ -3,7 +3,7 @@
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2013 SchedMD LLC.
+ *  Portions Copyright (C) 2010-2016 SchedMD LLC.
  *  Portions copyright (C) 2015 Mellanox Technologies Inc.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Mark Grondona <mgrondona@llnl.gov>.
@@ -49,6 +49,7 @@
 #include <signal.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #include <sys/param.h>
 #include <poll.h>
 #include <sys/stat.h>
@@ -72,6 +73,7 @@
 #include "src/common/node_select.h"
 #include "src/common/plugstack.h"
 #include "src/common/read_config.h"
+#include "src/common/siphash.h"
 #include "src/common/slurm_auth.h"
 #include "src/common/slurm_cred.h"
 #include "src/common/slurm_acct_gather_energy.h"
@@ -86,6 +88,8 @@
 #include "src/common/xstring.h"
 #include "src/common/xmalloc.h"
 
+#include "src/bcast/file_bcast.h"
+
 #include "src/slurmd/slurmd/get_mach_stat.h"
 #include "src/slurmd/slurmd/slurmd.h"
 
@@ -185,6 +189,9 @@ static void _rpc_reconfig(slurm_msg_t *msg);
 static void _rpc_reboot(slurm_msg_t *msg);
 static void _rpc_pid2jid(slurm_msg_t *msg);
 static int  _rpc_file_bcast(slurm_msg_t *msg);
+static void _file_bcast_cleanup(void);
+static int  _file_bcast_register_file(slurm_msg_t *msg,
+				      file_bcast_info_t *key);
 static int  _rpc_ping(slurm_msg_t *);
 static int  _rpc_health_check(slurm_msg_t *);
 static int  _rpc_acct_gather_update(slurm_msg_t *);
@@ -198,6 +205,7 @@ static int  _run_epilog(job_env_t *job_env);
 static int  _run_prolog(job_env_t *job_env, slurm_cred_t *cred);
 static void _rpc_forward_data(slurm_msg_t *msg);
 static int  _rpc_network_callerid(slurm_msg_t *msg);
+static void _dealloc_gids(gids_t *p);
 
 
 static bool _pause_for_job_completion(uint32_t jobid, char *nodes,
@@ -225,6 +233,7 @@ static void _add_job_running_prolog(uint32_t job_id);
 static void _remove_job_running_prolog(uint32_t job_id);
 static int  _match_jobid(void *s0, void *s1);
 static void _wait_for_job_running_prolog(uint32_t job_id);
+static bool _requeue_setup_env_fail(void);
 
 /*
  *  List of threads waiting for jobs to complete
@@ -261,6 +270,11 @@ static uint32_t active_job_id[JOB_STATE_CNT];
 
 static pthread_mutex_t prolog_mutex = PTHREAD_MUTEX_INITIALIZER;
 
+#define FILE_BCAST_TIMEOUT 300
+static pthread_mutex_t file_bcast_mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_cond_t  file_bcast_cond  = PTHREAD_COND_INITIALIZER;
+static int fb_read_lock = 0, fb_write_wait_lock = 0, fb_write_lock = 0;
+static List file_bcast_list = NULL;
 
 void
 slurmd_req(slurm_msg_t *msg)
@@ -280,12 +294,11 @@ slurmd_req(slurm_msg_t *msg)
 		return;
 	}
 
-	switch(msg->msg_type) {
+	switch (msg->msg_type) {
 	case REQUEST_LAUNCH_PROLOG:
 		debug2("Processing RPC: REQUEST_LAUNCH_PROLOG");
 		_rpc_prolog(msg);
 		last_slurmctld_msg = time(NULL);
-		slurm_free_prolog_launch_msg(msg->data);
 		break;
 	case REQUEST_BATCH_JOB_LAUNCH:
 		debug2("Processing RPC: REQUEST_BATCH_JOB_LAUNCH");
@@ -294,103 +307,85 @@ slurmd_req(slurm_msg_t *msg)
 		 * jobs are supported on Blue Gene (no job steps). */
 		_rpc_batch_job(msg, true);
 		last_slurmctld_msg = time(NULL);
-		slurm_free_job_launch_msg(msg->data);
 		break;
 	case REQUEST_LAUNCH_TASKS:
 		debug2("Processing RPC: REQUEST_LAUNCH_TASKS");
 		slurm_mutex_lock(&launch_mutex);
 		_rpc_launch_tasks(msg);
-		slurm_free_launch_tasks_request_msg(msg->data);
 		slurm_mutex_unlock(&launch_mutex);
 		break;
 	case REQUEST_SIGNAL_TASKS:
 		debug2("Processing RPC: REQUEST_SIGNAL_TASKS");
 		_rpc_signal_tasks(msg);
-		slurm_free_kill_tasks_msg(msg->data);
 		break;
 	case REQUEST_CHECKPOINT_TASKS:
 		debug2("Processing RPC: REQUEST_CHECKPOINT_TASKS");
 		_rpc_checkpoint_tasks(msg);
-		slurm_free_checkpoint_tasks_msg(msg->data);
 		break;
 	case REQUEST_TERMINATE_TASKS:
 		debug2("Processing RPC: REQUEST_TERMINATE_TASKS");
 		_rpc_terminate_tasks(msg);
-		slurm_free_kill_tasks_msg(msg->data);
 		break;
 	case REQUEST_KILL_PREEMPTED:
 		debug2("Processing RPC: REQUEST_KILL_PREEMPTED");
 		last_slurmctld_msg = time(NULL);
 		_rpc_timelimit(msg);
-		slurm_free_timelimit_msg(msg->data);
 		break;
 	case REQUEST_KILL_TIMELIMIT:
 		debug2("Processing RPC: REQUEST_KILL_TIMELIMIT");
 		last_slurmctld_msg = time(NULL);
 		_rpc_timelimit(msg);
-		slurm_free_timelimit_msg(msg->data);
 		break;
 	case REQUEST_REATTACH_TASKS:
 		debug2("Processing RPC: REQUEST_REATTACH_TASKS");
 		_rpc_reattach_tasks(msg);
-		slurm_free_reattach_tasks_request_msg(msg->data);
 		break;
 	case REQUEST_SIGNAL_JOB:
 		debug2("Processing RPC: REQUEST_SIGNAL_JOB");
 		_rpc_signal_job(msg);
-		slurm_free_signal_job_msg(msg->data);
 		break;
 	case REQUEST_SUSPEND_INT:
 		debug2("Processing RPC: REQUEST_SUSPEND_INT");
 		_rpc_suspend_job(msg);
 		last_slurmctld_msg = time(NULL);
-		slurm_free_suspend_int_msg(msg->data);
 		break;
 	case REQUEST_ABORT_JOB:
 		debug2("Processing RPC: REQUEST_ABORT_JOB");
 		last_slurmctld_msg = time(NULL);
 		_rpc_abort_job(msg);
-		slurm_free_kill_job_msg(msg->data);
 		break;
 	case REQUEST_TERMINATE_JOB:
 		debug2("Processing RPC: REQUEST_TERMINATE_JOB");
 		last_slurmctld_msg = time(NULL);
 		_rpc_terminate_job(msg);
-		slurm_free_kill_job_msg(msg->data);
 		break;
 	case REQUEST_COMPLETE_BATCH_SCRIPT:
 		debug2("Processing RPC: REQUEST_COMPLETE_BATCH_SCRIPT");
 		_rpc_complete_batch(msg);
-		slurm_free_complete_batch_script_msg(msg->data);
 		break;
 	case REQUEST_UPDATE_JOB_TIME:
 		debug2("Processing RPC: REQUEST_UPDATE_JOB_TIME");
 		_rpc_update_time(msg);
 		last_slurmctld_msg = time(NULL);
-		slurm_free_update_job_time_msg(msg->data);
 		break;
 	case REQUEST_SHUTDOWN:
 		debug2("Processing RPC: REQUEST_SHUTDOWN");
 		_rpc_shutdown(msg);
-		slurm_free_shutdown_msg(msg->data);
 		break;
 	case REQUEST_RECONFIGURE:
 		debug2("Processing RPC: REQUEST_RECONFIGURE");
 		_rpc_reconfig(msg);
 		last_slurmctld_msg = time(NULL);
-		/* No body to free */
 		break;
 	case REQUEST_REBOOT_NODES:
 		debug2("Processing RPC: REQUEST_REBOOT_NODES");
 		_rpc_reboot(msg);
-		slurm_free_reboot_msg(msg->data);
 		break;
 	case REQUEST_NODE_REGISTRATION_STATUS:
 		debug2("Processing RPC: REQUEST_NODE_REGISTRATION_STATUS");
 		/* Treat as ping (for slurmctld agent, just return SUCCESS) */
 		rc = _rpc_ping(msg);
 		last_slurmctld_msg = time(NULL);
-		/* No body to free */
 		/* Then initiate a separate node registration */
 		if (rc == SLURM_SUCCESS)
 			send_registration_msg(SLURM_SUCCESS, true);
@@ -398,66 +393,52 @@ slurmd_req(slurm_msg_t *msg)
 	case REQUEST_PING:
 		_rpc_ping(msg);
 		last_slurmctld_msg = time(NULL);
-		/* No body to free */
 		break;
 	case REQUEST_HEALTH_CHECK:
 		debug2("Processing RPC: REQUEST_HEALTH_CHECK");
 		_rpc_health_check(msg);
 		last_slurmctld_msg = time(NULL);
-		/* No body to free */
 		break;
 	case REQUEST_ACCT_GATHER_UPDATE:
 		debug2("Processing RPC: REQUEST_ACCT_GATHER_UPDATE");
 		_rpc_acct_gather_update(msg);
 		last_slurmctld_msg = time(NULL);
-		/* No body to free */
 		break;
 	case REQUEST_ACCT_GATHER_ENERGY:
 		debug2("Processing RPC: REQUEST_ACCT_GATHER_ENERGY");
 		_rpc_acct_gather_energy(msg);
-		slurm_free_acct_gather_energy_req_msg(msg->data);
 		break;
 	case REQUEST_JOB_ID:
 		_rpc_pid2jid(msg);
-		slurm_free_job_id_request_msg(msg->data);
 		break;
 	case REQUEST_FILE_BCAST:
 		rc = _rpc_file_bcast(msg);
 		slurm_send_rc_msg(msg, rc);
-		slurm_free_file_bcast_msg(msg->data);
 		break;
 	case REQUEST_STEP_COMPLETE:
 		(void) _rpc_step_complete(msg);
-		slurm_free_step_complete_msg(msg->data);
 		break;
 	case REQUEST_STEP_COMPLETE_AGGR:
 		(void) _rpc_step_complete_aggr(msg);
-		slurm_free_step_complete_msg(msg->data);
 		break;
 	case REQUEST_JOB_STEP_STAT:
 		(void) _rpc_stat_jobacct(msg);
-		slurm_free_job_step_id_msg(msg->data);
 		break;
 	case REQUEST_JOB_STEP_PIDS:
 		(void) _rpc_list_pids(msg);
-		slurm_free_job_step_id_msg(msg->data);
 		break;
 	case REQUEST_DAEMON_STATUS:
 		_rpc_daemon_status(msg);
-		/* No body to free */
 		break;
 	case REQUEST_JOB_NOTIFY:
 		_rpc_job_notify(msg);
-		slurm_free_job_notify_msg(msg->data);
 		break;
 	case REQUEST_FORWARD_DATA:
 		_rpc_forward_data(msg);
-		slurm_free_forward_data_msg(msg->data);
 		break;
 	case REQUEST_NETWORK_CALLERID:
 		debug2("Processing RPC: REQUEST_NETWORK_CALLERID");
 		_rpc_network_callerid(msg);
-		slurm_free_network_callerid_msg(msg->data);
 		break;
 	case MESSAGE_COMPOSITE:
 		error("Processing RPC: MESSAGE_COMPOSITE: "
@@ -467,9 +448,7 @@ slurmd_req(slurm_msg_t *msg)
 	case RESPONSE_MESSAGE_COMPOSITE:
 		debug2("Processing RPC: RESPONSE_MESSAGE_COMPOSITE");
 		msg_aggr_resp(msg);
-		slurm_free_composite_msg(msg->data);
 		break;
-	case REQUEST_SUSPEND:	/* Defunct, see REQUEST_SUSPEND_INT */
 	default:
 		error("slurmd_req: invalid request msg type %d",
 		      msg->msg_type);
@@ -532,8 +511,10 @@ _send_slurmstepd_init(int fd, int type, void *req,
 			if (launch_req->job_step_id != SLURM_EXTERN_CONT)
 				send_error = true;
 		}
-		if (send_error)
-			info("task rank unavailable due to invalid job credential, step completion RPC impossible");
+		if (send_error) {
+			info("task rank unavailable due to invalid job "
+			     "credential, step completion RPC impossible");
+		}
 		rank = -1;
 		parent_rank = -1;
 		children = 0;
@@ -719,6 +700,7 @@ _send_slurmstepd_init(int fd, int type, void *req,
 			tmp32 = (uint32_t)gids->gids[i];
 			safe_write(fd, &tmp32, sizeof(uint32_t));
 		}
+		_dealloc_gids(gids);
 	} else {
 		len = 0;
 		safe_write(fd, &len, sizeof(int));
@@ -809,6 +791,7 @@ _forkexec_slurmstepd(uint16_t type, void *req,
 			rc = SLURM_FAILURE;
 		} else {
 			int delta_time = time(NULL) - start_time;
+			int cc;
 			if (delta_time > 5) {
 				info("Warning: slurmstepd startup took %d sec, "
 				     "possible file system problem or full "
@@ -816,6 +799,13 @@ _forkexec_slurmstepd(uint16_t type, void *req,
 			}
 			if (rc != SLURM_SUCCESS)
 				error("slurmstepd return code %d", rc);
+
+			cc = SLURM_SUCCESS;
+			cc = write(to_stepd[1], &cc, sizeof(int));
+			if (cc != sizeof(int)) {
+				error("%s: failed to send ack to stepd %d: %m",
+				      __func__, cc);
+			}
 		}
 #endif
 	done:
@@ -1378,42 +1368,54 @@ rwfail:
 
 /* load the user's environment on this machine if requested
  * SLURM_GET_USER_ENV environment variable is set */
-static void
+static int
 _get_user_env(batch_job_launch_msg_t *req)
 {
 	struct passwd pwd, *pwd_ptr = NULL;
 	char pwd_buf[PW_BUF_SIZE];
 	char **new_env;
 	int i;
+	static time_t config_update = 0;
+	static bool no_env_cache = false;
+
+	if (config_update != conf->last_update) {
+		char *sched_params = slurm_get_sched_params();
+		no_env_cache = (sched_params &&
+				strstr(sched_params, "no_env_cache"));
+		xfree(sched_params);
+		config_update = conf->last_update;
+	}
 
 	for (i=0; i<req->envc; i++) {
-		if (strcmp(req->environment[i], "SLURM_GET_USER_ENV=1") == 0)
+		if (xstrcmp(req->environment[i], "SLURM_GET_USER_ENV=1") == 0)
 			break;
 	}
 	if (i >= req->envc)
-		return;		/* don't need to load env */
+		return 0;		/* don't need to load env */
 
 	if (slurm_getpwuid_r(req->uid, &pwd, pwd_buf, PW_BUF_SIZE, &pwd_ptr)
 	    || (pwd_ptr == NULL)) {
 		error("%s: getpwuid_r(%u):%m", __func__, req->uid);
-	} else {
-		verbose("get env for user %s here", pwd.pw_name);
-		/* Permit up to 120 second delay before using cache file */
-		new_env = env_array_user_default(pwd.pw_name, 120, 0);
-		if (new_env) {
-			env_array_merge(&new_env,
-					(const char **) req->environment);
-			env_array_free(req->environment);
-			req->environment = new_env;
-			req->envc = envcount(new_env);
-		} else {
-			/* One option is to kill the job, but it's
-			 * probably better to try running with what
-			 * we have. */
-			error("Unable to get user's local environment, "
-			      "running only with passed environment");
-		}
+		return -1;
 	}
+	verbose("%s: get env for user %s here", __func__, pwd.pw_name);
+
+	/* Permit up to 120 second delay before using cache file */
+	new_env = env_array_user_default(pwd.pw_name, 120, 0, no_env_cache);
+	if (! new_env) {
+		error("%s: Unable to get user's local environment%s",
+		      __func__, no_env_cache ?
+		      "" : ", running only with passed environment");
+		return -1;
+	}
+
+	env_array_merge(&new_env,
+			(const char **) req->environment);
+	env_array_free(req->environment);
+	req->environment = new_env;
+	req->envc = envcount(new_env);
+
+	return 0;
 }
 
 /* The RPC currently contains a memory size limit, but we load the
@@ -1764,6 +1766,7 @@ static void _rpc_prolog(slurm_msg_t *msg)
 		job_env.spank_job_env = req->spank_job_env;
 		job_env.spank_job_env_size = req->spank_job_env_size;
 		job_env.uid = req->uid;
+		job_env.user_name = req->user_name;
 #if defined(HAVE_BG)
 		select_g_select_jobinfo_get(req->select_jobinfo,
 					    SELECT_JOBDATA_BLOCK_ID,
@@ -1911,7 +1914,13 @@ _rpc_batch_job(slurm_msg_t *msg, bool new_msg)
 		_wait_for_job_running_prolog(req->job_id);
 	}
 
-	_get_user_env(req);
+	if (_get_user_env(req) < 0) {
+		bool requeue = _requeue_setup_env_fail();
+		if (requeue) {
+			rc = ESLURMD_SETUP_ENVIRONMENT_ERROR;
+			goto done;
+		}
+	}
 	_set_batch_job_limits(msg);
 
 	/* Since job could have been killed while the prolog was
@@ -1992,10 +2001,13 @@ done:
 	 *  If job prolog failed or we could not reply,
 	 *  initiate message to slurmctld with current state
 	 */
-	if ((rc == ESLURMD_PROLOG_FAILED) ||
-	    (rc == SLURM_COMMUNICATIONS_SEND_ERROR))
+	if ((rc == ESLURMD_PROLOG_FAILED)
+	    || (rc == SLURM_COMMUNICATIONS_SEND_ERROR)
+	    || (rc == ESLURMD_SETUP_ENVIRONMENT_ERROR)) {
 		send_registration_msg(rc, false);
+	}
 }
+
 /*
  * Send notification message to batch job
  */
@@ -2179,7 +2191,8 @@ _rpc_shutdown(slurm_msg_t *msg)
 static void
 _rpc_reboot(slurm_msg_t *msg)
 {
-	char *reboot_program, *sp;
+	char *reboot_program, *cmd = NULL, *sp;
+	reboot_msg_t *reboot_msg;
 	slurm_ctl_conf_t *cfg;
 	uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred,
 					     slurm_get_auth_info());
@@ -2197,13 +2210,20 @@ _rpc_reboot(slurm_msg_t *msg)
 				sp = xstrndup(reboot_program,
 					      (sp - reboot_program));
 			else
-			    sp = xstrdup(reboot_program);
+				sp = xstrdup(reboot_program);
+			reboot_msg = (reboot_msg_t *) msg->data;
+			if (reboot_msg && reboot_msg->features) {
+				xstrfmtcat(cmd, "%s %s",
+					   sp, reboot_msg->features);
+			} else
+				cmd = xstrdup(sp);
 			if (access(sp, R_OK | X_OK) < 0)
 				error("Cannot run RebootProgram [%s]: %m", sp);
-			else if ((exit_code = system(reboot_program)))
+			else if ((exit_code = system(cmd)))
 				error("system(%s) returned %d", reboot_program,
 				      exit_code);
 			xfree(sp);
+			xfree(cmd);
 		} else
 			error("RebootProgram isn't defined in config");
 		slurm_conf_unlock();
@@ -2528,6 +2548,8 @@ _rpc_ping(slurm_msg_t *msg)
 
 	/* Take this opportunity to enforce any job memory limits */
 	_enforce_job_mem_limit();
+	/* Clear up any stalled file transfers as well */
+	_file_bcast_cleanup();
 	return rc;
 }
 
@@ -2556,14 +2578,13 @@ _rpc_health_check(slurm_msg_t *msg)
 		send_registration_msg(SLURM_SUCCESS, false);
 	}
 
-	if ((rc == SLURM_SUCCESS) && (conf->health_check_program)) {
-		char *env[1] = { NULL };
-		rc = run_script("health_check", conf->health_check_program,
-				0, 60, env, 0);
-	}
+	if (rc == SLURM_SUCCESS)
+		rc = run_script_health_check();
 
 	/* Take this opportunity to enforce any job memory limits */
 	_enforce_job_mem_limit();
+	/* Clear up any stalled file transfers as well */
+	_file_bcast_cleanup();
 	return rc;
 }
 
@@ -3472,19 +3493,135 @@ _valid_sbcast_cred(file_bcast_msg_t *req, uid_t req_uid, uint16_t block_no,
 	return rc;
 }
 
-static int
-_rpc_file_bcast(slurm_msg_t *msg)
+static void _fb_rdlock(void)
+{
+	slurm_mutex_lock(&file_bcast_mutex);
+	while (1) {
+		if ((fb_write_wait_lock == 0) && (fb_write_lock == 0)) {
+			fb_read_lock++;
+			break;
+		} else {	/* wait for state change and retry */
+			pthread_cond_wait(&file_bcast_cond, &file_bcast_mutex);
+		}
+	}
+	slurm_mutex_unlock(&file_bcast_mutex);
+}
+
+static void _fb_rdunlock(void)
+{
+	slurm_mutex_lock(&file_bcast_mutex);
+	fb_read_lock--;
+	pthread_cond_broadcast(&file_bcast_cond);
+	slurm_mutex_unlock(&file_bcast_mutex);
+}
+
+static void _fb_wrlock(void)
+{
+	slurm_mutex_lock(&file_bcast_mutex);
+	fb_write_wait_lock++;
+	while (1) {
+		if ((fb_read_lock == 0) && (fb_write_lock == 0)) {
+			fb_write_lock++;
+			fb_write_wait_lock--;
+			break;
+		} else {	/* wait for state change and retry */
+			pthread_cond_wait(&file_bcast_cond, &file_bcast_mutex);
+		}
+	}
+	slurm_mutex_unlock(&file_bcast_mutex);
+}
+
+static void _fb_wrunlock(void)
+{
+	slurm_mutex_lock(&file_bcast_mutex);
+	fb_write_lock--;
+	pthread_cond_broadcast(&file_bcast_cond);
+	slurm_mutex_unlock(&file_bcast_mutex);
+}
+
+static int _bcast_find_in_list(void *x, void *y)
+{
+	file_bcast_info_t *info = (file_bcast_info_t *)x;
+	file_bcast_info_t *key = (file_bcast_info_t *)y;
+	/* uid, job_id, and fname must match */
+	return ((info->uid == key->uid)
+		&& (info->job_id == key->job_id)
+		&& (!xstrcmp(info->fname, key->fname)));
+}
+
+/* must have read lock */
+static file_bcast_info_t *_bcast_lookup_file(file_bcast_info_t *key)
+{
+	return list_find_first(file_bcast_list, _bcast_find_in_list, key);
+}
+
+/* must not have read lock, will get write lock */
+static void _file_bcast_close_file(file_bcast_info_t *key)
+{
+	_fb_wrlock();
+	list_delete_all(file_bcast_list, _bcast_find_in_list, key);
+	_fb_wrunlock();
+}
+
+static void _free_file_bcast_info_t(file_bcast_info_t *f)
+{
+	xfree(f->fname);
+	if (f->fd)
+		close(f->fd);
+	xfree(f);
+}
+
+static int _bcast_find_in_list_to_remove(void *x, void *y)
+{
+	file_bcast_info_t *f = (file_bcast_info_t *)x;
+	time_t *now = (time_t *) y;
+
+	if (f->last_update + FILE_BCAST_TIMEOUT < *now) {
+		error("Removing stalled file_bcast transfer from uid "
+		      "%u to file `%s`", f->uid, f->fname);
+		return true;
+	}
+
+	return false;
+}
+
+/* remove transfers that have stalled */
+static void _file_bcast_cleanup(void)
+{
+	time_t now = time(NULL);
+
+	_fb_wrlock();
+	list_delete_all(file_bcast_list, _bcast_find_in_list_to_remove, &now);
+	_fb_wrunlock();
+}
+
+void file_bcast_init(void)
 {
+	/* skip locks during slurmd init */
+	file_bcast_list = list_create((ListDelF) _free_file_bcast_info_t);
+}
+
+void file_bcast_purge(void)
+{
+	_fb_wrlock();
+	list_destroy(file_bcast_list);
+	/* destroying list before exit, no need to unlock */
+}
+
+static int _rpc_file_bcast(slurm_msg_t *msg)
+{
+	int rc, offset, inx;
+	file_bcast_info_t *file_info;
 	file_bcast_msg_t *req = msg->data;
-	int fd, flags, offset, inx, rc;
-	int ngroups = 16;
-	gid_t *groups;
-	uid_t req_uid = g_slurm_auth_get_uid(msg->auth_cred,
-					     slurm_get_auth_info());
-	gid_t req_gid = g_slurm_auth_get_gid(msg->auth_cred,
-					     slurm_get_auth_info());
-	pid_t child;
-	uint32_t job_id;
+	file_bcast_info_t key;
+
+	key.uid = g_slurm_auth_get_uid(msg->auth_cred, slurm_get_auth_info());
+	key.gid = g_slurm_auth_get_gid(msg->auth_cred, slurm_get_auth_info());
+	key.fname = req->fname;
+
+	rc = _valid_sbcast_cred(req, key.uid, req->block_no, &key.job_id);
+	if ((rc != SLURM_SUCCESS) && !_slurm_authorized_user(key.uid))
+		return rc;
 
 #if 0
 	info("last_block=%u force=%u modes=%o",
@@ -3499,47 +3636,201 @@ _rpc_file_bcast(slurm_msg_t *msg)
 #endif
 #endif
 
-	rc = _valid_sbcast_cred(req, req_uid, req->block_no, &job_id);
-	if ((rc != SLURM_SUCCESS) && !_slurm_authorized_user(req_uid))
-		return rc;
-
 	if (req->block_no == 1) {
 		info("sbcast req_uid=%u job_id=%u fname=%s block_no=%u",
-		     req_uid, job_id, req->fname, req->block_no);
+		     key.uid, key.job_id, key.fname, req->block_no);
 	} else {
 		debug("sbcast req_uid=%u job_id=%u fname=%s block_no=%u",
-		      req_uid, job_id, req->fname, req->block_no);
+		      key.uid, key.job_id, key.fname, req->block_no);
+	}
+
+	/* first block must register the file and open fd/mmap */
+	if (req->block_no == 1) {
+		if ((rc = _file_bcast_register_file(msg, &key)))
+			return rc;
+	}
+
+	_fb_rdlock();
+	if (!(file_info = _bcast_lookup_file(&key))) {
+		error("No registered file transfer for uid %u file `%s`.",
+		      key.uid, key.fname);
+		_fb_rdunlock();
+		return SLURM_ERROR;
+	}
+
+	/* now decompress file */
+	if (bcast_decompress_data(req) < 0) {
+		error("sbcast: data decompression error for UID %u, file %s",
+		      key.uid, key.fname);
+		_fb_rdunlock();
+		return SLURM_FAILURE;
+	}
+
+	offset = 0;
+	while (req->block_len - offset) {
+		inx = write(file_info->fd, &req->block[offset],
+			    (req->block_len - offset));
+		if (inx == -1) {
+			if ((errno == EINTR) || (errno == EAGAIN))
+				continue;
+			error("sbcast: uid:%u can't write `%s`: %m",
+			      key.uid, key.fname);
+			_fb_rdunlock();
+			return SLURM_FAILURE;
+		}
+		offset += inx;
+	}
+
+	file_info->last_update = time(NULL);
+
+	if (req->last_block && fchmod(file_info->fd, (req->modes & 0777))) {
+		error("sbcast: uid:%u can't chmod `%s`: %m",
+		      key.uid, key.fname);
+	}
+	if (req->last_block && fchown(file_info->fd, key.uid, key.gid)) {
+		error("sbcast: uid:%u gid:%u can't chown `%s`: %m",
+		      key.uid, key.gid, key.fname);
+	}
+	if (req->last_block && req->atime) {
+		struct utimbuf time_buf;
+		time_buf.actime  = req->atime;
+		time_buf.modtime = req->mtime;
+		if (utime(key.fname, &time_buf)) {
+			error("sbcast: uid:%u can't utime `%s`: %m",
+			      key.uid, key.fname);
+		}
+	}
+
+	_fb_rdunlock();
+
+	if (req->last_block) {
+		_file_bcast_close_file(&key);
 	}
+	return SLURM_SUCCESS;
+}
+
+/* pass an open file descriptor back to the parent process */
+static void _send_back_fd(int socket, int fd)
+{
+	struct msghdr msg = { 0 };
+	struct cmsghdr *cmsg;
+	char buf[CMSG_SPACE(sizeof(fd))];
+	memset(buf, '\0', sizeof(buf));
+
+	msg.msg_iov = NULL;
+	msg.msg_iovlen = 0;
+	msg.msg_control = buf;
+	msg.msg_controllen = sizeof(buf);
+
+	cmsg = CMSG_FIRSTHDR(&msg);
+	cmsg->cmsg_level = SOL_SOCKET;
+	cmsg->cmsg_type = SCM_RIGHTS;
+	cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
+
+	memmove(CMSG_DATA(cmsg), &fd, sizeof(fd));
+	msg.msg_controllen = cmsg->cmsg_len;
+
+	if (sendmsg(socket, &msg, 0) < 0)
+		error("%s: failed to send fd: %m", __func__);
+}
+
+/* receive an open file descriptor from fork()'d child over unix socket */
+static int _receive_fd(int socket)
+{
+	struct msghdr msg = {0};
+	struct cmsghdr *cmsg;
+	int fd;
+	msg.msg_iov = NULL;
+	msg.msg_iovlen = 0;
+	char c_buffer[256];
+	msg.msg_control = c_buffer;
+	msg.msg_controllen = sizeof(c_buffer);
+
+	if (recvmsg(socket, &msg, 0) < 0) {
+		error("%s: failed to receive fd: %m", __func__);
+		return -1;
+	}
+
+	cmsg = CMSG_FIRSTHDR(&msg);
+	memmove(&fd, CMSG_DATA(cmsg), sizeof(fd));
+	return fd;
+}
 
-	if ((rc = _get_grouplist(&req->user_name, req_uid,
-				 req_gid, &ngroups, &groups)) < 0) {
-		error("sbcast: getgrouplist(%u): %m", req_uid);
+
+static int _file_bcast_register_file(slurm_msg_t *msg,
+				     file_bcast_info_t *key)
+{
+	file_bcast_msg_t *req = msg->data;
+	int fd, flags, rc;
+	int pipe[2];
+	int ngroups = 16;
+	gid_t *groups;
+	pid_t child;
+	file_bcast_info_t *file_info;
+
+	if ((rc = _get_grouplist(&req->user_name, key->uid,
+				 key->gid, &ngroups, &groups)) < 0) {
+		error("sbcast: getgrouplist(%u): %m", key->uid);
 		return rc;
 	}
 
-	if ((req->block_no == 1) && (rc = container_g_create(job_id))) {
-		error("sbcast: container_g_create(%u): %m", job_id);
+	if ((rc = container_g_create(key->job_id))) {
+		error("sbcast: container_g_create(%u): %m", key->job_id);
+		xfree(groups);
 		return rc;
 	}
 
+	/* child process will setuid to the user, register the process
+	 * with the container, and open the file for us. */
+
+	if (socketpair(AF_UNIX, SOCK_DGRAM, 0, pipe) != 0) {
+		error("%s: Failed to open pipe: %m", __func__);
+		xfree(groups);
+		return SLURM_ERROR;
+	}
+
 	child = fork();
 	if (child == -1) {
 		error("sbcast: fork failure");
 		return errno;
 	} else if (child > 0) {
+		/* get fd back from pipe */
+		close(pipe[0]);
 		waitpid(child, &rc, 0);
 		xfree(groups);
-		return WEXITSTATUS(rc);
+		if (rc)
+			return WEXITSTATUS(rc);
+
+		fd = _receive_fd(pipe[1]);
+
+		file_info = xmalloc(sizeof(file_bcast_info_t));
+		file_info->fd = fd;
+		file_info->fname = xstrdup(req->fname);
+		file_info->uid = key->uid;
+		file_info->gid = key->gid;
+		file_info->job_id = key->job_id;
+		file_info->start_time = time(NULL);
+
+		//TODO: mmap the file here
+		_fb_wrlock();
+		list_append(file_bcast_list, file_info);
+		_fb_wrunlock();
+
+		return SLURM_SUCCESS;
 	}
 
+	close(pipe[1]);
+
 	/* container_g_add_pid needs to be called in the
 	   forked process part of the fork to avoid a race
 	   condition where if this process makes a file or
 	   detacts itself from a child before we add the pid
 	   to the container in the parent of the fork.
 	*/
-	if (container_g_add_pid(job_id, getpid(), req_uid) != SLURM_SUCCESS)
-		error("container_g_add_pid(%u): %m", job_id);
+	if (container_g_add_pid(key->job_id, getpid(), key->uid)) {
+		error("container_g_add_pid(%u): %m", key->job_id);
+		exit(SLURM_ERROR);
+	}
 
 	/* The child actually performs the I/O and exits with
 	 * a return code, do not return! */
@@ -3556,70 +3847,33 @@ _rpc_file_bcast(slurm_msg_t *msg)
 	\*********************************************************************/
 
 	if (setgroups(ngroups, groups) < 0) {
-		error("sbcast: uid: %u setgroups: %s", req_uid,
-		      strerror(errno));
+		error("sbcast: uid: %u setgroups: %m", key->uid);
 		exit(errno);
 	}
 
-	if (setgid(req_gid) < 0) {
-		error("sbcast: uid:%u setgid(%u): %s", req_uid, req_gid,
-		      strerror(errno));
+	if (setgid(key->gid) < 0) {
+		error("sbcast: uid:%u setgid(%u): %m", key->uid, key->gid);
 		exit(errno);
 	}
-	if (setuid(req_uid) < 0) {
-		error("sbcast: getuid(%u): %s", req_uid, strerror(errno));
+	if (setuid(key->uid) < 0) {
+		error("sbcast: getuid(%u): %m", key->uid);
 		exit(errno);
 	}
 
-	flags = O_WRONLY;
-	if (req->block_no == 1) {
-		flags |= O_CREAT;
-		if (req->force)
-			flags |= O_TRUNC;
-		else
-			flags |= O_EXCL;
-	} else
-		flags |= O_APPEND;
+	flags = O_WRONLY | O_CREAT;
+	if (req->force)
+		flags |= O_TRUNC;
+	else
+		flags |= O_EXCL;
 
-	fd = open(req->fname, flags, 0700);
+	fd = open(key->fname, flags, 0700);
 	if (fd == -1) {
-		error("sbcast: uid:%u can't open `%s`: %s",
-		      req_uid, req->fname, strerror(errno));
+		error("sbcast: uid:%u can't open `%s`: %m",
+		      key->uid, key->fname);
 		exit(errno);
 	}
-
-	offset = 0;
-	while (req->block_len - offset) {
-		inx = write(fd, &req->block[offset],
-			    (req->block_len - offset));
-		if (inx == -1) {
-			if ((errno == EINTR) || (errno == EAGAIN))
-				continue;
-			error("sbcast: uid:%u can't write `%s`: %s",
-			      req_uid, req->fname, strerror(errno));
-			close(fd);
-			exit(errno);
-		}
-		offset += inx;
-	}
-	if (req->last_block && fchmod(fd, (req->modes & 0777))) {
-		error("sbcast: uid:%u can't chmod `%s`: %s",
-		      req_uid, req->fname, strerror(errno));
-	}
-	if (req->last_block && fchown(fd, req_uid, req_gid)) {
-		error("sbcast: uid:%u gid:%u can't chown `%s`: %s",
-		      req_uid, req_gid, req->fname, strerror(errno));
-	}
+	_send_back_fd(pipe[0], fd);
 	close(fd);
-	if (req->last_block && req->atime) {
-		struct utimbuf time_buf;
-		time_buf.actime  = req->atime;
-		time_buf.modtime = req->mtime;
-		if (utime(req->fname, &time_buf)) {
-			error("sbcast: uid:%u can't utime `%s`: %s",
-			      req_uid, req->fname, strerror(errno));
-		}
-	}
 	exit(SLURM_SUCCESS);
 }
 
@@ -3923,15 +4177,8 @@ _job_still_running(uint32_t job_id)
 static void
 _wait_state_completed(uint32_t jobid, int max_delay)
 {
-	char *switch_type = slurm_get_switch_type();
 	int i;
 
-	if (strcmp(switch_type, "switch/federation")) {
-		xfree(switch_type);
-		return;
-	}
-	xfree(switch_type);
-
 	for (i=0; i<max_delay; i++) {
 		if (_steps_completed_now(jobid))
 			break;
@@ -4136,7 +4383,7 @@ _get_suspend_job_lock(uint32_t job_id)
 	static bool logged = false;
 	int i, empty_loc = -1, rc = 0;
 
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	for (i = 0; i < job_suspend_size; i++) {
 		if (job_suspend_array[i] == 0) {
 			empty_loc = i;
@@ -4144,7 +4391,7 @@ _get_suspend_job_lock(uint32_t job_id)
 		}
 		if (job_suspend_array[i] == job_id) {
 			/* another thread already a lock for this job ID */
-			pthread_mutex_unlock(&suspend_mutex);
+			slurm_mutex_unlock(&suspend_mutex);
 			return rc;
 		}
 	}
@@ -4163,7 +4410,7 @@ _get_suspend_job_lock(uint32_t job_id)
 		      NUM_PARALLEL_SUSP_JOBS);
 		logged = true;
 	}
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 	return rc;
 }
 
@@ -4171,12 +4418,12 @@ static void
 _unlock_suspend_job(uint32_t job_id)
 {
 	int i;
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	for (i = 0; i < job_suspend_size; i++) {
 		if (job_suspend_array[i] == job_id)
 			job_suspend_array[i] = 0;
 	}
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 }
 
 /* Add record for every launched job so we know they are ready for suspend */
@@ -4635,7 +4882,7 @@ _rpc_complete_batch(slurm_msg_t *msg)
 
 	if (running_serial == -1) {
 		char *select_type = slurm_get_select_type();
-		if (!strcmp(select_type, "select/serial"))
+		if (!xstrcmp(select_type, "select/serial"))
 			running_serial = 1;
 		else
 			running_serial = 0;
@@ -4962,7 +5209,7 @@ static void _sync_messages_kill(kill_job_msg_t *req)
 		host = hostset_shift(hosts);
 		if (host == NULL)
 			break;
-		if (strcmp(host, conf->node_name) == 0) {
+		if (xstrcmp(host, conf->node_name) == 0) {
 			free(host);
 			break;
 		}
@@ -5487,12 +5734,13 @@ _run_epilog(job_env_t *job_env)
 
 
 /**********************************************************************/
-/* Because calling initgroups(2) in Linux 2.4/2.6 looks very costly,  */
-/* we cache the group access list and call setgroups(2).              */
+/* Because calling initgroups(2)/getgrouplist(3) can be expensive and */
+/* is not cached by sssd or nscd, we cache the group access list.     */
 /**********************************************************************/
 
 typedef struct gid_cache_s {
 	char *user;
+	time_t timestamp;
 	gid_t gid;
 	gids_t *gids;
 	struct gid_cache_s *next;
@@ -5500,7 +5748,7 @@ typedef struct gid_cache_s {
 
 #define GIDS_HASH_LEN 64
 static gids_cache_t *gids_hashtbl[GIDS_HASH_LEN] = {NULL};
-
+static pthread_mutex_t gids_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static gids_t *
 _alloc_gids(int n, gid_t *gids)
@@ -5520,6 +5768,19 @@ _dealloc_gids(gids_t *p)
 	xfree(p);
 }
 
+/* Duplicate a gids_t struct.  */
+static gids_t *
+_gids_dup(gids_t *g)
+{
+	int buf_size;
+	gids_t *n = xmalloc(sizeof(gids_t));
+	n->ngids = g->ngids;
+	buf_size = g->ngids * sizeof(gid_t);
+	n->gids = xmalloc(buf_size);
+	memcpy(n->gids, g->gids, buf_size);
+	return n;
+}
+
 static gids_cache_t *
 _alloc_gids_cache(char *user, gid_t gid, gids_t *gids, gids_cache_t *next)
 {
@@ -5527,6 +5788,7 @@ _alloc_gids_cache(char *user, gid_t gid, gids_t *gids, gids_cache_t *next)
 
 	p = (gids_cache_t *)xmalloc(sizeof(gids_cache_t));
 	p->user = xstrdup(user);
+	p->timestamp = time(NULL);
 	p->gid = gid;
 	p->gids = gids;
 	p->next = next;
@@ -5541,25 +5803,20 @@ _dealloc_gids_cache(gids_cache_t *p)
 	xfree(p);
 }
 
-static int
-_gids_hashtbl_idx(char *user)
+static size_t
+_gids_hashtbl_idx(const char *user)
 {
-	unsigned char *p = (unsigned char *)user;
-	unsigned int x = 0;
-
-	while (*p) {
-		x += (unsigned int)*p;
-		p++;
-	}
+	uint64_t x = siphash_str(user);
 	return x % GIDS_HASH_LEN;
 }
 
-static void
-_gids_cache_purge(void)
+void
+gids_cache_purge(void)
 {
 	int i;
 	gids_cache_t *p, *q;
 
+	slurm_mutex_lock(&gids_mutex);
 	for (i=0; i<GIDS_HASH_LEN; i++) {
 		p = gids_hashtbl[i];
 		while (p) {
@@ -5569,29 +5826,13 @@ _gids_cache_purge(void)
 		}
 		gids_hashtbl[i] = NULL;
 	}
-}
-
-static gids_t *
-_gids_cache_lookup(char *user, gid_t gid)
-{
-	int idx;
-	gids_cache_t *p;
-
-	idx = _gids_hashtbl_idx(user);
-	p = gids_hashtbl[idx];
-	while (p) {
-		if (strcmp(p->user, user) == 0 && p->gid == gid) {
-			return p->gids;
-		}
-		p = p->next;
-	}
-	return NULL;
+	slurm_mutex_unlock(&gids_mutex);
 }
 
 static void
 _gids_cache_register(char *user, gid_t gid, gids_t *gids)
 {
-	int idx;
+	size_t idx;
 	gids_cache_t *p, *q;
 
 	idx = _gids_hashtbl_idx(user);
@@ -5602,24 +5843,62 @@ _gids_cache_register(char *user, gid_t gid, gids_t *gids)
 }
 
 static gids_t *
-_getgroups(void)
+_gids_cache_lookup(char *user, gid_t gid)
 {
-	int n;
-	gid_t *gg;
+	size_t idx;
+	gids_cache_t *p;
+	bool found_but_old = false;
+	time_t now = 0;
+	int ngroups = 0;
+	gid_t *groups;
+	gids_t *ret_gids = NULL;
 
-	if ((n = getgroups(0, NULL)) < 0) {
-		error("getgroups:_getgroups: %m");
-		return NULL;
+	idx = _gids_hashtbl_idx(user);
+	slurm_mutex_lock(&gids_mutex);
+	p = gids_hashtbl[idx];
+	while (p) {
+		if (xstrcmp(p->user, user) == 0 && p->gid == gid) {
+			slurm_ctl_conf_t *cf = slurm_conf_lock();
+			int group_ttl = cf->group_info & GROUP_TIME_MASK;
+			slurm_conf_unlock();
+			if (!group_ttl) {
+				ret_gids = _gids_dup(p->gids);
+				goto done;
+			}
+			now = time(NULL);
+			if (difftime(now, p->timestamp) < group_ttl) {
+				ret_gids = _gids_dup(p->gids);
+				goto done;
+			} else {
+				found_but_old = true;
+				break;
+			}
+		}
+		p = p->next;
 	}
-	gg = (gid_t *)xmalloc(n * sizeof(gid_t));
-	if (getgroups(n, gg) == -1) {
-		error("_getgroups: couldn't get %d groups: %m", n);
-		xfree(gg);
-		return NULL;
+	/* Cache lookup failed or cached value was too old, fetch new
+	 * value and insert it into cache.  */
+	getgrouplist(user, gid, NULL, &ngroups);
+	groups = xmalloc(ngroups * sizeof(gid_t));
+	if (getgrouplist(user, gid, groups, &ngroups) == -1)
+		error("getgrouplist failed");
+	if (found_but_old) {
+		xfree(p->gids->gids);
+		p->gids->gids = groups;
+		p->gids->ngids = ngroups;
+		p->timestamp = now;
+		ret_gids = _gids_dup(p->gids);
+	} else {
+		gids_t *gids = _alloc_gids(ngroups, groups);
+		_gids_cache_register(user, gid, gids);
+		ret_gids = _gids_dup(gids);
 	}
-	return _alloc_gids(n, gg);
+done:
+	slurm_mutex_unlock(&gids_mutex);
+	return ret_gids;
 }
 
+
 extern void
 destroy_starting_step(void *x)
 {
@@ -5627,77 +5906,6 @@ destroy_starting_step(void *x)
 }
 
 
-
-extern void
-init_gids_cache(int cache)
-{
-	struct passwd *pwd;
-	int ngids;
-	gid_t *orig_gids;
-	gids_t *gids;
-#ifdef HAVE_AIX
-	FILE *fp = NULL;
-#elif defined (__APPLE__) || defined (__CYGWIN__)
-#else
-	struct passwd pw;
-	char buf[BUF_SIZE];
-#endif
-
-	if (!cache) {
-		_gids_cache_purge();
-		return;
-	}
-
-	if ((ngids = getgroups(0, NULL)) < 0) {
-		error("getgroups: init_gids_cache: %m");
-		return;
-	}
-	orig_gids = (gid_t *)xmalloc(ngids * sizeof(gid_t));
-	if (getgroups(ngids, orig_gids) == -1) {
-		error("init_gids_cache: couldn't get %d groups: %m", ngids);
-		xfree(orig_gids);
-		return;
-	}
-
-#ifdef HAVE_AIX
-	setpwent_r(&fp);
-	while (!getpwent_r(&pw, buf, BUF_SIZE, &fp)) {
-		pwd = &pw;
-#else
-	setpwent();
-#if defined (__sun)
-	while ((pwd = getpwent_r(&pw, buf, BUF_SIZE)) != NULL) {
-#elif defined (__APPLE__) || defined (__CYGWIN__)
-	while ((pwd = getpwent()) != NULL) {
-#else
-
-	while (!getpwent_r(&pw, buf, BUF_SIZE, &pwd)) {
-#endif
-#endif
-		if (_gids_cache_lookup(pwd->pw_name, pwd->pw_gid))
-			continue;
-		if (initgroups(pwd->pw_name, pwd->pw_gid)) {
-			if ((errno == EPERM) && (getuid() != (uid_t) 0))
-				debug("initgroups:init_gids_cache: %m");
-			else
-				error("initgroups:init_gids_cache: %m");
-			continue;
-		}
-		if ((gids = _getgroups()) == NULL)
-			continue;
-		_gids_cache_register(pwd->pw_name, pwd->pw_gid, gids);
-	}
-#ifdef HAVE_AIX
-	endpwent_r(&fp);
-#else
-	endpwent();
-#endif
-
-	setgroups(ngids, orig_gids);
-	xfree(orig_gids);
-}
-
-
 static int
 _add_starting_step(uint16_t type, void *req)
 {
@@ -5987,7 +6195,7 @@ _rpc_forward_data(slurm_msg_t *msg)
 	memset(&sa, 0, sizeof(sa));
 	sa.sun_family = AF_UNIX;
 	strcpy(sa.sun_path, req->address);
-	while ((rc = connect(fd, (struct sockaddr *)&sa, SUN_LEN(&sa)) < 0) &&
+	while (((rc = connect(fd, (struct sockaddr *)&sa, SUN_LEN(&sa))) < 0) &&
 	       (errno == EINTR));
 	if (rc < 0) {
 		rc = errno;
@@ -6145,3 +6353,21 @@ static void _launch_complete_wait(uint32_t job_id)
 	slurm_mutex_unlock(&job_state_mutex);
 	_launch_complete_log("job wait", job_id);
 }
+
+static bool
+_requeue_setup_env_fail(void)
+{
+	static time_t config_update = 0;
+	static bool requeue = false;
+
+	if (config_update != conf->last_update) {
+		char *sched_params = slurm_get_sched_params();
+		requeue = (sched_params &&
+			   (strstr(sched_params, "no_env_cache") ||
+			    strstr(sched_params, "requeue_setup_env_fail")));
+		xfree(sched_params);
+		config_update = conf->last_update;
+	}
+
+	return requeue;
+}
diff --git a/src/slurmd/slurmd/req.h b/src/slurmd/slurmd/req.h
index 9b3e49701..c38615e8f 100644
--- a/src/slurmd/slurmd/req.h
+++ b/src/slurmd/slurmd/req.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmd/req.h - slurmd request handling
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -50,9 +49,12 @@ void slurmd_req(slurm_msg_t *msg);
 
 void destroy_starting_step(void *x);
 
-int init_gids_cache(int cache);
+void gids_cache_purge(void);
 
 /* Add record for every launched job so we know they are ready for suspend */
 extern void record_launched_jobs(void);
 
+void file_bcast_init(void);
+void file_bcast_purge(void);
+
 #endif
diff --git a/src/slurmd/slurmd/slurmd.c b/src/slurmd/slurmd/slurmd.c
index 13763f2d9..f632f1d35 100644
--- a/src/slurmd/slurmd/slurmd.c
+++ b/src/slurmd/slurmd/slurmd.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmd/slurmd.c - main slurm node server daemon
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -77,18 +76,19 @@
 #include "src/common/macros.h"
 #include "src/common/msg_aggr.h"
 #include "src/common/node_conf.h"
+#include "src/common/node_features.h"
 #include "src/common/node_select.h"
 #include "src/common/pack.h"
 #include "src/common/parse_spec.h"
 #include "src/common/parse_time.h"
+#include "src/common/plugstack.h"
 #include "src/common/proc_args.h"
 #include "src/common/read_config.h"
-#include "src/slurmd/common/set_oomadj.h"
-#include "src/slurmd/common/setproctitle.h"
 #include "src/common/slurm_auth.h"
 #include "src/common/slurm_cred.h"
 #include "src/common/slurm_acct_gather_energy.h"
 #include "src/common/slurm_jobacct_gather.h"
+#include "src/common/slurm_mcs.h"
 #include "src/common/slurm_protocol_api.h"
 #include "src/common/slurm_route.h"
 #include "src/common/slurm_strcasestr.h"
@@ -99,24 +99,28 @@
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
 #include "src/common/xsignal.h"
-#include "src/common/plugstack.h"
 
 #include "src/slurmd/common/core_spec_plugin.h"
+#include "src/slurmd/slurmd/get_mach_stat.h"
 #include "src/slurmd/common/job_container_plugin.h"
 #include "src/slurmd/common/proctrack.h"
-#include "src/slurmd/common/slurmd_cgroup.h"
-#include "src/slurmd/common/xcpuinfo.h"
-#include "src/slurmd/slurmd/get_mach_stat.h"
 #include "src/slurmd/slurmd/req.h"
+#include "src/slurmd/common/run_script.h"
+#include "src/slurmd/common/set_oomadj.h"
+#include "src/slurmd/common/setproctitle.h"
 #include "src/slurmd/slurmd/slurmd.h"
+#include "src/slurmd/common/slurmd_cgroup.h"
 #include "src/slurmd/slurmd/slurmd_plugstack.h"
+#include "src/slurmd/common/xcpuinfo.h"
 
-#define GETOPT_ARGS	"cCd:Df:hL:Mn:N:vV"
+#define GETOPT_ARGS	"bcCd:Df:hL:Mn:N:vV"
 
 #ifndef MAXHOSTNAMELEN
 #  define MAXHOSTNAMELEN	64
 #endif
 
+#define HEALTH_RETRY_DELAY 10
+
 #define MAX_THREADS		256
 
 #define _free_and_set(__dst, __src) \
@@ -203,7 +207,7 @@ static void      _update_nice(void);
 static void      _usage(void);
 static int       _validate_and_convert_cpu_list(void);
 static void      _wait_for_all_threads(int secs);
-
+static void      _wait_health_check(void);
 
 int
 main (int argc, char *argv[])
@@ -338,9 +342,12 @@ main (int argc, char *argv[])
 		fatal("Unable to initialize core specialization plugin.");
 	if (switch_g_node_init() < 0)
 		fatal("Unable to initialize interconnect.");
+	if (node_features_g_init() != SLURM_SUCCESS )
+		fatal( "failed to initialize node_features plugin");	
 	if (conf->cleanstart && switch_g_clear_node_state())
 		fatal("Unable to clear interconnect state.");
 	switch_g_slurmd_init();
+	file_bcast_init();
 
 	_create_msg_socket();
 
@@ -363,6 +370,9 @@ main (int argc, char *argv[])
 	if (slurmd_plugstack_init())
 		fatal("failed to initialize slurmd_plugstack");
 
+	/* Wait for a successfull health check if HealthCheckInterval != 0 */
+	_wait_health_check();
+
 	_spawn_registration_engine();
 	msg_aggr_sender_init(conf->hostname, conf->port,
 			     conf->msg_aggr_window_time,
@@ -382,6 +392,8 @@ main (int argc, char *argv[])
 	_slurmd_fini();
 	_destroy_conf();
 	slurm_crypto_fini();	/* must be after _destroy_conf() */
+	gids_cache_purge();
+	file_bcast_purge();
 
 	info("Slurmd shutdown completing");
 	log_fini();
@@ -685,19 +697,25 @@ _fill_registration_msg(slurm_node_registration_status_msg_t *msg)
 		slurmd_start_time = time(NULL);
 	msg->slurmd_start_time = slurmd_start_time;
 
+	node_features_g_node_state(&msg->features_avail, &msg->features_active);
+
 	if (first_msg) {
 		first_msg = false;
 		info("CPUs=%u Boards=%u Sockets=%u Cores=%u Threads=%u "
-		     "Memory=%u TmpDisk=%u Uptime=%u CPUSpecList=%s",
+		     "Memory=%u TmpDisk=%u Uptime=%u CPUSpecList=%s "
+		     "FeaturesAvail=%s FeaturesActive=%s",
 		     msg->cpus, msg->boards, msg->sockets, msg->cores,
 		     msg->threads, msg->real_memory, msg->tmp_disk,
-		     msg->up_time, msg->cpu_spec_list);
+		     msg->up_time, msg->cpu_spec_list, msg->features_avail,
+		     msg->features_active);
 	} else {
 		debug3("CPUs=%u Boards=%u Sockets=%u Cores=%u Threads=%u "
-		       "Memory=%u TmpDisk=%u Uptime=%u CPUSpecList=%s",
+		       "Memory=%u TmpDisk=%u Uptime=%u CPUSpecList=%s "
+		       "FeaturesAvail=%s FeaturesActive=%s",
 		       msg->cpus, msg->boards, msg->sockets, msg->cores,
 		       msg->threads, msg->real_memory, msg->tmp_disk,
-		       msg->up_time, msg->cpu_spec_list);
+		       msg->up_time, msg->cpu_spec_list, msg->features_avail,
+		       msg->features_active);
 	}
 	uname(&buf);
 	if ((arch = getenv("SLURM_ARCH")))
@@ -816,7 +834,7 @@ _read_config(void)
 		conf->logfile = xstrdup(cf->slurmd_logfile);
 
 #ifndef HAVE_FRONT_END
-	if (!strcmp(cf->select_type, "select/cons_res"))
+	if (!xstrcmp(cf->select_type, "select/cons_res"))
 		cr_flag = true;
 	if (cf->preempt_mode & PREEMPT_MODE_GANG)
 		gang_flag = true;
@@ -843,7 +861,7 @@ _read_config(void)
 	/* set node_addr if relevant */
 	if ((conf->node_addr == NULL) &&
 	    (conf->node_addr = slurm_conf_get_nodeaddr(conf->hostname)) &&
-	    (strcmp(conf->node_addr, conf->hostname) == 0)) {
+	    (xstrcmp(conf->node_addr, conf->hostname) == 0)) {
 		xfree(conf->node_addr);	/* Sets to NULL */
 	}
 
@@ -899,6 +917,22 @@ _read_config(void)
 		conf->sockets = conf->actual_sockets;
 		conf->cores   = conf->actual_cores;
 		conf->threads = conf->actual_threads;
+	} else if ((cf->fast_schedule == 1) && (cr_flag || gang_flag) &&
+		   (conf->actual_sockets != conf->conf_sockets) &&
+		   (conf->actual_cores != conf->conf_cores) &&
+		   ((conf->actual_sockets * conf->actual_cores) ==
+		    (conf->conf_sockets * conf->conf_cores))) {
+		/* Socket and core count can be changed when KNL node reboots
+		 * in a different NUMA configuration */
+		info("Node reconfigured socket/core boundaries "
+		     "SocketsPerBoard=%u:%u(hw) CoresPerSocket=%u:%u(hw)",
+		     conf->conf_sockets, conf->actual_sockets,
+		     conf->conf_cores, conf->actual_cores);
+		conf->cpus    = conf->conf_cpus;
+		conf->boards  = conf->conf_boards;
+		conf->sockets = conf->actual_sockets;
+		conf->cores   = conf->actual_cores;
+		conf->threads = conf->conf_threads;
 	} else {
 		conf->cpus    = conf->conf_cpus;
 		conf->boards  = conf->conf_boards;
@@ -1001,6 +1035,7 @@ _read_config(void)
 	conf->task_plugin_param = cf->task_plugin_param;
 
 	conf->mem_limit_enforce = cf->mem_limit_enforce;
+	conf->health_check_interval = cf->health_check_interval;
 
 	slurm_mutex_unlock(&conf->config_mutex);
 	slurm_conf_unlock();
@@ -1011,7 +1046,6 @@ _reconfigure(void)
 {
 	List steps;
 	ListIterator i;
-	slurm_ctl_conf_t *cf;
 	step_loc_t *stepd;
 	bool did_change;
 
@@ -1049,14 +1083,9 @@ _reconfigure(void)
 	slurm_cred_ctx_key_update(conf->vctx, conf->pubkey);
 
 	/*
-	 * Reinitialize the groups cache
+	 * Purge the username -> grouplist cache.
 	 */
-	cf = slurm_conf_lock();
-	if (cf->group_info & GROUP_CACHE)
-		init_gids_cache(1);
-	else
-		init_gids_cache(0);
-	slurm_conf_unlock();
+	gids_cache_purge();
 
 	/* send reconfig to each stepd so they can refresh their log
 	 * file handle
@@ -1110,11 +1139,6 @@ _print_conf(void)
 	debug3("NodeName    = %s",       conf->node_name);
 	debug3("TopoAddr    = %s",       conf->node_topo_addr);
 	debug3("TopoPattern = %s",       conf->node_topo_pattern);
-	if (cf->group_info & GROUP_CACHE)
-		i = 1;
-	else
-		i = 0;
-	debug3("CacheGroups = %d",       i);
 	debug3("ClusterName = %s",       conf->cluster_name);
 	debug3("Confile     = `%s'",     conf->conffile);
 	debug3("Debug       = %d",       cf->slurmd_debug);
@@ -1307,6 +1331,9 @@ _process_cmdline(int ac, char **av)
 
 	while ((c = getopt(ac, av, GETOPT_ARGS)) > 0) {
 		switch (c) {
+		case 'b':
+			conf->boot_time = 1;
+			break;
 		case 'c':
 			conf->cleanstart = 1;
 			break;
@@ -1424,7 +1451,7 @@ _stepd_cleanup_batch_dirs(const char *directory, const char *nodename)
 	}
 
 	while ((ent = readdir(dp)) != NULL) {
-		if (!strncmp(ent->d_name, "job", 3) &&
+		if (!xstrncmp(ent->d_name, "job", 3) &&
 		    (ent->d_name[3] >= '0') && (ent->d_name[3] <= '9')) {
 			snprintf(dir_path, sizeof(dir_path),
 				 "%s/%s", directory, ent->d_name);
@@ -1443,7 +1470,6 @@ static int
 _slurmd_init(void)
 {
 	struct rlimit rlim;
-	slurm_ctl_conf_t *cf;
 	struct stat stat_buf;
 	uint32_t cpu_cnt;
 
@@ -1539,7 +1565,7 @@ _slurmd_init(void)
 	 */
 	if (!(conf->vctx = slurm_cred_verifier_ctx_create(conf->pubkey)))
 		return SLURM_FAILURE;
-	if (!strcmp(conf->select_type, "select/serial")) {
+	if (!xstrcmp(conf->select_type, "select/serial")) {
 		/* Only cache credential for 5 seconds with select/serial
 		 * for shorter cache searches and higher throughput */
 		slurm_cred_ctx_set(conf->vctx, SLURM_CRED_OPT_EXPIRY_WINDOW, 5);
@@ -1600,16 +1626,6 @@ _slurmd_init(void)
 		}
 	}
 
-	/*
-	 * Cache the group access list
-	 */
-	cf = slurm_conf_lock();
-	if (cf->group_info & GROUP_CACHE)
-		init_gids_cache(1);
-	else
-		init_gids_cache(0);
-	slurm_conf_unlock();
-
 	if ((devnull = open_cloexec("/dev/null", O_RDWR)) < 0) {
 		error("Unable to open /dev/null: %m");
 		return SLURM_FAILURE;
@@ -1679,6 +1695,7 @@ cleanup:
 static int
 _slurmd_fini(void)
 {
+	node_features_g_fini();
 	core_spec_g_fini();
 	switch_g_node_fini();
 	jobacct_gather_fini();
@@ -1812,6 +1829,7 @@ _usage(void)
 {
 	fprintf(stderr, "\
 Usage: %s [OPTIONS]\n\
+   -b          Report node reboot now.\n\
    -c          Force cleanup of slurmd shared memory.\n\
    -C          Print node configuration information and exit.\n\
    -d stepd    Pathname to the slurmstepd program.\n\
@@ -2082,8 +2100,10 @@ static int _core_spec_init(void)
 		debug("Using core_spec/cray to manage specialized cores");
 		return SLURM_SUCCESS;
 	}
-	if (!check_cgroup_job_confinement()) {
-		error("Resource spec: cgroup job confinement not configured");
+	if (!check_corespec_cgroup_job_confinement()) {
+		error("Resource spec: cgroup job confinement not configured. "
+		     "CoreSpec requires TaskPlugin=task/cgroup and "
+		     "ConstrainCores=yes in cgroup.conf");
 		return SLURM_ERROR;
 	}
 
@@ -2158,6 +2178,12 @@ static int _memory_spec_init(void)
 		      "configured for this node");
 		return SLURM_SUCCESS;
 	}
+	if (!check_memspec_cgroup_job_confinement()) {
+		error("Resource spec: cgroup job confinement not configured. "
+		      "MemSpecLimit requires TaskPlugin=task/cgroup and "
+		      "ConstrainRAMSpace=yes in cgroup.conf");
+		return SLURM_ERROR;
+	}
 	if (init_system_memory_cgroup() != SLURM_SUCCESS) {
 		error("Resource spec: unable to initialize system "
 		      "memory cgroup");
@@ -2290,3 +2316,44 @@ static void _resource_spec_fini(void)
 	FREE_NULL_BITMAP(res_core_bitmap);
 	FREE_NULL_BITMAP(res_cpu_bitmap);
 }
+
+/*
+ * Wait for health check to execute successfully
+ *
+ * Return imediately if a shutdown has been requested or
+ * if the HealthCheckInterval is 0.
+ */
+static void _wait_health_check(void)
+{
+	int last_check_time = 0;
+	while (!_shutdown && (conf->health_check_interval != 0) ) {
+		if (time(NULL) - last_check_time > HEALTH_RETRY_DELAY) {
+			if (run_script_health_check() == SLURM_SUCCESS) {
+				break;
+			}
+			last_check_time = time(NULL);
+			info ("Health Check failed, retrying in %ds...",
+				HEALTH_RETRY_DELAY);
+		}
+		usleep(10000);
+	}
+}
+
+/*
+ * Run the configured health check program
+ *
+ * Returns the run result. If the health check program
+ * is not defined, returns success immediately.
+ */
+extern int run_script_health_check(void)
+{
+	int rc = SLURM_SUCCESS;
+
+	if (conf->health_check_program) {
+		char *env[1] = { NULL };
+		rc = run_script("health_check", conf->health_check_program,
+				0, 60, env, 0);
+	}
+
+	return rc;
+}
diff --git a/src/slurmd/slurmd/slurmd.h b/src/slurmd/slurmd/slurmd.h
index d25381578..68970f411 100644
--- a/src/slurmd/slurmd/slurmd.h
+++ b/src/slurmd/slurmd/slurmd.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmd/slurmd.h - header for slurmd
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -125,7 +124,8 @@ typedef struct slurmd_config {
 	char         *logfile;		/* slurmd logfile, if any          */
 	char         *spooldir;		/* SlurmdSpoolDir		   */
 	char         *pidfile;		/* PidFile location		   */
-	char         *health_check_program;	/* run on RPC request      */
+	char         *health_check_program; /* run on RPC request or at start */
+	uint64_t     health_check_interval; /* Interval between runs       */
 	char         *tmpfs;		/* directory of tmp FS             */
 	char         *pubkey;		/* location of job cred public key */
 	char         *epilog;		/* Path to Epilog script	   */
@@ -142,7 +142,8 @@ typedef struct slurmd_config {
 	int           debug_level;	/* logging detail level            */
 	uint16_t      debug_level_set;	/* debug_level set on command line */
 	uint64_t      debug_flags;	/* DebugFlags configured           */
-	int           daemonize:1;	/* daemonize flag		   */
+	int	      boot_time:1;      /* Report node boot time now (-b)  */
+	int           daemonize:1;	/* daemonize flag (-D)		   */
 	int	      cleanstart:1;     /* clean start requested (-c)      */
 	int           mlock_pages:1;	/* mlock() slurmd  */
 
@@ -194,5 +195,7 @@ int send_registration_msg(uint32_t status, bool startup);
  */
 int save_cred_state(slurm_cred_ctx_t vctx);
 
+/* Run the health check program if configured */
+int run_script_health_check(void);
 
 #endif /* !_SLURMD_H */
diff --git a/src/slurmd/slurmd/slurmd_plugstack.c b/src/slurmd/slurmd/slurmd_plugstack.c
index 470fd9d0f..3dbab18ad 100644
--- a/src/slurmd/slurmd/slurmd_plugstack.c
+++ b/src/slurmd/slurmd/slurmd_plugstack.c
@@ -122,7 +122,7 @@ extern int slurmd_plugstack_init(void)
 			      (g_context_cnt + 1)));
 		xrealloc(g_context,
 			 (sizeof(plugin_context_t *) * (g_context_cnt + 1)));
-		if (strncmp(type, "slurmd/", 10) == 0)
+		if (xstrncmp(type, "slurmd/", 10) == 0)
 			type += 10; /* backward compatibility */
 		type = xstrdup_printf("slurmd/%s", type);
 		g_context[g_context_cnt] = plugin_context_create(
diff --git a/src/slurmd/slurmstepd/Makefile.in b/src/slurmd/slurmstepd/Makefile.in
index e71603fe5..e5fe52eea 100644
--- a/src/slurmd/slurmstepd/Makefile.in
+++ b/src/slurmd/slurmstepd/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 sbin_PROGRAMS = slurmstepd$(EXEEXT)
 subdir = src/slurmd/slurmstepd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -232,8 +233,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -333,6 +332,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -371,6 +374,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -414,6 +420,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -464,6 +473,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/slurmd/slurmstepd/fname.c b/src/slurmd/slurmstepd/fname.c
index 7a8b552f9..18889188c 100644
--- a/src/slurmd/slurmstepd/fname.c
+++ b/src/slurmd/slurmstepd/fname.c
@@ -54,6 +54,17 @@
 #include "src/common/xmalloc.h"
 #include "src/common/xstring.h"
 
+static void _batch_path_check(char **p, char **q, char **name,
+			      unsigned int wid, stepd_step_rec_t *job,
+			      int taskid);
+static char * _create_batch_fname(char *name, char *path,
+				  stepd_step_rec_t *job, int taskid);
+static char * _create_step_fname(char *name, char *path, stepd_step_rec_t *job,
+				 int taskid);
+static void _step_path_check(char **p, char **q, char **name, unsigned int wid,
+			     bool double_p, stepd_step_rec_t *job, int taskid,
+			     int offset);
+
 /*
  * Max zero-padding width
  */
@@ -65,125 +76,245 @@
 char *
 fname_create(stepd_step_rec_t *job, const char *format, int taskid)
 {
-	unsigned int wid   = 0;
 	char *name = NULL;
 	char *orig = xstrdup(format);
-	char *p, *q;
 	int id;
 	char *esc;
 
 	if (((id = fname_single_task_io (format)) >= 0) && (taskid != id))
-			return (xstrdup ("/dev/null"));
+		return (xstrdup ("/dev/null"));
 
 	esc = is_path_escaped(orig);
 
-	/* If format doesn't specify an absolute pathname,
-	 * use cwd
+	/* If format doesn't specify an absolute pathname, use cwd
 	 */
 	if (orig[0] != '/') {
 		xstrcat(name, job->cwd);
 		if (esc) {
 			xstrcat(name, esc);
-			goto via;
+			goto fini;
 		}
 		if (name[strlen(name)-1] != '/')
 			xstrcatchar(name, '/');
 	}
 
 	if (esc) {
-		/* esc is malloc
-		 */
+		/* esc is malloc */
 		name = esc;
-		goto via;
+		goto fini;
 	}
 
-	q = p = orig;
+	if (job->batch)
+		name = _create_batch_fname(name, orig, job, taskid);
+	else
+		name = _create_step_fname(name, orig, job, taskid);
+
+fini:
+	xfree(orig);
+	return name;
+}
+
+static char *_create_batch_fname(char *name, char *path, stepd_step_rec_t *job,
+				 int taskid)
+{
+	unsigned int wid   = 0;
+	char *p, *q;
+	q = p = path;
+
 	while (*p != '\0') {
 		if (*p == '%') {
+			if (*(p+1) == '%') {
+				p++;
+				xmemcat(name, q, p);
+				q = ++p;
+				continue;
+			}
 			if (isdigit(*(++p))) {
 				unsigned long in_width = 0;
 				xmemcat(name, q, p - 1);
-				if ((in_width = strtoul(p, &p, 10)) > MAX_WIDTH)
+				if ((in_width = strtoul(p, &p, 10)) >
+				    MAX_WIDTH) {
 					wid = MAX_WIDTH;
-				else
+				} else
 					wid = (unsigned int)in_width;
 				q = p - 1;
 				if (*p == '\0')
 					break;
 			}
 
-			switch (*p) {
-			case 'a':  /* '%a' => array task id   */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid,
-					   job->array_task_id);
-				q = ++p;
-				break;
-			case 'A':  /* '%A' => array master job id */
-				xmemcat(name, q, p - 1);
-				if (job->array_task_id == NO_VAL) {
-					xstrfmtcat(name, "%0*u", wid,
-						   job->jobid);
-				} else {
-					xstrfmtcat(name, "%0*u", wid,
-						   job->array_job_id);
-				}
-				q = ++p;
-				break;
-			case 's':  /* '%s' => step id        */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, job->stepid);
-				q = ++p;
-				break;
-			case 't':  /* '%t' => taskid         */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, taskid);
-				q = ++p;
-				break;
-			case 'n':  /* '%n' => nodeid         */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, job->nodeid);
-				q = ++p;
-				break;
-			case 'N':  /* '%N' => node name      */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%s", conf->hostname);
-				q = ++p;
-				break;
-			case 'u':  /* '%u' => user name      */
-				if (!job->user_name)
-					job->user_name =
-						uid_to_string(job->uid);
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%s", job->user_name);
-				q = ++p;
-				break;
-			case 'J':  /* '%J' => jobid.stepid */
-			case 'j':  /* '%j' => jobid        */
-				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, job->jobid);
+			_batch_path_check(&p, &q, &name, wid, job, taskid);
+			wid = 0;
+		} else
+			p++;
+	}
 
-				if ((*p == 'J') && (job->stepid != NO_VAL))
-					xstrfmtcat(name, ".%u", job->stepid);
-				q = ++p;
-				break;
+	if (q != p)
+		xmemcat(name, q, p);
 
-			default:
-				break;
+	return name;
+}
+
+static char *_create_step_fname (char *name, char *path, stepd_step_rec_t *job,
+				 int taskid)
+{
+
+	unsigned int wid   = 0;
+	char *p, *q;
+	bool double_p = false;
+	int str_offset = 1;
+
+	q = p = path;
+	while (*p != '\0') {
+		if (*p == '%') {
+			if (*(p+1) == '%') {
+				p++;
+				double_p = true;
 			}
-			wid = 0;
 
+			if (isdigit(*(++p))) {
+				unsigned long in_width = 0;
+				if ((in_width = strtoul(p, &p, 10)) ==
+				    MAX_WIDTH) {
+					/* Remove % and double digit 10 */
+					str_offset = 3;
+				} else
+					str_offset = 2;
+				wid = (unsigned int)in_width;
+				if (*p == '\0')
+					break;
+
+			}
+			_step_path_check(&p, &q, &name, wid, double_p,
+					 job, taskid, str_offset);
+			wid = 0;
 		} else
 			p++;
+		double_p = false;
+		str_offset = 1;
+
 	}
 
 	if (q != p)
 		xmemcat(name, q, p);
-via:
-	xfree(orig);
+
 	return name;
 }
 
+/*
+ * Substitute the path option for a step.
+ *
+ */
+static void _step_path_check(char **p, char **q, char **name, unsigned int wid,
+			     bool double_p, stepd_step_rec_t *job, int taskid,
+			     int offset)
+{
+	switch (**p) {
+	case '%': /* This is in case there is a 3rd %, ie. %%% */
+		xmemcat(*name, *q, *p - 1);
+		*q = *p;
+		break;
+	case 't':  /* '%t' => taskid         */
+		xmemcat(*name, *q, *p - offset);
+		if (!double_p) {
+			xstrfmtcat(*name, "%0*u", wid, taskid);
+			(*p)++;
+		}
+		*q = (*p)++;
+		break;
+	case 'n':  /* '%n' => nodeid         */
+		xmemcat(*name, *q, *p - offset);
+		if (!double_p) {
+			xstrfmtcat(*name, "%0*u", wid, job->nodeid);
+			(*p)++;
+		}
+		*q = (*p)++;
+		break;
+	case 'N':  /* '%N' => node name      */
+		xmemcat(*name, *q, *p - offset);
+		if (!double_p) {
+			xstrfmtcat(*name, "%s", conf->hostname);
+			(*p)++;
+		}
+		*q = (*p)++;
+		break;
+	case 'u':  /* '%u' => user name      */
+		if (!job->user_name)
+			job->user_name = uid_to_string(job->uid);
+		xmemcat(*name, *q, *p - 1);
+		if (!double_p) {
+			xstrfmtcat(*name, "%s", job->user_name);
+			(*p)++;
+		}
+		*q = (*p)++;
+		break;
+	default:
+		break;
+	}
+}
+
+/*
+ * Substitute the path option for a batch job
+ *
+ */
+static void _batch_path_check(char **p, char **q, char **name,
+			      unsigned int wid, stepd_step_rec_t *job,
+			      int taskid)
+{
+
+	switch (**p) {
+	case 'a':  /* '%a' => array task id   */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%0*u", wid,
+			   job->array_task_id);
+		*q = ++(*p);
+		break;
+	case 'A':  /* '%A' => array master job id */
+		xmemcat(*name, *q, *p - 1);
+		if (job->array_task_id == NO_VAL)
+			xstrfmtcat(*name, "%0*u", wid, job->jobid);
+		else
+			xstrfmtcat(*name, "%0*u",wid, job->array_job_id);
+		*q = ++(*p);
+		break;
+	case 'J':  /* '%J' => jobid.stepid */
+	case 'j':  /* '%j' => jobid        */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%0*u", wid, job->jobid);
+		if ((**p == 'J') && (job->stepid != NO_VAL))
+			xstrfmtcat(*name, ".%u", job->stepid);
+		*q = ++(*p);
+		break;
+	case 'n':  /* '%n' => nodeid         */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%0*u", wid, job->nodeid);
+		*q = ++(*p);
+		break;
+	case 'N':  /* '%N' => node name      */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%s", conf->hostname);
+		*q = ++(*p);
+		break;
+	case 's':  /* '%s' => step id        */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%0*u", wid, job->stepid);
+		*q = ++(*p);
+		break;
+	case 't':  /* '%t' => taskid         */
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%0*u", wid, taskid);
+		*q = ++(*p);
+		break;
+	case 'u':  /* '%u' => user name      */
+		if (!job->user_name)
+			job->user_name = uid_to_string(job->uid);
+		xmemcat(*name, *q, *p - 1);
+		xstrfmtcat(*name, "%s", job->user_name);
+		*q = ++(*p);
+		break;
+	default:
+		break;
+	}
+}
 /*
  * Return >= 0 if fmt specifies "single task only" IO
  *  i.e. if it specifies a single integer only
diff --git a/src/slurmd/slurmstepd/io.c b/src/slurmd/slurmstepd/io.c
index 266d2addf..eb27b5a2e 100644
--- a/src/slurmd/slurmstepd/io.c
+++ b/src/slurmd/slurmstepd/io.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/io.c - Standard I/O handling routines for slurmstepd
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -1052,10 +1051,10 @@ _init_task_stdio_fds(stepd_step_task_info_t *task, stepd_step_rec_t *job)
 			task->from_stdout = -1;  /* not used */
 		}
 	} else if (task->ofname != NULL &&
-		   (!job->labelio || strcmp(task->ofname, "/dev/null")==0)) {
+		   (!job->labelio || xstrcmp(task->ofname, "/dev/null")==0)) {
 #else
 	if (task->ofname != NULL &&
-	    (!job->labelio || strcmp(task->ofname, "/dev/null")==0) ) {
+	    (!job->labelio || xstrcmp(task->ofname, "/dev/null")==0) ) {
 #endif
 		int count = 0;
 		/* open file on task's stdout */
@@ -1138,10 +1137,10 @@ _init_task_stdio_fds(stepd_step_task_info_t *task, stepd_step_rec_t *job)
 			task->from_stderr = -1;  /* not used */
 		}
 	} else if (task->efname != NULL &&
-		   (!job->labelio || strcmp(task->efname, "/dev/null")==0)) {
+		   (!job->labelio || xstrcmp(task->efname, "/dev/null")==0)) {
 #else
 	if (task->efname != NULL &&
-	    (!job->labelio || strcmp(task->efname, "/dev/null")==0) ) {
+	    (!job->labelio || xstrcmp(task->efname, "/dev/null")==0) ) {
 #endif
 		int count = 0;
 		/* open file on task's stdout */
@@ -2000,14 +1999,14 @@ io_find_filename_pattern( stepd_step_rec_t *job,
 		if (job->task[ii]->ofname == NULL) {
 			of_num_null++;
 			of_lastnull = ii;
-		} else if (strcmp(job->task[ii]->ofname, "/dev/null")==0) {
+		} else if (xstrcmp(job->task[ii]->ofname, "/dev/null")==0) {
 			of_num_devnull++;
 		}
 
 		if (job->task[ii]->efname == NULL) {
 			ef_num_null++;
 			ef_lastnull = ii;
-		} else if (strcmp(job->task[ii]->efname, "/dev/null")==0) {
+		} else if (xstrcmp(job->task[ii]->efname, "/dev/null")==0) {
 			ef_num_devnull++;
 		}
 	}
@@ -2035,11 +2034,11 @@ io_find_filename_pattern( stepd_step_rec_t *job,
 
 	for (ii = 1; ii < job->node_tasks; ii++) {
 		if (!job->task[ii]->ofname || !job->task[0]->ofname ||
-		    strcmp(job->task[ii]->ofname, job->task[0]->ofname) != 0)
+		    xstrcmp(job->task[ii]->ofname, job->task[0]->ofname) != 0)
 			of_all_same = false;
 
 		if (!job->task[ii]->efname || !job->task[0]->efname ||
-		    strcmp(job->task[ii]->efname, job->task[0]->efname) != 0)
+		    xstrcmp(job->task[ii]->efname, job->task[0]->efname) != 0)
 			ef_all_same = false;
 	}
 
@@ -2050,7 +2049,7 @@ io_find_filename_pattern( stepd_step_rec_t *job,
 		*errpattern = SLURMD_ALL_SAME;
 
 	if (job->task[0]->ofname && job->task[0]->efname &&
-	    strcmp(job->task[0]->ofname, job->task[0]->efname)==0)
+	    xstrcmp(job->task[0]->ofname, job->task[0]->efname)==0)
 		*same_out_err_files = true;
 
 	if (*outpattern != SLURMD_UNKNOWN && *errpattern != SLURMD_UNKNOWN)
@@ -2060,13 +2059,13 @@ io_find_filename_pattern( stepd_step_rec_t *job,
 		for (jj = ii+1; jj < job->node_tasks; jj++) {
 
 			if (!job->task[ii]->ofname || !job->task[jj]->ofname ||
-			    strcmp(job->task[ii]->ofname,
-				   job->task[jj]->ofname) == 0)
+			    xstrcmp(job->task[ii]->ofname,
+				    job->task[jj]->ofname) == 0)
 				of_all_unique = false;
 
 			if (!job->task[ii]->efname || !job->task[jj]->efname ||
-			    strcmp(job->task[ii]->efname,
-				   job->task[jj]->efname) == 0)
+			    xstrcmp(job->task[ii]->efname,
+				    job->task[jj]->efname) == 0)
 				ef_all_unique = false;
 		}
 	}
@@ -2082,8 +2081,8 @@ io_find_filename_pattern( stepd_step_rec_t *job,
 		for (ii = 0; ii < job->node_tasks; ii++) {
 			if (job->task[ii]->ofname &&
 			    job->task[ii]->efname &&
-			    strcmp(job->task[ii]->ofname,
-				   job->task[ii]->efname) != 0) {
+			    xstrcmp(job->task[ii]->ofname,
+				    job->task[ii]->efname) != 0) {
 				*same_out_err_files = false;
 				break;
 			}
diff --git a/src/slurmd/slurmstepd/io.h b/src/slurmd/slurmstepd/io.h
index 4dc39097f..1a69faac8 100644
--- a/src/slurmd/slurmstepd/io.h
+++ b/src/slurmd/slurmstepd/io.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/io.h - slurmstepd standard IO routines
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/slurmstepd/mgr.c b/src/slurmd/slurmstepd/mgr.c
index 48df1be02..bfb0fa324 100644
--- a/src/slurmd/slurmstepd/mgr.c
+++ b/src/slurmd/slurmstepd/mgr.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/mgr.c - job manager functions for slurmstepd
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -660,7 +659,7 @@ _random_sleep(stepd_step_rec_t *job)
 {
 #if !defined HAVE_FRONT_END
 	long int delay = 0;
-	long int max   = (3 * job->nnodes);
+	long int max   = (slurm_get_tcp_timeout() * job->nnodes);
 
 	srand48((long int) (job->jobid + job->nodeid));
 
@@ -697,7 +696,7 @@ _send_exit_msg(stepd_step_rec_t *job, uint32_t *tid, int n, int status)
 	 *  Hack for TCP timeouts on exit of large, synchronized job
 	 *  termination. Delay a random amount if job->nnodes > 100
 	 */
-	if (job->nnodes > 100)
+	if (job->nnodes > 500)
 		_random_sleep(job);
 
 	/*
@@ -731,7 +730,7 @@ _wait_for_children_slurmstepd(stepd_step_rec_t *job)
 	int rc;
 	struct timespec ts = {0, 0};
 
-	pthread_mutex_lock(&step_complete.lock);
+	slurm_mutex_lock(&step_complete.lock);
 
 	/* wait an extra 3 seconds for every level of tree below this level */
 	if (step_complete.children > 0) {
@@ -763,7 +762,7 @@ _wait_for_children_slurmstepd(stepd_step_rec_t *job)
 	step_complete.step_rc = _get_exit_code(job);
 	step_complete.wait_children = false;
 
-	pthread_mutex_unlock(&step_complete.lock);
+	slurm_mutex_unlock(&step_complete.lock);
 }
 
 /*
@@ -843,7 +842,7 @@ _one_step_complete_msg(stepd_step_rec_t *job, int first, int last)
 		/* this is the base of the tree, but we are doing
 		 * message aggr so send it to the slurmd to handle */
 		req.msg_type = REQUEST_STEP_COMPLETE_AGGR;
-		slurm_set_addr_char(&req.address, conf->port, "localhost");
+		slurm_set_addr_char(&req.address, conf->port, conf->hostname);
 		for (i = 0; i <= REVERSE_TREE_PARENT_RETRY; i++) {
 			if (i)
 				sleep(1);
@@ -934,7 +933,7 @@ _send_step_complete_msgs(stepd_step_rec_t *job)
 	int first = -1, last = -1;
 	bool sent_own_comp_msg = false;
 
-	pthread_mutex_lock(&step_complete.lock);
+	slurm_mutex_lock(&step_complete.lock);
 	start = 0;
 	size = bit_size(step_complete.bits);
 
@@ -942,7 +941,7 @@ _send_step_complete_msgs(stepd_step_rec_t *job)
 	if (size == 0) {
 		_one_step_complete_msg(job, step_complete.rank,
 				       step_complete.rank);
-		pthread_mutex_unlock(&step_complete.lock);
+		slurm_mutex_unlock(&step_complete.lock);
 		return;
 	}
 
@@ -964,7 +963,7 @@ _send_step_complete_msgs(stepd_step_rec_t *job)
 				       step_complete.rank);
 	}
 
-	pthread_mutex_unlock(&step_complete.lock);
+	slurm_mutex_unlock(&step_complete.lock);
 }
 
 /* This dummy function is provided so that the checkpoint functions can
@@ -992,6 +991,13 @@ static int _spawn_job_container(stepd_step_rec_t *job)
 	int status = 0;
 	pid_t pid;
 
+	debug2("%s: Before call to spank_init()", __func__);
+	if (spank_init(job) < 0) {
+		error("%s: Plugin stack initialization failed.", __func__);
+		return SLURM_PLUGIN_NAME_INVALID;
+	}
+	debug2("%s: After call to spank_init()", __func__);
+
 	set_oom_adj(0);	/* the tasks may be killed by OOM */
 	if (task_g_pre_setuid(job)) {
 		error("%s: Failed to invoke task plugins: one of "
@@ -1030,6 +1036,9 @@ static int _spawn_job_container(stepd_step_rec_t *job)
 	if (!conf->job_acct_gather_freq)
 		jobacct_gather_stat_task(0);
 
+	if (spank_task_post_fork(job, 0) < 0)
+		error("spank extern task post-fork failed");
+
 	while ((wait4(pid, &status, 0, &rusage) < 0) && (errno == EINTR)) {
 		;	       /* Wait until above processs exits from signal */
 	}
@@ -1063,6 +1072,11 @@ static int _spawn_job_container(stepd_step_rec_t *job)
 	 * condition starting another job on these CPUs. */
 	while (_send_pending_exit_msgs(job)) {;}
 
+	debug2("%s: Before call to spank_fini()", __func__);
+	if (spank_fini(job) < 0)
+		error("spank_fini failed");
+	debug2("%s: After call to spank_fini()", __func__);
+
 	return SLURM_SUCCESS;
 }
 
@@ -1247,6 +1261,12 @@ job_manager(stepd_step_rec_t *job)
 	/* Send job launch response with list of pids */
 	_send_launch_resp(job, 0);
 
+#ifdef PR_SET_DUMPABLE
+	/* RHEL6 requires setting "dumpable" flag AGAIN; after euid changes */
+	if (prctl(PR_SET_DUMPABLE, 1) < 0)
+		debug ("Unable to set dumpable to 1");
+#endif /* PR_SET_DUMPABLE */
+
 	_wait_for_all_tasks(job);
 	acct_gather_profile_endpoll();
 	acct_gather_profile_g_node_step_end();
@@ -1643,6 +1663,7 @@ _fork_all_tasks(stepd_step_rec_t *job, bool *io_initialized)
 	/*
 	 * Fork all of the task processes.
 	 */
+	verbose("starting %u tasks", job->node_tasks);
 	for (i = 0; i < job->node_tasks; i++) {
 		char time_stamp[256];
 		pid_t pid;
@@ -1721,9 +1742,9 @@ _fork_all_tasks(stepd_step_rec_t *job, bool *io_initialized)
 		list_append (exec_wait_list, ei);
 
 		log_timestamp(time_stamp, sizeof(time_stamp));
-		verbose ("task %lu (%lu) started %s",
-			 (unsigned long) job->task[i]->gtid,
-			 (unsigned long) pid, time_stamp);
+		verbose("task %lu (%lu) started %s",
+			(unsigned long) job->task[i]->gtid,
+			(unsigned long) pid, time_stamp);
 
 		job->task[i]->pid = pid;
 		if (i == 0)
@@ -1847,12 +1868,13 @@ _send_pending_exit_msgs(stepd_step_rec_t *job)
 	int  nsent  = 0;
 	int  status = 0;
 	bool set    = false;
-	uint32_t  tid[job->node_tasks];
+	uint32_t *tid;
 
 	/*
 	 * Collect all exit codes with the same status into a
 	 * single message.
 	 */
+	tid = xmalloc(sizeof(uint32_t) * job->node_tasks);
 	for (i = 0; i < job->node_tasks; i++) {
 		stepd_step_task_info_t *t = job->task[i];
 
@@ -1873,6 +1895,7 @@ _send_pending_exit_msgs(stepd_step_rec_t *job)
 		debug2("Aggregated %d task exit messages", nsent);
 		_send_exit_msg(job, tid, nsent, status);
 	}
+	xfree(tid);
 
 	return nsent;
 }
@@ -2316,7 +2339,7 @@ _send_complete_batch_script_msg(stepd_step_rec_t *job, int err, int status)
 		msg_to_ctld = 0;
 	else {
 		select_type = slurm_get_select_type();
-		msg_to_ctld = strcmp(select_type, "select/serial");
+		msg_to_ctld = xstrcmp(select_type, "select/serial");
 		xfree(select_type);
 	}
 
@@ -2343,7 +2366,7 @@ _send_complete_batch_script_msg(stepd_step_rec_t *job, int err, int status)
 			 * may get a new job to launch */
 			if (i == 0) {
 				slurm_set_addr_char(&req_msg.address,
-						    conf->port, "localhost");
+						    conf->port, conf->hostname);
 			}
 			msg_rc = slurm_send_recv_rc_msg_only_one(&req_msg,
 								 &rc, 0);
@@ -2604,7 +2627,7 @@ _get_primary_group(const char *user, gid_t *gid)
 	int cc;
 
 	cc = getpwnam_r(user, &pwd, buf, sizeof(buf), &pwd0);
-	if (cc != 0) {
+	if ((cc != 0) || (pwd0 == NULL)) {
 		error("%s: getpwnam_r() failed: %m", __func__);
 		return -1;
 	}
@@ -2795,7 +2818,7 @@ _run_script_as_user(const char *name, const char *path, stepd_step_rec_t *job,
 		while (1) {
 			execve(path, argv, env);
 			error("execve(%s): %m", path);
-			if ((errno == ENFILE) || (errno = ENOMEM)) {
+			if ((errno == ENFILE) || (errno == ENOMEM)) {
 				/* System limit on open files or memory reached,
 				 * retry after short delay */
 				sleep(1);
diff --git a/src/slurmd/slurmstepd/pam_ses.c b/src/slurmd/slurmstepd/pam_ses.c
index 06ef22151..1d83196e1 100644
--- a/src/slurmd/slurmstepd/pam_ses.c
+++ b/src/slurmd/slurmstepd/pam_ses.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/pam_ses.c - functions to manage pam session
- *  $Id: pam_ses.c $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/slurmstepd/pam_ses.h b/src/slurmd/slurmstepd/pam_ses.h
index a5b26e99c..7e7f32de9 100644
--- a/src/slurmd/slurmstepd/pam_ses.h
+++ b/src/slurmd/slurmstepd/pam_ses.h
@@ -1,7 +1,6 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/pam_ses.h - prototypes for functions that manage
  *                                    pam sessions
- *  $Id: pam_ses.h $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/slurmstepd/pdebug.c b/src/slurmd/slurmstepd/pdebug.c
index b0545e67c..e1b4b345a 100644
--- a/src/slurmd/slurmstepd/pdebug.c
+++ b/src/slurmd/slurmstepd/pdebug.c
@@ -56,9 +56,7 @@ pdebug_trace_process(stepd_step_rec_t *job, pid_t pid)
 {
 	/*  If task to be debugged, wait for it to stop via
 	 *  child's ptrace(PTRACE_TRACEME), then SIGSTOP, and
-	 *  ptrace(PTRACE_DETACH). This requires a kernel patch,
-	 *  which you may already have in place for TotalView.
-	 *  If not, apply the kernel patch in contribs/ptrace.patch
+	 *  ptrace(PTRACE_DETACH).
 	 */
 
 	if (job->task_flags & TASK_PARALLEL_DEBUG) {
diff --git a/src/slurmd/slurmstepd/req.c b/src/slurmd/slurmstepd/req.c
index f0ac23e8a..0238ad0c3 100644
--- a/src/slurmd/slurmstepd/req.c
+++ b/src/slurmd/slurmstepd/req.c
@@ -290,12 +290,12 @@ static void _wait_for_connections(void)
 	struct timespec ts = {0, 0};
 	int rc = 0;
 
-	pthread_mutex_lock(&message_lock);
+	slurm_mutex_lock(&message_lock);
 	ts.tv_sec = time(NULL) + STEPD_MESSAGE_COMP_WAIT;
 	while (message_connections > 0 && rc == 0)
 		rc = pthread_cond_timedwait(&message_cond, &message_lock, &ts);
 
-	pthread_mutex_unlock(&message_lock);
+	slurm_mutex_unlock(&message_lock);
 }
 
 static bool
@@ -353,9 +353,9 @@ _msg_socket_accept(eio_obj_t *obj, List objs)
 		return SLURM_SUCCESS;
 	}
 
-	pthread_mutex_lock(&message_lock);
+	slurm_mutex_lock(&message_lock);
 	message_connections++;
-	pthread_mutex_unlock(&message_lock);
+	slurm_mutex_unlock(&message_lock);
 
 	fd_set_close_on_exec(fd);
 	fd_set_blocking(fd);
@@ -454,10 +454,10 @@ _handle_accept(void *arg)
 	if (close(fd) == -1)
 		error("Closing accepted fd: %m");
 
-	pthread_mutex_lock(&message_lock);
+	slurm_mutex_lock(&message_lock);
 	message_connections--;
 	pthread_cond_signal(&message_cond);
-	pthread_mutex_unlock(&message_lock);
+	slurm_mutex_unlock(&message_lock);
 
 	debug3("Leaving  _handle_accept");
 	return NULL;
@@ -701,10 +701,10 @@ _handle_signal_task_local(int fd, stepd_step_rec_t *job, uid_t uid)
 	/*
 	 * Signal the task
 	 */
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (suspended) {
 		rc = ESLURMD_STEP_SUSPENDED;
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	}
 
@@ -718,7 +718,7 @@ _handle_signal_task_local(int fd, stepd_step_rec_t *job, uid_t uid)
 			signal, job->jobid, job->stepid,
 			job->task[ltaskid]->pid);
 	}
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code */
@@ -844,11 +844,11 @@ _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid)
 		job->aborted = true;
 	}
 
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (suspended && (sig != SIGKILL)) {
 		rc = -1;
 		errnum = ESLURMD_STEP_SUSPENDED;
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	}
 
@@ -856,7 +856,7 @@ _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid)
 		int i;
 		for (i = 0; i < job->node_tasks; i++)
 			pdebug_wake_process(job, job->task[i]->pid);
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	}
 
@@ -873,7 +873,7 @@ _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid)
 			      job->jobid, job->stepid);
 			rc = SLURM_ERROR;
 			errnum = errno;
-			pthread_mutex_unlock(&suspend_mutex);
+			slurm_mutex_unlock(&suspend_mutex);
 			goto done;
 		}
 		rc = SLURM_SUCCESS;
@@ -881,7 +881,7 @@ _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid)
 		verbose("%s: sent signal %d to container pid %u job %u.%u",
 			__func__, sig, job->pgid,
 			job->jobid, job->stepid);
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	}
 
@@ -897,7 +897,7 @@ _handle_signal_container(int fd, stepd_step_rec_t *job, uid_t uid)
 		verbose("Sent signal %d to %u.%u",
 			sig, job->jobid, job->stepid);
 	}
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code and errnum */
@@ -954,10 +954,10 @@ _handle_checkpoint_tasks(int fd, stepd_step_rec_t *job, uid_t uid)
 		goto done;
 	}
 
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (suspended) {
 		rc = ESLURMD_STEP_SUSPENDED;
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	}
 
@@ -980,7 +980,7 @@ _handle_checkpoint_tasks(int fd, stepd_step_rec_t *job, uid_t uid)
 			job->jobid, job->stepid);
 	}
 
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code */
@@ -1080,7 +1080,7 @@ _handle_terminate(int fd, stepd_step_rec_t *job, uid_t uid)
 	/*
 	 * Signal the container with SIGKILL
 	 */
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (suspended) {
 		debug("Terminating suspended job step %u.%u",
 		      job->jobid, job->stepid);
@@ -1096,7 +1096,7 @@ _handle_terminate(int fd, stepd_step_rec_t *job, uid_t uid)
 		verbose("Sent SIGKILL signal to %u.%u",
 			job->jobid, job->stepid);
 	}
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code and errnum */
@@ -1419,7 +1419,7 @@ _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid)
 	acct_gather_suspend_poll();
 	if (launch_poe == -1) {
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/poe"))
+		if (!xstrcmp(launch_type, "launch/poe"))
 			launch_poe = 1;
 		else
 			launch_poe = 0;
@@ -1429,11 +1429,11 @@ _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid)
 	/*
 	 * Signal the container
 	 */
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (suspended) {
 		rc = -1;
 		errnum = ESLURMD_STEP_SUSPENDED;
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	} else {
 		if (!job->batch && switch_g_job_step_pre_suspend(job))
@@ -1471,7 +1471,7 @@ _handle_suspend(int fd, stepd_step_rec_t *job, uid_t uid)
 	if (!job->batch && core_spec_g_suspend(job->cont_id, job_core_spec))
 		error("core_spec_g_suspend: %m");
 
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code and errno */
@@ -1514,11 +1514,11 @@ _handle_resume(int fd, stepd_step_rec_t *job, uid_t uid)
 	/*
 	 * Signal the container
 	 */
-	pthread_mutex_lock(&suspend_mutex);
+	slurm_mutex_lock(&suspend_mutex);
 	if (!suspended) {
 		rc = -1;
 		errnum = ESLURMD_STEP_NOTSUSPENDED;
-		pthread_mutex_unlock(&suspend_mutex);
+		slurm_mutex_unlock(&suspend_mutex);
 		goto done;
 	} else {
 		if (!job->batch && switch_g_job_step_pre_resume(job))
@@ -1542,7 +1542,7 @@ _handle_resume(int fd, stepd_step_rec_t *job, uid_t uid)
 		cpu_freq_set(job);
 	}
 
-	pthread_mutex_unlock(&suspend_mutex);
+	slurm_mutex_unlock(&suspend_mutex);
 
 done:
 	/* Send the return code and errno */
@@ -1606,7 +1606,7 @@ _handle_completion(int fd, stepd_step_rec_t *job, uid_t uid)
 	/*
 	 * Record the completed nodes
 	 */
-	pthread_mutex_lock(&step_complete.lock);
+	slurm_mutex_lock(&step_complete.lock);
 	lock_set = true;
 	if (! step_complete.wait_children) {
 		rc = -1;
@@ -1648,14 +1648,14 @@ timeout:
 	safe_write(fd, &rc, sizeof(int));
 	safe_write(fd, &errnum, sizeof(int));
 	pthread_cond_signal(&step_complete.cond);
-	pthread_mutex_unlock(&step_complete.lock);
+	slurm_mutex_unlock(&step_complete.lock);
 
 	return SLURM_SUCCESS;
 
 
 rwfail:	if (lock_set) {
 		pthread_cond_signal(&step_complete.cond);
-		pthread_mutex_unlock(&step_complete.lock);
+		slurm_mutex_unlock(&step_complete.lock);
 	}
 	return SLURM_FAILURE;
 }
diff --git a/src/slurmd/slurmstepd/req.h b/src/slurmd/slurmstepd/req.h
index ef23717d7..59eaa518c 100644
--- a/src/slurmd/slurmstepd/req.h
+++ b/src/slurmd/slurmstepd/req.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/req.h - slurmstepd request handling
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/slurmstepd/slurmstepd.c b/src/slurmd/slurmstepd/slurmstepd.c
index 71297849b..08254071d 100644
--- a/src/slurmd/slurmstepd/slurmstepd.c
+++ b/src/slurmd/slurmstepd/slurmstepd.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/slurmstepd.c - SLURM job-step manager.
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2009 Lawrence Livermore National Security.
@@ -60,6 +59,7 @@
 #include "src/common/switch.h"
 #include "src/common/xmalloc.h"
 #include "src/common/xsignal.h"
+#include "src/common/xstring.h"
 
 #include "src/slurmd/common/core_spec_plugin.h"
 #include "src/slurmd/common/slurmstepd_init.h"
@@ -78,6 +78,7 @@ static int _init_from_slurmd(int sock, char **argv, slurm_addr_t **_cli,
 static void _dump_user_env(void);
 static void _send_ok_to_slurmd(int sock);
 static void _send_fail_to_slurmd(int sock);
+static void _got_ack_from_slurmd(int);
 static stepd_step_rec_t *_step_setup(slurm_addr_t *cli, slurm_addr_t *self,
 				     slurm_msg_t *msg);
 #ifdef MEMORY_LEAK_DEBUG
@@ -121,11 +122,6 @@ main (int argc, char *argv[])
 	_init_from_slurmd(STDIN_FILENO, argv, &cli, &self, &msg,
 			  &ngids, &gids);
 
-	/* Fancy way of closing stdin that keeps STDIN_FILENO from being
-	 * allocated to any random file.  The slurmd already opened /dev/null
-	 * on STDERR_FILENO for us. */
-	dup2(STDERR_FILENO, STDIN_FILENO);
-
 	/* Create the stepd_step_rec_t, mostly from info in a
 	 * launch_tasks_request_msg_t or a batch_job_launch_msg_t */
 	if (!(job = _step_setup(cli, self, msg))) {
@@ -149,6 +145,12 @@ main (int argc, char *argv[])
 	}
 
 	_send_ok_to_slurmd(STDOUT_FILENO);
+	_got_ack_from_slurmd(STDIN_FILENO);
+
+	/* Fancy way of closing stdin that keeps STDIN_FILENO from being
+	 * allocated to any random file.  The slurmd already opened /dev/null
+	 * on STDERR_FILENO for us. */
+	dup2(STDERR_FILENO, STDIN_FILENO);
 
 	/* Fancy way of closing stdout that keeps STDOUT_FILENO from being
 	 * allocated to any random file.  The slurmd already opened /dev/null
@@ -216,6 +218,7 @@ static slurmd_conf_t * read_slurmd_conf_lite (int fd)
 
 	free_buf(buffer);
 
+	confl->log_opts.prefix_level = 1;
 	confl->log_opts.stderr_level = confl->debug_level;
 	confl->log_opts.logfile_level = confl->debug_level;
 	confl->log_opts.syslog_level = confl->debug_level;
@@ -305,11 +308,11 @@ static int _handle_spank_mode (int argc, char *argv[])
 
 	debug("Running spank/%s for jobid [%u] uid [%u]", mode, jobid, uid);
 
-	if (strcmp (mode, "prolog") == 0) {
+	if (xstrcmp (mode, "prolog") == 0) {
 		if (spank_job_prolog (jobid, uid) < 0)
 			return (-1);
 	}
-	else if (strcmp (mode, "epilog") == 0) {
+	else if (xstrcmp (mode, "epilog") == 0) {
 		if (spank_job_epilog (jobid, uid) < 0)
 			return (-1);
 	}
@@ -325,12 +328,12 @@ static int _handle_spank_mode (int argc, char *argv[])
  */
 static int _process_cmdline (int argc, char *argv[])
 {
-	if ((argc == 2) && (strcmp(argv[1], "getenv") == 0)) {
+	if ((argc == 2) && (xstrcmp(argv[1], "getenv") == 0)) {
 		print_rlimits();
 		_dump_user_env();
 		exit(0);
 	}
-	if ((argc == 3) && (strcmp(argv[1], "spank") == 0)) {
+	if ((argc == 3) && (xstrcmp(argv[1], "spank") == 0)) {
 		if (_handle_spank_mode(argc, argv) < 0)
 			exit (1);
 		exit (0);
@@ -371,6 +374,20 @@ rwfail:
 #endif
 }
 
+static void
+_got_ack_from_slurmd(int sock)
+{
+	/* If running under valgrind/memcheck, this pipe doesn't work correctly
+	 * so just skip it. */
+#ifndef SLURMSTEPD_MEMCHECK
+	int ok;
+	safe_read(sock, &ok, sizeof(int));
+	return;
+rwfail:
+	error("Unable to receive \"ok ack\" to slurmd");
+#endif
+}
+
 /*
  *  This function handles the initialization information from slurmd
  *  sent by _send_slurmstepd_init() in src/slurmd/slurmd/req.c.
@@ -400,7 +417,7 @@ _init_from_slurmd(int sock, char **argv,
 	debug3("step_type = %d", step_type);
 
 	/* receive reverse-tree info from slurmd */
-	pthread_mutex_lock(&step_complete.lock);
+	slurm_mutex_lock(&step_complete.lock);
 	safe_read(sock, &step_complete.rank, sizeof(int));
 	safe_read(sock, &step_complete.parent_rank, sizeof(int));
 	safe_read(sock, &step_complete.children, sizeof(int));
@@ -409,7 +426,7 @@ _init_from_slurmd(int sock, char **argv,
 	safe_read(sock, &step_complete.parent_addr, sizeof(slurm_addr_t));
 	step_complete.bits = bit_alloc(step_complete.children);
 	step_complete.jobacct = jobacctinfo_create(NULL);
-	pthread_mutex_unlock(&step_complete.lock);
+	slurm_mutex_unlock(&step_complete.lock);
 
 	/* receive conf from slurmd */
 	if ((conf = read_slurmd_conf_lite (sock)) == NULL)
diff --git a/src/slurmd/slurmstepd/slurmstepd.h b/src/slurmd/slurmstepd/slurmstepd.h
index 522130e51..109e8e148 100644
--- a/src/slurmd/slurmstepd/slurmstepd.h
+++ b/src/slurmd/slurmstepd/slurmstepd.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/slurmstepd.h - slurmstepd general header file
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2005 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/slurmd/slurmstepd/slurmstepd_job.c b/src/slurmd/slurmstepd/slurmstepd_job.c
index cefdfaa1f..531b57527 100644
--- a/src/slurmd/slurmstepd/slurmstepd_job.c
+++ b/src/slurmd/slurmstepd/slurmstepd_job.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/slurmstepd_job.c - stepd_step_rec_t routines
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -70,6 +69,7 @@
 #include "src/slurmd/slurmstepd/fname.h"
 #include "src/slurmd/slurmstepd/multi_prog.h"
 #include "src/slurmd/slurmstepd/slurmstepd_job.h"
+#include "src/slurmd/slurmstepd/task.h"
 
 #ifdef HAVE_NATIVE_CRAY
 static bool already_validated_uid = true;
@@ -161,6 +161,12 @@ _job_init_task_info(stepd_step_rec_t *job, uint32_t **gtid,
 	job->task = (stepd_step_task_info_t **)
 		xmalloc(job->node_tasks * sizeof(stepd_step_task_info_t *));
 
+	if (!job->multi_prog && job->argv) {
+		char *new_path = build_path(job->argv[0], job->env, job->cwd);
+		xfree(job->argv[0]);
+		job->argv[0] = new_path;
+	}
+
 	for (i = 0; i < job->node_tasks; i++) {
 		in = _expand_stdio_filename(ifname, gtid[node_id][i], job);
 		out = _expand_stdio_filename(ofname, gtid[node_id][i], job);
@@ -175,7 +181,7 @@ _job_init_task_info(stepd_step_rec_t *job, uint32_t **gtid,
 
 	if (job->multi_prog) {
 		char *switch_type = slurm_get_switch_type();
-		if (!strcmp(switch_type, "switch/cray"))
+		if (!xstrcmp(switch_type, "switch/cray"))
 			multi_prog_parse(job, gtid);
 		xfree(switch_type);
 		for (i = 0; i < job->node_tasks; i++){
@@ -302,15 +308,20 @@ stepd_step_rec_create(launch_tasks_request_msg_t *msg, uint16_t protocol_version
 	job->array_task_id = NO_VAL;
 	for (i = 0; i < msg->envc; i++) {
 		/*                         1234567890123456789 */
-		if (!strncmp(msg->env[i], "SLURM_ARRAY_JOB_ID=", 19))
+		if (!xstrncmp(msg->env[i], "SLURM_ARRAY_JOB_ID=", 19))
 			job->array_job_id = atoi(msg->env[i] + 19);
 		/*                         12345678901234567890 */
-		if (!strncmp(msg->env[i], "SLURM_ARRAY_TASK_ID=", 20))
+		if (!xstrncmp(msg->env[i], "SLURM_ARRAY_TASK_ID=", 20))
 			job->array_task_id = atoi(msg->env[i] + 20);
 	}
 
 	job->eio     = eio_handle_create(0);
 	job->sruns   = list_create((ListDelF) _srun_info_destructor);
+
+	/* Based on my testing the next 3 lists here could use the
+	 * eio_obj_destroy, but if you do you can get an invalid read.  Since
+	 * these stay until the end of the job it isn't that big of a deal.
+	 */
 	job->clients = list_create(NULL); /* FIXME! Needs destructor */
 	job->stdout_eio_objs = list_create(NULL); /* FIXME! Needs destructor */
 	job->stderr_eio_objs = list_create(NULL); /* FIXME! Needs destructor */
@@ -461,6 +472,15 @@ batch_stepd_step_rec_create(batch_job_launch_msg_t *msg)
 
 	job->batch   = true;
 	job->node_name  = xstrdup(conf->node_name);
+	job->user_name  = xstrdup(msg->user_name);
+	job->uid        = (uid_t) msg->uid;
+	job->gid        = (gid_t) msg->gid;
+
+	job->profile    = msg->profile;
+
+	/* give them all to the 1 task */
+	job->cpus_per_task = job->cpus;
+
 	/* This needs to happen before acct_gather_profile_startpoll
 	   and only really looks at the profile in the job.
 	*/
@@ -473,9 +493,6 @@ batch_stepd_step_rec_create(batch_job_launch_msg_t *msg)
 	job->open_mode  = msg->open_mode;
 	job->overcommit = (bool) msg->overcommit;
 
-	job->uid     = (uid_t) msg->uid;
-	job->user_name  = xstrdup(msg->user_name);
-	job->gid     = (gid_t) msg->gid;
 	job->cwd     = xstrdup(msg->work_dir);
 
 	job->ckpt_dir = xstrdup(msg->ckpt_dir);
@@ -564,7 +581,14 @@ stepd_step_rec_destroy(stepd_step_rec_t *job)
 
 	for (i = 0; i < job->node_tasks; i++)
 		_task_info_destroy(job->task[i], job->multi_prog);
+	eio_handle_destroy(job->eio);
 	FREE_NULL_LIST(job->sruns);
+	FREE_NULL_LIST(job->clients);
+	FREE_NULL_LIST(job->stdout_eio_objs);
+	FREE_NULL_LIST(job->stderr_eio_objs);
+	FREE_NULL_LIST(job->free_incoming);
+	FREE_NULL_LIST(job->free_outgoing);
+	FREE_NULL_LIST(job->outgoing_cache);
 	xfree(job->envtp);
 	xfree(job->node_name);
 	mpmd_free(job);
diff --git a/src/slurmd/slurmstepd/slurmstepd_job.h b/src/slurmd/slurmstepd/slurmstepd_job.h
index f42e824b7..25eefb947 100644
--- a/src/slurmd/slurmstepd/slurmstepd_job.h
+++ b/src/slurmd/slurmstepd/slurmstepd_job.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/slurmd/slurmstepd/slurmstepd_job.h  stepd_step_rec_t definition
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/slurmd/slurmstepd/step_terminate_monitor.c b/src/slurmd/slurmstepd/step_terminate_monitor.c
index df1676548..7518ccdcc 100644
--- a/src/slurmd/slurmstepd/step_terminate_monitor.c
+++ b/src/slurmd/slurmstepd/step_terminate_monitor.c
@@ -61,10 +61,10 @@ void step_terminate_monitor_start(uint32_t jobid, uint32_t stepid)
 	slurm_ctl_conf_t *conf;
 	pthread_attr_t attr;
 
-	pthread_mutex_lock(&lock);
+	slurm_mutex_lock(&lock);
 
 	if (running_flag) {
-		pthread_mutex_unlock(&lock);
+		slurm_mutex_unlock(&lock);
 		return;
 	}
 
@@ -72,7 +72,7 @@ void step_terminate_monitor_start(uint32_t jobid, uint32_t stepid)
 	if (conf->unkillable_program == NULL) {
 		/* do nothing */
 		slurm_conf_unlock();
-		pthread_mutex_unlock(&lock);
+		slurm_mutex_unlock(&lock);
 		return;
 	}
 	timeout = conf->unkillable_timeout;
@@ -86,29 +86,29 @@ void step_terminate_monitor_start(uint32_t jobid, uint32_t stepid)
 	recorded_jobid = jobid;
 	recorded_stepid = stepid;
 
-	pthread_mutex_unlock(&lock);
+	slurm_mutex_unlock(&lock);
 
 	return;
 }
 
 void step_terminate_monitor_stop(void)
 {
-	pthread_mutex_lock(&lock);
+	slurm_mutex_lock(&lock);
 
 	if (!running_flag) {
-		pthread_mutex_unlock(&lock);
+		slurm_mutex_unlock(&lock);
 		return;
 	}
 	if (stop_flag) {
 		error("step_terminate_monitor_stop: already stopped");
-		pthread_mutex_unlock(&lock);
+		slurm_mutex_unlock(&lock);
 		return;
 	}
 
 	stop_flag = 1;
 	debug("step_terminate_monitor_stop signalling condition");
 	pthread_cond_signal(&cond);
-	pthread_mutex_unlock(&lock);
+	slurm_mutex_unlock(&lock);
 
 	if (pthread_join(tid, NULL) != 0) {
 		error("step_terminate_monitor_stop: pthread_join: %m");
@@ -128,7 +128,7 @@ static void *_monitor(void *notused)
 
 	ts.tv_sec = time(NULL) + 1 + timeout;
 
-	pthread_mutex_lock(&lock);
+	slurm_mutex_lock(&lock);
 	if (stop_flag)
 		goto done;
 
@@ -139,7 +139,7 @@ static void *_monitor(void *notused)
 		error("Error waiting on condition in _monitor: %m");
 	}
 done:
-	pthread_mutex_unlock(&lock);
+	slurm_mutex_unlock(&lock);
 
 	info("_monitor is stopping");
 	return NULL;
diff --git a/src/slurmd/slurmstepd/task.c b/src/slurmd/slurmstepd/task.c
index eae10d09e..de1d2e041 100644
--- a/src/slurmd/slurmstepd/task.c
+++ b/src/slurmd/slurmstepd/task.c
@@ -71,6 +71,12 @@
 
 #include <sys/resource.h>
 
+/* FIXME: Come up with a real solution for EUID instead of substituting RUID */
+#if defined(__NetBSD__)
+#define eaccess(p,m) (access((p),(m)))
+#define HAVE_EACCESS 1
+#endif
+
 #include "slurm/slurm_errno.h"
 
 #include "src/common/checkpoint.h"
@@ -121,13 +127,13 @@ static void _proc_stdout(char *buf, stepd_step_rec_t *job)
 			end_line = buf_ptr + strlen(buf_ptr);
 			end_buf = true;
 		}
-		if (!strncmp(buf_ptr, "print ", 6)) {
+		if (!xstrncmp(buf_ptr, "print ", 6)) {
 			buf_ptr += 6;
 			while (isspace(buf_ptr[0]))
 				buf_ptr++;
 			len = end_line - buf_ptr + 1;
 			safe_write(1, buf_ptr, len);
-		} else if (!strncmp(buf_ptr, "export ",7)) {
+		} else if (!xstrncmp(buf_ptr, "export ",7)) {
 			name_ptr = buf_ptr + 7;
 			while (isspace(name_ptr[0]))
 				name_ptr++;
@@ -139,7 +145,7 @@ static void _proc_stdout(char *buf, stepd_step_rec_t *job)
 				equal_ptr--;
 			equal_ptr[0] = '\0';
 			end_line[0] = '\0';
-			if (!strcmp(name_ptr, "SLURM_PROLOG_CPU_MASK")) {
+			if (!xstrcmp(name_ptr, "SLURM_PROLOG_CPU_MASK")) {
 				job->cpu_bind_type = CPU_BIND_MASK;
 				xfree(job->cpu_bind);
 				job->cpu_bind = xstrdup(val_ptr);
@@ -159,7 +165,7 @@ static void _proc_stdout(char *buf, stepd_step_rec_t *job)
 				end_line[0] = '\0';
 			else
 				end_line[0] = '\n';
-		} else if (!strncmp(buf_ptr, "unset ", 6)) {
+		} else if (!xstrncmp(buf_ptr, "unset ", 6)) {
 			name_ptr = buf_ptr + 6;
 			while (isspace(name_ptr[0]))
 				name_ptr++;
@@ -247,7 +253,7 @@ _run_script_and_set_env(const char *name, const char *path,
 	close(pfd[1]);
 	f = fdopen(pfd[0], "r");
 	if (f == NULL) {
-		error("Cannot open pipe device");
+		error("Cannot open pipe device: %m");
 		log_fini();
 		exit(1);
 	}
@@ -274,10 +280,9 @@ _run_script_and_set_env(const char *name, const char *path,
 	/* NOTREACHED */
 }
 
-/* Given a program name, translate it to a fully qualified pathname
- * as needed based upon the PATH environment variable */
-static char *
-_build_path(char* fname, char **prog_env)
+/* Given a program name, translate it to a fully qualified pathname as needed
+ * based upon the PATH environment variable and current working directory */
+extern char *build_path(char* fname, char **prog_env, char *cwd)
 {
 	int i;
 	char *path_env = NULL, *dir;
@@ -288,7 +293,7 @@ _build_path(char* fname, char **prog_env)
 	file_name = (char *)xmalloc(len);
 	/* make copy of file name (end at white space) */
 	snprintf(file_name, len, "%s", fname);
-	for (i=0; i < len; i++) {
+	for (i = 0; i < len; i++) {
 		if (file_name[i] == '\0')
 			break;
 		if (!isspace(file_name[i]))
@@ -302,20 +307,24 @@ _build_path(char* fname, char **prog_env)
 		return file_name;
 	if (file_name[0] == '.') {
 		file_path = (char *)xmalloc(len);
-		dir = (char *)xmalloc(len);
-		if (!getcwd(dir, len))
-			error("getcwd failed: %m");
-		snprintf(file_path, len, "%s/%s", dir, file_name);
+		if (cwd) {
+			snprintf(file_path, len, "%s/%s", cwd, file_name);
+		} else {
+			dir = (char *)xmalloc(len);
+			if (!getcwd(dir, len))
+				error("getcwd failed: %m");
+			snprintf(file_path, len, "%s/%s", dir, file_name);
+			xfree(dir);
+		}
 		xfree(file_name);
-		xfree(dir);
 		return file_path;
 	}
 
 	/* search for the file using PATH environment variable */
-	for (i=0; ; i++) {
+	for (i = 0; ; i++) {
 		if (prog_env[i] == NULL)
 			return file_name;
-		if (strncmp(prog_env[i], "PATH=", 5))
+		if (xstrncmp(prog_env[i], "PATH=", 5))
 			continue;
 		path_env = xstrdup(&prog_env[i][5]);
 		break;
@@ -420,7 +429,7 @@ exec_task(stepd_step_rec_t *job, int i)
 		 * is left up to the server to search the PATH for the
 		 * executable.
 		 */
-		task->argv[0] = _build_path(task->argv[0], job->env);
+		task->argv[0] = build_path(task->argv[0], job->env, NULL);
 	}
 
 	if (!job->batch) {
@@ -443,7 +452,7 @@ exec_task(stepd_step_rec_t *job, int i)
 
 	/* task plugin hook */
 	if (task_g_pre_launch(job)) {
-		error("Failed to invoke task plugins: one of task_p_pre_launch functions returned error");
+		error("Failed to invoke task plugins: task_p_pre_launch error");
 		exit(1);
 	}
 	if (!job->batch && job->accel_bind_type) {
@@ -458,9 +467,9 @@ exec_task(stepd_step_rec_t *job, int i)
 		env_array_free(tmp_env);
 	}
 
-	if (spank_user_task (job, i) < 0) {
-		error ("Failed to invoke spank plugin stack");
-		exit (1);
+	if (spank_user_task(job, i) < 0) {
+		error("Failed to invoke spank plugin stack");
+		exit(1);
 	}
 
 	if (conf->task_prolog) {
@@ -518,7 +527,7 @@ exec_task(stepd_step_rec_t *job, int i)
 		char buf[256], *eol;
 		int sz;
 		sz = read(fd, buf, sizeof(buf));
-		if ((sz >= 3) && (strncmp(buf, "#!", 2) == 0)) {
+		if ((sz >= 3) && (xstrncmp(buf, "#!", 2) == 0)) {
 			eol = strchr(buf, '\n');
 			if (eol)
 				eol[0] = '\0';
diff --git a/src/slurmd/slurmstepd/task.h b/src/slurmd/slurmstepd/task.h
index 388b1e9dd..b0e1e9ca2 100644
--- a/src/slurmd/slurmstepd/task.h
+++ b/src/slurmd/slurmstepd/task.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/task.h - task launching functions for slurmstepd
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -54,4 +53,8 @@
 
 void exec_task(stepd_step_rec_t *job, int i);
 
+/* Given a program name, translate it to a fully qualified pathname as needed
+ * based upon the PATH environment variable and current working directory */
+extern char *build_path(char* fname, char **prog_env, char *cwd);
+
 #endif /* !_TASK_H */
diff --git a/src/slurmd/slurmstepd/ulimits.c b/src/slurmd/slurmstepd/ulimits.c
index da3a69818..f904c6fc7 100644
--- a/src/slurmd/slurmstepd/ulimits.c
+++ b/src/slurmd/slurmstepd/ulimits.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/slurmd/slurmstepd/ulimits.c - set user limits for job
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -192,7 +191,6 @@ set_umask(stepd_step_rec_t *job)
 	}
 
 	mask = strtol(val, (char **)NULL, 8);
-	unsetenvp(job->env, "SLURM_UMASK");
 	umask(mask);
 	return SLURM_SUCCESS;
 }
diff --git a/src/slurmdbd/Makefile.am b/src/slurmdbd/Makefile.am
index 42f3474a4..86dac9a10 100644
--- a/src/slurmdbd/Makefile.am
+++ b/src/slurmdbd/Makefile.am
@@ -14,8 +14,6 @@ slurmdbd_LDADD = 					\
 
 
 slurmdbd_SOURCES = 		\
-	agent.c			\
-	agent.h			\
 	backup.c		\
 	backup.h		\
 	proc_req.c		\
diff --git a/src/slurmdbd/Makefile.in b/src/slurmdbd/Makefile.in
index e3f2d7daf..bd6aa0a06 100644
--- a/src/slurmdbd/Makefile.in
+++ b/src/slurmdbd/Makefile.in
@@ -95,7 +95,8 @@ target_triplet = @target@
 sbin_PROGRAMS = slurmdbd$(EXEEXT)
 subdir = src/slurmdbd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -108,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -121,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -128,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -136,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -147,9 +148,8 @@ CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
 am__installdirs = "$(DESTDIR)$(sbindir)"
 PROGRAMS = $(sbin_PROGRAMS)
-am_slurmdbd_OBJECTS = agent.$(OBJEXT) backup.$(OBJEXT) \
-	proc_req.$(OBJEXT) read_config.$(OBJEXT) rpc_mgr.$(OBJEXT) \
-	slurmdbd.$(OBJEXT)
+am_slurmdbd_OBJECTS = backup.$(OBJEXT) proc_req.$(OBJEXT) \
+	read_config.$(OBJEXT) rpc_mgr.$(OBJEXT) slurmdbd.$(OBJEXT)
 slurmdbd_OBJECTS = $(am_slurmdbd_OBJECTS)
 am__DEPENDENCIES_1 =
 slurmdbd_DEPENDENCIES = $(top_builddir)/src/common/libdaemonize.la \
@@ -227,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -328,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -366,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -409,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -459,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -479,8 +488,6 @@ slurmdbd_LDADD = \
 	$(top_builddir)/src/api/libslurm.o $(DL_LIBS)
 
 slurmdbd_SOURCES = \
-	agent.c			\
-	agent.h			\
 	backup.c		\
 	backup.h		\
 	proc_req.c		\
@@ -586,7 +593,6 @@ mostlyclean-compile:
 distclean-compile:
 	-rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agent.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backup.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/proc_req.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_config.Po@am__quote@
diff --git a/src/slurmdbd/proc_req.c b/src/slurmdbd/proc_req.c
index 40308d1c9..bfa7d020e 100644
--- a/src/slurmdbd/proc_req.c
+++ b/src/slurmdbd/proc_req.c
@@ -180,6 +180,8 @@ static int   _step_complete(slurmdbd_conn_t *slurmdbd_conn,
 			    Buf in_buffer, Buf *out_buffer, uint32_t *uid);
 static int   _step_start(slurmdbd_conn_t *slurmdbd_conn,
 			 Buf in_buffer, Buf *out_buffer, uint32_t *uid);
+static int   _fix_lost_jobs(slurmdbd_conn_t *slurmdbd_conn, Buf in_buffer,
+			    Buf *out_buffer, uint32_t *uid);
 
 /* Process an incoming RPC
  * slurmdbd_conn IN/OUT - in will that the newsockfd set before
@@ -464,6 +466,10 @@ proc_req(slurmdbd_conn_t *slurmdbd_conn,
 			rc = _step_start(slurmdbd_conn,
 					 in_buffer, out_buffer, uid);
 			break;
+		case DBD_FIX_LOST_JOB:
+			rc = _fix_lost_jobs(slurmdbd_conn,
+					    in_buffer, out_buffer, uid);
+			break;
 		default:
 			comment = "Invalid RPC";
 			error("CONN:%u %s msg_type=%d",
@@ -562,6 +568,34 @@ end_it:
 				      rc, comment, DBD_ADD_ACCOUNTS);
 	return rc;
 }
+
+static int _fix_lost_jobs(slurmdbd_conn_t *slurmdbd_conn, Buf in_buffer,
+			  Buf *out_buffer, uint32_t *uid)
+{
+	int rc = SLURM_SUCCESS;
+	dbd_list_msg_t *get_msg = NULL;
+	char *comment = NULL;
+
+	if (slurmdbd_unpack_list_msg(&get_msg, slurmdbd_conn->rpc_version,
+				     DBD_FIX_LOST_JOB, in_buffer) !=
+	    SLURM_SUCCESS) {
+		comment = "Failed to unpack DBD_LOST_JOBS message";
+		error("CONN:%u %s", slurmdbd_conn->newsockfd, comment);
+		rc = SLURM_ERROR;
+		goto end_it;
+	}
+
+	rc = acct_storage_g_fix_lost_jobs(slurmdbd_conn->db_conn, *uid,
+					  get_msg->my_list);
+
+end_it:
+	slurmdbd_free_list_msg(get_msg);
+	*out_buffer = make_dbd_rc_msg(slurmdbd_conn->rpc_version,
+				      rc, comment, DBD_FIX_LOST_JOB);
+
+	return rc;
+}
+
 static int _add_account_coords(slurmdbd_conn_t *slurmdbd_conn,
 			       Buf in_buffer, Buf *out_buffer, uint32_t *uid)
 {
@@ -681,7 +715,7 @@ static int _add_assocs(slurmdbd_conn_t *slurmdbd_conn,
 				account = object->parent_acct;
 			list_iterator_reset(itr2);
 			while ((coord = list_next(itr2))) {
-				if (!strcasecmp(coord->name, account))
+				if (!xstrcasecmp(coord->name, account))
 					break;
 			}
 			if (!coord)
@@ -1252,7 +1286,7 @@ static int _get_config(slurmdbd_conn_t *slurmdbd_conn,
 	}
 
 	if (config_name == NULL ||
-	    strcmp(config_name, "slurmdbd.conf") == 0)
+	    xstrcmp(config_name, "slurmdbd.conf") == 0)
 		list_msg.my_list = dump_config();
 	else if ((list_msg.my_list = acct_storage_g_get_config(
 			slurmdbd_conn->db_conn, config_name)) == NULL) {
diff --git a/src/slurmdbd/read_config.c b/src/slurmdbd/read_config.c
index 22a76b05e..378157ce9 100644
--- a/src/slurmdbd/read_config.c
+++ b/src/slurmdbd/read_config.c
@@ -171,6 +171,7 @@ extern int read_slurmdbd_conf(void)
 		{"StoragePort", S_P_UINT16},
 		{"StorageType", S_P_STRING},
 		{"StorageUser", S_P_STRING},
+		{"TCPTimeout", S_P_UINT16},
 		{"TrackWCKey", S_P_BOOLEAN},
 		{"TrackSlurmctldDown", S_P_BOOLEAN},
 		{NULL} };
@@ -417,6 +418,10 @@ extern int read_slurmdbd_conf(void)
 		s_p_get_string(&slurmdbd_conf->storage_user,
 			       "StorageUser", tbl);
 
+		if (!s_p_get_uint16(&slurmdbd_conf->tcp_timeout,
+				    "TCPTimeout", tbl))
+			slurmdbd_conf->tcp_timeout = DEFAULT_TCP_TIMEOUT;
+
 		if (!s_p_get_boolean((bool *)&slurmdbd_conf->track_wckey,
 				     "TrackWCKey", tbl))
 			slurmdbd_conf->track_wckey = false;
@@ -470,8 +475,8 @@ extern int read_slurmdbd_conf(void)
 
 	if (slurmdbd_conf->storage_type == NULL)
 		fatal("StorageType must be specified");
-	if (!strcmp(slurmdbd_conf->storage_type,
-		    "accounting_storage/slurmdbd")) {
+	if (!xstrcmp(slurmdbd_conf->storage_type,
+		     "accounting_storage/slurmdbd")) {
 		fatal("StorageType=%s is invalid in slurmdbd.conf",
 		      slurmdbd_conf->storage_type);
 	}
@@ -482,8 +487,8 @@ extern int read_slurmdbd_conf(void)
 	if (!slurmdbd_conf->storage_user)
 		slurmdbd_conf->storage_user = xstrdup(getlogin());
 
-	if (!strcmp(slurmdbd_conf->storage_type,
-		    "accounting_storage/mysql")) {
+	if (!xstrcmp(slurmdbd_conf->storage_type,
+		     "accounting_storage/mysql")) {
 		if (!slurmdbd_conf->storage_port)
 			slurmdbd_conf->storage_port = DEFAULT_MYSQL_PORT;
 		if (!slurmdbd_conf->storage_loc)
@@ -600,6 +605,8 @@ extern void log_config(void)
 	debug2("StorageType       = %s", slurmdbd_conf->storage_type);
 	debug2("StorageUser       = %s", slurmdbd_conf->storage_user);
 
+	debug2("TCPTimeout        = %u", slurmdbd_conf->tcp_timeout);
+
 	debug2("TrackWCKey        = %u", slurmdbd_conf->track_wckey);
 	debug2("TrackSlurmctldDown= %u", slurmdbd_conf->track_ctld);
 }
@@ -860,6 +867,11 @@ extern List dump_config(void)
 	key_pair->value = xstrdup(slurmdbd_conf->storage_user);
 	list_append(my_list, key_pair);
 
+	key_pair = xmalloc(sizeof(config_key_pair_t));
+	key_pair->name = xstrdup("TCPTimeout");
+	key_pair->value = xstrdup_printf("%u secs", slurmdbd_conf->tcp_timeout);
+	list_append(my_list, key_pair);
+
 	key_pair = xmalloc(sizeof(config_key_pair_t));
 	key_pair->name = xstrdup("TrackWCKey");
 	key_pair->value = xstrdup(slurmdbd_conf->track_wckey ? "Yes" : "No");
diff --git a/src/slurmdbd/read_config.h b/src/slurmdbd/read_config.h
index aafe1e3ac..c80b52067 100644
--- a/src/slurmdbd/read_config.h
+++ b/src/slurmdbd/read_config.h
@@ -111,6 +111,7 @@ typedef struct slurm_dbd_conf {
 	uint16_t        track_wckey;    /* Whether or not to track wckey*/
 	uint16_t        track_ctld;     /* Whether or not track when a
 					 * slurmctld goes down or not   */
+	uint16_t        tcp_timeout;    /* tcp timeout			*/
 } slurm_dbd_conf_t;
 
 extern pthread_mutex_t conf_mutex;
diff --git a/src/slurmdbd/rpc_mgr.c b/src/slurmdbd/rpc_mgr.c
index f449c063c..567bf8e79 100644
--- a/src/slurmdbd/rpc_mgr.c
+++ b/src/slurmdbd/rpc_mgr.c
@@ -246,7 +246,16 @@ static void * _service_connection(void *arg)
 			fini = true;
 		}
 
-		(void) _send_resp(conn->newsockfd, buffer);
+		if (_send_resp(conn->newsockfd, buffer) != SLURM_SUCCESS) {
+			/* This is only an issue on persistent connections, and
+			 * really isn't that big of a deal as the slurmctld
+			 * will just send the message again. */
+			if (conn->ctld_port)
+				debug("Problem sending response to "
+				      "connection %d(%s) uid(%d)",
+				      conn->newsockfd, conn->ip, uid);
+			fini = true;
+		}
 		xfree(msg);
 	}
 
diff --git a/src/slurmdbd/slurmdbd.c b/src/slurmdbd/slurmdbd.c
index 3d9d6dd56..02d68733f 100644
--- a/src/slurmdbd/slurmdbd.c
+++ b/src/slurmdbd/slurmdbd.c
@@ -93,6 +93,9 @@ static pthread_t commit_handler_thread;	/* thread ID for commit hander */
 static pthread_mutex_t rollup_lock = PTHREAD_MUTEX_INITIALIZER;
 static bool running_rollup = 0;
 static bool running_commit = 0;
+static bool restart_backup = false;
+static bool reset_lft_rgt = 0;
+static List lft_rgt_list = NULL;
 
 /* Local functions */
 static void  _become_slurm_user(void);
@@ -113,12 +116,14 @@ static void *_signal_handler(void *no_data);
 static void  _update_logging(bool startup);
 static void  _update_nice(void);
 static void  _usage(char *prog_name);
+static void  _restart_self(int argc, char **argv);
 
 /* main - slurmctld main function, start various threads and process RPCs */
 int main(int argc, char *argv[])
 {
 	pthread_attr_t thread_attr;
-	char node_name[128];
+	char node_name_short[128];
+	char node_name_long[128];
 	void *db_conn = NULL;
 	assoc_init_args_t assoc_init_arg;
 
@@ -195,13 +200,28 @@ int main(int argc, char *argv[])
 		goto end_it;
 	}
 
-	if (gethostname_short(node_name, sizeof(node_name)))
+	if (reset_lft_rgt) {
+		int rc;
+		if ((rc = acct_storage_g_reset_lft_rgt(
+			     db_conn, slurmdbd_conf->slurm_user_id,
+			     lft_rgt_list)) != SLURM_SUCCESS)
+			fatal("Error when trying to reset lft and rgt's");
+
+		if (acct_storage_g_commit(db_conn, 1))
+			fatal("commit failed, meaning reset failed");
+		FREE_NULL_LIST(lft_rgt_list);
+	}
+
+	if (gethostname(node_name_long, sizeof(node_name_long)))
 		fatal("getnodename: %m");
+	if (gethostname_short(node_name_short, sizeof(node_name_short)))
+		fatal("getnodename_short: %m");
 
 	while (1) {
 		if (slurmdbd_conf->dbd_backup &&
-		    (!strcmp(node_name, slurmdbd_conf->dbd_backup) ||
-		     !strcmp(slurmdbd_conf->dbd_backup, "localhost"))) {
+		    (!xstrcmp(node_name_short, slurmdbd_conf->dbd_backup) ||
+		     !xstrcmp(node_name_long, slurmdbd_conf->dbd_backup) ||
+		     !xstrcmp(slurmdbd_conf->dbd_backup, "localhost"))) {
 			info("slurmdbd running in background mode");
 			have_control = false;
 			backup = true;
@@ -211,14 +231,16 @@ int main(int argc, char *argv[])
 			if (!shutdown_time)
 				assoc_mgr_refresh_lists(db_conn, 0);
 		} else if (slurmdbd_conf->dbd_host &&
-			   (!strcmp(slurmdbd_conf->dbd_host, node_name) ||
-			    !strcmp(slurmdbd_conf->dbd_host, "localhost"))) {
+			   (!xstrcmp(slurmdbd_conf->dbd_host, node_name_short)||
+			    !xstrcmp(slurmdbd_conf->dbd_host, node_name_long) ||
+			    !xstrcmp(slurmdbd_conf->dbd_host, "localhost"))) {
 			backup = false;
 			have_control = true;
 		} else {
 			fatal("This host not configured to run SlurmDBD "
-			      "(%s != %s | (backup) %s)",
-			      node_name, slurmdbd_conf->dbd_host,
+			      "((%s or %s) != %s | (backup) %s)",
+			      node_name_short, node_name_long,
+			      slurmdbd_conf->dbd_host,
 			      slurmdbd_conf->dbd_backup);
 		}
 
@@ -259,7 +281,7 @@ int main(int argc, char *argv[])
 		if (rpc_handler_thread)
 			pthread_join(rpc_handler_thread, NULL);
 
-		if (backup && primary_resumed) {
+		if (backup && primary_resumed && !restart_backup) {
 			shutdown_time = 0;
 			info("Backup has given up control");
 		}
@@ -271,7 +293,7 @@ int main(int argc, char *argv[])
 
 end_it:
 
-	if (signal_handler_thread)
+	if (signal_handler_thread && (!backup || !restart_backup))
 		pthread_join(signal_handler_thread, NULL);
 	if (commit_handler_thread)
 		pthread_join(commit_handler_thread, NULL);
@@ -287,6 +309,13 @@ end_it:
 
 	FREE_NULL_LIST(registered_clusters);
 
+	if (backup && restart_backup) {
+		info("Primary has come back but backup is "
+		     "running the rollup. To avoid contention, "
+		     "the backup dbd will now restart.");
+		_restart_self(argc, argv);
+	}
+
 	assoc_mgr_fini(NULL);
 	slurm_acct_storage_fini();
 	slurm_auth_fini();
@@ -353,7 +382,7 @@ static void _parse_commandline(int argc, char *argv[])
 	char *tmp_char;
 
 	opterr = 0;
-	while ((c = getopt(argc, argv, "Dhn:vV")) != -1)
+	while ((c = getopt(argc, argv, "Dhn:R::vV")) != -1)
 		switch (c) {
 		case 'D':
 			foreground = 1;
@@ -363,6 +392,8 @@ static void _parse_commandline(int argc, char *argv[])
 			exit(0);
 			break;
 		case 'n':
+			if (!optarg) /* CLANG fix */
+				break;
 			new_nice = strtol(optarg, &tmp_char, 10);
 			if (tmp_char[0] != '\0') {
 				error("Invalid option for -n option (nice "
@@ -370,6 +401,13 @@ static void _parse_commandline(int argc, char *argv[])
 				new_nice = 0;
 			}
 			break;
+		case 'R':
+			reset_lft_rgt = 1;
+			if (optarg) {
+				lft_rgt_list = list_create(slurm_destroy_char);
+				slurm_addto_char_list(lft_rgt_list, optarg);
+			}
+			break;
 		case 'v':
 			debug_level++;
 			break;
@@ -394,6 +432,12 @@ static void _usage(char *prog_name)
 		"Print this help message.\n");
 	fprintf(stderr, "  -n value   \t"
 		"Run the daemon at the specified nice value.\n");
+	fprintf(stderr, "  -R [Names] \t"
+		"Reset the lft and rgt values of the associations "
+		"\n\t\tin the given cluster list. "
+		"\n\t\tLft and rgt values are used to distinguish "
+		"\n\t\thierarical groups in the slurm accounting database.  "
+		"\n\t\tThis option should be very rarely used.\n");
 	fprintf(stderr, "  -v         \t"
 		"Verbose mode. Multiple -v's increase verbosity.\n");
 	fprintf(stderr, "  -V         \t"
@@ -557,12 +601,23 @@ static void _request_registrations(void *db_conn)
 
 static void _rollup_handler_cancel()
 {
-	if (running_rollup)
-		debug("Waiting for rollup thread to finish.");
-	slurm_mutex_lock(&rollup_lock);
-	if (rollup_handler_thread)
-		pthread_cancel(rollup_handler_thread);
-	slurm_mutex_unlock(&rollup_lock);
+	if (running_rollup) {
+		if (backup && running_rollup && primary_resumed)
+			debug("Hard cancelling rollup thread");
+		else
+			debug("Waiting for rollup thread to finish.");
+	}
+
+	if (rollup_handler_thread) {
+		if (backup && running_rollup && primary_resumed) {
+			pthread_cancel(rollup_handler_thread);
+			restart_backup = true;
+		} else {
+			slurm_mutex_lock(&rollup_lock);
+			pthread_cancel(rollup_handler_thread);
+			slurm_mutex_unlock(&rollup_lock);
+		}
+	}
 }
 
 /* _rollup_handler - Process rollup duties */
@@ -806,3 +861,10 @@ static void _become_slurm_user(void)
 		      slurmdbd_conf->slurm_user_id);
 	}
 }
+
+extern void _restart_self(int argc, char **argv)
+{
+	info("Restarting self");
+	if (execvp(argv[0], argv))
+		fatal("failed to restart the dbd: %m");
+}
diff --git a/src/smap/Makefile.am b/src/smap/Makefile.am
index 4d9f7e0bd..753334337 100644
--- a/src/smap/Makefile.am
+++ b/src/smap/Makefile.am
@@ -6,7 +6,6 @@
 
 AUTOMAKE_OPTIONS = foreign
 
-LIBS=$(NCURSES)
 AM_CPPFLAGS = -I$(top_srcdir) $(BG_INCLUDES)
 
 if BUILD_SMAP
@@ -18,7 +17,7 @@ smap_SOURCES = smap.c \
 	job_functions.c partition_functions.c \
 	grid_functions.c reservation_functions.c opts.c
 
-smap_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS)
+smap_LDADD = $(top_builddir)/src/api/libslurm.o $(DL_LIBS) $(NCURSES)
 
 if BLUEGENE_LOADED
 bg_dir = $(top_builddir)/src/plugins/select/bluegene
diff --git a/src/smap/Makefile.in b/src/smap/Makefile.in
index f17e3cc6d..63c0d91ee 100644
--- a/src/smap/Makefile.in
+++ b/src/smap/Makefile.in
@@ -101,7 +101,8 @@ target_triplet = @target@
 @BLUEGENE_LOADED_TRUE@@BUILD_SMAP_TRUE@am__append_2 = configure_functions.c
 subdir = src/smap
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -114,7 +115,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -127,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -134,6 +135,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -142,7 +144,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -171,7 +172,8 @@ smap_OBJECTS = $(am_smap_OBJECTS)
 am__DEPENDENCIES_1 =
 @BUILD_SMAP_TRUE@smap_DEPENDENCIES =  \
 @BUILD_SMAP_TRUE@	$(top_builddir)/src/api/libslurm.o \
-@BUILD_SMAP_TRUE@	$(am__DEPENDENCIES_1) $(am__append_1)
+@BUILD_SMAP_TRUE@	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@BUILD_SMAP_TRUE@	$(am__append_1)
 AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
@@ -247,8 +249,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -342,12 +342,16 @@ LDFLAGS = @LDFLAGS@
 LIBCURL = @LIBCURL@
 LIBCURL_CPPFLAGS = @LIBCURL_CPPFLAGS@
 LIBOBJS = @LIBOBJS@
-LIBS = $(NCURSES)
+LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
 LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -386,6 +390,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -429,6 +436,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -479,6 +489,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -499,7 +510,7 @@ AM_CPPFLAGS = -I$(top_srcdir) $(BG_INCLUDES)
 @BUILD_SMAP_TRUE@	reservation_functions.c opts.c \
 @BUILD_SMAP_TRUE@	$(am__append_2)
 @BUILD_SMAP_TRUE@smap_LDADD = $(top_builddir)/src/api/libslurm.o \
-@BUILD_SMAP_TRUE@	$(DL_LIBS) $(am__append_1)
+@BUILD_SMAP_TRUE@	$(DL_LIBS) $(NCURSES) $(am__append_1)
 @BLUEGENE_LOADED_TRUE@@BUILD_SMAP_TRUE@bg_dir = $(top_builddir)/src/plugins/select/bluegene
 @BUILD_SMAP_TRUE@smap_LDFLAGS = -export-dynamic $(CMD_LDFLAGS)
 @BUILD_SMAP_FALSE@EXTRA_smap_SOURCES = smap.h smap.c \
diff --git a/src/smap/configure_functions.c b/src/smap/configure_functions.c
index c01e432dd..6edcb291b 100644
--- a/src/smap/configure_functions.c
+++ b/src/smap/configure_functions.c
@@ -161,7 +161,7 @@ static int _full_request(select_ba_request_t *request,
 	allocated_block_t *allocated_block;
 	int rc = 1;
 
-	if (!strcasecmp(layout_mode,"OVERLAP"))
+	if (!xstrcasecmp(layout_mode,"OVERLAP"))
 		bg_configure_reset_ba_system(true);
 
 	if (usable_mp_bitmap)
@@ -369,7 +369,7 @@ static int _create_allocation(char *com, List allocated_blocks)
 				request->deny_pass |= PASS_DENY_Y;
 			if (strstr(com+i, "Z"))
 				request->deny_pass |= PASS_DENY_Z;
-			if (!strcasecmp(com+i, "ALL"))
+			if (!xstrcasecmp(com+i, "ALL"))
 				request->deny_pass |= PASS_DENY_ALL;
 		} else if (!strncasecmp(com+i, "nodecard", 8)) {
 			small32 = 0;
@@ -1200,7 +1200,7 @@ static int _load_configuration(char *com, List allocated_blocks)
 		xfree(layout);
 	}
 
-	if (strcasecmp(layout_mode, "DYNAMIC")) {
+	if (xstrcasecmp(layout_mode, "DYNAMIC")) {
 		if (!s_p_get_array((void ***)&blockreq_array,
 				   &count, "MPs", tbl)) {
 			if (!s_p_get_array((void ***)&blockreq_array,
@@ -1389,7 +1389,7 @@ void get_command(void)
 
 	if (working_cluster_rec) {
 		char *cluster_name = slurm_get_cluster_name();
-		if (strcmp(working_cluster_rec->name, cluster_name)) {
+		if (xstrcmp(working_cluster_rec->name, cluster_name)) {
 			xfree(cluster_name);
 			endwin();
 			printf("To use the configure option you must be on the "
@@ -1423,7 +1423,7 @@ void get_command(void)
 		echo();
 	}
 
-	while (strcmp(com, "quit")) {
+	while (xstrcmp(com, "quit")) {
 		clear_window(grid_win);
 		print_grid();
 		clear_window(text_win);
@@ -1479,7 +1479,7 @@ void get_command(void)
 		wmove(command_win, 1, 1);
 		wgetstr(command_win, com);
 
-		if (!strcmp(com, "exit")) {
+		if (!xstrcmp(com, "exit")) {
 			endwin();
 			FREE_NULL_LIST(allocated_blocks);
 			bg_configure_ba_fini();
@@ -1487,7 +1487,7 @@ void get_command(void)
 		}
 	run_command:
 
-		if (!strcmp(com, "quit") || !strcmp(com, "\\q")) {
+		if (!xstrcmp(com, "quit") || !xstrcmp(com, "\\q")) {
 			break;
 		} else if (!strncasecmp(com, "layout", 6)) {
 			_set_layout(com);
diff --git a/src/smap/job_functions.c b/src/smap/job_functions.c
index d78606c74..3348985ea 100644
--- a/src/smap/job_functions.c
+++ b/src/smap/job_functions.c
@@ -299,7 +299,7 @@ static int _print_text_job(job_info_t * job_ptr)
 		select_g_select_jobinfo_get(job_ptr->select_jobinfo,
 					    SELECT_JOBDATA_NODE_CNT,
 					    &node_cnt);
-		if (!strcasecmp(job_ptr->nodes,"waiting..."))
+		if (!xstrcasecmp(job_ptr->nodes,"waiting..."))
 			xfree(ionodes);
 	} else
 		node_cnt = job_ptr->num_nodes;
@@ -308,9 +308,8 @@ static int _print_text_job(job_info_t * job_ptr)
 		node_cnt = job_ptr->num_nodes;
 
 	if (params.cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)node_cnt, tmp_cnt,
-				 sizeof(tmp_cnt), UNIT_NONE,
-				 CONVERT_NUM_UNIT_EXACT);
+		convert_num_unit((float)node_cnt, tmp_cnt, sizeof(tmp_cnt),
+				 UNIT_NONE, NO_VAL, CONVERT_NUM_UNIT_EXACT);
 	else
 		snprintf(tmp_cnt, sizeof(tmp_cnt), "%d", node_cnt);
 
@@ -366,7 +365,7 @@ static int _print_text_job(job_info_t * job_ptr)
 			  main_xcord, "%.2s",
 			  job_state_string_compact(job_ptr->job_state));
 		main_xcord += 2;
-		if (!strcasecmp(job_ptr->nodes,"waiting...")) {
+		if (!xstrcasecmp(job_ptr->nodes,"waiting...")) {
 			sprintf(time_buf,"00:00:00");
 		} else {
 			time_diff = (time_t) _job_time_used(job_ptr);
@@ -437,7 +436,7 @@ static int _print_text_job(job_info_t * job_ptr)
 		printf("%6.6s ", job_ptr->name);
 		printf("%2.2s ",
 		       job_state_string_compact(job_ptr->job_state));
-		if (!strcasecmp(job_ptr->nodes,"waiting...")) {
+		if (!xstrcasecmp(job_ptr->nodes,"waiting...")) {
 			sprintf(time_buf,"00:00:00");
 		} else {
 			time_diff = (time_t) _job_time_used(job_ptr);
diff --git a/src/smap/opts.c b/src/smap/opts.c
index cf7f8a3d5..fef91e5e0 100644
--- a/src/smap/opts.c
+++ b/src/smap/opts.c
@@ -93,15 +93,15 @@ extern void parse_command_line(int argc, char *argv[])
 			params.command = xstrdup(optarg);
 			break;
 		case 'D':
-			if (!strcmp(optarg, "j"))
+			if (!xstrcmp(optarg, "j"))
 				tmp = JOBS;
-			else if (!strcmp(optarg, "s"))
+			else if (!xstrcmp(optarg, "s"))
 				tmp = SLURMPART;
-			else if (!strcmp(optarg, "b"))
+			else if (!xstrcmp(optarg, "b"))
 				tmp = BGPART;
-			else if (!strcmp(optarg, "c"))
+			else if (!xstrcmp(optarg, "c"))
 				tmp = COMMANDS;
-			else if (!strcmp(optarg, "r"))
+			else if (!xstrcmp(optarg, "r"))
 				tmp = RESERVATIONS;
 
 			params.display = tmp;
@@ -249,11 +249,11 @@ extern char *resolve_mp(char *desc, node_info_msg_t *node_info_ptr)
 			if (!rack_mid)
 				break;
 			if (desc[0] != 'R') {
-				if (!strcasecmp(name, node_geo))
+				if (!xstrcasecmp(name, node_geo))
 					ret_str = xstrdup_printf(
 						"%s resolves to %s\n",
 						node_geo, rack_mid);
-			} else if (!strcasecmp(name, rack_mid))
+			} else if (!xstrcasecmp(name, rack_mid))
 				ret_str = xstrdup_printf(
 					"%s resolves to %s\n",
 					rack_mid, node_geo);
diff --git a/src/smap/partition_functions.c b/src/smap/partition_functions.c
index 5cd16e044..a6e8b95bb 100644
--- a/src/smap/partition_functions.c
+++ b/src/smap/partition_functions.c
@@ -309,7 +309,7 @@ extern void get_bg_part(void)
 
 		itr = list_iterator_create(block_list);
 		while ((found_block = (db2_block_info_t*)list_next(itr))) {
-			if (!strcmp(block_ptr->mp_str, found_block->mp_str)) {
+			if (!xstrcmp(block_ptr->mp_str, found_block->mp_str)) {
 				block_ptr->letter_num =
 					found_block->letter_num;
 				break;
@@ -557,7 +557,7 @@ static int _print_text_part(partition_info_t *part_ptr,
 
 	if (params.cluster_flags & CLUSTER_FLAG_BG)
 		convert_num_unit((float)part_ptr->total_nodes, tmp_cnt,
-				 sizeof(tmp_cnt), UNIT_NONE,
+				 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 				 CONVERT_NUM_UNIT_EXACT);
 	else
 		snprintf(tmp_cnt, sizeof(tmp_cnt), "%u", part_ptr->total_nodes);
diff --git a/src/smd/Makefile.in b/src/smd/Makefile.in
index 59a38b891..3934d5e1f 100644
--- a/src/smd/Makefile.in
+++ b/src/smd/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/smd
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sprio/Makefile.in b/src/sprio/Makefile.in
index 8e19dab85..ad7d49c2a 100644
--- a/src/sprio/Makefile.in
+++ b/src/sprio/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 bin_PROGRAMS = sprio$(EXEEXT)
 subdir = src/sprio
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sprio/sprio.c b/src/sprio/sprio.c
index 3ffc5ff39..63905c39c 100644
--- a/src/sprio/sprio.c
+++ b/src/sprio/sprio.c
@@ -119,7 +119,7 @@ int main (int argc, char *argv[])
 	}
 
 	/* Check to see if we are running a supported accounting plugin */
-	if (strcasecmp(prio_type, "priority/basic") == 0) {
+	if (xstrcasecmp(prio_type, "priority/basic") == 0) {
 		fprintf (stderr, "You are not running a supported "
 			 "priority plugin\n(%s).\n"
 			 "Only 'priority/multifactor' is supported.\n",
diff --git a/src/squeue/Makefile.in b/src/squeue/Makefile.in
index 49df857a4..3f9ac273b 100644
--- a/src/squeue/Makefile.in
+++ b/src/squeue/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 bin_PROGRAMS = squeue$(EXEEXT)
 subdir = src/squeue
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -229,8 +230,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -330,6 +329,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -368,6 +371,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -411,6 +417,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -461,6 +470,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/squeue/opts.c b/src/squeue/opts.c
index 7d85dcce7..3ed69f61f 100644
--- a/src/squeue/opts.c
+++ b/src/squeue/opts.c
@@ -364,7 +364,7 @@ parse_command_line( int argc, char* argv[] )
 			name1 = hostset_pop(params.nodes);
 
 			/* localhost = use current host name */
-			if ( strcasecmp("localhost", name1) == 0 ) {
+			if ( xstrcasecmp("localhost", name1) == 0 ) {
 				name2 = xmalloc(128);
 				gethostname_short(name2, 128);
 			} else {
@@ -538,12 +538,12 @@ extern int parse_format( char* format )
 		}
 	}
 
-	if (!strcasecmp(format, "%all")) {
+	if (!xstrcasecmp(format, "%all")) {
 		xstrfmtcat(tmp_format, "%c%c", '%', 'a');
 		for (i = 'b'; i <= 'z'; i++)
 			xstrfmtcat(tmp_format, "|%c%c", '%', (char) i);
 		for (i = 'A'; i <= 'Z'; i++)
-			xstrfmtcat(tmp_format, "|%c%c ", '%', (char) i);
+			xstrfmtcat(tmp_format, "|%c%c", '%', (char) i);
 		format_all = true;
 	} else {
 		tmp_format = xstrdup(format);
@@ -697,7 +697,8 @@ extern int parse_format( char* format )
 							 right_justify,
 							 suffix );
 			else if (field[0] == 'h')
-				job_format_add_shared( params.format_list,
+				job_format_add_over_subscribe(
+						       params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
@@ -930,108 +931,108 @@ extern int parse_long_format( char* format_long )
 
 		if (params.step_flag) {
 
-			if (!strcasecmp(token, "numtask"))
+			if (!xstrcasecmp(token, "numtask"))
 				step_format_add_num_tasks( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "gres"))
+			else if (!xstrcasecmp(token, "gres"))
 				step_format_add_gres( params.format_list,
 						      field_size,
 						      right_justify, suffix );
-			else if (!strcasecmp(token, "stepid"))
+			else if (!xstrcasecmp(token, "stepid"))
 				step_format_add_id( params.format_list,
 						    field_size,
 						    right_justify, suffix );
-			else if (!strcasecmp(token, "stepname"))
+			else if (!xstrcasecmp(token, "stepname"))
 				step_format_add_name( params.format_list,
 						      field_size,
 						      right_justify,
 						      suffix );
-			else if (!strcasecmp(token, "timelimit"))
+			else if (!xstrcasecmp(token, "timelimit"))
 				step_format_add_time_limit( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "timeused"))
+			else if (!xstrcasecmp(token, "timeused"))
 				step_format_add_time_used( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "nodes"))
+			else if (!xstrcasecmp(token, "nodes"))
 				step_format_add_nodes( params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "partition"))
+			else if (!xstrcasecmp(token, "partition"))
 				step_format_add_partition( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "starttime"))
+			else if (!xstrcasecmp(token, "starttime"))
 				step_format_add_time_start( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "userid"))
+			else if (!xstrcasecmp(token, "userid"))
 				step_format_add_user_id( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if  (!strcasecmp(token, "username"))
+			else if  (!xstrcasecmp(token, "username"))
 				step_format_add_user_name( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "arrayjobid"))
+			else if (!xstrcasecmp(token, "arrayjobid"))
 				step_format_add_array_job_id(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "arraytaskid"))
+			else if (!xstrcasecmp(token, "arraytaskid"))
 				step_format_add_array_task_id(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "chptdir"))
+			else if (!xstrcasecmp(token, "chptdir"))
 				step_format_add_chpt_dir( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if ( !strcasecmp(token, "chptinter"))
+			else if ( !xstrcasecmp(token, "chptinter"))
 				step_format_add_chpt_interval(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if ( !strcasecmp(token, "jobid"))
+			else if ( !xstrcasecmp(token, "jobid"))
 				step_format_add_job_id( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if ( !strcasecmp(token, "network"))
+			else if ( !xstrcasecmp(token, "network"))
 				step_format_add_network( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if ( !strcasecmp(token, "numcpus"))
+			else if ( !xstrcasecmp(token, "numcpus"))
 				step_format_add_num_cpus( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if ( !strcasecmp(token, "cpufreq"))
+			else if ( !xstrcasecmp(token, "cpufreq"))
 				step_format_add_cpu_freq( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if ( !strcasecmp(token, "resvports"))
+			else if ( !xstrcasecmp(token, "resvports"))
 				step_format_add_resv_ports( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if ( !strcasecmp(token, "stepstate"))
+			else if ( !xstrcasecmp(token, "stepstate"))
 				step_format_add_step_state( params.format_list,
 							    field_size,
 							    right_justify,
@@ -1048,427 +1049,444 @@ extern int parse_long_format( char* format_long )
 
 		} else {
 
-			if (!strcasecmp(token,"account"))
+			if (!xstrcasecmp(token,"account"))
 				job_format_add_account( params.format_list,
 							field_size,
 							right_justify,
 							suffix  );
-			else if (!strcasecmp(token, "jobid"))
+			else if (!xstrcasecmp(token, "jobid"))
 				job_format_add_job_id2(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "gres"))
+			else if (!xstrcasecmp(token, "gres"))
 				job_format_add_gres(params.format_list,
 						    field_size, right_justify,
 						    suffix );
-			else if (!strcasecmp(token,"batchhost"))
+			else if (!xstrcasecmp(token,"batchhost"))
 				job_format_add_batch_host(params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token,"burstbuffer"))
+			else if (!xstrcasecmp(token,"burstbuffer"))
 				job_format_add_burst_buffer(params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token,"mincpus"))
+			else if (!xstrcasecmp(token,"mincpus"))
 				job_format_add_min_cpus( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix  );
-			else if (!strcasecmp(token,"numcpus"))
+			else if (!xstrcasecmp(token,"numcpus"))
 				job_format_add_num_cpus( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix  );
-			else if (!strcasecmp(token, "mintmpdisk"))
+			else if (!xstrcasecmp(token, "mintmpdisk"))
 				job_format_add_min_tmp_disk(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix  );
-			else if (!strcasecmp(token, "numnodes"))
+			else if (!xstrcasecmp(token, "numnodes"))
 				job_format_add_num_nodes( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix  );
-			else if (!strcasecmp(token, "endtime"))
+			else if (!xstrcasecmp(token, "numtasks"))
+				job_format_add_num_tasks( params.format_list,
+							  field_size,
+							  right_justify,
+							  suffix  );
+			else if (!xstrcasecmp(token, "endtime"))
 				job_format_add_time_end( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
 
-			else if (!strcasecmp(token, "dependency"))
+			else if (!xstrcasecmp(token, "dependency"))
 				job_format_add_dependency( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "feature"))
+			else if (!xstrcasecmp(token, "feature"))
 				job_format_add_features( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "arrayjobid"))
+			else if (!xstrcasecmp(token, "arrayjobid"))
 				job_format_add_array_job_id(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token,"groupname"))
+			else if (!xstrcasecmp(token,"groupname"))
 				job_format_add_group_name( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token,"groupid"))
+			else if (!xstrcasecmp(token,"groupid"))
 				job_format_add_group_id( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token,"shared"))
-				job_format_add_shared( params.format_list,
+			else if (!xstrcasecmp(token, "oversubscribe") ||
+				 !xstrcasecmp(token, "shared"))
+				job_format_add_over_subscribe(
+						       params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
 
-			else if (!strcasecmp(token, "sockets"))
+			else if (!xstrcasecmp(token, "sockets"))
 				job_format_add_sockets( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token,"jobarrayid"))
+			else if (!xstrcasecmp(token,"jobarrayid"))
 				job_format_add_job_id( params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "cores"))
+			else if (!xstrcasecmp(token, "cores"))
 				job_format_add_cores( params.format_list,
 						      field_size,
 						      right_justify, suffix );
-			else if (!strcasecmp(token, "name"))
+			else if (!xstrcasecmp(token, "name"))
 				job_format_add_name( params.format_list,
 						     field_size,
 						     right_justify, suffix );
-			else if (!strcasecmp(token, "threads"))
+			else if (!xstrcasecmp(token, "threads"))
 				job_format_add_threads( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "comment"))
+			else if (!xstrcasecmp(token, "comment"))
 				job_format_add_comment( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "arraytaskid"))
+			else if (!xstrcasecmp(token, "arraytaskid"))
 				job_format_add_array_task_id(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "timelimit"))
+			else if (!xstrcasecmp(token, "timelimit"))
 				job_format_add_time_limit( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "timeleft"))
+			else if (!xstrcasecmp(token, "timeleft"))
 				job_format_add_time_left( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "minmemory"))
+			else if (!xstrcasecmp(token, "minmemory"))
 				job_format_add_min_memory( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token,"timeused"))
+			else if (!xstrcasecmp(token,"timeused"))
 				job_format_add_time_used( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "reqnodes"))
+			else if (!xstrcasecmp(token, "reqnodes"))
 				job_format_add_req_nodes( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "nodelist"))
+			else if (!xstrcasecmp(token, "nodelist"))
 				job_format_add_nodes( params.format_list,
 						      field_size,
 						      right_justify, suffix );
-			else if (!strcasecmp(token, "command"))
+			else if (!xstrcasecmp(token, "command"))
 				job_format_add_command( params.format_list,
 							field_size,
 							right_justify, suffix);
-			else if (!strcasecmp(token, "contiguous"))
+			else if (!xstrcasecmp(token, "contiguous"))
 				job_format_add_contiguous( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "priority"))
+			else if (!xstrcasecmp(token, "priority"))
 				job_format_add_priority( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "partition"))
+			else if (!xstrcasecmp(token, "partition"))
 				job_format_add_partition( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "qos"))
+			else if (!xstrcasecmp(token, "qos"))
 				job_format_add_qos( params.format_list,
 						    field_size,
 						    right_justify,
 						    suffix );
-			else if (!strcasecmp(token, "prioritylong"))
+			else if (!xstrcasecmp(token, "prioritylong"))
 				job_format_add_priority_long(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "reason"))
+			else if (!xstrcasecmp(token, "reason"))
 				job_format_add_reason( params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "reasonlist"))
+			else if (!xstrcasecmp(token, "reasonlist"))
 				job_format_add_reason_list( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "selectjobinfo"))
+			else if (!xstrcasecmp(token, "selectjobinfo"))
 				job_format_add_select_jobinfo(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "starttime"))
+			else if (!xstrcasecmp(token, "starttime"))
 				job_format_add_time_start( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "statecompact"))
+			else if (!xstrcasecmp(token, "statecompact"))
 				job_format_add_job_state_compact(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "state"))
+			else if (!xstrcasecmp(token, "state"))
 				job_format_add_job_state( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "userid"))
+			else if (!xstrcasecmp(token, "userid"))
 				job_format_add_user_id( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "username"))
+			else if (!xstrcasecmp(token, "username"))
 				job_format_add_user_name( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "reservation"))
+			else if (!xstrcasecmp(token, "reservation"))
 				job_format_add_reservation( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "submittime"))
+			else if (!xstrcasecmp(token, "submittime"))
 				job_format_add_time_submit( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "wckey"))
+			else if (!xstrcasecmp(token, "wckey"))
 				job_format_add_wckey( params.format_list,
 						      field_size,
 						      right_justify,
 						      suffix );
-			else if (!strcasecmp(token, "licenses"))
+			else if (!xstrcasecmp(token, "licenses"))
 				job_format_add_licenses( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "corespec"))
+			else if (!xstrcasecmp(token, "corespec"))
 				job_format_add_core_spec( params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "nice"))
+			else if (!xstrcasecmp(token, "nice"))
 				job_format_add_nice( params.format_list,
 						     field_size, right_justify,
 						     suffix );
-			else if (!strcasecmp(token, "schednodes"))
+			else if (!xstrcasecmp(token, "schednodes"))
 				job_format_add_schednodes( params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "sct"))
+			else if (!xstrcasecmp(token, "sct"))
 				job_format_add_num_sct( params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "workdir"))
+			else if (!xstrcasecmp(token, "workdir"))
 				job_format_add_work_dir( params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
 
-			else if (!strcasecmp(token, "allocnodes"))
+			else if (!xstrcasecmp(token, "allocnodes"))
 				job_format_add_alloc_nodes( params.format_list,
 							    field_size,
 							    right_justify,
 							    suffix );
-			else if (!strcasecmp(token, "allocsid"))
+			else if (!xstrcasecmp(token, "allocsid"))
 				job_format_add_alloc_sid(params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token,"associd"))
+			else if (!xstrcasecmp(token,"associd"))
 				job_format_add_assoc_id(params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "batchflag"))
+			else if (!xstrcasecmp(token, "batchflag"))
 				job_format_add_batch_flag(params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "boardspernode"))
+			else if (!xstrcasecmp(token, "boardspernode"))
 				job_format_add_boards_per_node(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "cpuspertask"))
+			else if (!xstrcasecmp(token, "cpuspertask"))
 				job_format_add_cpus_per_task(params.format_list,
 							     field_size,
 							     right_justify,
 							     suffix );
 
-			else if (!strcasecmp(token, "derivedec"))
+			else if (!xstrcasecmp(token, "derivedec"))
 				job_format_add_derived_ec(params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "eligibletime"))
+			else if (!xstrcasecmp(token, "eligibletime"))
 				job_format_add_eligible_time(params.format_list,
 							     field_size,
 							     right_justify,
 							     suffix );
-			else if (!strcasecmp(token, "exit_code"))
+			else if (!xstrcasecmp(token, "exit_code"))
 				job_format_add_exit_code(params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "maxcpus"))
+			else if (!xstrcasecmp(token, "maxcpus"))
 				job_format_add_max_cpus(params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "maxnodes"))
+			else if (!xstrcasecmp(token, "maxnodes"))
 				job_format_add_max_nodes(params.format_list,
 							 field_size,
 							 right_justify,
 							 suffix );
-			else if (!strcasecmp(token, "network"))
+			else if (!xstrcasecmp(token, "network"))
 				job_format_add_network(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "ntpercore"))
+			else if (!xstrcasecmp(token, "ntpercore"))
 				job_format_add_ntasks_per_core(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "ntpernode"))
+			else if (!xstrcasecmp(token, "ntpernode"))
 				job_format_add_ntasks_per_node(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "ntpersocket"))
+			else if (!xstrcasecmp(token, "ntpersocket"))
 				job_format_add_ntasks_per_socket(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "ntperboard"))
+			else if (!xstrcasecmp(token, "ntperboard"))
 				job_format_add_ntasks_per_board(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "preempttime"))
+			else if (!xstrcasecmp(token, "preempttime"))
 				job_format_add_preempt_time(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "profile"))
+			else if (!xstrcasecmp(token, "profile"))
 				job_format_add_profile(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "reboot"))
+			else if (!xstrcasecmp(token, "reboot"))
 				job_format_add_reboot(params.format_list,
 						      field_size,
 						      right_justify,
 						      suffix );
-			else if (!strcasecmp(token, "reqswitch"))
+			else if (!xstrcasecmp(token, "reqswitch"))
 				job_format_add_req_switch(params.format_list,
 							  field_size,
 							  right_justify,
 							  suffix );
-			else if (!strcasecmp(token, "requeue"))
+			else if (!xstrcasecmp(token, "requeue"))
 				job_format_add_requeue(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "resizetime"))
+			else if (!xstrcasecmp(token, "resizetime"))
 				job_format_add_resize_time(params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "restartcnt"))
+			else if (!xstrcasecmp(token, "restartcnt"))
 				job_format_add_restart_cnt(params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "sperboard"))
+			else if (!xstrcasecmp(token, "sperboard"))
 				job_format_add_sockets_per_board(
 					params.format_list,
 					field_size,
 					right_justify,
 					suffix );
-			else if (!strcasecmp(token, "stderr"))
+			else if (!xstrcasecmp(token, "stderr"))
 				job_format_add_std_err(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "stdin"))
+			else if (!xstrcasecmp(token, "stdin"))
 				job_format_add_std_in(params.format_list,
 						      field_size,
 						      right_justify,
 						      suffix );
-			else if (!strcasecmp(token, "stdout"))
+			else if (!xstrcasecmp(token, "stdout"))
 				job_format_add_std_out(params.format_list,
 						       field_size,
 						       right_justify,
 						       suffix );
-			else if (!strcasecmp(token, "mintime"))
+			else if (!xstrcasecmp(token, "mintime"))
 				job_format_add_min_time(params.format_list,
 							field_size,
 							right_justify,
 							suffix );
-			else if (!strcasecmp(token, "wait4switch"))
+			else if (!xstrcasecmp(token, "wait4switch"))
 				job_format_add_wait4switch(params.format_list,
 							   field_size,
 							   right_justify,
 							   suffix );
-			else if (!strcasecmp(token, "tres"))
+			else if (!xstrcasecmp(token, "tres"))
 				job_format_add_tres(params.format_list,
 						    field_size,
 						    right_justify,
 						    suffix );
+			else if (!xstrcasecmp(token, "mcslabel"))
+				job_format_add_mcs_label(params.format_list,
+							 field_size,
+							 right_justify,
+							 suffix );
+			else if (!xstrcasecmp(token, "deadline"))
+				job_format_add_deadline(params.format_list,
+							field_size,
+							right_justify,
+							suffix );
 			else {
 				job_format_add_invalid( params.format_list,
 							field_size,
@@ -1769,7 +1787,7 @@ _build_state_list( char* str )
 
 	if ( str == NULL)
 		return NULL;
-	if ( strcasecmp( str, "all" ) == 0 )
+	if ( xstrcasecmp( str, "all" ) == 0 )
 		return _build_all_states_list ();
 
 	my_list = list_create( NULL );
@@ -2000,7 +2018,7 @@ _find_a_host(char *host, node_info_msg_t *node)
 		 */
 		if (node->node_array[cc].name == NULL)
 			continue;
-		if (strcmp(host, node->node_array[cc].name) == 0)
+		if (xstrcmp(host, node->node_array[cc].name) == 0)
 			return true;
 	}
 
diff --git a/src/squeue/print.c b/src/squeue/print.c
index 5ef5a72dc..2bef2a670 100644
--- a/src/squeue/print.c
+++ b/src/squeue/print.c
@@ -64,7 +64,7 @@ static int	_filter_job(job_info_t * job);
 static int	_filter_job_part(char *part_name);
 static int	_filter_step(job_step_info_t * step);
 static void	_job_list_del(void *x);
-static uint32_t	_part_get_prio(char *part_name);
+static uint32_t	_part_get_prio_tier(char *part_name);
 static void	_part_state_free(void);
 static void	_part_state_load(void);
 static int	_print_str(char *str, int width, bool right, bool cut_output);
@@ -117,7 +117,7 @@ int print_jobs_array(job_info_t * jobs, int size, List format)
 					job_rec_ptr->job_ptr = jobs + i;
 					job_rec_ptr->part_name = xstrdup(tok);
 					job_rec_ptr->part_prio =
-						_part_get_prio(tok);
+						_part_get_prio_tier(tok);
 					list_append(l, (void *) job_rec_ptr);
 				}
 				tok = strtok_r(NULL, ",", &save_ptr);
@@ -268,7 +268,7 @@ static void _job_list_del(void *x)
 	xfree(job_rec_ptr);
 }
 
-static uint32_t _part_get_prio(char *part_name)
+static uint32_t _part_get_prio_tier(char *part_name)
 {
 	partition_info_t *part_ptr;
 	uint32_t part_prio = 1;	/* Default partition priority */
@@ -276,8 +276,8 @@ static uint32_t _part_get_prio(char *part_name)
 
 	for (i = 0, part_ptr = part_info_msg->partition_array;
 	     i < part_info_msg->record_count; i++, part_ptr++) {
-		if (!strcmp(part_ptr->name, part_name)) {
-			part_prio = part_ptr->priority;
+		if (!xstrcmp(part_ptr->name, part_name)) {
+			part_prio = part_ptr->priority_tier;
 			break;
 		}
 	}
@@ -876,7 +876,16 @@ int _print_job_time_start(job_info_t * job, int width, bool right,
 		printf("%s", suffix);
 	return SLURM_SUCCESS;
 }
-
+int _print_job_deadline(job_info_t * job, int width, bool right, char* suffix)
+{
+	if (job == NULL)        /* Print the Header instead */
+		_print_str("DEADLINE", width, right, true);
+	else
+		_print_time(job->deadline, 0, width, right);
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
 int _print_job_time_end(job_info_t * job, int width, bool right, char* suffix)
 {
 	if (job == NULL)	/* Print the Header instead */
@@ -979,6 +988,7 @@ int _print_job_reason_list(job_info_t * job, int width, bool right,
 	} else if (!IS_JOB_COMPLETING(job)
 		   && (IS_JOB_PENDING(job)
 		       || IS_JOB_TIMEOUT(job)
+		       || IS_JOB_DEADLINE(job)
 		       || IS_JOB_FAILED(job))) {
 		char *reason_fmt = NULL, *reason = NULL;
 		if (job->state_desc)
@@ -1037,7 +1047,7 @@ int _print_job_num_cpus(job_info_t * job, int width, bool right, char* suffix)
 	else {
 		if (params.cluster_flags & CLUSTER_FLAG_BG)
 			convert_num_unit((float)job->num_cpus, tmp_char,
-					 sizeof(tmp_char), UNIT_NONE,
+					 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		else
 			snprintf(tmp_char, sizeof(tmp_char),
@@ -1068,7 +1078,7 @@ int _print_job_num_nodes(job_info_t * job, int width, bool right_justify,
 
 		if (params.cluster_flags & CLUSTER_FLAG_BG)
 			convert_num_unit((float)node_cnt, tmp_char,
-					 sizeof(tmp_char), UNIT_NONE,
+					 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 					 params.convert_flags);
 		else
 			snprintf(tmp_char, sizeof(tmp_char), "%d", node_cnt);
@@ -1086,33 +1096,29 @@ int _print_job_num_sct(job_info_t * job, int width, bool right_justify,
 	char sockets[10];
 	char cores[10];
 	char threads[10];
-	char sct[(10+1)*3];
+	char *sct = NULL;
 	if (job) {
 		if (job->sockets_per_node == (uint16_t) NO_VAL)
 			strcpy(sockets, "*");
 		else
 			convert_num_unit((float)job->sockets_per_node, sockets,
-					sizeof(sockets), UNIT_NONE,
+					sizeof(sockets), UNIT_NONE, NO_VAL,
 					params.convert_flags);
 		if (job->cores_per_socket == (uint16_t) NO_VAL)
 			strcpy(cores, "*");
 		else
 			convert_num_unit((float)job->cores_per_socket, cores,
-					sizeof(cores), UNIT_NONE,
+					sizeof(cores), UNIT_NONE, NO_VAL,
 					params.convert_flags);
 		if (job->threads_per_core == (uint16_t) NO_VAL)
 			strcpy(threads, "*");
 		else
 			convert_num_unit((float)job->threads_per_core, threads,
-					sizeof(threads), UNIT_NONE,
+					sizeof(threads), UNIT_NONE, NO_VAL,
 					params.convert_flags);
-		sct[0] = '\0';
-		strcat(sct, sockets);
-		strcat(sct, ":");
-		strcat(sct, cores);
-		strcat(sct, ":");
-		strcat(sct, threads);
+		xstrfmtcat(sct, "%s:%s:%s", sockets, cores, threads);
 		_print_str(sct, width, right_justify, true);
+		xfree(sct);
 	} else {
 		_print_str("S:C:T", width, right_justify, true);
 	}
@@ -1122,27 +1128,28 @@ int _print_job_num_sct(job_info_t * job, int width, bool right_justify,
 	return SLURM_SUCCESS;
 }
 
-int _print_job_shared(job_info_t * job, int width, bool right_justify,
-		      char* suffix)
+int _print_job_num_tasks(job_info_t * job, int width, bool right, char* suffix)
 {
-	if (job == NULL)	/* Print the Header instead */
-		_print_str("SHARED", width, right_justify, true);
-	else {
-		switch (job->shared) {
-		case 0:
-			_print_str("no", width, right_justify, true);
-			break;
-		case 1:
-			_print_str("yes", width, right_justify, true);
-			break;
-		case 2:
-			_print_str("user", width, right_justify, true);
-			break;
-		case (uint16_t)NO_VAL:
-		default:
-			_print_str("unknwn", width, right_justify, true);
-			break;
-		}
+	char tmp_char[18];
+	if (job == NULL) {	/* Print the Header instead */
+		_print_str("TASKS", width, right, true);
+	} else {
+		snprintf(tmp_char, sizeof(tmp_char), "%u", job->num_tasks);
+       		_print_str(tmp_char, width, right, true);
+	}
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
+
+int _print_job_over_subscribe(job_info_t * job, int width, bool right_justify,
+			      char* suffix)
+{
+	if (job == NULL) {	/* Print the Header instead */
+		_print_str("OVER_SUBSCRIBE", width, right_justify, true);
+	} else {
+		_print_str(job_share_string(job->shared),
+			   width, right_justify, true);
 	}
 	if (suffix)
 		printf("%s", suffix);
@@ -1172,7 +1179,7 @@ int _print_pn_min_cpus(job_info_t * job, int width, bool right_justify,
 		_print_str("MIN_CPUS", width, right_justify, true);
 	else {
 		convert_num_unit((float)job->pn_min_cpus, tmp_char,
-				 sizeof(tmp_char), UNIT_NONE,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				 params.convert_flags);
 		_print_str(tmp_char, width, right_justify, true);
 	}
@@ -1193,7 +1200,7 @@ int _print_sockets(job_info_t * job, int width, bool right_justify,
 			strcpy(tmp_char, "*");
 		else
 			convert_num_unit((float)job->sockets_per_node, tmp_char,
-				 sizeof(tmp_char), UNIT_NONE,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				 params.convert_flags);
 		_print_str(tmp_char, width, right_justify, true);
 	}
@@ -1214,7 +1221,7 @@ int _print_cores(job_info_t * job, int width, bool right_justify,
 			strcpy(tmp_char, "*");
 		else
 			convert_num_unit((float)job->cores_per_socket, tmp_char,
-					sizeof(tmp_char), UNIT_NONE,
+					sizeof(tmp_char), UNIT_NONE, NO_VAL,
 					params.convert_flags);
 		_print_str(tmp_char, width, right_justify, true);
 	}
@@ -1235,7 +1242,7 @@ int _print_threads(job_info_t * job, int width, bool right_justify,
 			strcpy(tmp_char, "*");
 		else
 			convert_num_unit((float)job->threads_per_core, tmp_char,
-					sizeof(tmp_char), UNIT_NONE,
+					sizeof(tmp_char), UNIT_NONE, NO_VAL,
 					params.convert_flags);
 		_print_str(tmp_char, width, right_justify, true);
 	}
@@ -1248,18 +1255,15 @@ int _print_pn_min_memory(job_info_t * job, int width, bool right_justify,
 			  char* suffix)
 {
 	char min_mem[10];
-	char tmp_char[21];
 
 	if (job == NULL)	/* Print the Header instead */
 		_print_str("MIN_MEMORY", width, right_justify, true);
 	else {
-	    	tmp_char[0] = '\0';
 		job->pn_min_memory &= (~MEM_PER_CPU);
 		convert_num_unit((float)job->pn_min_memory, min_mem,
-				 sizeof(min_mem), UNIT_MEGA,
+				 sizeof(min_mem), UNIT_MEGA, NO_VAL,
 				 params.convert_flags);
-		strcat(tmp_char, min_mem);
-		_print_str(tmp_char, width, right_justify, true);
+		_print_str(min_mem, width, right_justify, true);
 	}
 
 	if (suffix)
@@ -1276,8 +1280,8 @@ _print_pn_min_tmp_disk(job_info_t * job, int width, bool right_justify,
 	if (job == NULL)	/* Print the Header instead */
 		_print_str("MIN_TMP_DISK", width, right_justify, true);
 	else {
-		convert_num_unit((float)job->pn_min_tmp_disk,
-				 tmp_char, sizeof(tmp_char), UNIT_MEGA,
+		convert_num_unit((float)job->pn_min_tmp_disk, tmp_char,
+				 sizeof(tmp_char), UNIT_MEGA, NO_VAL,
 				 params.convert_flags);
 		_print_str(tmp_char, width, right_justify, true);
 	}
@@ -1940,6 +1944,18 @@ int _print_job_tres(job_info_t *job, int width,
 	return SLURM_SUCCESS;
 }
 
+int _print_job_mcs_label(job_info_t * job, int width,
+			bool right, char* suffix)
+{
+	if (job == NULL)
+		_print_str("MCSLABEL", width, right, true);
+	else
+		_print_str(job->mcs_label, width, right, true);
+
+	if (suffix)
+		printf("%s", suffix);
+	return SLURM_SUCCESS;
+}
 
 /*****************************************************************************
  * Job Step Print Functions
@@ -2408,7 +2424,7 @@ static int _filter_job(job_info_t * job)
 		iterator = list_iterator_create(params.account_list);
 		while ((account = list_next(iterator))) {
 			 if ((job->account != NULL) &&
-			     (strcasecmp(account, job->account) == 0)) {
+			     (xstrcasecmp(account, job->account) == 0)) {
 				filter = 0;
 				break;
 			}
@@ -2423,7 +2439,7 @@ static int _filter_job(job_info_t * job)
 		iterator = list_iterator_create(params.qos_list);
 		while ((qos = list_next(iterator))) {
 			 if ((job->qos != NULL) &&
-			     (strcasecmp(qos, job->qos) == 0)) {
+			     (xstrcasecmp(qos, job->qos) == 0)) {
 				filter = 0;
 				break;
 			}
@@ -2481,7 +2497,7 @@ static int _filter_job(job_info_t * job)
 
 	if (params.reservation) {
 		if ((job->resv_name == NULL) ||
-		    (strcmp(job->resv_name, params.reservation))) {
+		    (xstrcmp(job->resv_name, params.reservation))) {
 			return 7;
 		}
 	}
@@ -2491,7 +2507,7 @@ static int _filter_job(job_info_t * job)
 		iterator = list_iterator_create(params.name_list);
 		while ((name = list_next(iterator))) {
 			if ((job->name != NULL) &&
-			     (strcasecmp(name, job->name) == 0)) {
+			     (xstrcasecmp(name, job->name) == 0)) {
 				filter = 0;
 				break;
 			}
@@ -2521,7 +2537,7 @@ static int _filter_job_part(char *part_name)
 	while (token && (rc != 0)) {
 		iterator = list_iterator_create(params.part_list);
 		while ((part = list_next(iterator))) {
-			if (strcmp(part, token) == 0) {
+			if (xstrcmp(part, token) == 0) {
 				rc = 0;
 				break;
 			}
@@ -2569,7 +2585,7 @@ static int _filter_step(job_step_info_t * step)
 		filter = 1;
 		iterator = list_iterator_create(params.part_list);
 		while ((part = list_next(iterator))) {
-			if (strcmp(part, step->partition) == 0) {
+			if (xstrcmp(part, step->partition) == 0) {
 				filter = 0;
 				break;
 			}
diff --git a/src/squeue/print.h b/src/squeue/print.h
index 687fe5403..dba4381ec 100644
--- a/src/squeue/print.h
+++ b/src/squeue/print.h
@@ -141,6 +141,8 @@ int job_format_add_function(List list, int width, bool right_justify,
 	job_format_add_function(list,wid,right,suffix,_print_job_time_submit)
 #define job_format_add_time_start(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_time_start)
+#define job_format_add_deadline(list,wid,right,suffix) \
+	job_format_add_function(list,wid,right,suffix,_print_job_deadline)
 #define job_format_add_time_end(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_time_end)
 #define job_format_add_priority(list,wid,right,suffix) \
@@ -159,8 +161,10 @@ int job_format_add_function(List list, int width, bool right_justify,
 	job_format_add_function(list,wid,right,suffix,_print_job_num_nodes)
 #define job_format_add_num_sct(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_num_sct)
-#define job_format_add_shared(list,wid,right,suffix) \
-	job_format_add_function(list,wid,right,suffix,_print_job_shared)
+#define job_format_add_num_tasks(list,wid,right,suffix) \
+	job_format_add_function(list,wid,right,suffix,_print_job_num_tasks)
+#define job_format_add_over_subscribe(list,wid,right,suffix) \
+	job_format_add_function(list,wid,right,suffix,_print_job_over_subscribe)
 #define job_format_add_contiguous(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_contiguous)
 #define job_format_add_min_cpus(list,wid,right,suffix) \
@@ -273,6 +277,8 @@ int job_format_add_function(List list, int width, bool right_justify,
 	job_format_add_function(list,wid,right,suffix,_print_job_wait4switch)
 #define job_format_add_tres(list,wid,right,suffix) \
 	job_format_add_function(list,wid,right,suffix,_print_job_tres)
+#define job_format_add_mcs_label(list,wid,right,suffix) \
+	job_format_add_function(list,wid,right,suffix,_print_job_mcs_label)
 
 
 /*****************************************************************************
@@ -330,6 +336,8 @@ int _print_job_time_start(job_info_t * job, int width, bool right_justify,
 			char* suffix);
 int _print_job_time_end(job_info_t * job, int width, bool right_justify,
 			char* suffix);
+int _print_job_deadline(job_info_t * job, int width, bool right_justify,
+			char* suffix);
 int _print_job_priority(job_info_t * job, int width, bool right_justify,
 			char* suffix);
 int _print_job_priority_long(job_info_t * job, int width, bool right_justify,
@@ -348,8 +356,10 @@ int _print_job_num_nodes(job_info_t * job, int width, bool right_justify,
 			char* suffix);
 int _print_job_num_sct(job_info_t * job, int width, bool right_justify,
 		       char* suffix);
-int _print_job_shared(job_info_t * job, int width, bool right_justify,
-		      char* suffix);
+int _print_job_num_tasks(job_info_t * job, int width, bool right_justify,
+		         char* suffix);
+int _print_job_over_subscribe(job_info_t * job, int width, bool right_justify,
+			      char* suffix);
 int _print_job_contiguous(job_info_t * job, int width, bool right_justify,
 			  char* suffix);
 int _print_pn_min_cpus(job_info_t * job, int width, bool right_justify,
@@ -457,6 +467,8 @@ int _print_job_wait4switch(job_info_t * job, int width,
 			   bool right_justify, char* suffix);
 int _print_job_tres(job_info_t * job, int width,
 		    bool right_justify, char *suffix);
+int _print_job_mcs_label(job_info_t * job, int width,
+			 bool right_justify, char* suffix);
 
 /*****************************************************************************
  * Step Print Format Functions
diff --git a/src/squeue/sort.c b/src/squeue/sort.c
index fac5a38bf..f0d37e42a 100644
--- a/src/squeue/sort.c
+++ b/src/squeue/sort.c
@@ -134,7 +134,7 @@ void sort_job_list(List job_list)
 		else if (params.sort[i] == 'G')
 			list_sort(job_list, _sort_job_by_group_id);
 		else if (params.sort[i] == 'h')
-			;	/* sort_job_by_shared */
+			;	/* sort_job_by_over_subscribe, not supported */
 		else if (params.sort[i] == 'H')
 			list_sort(job_list, _sort_job_by_sockets);
 		else if (params.sort[i] == 'i')
@@ -294,7 +294,7 @@ static int _sort_job_by_batch_host(void *void1, void *void2)
 		val1 = job1->batch_host;
 	if (job2->batch_host)
 		val2 = job2->batch_host;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -314,7 +314,7 @@ static int _sort_job_by_gres(void *void1, void *void2)
 		val1 = job1->gres;
 	if (job2->gres)
 		val2 = job2->gres;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -350,7 +350,7 @@ static int _sort_job_by_group_name(void *void1, void *void2)
 		name1 = group_info->gr_name;
 	if ((group_info = getgrgid((gid_t) job2->group_id)))
 		name2 = group_info->gr_name;
-	diff = strcmp(name1, name2);
+	diff = xstrcmp(name1, name2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -399,7 +399,7 @@ static int _sort_job_by_name(void *void1, void *void2)
 		val1 = job1->name;
 	if (job2->name)
 		val2 = job2->name;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -434,7 +434,7 @@ static int _sort_job_by_node_list(void *void1, void *void2)
 	hostlist_destroy(hostlist2);
 
 #if	PURE_ALPHA_SORT
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 #else
 	for (inx=0; ; inx++) {
 		if (val1[inx] == val2[inx]) {
@@ -449,7 +449,7 @@ static int _sort_job_by_node_list(void *void1, void *void2)
 			num2 = atoi(val2+inx);
 			diff = num1 - num2;
 		} else
-			diff = strcmp(val1, val2);
+			diff = xstrcmp(val1, val2);
 		break;
 	}
 #endif
@@ -603,8 +603,8 @@ static int _sort_job_by_state(void *void1, void *void2)
 
 	_get_job_info_from_void(&job1, &job2, void1, void2);
 
-	diff = strcmp(job_state_string(job1->job_state),
-			 job_state_string(job2->job_state));
+	diff = xstrcmp(job_state_string(job1->job_state),
+		       job_state_string(job2->job_state));
 
 	if (reverse_order)
 		diff = -diff;
@@ -619,8 +619,8 @@ static int _sort_job_by_state_compact(void *void1, void *void2)
 
 	_get_job_info_from_void(&job1, &job2, void1, void2);
 
-	diff = strcmp(job_state_string_compact(job1->job_state),
-	              job_state_string_compact(job2->job_state));
+	diff = xstrcmp(job_state_string_compact(job1->job_state),
+		       job_state_string_compact(job2->job_state));
 
 	if (reverse_order)
 		diff = -diff;
@@ -786,7 +786,7 @@ static int _sort_job_by_user_name(void *void1, void *void2)
 
 	name1 = uid_to_string_cached((uid_t) job1->user_id);
 	name2 = uid_to_string_cached((uid_t) job2->user_id);
-	diff = strcmp(name1, name2);
+	diff = xstrcmp(name1, name2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -806,7 +806,7 @@ static int _sort_job_by_reservation(void *void1, void *void2)
 		val1 = job1->resv_name;
 	if (job2->resv_name)
 		val2 = job2->resv_name;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -829,7 +829,7 @@ static int _sort_step_by_gres(void *void1, void *void2)
 		val1 = step1->gres;
 	if (step2->gres)
 		val2 = step2->gres;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -882,7 +882,7 @@ static int _sort_step_by_node_list(void *void1, void *void2)
 	hostlist_destroy(hostlist2);
 
 #if	PURE_ALPHA_SORT
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 #else
 	for (inx=0; ; inx++) {
 		if (val1[inx] == val2[inx]) {
@@ -897,7 +897,7 @@ static int _sort_step_by_node_list(void *void1, void *void2)
 			num2 = atoi(val2+inx);
 			diff = num1 - num2;
 		} else
-			diff = strcmp(val1, val2);
+			diff = xstrcmp(val1, val2);
 		break;
 	}
 #endif
@@ -924,7 +924,7 @@ static int _sort_step_by_partition(void *void1, void *void2)
 		val1 = step1->partition;
 	if (step2->partition)
 		val2 = step2->partition;
-	diff = strcmp(val1, val2);
+	diff = xstrcmp(val1, val2);
 
 	if (reverse_order)
 		diff = -diff;
@@ -1005,7 +1005,7 @@ static int _sort_step_by_user_name(void *void1, void *void2)
 
 	name1 = uid_to_string_cached((uid_t) step1->user_id);
 	name2 = uid_to_string_cached((uid_t) step2->user_id);
-	diff = strcmp(name1, name2);
+	diff = xstrcmp(name1, name2);
 
 	if (reverse_order)
 		diff = -diff;
diff --git a/src/sreport/Makefile.in b/src/sreport/Makefile.in
index bc591c0b1..64f95c7d4 100644
--- a/src/sreport/Makefile.in
+++ b/src/sreport/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sreport$(EXEEXT)
 subdir = src/sreport
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sreport/cluster_reports.c b/src/sreport/cluster_reports.c
index c816b19d1..60b01dd7f 100644
--- a/src/sreport/cluster_reports.c
+++ b/src/sreport/cluster_reports.c
@@ -84,6 +84,8 @@ static int _set_wckey_cond(int *start, int argc, char *argv[],
 
 	if (!wckey_cond->cluster_list)
 		wckey_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(wckey_cond->cluster_list, cluster_flag);
 
 	for (i = (*start); i < argc; i++) {
 		end = parse_option_end(argv[i]);
@@ -150,6 +152,7 @@ static int _set_wckey_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(wckey_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(wckey_cond->cluster_list, temp);
@@ -189,6 +192,9 @@ static int _set_assoc_cond(int *start, int argc, char *argv[],
 
 	if (!assoc_cond->cluster_list)
 		assoc_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(assoc_cond->cluster_list, cluster_flag);
+
 	for (i = (*start); i < argc; i++) {
 		end = parse_option_end(argv[i]);
 		if (!end)
@@ -252,6 +258,7 @@ static int _set_assoc_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(assoc_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(assoc_cond->cluster_list, temp);
@@ -290,6 +297,9 @@ static int _set_cluster_cond(int *start, int argc, char *argv[],
 
 	if (!cluster_cond->cluster_list)
 		cluster_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(cluster_cond->cluster_list, cluster_flag);
+
 	for (i = (*start); i < argc; i++) {
 		end = parse_option_end(argv[i]);
 		if (!end)
@@ -332,6 +342,7 @@ static int _set_cluster_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(cluster_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(cluster_cond->cluster_list, temp);
diff --git a/src/sreport/common.c b/src/sreport/common.c
index 562c9f9a1..38b5d381b 100644
--- a/src/sreport/common.c
+++ b/src/sreport/common.c
@@ -207,7 +207,8 @@ extern void addto_char_list(List char_list, char *names)
 					memcpy(name, names+start, (i-start));
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -226,7 +227,7 @@ extern void addto_char_list(List char_list, char *names)
 			name = xmalloc((i-start)+1);
 			memcpy(name, names+start, (i-start));
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -282,7 +283,7 @@ extern int sort_user_dec(void *v1, void *v2)
 	if (!user_a->name || !user_b->name)
 		return 0;
 
-	diff = strcmp(user_a->name, user_b->name);
+	diff = xstrcmp(user_a->name, user_b->name);
 
 	if (diff > 0)
 		return 1;
@@ -313,7 +314,7 @@ extern int sort_cluster_dec(void *v1, void *v2)
 	if (!cluster_a->name || !cluster_b->name)
 		return 0;
 
-	diff = strcmp(cluster_a->name, cluster_b->name);
+	diff = xstrcmp(cluster_a->name, cluster_b->name);
 
 	if (diff > 0)
 		return 1;
@@ -345,7 +346,7 @@ extern int sort_assoc_dec(void *v1, void *v2)
 	if (!assoc_a->acct || !assoc_b->acct)
 		return 0;
 
-	diff = strcmp(assoc_a->acct, assoc_b->acct);
+	diff = xstrcmp(assoc_a->acct, assoc_b->acct);
 
 	if (diff > 0)
 		return 1;
@@ -357,7 +358,7 @@ extern int sort_assoc_dec(void *v1, void *v2)
 	else if (!assoc_b->user)
 		return -1;
 
-	diff = strcmp(assoc_a->user, assoc_b->user);
+	diff = xstrcmp(assoc_a->user, assoc_b->user);
 
 	if (diff > 0)
 		return 1;
@@ -386,7 +387,7 @@ extern int sort_reservations_dec(void *v1, void *v2)
 	if (!resv_a->cluster || !resv_b->cluster)
 		return 0;
 
-	diff = strcmp(resv_a->cluster, resv_b->cluster);
+	diff = xstrcmp(resv_a->cluster, resv_b->cluster);
 
 	if (diff > 0)
 		return 1;
@@ -396,7 +397,7 @@ extern int sort_reservations_dec(void *v1, void *v2)
 	if (!resv_a->name || !resv_b->name)
 		return 0;
 
-	diff = strcmp(resv_a->name, resv_b->name);
+	diff = xstrcmp(resv_a->name, resv_b->name);
 
 	if (diff > 0)
 		return 1;
diff --git a/src/sreport/job_reports.c b/src/sreport/job_reports.c
index 353808913..5deed06d4 100644
--- a/src/sreport/job_reports.c
+++ b/src/sreport/job_reports.c
@@ -85,7 +85,7 @@ static int _sort_cluster_grouping_dec(void *v1, void *v2)
 	if (!cluster_a->cluster || !cluster_b->cluster)
 		return 0;
 
-	diff = strcmp(cluster_a->cluster, cluster_b->cluster);
+	diff = xstrcmp(cluster_a->cluster, cluster_b->cluster);
 
 	if (diff > 0)
 		return 1;
@@ -126,7 +126,7 @@ static int _sort_acct_grouping_dec(void *v1, void *v2)
 	if ((wckey_b = strstr(tmp_acct_b, ":")))
 		*wckey_b++ = 0;
 
-	diff = strcmp(tmp_acct_a, tmp_acct_b);
+	diff = xstrcmp(tmp_acct_a, tmp_acct_b);
 
 	if (diff > 0)
 		return 1;
@@ -136,7 +136,7 @@ static int _sort_acct_grouping_dec(void *v1, void *v2)
 	if (!wckey_a || !wckey_b)
 		return 0;
 
-	diff = strcmp(wckey_a, wckey_b);
+	diff = xstrcmp(wckey_a, wckey_b);
 
 	if (diff > 0)
 		return 1;
@@ -196,7 +196,8 @@ static int _addto_uid_char_list(List char_list, char *names)
 					name = _string_to_uid( name );
 
 					while ((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -224,7 +225,7 @@ static int _addto_uid_char_list(List char_list, char *names)
 			name = _string_to_uid( name );
 
 			while ((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
@@ -252,6 +253,8 @@ static int _set_cond(int *start, int argc, char *argv[],
 
 	if (!job_cond->cluster_list)
 		job_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(job_cond->cluster_list, cluster_flag);
 
 	for (i = (*start); i < argc; i++) {
 		end = parse_option_end(argv[i]);
@@ -399,6 +402,7 @@ static int _set_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(job_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(job_cond->cluster_list, temp);
@@ -526,7 +530,7 @@ static int _setup_grouping_print_fields_list(List grouping_list)
 	uint32_t size = 0;
 	char *tmp_char = NULL, *tres_type;
 
-	if (!tres_str || !strcasecmp(tres_str, "cpu"))
+	if (!tres_str || !xstrcasecmp(tres_str, "cpu"))
 		tres_type = "CPUs";
 	else
 		tres_type = "TRES";
diff --git a/src/sreport/resv_reports.c b/src/sreport/resv_reports.c
index ec451a6f3..6a789d9ae 100644
--- a/src/sreport/resv_reports.c
+++ b/src/sreport/resv_reports.c
@@ -91,6 +91,9 @@ static int _set_resv_cond(int *start, int argc, char *argv[],
 
 	if (!resv_cond->cluster_list)
 		resv_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(resv_cond->cluster_list, cluster_flag);
+
 	for (i=(*start); i<argc; i++) {
 		end = parse_option_end(argv[i]);
 		if (!end)
@@ -164,6 +167,7 @@ static int _set_resv_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(resv_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(resv_cond->cluster_list, temp);
diff --git a/src/sreport/sreport.c b/src/sreport/sreport.c
index e9090545c..224fad610 100644
--- a/src/sreport/sreport.c
+++ b/src/sreport/sreport.c
@@ -58,6 +58,7 @@ int quiet_flag;		/* quiet=1, verbose=-1, normal=0 */
 char *tres_str = NULL;	/* --tres= value */
 List tres_list;		/* TRES to report, built from --tres= value */
 int all_clusters_flag = 0;
+char *cluster_flag = NULL;
 slurmdb_report_time_format_t time_format = SLURMDB_REPORT_TIME_MINS;
 char *time_format_string = "Minutes";
 void *db_conn = NULL;
@@ -87,6 +88,7 @@ main (int argc, char *argv[])
 	int option_index;
 	static struct option long_options[] = {
 		{"all_clusters", 0, 0, 'a'},
+		{"cluster",  1, 0, 'M'},
 		{"help",     0, 0, 'h'},
 		{"immediate",0, 0, 'i'},
 		{"noheader", 0, 0, 'n'},
@@ -111,8 +113,8 @@ main (int argc, char *argv[])
 
 	/* Check to see if we are running a supported accounting plugin */
 	temp = slurm_get_accounting_storage_type();
-	if (strcasecmp(temp, "accounting_storage/slurmdbd")
-	   && strcasecmp(temp, "accounting_storage/mysql")) {
+	if (xstrcasecmp(temp, "accounting_storage/slurmdbd")
+	   && xstrcasecmp(temp, "accounting_storage/mysql")) {
 		fprintf (stderr, "You are not running a supported "
 			 "accounting_storage plugin\n(%s).\n"
 			 "Only 'accounting_storage/slurmdbd' "
@@ -127,7 +129,7 @@ main (int argc, char *argv[])
 	if (temp)
 		tres_str = xstrdup(temp);
 
-	while ((opt_char = getopt_long(argc, argv, "ahnpPQs:t:T:vV",
+	while ((opt_char = getopt_long(argc, argv, "aM:hnpPQs:t:T:vV",
 			long_options, &option_index)) != -1) {
 		switch (opt_char) {
 		case (int)'?':
@@ -142,6 +144,9 @@ main (int argc, char *argv[])
 		case (int)'a':
 			all_clusters_flag = 1;
 			break;
+		case (int) 'M':
+			cluster_flag = xstrdup(optarg);
+			break;
 		case (int)'n':
 			print_fields_have_header = 0;
 			break;
@@ -213,6 +218,10 @@ main (int argc, char *argv[])
 	}
 	if (exit_flag == 2)
 		putchar('\n');
+
+	/* Free the cluster grabbed from the -M option */
+	xfree(cluster_flag);
+
 	slurmdb_connection_close(&db_conn);
 	slurm_acct_storage_fini();
 	exit(exit_code);
@@ -243,7 +252,7 @@ static List _build_tres_list(char *tres_str)
 				   tres->name ? tres->name : "");
 			tok = strtok_r(tres_tmp, ",", &save_ptr);
 			while (tok) {
-				if (!strcasecmp(tres_tmp2, tok))
+				if (!xstrcasecmp(tres_tmp2, tok))
 					break;
 				tok = strtok_r(NULL, ",", &save_ptr);
 			}
@@ -446,10 +455,10 @@ _get_command (int *argc, char **argv)
 		exit_flag = 2;
 		return 0;
 	}
-	else if (strncmp (in_line, "#", 1) == 0) {
+	else if (xstrncmp (in_line, "#", 1) == 0) {
 		free (in_line);
 		return 0;
-	} else if (strcmp (in_line, "!!") == 0) {
+	} else if (xstrcmp (in_line, "!!") == 0) {
 		free (in_line);
 		in_line = last_in_line;
 		in_line_size = last_in_line_size;
diff --git a/src/sreport/sreport.h b/src/sreport/sreport.h
index 68d6347d5..a513efae1 100644
--- a/src/sreport/sreport.h
+++ b/src/sreport/sreport.h
@@ -113,6 +113,7 @@ extern void *db_conn;
 extern uint32_t my_uid;
 extern int all_clusters_flag;
 extern slurmdb_report_sort_t sort_flag;
+extern char *cluster_flag;
 
 extern void slurmdb_report_print_time(print_field_t *field,
 			       uint64_t value, uint64_t total_time, int last);
diff --git a/src/sreport/user_reports.c b/src/sreport/user_reports.c
index 8071268ab..0b3baf8c9 100644
--- a/src/sreport/user_reports.c
+++ b/src/sreport/user_reports.c
@@ -81,6 +81,9 @@ static int _set_cond(int *start, int argc, char *argv[],
 
 	if (!assoc_cond->cluster_list)
 		assoc_cond->cluster_list = list_create(slurm_destroy_char);
+	if (cluster_flag)
+		slurm_addto_char_list(assoc_cond->cluster_list, cluster_flag);
+
 	for (i = (*start); i < argc; i++) {
 		end = parse_option_end(argv[i]);
 		if (!end)
@@ -145,6 +148,7 @@ static int _set_cond(int *start, int argc, char *argv[],
 	(*start) = i;
 
 	if (!local_cluster_flag && !list_count(assoc_cond->cluster_list)) {
+		/* Get the default Cluster since no cluster is specified */
 		char *temp = slurm_get_cluster_name();
 		if (temp)
 			list_append(assoc_cond->cluster_list, temp);
diff --git a/src/srun/Makefile.am b/src/srun/Makefile.am
index cd7d7d68b..6d25221a4 100644
--- a/src/srun/Makefile.am
+++ b/src/srun/Makefile.am
@@ -10,8 +10,10 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun
 bin_PROGRAMS = srun
 
 convenience_libs = $(top_builddir)/src/srun/libsrun/libsrun.la \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
 	$(top_builddir)/src/api/libslurm.o
 
+
 srun_SOURCES = \
 	srun.c \
 	srun_pty.c srun_pty.h \
diff --git a/src/srun/Makefile.in b/src/srun/Makefile.in
index 1f99f7af5..15499fefe 100644
--- a/src/srun/Makefile.in
+++ b/src/srun/Makefile.in
@@ -98,7 +98,8 @@ bin_PROGRAMS = srun$(EXEEXT)
 @BGQ_LOADED_TRUE@am__append_1 = $(RUNJOB_LDFLAGS)
 subdir = src/srun
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -111,7 +112,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -124,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -131,6 +132,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -139,7 +141,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -270,8 +271,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -371,6 +370,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -409,6 +412,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -452,6 +458,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -502,6 +511,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -519,6 +529,7 @@ AUTOMAKE_OPTIONS = foreign
 CLEANFILES = core.*
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/src/srun/libsrun
 convenience_libs = $(top_builddir)/src/srun/libsrun/libsrun.la \
+	$(top_builddir)/src/bcast/libfile_bcast.la \
 	$(top_builddir)/src/api/libslurm.o
 
 srun_SOURCES = \
diff --git a/src/srun/libsrun/Makefile.in b/src/srun/libsrun/Makefile.in
index ec55199fe..58fcf2ff5 100644
--- a/src/srun/libsrun/Makefile.in
+++ b/src/srun/libsrun/Makefile.in
@@ -93,7 +93,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = src/srun/libsrun
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -106,7 +107,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -119,6 +119,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -126,6 +127,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -134,7 +136,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -222,8 +223,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -323,6 +322,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -361,6 +364,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -404,6 +410,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -454,6 +463,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/srun/libsrun/allocate.c b/src/srun/libsrun/allocate.c
index f6cc1b4ba..8b31f7ccb 100644
--- a/src/srun/libsrun/allocate.c
+++ b/src/srun/libsrun/allocate.c
@@ -401,7 +401,7 @@ static int _wait_nodes_ready(resource_allocation_response_msg_t *alloc)
 		char *tmp_str;
 		if (i > 0)
      			verbose("Nodes %s are ready for job", alloc->node_list);
-		if (alloc->alias_list && !strcmp(alloc->alias_list, "TBD") &&
+		if (alloc->alias_list && !xstrcmp(alloc->alias_list, "TBD") &&
 		    (slurm_allocation_lookup_lite(pending_job_id, &resp)
 		     == SLURM_SUCCESS)) {
 			tmp_str = alloc->alias_list;
@@ -667,7 +667,7 @@ job_desc_msg_create_from_opts (void)
 	if (opt.core_spec != (uint16_t) NO_VAL)
 		j->core_spec      = opt.core_spec;
 	j->features       = opt.constraints;
-	if (opt.gres && strcasecmp(opt.gres, "NONE"))
+	if (opt.gres && xstrcasecmp(opt.gres, "NONE"))
 		j->gres   = opt.gres;
 	if (opt.immediate == 1)
 		j->immediate = opt.immediate;
@@ -754,6 +754,8 @@ job_desc_msg_create_from_opts (void)
 		j->burst_buffer = opt.burst_buffer;
 	if (opt.begin)
 		j->begin_time = opt.begin;
+	if (opt.deadline)
+		j->deadline = opt.deadline;
 	if (opt.licenses)
 		j->licenses = opt.licenses;
 	if (opt.network)
@@ -839,6 +841,8 @@ job_desc_msg_create_from_opts (void)
 		j->warn_signal = opt.warn_signal;
 	if (opt.warn_time)
 		j->warn_time = opt.warn_time;
+	if (opt.job_flags)
+		j->bitflags = opt.job_flags;
 
 	if (opt.cpu_freq_min != NO_VAL)
 		j->cpu_freq_min = opt.cpu_freq_min;
@@ -864,8 +868,8 @@ job_desc_msg_create_from_opts (void)
 
 	if (opt.power_flags)
 		j->power_flags = opt.power_flags;
-	if (opt.sicp_mode)
-		j->sicp_mode = opt.sicp_mode;
+	if (opt.mcs_label)
+		j->mcs_label = opt.mcs_label;
 
 	return j;
 }
diff --git a/src/srun/libsrun/allocate.h b/src/srun/libsrun/allocate.h
index 13aa11f59..b10fbb364 100644
--- a/src/srun/libsrun/allocate.h
+++ b/src/srun/libsrun/allocate.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  * src/srun/allocate.h - node allocation functions for srun
- * $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/srun/libsrun/debugger.c b/src/srun/libsrun/debugger.c
index 3d97ba6de..81b258940 100644
--- a/src/srun/libsrun/debugger.c
+++ b/src/srun/libsrun/debugger.c
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  debugger.c - Definitions needed for parallel debugger
- *  $Id: debugger.c 11149 2007-03-14 20:53:19Z morrone $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
diff --git a/src/srun/libsrun/fname.c b/src/srun/libsrun/fname.c
index eda688942..6d48b4866 100644
--- a/src/srun/libsrun/fname.c
+++ b/src/srun/libsrun/fname.c
@@ -70,11 +70,12 @@ fname_create(srun_job_t *job, char *format)
 	unsigned int wid     = 0;
 	unsigned long int taskid  = 0;
 	fname_t *fname = NULL;
-	char *p, *q, *name, *tmp_env;
+	char *p, *q, *name, *tmp_env, *tmp_perc;
 	uint32_t array_job_id  = job->jobid;
 	uint32_t array_task_id = NO_VAL;
 	char *esc;
 	char *end;
+	bool double_p = false;
 
 	fname = xmalloc(sizeof(*fname));
 	fname->type = IO_ALL;
@@ -86,12 +87,12 @@ fname_create(srun_job_t *job, char *format)
 
 	if ((format == NULL)
 	    || (strncasecmp(format, "all", (size_t) 3) == 0)
-	    || (strncmp(format, "-", (size_t) 1) == 0)       ) {
-		 /* "all" explicitly sets IO_ALL and is the default */
+	    || (xstrncmp(format, "-", (size_t) 1) == 0)       ) {
+		/* "all" explicitly sets IO_ALL and is the default */
 		return fname;
 	}
 
-	if (strcasecmp(format, "none") == 0) {
+	if (xstrcasecmp(format, "none") == 0) {
 		/*
 		 * Set type to IO_PER_TASK so that /dev/null is opened
 		 *  on every node, which should be more efficient
@@ -122,10 +123,20 @@ fname_create(srun_job_t *job, char *format)
 		return fname;
 	}
 
+	tmp_perc = NULL;
 	name = NULL;
 	q = p = format;
 	while (*p != '\0') {
 		if (*p == '%') {
+			if (*(p+1) == '%') {
+				p++;
+				double_p = true;
+				xmemcat(name, q, p);
+				/* Save the removed % just in case */
+				xstrcat(tmp_perc, "%");
+				q = ++p;
+				continue;
+			}
 			if (isdigit(*(++p))) {
 				unsigned long in_width = 0;
 				xmemcat(name, q, p - 1);
@@ -139,67 +150,122 @@ fname_create(srun_job_t *job, char *format)
 			}
 
 			switch (*p) {
-			 case 'a':  /* '%a' => array task id   */
+			case 'a':  /* '%a' => array task id   */
 				tmp_env = getenv("SLURM_ARRAY_TASK_ID");
 				if (tmp_env)
-					array_task_id = strtoul(tmp_env, &end, 10);
+					array_task_id = strtoul(tmp_env, &end,
+								10);
 				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, array_task_id);
+				xstrfmtcat(name, "%0*u", wid,
+					   array_task_id);
+				xfree(tmp_perc);
+				tmp_perc = NULL;
 				q = ++p;
 				break;
-			 case 'A':  /* '%A' => array master job id */
+			case 'A':  /* '%A' => array master job id */
 				tmp_env = getenv("SLURM_ARRAY_JOB_ID");
 				if (tmp_env)
-					array_job_id = strtoul(tmp_env, &end, 10);
+					array_job_id = strtoul(tmp_env, &end,
+							       10);
 				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%0*u", wid, array_job_id);
+				xstrfmtcat(name, "%0*u", wid,
+					   array_job_id);
+				xfree(tmp_perc);
+				tmp_perc = NULL;
 				q = ++p;
 				break;
-
-			 case 't':  /* '%t' => taskid         */
-			 case 'n':  /* '%n' => nodeid         */
-			 case 'N':  /* '%N' => node name      */
-
-				 fname->type = IO_PER_TASK;
-				 if (wid)
-					 xstrcatchar(name, '%');
-				 p++;
-				 break;
-
-			 case 'J':  /* '%J' => "jobid.stepid" */
-			 case 'j':  /* '%j' => jobid          */
-
-				 xmemcat(name, q, p - 1);
-				 xstrfmtcat(name, "%0*d", wid, job->jobid);
-
-				 if ((*p == 'J') && (job->stepid != NO_VAL))
-					 xstrfmtcat(name, ".%d", job->stepid);
-				 q = ++p;
-				 break;
-
-			 case 's':  /* '%s' => stepid         */
-				 xmemcat(name, q, p - 1);
-				 xstrfmtcat(name, "%0*d", wid, job->stepid);
-				 q = ++p;
-				 break;
-
-			 case 'u':  /* '%u' => username       */
+			case 'J':  /* '%J' => "jobid.stepid" */
+			case 'j':  /* '%j' => jobid          */
+				xmemcat(name, q, p - 1);
+				xstrfmtcat(name, "%0*d", wid,
+					   job->jobid);
+
+				if ((*p == 'J') && (job->stepid !=
+						    NO_VAL))
+					xstrfmtcat(name, ".%d",
+						   job->stepid);
+				xfree(tmp_perc);
+				tmp_perc = NULL;
+				q = ++p;
+				break;
+			case 's':  /* '%s' => stepid         */
 				xmemcat(name, q, p - 1);
-				xstrfmtcat(name, "%s", opt.user);
+				xstrfmtcat(name, "%0*d", wid,
+					   job->stepid);
+				xfree(tmp_perc);
+				tmp_perc = NULL;
 				q = ++p;
 				break;
+			case 'u':  /* '%u' => username       */
+			case 't':  /* '%t' => taskid         */
+			case 'n':  /* '%n' => nodeid         */
+			case 'N':  /* '%N' => node name      */
+				fname->type = IO_PER_TASK;
+				if (double_p)
+					xstrcat(name, tmp_perc);
+
+				if (wid) { /* Put the width back and
+					    * the removed %, so the
+					    * slurmstepd can remove it */
+					xstrcat(name,
+						xstrdup_printf("%%%u", wid));
+
+				} else {
+					xmemcat(name, q, p);
+				}
+				xfree(tmp_perc);
+				tmp_perc = NULL;
+				q = p;
+				p++;
+				break;
+			default:
+				break;
+			}
+
+			double_p = false;
+		} else if (double_p) {
+			/* special case when there is a
+			 * double percent and a t, n, or N
+			 */
+			double_p = false;
+
+			if (isdigit(*p))
+				wid = strtoul(p, &p, 10);
 
-			 default:
-				 break;
+			switch (*p) {
+			case 'u':  /* '%u' => username       */
+			case 't':  /* '%t' => taskid         */
+			case 'n':  /* '%n' => nodeid         */
+			case 'N':  /* '%N' => node name      */
+				fname->type = IO_PER_TASK;
+				/* Put back all the removed % */
+				xstrcat(name, tmp_perc);
+				if (wid) { /* Put the width back and
+					    * the removed %, so the
+					    * step can remove it
+					    */
+					xstrcat(name,
+						xstrdup_printf("%u", wid));
+					q = p;
+				}
+				xfree(tmp_perc);
+				tmp_perc = NULL;
+				p++;
+				break;
+			default:
+				break;
 			}
-			wid = 0;
+
+
 		} else
 			p++;
+		wid = 0;
 	}
 
 	if (q != p)
 		xmemcat(name, q, p);
 
+	xfree(tmp_perc);
 	fname->name = name;
 	return fname;
 }
diff --git a/src/srun/libsrun/launch.c b/src/srun/libsrun/launch.c
index c50dc40fb..e35d3b3ae 100644
--- a/src/srun/libsrun/launch.c
+++ b/src/srun/libsrun/launch.c
@@ -450,7 +450,7 @@ extern void launch_common_set_stdio_fds(srun_job_t *job,
 		}
 		if (job->ofname->name != NULL
 		    && job->efname->name != NULL
-		    && !strcmp(job->ofname->name, job->efname->name)) {
+		    && !xstrcmp(job->ofname->name, job->efname->name)) {
 			err_shares_out = true;
 		}
 	}
diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c
index e16e4ff6e..732e2faa2 100644
--- a/src/srun/libsrun/opt.c
+++ b/src/srun/libsrun/opt.c
@@ -106,6 +106,7 @@
 #define OPT_DISTRIB     0x04
 #define OPT_NODES       0x05
 #define OPT_OVERCOMMIT  0x06
+#define OPT_COMPRESS	0x07
 #define OPT_CONN_TYPE	0x08
 #define OPT_RESV_PORTS	0x09
 #define OPT_NO_ROTATE	0x0a
@@ -125,7 +126,7 @@
 #define OPT_TIME_VAL    0x18
 #define OPT_CPU_FREQ    0x19
 #define OPT_CORE_SPEC   0x1a
-#define OPT_SICP        0x1b
+#define OPT_GRES_FLAGS	0x1b
 #define OPT_POWER       0x1c
 #define OPT_THREAD_SPEC 0x1d
 #define OPT_BCAST       0x1e
@@ -148,7 +149,7 @@
 #define LONG_OPT_GID         0x10b
 #define LONG_OPT_MPI         0x10c
 #define LONG_OPT_RESV_PORTS  0x10d
-#define LONG_OPT_SICP        0x10e
+#define LONG_OPT_COMPRESS    0x10e
 #define LONG_OPT_POWER       0x10f
 #define LONG_OPT_DEBUG_TS    0x110
 #define LONG_OPT_CONNTYPE    0x111
@@ -201,7 +202,7 @@
 #define LONG_OPT_DEBUG_SLURMD    0x14f
 #define LONG_OPT_TIME_MIN        0x150
 #define LONG_OPT_GRES            0x151
-
+#define LONG_OPT_GRES_FLAGS      0x152
 #define LONG_OPT_REQ_SWITCH      0x153
 #define LONG_OPT_LAUNCHER_OPTS   0x154
 #define LONG_OPT_CPU_FREQ        0x155
@@ -210,6 +211,8 @@
 #define LONG_OPT_EXPORT          0x158
 #define LONG_OPT_PRIORITY        0x160
 #define LONG_OPT_ACCEL_BIND      0x161
+#define LONG_OPT_MCS_LABEL       0x165
+#define LONG_OPT_DEADLINE        0x166
 
 extern char **environ;
 
@@ -274,7 +277,7 @@ int initialize_and_process_args(int argc, char *argv[])
 
 	if (opt.launch_cmd) {
 		char *launch_type = slurm_get_launch_type();
-		if (!strcmp(launch_type, "launch/slurm")) {
+		if (!xstrcmp(launch_type, "launch/slurm")) {
 			error("--launch-cmd option is invalid with %s",
 			      launch_type);
 			xfree(launch_type);
@@ -387,7 +390,7 @@ static void _opt_default(void)
 	uid_t uid = getuid();
 
 	opt.user = uid_to_string(uid);
-	if (strcmp(opt.user, "nobody") == 0)
+	if (xstrcmp(opt.user, "nobody") == 0)
 		fatal("Invalid user id: %u", uid);
 
 	opt.uid = uid;
@@ -511,6 +514,7 @@ static void _opt_default(void)
 	opt.linuximage = NULL;
 	opt.mloaderimage = NULL;
 	opt.ramdiskimage = NULL;
+	opt.job_flags = 0;
 
 	opt.euid	    = (uid_t) -1;
 	opt.egid	    = (gid_t) -1;
@@ -549,8 +553,8 @@ static void _opt_default(void)
 
 	opt.nice = NO_VAL;
 	opt.priority = 0;
-	opt.sicp_mode = 0;
 	opt.power_flags = 0;
+	opt.mcs_label = NULL;
 }
 
 /*---[ env var processing ]-----------------------------------------------*/
@@ -581,6 +585,7 @@ env_vars_t env_vars[] = {
 {"SLURM_CHECKPOINT",    OPT_STRING,     &opt.ckpt_interval_str, NULL         },
 {"SLURM_CHECKPOINT_DIR",OPT_STRING,     &opt.ckpt_dir,      NULL             },
 {"SLURM_CNLOAD_IMAGE",  OPT_STRING,     &opt.linuximage,    NULL             },
+{"SLURM_COMPRESS",      OPT_COMPRESS,   NULL,               NULL             },
 {"SLURM_CONN_TYPE",     OPT_CONN_TYPE,  NULL,               NULL             },
 {"SLURM_CORE_SPEC",     OPT_INT,        &opt.core_spec,     NULL             },
 {"SLURM_CPUS_PER_TASK", OPT_INT,        &opt.cpus_per_task, &opt.cpus_set    },
@@ -594,6 +599,7 @@ env_vars_t env_vars[] = {
 {"SLURM_EXPORT_ENV",    OPT_STRING,     &opt.export_env,    NULL             },
 {"SLURM_GEOMETRY",      OPT_GEOMETRY,   NULL,               NULL             },
 {"SLURM_GRES",          OPT_STRING,     &opt.gres,          NULL             },
+{"SLURM_GRES_FLAGS",    OPT_GRES_FLAGS, NULL,               NULL             },
 {"SLURM_HINT",          OPT_HINT,       NULL,               NULL             },
 {"SLURM_IMMEDIATE",     OPT_IMMEDIATE,  NULL,               NULL             },
 {"SLURM_IOLOAD_IMAGE",  OPT_STRING,     &opt.ramdiskimage,  NULL             },
@@ -632,7 +638,6 @@ env_vars_t env_vars[] = {
 {"SLURM_RESERVATION",   OPT_STRING,     &opt.reservation,   NULL             },
 {"SLURM_RESTART_DIR",   OPT_STRING,     &opt.restart_dir ,  NULL             },
 {"SLURM_RESV_PORTS",    OPT_RESV_PORTS, NULL,               NULL             },
-{"SLURM_SICP",          OPT_SICP,       NULL,               NULL             },
 {"SLURM_SIGNAL",        OPT_SIGNAL,     NULL,               NULL             },
 {"SLURM_SRUN_MULTI",    OPT_MULTI,      NULL,               NULL             },
 {"SLURM_STDERRMODE",    OPT_STRING,     &opt.efname,        NULL             },
@@ -704,8 +709,12 @@ _process_env_var(env_vars_t *e, const char *val)
 		}
 		break;
 
+	case OPT_COMPRESS:
+		opt.compress = parse_compress_type(val);
+		break;
+
 	case OPT_DISTRIB:
-		if (strcmp(val, "unknown") == 0)
+		if (xstrcmp(val, "unknown") == 0)
 			break;	/* ignore it, passed from salloc */
 		dt = verify_dist_type(val, &opt.plane_size);
 		if (dt == SLURM_DIST_UNKNOWN) {
@@ -762,9 +771,11 @@ _process_env_var(env_vars_t *e, const char *val)
 	case OPT_EXCLUSIVE:
 		if (val[0] == '\0') {
 			opt.exclusive = true;
-			opt.shared = 0;
-		} else if (!strcasecmp(val, "user")) {
-			opt.shared = 2;
+			opt.shared = JOB_SHARED_NONE;
+		} else if (!xstrcasecmp(val, "user")) {
+			opt.shared = JOB_SHARED_USER;
+		} else if (!xstrcasecmp(val, "mcs")) {
+			opt.shared = JOB_SHARED_MCS;
 		} else {
 			error("\"%s=%s\" -- invalid value, ignoring...",
 			      e->var, val);
@@ -815,6 +826,16 @@ _process_env_var(env_vars_t *e, const char *val)
 		}
 		break;
 
+	case OPT_GRES_FLAGS:
+		if (!xstrcasecmp(val, "enforce-binding")) {
+			opt.job_flags |= GRES_ENFORCE_BIND;
+		} else {
+			error("Invalid SLURM_GRES_FLAGS specification: %s",
+			      val);
+			exit(error_exit);
+		}
+		break;
+
 	case OPT_IMMEDIATE:
 		if (val)
 			opt.immediate = strtol(val, NULL, 10);
@@ -851,9 +872,6 @@ _process_env_var(env_vars_t *e, const char *val)
 	case OPT_POWER:
 		opt.power_flags = power_flags_id((char *)val);
 		break;
-	case OPT_SICP:
-		opt.sicp_mode = 1;
-		break;
 	case OPT_THREAD_SPEC:
 		opt.core_spec = _get_int(val, "thread_spec", true) |
 					 CORE_SPEC_THREAD;
@@ -905,6 +923,7 @@ static void _set_options(const int argc, char **argv)
 		{"nodes",         required_argument, 0, 'N'},
 		{"output",        required_argument, 0, 'o'},
 		{"overcommit",    no_argument,       0, 'O'},
+		{"oversubscribe", no_argument,       0, 's'},
 		{"partition",     required_argument, 0, 'p'},
 		{"quit-on-interrupt", no_argument,   0, 'q'},
 		{"quiet",            no_argument,    0, 'Q'},
@@ -932,12 +951,14 @@ static void _set_options(const int argc, char **argv)
 		{"checkpoint",       required_argument, 0, LONG_OPT_CHECKPOINT},
 		{"checkpoint-dir",   required_argument, 0, LONG_OPT_CHECKPOINT_DIR},
 		{"cnload-image",     required_argument, 0, LONG_OPT_LINUX_IMAGE},
+		{"compress",         optional_argument, 0, LONG_OPT_COMPRESS},
 		{"comment",          required_argument, 0, LONG_OPT_COMMENT},
 		{"conn-type",        required_argument, 0, LONG_OPT_CONNTYPE},
 		{"contiguous",       no_argument,       0, LONG_OPT_CONT},
 		{"cores-per-socket", required_argument, 0, LONG_OPT_CORESPERSOCKET},
 		{"cpu_bind",         required_argument, 0, LONG_OPT_CPU_BIND},
 		{"cpu-freq",         required_argument, 0, LONG_OPT_CPU_FREQ},
+		{"deadline",         required_argument, 0, LONG_OPT_DEADLINE},
 		{"debugger-test",    no_argument,       0, LONG_OPT_DEBUG_TS},
 		{"epilog",           required_argument, 0, LONG_OPT_EPILOG},
 		{"exclusive",        optional_argument, 0, LONG_OPT_EXCLUSIVE},
@@ -945,6 +966,7 @@ static void _set_options(const int argc, char **argv)
 		{"get-user-env",     optional_argument, 0, LONG_OPT_GET_USER_ENV},
 		{"gid",              required_argument, 0, LONG_OPT_GID},
 		{"gres",             required_argument, 0, LONG_OPT_GRES},
+		{"gres-flags",       required_argument, 0, LONG_OPT_GRES_FLAGS},
 		{"help",             no_argument,       0, LONG_OPT_HELP},
 		{"hint",             required_argument, 0, LONG_OPT_HINT},
 		{"ioload-image",     required_argument, 0, LONG_OPT_RAMDISK_IMAGE},
@@ -955,6 +977,7 @@ static void _set_options(const int argc, char **argv)
 		{"mail-type",        required_argument, 0, LONG_OPT_MAIL_TYPE},
 		{"mail-user",        required_argument, 0, LONG_OPT_MAIL_USER},
 		{"max-exit-timeout", required_argument, 0, LONG_OPT_XTO},
+		{"mcs-label",        required_argument, 0, LONG_OPT_MCS_LABEL},
 		{"mem",              required_argument, 0, LONG_OPT_MEM},
 		{"mem-per-cpu",      required_argument, 0, LONG_OPT_MEM_PER_CPU},
 		{"mem_bind",         required_argument, 0, LONG_OPT_MEM_BIND},
@@ -985,7 +1008,6 @@ static void _set_options(const int argc, char **argv)
 		{"restart-dir",      required_argument, 0, LONG_OPT_RESTART_DIR},
 		{"resv-ports",       optional_argument, 0, LONG_OPT_RESV_PORTS},
 		{"runjob-opts",      required_argument, 0, LONG_OPT_LAUNCHER_OPTS},
-		{"sicp",             optional_argument, 0, LONG_OPT_SICP},
 		{"signal",	     required_argument, 0, LONG_OPT_SIGNAL},
 		{"slurmd-debug",     required_argument, 0, LONG_OPT_DEBUG_SLURMD},
 		{"sockets-per-node", required_argument, 0, LONG_OPT_SOCKETSPERNODE},
@@ -1085,7 +1107,7 @@ static void _set_options(const int argc, char **argv)
 				exit(error_exit);
 			}
 			xfree(opt.efname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.efname = xstrdup("/dev/null");
 			else
 				opt.efname = xstrdup(optarg);
@@ -1107,7 +1129,7 @@ static void _set_options(const int argc, char **argv)
 				exit(error_exit);
 			}
 			xfree(opt.ifname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.ifname = xstrdup("/dev/null");
 			else
 				opt.ifname = xstrdup(optarg);
@@ -1179,7 +1201,7 @@ static void _set_options(const int argc, char **argv)
 				exit(error_exit);
 			}
 			xfree(opt.ofname);
-			if (strcasecmp(optarg, "none") == 0)
+			if (xstrcasecmp(optarg, "none") == 0)
 				opt.ofname = xstrdup("/dev/null");
 			else
 				opt.ofname = xstrdup(optarg);
@@ -1254,18 +1276,28 @@ static void _set_options(const int argc, char **argv)
 		case (int)'Z':
 			opt.no_alloc = true;
 			uname(&name);
-			if (strcasecmp(name.sysname, "AIX") == 0)
+			if (xstrcasecmp(name.sysname, "AIX") == 0)
 				opt.network = xstrdup("ip");
 			break;
 		case LONG_OPT_CONT:
 			opt.contiguous = true;
 			break;
+		case LONG_OPT_DEADLINE:
+			opt.deadline = parse_time(optarg, 0);
+			if (errno == ESLURM_INVALID_TIME_VALUE) {
+				error("Invalid deadline specification %s",
+				       optarg);
+				exit(error_exit);
+			}
+			break;
                 case LONG_OPT_EXCLUSIVE:
 			if (optarg == NULL) {
 				opt.exclusive = true;
-				opt.shared = 0;
-			} else if (!strcasecmp(optarg, "user")) {
-				opt.shared = 2;
+				opt.shared = JOB_SHARED_NONE;
+			} else if (!xstrcasecmp(optarg, "user")) {
+				opt.shared = JOB_SHARED_USER;
+			} else if (!xstrcasecmp(optarg, "mcs")) {
+				opt.shared = JOB_SHARED_MCS;
 			} else {
 				error("invalid exclusive option %s", optarg);
 				exit(error_exit);
@@ -1474,7 +1506,7 @@ static void _set_options(const int argc, char **argv)
 			break;
 		case LONG_OPT_MAIL_TYPE:
 			opt.mail_type |= parse_mail_type(optarg);
-			if (opt.mail_type == 0) {
+			if (opt.mail_type == (uint16_t)INFINITE) {
 				error("--mail-type=%s invalid", optarg);
 				exit(error_exit);
 			}
@@ -1483,6 +1515,11 @@ static void _set_options(const int argc, char **argv)
 			xfree(opt.mail_user);
 			opt.mail_user = xstrdup(optarg);
 			break;
+		case LONG_OPT_MCS_LABEL: {
+			xfree(opt.mcs_label);
+			opt.mcs_label = xstrdup(optarg);
+			break;
+		}
 		case LONG_OPT_TASK_PROLOG:
 			xfree(opt.task_prolog);
 			opt.task_prolog = xstrdup(optarg);
@@ -1496,11 +1533,6 @@ static void _set_options(const int argc, char **argv)
 				opt.nice = strtol(optarg, NULL, 10);
 			else
 				opt.nice = 100;
-			if (abs(opt.nice) > NICE_OFFSET) {
-				error("Invalid nice value, must be between "
-				      "-%d and %d", NICE_OFFSET, NICE_OFFSET);
-				exit(error_exit);
-			}
 			if (opt.nice < 0) {
 				uid_t my_uid = getuid();
 				if ((my_uid != 0) &&
@@ -1685,14 +1717,23 @@ static void _set_options(const int argc, char **argv)
 			opt.time_min_str = xstrdup(optarg);
 			break;
 		case LONG_OPT_GRES:
-			if (!strcasecmp(optarg, "help") ||
-			    !strcasecmp(optarg, "list")) {
+			if (!xstrcasecmp(optarg, "help") ||
+			    !xstrcasecmp(optarg, "list")) {
 				print_gres_help();
 				exit(0);
 			}
 			xfree(opt.gres);
 			opt.gres = xstrdup(optarg);
 			break;
+		case LONG_OPT_GRES_FLAGS:
+			if (!xstrcasecmp(optarg, "enforce-binding")) {
+				opt.job_flags |= GRES_ENFORCE_BIND;
+			} else {
+				error("Invalid gres-flags specification: %s",
+				      optarg);
+				exit(error_exit);
+			}
+			break;
 		case LONG_OPT_CPU_FREQ:
 		        if (cpu_freq_verify_cmdline(optarg, &opt.cpu_freq_min,
 					&opt.cpu_freq_max, &opt.cpu_freq_gov))
@@ -1711,9 +1752,6 @@ static void _set_options(const int argc, char **argv)
 		case LONG_OPT_POWER:
 			opt.power_flags = power_flags_id(optarg);
 			break;
-		case LONG_OPT_SICP:
-			opt.sicp_mode = 1;
-			break;
 		case LONG_OPT_THREAD_SPEC:
 			opt.core_spec = _get_int(optarg, "thread_spec", true) |
 				CORE_SPEC_THREAD;
@@ -1728,6 +1766,9 @@ static void _set_options(const int argc, char **argv)
 			if (strchr(optarg, 'n'))
 				opt.accel_bind_type |= ACCEL_BIND_CLOSEST_NIC;
 			break;
+		case LONG_OPT_COMPRESS:
+			opt.compress = parse_compress_type(optarg);
+			break;
 		default:
 			if (spank_process_option (opt_char, optarg) < 0) {
 				exit(error_exit);
@@ -1771,7 +1812,7 @@ static void _opt_args(int argc, char **argv)
 
 	if (opt.pty) {
 		char *launch_type = slurm_get_launch_type();
-		if (strcmp(launch_type, "launch/slurm")) {
+		if (xstrcmp(launch_type, "launch/slurm")) {
 			error("--pty not currently supported with %s "
 			      "configuration, ignoring option", launch_type);
 			opt.pty = false;
@@ -2205,6 +2246,17 @@ static bool _opt_verify(void)
 					hostlist_ranged_string_xmalloc(hl);
 			}
 		}
+
+		if ((opt.ntasks_per_node != NO_VAL) &&
+		    (opt.ntasks_per_node != (opt.ntasks / opt.min_nodes))) {
+			info("Warning: can't honor --ntasks-per-node set to %u "
+			     "which doesn't match the requested tasks %u with "
+			     "the number of requested nodes %u.  "
+			     "Ignoring --ntasks-per-node.",
+			      opt.ntasks_per_node, opt.ntasks, opt.min_nodes);
+			opt.ntasks_per_node = NO_VAL;
+		}
+
 	} /* else if (opt.ntasks_set && !opt.nodes_set) */
 
 	if (hl)
@@ -2243,7 +2295,10 @@ static bool _opt_verify(void)
 		if (opt.time_min == 0)
 			opt.time_min = INFINITE;
 	}
-
+	if ((opt.deadline) && (opt.begin) && (opt.deadline < opt.begin)) {
+		error("Incompatible begin and deadline time specification");
+		exit(error_exit);
+	}
 	if (opt.ckpt_interval_str) {
 		opt.ckpt_interval = time_str2mins(opt.ckpt_interval_str);
 		if ((opt.ckpt_interval < 0) &&
@@ -2286,7 +2341,7 @@ extern void init_spank_env(void)
 		return;
 
 	for (i = 0; environ[i]; i++) {
-		if (strncmp(environ[i], "SLURM_SPANK_", 12))
+		if (xstrncmp(environ[i], "SLURM_SPANK_", 12))
 			continue;
 		name = xstrdup(environ[i] + 12);
 		eq = strchr(name, (int)'=');
@@ -2320,7 +2375,7 @@ extern char *spank_get_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i = 0; i < opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(tmp_str);
 		return (opt.spank_job_env[i] + len);
@@ -2347,7 +2402,7 @@ extern int   spank_set_job_env(const char *name, const char *value,
 	xstrcat(tmp_str, value);
 
 	for (i = 0; i < opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		if (overwrite) {
 			xfree(opt.spank_job_env[i]);
@@ -2380,7 +2435,7 @@ extern int   spank_unset_job_env(const char *name)
 	len = strlen(tmp_str);
 
 	for (i = 0; i < opt.spank_job_env_size; i++) {
-		if (strncmp(opt.spank_job_env[i], tmp_str, len))
+		if (xstrncmp(opt.spank_job_env[i], tmp_str, len))
 			continue;
 		xfree(opt.spank_job_env[i]);
 		for (j = (i+1); j < opt.spank_job_env_size; i++, j++)
@@ -2511,7 +2566,7 @@ static void _opt_list(void)
 		info("bcast          : %s", tf_(opt.bcast_flag));
 	info("qos            : %s", opt.qos);
 	if (opt.shared != (uint16_t) NO_VAL)
-		info("shared         : %u", opt.shared);
+		info("oversubscribe  : %u", opt.shared);
 	str = print_constraints();
 	info("constraints    : %s", str);
 	xfree(str);
@@ -2554,6 +2609,11 @@ static void _opt_list(void)
 		slurm_make_time_str(&opt.begin, time_str, sizeof(time_str));
 		info("begin          : %s", time_str);
 	}
+	if (opt.deadline) {
+		char time_str[32];
+		slurm_make_time_str(&opt.deadline, time_str, sizeof(time_str));
+		info("deadline       : %s", time_str);
+	}
 	info("prolog         : %s", opt.prolog);
 	info("epilog         : %s", opt.epilog);
 	info("mail_type      : %s", print_mail_type(opt.mail_type));
@@ -2578,9 +2638,10 @@ static void _opt_list(void)
 	if (opt.resv_port_cnt != NO_VAL)
 		info("resv_port_cnt     : %d", opt.resv_port_cnt);
 	info("power             : %s", power_flags_str(opt.power_flags));
-	info("sicp              : %u", opt.sicp_mode);
 	str = print_commandline(opt.argc, opt.argv);
 	info("remote command    : `%s'", str);
+	if (opt.mcs_label)
+		info("mcs-label         : %s",opt.mcs_label);
 	xfree(str);
 
 }
@@ -2638,9 +2699,9 @@ static void _usage(void)
 "Usage: srun [-N nnodes] [-n ntasks] [-i in] [-o out] [-e err]\n"
 "            [-c ncpus] [-r n] [-p partition] [--hold] [-t minutes]\n"
 "            [-D path] [--immediate[=secs]] [--overcommit] [--no-kill]\n"
-"            [--share] [--label] [--unbuffered] [-m dist] [-J jobname]\n"
+"            [--oversubscribe] [--label] [--unbuffered] [-m dist] [-J jobname]\n"
 "            [--jobid=id] [--verbose] [--slurmd_debug=#] [--gres=list]\n"
-"            [-T threads] [-W sec] [--checkpoint=time]\n"
+"            [-T threads] [-W sec] [--checkpoint=time] [--gres-flags=opts]\n"
 "            [--checkpoint-dir=dir]  [--licenses=names]\n"
 "            [--restart-dir=dir] [--qos=qos] [--time-min=minutes]\n"
 "            [--contiguous] [--mincpus=n] [--mem=MB] [--tmp=MB] [-C list]\n"
@@ -2669,12 +2730,13 @@ static void _usage(void)
 "            [--mail-type=type] [--mail-user=user] [--nice[=value]]\n"
 "            [--prolog=fname] [--epilog=fname]\n"
 "            [--task-prolog=fname] [--task-epilog=fname]\n"
-"            [--ctrl-comm-ifhn=addr] [--multi-prog]\n"
-"            [--cpu-freq=min[-max[:gov]] [--sicp] [--power=flags]\n"
+"            [--ctrl-comm-ifhn=addr] [--multi-prog] [--mcs-label=mcs]\n"
+"            [--cpu-freq=min[-max[:gov]] [--power=flags]\n"
 "            [--switches=max-switches{@max-time-to-wait}] [--reboot]\n"
 "            [--core-spec=cores] [--thread-spec=threads]\n"
 "            [--bb=burst_buffer_spec] [--bbf=burst_buffer_file]\n"
-"            [--acctg-freq=<datatype>=<interval>} [--bcast=<dest_path>]\n"
+"            [--bcast=<dest_path>] [--compress[=library]]\n"
+"            [--acctg-freq=<datatype>=<interval>]\n"
 "            [-w hosts...] [-x hosts...] executable [args...]\n");
 
 }
@@ -2701,8 +2763,11 @@ static void _help(void)
 "      --checkpoint-dir=dir    directory to store job step checkpoint image \n"
 "                              files\n"
 "      --comment=name          arbitrary comment\n"
+"      --compress[=library]    data compression library used with --bcast\n"
 "      --cpu-freq=min[-max[:gov]] requested cpu frequency (and governor)\n"
 "  -d, --dependency=type:jobid defer job until condition on jobid is satisfied\n"
+"      --deadline=time         remove the job if no ending possible before\n"
+"                              this deadline (start > (deadline - time[-min]))\n"
 "  -D, --chdir=path            change remote current working directory\n"
 "      --export=env_vars|NONE  environment variables passed to launcher with\n"
 "                              optional values or NONE (pass no variables)\n"
@@ -2712,6 +2777,7 @@ static void _help(void)
 "                              command-line flags\n"
 "      --get-user-env          used by Moab.  See srun man page.\n"
 "      --gres=list             required generic resources\n"
+"      --gres-flags=opts       flags related to GRES management\n"
 "  -H, --hold                  submit job in held state\n"
 "  -i, --input=in              location of stdin redirection\n"
 "  -I, --immediate[=secs]      exit if resources not available in \"secs\"\n"
@@ -2730,6 +2796,7 @@ static void _help(void)
 "      --mail-type=type        notify on state change: BEGIN, END, FAIL or ALL\n"
 "      --mail-user=user        who to send email notification for job state\n"
 "                              changes\n"
+"      --mcs-label=mcs         mcs label if mcs plugin mcs/group is used\n"
 "      --mpi=type              type of MPI being used\n"
 "      --multi-prog            if set the program name specified is the\n"
 "                              configuration specification for multiple programs\n"
@@ -2757,9 +2824,7 @@ static void _help(void)
 "  -r, --relative=n            run job step relative to node n of allocation\n"
 "      --restart-dir=dir       directory of checkpoint image files to restart\n"
 "                              from\n"
-"  -s, --share                 share nodes with other jobs\n"
-"      --sicp                  If specified, signifies job is to receive\n"
-"                              job id from the incluster reserve range.\n"
+"  -s, --oversubscribe         over-subscribe resources with other jobs\n"
 "  -S, --core-spec=cores       count of reserved cores\n"
 "      --signal=[B:]num[@time] send signal when time limit within time seconds\n"
 "      --slurmd-debug=level    slurmd debug level\n"
@@ -2794,6 +2859,10 @@ static void _help(void)
 "      --exclusive[=user]      allocate nodes in exclusive mode when\n"
 "                              cpu consumable resource is enabled\n"
 "                              or don't share CPUs for job steps\n"
+"      --exclusive[=mcs]       allocate nodes in exclusive mode when\n"
+"                              cpu consumable resource is enabled\n"
+"                              and mcs plugin is enabled\n"
+"                              or don't share CPUs for job steps\n"
 "      --mem-per-cpu=MB        maximum amount of real memory per allocated\n"
 "                              cpu required by the job.\n"
 "                              --mem >= --mem-per-cpu if --mem is specified.\n"
@@ -2811,7 +2880,7 @@ static void _help(void)
 "      --ntasks-per-socket=n   number of tasks to invoke on each socket\n");
 	conf = slurm_conf_lock();
 	if (conf->task_plugin != NULL
-	    && strcasecmp(conf->task_plugin, "task/affinity") == 0) {
+	    && xstrcasecmp(conf->task_plugin, "task/affinity") == 0) {
 		printf(
 "      --cpu_bind=             Bind tasks to CPUs\n"
 "                              (see \"--cpu_bind=help\" for options)\n"
diff --git a/src/srun/libsrun/opt.h b/src/srun/libsrun/opt.h
index 4dfba016d..c2efae2ba 100644
--- a/src/srun/libsrun/opt.h
+++ b/src/srun/libsrun/opt.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  opt.h - definitions for srun option processing
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
@@ -113,6 +112,7 @@ typedef struct srun_options {
 	char *ckpt_interval_str;/* --checkpoint (string)	*/
 	char *ckpt_dir;  	/* --checkpoint-dir (string)   */
 	bool exclusive;		/* --exclusive			*/
+	uint16_t compress;	/* --compress (for --bcast option) */
 	char *bcast_file;	/* --bcast, copy executable to compute nodes */
 	bool bcast_flag;	/* --bcast, copy executable to compute nodes */
 	int  resv_port_cnt;	/* --resv_ports			*/
@@ -238,7 +238,9 @@ typedef struct srun_options {
 	uint32_t cpu_freq_max;  /* Maximum cpu frequency  */
 	uint32_t cpu_freq_gov;  /* cpu frequency governor */
 	uint8_t power_flags;	/* Power management options	*/
-	uint8_t sicp_mode;	/* Inter-cluster job ID		*/
+	char *mcs_label;	/* mcs label if mcs plugin in use */
+	time_t deadline; 	/* --deadline                   */
+	uint32_t job_flags;	/* --gres-flags */
 } opt_t;
 
 extern opt_t opt;
diff --git a/src/srun/libsrun/srun_job.c b/src/srun/libsrun/srun_job.c
index 9bfdd36ee..da7d1842f 100644
--- a/src/srun/libsrun/srun_job.c
+++ b/src/srun/libsrun/srun_job.c
@@ -93,6 +93,10 @@ typedef struct allocation_info {
 	uint32_t                jobid;
 	uint32_t                nnodes;
 	char                   *nodelist;
+	uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
+	uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
+	uint16_t ntasks_per_socket;/* number of tasks to invoke on
+				    * each socket */
 	uint32_t                num_cpu_groups;
 	char                   *partition;
 	dynamic_plugin_data_t  *select_jobinfo;
@@ -369,6 +373,10 @@ job_step_create_allocation(resource_allocation_response_msg_t *resp)
 	ai->num_cpu_groups = resp->num_cpu_groups;
 	ai->cpus_per_node  = resp->cpus_per_node;
 	ai->cpu_count_reps = resp->cpu_count_reps;
+	ai->ntasks_per_board = resp->ntasks_per_board;
+	ai->ntasks_per_core = resp->ntasks_per_core;
+	ai->ntasks_per_socket = resp->ntasks_per_socket;
+
 	ai->partition = resp->partition;
 
 /* 	info("looking for %d nodes out of %s with a must list of %s", */
@@ -401,6 +409,10 @@ job_create_allocation(resource_allocation_response_msg_t *resp)
 	i->num_cpu_groups = resp->num_cpu_groups;
 	i->cpus_per_node  = resp->cpus_per_node;
 	i->cpu_count_reps = resp->cpu_count_reps;
+	i->ntasks_per_board = resp->ntasks_per_board;
+	i->ntasks_per_core = resp->ntasks_per_core;
+	i->ntasks_per_socket = resp->ntasks_per_socket;
+
 	i->select_jobinfo = select_g_select_jobinfo_copy(resp->select_jobinfo);
 
 	job = _job_create_structure(i);
@@ -711,13 +723,13 @@ cleanup:
 void
 update_job_state(srun_job_t *job, srun_job_state_t state)
 {
-	pthread_mutex_lock(&job->state_mutex);
+	slurm_mutex_lock(&job->state_mutex);
 	if (job->state < state) {
 		job->state = state;
 		pthread_cond_signal(&job->state_cond);
 
 	}
-	pthread_mutex_unlock(&job->state_mutex);
+	slurm_mutex_unlock(&job->state_mutex);
 	return;
 }
 
@@ -828,13 +840,13 @@ _job_create_structure(allocation_info_t *ainfo)
 		/* Replace the runjob line with correct information. */
 		int i, matches = 0;
 		for (i = 0; i < opt.argc; i++) {
-			if (!strcmp(opt.argv[i], "-p")) {
+			if (!xstrcmp(opt.argv[i], "-p")) {
 				i++;
 				xfree(opt.argv[i]);
 				opt.argv[i]  = xstrdup_printf(
 					"%d", opt.ntasks_per_node);
 				matches++;
-			} else if (!strcmp(opt.argv[i], "--np")) {
+			} else if (!xstrcmp(opt.argv[i], "--np")) {
 				i++;
 				xfree(opt.argv[i]);
 				opt.argv[i]  = xstrdup_printf(
@@ -880,6 +892,9 @@ _job_create_structure(allocation_info_t *ainfo)
 	job->jobid   = ainfo->jobid;
 
 	job->ntasks  = opt.ntasks;
+	job->ntasks_per_board = ainfo->ntasks_per_board;
+	job->ntasks_per_core = ainfo->ntasks_per_core;
+	job->ntasks_per_socket = ainfo->ntasks_per_socket;
 
 	/* If cpus_per_task is set then get the exact count of cpus
 	   for the requested step (we might very well use less,
@@ -931,7 +946,7 @@ static int _become_user (void)
 	char *user = uid_to_string(opt.uid);
 	gid_t gid = gid_from_uid(opt.uid);
 
-	if (strcmp(user, "nobody") == 0) {
+	if (xstrcmp(user, "nobody") == 0) {
 		xfree(user);
 		return (error ("Invalid user id %u: %m", opt.uid));
 	}
@@ -1075,7 +1090,7 @@ static void _run_srun_epilog (srun_job_t *job)
 {
 	int rc;
 
-	if (opt.epilog && strcasecmp(opt.epilog, "none") != 0) {
+	if (opt.epilog && xstrcasecmp(opt.epilog, "none") != 0) {
 		rc = _run_srun_script(job, opt.epilog);
 		debug("srun epilog rc = %d", rc);
 	}
@@ -1085,7 +1100,7 @@ static void _run_srun_prolog (srun_job_t *job)
 {
 	int rc;
 
-	if (opt.prolog && strcasecmp(opt.prolog, "none") != 0) {
+	if (opt.prolog && xstrcasecmp(opt.prolog, "none") != 0) {
 		rc = _run_srun_script(job, opt.prolog);
 		debug("srun prolog rc = %d", rc);
 	}
diff --git a/src/srun/libsrun/srun_job.h b/src/srun/libsrun/srun_job.h
index eba8fda21..e7d472376 100644
--- a/src/srun/libsrun/srun_job.h
+++ b/src/srun/libsrun/srun_job.h
@@ -1,6 +1,5 @@
 /*****************************************************************************\
  *  src/srun/srun_job.h - specification of an srun "job"
- *  $Id$
  *****************************************************************************
  *  Copyright (C) 2002 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -89,6 +88,11 @@ typedef struct srun_job {
 	uint32_t cpu_count;	/* allocated CPUs */
 	uint32_t nhosts;	/* node count */
 	uint32_t ntasks;	/* task count */
+	uint16_t ntasks_per_board;/* number of tasks to invoke on each board */
+	uint16_t ntasks_per_core; /* number of tasks to invoke on each core */
+	uint16_t ntasks_per_socket;/* number of tasks to invoke on
+				    * each socket */
+
 	srun_job_state_t state;	/* job state	   	                  */
 	pthread_mutex_t state_mutex;
 	pthread_cond_t  state_cond;
diff --git a/src/srun/srun.c b/src/srun/srun.c
index 7bdef618f..81c07b3ac 100644
--- a/src/srun/srun.c
+++ b/src/srun/srun.c
@@ -72,7 +72,7 @@
 #include <grp.h>
 
 #include "src/common/fd.h"
-#include "src/common/file_bcast.h"
+
 #include "src/common/hostlist.h"
 #include "src/common/log.h"
 #include "src/common/net.h"
@@ -88,6 +88,8 @@
 #include "src/common/xsignal.h"
 #include "src/common/xstring.h"
 
+#include "src/bcast/file_bcast.h"
+
 #include "launch.h"
 #include "allocate.h"
 #include "srun_job.h"
@@ -303,7 +305,7 @@ static int _file_bcast(void)
 	}
 	params = xmalloc(sizeof(struct bcast_parameters));
 	params->block_size = 8 * 1024 * 1024;
-	params->compress = 0;
+	params->compress = opt.compress;
 	if (opt.bcast_file) {
 		params->dst_fname = xstrdup(opt.bcast_file);
 	} else {
diff --git a/src/srun_cr/Makefile.in b/src/srun_cr/Makefile.in
index 606130aff..fe372af5a 100644
--- a/src/srun_cr/Makefile.in
+++ b/src/srun_cr/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 @WITH_BLCR_TRUE@bin_PROGRAMS = srun_cr$(EXEEXT)
 subdir = src/srun_cr
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -230,8 +231,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -331,6 +330,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -369,6 +372,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -412,6 +418,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -462,6 +471,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/srun_cr/srun_cr.c b/src/srun_cr/srun_cr.c
index 4a1af4b7d..5a90266ba 100644
--- a/src/srun_cr/srun_cr.c
+++ b/src/srun_cr/srun_cr.c
@@ -464,13 +464,13 @@ main(int argc, char **argv)
 	cr_leave_cs(cr_id); /* END CS */
 
 	while (1) {
-		pthread_mutex_lock(&step_launch_mutex);
+		slurm_mutex_lock(&step_launch_mutex);
 		while (step_launched) {
 			/* just avoid busy waiting */
 			pthread_cond_wait(&step_launch_cond,
 					  &step_launch_mutex);
 		}
-		pthread_mutex_unlock(&step_launch_mutex);
+		slurm_mutex_unlock(&step_launch_mutex);
 
 		if (_wait_for_srun_connect() < 0)
 			continue;
diff --git a/src/sshare/Makefile.in b/src/sshare/Makefile.in
index 4db59b4e1..bb924fd8f 100644
--- a/src/sshare/Makefile.in
+++ b/src/sshare/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sshare$(EXEEXT)
 subdir = src/sshare
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -224,8 +225,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -325,6 +324,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -363,6 +366,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -406,6 +412,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -456,6 +465,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sshare/process.c b/src/sshare/process.c
index 48d016fbb..5cded61d4 100644
--- a/src/sshare/process.c
+++ b/src/sshare/process.c
@@ -182,17 +182,16 @@ extern int process(shares_response_msg_t *resp, uint16_t options)
 	print_fields_list = list_create(NULL);
 	itr = list_iterator_create(format_list);
 	while ((object = list_next(itr))) {
+		int newlen = 0;
+		if ((tmp_char = strstr(object, "\%"))) {
+			tmp_char[0] = '\0';
+			newlen = atoi(tmp_char+1);
+		}
 		for (i = 0; fields[i].name; i++) {
-			if ((tmp_char = strstr(object, "\%")))
-				tmp_char[0] = '\0';
-
 			if (!strncasecmp(fields[i].name,
 					 object, strlen(object))) {
-				if (tmp_char) {
-					int newlen = atoi(tmp_char+1);
-					if (newlen)
-						fields[i].len = newlen;
-				}
+				if (newlen)
+					fields[i].len = newlen;
 
 				list_append(print_fields_list, &fields[i]);
 				break;
diff --git a/src/sshare/sshare.c b/src/sshare/sshare.c
index 845d8d8bc..1a96af256 100644
--- a/src/sshare/sshare.c
+++ b/src/sshare/sshare.c
@@ -49,6 +49,8 @@
 static int      _get_info(shares_request_msg_t *shares_req,
 			  shares_response_msg_t **shares_resp);
 static int      _addto_name_char_list(List char_list, char *names, bool gid);
+static int 	_single_cluster(shares_request_msg_t *req_msg);
+static int 	_multi_cluster(shares_request_msg_t *req_msg);
 static char *   _convert_to_name(int id, bool gid);
 static void     _print_version( void );
 static void	_usage(void);
@@ -59,17 +61,16 @@ int quiet_flag;		/* quiet=1, verbose=-1, normal=0 */
 int verbosity;		/* count of -v options */
 uint32_t my_uid = 0;
 List clusters = NULL;
+uint16_t options = 0;
 
 int main (int argc, char *argv[])
 {
-	int error_code = SLURM_SUCCESS, opt_char;
+	int opt_char;
 	log_options_t opts = LOG_OPTS_STDERR_ONLY;
 	shares_request_msg_t req_msg;
-	shares_response_msg_t *resp_msg = NULL;
 	char *temp = NULL;
 	int option_index;
 	bool all_users = 0;
-	uint16_t options = 0;
 
 	static struct option long_options[] = {
 		{"accounts", 1, 0, 'A'},
@@ -156,7 +157,7 @@ int main (int argc, char *argv[])
 			PRINT_FIELDS_PARSABLE_NO_ENDING;
 			break;
 		case 'u':
-			if (!strcmp(optarg, "-1")) {
+			if (!xstrcmp(optarg, "-1")) {
 				all_users = 1;
 				break;
 			}
@@ -239,22 +240,51 @@ int main (int argc, char *argv[])
 
 	}
 
-	error_code = _get_info(&req_msg, &resp_msg);
+	if (clusters)
+		exit_code = _multi_cluster(&req_msg);
+	else
+		exit_code = _single_cluster(&req_msg);
+
+	exit(exit_code);
+}
+
 
-	FREE_NULL_LIST(req_msg.acct_list);
-	FREE_NULL_LIST(req_msg.user_list);
+static int _single_cluster(shares_request_msg_t *req_msg)
+{
+	int rc = SLURM_SUCCESS;
+	shares_response_msg_t *resp_msg = NULL;
 
-	if (error_code) {
+	rc = _get_info(req_msg, &resp_msg);
+	if (rc) {
 		slurm_perror("Couldn't get shares from controller");
-		exit(error_code);
+		return rc;
 	}
 
-	/* do stuff with it */
 	process(resp_msg, options);
-
 	slurm_free_shares_response_msg(resp_msg);
 
-	exit(exit_code);
+	return rc;
+}
+
+static int _multi_cluster(shares_request_msg_t *req_msg)
+{
+	ListIterator itr;
+	bool first = true;
+	int rc = 0, rc2;
+
+	itr = list_iterator_create(clusters);
+	while ((working_cluster_rec = list_next(itr))) {
+		if (first)
+			first = false;
+		else
+			printf("\n");
+		printf("CLUSTER: %s\n", working_cluster_rec->name);
+		rc2 = _single_cluster(req_msg);
+		rc  = MAX(rc, rc2);
+	}
+	list_iterator_destroy(itr);
+
+	return rc;
 }
 
 static int _get_info(shares_request_msg_t *shares_req,
@@ -334,7 +364,8 @@ static int _addto_name_char_list(List char_list, char *names, bool gid)
 					}
 
 					while((tmp_char = list_next(itr))) {
-						if (!strcasecmp(tmp_char, name))
+						if (!xstrcasecmp(tmp_char,
+								 name))
 							break;
 					}
 
@@ -367,7 +398,7 @@ static int _addto_name_char_list(List char_list, char *names, bool gid)
 			}
 
 			while((tmp_char = list_next(itr))) {
-				if (!strcasecmp(tmp_char, name))
+				if (!xstrcasecmp(tmp_char, name))
 					break;
 			}
 
diff --git a/src/sstat/Makefile.in b/src/sstat/Makefile.in
index caf7832c7..706c29ff4 100644
--- a/src/sstat/Makefile.in
+++ b/src/sstat/Makefile.in
@@ -94,7 +94,8 @@ target_triplet = @target@
 bin_PROGRAMS = sstat$(EXEEXT)
 subdir = src/sstat
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -225,8 +226,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -326,6 +325,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -364,6 +367,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -407,6 +413,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -457,6 +466,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sstat/options.c b/src/sstat/options.c
index 39c2035f7..4cb52f416 100644
--- a/src/sstat/options.c
+++ b/src/sstat/options.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  options.c - option functions for sstat
- *
- *  $Id: options.c 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -190,11 +188,11 @@ static int _addto_job_list(List job_list, char *names)
 						*dot++ = 0;
 						/* can't use NO_VAL
 						 * since that means all */
-						if (!strcasecmp(dot, "batch"))
+						if (!xstrcasecmp(dot, "batch"))
 							selected_step->stepid =
 								SSTAT_EXTERN_STEP;
-						else if (!strcasecmp(dot,
-								     "extern"))
+						else if (!xstrcasecmp(dot,
+								      "extern"))
 							selected_step->stepid =
 								SSTAT_EXTERN_STEP;
 						else
@@ -262,10 +260,10 @@ static int _addto_job_list(List job_list, char *names)
 			} else {
 				*dot++ = 0;
 				/* can't use NO_VAL since that means all */
-				if (!strcasecmp(dot, "batch"))
+				if (!xstrcasecmp(dot, "batch"))
 					selected_step->stepid =
 						SSTAT_BATCH_STEP;
-				else if (!strcasecmp(dot, "extern"))
+				else if (!xstrcasecmp(dot, "extern"))
 					selected_step->stepid =
 						SSTAT_EXTERN_STEP;
 				else
@@ -316,24 +314,26 @@ static int _addto_job_list(List job_list, char *names)
 
 int decode_state_char(char *state)
 {
-	if (!strcasecmp(state, "p"))
+	if (!xstrcasecmp(state, "p"))
 		return JOB_PENDING; 	/* we should never see this */
-	else if (!strcasecmp(state, "r"))
+	else if (!xstrcasecmp(state, "r"))
 		return JOB_RUNNING;
-	else if (!strcasecmp(state, "su"))
+	else if (!xstrcasecmp(state, "su"))
 		return JOB_SUSPENDED;
-	else if (!strcasecmp(state, "cd"))
+	else if (!xstrcasecmp(state, "cd"))
 		return JOB_COMPLETE;
-	else if (!strcasecmp(state, "ca"))
+	else if (!xstrcasecmp(state, "ca"))
 		return JOB_CANCELLED;
-	else if (!strcasecmp(state, "f"))
+	else if (!xstrcasecmp(state, "f"))
 		return JOB_FAILED;
-	else if (!strcasecmp(state, "to"))
+	else if (!xstrcasecmp(state, "to"))
 		return JOB_TIMEOUT;
-	else if (!strcasecmp(state, "nf"))
+	else if (!xstrcasecmp(state, "nf"))
 		return JOB_NODE_FAIL;
-	else if (!strcasecmp(state, "pr"))
+	else if (!xstrcasecmp(state, "pr"))
 		return JOB_PREEMPTED;
+	else if (!xstrcasecmp(state, "dl"))
+		return JOB_DEADLINE;
 	else
 		return -1; // unknown
 }
diff --git a/src/sstat/print.c b/src/sstat/print.c
index d1da23ce6..b5129f1d0 100644
--- a/src/sstat/print.c
+++ b/src/sstat/print.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  print.c - print functions for sstat
- *
- *  $Id: print.c 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
@@ -88,7 +86,7 @@ static void _print_small_double(
 		return;
 
 	if (dub > 1)
-		convert_num_unit((double)dub, outbuf, buf_size, units,
+		convert_num_unit((double)dub, outbuf, buf_size, units, NO_VAL,
 				 params.convert_flags);
 	else if (dub > 0)
 		snprintf(outbuf, buf_size, "%.2fM", dub);
@@ -120,9 +118,9 @@ void print_fields(slurmdb_step_rec_t *step)
 		case PRINT_ACT_CPUFREQ:
 
 			convert_num_unit2((double)step->stats.act_cpufreq,
-					  outbuf, sizeof(outbuf),
-					  UNIT_KILO, 1000, params.convert_flags
-					  & (~CONVERT_NUM_UNIT_EXACT));
+					  outbuf, sizeof(outbuf), UNIT_KILO,
+					  NO_VAL, 1000, params.convert_flags &
+					  (~CONVERT_NUM_UNIT_EXACT));
 
 			field->print_routine(field,
 					     outbuf,
@@ -133,7 +131,7 @@ void print_fields(slurmdb_step_rec_t *step)
 				convert_num_unit2((double)
 						  step->stats.consumed_energy,
 						  outbuf, sizeof(outbuf),
-						  UNIT_NONE, 1000,
+						  UNIT_NONE, NO_VAL, 1000,
 						  params.convert_flags &
 						  (~CONVERT_NUM_UNIT_EXACT));
 			}
@@ -165,27 +163,27 @@ void print_fields(slurmdb_step_rec_t *step)
 					     (curr_inx == field_count));
 			break;
 		case PRINT_AVEPAGES:
-			convert_num_unit((double)step->stats.pages_ave,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.pages_ave, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
 					     (curr_inx == field_count));
 			break;
 		case PRINT_AVERSS:
-			convert_num_unit((double)step->stats.rss_ave,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.rss_ave, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
 					     (curr_inx == field_count));
 			break;
 		case PRINT_AVEVSIZE:
-			convert_num_unit((double)step->stats.vsize_ave,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.vsize_ave, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
@@ -251,9 +249,9 @@ void print_fields(slurmdb_step_rec_t *step)
 					     (curr_inx == field_count));
 			break;
 		case PRINT_MAXPAGES:
-			convert_num_unit((double)step->stats.pages_max,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.pages_max, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
@@ -274,9 +272,9 @@ void print_fields(slurmdb_step_rec_t *step)
 					     (curr_inx == field_count));
 			break;
 		case PRINT_MAXRSS:
-			convert_num_unit((double)step->stats.rss_max,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.rss_max, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
@@ -297,9 +295,9 @@ void print_fields(slurmdb_step_rec_t *step)
 					     (curr_inx == field_count));
 			break;
 		case PRINT_MAXVSIZE:
-			convert_num_unit((double)step->stats.vsize_max,
-					 outbuf, sizeof(outbuf),
-					 UNIT_KILO, params.convert_flags);
+			convert_num_unit((double)step->stats.vsize_max, outbuf,
+					 sizeof(outbuf), UNIT_KILO, NO_VAL,
+					 params.convert_flags);
 
 			field->print_routine(field,
 					     outbuf,
diff --git a/src/sstat/process.c b/src/sstat/process.c
index aa4b0aa34..1637d6234 100644
--- a/src/sstat/process.c
+++ b/src/sstat/process.c
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  process.c - process functions for stats
- *
- *  $Id: process.c 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2006 The Regents of the University of California.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
diff --git a/src/sstat/sstat.c b/src/sstat/sstat.c
index e87e3a4b5..ffec72af4 100644
--- a/src/sstat/sstat.c
+++ b/src/sstat/sstat.c
@@ -38,15 +38,10 @@
 
 #include "sstat.h"
 
-void _destroy_steps(void *object);
-void _print_header(void);
-void *_stat_thread(void *args);
-int _sstat_query(slurm_step_layout_t *step_layout, uint32_t job_id,
-		 uint32_t step_id);
-int _process_results();
 int _do_stat(uint32_t jobid, uint32_t stepid, char *nodelist,
 	     uint32_t req_cpufreq_min, uint32_t req_cpufreq_max,
-	     uint32_t req_cpufreq_gov);
+	     uint32_t req_cpufreq_gov,
+	     uint16_t use_protocol_ver);
 
 /*
  * Globals
@@ -100,7 +95,7 @@ int field_count = 0;
 
 int _do_stat(uint32_t jobid, uint32_t stepid, char *nodelist,
 	     uint32_t req_cpufreq_min, uint32_t req_cpufreq_max,
-	     uint32_t req_cpufreq_gov)
+	     uint32_t req_cpufreq_gov, uint16_t use_protocol_ver)
 {
 	job_step_stat_response_msg_t *step_stat_response = NULL;
 	int rc = SLURM_SUCCESS;
@@ -112,7 +107,7 @@ int _do_stat(uint32_t jobid, uint32_t stepid, char *nodelist,
 	hostlist_t hl = NULL;
 
 	debug("requesting info for job %u.%u", jobid, stepid);
-	if ((rc = slurm_job_step_stat(jobid, stepid, nodelist,
+	if ((rc = slurm_job_step_stat(jobid, stepid, nodelist, use_protocol_ver,
 				      &step_stat_response)) != SLURM_SUCCESS) {
 		if (rc == ESLURM_INVALID_JOB_ID) {
 			debug("job step %u.%u has already completed",
@@ -232,6 +227,7 @@ int main(int argc, char **argv)
 	while ((selected_step = list_next(itr))) {
 		char *nodelist = NULL;
 		bool free_nodelist = false;
+		uint16_t use_protocol_ver = (uint16_t)NO_VAL;
 		if (selected_step->stepid == SSTAT_BATCH_STEP) {
 			/* get the batch step info */
 			job_info_msg_t *job_ptr = NULL;
@@ -244,6 +240,8 @@ int main(int argc, char **argv)
 				continue;
 			}
 
+			use_protocol_ver =
+				job_ptr->job_array[0].start_protocol_ver;
 			stepid = NO_VAL;
 			hl = hostlist_create(job_ptr->job_array[0].nodes);
 			nodelist = hostlist_pop(hl);
@@ -261,6 +259,8 @@ int main(int argc, char **argv)
 				continue;
 			}
 
+			use_protocol_ver =
+				job_ptr->job_array[0].start_protocol_ver;
 			stepid = INFINITE;
 			nodelist = job_ptr->job_array[0].nodes;
 			slurm_free_job_info_msg(job_ptr);
@@ -283,7 +283,9 @@ int main(int argc, char **argv)
 					 step_ptr->job_steps[i].nodes,
 					 step_ptr->job_steps[i].cpu_freq_min,
 					 step_ptr->job_steps[i].cpu_freq_max,
-					 step_ptr->job_steps[i].cpu_freq_gov);
+					 step_ptr->job_steps[i].cpu_freq_gov,
+					 step_ptr->job_steps[i].
+					 start_protocol_ver);
 			}
 			slurm_free_job_step_info_response_msg(step_ptr);
 			continue;
@@ -307,9 +309,12 @@ int main(int argc, char **argv)
 			req_cpufreq_min = step_ptr->job_steps[0].cpu_freq_min;
 			req_cpufreq_max = step_ptr->job_steps[0].cpu_freq_max;
 			req_cpufreq_gov = step_ptr->job_steps[0].cpu_freq_gov;
+			use_protocol_ver =
+				step_ptr->job_steps[0].start_protocol_ver;
 		}
 		_do_stat(selected_step->jobid, stepid, nodelist,
-			 req_cpufreq_min, req_cpufreq_max, req_cpufreq_gov);
+			 req_cpufreq_min, req_cpufreq_max, req_cpufreq_gov,
+			 use_protocol_ver);
 		if (free_nodelist && nodelist)
 			free(nodelist);
 	}
diff --git a/src/sstat/sstat.h b/src/sstat/sstat.h
index cf94b4f1a..e6c8eb6e2 100644
--- a/src/sstat/sstat.h
+++ b/src/sstat/sstat.h
@@ -1,7 +1,5 @@
 /*****************************************************************************\
  *  sstat.h - header file for sstat
- *
- *  $Id: sstat.h 7541 2006-03-18 01:44:58Z da $
  *****************************************************************************
  *  Copyright (C) 2002-2007 The Regents of the University of California.
  *  Copyright (C) 2008 Lawrence Livermore National Security.
diff --git a/src/strigger/Makefile.in b/src/strigger/Makefile.in
index f968c5a12..32e85697e 100644
--- a/src/strigger/Makefile.in
+++ b/src/strigger/Makefile.in
@@ -96,7 +96,8 @@ target_triplet = @target@
 bin_PROGRAMS = strigger$(EXEEXT)
 subdir = src/strigger
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -228,8 +229,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -329,6 +328,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -367,6 +370,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -410,6 +416,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -460,6 +469,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sview/Makefile.am b/src/sview/Makefile.am
index 9f20dc745..700350cfc 100644
--- a/src/sview/Makefile.am
+++ b/src/sview/Makefile.am
@@ -1,5 +1,3 @@
-# $Id: Makefile.am 6669 2005-11-21 22:41:16Z da $
-#
 # Makefile for sview
 
 AUTOMAKE_OPTIONS = foreign
diff --git a/src/sview/Makefile.in b/src/sview/Makefile.in
index a60f358a9..84a8c3cbe 100644
--- a/src/sview/Makefile.in
+++ b/src/sview/Makefile.in
@@ -14,8 +14,6 @@
 
 @SET_MAKE@
 
-# $Id: Makefile.am 6669 2005-11-21 22:41:16Z da $
-#
 # Makefile for sview
 
 
@@ -97,7 +95,8 @@ target_triplet = @target@
 @BUILD_SVIEW_TRUE@bin_PROGRAMS = sview$(EXEEXT)
 subdir = src/sview
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -110,7 +109,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -123,6 +121,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -130,6 +129,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -138,7 +138,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -254,8 +253,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -355,6 +352,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -393,6 +394,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -436,6 +440,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -486,6 +493,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/src/sview/bb_info.c b/src/sview/bb_info.c
index 31ab29596..d0906281c 100644
--- a/src/sview/bb_info.c
+++ b/src/sview/bb_info.c
@@ -53,10 +53,10 @@ enum {
 	SORTID_COLOR,
 	SORTID_COLOR_INX,
 	SORTID_CREATE_TIME,
-	SORTID_GRES,
 	SORTID_NAME,
 	SORTID_PARTITION,
 	SORTID_PLUGIN,
+	SORTID_POOL,
 	SORTID_QOS,
 	SORTID_SIZE,
 	SORTID_STATE,
@@ -73,7 +73,7 @@ enum {
 /*these are the settings to apply for the user
  * on the first startup after a fresh slurm install.
  * s/b a const probably*/
-static char *_initial_page_opts = "Plugin,Name/JobID,Gres,Size,State,StateTime,UserID";
+static char *_initial_page_opts = "Name/JobID,Pool,Size,State,StateTime,UserID";
 
 static display_data_t display_data_bb[] = {
 	{G_TYPE_INT, SORTID_POS, NULL, FALSE, EDIT_NONE,
@@ -90,10 +90,10 @@ static display_data_t display_data_bb[] = {
 	 refresh_bb, create_model_bb, admin_edit_bb},
 	{G_TYPE_STRING, SORTID_CREATE_TIME, "CreateTime", FALSE, EDIT_NONE,
 	 refresh_bb, create_model_bb, admin_edit_bb},
-	{G_TYPE_STRING, SORTID_GRES, "Gres", FALSE, EDIT_NONE,
-	 refresh_bb, create_model_bb, admin_edit_bb},
 	{G_TYPE_STRING, SORTID_PARTITION, "Partition", FALSE, EDIT_NONE,
 	 refresh_bb, create_model_bb, admin_edit_bb},
+	{G_TYPE_STRING, SORTID_POOL, "Pool", FALSE, EDIT_NONE,
+	 refresh_bb, create_model_bb, admin_edit_bb},
 	{G_TYPE_STRING, SORTID_QOS, "QOS", FALSE, EDIT_NONE,
 	 refresh_bb, create_model_bb, admin_edit_bb},
 	{G_TYPE_STRING, SORTID_SIZE, "Size", FALSE, EDIT_NONE,
@@ -193,21 +193,20 @@ static void _layout_bb_record(GtkTreeView *treeview,
 			      sview_bb_info_t *sview_bb_info, int update)
 {
 	GtkTreeIter iter;
-	char time_buf[20], *tmp_gres = NULL, tmp_user_id[60], tmp_size[20];
+	char time_buf[20], tmp_user_id[60], tmp_size[20];
 	char bb_name_id[32];
-	char *tmp_state, *tmp_user_name, *sep;
+	char *tmp_state, *tmp_user_name;
 	burst_buffer_resv_t *bb_ptr = sview_bb_info->bb_ptr;
 	GtkTreeStore *treestore;
-	int i;
 
 	treestore = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
 
 	if (bb_ptr->name) {
 		strncpy(bb_name_id, bb_ptr->name, sizeof(bb_name_id));
 	} else if (bb_ptr->array_task_id == NO_VAL) {
-		convert_num_unit(bb_ptr->job_id, bb_name_id,
-				 sizeof(bb_name_id),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit(bb_ptr->job_id, bb_name_id, sizeof(bb_name_id),
+				 UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	} else {
 		snprintf(bb_name_id, sizeof(bb_name_id),
 			 "%u_%u(%u)",
@@ -235,6 +234,11 @@ static void _layout_bb_record(GtkTreeView *treeview,
 						 SORTID_PARTITION),
 				   bb_ptr->partition);
 
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_bb,
+						 SORTID_POOL),
+				   bb_ptr->pool);
+
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_bb,
 						 SORTID_QOS),
@@ -252,18 +256,6 @@ static void _layout_bb_record(GtkTreeView *treeview,
 						 SORTID_SIZE),
 				   tmp_size);
 
-	sep = "";
-	for (i = 0; i < bb_ptr->gres_cnt; i++) {
-		xstrfmtcat(tmp_gres, "%s%s:%"PRIu64"", sep,
-			   bb_ptr->gres_ptr->name, bb_ptr->gres_ptr->used_cnt);
-		sep = ",";
-	}
-	add_display_treestore_line(update, treestore, &iter,
-				   find_col_name(display_data_bb,
-						 SORTID_GRES),
-				   tmp_gres);
-	xfree(tmp_gres);
-
 	if (bb_ptr->create_time) {
 		slurm_make_time_str((time_t *)&bb_ptr->create_time, time_buf,
 				    sizeof(time_buf));
@@ -324,23 +316,15 @@ static void _update_bb_record(sview_bb_info_t *sview_bb_info_ptr,
 {
 	char tmp_create_time[40];
 	char tmp_size[20], tmp_user_id[60], bb_name_id[32];
-	char *tmp_gres = NULL, *tmp_state, *tmp_user_name, *sep;
+	char *tmp_state, *tmp_user_name;
 	burst_buffer_resv_t *bb_ptr = sview_bb_info_ptr->bb_ptr;
-	int i;
-
-	sep = "";
-	for (i = 0; i < bb_ptr->gres_cnt; i++) {
-		xstrfmtcat(tmp_gres, "%s%s:%"PRIu64"", sep,
-			   bb_ptr->gres_ptr->name, bb_ptr->gres_ptr->used_cnt);
-		sep = ",";
-	}
 
 	if (bb_ptr->name) {
 		strncpy(bb_name_id, bb_ptr->name, sizeof(bb_name_id));
 	} else if (bb_ptr->array_task_id == NO_VAL) {
-		convert_num_unit(bb_ptr->job_id, bb_name_id,
-				 sizeof(bb_name_id),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit(bb_ptr->job_id, bb_name_id, sizeof(bb_name_id),
+				 UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	} else {
 		snprintf(bb_name_id, sizeof(bb_name_id),
 			 "%u_%u(%u)",
@@ -375,16 +359,15 @@ static void _update_bb_record(sview_bb_info_t *sview_bb_info_ptr,
 			   SORTID_PLUGIN,        sview_bb_info_ptr->plugin,
 			   SORTID_ACCOUNT,       bb_ptr->account,
 			   SORTID_CREATE_TIME,   tmp_create_time,
-			   SORTID_GRES,          tmp_gres,
 			   SORTID_NAME,          bb_name_id,
 			   SORTID_PARTITION,     bb_ptr->partition,
+			   SORTID_POOL,          bb_ptr->pool,
 			   SORTID_QOS,           bb_ptr->qos,
 			   SORTID_SIZE,          tmp_size,
 			   SORTID_STATE,         tmp_state,
 			   SORTID_UPDATED,       1,
 			   SORTID_USERID,        tmp_user_id,
 			   -1);
-	xfree(tmp_gres);
 
 	return;
 }
@@ -419,7 +402,7 @@ static void _update_info_bb(List info_list, GtkTreeView *tree_view)
 		if (sview_bb_info->iter_set) {
 			gtk_tree_model_get(model, &sview_bb_info->iter_ptr,
 					   SORTID_NAME, &name, -1);
-			if (strcmp(name, sview_bb_info->bb_name)) {
+			if (xstrcmp(name, sview_bb_info->bb_name)) {
 				/* Bad pointer */
 				sview_bb_info->iter_set = false;
 				//g_print("bad resv iter pointer\n");
@@ -500,7 +483,7 @@ static List _create_bb_info_list(burst_buffer_info_msg_t *bb_info_ptr)
 				convert_num_unit(bb_resv_ptr->job_id,
 						 bb_name_id,
 						 sizeof(bb_name_id),
-						 UNIT_NONE,
+						 UNIT_NONE, NO_VAL,
 						 working_sview_config.
 						 convert_flags);
 			} else {
@@ -566,7 +549,7 @@ static void _display_info_bb(List info_list, popup_info_t *popup_win)
 			convert_num_unit(bb_ptr->job_id,
 					 bb_name_id,
 					 sizeof(bb_name_id),
-					 UNIT_NONE,
+					 UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 		} else {
 			snprintf(bb_name_id, sizeof(bb_name_id),
@@ -576,7 +559,7 @@ static void _display_info_bb(List info_list, popup_info_t *popup_win)
 				 bb_ptr->job_id);
 		}
 
-		if (!strcmp(bb_name_id, name)) {
+		if (!xstrcmp(bb_name_id, name)) {
 			_layout_bb_record(treeview, sview_bb_info, update);
 			break;
 		}
@@ -964,7 +947,7 @@ extern void popup_all_bb(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
diff --git a/src/sview/block_info.c b/src/sview/block_info.c
index 329bd1faa..db81dd419 100644
--- a/src/sview/block_info.c
+++ b/src/sview/block_info.c
@@ -349,12 +349,12 @@ static void _layout_block_record(GtkTreeView *treeview,
 							 SORTID_USE),
 					   node_use_string(
 						   block_ptr->bg_node_use));
-	}
-	convert_num_unit((float)block_ptr->cnode_cnt, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+	} convert_num_unit((float)block_ptr->cnode_cnt, tmp_cnt,
+			   sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
+			   working_sview_config.convert_flags);
 	if (cluster_flags & CLUSTER_FLAG_BGQ) {
 		convert_num_unit((float)block_ptr->cnode_err_cnt, tmp_cnt2,
-				 sizeof(tmp_cnt2), UNIT_NONE,
+				 sizeof(tmp_cnt2), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 		tmp_char = xstrdup_printf("%s/%s", tmp_cnt, tmp_cnt2);
 	} else
@@ -386,11 +386,11 @@ static void _update_block_record(sview_block_info_t *block_ptr,
 	char *tmp_char = NULL, *tmp_char2 = NULL, *tmp_char3 = NULL;
 
 	convert_num_unit((float)block_ptr->cnode_cnt, cnode_cnt,
-			 sizeof(cnode_cnt), UNIT_NONE,
+			 sizeof(cnode_cnt), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	if (cluster_flags & CLUSTER_FLAG_BGQ) {
 		convert_num_unit((float)block_ptr->cnode_err_cnt, cnode_cnt2,
-				 sizeof(cnode_cnt), UNIT_NONE,
+				 sizeof(cnode_cnt), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 		tmp_char3 = xstrdup_printf("%s/%s", cnode_cnt, cnode_cnt2);
 	} else
@@ -481,7 +481,7 @@ static void _update_info_block(List block_list,
 		if (block_ptr->iter_set) {
 			gtk_tree_model_get(model, &block_ptr->iter_ptr,
 					   SORTID_BLOCK, &name, -1);
-			if (strcmp(name, block_ptr->bg_block_name)) {
+			if (xstrcmp(name, block_ptr->bg_block_name)) {
 				/* Bad pointer */
 				block_ptr->iter_set = false;
 			}
@@ -531,7 +531,7 @@ static int _sview_block_sort_aval_dec(void *s1, void *s2)
 		return 1;
 
 	if (rec_a->mp_str && rec_b->mp_str) {
-		size_a = strcmp(rec_a->mp_str, rec_b->mp_str);
+		size_a = xstrcmp(rec_a->mp_str, rec_b->mp_str);
 		if (size_a < 0)
 			return -1;
 		else if (size_a > 0)
@@ -609,9 +609,9 @@ static List _create_block_list(partition_info_msg_t *part_info_ptr,
 
 		if (last_list_itr) {
 			while ((block_ptr = list_next(last_list_itr))) {
-				if (!strcmp(block_ptr->bg_block_name,
-					    block_info_ptr->
-					    block_array[i].bg_block_id)) {
+				if (!xstrcmp(block_ptr->bg_block_name,
+					     block_info_ptr->
+					     block_array[i].bg_block_id)) {
 					list_remove(last_list_itr);
 					_block_info_free(block_ptr);
 					break;
@@ -738,8 +738,8 @@ need_refresh:
 
 	itr = list_iterator_create(block_list);
 	while ((block_ptr = (sview_block_info_t*) list_next(itr))) {
-		if (!strcmp(block_ptr->bg_block_name, name)
-		    || !strcmp(block_ptr->mp_str, name)) {
+		if (!xstrcmp(block_ptr->bg_block_name, name)
+		    || !xstrcmp(block_ptr->mp_str, name)) {
 			/* we want to over ride any subgrp in error
 			   state */
 			enum node_states state = NODE_STATE_UNKNOWN;
@@ -890,24 +890,24 @@ extern int update_state_block(GtkDialog *dialog,
 	gtk_dialog_add_button(dialog,
 			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 
-	if (!strcasecmp("Error", type) ||
-	    !strcasecmp("Put block in error state", type)) {
+	if (!xstrcasecmp("Error", type) ||
+	    !xstrcasecmp("Put block in error state", type)) {
 		snprintf(tmp_char, sizeof(tmp_char),
 			 "Are you sure you want to put block %s "
 			 "in an error state?",
 			 blockid);
 		block_msg.state = BG_BLOCK_ERROR_FLAG;
-	} else if (!strcasecmp("Recreate block", type)) {
+	} else if (!xstrcasecmp("Recreate block", type)) {
 		snprintf(tmp_char, sizeof(tmp_char),
 			 "Are you sure you want to recreate block %s?",
 			 blockid);
 		block_msg.state = BG_BLOCK_BOOTING;
-	} else if (!strcasecmp("Remove block", type)) {
+	} else if (!xstrcasecmp("Remove block", type)) {
 		snprintf(tmp_char, sizeof(tmp_char),
 			 "Are you sure you want to remove block %s?",
 			 blockid);
 		block_msg.state = BG_BLOCK_NAV;
-	} else if (!strcasecmp("Resume block", type)) {
+	} else if (!xstrcasecmp("Resume block", type)) {
 		snprintf(tmp_char, sizeof(tmp_char),
 			 "Are you sure you want to resume block %s?",
 			 blockid);
@@ -986,7 +986,7 @@ extern void admin_edit_block(GtkCellRendererText *cell,
 
 	char *blockid = NULL;
 	char *old_text = NULL;
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -1308,8 +1308,8 @@ display_it:
 		i++;
 		switch(spec_info->type) {
 		case PART_PAGE:
-			if (strcmp(block_ptr->slurm_part_name,
-				   search_info->gchar_data))
+			if (xstrcmp(block_ptr->slurm_part_name,
+				    search_info->gchar_data))
 				continue;
 			break;
 		case RESV_PAGE:
@@ -1344,8 +1344,8 @@ display_it:
 				if (!search_info->gchar_data)
 					continue;
 
-				if (strcmp(block_ptr->bg_block_name,
-					   search_info->gchar_data))
+				if (xstrcmp(block_ptr->bg_block_name,
+					    search_info->gchar_data))
 					continue;
 				break;
 			case SEARCH_BLOCK_SIZE:
@@ -1368,8 +1368,8 @@ display_it:
 			}
 			break;
 		case JOB_PAGE:
-			if (strcmp(block_ptr->bg_block_name,
-				   search_info->gchar_data))
+			if (xstrcmp(block_ptr->bg_block_name,
+				    search_info->gchar_data))
 				continue;
 			break;
 		default:
@@ -1486,7 +1486,7 @@ extern void popup_all_block(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
diff --git a/src/sview/common.c b/src/sview/common.c
index fa7ed3cec..0bf69594d 100644
--- a/src/sview/common.c
+++ b/src/sview/common.c
@@ -65,7 +65,7 @@ static int _find_node_inx (char *name)
 	for (i = 0; i < g_node_info_ptr->record_count; i++) {
 		if (g_node_info_ptr->node_array[i].name == NULL)
 			continue;	/* Future node or other anomaly */
-		if (!strcmp(name, g_node_info_ptr->node_array[i].name))
+		if (!xstrcmp(name, g_node_info_ptr->node_array[i].name))
 			return i;
 	}
 
@@ -1248,10 +1248,10 @@ extern GtkTreeStore *create_treestore(GtkTreeView *tree_view,
 
 			break;
 		case G_TYPE_STRING:
-			if (!strcasecmp(display_data[i].name, "Node Count")
-			    || !strcasecmp(display_data[i].name, "CPU Count")
-			    || !strcasecmp(display_data[i].name, "Real Memory")
-			    || !strcasecmp(display_data[i].name, "Tmp Disk")) {
+			if (!xstrcasecmp(display_data[i].name, "Node Count")
+			    || !xstrcasecmp(display_data[i].name, "CPU Count")
+			    || !xstrcasecmp(display_data[i].name, "Real Memory")
+			    || !xstrcasecmp(display_data[i].name, "Tmp Disk")) {
 				gtk_tree_sortable_set_sort_func(
 					GTK_TREE_SORTABLE(treestore),
 					display_data[i].id,
@@ -1259,8 +1259,8 @@ extern GtkTreeStore *create_treestore(GtkTreeView *tree_view,
 					GINT_TO_POINTER(display_data[i].id),
 					NULL);
 				break;
-			} else if (!strcasecmp(display_data[i].name,
-					       "MidplaneList")) {
+			} else if (!xstrcasecmp(display_data[i].name,
+						"MidplaneList")) {
 				gtk_tree_sortable_set_sort_func(
 					GTK_TREE_SORTABLE(treestore),
 					display_data[i].id,
@@ -1800,7 +1800,7 @@ extern gboolean delete_popup(GtkWidget *widget, GtkWidget *event, char *title)
 
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info) {
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				//g_print("removing %s\n", title);
 				list_remove(itr);
 				destroy_popup_info(popup_win);
@@ -2156,7 +2156,7 @@ extern void add_display_treestore_line(int update,
 			gtk_tree_model_get(GTK_TREE_MODEL(treestore), iter,
 					   DISPLAY_NAME,
 					   &display_name, -1);
-			if (!strcmp(display_name, name)) {
+			if (!xstrcmp(display_name, name)) {
 				/* update with new info */
 				g_free(display_name);
 				goto found;
@@ -2204,7 +2204,7 @@ extern void add_display_treestore_line_with_font(
 			gtk_tree_model_get(GTK_TREE_MODEL(treestore), iter,
 					   DISPLAY_NAME,
 					   &display_name, -1);
-			if (!strcmp(display_name, name)) {
+			if (!xstrcmp(display_name, name)) {
 				/* update with new info */
 				g_free(display_name);
 				goto found;
diff --git a/src/sview/defaults.c b/src/sview/defaults.c
index c9ca8a392..65d213024 100644
--- a/src/sview/defaults.c
+++ b/src/sview/defaults.c
@@ -173,7 +173,7 @@ static const char *_set_sview_config(sview_config_t *sview_config,
 	switch(column) {
 	case SORTID_ADMIN:
 		type = "Admin Mode";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->admin_mode = 1;
 		else
 			sview_config->admin_mode = 0;
@@ -187,19 +187,19 @@ static const char *_set_sview_config(sview_config_t *sview_config,
 		sview_config->gap_size = MIN(temp_int/2, 2);
 		break;
 	case SORTID_DEFAULT_PAGE:
-		if (!strcasecmp(new_text, "job"))
+		if (!xstrcasecmp(new_text, "job"))
 			sview_config->default_page = JOB_PAGE;
-		else if (!strcasecmp(new_text, "part"))
+		else if (!xstrcasecmp(new_text, "part"))
 			sview_config->default_page = PART_PAGE;
-		else if (!strcasecmp(new_text, "res"))
+		else if (!xstrcasecmp(new_text, "res"))
 			sview_config->default_page = RESV_PAGE;
-		else if (!strcasecmp(new_text, "block"))
+		else if (!xstrcasecmp(new_text, "block"))
 			sview_config->default_page = BLOCK_PAGE;
-		else if (!strcasecmp(new_text, "node"))
+		else if (!xstrcasecmp(new_text, "node"))
 			sview_config->default_page = NODE_PAGE;
-		else if (!strcasecmp(new_text, "frontend"))
+		else if (!xstrcasecmp(new_text, "frontend"))
 			sview_config->default_page = FRONT_END_PAGE;
-		else if (!strcasecmp(new_text, "burstbuffer"))
+		else if (!xstrcasecmp(new_text, "burstbuffer"))
 			sview_config->default_page = BB_PAGE;
 		else
 			sview_config->default_page = JOB_PAGE;
@@ -233,48 +233,48 @@ static const char *_set_sview_config(sview_config_t *sview_config,
 		break;
 	case SORTID_RULED_TV:
 		type = "Ruled Tables";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->ruled_treeview = 1;
 		else
 			sview_config->ruled_treeview = 0;
 		break;
 	case SORTID_SHOW_GRID:
 		type = "Show Grid";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->show_grid = 1;
 		else
 			sview_config->show_grid = 0;
 		break;
 	case SORTID_GRID_TOPO_ORDER:
 		type = "Topology order";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->grid_topological = 1;
 		else
 			sview_config->grid_topological =  0;
 		break;
 	case SORTID_SHOW_HIDDEN:
 		type = "Show Hidden";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->show_hidden = 1;
 		else
 			sview_config->show_hidden = 0;
 		break;
 	case SORTID_SAVE_PAGE_OPTS:
 		type = "Save Page Settings";
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			sview_config->save_page_opts = 1;
 		else
 			sview_config->save_page_opts = 0;
 		break;
 	case SORTID_TAB_POS:
 		type = "Tab Position";
-		if (!strcasecmp(new_text, "top")) {
+		if (!xstrcasecmp(new_text, "top")) {
 			sview_config->tab_pos = GTK_POS_TOP;
-		} else if (!strcasecmp(new_text, "bottom")) {
+		} else if (!xstrcasecmp(new_text, "bottom")) {
 			sview_config->tab_pos = GTK_POS_BOTTOM;
-		} else if (!strcasecmp(new_text, "left")) {
+		} else if (!xstrcasecmp(new_text, "left")) {
 			sview_config->tab_pos = GTK_POS_LEFT;
-		} else if (!strcasecmp(new_text, "right"))
+		} else if (!xstrcasecmp(new_text, "right"))
 			sview_config->tab_pos = GTK_POS_RIGHT;
 		else
 			goto return_error;
@@ -283,7 +283,7 @@ static const char *_set_sview_config(sview_config_t *sview_config,
 		type = "unknown";
 		break;
 	}
-	if (strcmp(type, "unknown")) {
+	if (xstrcmp(type, "unknown")) {
 		global_send_update_msg = 1;
 
 	}
diff --git a/src/sview/front_end_info.c b/src/sview/front_end_info.c
index e828ec4a7..7a02c6052 100644
--- a/src/sview/front_end_info.c
+++ b/src/sview/front_end_info.c
@@ -294,8 +294,8 @@ static void _update_info_front_end(List info_list, GtkTreeView *tree_view)
 			gtk_tree_model_get(model,
 					   &sview_front_end_info->iter_ptr,
 					   SORTID_NAME, &name, -1);
-			if (strcmp(name,
-				   sview_front_end_info->front_end_name)) {
+			if (xstrcmp(name,
+				    sview_front_end_info->front_end_name)) {
 				/* Bad pointer */
 				sview_front_end_info->iter_set = false;
 				//g_print("bad front_end iter pointer\n");
@@ -352,9 +352,9 @@ static List _create_front_end_info_list(
 		if (last_list_itr) {
 			while ((sview_front_end_info_ptr =
 				list_next(last_list_itr))) {
-				if (!strcmp(sview_front_end_info_ptr->
-					    front_end_name,
-					    front_end_ptr->name)) {
+				if (!xstrcmp(sview_front_end_info_ptr->
+					     front_end_name,
+					     front_end_ptr->name)) {
 					list_remove(last_list_itr);
 					_front_end_info_free(
 						sview_front_end_info_ptr);
@@ -454,7 +454,7 @@ need_refresh:
 	itr = list_iterator_create(info_list);
 	while ((sview_fe_info = (sview_front_end_info_t*) list_next(itr))) {
 		front_end_ptr = sview_fe_info->front_end_ptr;
-		if (strcmp(front_end_ptr->name, name) == 0) {
+		if (xstrcmp(front_end_ptr->name, name) == 0) {
 			j = 0;
 			while (sview_fe_info->node_inx[j] >= 0) {
 				change_grid_color(popup_win->grid_button_list,
@@ -596,7 +596,7 @@ extern void admin_edit_front_end(GtkCellRendererText *cell,
 	char *node_list = NULL;
 	int column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
 						       "column"));
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -846,8 +846,8 @@ display_it:
 		case NODE_PAGE:
 			break;
 		case JOB_PAGE:
-			if (strcmp(front_end_ptr->name,
-				   search_info->gchar_data))
+			if (xstrcmp(front_end_ptr->name,
+				    search_info->gchar_data))
 				continue;
 			break;
 		case RESV_PAGE:
@@ -856,8 +856,8 @@ display_it:
 				if (!search_info->gchar_data)
 					continue;
 
-				if (strcmp(front_end_ptr->name,
-					   search_info->gchar_data))
+				if (xstrcmp(front_end_ptr->name,
+					    search_info->gchar_data))
 					continue;
 				break;
 			default:
@@ -947,7 +947,7 @@ extern void popup_all_front_end(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
diff --git a/src/sview/grid.c b/src/sview/grid.c
index 0901f0450..c5a58121d 100644
--- a/src/sview/grid.c
+++ b/src/sview/grid.c
@@ -140,7 +140,7 @@ static void _open_block(GtkWidget *widget, GdkEventButton *event,
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -364,7 +364,7 @@ static bool _change_button_color(grid_button_t *grid_button,
 		   (node_base_state == NODE_STATE_ERROR)) {
 		_put_button_as_down(grid_button, NODE_STATE_DRAIN);
 	} else if (grid_button->node_name &&
-		   !strcmp(grid_button->node_name, "EMPTY")) {
+		   !xstrcmp(grid_button->node_name, "EMPTY")) {
 		grid_button->color_inx = MAKE_BLACK;
 //		_put_button_as_up(grid_button);
 	} else if (grid_button->color_inx != color_inx) {
diff --git a/src/sview/job_info.c b/src/sview/job_info.c
index 4d9641274..4f9497346 100644
--- a/src/sview/job_info.c
+++ b/src/sview/job_info.c
@@ -127,6 +127,7 @@ enum {
 	SORTID_CPU_MAX,
 	SORTID_CPU_MIN,
 	SORTID_CPUS_PER_TASK,
+	SORTID_DEADLINE,
 	SORTID_DEPENDENCY,
 	SORTID_DERIVED_EC,
 	SORTID_EXIT_CODE,
@@ -147,6 +148,7 @@ enum {
 	SORTID_JOBID,
 	SORTID_JOBID_FORMATTED,
 	SORTID_LICENSES,
+	SORTID_MCS_LABEL,
 	SORTID_CPU_REQ,
 	SORTID_MEM_MIN,
 	SORTID_TMP_DISK,
@@ -172,6 +174,7 @@ enum {
 /* 	SORTID_NTASKS_PER_CORE, */
 /* 	SORTID_NTASKS_PER_NODE, */
 /* 	SORTID_NTASKS_PER_SOCKET, */
+	SORTID_OVER_SUBSCRIBE,
 	SORTID_PARTITION,
 	SORTID_PREEMPT_TIME,
 	SORTID_PRIORITY,
@@ -182,7 +185,6 @@ enum {
 	SORTID_RESV_NAME,
 	SORTID_RESTARTS,
 	SORTID_ROTATE,
-	SORTID_SHARED,
 /* 	SORTID_SOCKETS_MAX, */
 /* 	SORTID_SOCKETS_MIN, */
 	SORTID_STATE,
@@ -317,6 +319,8 @@ static display_data_t display_data_job[] = {
 	 EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_TIME_END, "Time End", FALSE,
 	 EDIT_NONE, refresh_job, create_model_job, admin_edit_job},
+	{G_TYPE_STRING, SORTID_DEADLINE, "Deadline", FALSE,
+	 EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_TIME_SUSPEND, "Time Suspended", FALSE,
 	 EDIT_NONE, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_TIMELIMIT, "Time Limit", FALSE,
@@ -375,7 +379,7 @@ static display_data_t display_data_job[] = {
 	 FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_TASKS, "Task Count",
 	 FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
-	{G_TYPE_STRING, SORTID_SHARED, "Shared", FALSE,
+	{G_TYPE_STRING, SORTID_OVER_SUBSCRIBE, "OverSubscribe", FALSE,
 	 EDIT_MODEL, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_STD_ERR, "Standard Error",
 	 FALSE, EDIT_NONE, refresh_job, create_model_job, admin_edit_job},
@@ -414,6 +418,8 @@ static display_data_t display_data_job[] = {
 	 FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_LICENSES, "Licenses",
 	 FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
+	{G_TYPE_STRING, SORTID_MCS_LABEL, "MCS_Label",
+	 FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_DEPENDENCY, "Dependency",
 	 FALSE, EDIT_TEXTBOX, refresh_job, create_model_job, admin_edit_job},
 	{G_TYPE_STRING, SORTID_ALLOC_NODE, "Alloc Node : Sid",
@@ -599,7 +605,7 @@ static uint16_t _xlate_signal_name(const char *signal_name)
 		return sig_num;
 
 	for (i=0; i<SIZE(sig_name_num); i++) {
-		if (strcasecmp(sig_name_num[i].name, signal_name) == 0) {
+		if (xstrcasecmp(sig_name_num[i].name, signal_name) == 0) {
 			xfree(sig_names);
 			return sig_name_num[i].val;
 		}
@@ -706,17 +712,17 @@ static void _set_active_combo_job(GtkComboBox *combo,
 		goto end_it;
 	switch(type) {
 	case SORTID_ACTION:
-		if (!strcasecmp(temp_char, "None"))
+		if (!xstrcasecmp(temp_char, "None"))
 			action = 0;
-		else if (!strcasecmp(temp_char, "Cancel"))
+		else if (!xstrcasecmp(temp_char, "Cancel"))
 			action = 1;
-		else if (!strcasecmp(temp_char, "Suspend"))
+		else if (!xstrcasecmp(temp_char, "Suspend"))
 			action = 2;
-		else if (!strcasecmp(temp_char, "Resume"))
+		else if (!xstrcasecmp(temp_char, "Resume"))
 			action = 3;
-		else if (!strcasecmp(temp_char, "Checkpoint"))
+		else if (!xstrcasecmp(temp_char, "Checkpoint"))
 			action = 4;
-		else if (!strcasecmp(temp_char, "Requeue"))
+		else if (!xstrcasecmp(temp_char, "Requeue"))
 			action = 5;
 		else
 			action = 0;
@@ -726,29 +732,28 @@ static void _set_active_combo_job(GtkComboBox *combo,
 	case SORTID_REBOOT:
 	case SORTID_REQUEUE:
 	case SORTID_ROTATE:
-	case SORTID_SHARED:
-		if (!strcasecmp(temp_char, "yes"))
+	case SORTID_OVER_SUBSCRIBE:
+		if (!xstrcasecmp(temp_char, "yes"))
 			action = 0;
-		else if (!strcasecmp(temp_char, "no"))
+		else if (!xstrcasecmp(temp_char, "no"))
 			action = 1;
 		else
 			action = 0;
-
 		break;
 	case SORTID_CONNECTION:
-		if (!strcasecmp(temp_char, "Torus"))
+		if (!xstrcasecmp(temp_char, "Torus"))
 			action = 0;
-		else if (!strcasecmp(temp_char, "Mesh"))
+		else if (!xstrcasecmp(temp_char, "Mesh"))
 			action = 1;
-		else if (!strcasecmp(temp_char, "NAV"))
+		else if (!xstrcasecmp(temp_char, "NAV"))
 			action = 2;
-		else if (!strcasecmp(temp_char, "HTC_S"))
+		else if (!xstrcasecmp(temp_char, "HTC_S"))
 			action = 3;
-		else if (!strcasecmp(temp_char, "HTC_D"))
+		else if (!xstrcasecmp(temp_char, "HTC_D"))
 			action = 4;
-		else if (!strcasecmp(temp_char, "HTC_V"))
+		else if (!xstrcasecmp(temp_char, "HTC_V"))
 			action = 5;
-		else if (!strcasecmp(temp_char, "HTC_L"))
+		else if (!xstrcasecmp(temp_char, "HTC_L"))
 			action = 6;
 		else
 			action = 0;
@@ -787,13 +792,13 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 	switch(column) {
 	case SORTID_ACTION:
 		xfree(got_edit_signal);
-		if (!strcasecmp(new_text, "None"))
+		if (!xstrcasecmp(new_text, "None"))
 			got_edit_signal = NULL;
 		else
 			got_edit_signal = xstrdup(new_text);
 		break;
 	case SORTID_TIMELIMIT:
-		if (!strcasecmp(new_text, "infinite"))
+		if (!xstrcasecmp(new_text, "infinite"))
 			temp_int = INFINITE;
 		else
 			temp_int = time_str2mins((char *)new_text);
@@ -804,7 +809,7 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		job_msg->time_limit = (uint32_t)temp_int;
 		break;
 	case SORTID_PRIORITY:
-		if (!strcasecmp(new_text, "infinite"))
+		if (!xstrcasecmp(new_text, "infinite"))
 			temp_int = INFINITE;
 		else
 			temp_int = strtol(new_text, (char **)NULL, 10);
@@ -940,16 +945,16 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		job_msg->wckey = xstrdup(new_text);
 		type = "wckey";
 		break;
-	case SORTID_SHARED:
-		if (!strcasecmp(new_text, "yes"))
+	case SORTID_OVER_SUBSCRIBE:
+		if (!xstrcasecmp(new_text, "yes"))
 			job_msg->shared = 1;
 		else
 			job_msg->shared = 0;
 
-		type = "shared";
+		type = "oversubscribe";
 		break;
 	case SORTID_CONTIGUOUS:
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			job_msg->contiguous = 1;
 		else
 			job_msg->contiguous = 0;
@@ -973,14 +978,14 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		job_msg->core_spec = (uint16_t)temp_int | CORE_SPEC_THREAD;
 		break;
 	case SORTID_REBOOT:
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			job_msg->reboot = 1;
 		else
 			job_msg->reboot = 0;
 		type = "reboot";
 		break;
 	case SORTID_REQUEUE:
-		if (!strcasecmp(new_text, "yes"))
+		if (!xstrcasecmp(new_text, "yes"))
 			job_msg->requeue = 1;
 		else
 			job_msg->requeue = 0;
@@ -1006,6 +1011,10 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		job_msg->licenses = xstrdup(new_text);
 		type = "licenses";
 		break;
+	case SORTID_MCS_LABEL:
+		job_msg->mcs_label = xstrdup(new_text);
+		type = "mcs_label";
+		break;
 	case SORTID_ACCOUNT:
 		job_msg->account = xstrdup(new_text);
 		type = "account";
@@ -1085,7 +1094,7 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		break;
 	case SORTID_ROTATE:
 		type = "rotate";
-		if (!strcasecmp(new_text, "yes")) {
+		if (!xstrcasecmp(new_text, "yes")) {
 			rotate = 1;
 
 		} else {
@@ -1165,6 +1174,14 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		if (job_msg->begin_time < time(NULL))
 			job_msg->begin_time = time(NULL);
 		break;
+	case SORTID_DEADLINE:
+		type = "deadline";
+		job_msg->deadline = parse_time((char *)new_text, 0);
+		if (!job_msg->deadline)
+			goto return_error;
+		if (job_msg->deadline < time(NULL))
+			goto return_error;
+		break;
 	case SORTID_STD_OUT:
 		type = "StdOut";
 		job_msg->std_out = xstrdup(new_text);
@@ -1182,7 +1199,7 @@ static const char *_set_job_msg(job_desc_msg_t *job_msg, const char *new_text,
 		break;
 	}
 
-	if (strcmp(type, "unknown"))
+	if (xstrcmp(type, "unknown"))
 		global_send_update_msg = 1;
 
 	xfree(original_ptr);
@@ -1347,7 +1364,7 @@ static void _layout_job_record(GtkTreeView *treeview,
 		return;
 
 	if (!job_ptr->nodes || IS_JOB_PENDING(job_ptr) ||
-	    !strcasecmp(job_ptr->nodes,"waiting...")) {
+	    !xstrcasecmp(job_ptr->nodes,"waiting...")) {
 		sprintf(running_char,"00:00:00");
 		nodes = "waiting...";
 	} else {
@@ -1499,9 +1516,9 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)job_ptr->num_cpus,
-				 tmp_char, sizeof(tmp_char),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)job_ptr->num_cpus, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u", job_ptr->num_cpus);
 
@@ -1511,9 +1528,9 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)job_ptr->max_cpus,
-				 tmp_char, sizeof(tmp_char),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)job_ptr->max_cpus, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u", job_ptr->max_cpus);
 
@@ -1523,9 +1540,9 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)job_ptr->num_cpus,
-				 tmp_char, sizeof(tmp_char),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)job_ptr->num_cpus, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u", job_ptr->num_cpus);
 
@@ -1542,6 +1559,15 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   find_col_name(display_data_job,
 						 SORTID_CPUS_PER_TASK),
 				   tmp_char);
+	if (job_ptr->deadline)
+		slurm_make_time_str((time_t *)&job_ptr->deadline, tmp_char,
+				     sizeof(tmp_char));
+	else
+		sprintf(tmp_char, "N/A");
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_job,
+						 SORTID_DEADLINE),
+				   tmp_char);
 
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
@@ -1659,8 +1685,14 @@ static void _layout_job_record(GtkTreeView *treeview,
 						 SORTID_LICENSES),
 				   job_ptr->licenses);
 
-	convert_num_unit((float)job_ptr->pn_min_cpus,
-			 tmp_char, sizeof(tmp_char), UNIT_NONE,
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_job,
+						 SORTID_MCS_LABEL),
+				   (job_ptr->mcs_label==NULL) ? "N/A" :
+						 job_ptr->mcs_label);
+
+	convert_num_unit((float)job_ptr->pn_min_cpus, tmp_char,
+			 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
@@ -1673,8 +1705,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 
 	if (min_mem > 0) {
 		int len;
-		convert_num_unit((float)min_mem,
-				 tmp_char, sizeof(tmp_char), UNIT_MEGA,
+		convert_num_unit((float)min_mem, tmp_char, sizeof(tmp_char),
+				 UNIT_MEGA, NO_VAL,
 				 working_sview_config.convert_flags);
 		len = strlen(tmp_char);
 		if (job_ptr->pn_min_memory & MEM_PER_CPU)
@@ -1689,8 +1721,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (job_ptr->pn_min_tmp_disk > 0)
-		convert_num_unit((float)job_ptr->pn_min_tmp_disk,
-				 tmp_char, sizeof(tmp_char), UNIT_MEGA,
+		convert_num_unit((float)job_ptr->pn_min_tmp_disk, tmp_char,
+				 sizeof(tmp_char), UNIT_MEGA, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		sprintf(tmp_char, " ");
@@ -1709,10 +1741,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 						 SORTID_NETWORK),
 				   job_ptr->network);
 
-	if (job_ptr->nice > 0)
-		sprintf(tmp_char, "%u", job_ptr->nice - NICE_OFFSET);
-	else
-		sprintf(tmp_char, " ");
+	snprintf(tmp_char, sizeof(tmp_char), "%"PRIi64,
+		 (((int64_t)job_ptr->nice) - NICE_OFFSET));
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
 						 SORTID_NICE),
@@ -1738,8 +1768,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 	}
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)sview_job_info_ptr->node_cnt,
-				 tmp_char, sizeof(tmp_char), UNIT_NONE,
+		convert_num_unit((float)sview_job_info_ptr->node_cnt, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u",
@@ -1751,8 +1781,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)sview_job_info_ptr->node_cnt,
-				 tmp_char, sizeof(tmp_char), UNIT_NONE,
+		convert_num_unit((float)sview_job_info_ptr->node_cnt, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u",
@@ -1764,8 +1794,8 @@ static void _layout_job_record(GtkTreeView *treeview,
 				   tmp_char);
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
-		convert_num_unit((float)sview_job_info_ptr->node_cnt,
-				 tmp_char, sizeof(tmp_char), UNIT_NONE,
+		convert_num_unit((float)sview_job_info_ptr->node_cnt, tmp_char,
+				 sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		snprintf(tmp_char, sizeof(tmp_char), "%u",
@@ -1776,6 +1806,11 @@ static void _layout_job_record(GtkTreeView *treeview,
 						 SORTID_NODES_MIN),
 				   tmp_char);
 
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_job,
+						 SORTID_OVER_SUBSCRIBE),
+				   job_share_string(job_ptr->shared));
+
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
 						 SORTID_PARTITION),
@@ -1848,19 +1883,6 @@ static void _layout_job_record(GtkTreeView *treeview,
 						   sizeof(tmp_char),
 						   SELECT_PRINT_ROTATE));
 
-	if (job_ptr->shared == 0)
-		sprintf(tmp_char, "no");
-	else if (job_ptr->shared == 1)
-		sprintf(tmp_char, "no");
-	else if (job_ptr->shared == 2)
-		sprintf(tmp_char, "user");
-	else
-		sprintf(tmp_char, "ok");
-	add_display_treestore_line(update, treestore, &iter,
-				   find_col_name(display_data_job,
-						 SORTID_SHARED),
-				   tmp_char);
-
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
 						 SORTID_STATE),
@@ -2005,8 +2027,8 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 	char tmp_prio[40],      tmp_nice[40],        tmp_preempt_time[40];
 	char tmp_rqswitch[40],  tmp_core_spec[40],   tmp_job_id[400];
 	char tmp_std_err[128],  tmp_std_in[128],     tmp_std_out[128];
-	char tmp_thread_spec[40];
-	char *tmp_batch,  *tmp_cont, *tmp_shared, *tmp_requeue, *tmp_uname;
+	char tmp_thread_spec[40], tmp_time_deadline[40];
+	char *tmp_batch,  *tmp_cont, *tmp_requeue, *tmp_uname;
 	char *tmp_reboot, *tmp_reason, *tmp_nodes;
 	char time_buf[32];
 	time_t now_time = time(NULL);
@@ -2024,7 +2046,7 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 		 job_ptr->alloc_node, job_ptr->alloc_sid);
 
 	/* These need to be set up first, or they could be NULL when
-	   they need to be set.  Since we do a strcmp on these later
+	   they need to be set.  Since we do a xstrcmp on these later
 	   we need to make sure they are exactly the same (length wise).
 	*/
 	if (!sview_job_info_ptr->task_hl_str && sview_job_info_ptr->task_hl) {
@@ -2117,29 +2139,29 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 		tmp_cpus_per_task[0] = '\0';
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
-		convert_num_unit((float)job_ptr->num_cpus,
-				 tmp_cpu_cnt, sizeof(tmp_cpu_cnt),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)job_ptr->num_cpus, tmp_cpu_cnt,
+				 sizeof(tmp_cpu_cnt), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	} else {
 		snprintf(tmp_cpu_cnt, sizeof(tmp_cpu_cnt), "%u",
 			 job_ptr->num_cpus);
 	}
 
-	convert_num_unit((float)job_ptr->pn_min_cpus,
-			 tmp_cpu_req, sizeof(tmp_cpu_req), UNIT_NONE,
+	convert_num_unit((float)job_ptr->pn_min_cpus, tmp_cpu_req,
+			 sizeof(tmp_cpu_req), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	if (cluster_flags & CLUSTER_FLAG_BG) {
-		convert_num_unit((float)job_ptr->max_cpus,
-				 tmp_cpus_max, sizeof(tmp_cpus_max),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)job_ptr->max_cpus, tmp_cpus_max,
+				 sizeof(tmp_cpus_max), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	} else {
 		snprintf(tmp_cpus_max, sizeof(tmp_cpus_max), "%u",
 			 job_ptr->max_cpus);
 	}
 
-	convert_num_unit((float)job_ptr->pn_min_tmp_disk,
-			 tmp_disk, sizeof(tmp_disk), UNIT_MEGA,
+	convert_num_unit((float)job_ptr->pn_min_tmp_disk, tmp_disk,
+			 sizeof(tmp_disk), UNIT_MEGA, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	if (WIFSIGNALED(job_ptr->derived_ec))
@@ -2169,8 +2191,8 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 
 	if (min_mem > 0) {
 		int len;
-		convert_num_unit((float)min_mem,
-				 tmp_mem_min, sizeof(tmp_mem_min), UNIT_MEGA,
+		convert_num_unit((float)min_mem, tmp_mem_min,
+				 sizeof(tmp_mem_min), UNIT_MEGA, NO_VAL,
 				 working_sview_config.convert_flags);
 		len = strlen(tmp_mem_min);
 		if (job_ptr->pn_min_memory & MEM_PER_CPU)
@@ -2183,7 +2205,7 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 	if (cluster_flags & CLUSTER_FLAG_BG)
 		convert_num_unit((float)sview_job_info_ptr->node_cnt,
 				 tmp_node_cnt, sizeof(tmp_node_cnt), UNIT_NONE,
-				 working_sview_config.convert_flags);
+				 NO_VAL, working_sview_config.convert_flags);
 	else
 		sprintf(tmp_node_cnt, "%u", sview_job_info_ptr->node_cnt);
 
@@ -2204,15 +2226,11 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 	else
 		tmp_requeue =  "no";
 
-	if (job_ptr->shared)
-		tmp_shared = "yes";
-	else
-		tmp_shared = "no";
-
-	sprintf(tmp_nice, "%u", job_ptr->nice - NICE_OFFSET);
+	snprintf(tmp_nice, sizeof(tmp_nice), "%"PRIi64,
+		 (((int64_t)job_ptr->nice) - NICE_OFFSET));
 
 	if (!job_ptr->nodes || IS_JOB_PENDING(job_ptr) ||
-	    !strcasecmp(job_ptr->nodes,"waiting...")) {
+	    !xstrcasecmp(job_ptr->nodes,"waiting...")) {
 		sprintf(tmp_time_run,"00:00:00");
 		tmp_nodes = "waiting...";
 	} else {
@@ -2279,6 +2297,12 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 	slurm_make_time_str((time_t *)&job_ptr->submit_time, tmp_time_submit,
 			    sizeof(tmp_time_submit));
 
+	if (job_ptr->deadline)
+		slurm_make_time_str((time_t *)&job_ptr->deadline, tmp_time_deadline,
+				     sizeof(tmp_time_deadline));
+	else
+		sprintf(tmp_time_deadline, "N/A");
+
 	slurm_get_job_stderr(tmp_std_err, sizeof(tmp_std_err), job_ptr);
 
 	slurm_get_job_stdin(tmp_std_in, sizeof(tmp_std_in), job_ptr);
@@ -2356,6 +2380,7 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 				   SORTID_CPU_MIN,      tmp_cpu_cnt,
 				   SORTID_CPUS_PER_TASK,tmp_cpus_per_task,
 				   SORTID_CPU_REQ,      tmp_cpu_req,
+				   SORTID_DEADLINE,     tmp_time_deadline,
 				   SORTID_DEPENDENCY,   job_ptr->dependency,
 				   SORTID_DERIVED_EC,   tmp_derived_ec,
 				   SORTID_EXIT_CODE,    tmp_exit,
@@ -2365,6 +2390,7 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 				   SORTID_JOBID,        tmp_job_id,
 				   SORTID_JOBID_FORMATTED, tmp_job_id,
 				   SORTID_LICENSES,     job_ptr->licenses,
+				   SORTID_MCS_LABEL,	job_ptr->mcs_label,
 				   SORTID_MEM_MIN,      tmp_mem_min,
 				   SORTID_NAME,         job_ptr->name,
 				   SORTID_NICE,         tmp_nice,
@@ -2377,6 +2403,8 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 				   SORTID_NODES,        tmp_node_cnt,
 				   SORTID_NODES_MAX,    tmp_nodes_max,
 				   SORTID_NODES_MIN,    tmp_nodes_min,
+				   SORTID_OVER_SUBSCRIBE,
+				   job_share_string(job_ptr->shared),
 				   SORTID_PARTITION,    job_ptr->partition,
 				   SORTID_PREEMPT_TIME, tmp_preempt_time,
 				   SORTID_PRIORITY,     tmp_prio,
@@ -2386,7 +2414,6 @@ static void _update_job_record(sview_job_info_t *sview_job_info_ptr,
 				   SORTID_REQUEUE,      tmp_requeue,
 				   SORTID_RESTARTS,     job_ptr->restart_cnt,
 				   SORTID_RESV_NAME,    job_ptr->resv_name,
-				   SORTID_SHARED,       tmp_shared,
 				   SORTID_STATE,
 				   job_state_string(job_ptr->job_state),
 				   SORTID_STATE_NUM,    job_ptr->job_state,
@@ -2561,7 +2588,7 @@ static void _layout_step_record(GtkTreeView *treeview,
 		return;
 
 	convert_num_unit((float)step_ptr->num_cpus, tmp_char, sizeof(tmp_char),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
 						 SORTID_CPUS),
@@ -2603,7 +2630,7 @@ static void _layout_step_record(GtkTreeView *treeview,
 		state = step_ptr->state;
 
 	if (!step_ptr->nodes
-	    || !strcasecmp(step_ptr->nodes, "waiting...")) {
+	    || !xstrcasecmp(step_ptr->nodes, "waiting...")) {
 		sprintf(tmp_time,"00:00:00");
 		snprintf(tmp_nodes, sizeof(tmp_nodes), "waiting...");
 		state = JOB_PENDING;
@@ -2617,16 +2644,17 @@ static void _layout_step_record(GtkTreeView *treeview,
 						    &nodes);
 			convert_num_unit(
 				(float)nodes,
-				tmp_char, sizeof(tmp_char), UNIT_NONE,
+				tmp_char, sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				working_sview_config.convert_flags);
 		} else if (cluster_flags & CLUSTER_FLAG_BG)
 			convert_num_unit(
 				(float)step_ptr->num_tasks / cpus_per_node,
-				tmp_char, sizeof(tmp_char), UNIT_NONE,
+				tmp_char, sizeof(tmp_char), UNIT_NONE, NO_VAL,
 				working_sview_config.convert_flags);
 		else {
 			convert_num_unit((float)_nodes_in_list(tmp_nodes),
 					 tmp_char, sizeof(tmp_char), UNIT_NONE,
+					 NO_VAL,
 					 working_sview_config.convert_flags);
 		}
 		add_display_treestore_line(update, treestore, &iter,
@@ -2668,7 +2696,7 @@ static void _layout_step_record(GtkTreeView *treeview,
 				   tmp_time);
 
 	convert_num_unit((float)step_ptr->num_tasks, tmp_char, sizeof(tmp_char),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_job,
 						 SORTID_TASKS),
@@ -2693,7 +2721,7 @@ static void _update_step_record(job_step_info_t *step_ptr,
 	int color_inx = step_ptr->step_id % sview_colors_cnt;
 
 	convert_num_unit((float)step_ptr->num_cpus, tmp_cpu_min,
-			 sizeof(tmp_cpu_min), UNIT_NONE,
+			 sizeof(tmp_cpu_min), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	if (suspended)
@@ -2702,7 +2730,7 @@ static void _update_step_record(job_step_info_t *step_ptr,
 		state = step_ptr->state;
 
 	if (!step_ptr->nodes ||
-	    !strcasecmp(step_ptr->nodes,"waiting...")) {
+	    !xstrcasecmp(step_ptr->nodes,"waiting...")) {
 		sprintf(tmp_time_run, "00:00:00");
 		snprintf(tmp_nodes, sizeof(tmp_nodes), "waiting...");
 		tmp_node_cnt[0] = '\0';
@@ -2718,22 +2746,23 @@ static void _update_step_record(job_step_info_t *step_ptr,
 						    &nodes);
 			convert_num_unit((float)nodes, tmp_node_cnt,
 					 sizeof(tmp_node_cnt), UNIT_NONE,
+					 NO_VAL,
 					 working_sview_config.convert_flags);
 		} else if (cluster_flags & CLUSTER_FLAG_BG) {
 			convert_num_unit(
 				(float)step_ptr->num_tasks / cpus_per_node,
 				tmp_node_cnt, sizeof(tmp_node_cnt), UNIT_NONE,
-				working_sview_config.convert_flags);
+				NO_VAL, working_sview_config.convert_flags);
 		} else {
 			convert_num_unit((float)_nodes_in_list(tmp_nodes),
 					 tmp_node_cnt, sizeof(tmp_node_cnt),
-					 UNIT_NONE,
+					 UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 		}
 	}
 
 	convert_num_unit((float)step_ptr->num_tasks, tmp_task_cnt,
-			 sizeof(tmp_task_cnt), UNIT_NONE,
+			 sizeof(tmp_task_cnt), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	if ((step_ptr->time_limit == NO_VAL) ||
@@ -2846,7 +2875,7 @@ static void _handle_task_check(sview_job_info_t *task_ptr,
 		else
 			use_id = task_ptr->job_id_str;
 
-		if (tmp_taskid && use_id && !strcmp(tmp_taskid, use_id)) {
+		if (tmp_taskid && use_id && !xstrcmp(tmp_taskid, use_id)) {
 			/* update with new info */
 			_update_job_record(task_ptr,
 					   GTK_TREE_STORE(model),
@@ -3104,7 +3133,7 @@ static int _sview_job_sort_aval_dec(void *s1, void *s2)
 		return 1;
 
 	if (rec_a->nodes && rec_b->nodes) {
-		size_a = strcmp(rec_a->nodes, rec_b->nodes);
+		size_a = xstrcmp(rec_a->nodes, rec_b->nodes);
 		if (size_a < 0)
 			return -1;
 		else if (size_a > 0)
@@ -3691,7 +3720,7 @@ extern GtkListStore *create_model_job(int type)
 	case SORTID_REBOOT:
 	case SORTID_REQUEUE:
 	case SORTID_ROTATE:
-	case SORTID_SHARED:
+	case SORTID_OVER_SUBSCRIBE:
 		model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
 		gtk_list_store_append(model, &iter);
 		gtk_list_store_set(model, &iter,
@@ -3769,7 +3798,7 @@ extern void admin_edit_job(GtkCellRendererText *cell,
 	int column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
 						       "column"));
 
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -3812,7 +3841,7 @@ extern void admin_edit_job(GtkCellRendererText *cell,
 		goto no_input;
 	}
 
-	if (old_text && !strcmp(old_text, new_text)) {
+	if (old_text && !xstrcmp(old_text, new_text)) {
 		temp = g_strdup_printf("No change in value.");
 	} else if (slurm_update_job(job_msg)
 		   == SLURM_SUCCESS) {
@@ -4184,8 +4213,8 @@ display_it:
 				if (!search_info->gchar_data)
 					continue;
 				uname = uid_to_string_cached(job_ptr->user_id);
-				name_diff = strcmp(uname,
-						   search_info->gchar_data);
+				name_diff = xstrcmp(uname,
+						    search_info->gchar_data);
 				if (name_diff)
 					continue;
 				break;
@@ -4201,14 +4230,14 @@ display_it:
 			}
 			break;
 		case PART_PAGE:
-			if (strcmp(search_info->gchar_data,
-				   job_ptr->partition))
+			if (xstrcmp(search_info->gchar_data,
+				    job_ptr->partition))
 				continue;
 			break;
 		case RESV_PAGE:
 			if (!job_ptr->resv_name
-			    || strcmp(search_info->gchar_data,
-				      job_ptr->resv_name))
+			    || xstrcmp(search_info->gchar_data,
+				       job_ptr->resv_name))
 				continue;
 			break;
 		case BLOCK_PAGE:
@@ -4217,7 +4246,7 @@ display_it:
 				name,
 				sizeof(name),
 				SELECT_PRINT_BG_ID);
-			if (strcmp(search_info->gchar_data, name))
+			if (xstrcmp(search_info->gchar_data, name))
 				continue;
 			break;
 		case NODE_PAGE:
@@ -4404,7 +4433,7 @@ extern void popup_all_job(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -4797,7 +4826,7 @@ extern void admin_job(GtkTreeModel *model, GtkTreeIter *iter,
 	GtkWidget *popup;
 	char *tmp_jobid, *offset;
 
-	if (strcmp(type, "Edit Job") == 0)
+	if (xstrcmp(type, "Edit Job") == 0)
 		return _edit_jobs(model, iter, type, treeview);
 
 	job_msg = xmalloc(sizeof(job_desc_msg_t));
@@ -4831,7 +4860,7 @@ extern void admin_job(GtkTreeModel *model, GtkTreeIter *iter,
 
 	slurm_init_job_desc_msg(job_msg);
 
-	if (!strcasecmp("Signal", type)) {
+	if (!xstrcasecmp("Signal", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_OK, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
@@ -4841,7 +4870,7 @@ extern void admin_job(GtkTreeModel *model, GtkTreeIter *iter,
 		entry = create_entry();
 		label = gtk_label_new("Signal?");
 		edit_type = EDIT_SIGNAL;
-	} else if (!strcasecmp("Requeue", type)) {
+	} else if (!xstrcasecmp("Requeue", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_YES, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
@@ -4851,7 +4880,7 @@ extern void admin_job(GtkTreeModel *model, GtkTreeIter *iter,
 			 "Are you sure you want to requeue these job(s)?");
 		label = gtk_label_new(tmp_char);
 		edit_type = EDIT_REQUEUE;
-	} else if (!strcasecmp("Cancel", type)) {
+	} else if (!xstrcasecmp("Cancel", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_YES, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
@@ -4868,7 +4897,7 @@ extern void admin_job(GtkTreeModel *model, GtkTreeIter *iter,
 				 "these job(s)?");
 		label = gtk_label_new(tmp_char);
 		edit_type = EDIT_CANCEL;
-	} else if (!strcasecmp("Suspend/Resume", type)) {
+	} else if (!xstrcasecmp("Suspend/Resume", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_YES, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
diff --git a/src/sview/node_info.c b/src/sview/node_info.c
index b9443a7ae..be22e6813 100644
--- a/src/sview/node_info.c
+++ b/src/sview/node_info.c
@@ -41,7 +41,9 @@ int g_node_scaling = 1;
 /* These need to be in alpha order (except POS and CNT) */
 enum {
 	SORTID_POS = POS_LOC,
+	SORTID_ACTIVE_FEATURES,
 	SORTID_ARCH,
+	SORTID_AVAIL_FEATURES,
 	SORTID_BOARDS,
 	SORTID_BOOT_TIME,
 	SORTID_CAP_WATTS,
@@ -52,11 +54,11 @@ enum {
 	SORTID_CORES,
 	SORTID_CURRENT_WATTS,
 	SORTID_ERR_CPUS,
-	SORTID_FEATURES,
 	SORTID_FREE_MEM,
 	SORTID_GRES,
 	SORTID_IDLE_CPUS,
 	SORTID_LOWEST_JOULES,
+	SORTID_MCS_LABEL,
 	SORTID_NAME,
 	SORTID_NODE_ADDR,
 	SORTID_NODE_HOSTNAME,
@@ -111,6 +113,8 @@ static display_data_t display_data_node[] = {
 	 refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_OWNER, "Owner", FALSE, EDIT_NONE,
 	 refresh_node, create_model_node, admin_edit_node},
+	{G_TYPE_STRING, SORTID_MCS_LABEL, "MCS_Label", FALSE, EDIT_NONE,
+	 refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_STATE, "State", FALSE, EDIT_MODEL, refresh_node,
 	 create_model_node, admin_edit_node},
 	{G_TYPE_INT, SORTID_STATE_NUM, NULL, FALSE, EDIT_NONE, refresh_node,
@@ -139,22 +143,22 @@ static display_data_t display_data_node[] = {
 	 refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_TMP_DISK, "Tmp Disk", FALSE, EDIT_NONE,
 	 refresh_node, create_model_node, admin_edit_node},
-	{G_TYPE_INT, SORTID_WEIGHT,"Weight", FALSE, EDIT_NONE, refresh_node,
-	 create_model_node, admin_edit_node},
-	{G_TYPE_STRING, SORTID_CPU_LOAD, "CPU Load", FALSE, EDIT_NONE,
-	 refresh_node, create_model_node, admin_edit_node},
+	{G_TYPE_STRING, SORTID_ACTIVE_FEATURES, "Active Features", FALSE,
+	 EDIT_TEXTBOX, refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_ARCH, "Arch", FALSE,
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
-	{G_TYPE_STRING, SORTID_FEATURES, "Features", FALSE,
+	{G_TYPE_STRING, SORTID_AVAIL_FEATURES, "Available Features", FALSE,
 	 EDIT_TEXTBOX, refresh_node, create_model_node, admin_edit_node},
+	{G_TYPE_STRING, SORTID_BOOT_TIME, "BootTime", FALSE,
+	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
+	{G_TYPE_STRING, SORTID_CPU_LOAD, "CPU Load", FALSE, EDIT_NONE,
+	 refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_GRES, "Gres", FALSE,
 	 EDIT_TEXTBOX, refresh_node, create_model_node, admin_edit_node},
-	{G_TYPE_STRING, SORTID_BOOT_TIME, "BootTime", FALSE,
+	{G_TYPE_STRING, SORTID_REASON, "Reason", FALSE,
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_SLURMD_START_TIME, "SlurmdStartTime", FALSE,
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
-	{G_TYPE_STRING, SORTID_REASON, "Reason", FALSE,
-	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_LOWEST_JOULES, "Lowest Joules", FALSE,
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_CONSUMED_ENERGY,"Consumed Joules", FALSE,
@@ -165,6 +169,8 @@ static display_data_t display_data_node[] = {
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
 	{G_TYPE_STRING, SORTID_VERSION, "Version", FALSE,
 	 EDIT_NONE, refresh_node, create_model_node, admin_edit_node},
+	{G_TYPE_INT, SORTID_WEIGHT,"Weight", FALSE, EDIT_NONE, refresh_node,
+	 create_model_node, admin_edit_node},
 	{G_TYPE_INT, SORTID_UPDATED, NULL, FALSE, EDIT_NONE, refresh_node,
 	 create_model_node, admin_edit_node},
 	{G_TYPE_NONE, -1, NULL, FALSE, EDIT_NONE}
@@ -188,7 +194,8 @@ static display_data_t options_data_node[] = {
 	{G_TYPE_STRING, NODE_PAGE, "Set Node(s) Down", TRUE, ADMIN_PAGE},
 	{G_TYPE_STRING, NODE_PAGE, "Make Node(s) Idle", TRUE, ADMIN_PAGE},
 #endif
-	{G_TYPE_STRING, NODE_PAGE, "Update Features", TRUE, ADMIN_PAGE},
+	{G_TYPE_STRING, NODE_PAGE, "Update Active Features", TRUE, ADMIN_PAGE},
+	{G_TYPE_STRING, NODE_PAGE, "Update Available Features", TRUE, ADMIN_PAGE},
 	{G_TYPE_STRING, NODE_PAGE, "Update Gres", TRUE, ADMIN_PAGE},
 	{G_TYPE_STRING, JOB_PAGE,  "Jobs", TRUE, NODE_PAGE},
 #ifdef HAVE_BG
@@ -260,8 +267,14 @@ static void _layout_node_record(GtkTreeView *treeview,
 				   find_col_name(display_data_node,
 						 SORTID_OWNER), tmp_owner);
 
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_node,
+						 SORTID_MCS_LABEL),
+				   (node_ptr->mcs_label == NULL) ? "N/A" :
+						 node_ptr->mcs_label),
+
 	convert_num_unit((float)node_ptr->cpus, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_CPUS),
@@ -303,7 +316,7 @@ static void _layout_node_record(GtkTreeView *treeview,
 	}
 	idle_cpus -= alloc_cpus;
 	convert_num_unit((float)alloc_cpus, tmp_cnt,
-			 sizeof(tmp_cnt), UNIT_NONE,
+			 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
@@ -320,14 +333,14 @@ static void _layout_node_record(GtkTreeView *treeview,
 
 	idle_cpus -= err_cpus;
 	convert_num_unit((float)err_cpus, tmp_cnt, sizeof(tmp_cnt), UNIT_NONE,
-			 working_sview_config.convert_flags);
+			 NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_ERR_CPUS),
 				   tmp_cnt);
 
 	convert_num_unit((float)idle_cpus, tmp_cnt, sizeof(tmp_cnt), UNIT_NONE,
-			 working_sview_config.convert_flags);
+			 NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_IDLE_CPUS),
@@ -343,35 +356,35 @@ static void _layout_node_record(GtkTreeView *treeview,
 	xfree(lower);
 
 	convert_num_unit((float)node_ptr->boards, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_BOARDS),
 				   tmp_cnt);
 
 	convert_num_unit((float)node_ptr->sockets, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_SOCKETS),
 				   tmp_cnt);
 
 	convert_num_unit((float)node_ptr->cores, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_CORES),
 				   tmp_cnt);
 
 	convert_num_unit((float)node_ptr->threads, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_THREADS),
 				   tmp_cnt);
 
 	convert_num_unit((float)node_ptr->real_memory, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_MEGA, working_sview_config.convert_flags);
+			 UNIT_MEGA, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_REAL_MEMORY),
@@ -388,7 +401,7 @@ static void _layout_node_record(GtkTreeView *treeview,
 				   tmp_cnt);
 
 	convert_num_unit((float)node_ptr->tmp_disk, tmp_cnt, sizeof(tmp_cnt),
-			 UNIT_MEGA, working_sview_config.convert_flags);
+			 UNIT_MEGA, NO_VAL, working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_TMP_DISK),
@@ -404,8 +417,12 @@ static void _layout_node_record(GtkTreeView *treeview,
 				   node_ptr->arch);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
-						 SORTID_FEATURES),
+						 SORTID_AVAIL_FEATURES),
 				   node_ptr->features);
+	add_display_treestore_line(update, treestore, &iter,
+				   find_col_name(display_data_node,
+						 SORTID_ACTIVE_FEATURES),
+				   node_ptr->features_act);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_node,
 						 SORTID_GRES),
@@ -529,7 +546,7 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 	}
 
 	convert_num_unit((float)node_ptr->cpus, tmp_cpus,
-			 sizeof(tmp_cpus), UNIT_NONE,
+			 sizeof(tmp_cpus), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	select_g_select_nodeinfo_get(node_ptr->select_nodeinfo,
@@ -546,7 +563,7 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 	}
 	idle_cpus = node_ptr->cpus - alloc_cpus;
 	convert_num_unit((float)alloc_cpus, tmp_used_cpus,
-			 sizeof(tmp_used_cpus), UNIT_NONE,
+			 sizeof(tmp_used_cpus), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	select_g_select_nodeinfo_get(node_ptr->select_nodeinfo,
@@ -556,7 +573,7 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 	snprintf(tmp_used_memory, sizeof(tmp_used_memory), "%uM", alloc_memory);
 
 	convert_num_unit((float)alloc_cpus, tmp_used_cpus,
-			 sizeof(tmp_used_cpus), UNIT_NONE,
+			 sizeof(tmp_used_cpus), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	select_g_select_nodeinfo_get(node_ptr->select_nodeinfo,
@@ -567,10 +584,10 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 		err_cpus *= cpus_per_node;
 	idle_cpus -= err_cpus;
 	convert_num_unit((float)err_cpus, tmp_err_cpus, sizeof(tmp_err_cpus),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 
 	convert_num_unit((float)idle_cpus, tmp_idle_cpus, sizeof(tmp_idle_cpus),
-			 UNIT_NONE, working_sview_config.convert_flags);
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
 
 	if (IS_NODE_DRAIN(node_ptr)) {
 		/* don't worry about mixed since the
@@ -584,10 +601,10 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 	tmp_state_lower = str_tolower(tmp_state_upper);
 
 	convert_num_unit((float)node_ptr->real_memory, tmp_mem, sizeof(tmp_mem),
-			 UNIT_MEGA, working_sview_config.convert_flags);
+			 UNIT_MEGA, NO_VAL, working_sview_config.convert_flags);
 
 	convert_num_unit((float)node_ptr->tmp_disk, tmp_disk, sizeof(tmp_disk),
-			 UNIT_MEGA, working_sview_config.convert_flags);
+			 UNIT_MEGA, NO_VAL, working_sview_config.convert_flags);
 
 	if (node_ptr->version == NULL) {
 		snprintf(tmp_version, sizeof(tmp_version), "N/A");
@@ -608,7 +625,9 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 
 	/* Combining these records provides a slight performance improvement */
 	gtk_tree_store_set(treestore, &sview_node_info_ptr->iter_ptr,
+			   SORTID_ACTIVE_FEATURES, node_ptr->features_act,
 			   SORTID_ARCH,      node_ptr->arch,
+			   SORTID_AVAIL_FEATURES,  node_ptr->features,
 			   SORTID_LOWEST_JOULES, tmp_base_watts,
 			   SORTID_BOARDS,    node_ptr->boards,
 			   SORTID_BOOT_TIME, sview_node_info_ptr->boot_time,
@@ -625,8 +644,9 @@ static void _update_node_record(sview_node_info_t *sview_node_info_ptr,
 			   SORTID_TMP_DISK,  tmp_disk,
 			   SORTID_ERR_CPUS,  tmp_err_cpus,
 			   SORTID_IDLE_CPUS, tmp_idle_cpus,
-			   SORTID_FEATURES,  node_ptr->features,
 			   SORTID_GRES,      node_ptr->gres,
+			   SORTID_MCS_LABEL, (node_ptr->mcs_label == NULL) ?
+				"N/A" : node_ptr->mcs_label,
 			   SORTID_REAL_MEMORY, tmp_mem,
 			   SORTID_NAME,      node_ptr->name,
 			   SORTID_NODE_ADDR, node_ptr->node_addr,
@@ -680,7 +700,7 @@ static void _update_info_node(List info_list, GtkTreeView *tree_view)
 		if (sview_node_info->iter_set) {
 			gtk_tree_model_get(model, &sview_node_info->iter_ptr,
 					   SORTID_NAME, &name, -1);
-			if (strcmp(name, sview_node_info->node_name)) {
+			if (xstrcmp(name, sview_node_info->node_name)) {
 				/* Bad pointer */
 				sview_node_info->iter_set = false;
 				//g_print("bad node iter pointer\n");
@@ -754,7 +774,7 @@ need_refresh:
 	while ((sview_node_info = (sview_node_info_t*) list_next(itr))) {
 		node_ptr = sview_node_info->node_ptr;
 		i++;
-		if (!strcmp(node_ptr->name, name)) {
+		if (!xstrcmp(node_ptr->name, name)) {
 			change_grid_color(popup_win->grid_button_list,
 					  i, i, i, true, 0);
 			_layout_node_record(treeview, sview_node_info, update);
@@ -884,8 +904,8 @@ extern List create_node_info_list(node_info_msg_t *node_info_ptr,
 		if (last_list_itr) {
 			while ((sview_node_info_ptr =
 				list_next(last_list_itr))) {
-				if (!strcmp(sview_node_info_ptr->node_name,
-					    node_ptr->name)) {
+				if (!xstrcmp(sview_node_info_ptr->node_name,
+					     node_ptr->name)) {
 					list_remove(last_list_itr);
 					_node_info_free(sview_node_info_ptr);
 					break;
@@ -1107,8 +1127,98 @@ extern int get_new_info_node(node_info_msg_t **info_ptr, int force)
 	return error_code;
 }
 
-extern int update_features_node(GtkDialog *dialog, const char *nodelist,
-				const char *old_features)
+extern int update_active_features_node(GtkDialog *dialog, const char *nodelist,
+				       const char *old_features)
+{
+	char tmp_char[100];
+	char *edit = NULL;
+	GtkWidget *entry = NULL;
+	GtkWidget *label = NULL;
+	update_node_msg_t *node_msg = xmalloc(sizeof(update_node_msg_t));
+	int response = 0;
+	int no_dialog = 0;
+	int rc = SLURM_SUCCESS;
+
+
+	if (_DEBUG)
+		g_print("update_active_features_node:global_row_count: %d "
+			"node_names %s\n",
+			global_row_count, nodelist);
+	if (!dialog) {
+		snprintf(tmp_char, sizeof(tmp_char),
+			 "Update Acitve Features for Node(s) %s?",
+			 nodelist);
+
+		dialog = GTK_DIALOG(
+			gtk_dialog_new_with_buttons(
+				tmp_char,
+				GTK_WINDOW(main_window),
+				GTK_DIALOG_MODAL
+				| GTK_DIALOG_DESTROY_WITH_PARENT,
+				NULL));
+		no_dialog = 1;
+	}
+	label = gtk_dialog_add_button(dialog,
+				      GTK_STOCK_YES, GTK_RESPONSE_OK);
+	gtk_window_set_default(GTK_WINDOW(dialog), label);
+	gtk_dialog_add_button(dialog,
+			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+
+	slurm_init_update_node_msg(node_msg);
+	node_msg->node_names = xstrdup(nodelist);
+
+	snprintf(tmp_char, sizeof(tmp_char),
+		 "Active Features for Node(s) %s?", nodelist);
+	label = gtk_label_new(tmp_char);
+	gtk_box_pack_start(GTK_BOX(dialog->vbox),
+			   label, FALSE, FALSE, 0);
+
+	entry = create_entry();
+	if (!entry)
+		goto end_it;
+
+	if (old_features)
+		gtk_entry_set_text(GTK_ENTRY(entry), old_features);
+
+	gtk_box_pack_start(GTK_BOX(dialog->vbox), entry, TRUE, TRUE, 0);
+	gtk_widget_show_all(GTK_WIDGET(dialog));
+
+	response = gtk_dialog_run(dialog);
+	if (response == GTK_RESPONSE_OK) {
+		node_msg->features_act =
+			xstrdup(gtk_entry_get_text(GTK_ENTRY(entry)));
+		if (!node_msg->features_act) {
+			edit = g_strdup_printf("No features given.");
+			display_edit_note(edit);
+			g_free(edit);
+			goto end_it;
+		}
+		if ((rc = slurm_update_node(node_msg) == SLURM_SUCCESS)) {
+			edit = g_strdup_printf(
+				"Node(s) %s updated successfully.",
+				nodelist);
+			display_edit_note(edit);
+			g_free(edit);
+
+		} else {
+			edit = g_strdup_printf(
+				"Problem updating node(s) %s: %s",
+				nodelist, slurm_strerror(rc));
+			display_edit_note(edit);
+			g_free(edit);
+		}
+	}
+
+end_it:
+	slurm_free_update_node_msg(node_msg);
+	if (no_dialog)
+		gtk_widget_destroy(GTK_WIDGET(dialog));
+
+	return rc;
+}
+
+extern int update_avail_features_node(GtkDialog *dialog, const char *nodelist,
+				      const char *old_features)
 {
 	char tmp_char[100];
 	char *edit = NULL;
@@ -1121,12 +1231,12 @@ extern int update_features_node(GtkDialog *dialog, const char *nodelist,
 
 
 	if (_DEBUG)
-		g_print("update_features_node:global_row_count: %d "
+		g_print("update_avail_features_node:global_row_count: %d "
 			"node_names %s\n",
 			global_row_count, nodelist);
 	if (!dialog) {
 		snprintf(tmp_char, sizeof(tmp_char),
-			 "Update Features for Node(s) %s?",
+			 "Update Available Features for Node(s) %s?",
 			 nodelist);
 
 		dialog = GTK_DIALOG(
@@ -1148,7 +1258,7 @@ extern int update_features_node(GtkDialog *dialog, const char *nodelist,
 	node_msg->node_names = xstrdup(nodelist);
 
 	snprintf(tmp_char, sizeof(tmp_char),
-		 "Features for Node(s) %s?", nodelist);
+		 "Available Features for Node(s) %s?", nodelist);
 	label = gtk_label_new(tmp_char);
 	gtk_box_pack_start(GTK_BOX(dialog->vbox),
 			   label, FALSE, FALSE, 0);
@@ -1346,7 +1456,7 @@ extern int update_state_node(GtkDialog *dialog,
 		for(i = 0; i < NODE_STATE_END; i++) {
 			upper = node_state_string(i);
 			lower = str_tolower(upper);
-			if (!strcmp(lower, type)) {
+			if (!xstrcmp(lower, type)) {
 				snprintf(tmp_char, sizeof(tmp_char),
 					 "Are you sure you want to set "
 					 "node(s) %s to %s?",
@@ -1465,7 +1575,7 @@ extern void admin_edit_node(GtkCellRendererText *cell,
 	char *nodelist = NULL;
 	int column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
 						       "column"));
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -1789,7 +1899,7 @@ display_it:
 			if (!search_info->gchar_data)
 				continue;
 			while ((host = hostlist_next(host_itr))) {
-				if (!strcmp(host, node_ptr->name)) {
+				if (!xstrcmp(host, node_ptr->name)) {
 					free(host);
 					found = 1;
 					break;
@@ -1923,7 +2033,7 @@ extern void popup_all_node_name(char *name, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -1997,11 +2107,11 @@ extern void select_admin_nodes(GtkTreeModel *model,
 		process_node.nodelist = hostlist_ranged_string_xmalloc(hl);
 		hostlist_destroy(hl);
 
-		if (!strcasecmp("Update Features", display_data->name)) {
+		if (!xstrcasecmp("Update Features", display_data->name)) {
 			/* get old features */
-			gtk_tree_model_get(model, iter, SORTID_FEATURES,
+			gtk_tree_model_get(model, iter, SORTID_AVAIL_FEATURES,
 					   &old_value, -1);
-		} else if (!strcasecmp("Update Gres", display_data->name)) {
+		} else if (!xstrcasecmp("Update Gres", display_data->name)) {
 			/* get old gres */
 			gtk_tree_model_get(model, iter, SORTID_GRES,
 					   &old_value, -1);
@@ -2025,12 +2135,14 @@ extern void admin_node_name(char *name, char *old_value, char *type)
 		NULL);
 	gtk_window_set_transient_for(GTK_WINDOW(popup), NULL);
 
-	if (!strcasecmp("Update Features", type)
-	    || !strcasecmp("Update Node Features", type)
-	    || !strcasecmp("Update Midplane Features",
+	if (!xstrcasecmp("Update Available Features", type)
+	    || !xstrcasecmp("Update Node Features", type)
+	    || !xstrcasecmp("Update Midplane Features",
 			   type)) { /* update features */
-		update_features_node(GTK_DIALOG(popup), name, old_value);
-	} else if (!strcasecmp("Update Gres", type)) { /* update gres */
+		update_avail_features_node(GTK_DIALOG(popup), name, old_value);
+	} else if (!xstrcasecmp("Update Active Features", type)) {
+		update_active_features_node(GTK_DIALOG(popup), name, old_value);
+	} else if (!xstrcasecmp("Update Gres", type)) { /* update gres */
 		update_gres_node(GTK_DIALOG(popup), name, old_value);
 	} else /* something that has to deal with a node state change */
 		update_state_node(GTK_DIALOG(popup), name, type);
@@ -2073,15 +2185,15 @@ extern void cluster_change_node(void)
 			}
 
 			if (!display_data->name) {
-			} else if (!strcmp(display_data->name, "Drain Node"))
+			} else if (!xstrcmp(display_data->name, "Drain Node"))
 				display_data->name = "Drain Midplane";
-			else if (!strcmp(display_data->name, "Undrain Node"))
+			else if (!xstrcmp(display_data->name, "Undrain Node"))
 				display_data->name = "Undrain Midplane";
-			else if (!strcmp(display_data->name, "Resume Node"))
+			else if (!xstrcmp(display_data->name, "Resume Node"))
 				display_data->name = "Resume Midplane";
-			else if (!strcmp(display_data->name, "Put Node Down"))
+			else if (!xstrcmp(display_data->name, "Put Node Down"))
 				display_data->name = "Put Midplane Down";
-			else if (!strcmp(display_data->name, "Make Node Idle"))
+			else if (!xstrcmp(display_data->name, "Make Node Idle"))
 				display_data->name =
 					"Make Midplane Idle";
 		} else {
@@ -2092,19 +2204,19 @@ extern void cluster_change_node(void)
 			}
 
 			if (!display_data->name) {
-			} else if (!strcmp(display_data->name,
+			} else if (!xstrcmp(display_data->name,
 					   "Drain Midplanes"))
 				display_data->name = "Drain Nodes";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					   "Undrain Midplanes"))
 				display_data->name = "Undrain Nodes";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Resume Midplanes"))
 				display_data->name = "Resume Nodes";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Put Midplanes Down"))
 				display_data->name = "Put Nodes Down";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Make Midplanes Idle"))
 				display_data->name = "Make Nodes Idle";
 		}
diff --git a/src/sview/part_info.c b/src/sview/part_info.c
index 9e47ef5eb..f4b14113a 100644
--- a/src/sview/part_info.c
+++ b/src/sview/part_info.c
@@ -4,7 +4,7 @@
  *****************************************************************************
  *  Copyright (C) 2004-2007 The Regents of the University of California.
  *  Copyright (C) 2008-2010 Lawrence Livermore National Security.
- *  Portions Copyright (C) 2010-2015 SchedMD <http://www.schedmd.com>.
+ *  Portions Copyright (C) 2010-2016 SchedMD <http://www.schedmd.com>.
  *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
  *  Written by Danny Auble <da@llnl.gov>
  *
@@ -44,6 +44,7 @@ typedef struct {
 	uint32_t cpu_idle_cnt;
 	uint32_t disk_total;
 	char *features;
+	char *features_act;
 	hostlist_t hl;
 	uint32_t mem_total;
 	uint32_t node_cnt;
@@ -91,6 +92,7 @@ enum {
 	SORTID_DENY_QOS,
 	SORTID_EXCLUSIVE_USER,
 	SORTID_FEATURES,
+	SORTID_FEATURES_ACT,
 	SORTID_GRACE_TIME,
 	SORTID_HIDDEN,
 	SORTID_JOB_SIZE,
@@ -112,13 +114,14 @@ enum {
 	SORTID_NODES_MAX,
 	SORTID_NODES_MIN,
 	SORTID_ONLY_LINE,
+	SORTID_OVER_SUBSCRIBE,
 	SORTID_PART_STATE,
 	SORTID_PREEMPT_MODE,
-	SORTID_PRIORITY,
+	SORTID_PRIORITY_JOB_FACTOR,
+	SORTID_PRIORITY_TIER,
 	SORTID_QOS_CHAR,
 	SORTID_REASON,
 	SORTID_ROOT,
-	SORTID_SHARE,
 	SORTID_TMP_DISK,
 	SORTID_TIMELIMIT,
 	SORTID_UPDATED,
@@ -161,7 +164,9 @@ static display_data_t display_data_part[] = {
 	 EDIT_NONE, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_PREEMPT_MODE, "PreemptMode", FALSE,
 	 EDIT_MODEL, refresh_part, create_model_part, admin_edit_part},
-	{G_TYPE_STRING, SORTID_PRIORITY, "Priority", FALSE,
+	{G_TYPE_STRING, SORTID_PRIORITY_JOB_FACTOR, "PriorityJobFactor", FALSE,
+	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
+	{G_TYPE_STRING, SORTID_PRIORITY_TIER, "PriorityTier", FALSE,
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_NODES_MIN, "Nodes Min", FALSE,
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
@@ -169,10 +174,10 @@ static display_data_t display_data_part[] = {
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_MAX_CPUS_PER_NODE, "Max CPUs Per Node", FALSE,
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
+	{G_TYPE_STRING, SORTID_OVER_SUBSCRIBE, "OverSubscribe", FALSE,
+	 EDIT_MODEL, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_ROOT, "Root", FALSE, EDIT_MODEL, refresh_part,
 	 create_model_part, admin_edit_part},
-	{G_TYPE_STRING, SORTID_SHARE, "Share", FALSE, EDIT_MODEL, refresh_part,
-	 create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_QOS_CHAR, "Qos", FALSE,
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_ALLOW_ACCOUNTS, "Allowed Accounts", FALSE,
@@ -191,7 +196,9 @@ static display_data_t display_data_part[] = {
 	 EDIT_NONE, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_MEM, "Memory", FALSE, EDIT_NONE, refresh_part,
 	 create_model_part, admin_edit_part},
-	{G_TYPE_STRING, SORTID_FEATURES, "Features", FALSE,
+	{G_TYPE_STRING, SORTID_FEATURES, "Available Features", FALSE,
+	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
+	{G_TYPE_STRING, SORTID_FEATURES_ACT, "Active Features", FALSE,
 	 EDIT_TEXTBOX, refresh_part, create_model_part, admin_edit_part},
 	{G_TYPE_STRING, SORTID_REASON, "Reason", FALSE,
 	 EDIT_NONE, refresh_part, create_model_part, admin_edit_part},
@@ -235,7 +242,9 @@ static display_data_t create_data_part[] = {
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
 	{G_TYPE_STRING, SORTID_PREEMPT_MODE, "PreemptMode", FALSE,
 	 EDIT_MODEL, refresh_part, _create_model_part2, admin_edit_part},
-	{G_TYPE_STRING, SORTID_PRIORITY, "Priority", FALSE,
+	{G_TYPE_STRING, SORTID_PRIORITY_JOB_FACTOR, "PriorityJobFactor", FALSE,
+	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
+	{G_TYPE_STRING, SORTID_PRIORITY_TIER, "PriorityTier", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
 	{G_TYPE_STRING, SORTID_NODES_MIN, "Nodes Min", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
@@ -245,7 +254,7 @@ static display_data_t create_data_part[] = {
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
 	{G_TYPE_STRING, SORTID_ROOT, "Root", FALSE,
 	 EDIT_MODEL, refresh_part, _create_model_part2, admin_edit_part},
-	{G_TYPE_STRING, SORTID_SHARE, "Share", FALSE,
+	{G_TYPE_STRING, SORTID_OVER_SUBSCRIBE, "OverSubscribe", FALSE,
 	 EDIT_MODEL, refresh_part, _create_model_part2, admin_edit_part},
 	{G_TYPE_STRING, SORTID_ALLOW_ACCOUNTS, "Accounts Allowed", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
@@ -259,9 +268,11 @@ static display_data_t create_data_part[] = {
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
 	{G_TYPE_STRING, SORTID_NODES_ALLOWED, "Nodes Allowed Allocating", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
-	{G_TYPE_STRING, SORTID_FEATURES, "Features", FALSE,
+	{G_TYPE_STRING, SORTID_FEATURES, "Available Features", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
-	{G_TYPE_STRING, SORTID_REASON, "Reason", FALSE,
+	{G_TYPE_STRING, SORTID_FEATURES_ACT, "Active Features", FALSE,
+	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
+	{G_TYPE_NONE, SORTID_REASON, "Reason", FALSE,
 	 EDIT_TEXTBOX, refresh_part, _create_model_part2, admin_edit_part},
 #ifdef HAVE_BG
 	{G_TYPE_STRING, SORTID_NODELIST, "MidplaneList", FALSE,
@@ -334,9 +345,9 @@ static int _build_min_max_32_string(char *buffer, int buf_size,
 	char tmp_min[8];
 	char tmp_max[8];
 	convert_num_unit((float)min, tmp_min, sizeof(tmp_min), UNIT_NONE,
-			 working_sview_config.convert_flags);
+			 NO_VAL, working_sview_config.convert_flags);
 	convert_num_unit((float)max, tmp_max, sizeof(tmp_max), UNIT_NONE,
-			 working_sview_config.convert_flags);
+			 NO_VAL, working_sview_config.convert_flags);
 
 	if (max == min)
 		return snprintf(buffer, buf_size, "%s", tmp_max);
@@ -369,52 +380,52 @@ static void _set_active_combo_part(GtkComboBox *combo,
 	case SORTID_EXCLUSIVE_USER:
 	case SORTID_HIDDEN:
 	case SORTID_ROOT:
-		if (!strcmp(temp_char, "yes"))
+		if (!xstrcmp(temp_char, "yes"))
 			action = 0;
-		else if (!strcmp(temp_char, "no"))
+		else if (!xstrcmp(temp_char, "no"))
 			action = 1;
 		else
 			action = 0;
 
 		break;
-	case SORTID_SHARE:
-		if (!strncmp(temp_char, "force", 5))
+	case SORTID_OVER_SUBSCRIBE:
+		if (!xstrncmp(temp_char, "force", 5))
 			action = 0;
-		else if (!strcmp(temp_char, "no"))
+		else if (!xstrcmp(temp_char, "no"))
 			action = 1;
-		else if (!strncmp(temp_char, "yes", 3))
+		else if (!xstrncmp(temp_char, "yes", 3))
 			action = 2;
-		else if (!strcmp(temp_char, "exclusive"))
+		else if (!xstrcmp(temp_char, "exclusive"))
 			action = 3;
 		else
 			action = 0;
 		break;
 	case SORTID_PART_STATE:
-		if (!strcmp(temp_char, "up"))
+		if (!xstrcmp(temp_char, "up"))
 			action = 0;
-		else if (!strcmp(temp_char, "down"))
+		else if (!xstrcmp(temp_char, "down"))
 			action = 1;
-		else if (!strcmp(temp_char, "inactive"))
+		else if (!xstrcmp(temp_char, "inactive"))
 			action = 2;
-		else if (!strcmp(temp_char, "drain"))
+		else if (!xstrcmp(temp_char, "drain"))
 			action = 3;
 		else
 			action = 0;
 		break;
 	case SORTID_NODE_STATE:
-		if (!strcasecmp(temp_char, "drain"))
+		if (!xstrcasecmp(temp_char, "drain"))
 			action = 0;
-		else if (!strcasecmp(temp_char, "resume"))
+		else if (!xstrcasecmp(temp_char, "resume"))
 			action = 1;
 		else
 			for(i = 0; i < NODE_STATE_END; i++) {
 				upper = node_state_string(i);
-				if (!strcmp(upper, "UNKNOWN")) {
+				if (!xstrcmp(upper, "UNKNOWN")) {
 					unknown_found++;
 					continue;
 				}
 
-				if (!strcasecmp(temp_char, upper)) {
+				if (!xstrcasecmp(temp_char, upper)) {
 					action = i + 2 - unknown_found;
 					break;
 				}
@@ -422,15 +433,15 @@ static void _set_active_combo_part(GtkComboBox *combo,
 
 		break;
 	case SORTID_PREEMPT_MODE:
-		if (!strcasecmp(temp_char, "cancel"))
+		if (!xstrcasecmp(temp_char, "cancel"))
 			action = 0;
-		else if (!strcasecmp(temp_char, "checkpoint"))
+		else if (!xstrcasecmp(temp_char, "checkpoint"))
 			action = 1;
-		else if (!strcasecmp(temp_char, "off"))
+		else if (!xstrcasecmp(temp_char, "off"))
 			action = 2;
-		else if (!strcasecmp(temp_char, "requeue"))
+		else if (!xstrcasecmp(temp_char, "requeue"))
 			action = 3;
-		else if (!strcasecmp(temp_char, "suspend"))
+		else if (!xstrcasecmp(temp_char, "suspend"))
 			action = 4;
 		else
 			action = 2;	/* off */
@@ -444,7 +455,7 @@ end_it:
 
 }
 
-static uint16_t _set_part_share_popup()
+static uint16_t _set_part_over_subscribe_popup(void)
 {
 	GtkWidget *table = gtk_table_new(1, 2, FALSE);
 	GtkWidget *label = NULL;
@@ -466,7 +477,7 @@ static uint16_t _set_part_share_popup()
 				      GTK_STOCK_OK, GTK_RESPONSE_OK);
 	gtk_window_set_default(GTK_WINDOW(popup), label);
 
-	label = gtk_label_new("Shared Job Count ");
+	label = gtk_label_new("OverSubscribe Job Count ");
 
 	gtk_container_set_border_width(GTK_CONTAINER(table), 10);
 
@@ -508,20 +519,20 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		part_msg->alternate = xstrdup(new_text);
 		break;
 	case SORTID_DEFAULT:
-		if (!strcasecmp(new_text, "yes")) {
+		if (!xstrcasecmp(new_text, "yes")) {
 			part_msg->flags |= PART_FLAG_DEFAULT;
 			part_msg->flags &= (~PART_FLAG_DEFAULT_CLR);
-		} else if (!strcasecmp(new_text, "no")) {
+		} else if (!xstrcasecmp(new_text, "no")) {
 			part_msg->flags &= (~PART_FLAG_DEFAULT);
 			part_msg->flags |= PART_FLAG_DEFAULT_CLR;
 		}
 		type = "default";
 		break;
 	case SORTID_EXCLUSIVE_USER:
-		if (!strcasecmp(new_text, "yes")) {
+		if (!xstrcasecmp(new_text, "yes")) {
 			part_msg->flags |= PART_FLAG_EXCLUSIVE_USER;
 			part_msg->flags &= (~PART_FLAG_EXC_USER_CLR);
-		} else if (!strcasecmp(new_text, "no")) {
+		} else if (!xstrcasecmp(new_text, "no")) {
 			part_msg->flags &= (~PART_FLAG_EXCLUSIVE_USER);
 			part_msg->flags |= PART_FLAG_EXC_USER_CLR;
 		}
@@ -536,17 +547,17 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		part_msg->grace_time = (uint32_t)(temp_int * 60);
 		break;
 	case SORTID_HIDDEN:
-		if (!strcasecmp(new_text, "yes")) {
+		if (!xstrcasecmp(new_text, "yes")) {
 			part_msg->flags |= PART_FLAG_HIDDEN;
 			part_msg->flags &= (~PART_FLAG_HIDDEN_CLR);
-		} else if (!strcasecmp(new_text, "no")) {
+		} else if (!xstrcasecmp(new_text, "no")) {
 			part_msg->flags &= (~PART_FLAG_HIDDEN);
 			part_msg->flags |= PART_FLAG_HIDDEN_CLR;
 		}
 		type = "hidden";
 		break;
 	case SORTID_TIMELIMIT:
-		if ((strcasecmp(new_text, "infinite") == 0))
+		if ((xstrcasecmp(new_text, "infinite") == 0))
 			temp_int = INFINITE;
 		else
 			temp_int = time_str2mins((char *)new_text);
@@ -557,22 +568,27 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		part_msg->max_time = (uint32_t)temp_int;
 		break;
 	case SORTID_PREEMPT_MODE:
-		if (!strcasecmp(new_text, "cancel"))
+		if (!xstrcasecmp(new_text, "cancel"))
 			part_msg->preempt_mode = PREEMPT_MODE_CANCEL;
-		else if (!strcasecmp(new_text, "checkpoint"))
+		else if (!xstrcasecmp(new_text, "checkpoint"))
 			part_msg->preempt_mode = PREEMPT_MODE_CHECKPOINT;
-		else if (!strcasecmp(new_text, "off"))
+		else if (!xstrcasecmp(new_text, "off"))
 			part_msg->preempt_mode = PREEMPT_MODE_OFF;
-		else if (!strcasecmp(new_text, "requeue"))
+		else if (!xstrcasecmp(new_text, "requeue"))
 			part_msg->preempt_mode = PREEMPT_MODE_REQUEUE;
-		else if (!strcasecmp(new_text, "suspend"))
+		else if (!xstrcasecmp(new_text, "suspend"))
 			part_msg->preempt_mode = PREEMPT_MODE_SUSPEND;
 		type = "preempt_mode";
 		break;
-	case SORTID_PRIORITY:
+	case SORTID_PRIORITY_JOB_FACTOR:
+		temp_int = strtol(new_text, (char **)NULL, 10);
+		type = "priority_job_factor";
+		part_msg->priority_job_factor = (uint16_t)temp_int;
+		break;
+	case SORTID_PRIORITY_TIER:
 		temp_int = strtol(new_text, (char **)NULL, 10);
-		type = "priority";
-		part_msg->priority = (uint16_t)temp_int;
+		type = "priority_tier";
+		part_msg->priority_tier = (uint16_t)temp_int;
 		break;
 	case SORTID_NAME:
 		type = "name";
@@ -595,7 +611,7 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		part_msg->min_nodes = (uint32_t)temp_int;
 		break;
 	case SORTID_NODES_MAX:
-		if (!strcasecmp(new_text, "infinite")) {
+		if (!xstrcasecmp(new_text, "infinite")) {
 			temp_int = INFINITE;
 		} else {
 			temp_int = strtol(new_text, &temp_char, 10);
@@ -611,29 +627,29 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		part_msg->max_nodes = (uint32_t)temp_int;
 		break;
 	case SORTID_ROOT:
-		if (!strcasecmp(new_text, "yes")) {
+		if (!xstrcasecmp(new_text, "yes")) {
 			part_msg->flags |= PART_FLAG_ROOT_ONLY;
 			part_msg->flags &= (~PART_FLAG_ROOT_ONLY_CLR);
-		} else if (!strcasecmp(new_text, "no")) {
+		} else if (!xstrcasecmp(new_text, "no")) {
 			part_msg->flags &= (~PART_FLAG_ROOT_ONLY);
 			part_msg->flags |= PART_FLAG_ROOT_ONLY_CLR;
 		}
 
 		type = "root";
 		break;
-	case SORTID_SHARE:
-		if (!strcasecmp(new_text, "yes")) {
-			part_msg->max_share = _set_part_share_popup();
-		} else if (!strcasecmp(new_text, "exclusive")) {
+	case SORTID_OVER_SUBSCRIBE:
+		if (!xstrcasecmp(new_text, "yes")) {
+			part_msg->max_share = _set_part_over_subscribe_popup();
+		} else if (!xstrcasecmp(new_text, "exclusive")) {
 			part_msg->max_share = 0;
-		} else if (!strcasecmp(new_text, "force")) {
-			part_msg->max_share =
-				_set_part_share_popup() | SHARED_FORCE;
-		} else if (!strcasecmp(new_text, "no"))
+		} else if (!xstrcasecmp(new_text, "force")) {
+			part_msg->max_share = _set_part_over_subscribe_popup()
+					      | SHARED_FORCE;
+		} else if (!xstrcasecmp(new_text, "no"))
 			part_msg->max_share = 1;
 		else
 			goto return_error;
-		type = "share";
+		type = "oversubscribe";
 		break;
 	case SORTID_ALLOW_ACCOUNTS:
 		type = "accounts";
@@ -664,13 +680,13 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		type = "nodelist";
 		break;
 	case SORTID_PART_STATE:
-		if (!strcasecmp(new_text, "up"))
+		if (!xstrcasecmp(new_text, "up"))
 			part_msg->state_up = PARTITION_UP;
-		else if (!strcasecmp(new_text, "down"))
+		else if (!xstrcasecmp(new_text, "down"))
 			part_msg->state_up = PARTITION_DOWN;
-		else if (!strcasecmp(new_text, "inactive"))
+		else if (!xstrcasecmp(new_text, "inactive"))
 			part_msg->state_up = PARTITION_INACTIVE;
-		else if (!strcasecmp(new_text, "drain"))
+		else if (!xstrcasecmp(new_text, "drain"))
 			part_msg->state_up = PARTITION_DRAIN;
 		else
 			goto return_error;
@@ -694,7 +710,7 @@ static const char *_set_part_msg(update_part_msg_t *part_msg,
 		break;
 	}
 
-	if (strcmp(type, "unknown"))
+	if (xstrcmp(type, "unknown"))
 		global_send_update_msg = 1;
 
 	return type;
@@ -930,13 +946,13 @@ static void _layout_part_record(GtkTreeView *treeview,
 		GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
 
 	convert_num_unit((float)sview_part_info->sub_part_total.node_alloc_cnt,
-			 tmp_cnt, sizeof(tmp_cnt), UNIT_NONE,
+			 tmp_cnt, sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	convert_num_unit((float)sview_part_info->sub_part_total.node_idle_cnt,
-			 tmp_cnt1, sizeof(tmp_cnt1), UNIT_NONE,
+			 tmp_cnt1, sizeof(tmp_cnt1), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	convert_num_unit((float)sview_part_info->sub_part_total.node_error_cnt,
-			 tmp_cnt2, sizeof(tmp_cnt2), UNIT_NONE,
+			 tmp_cnt2, sizeof(tmp_cnt2), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	snprintf(ind_cnt, sizeof(ind_cnt), "%s/%s/%s",
 		 tmp_cnt, tmp_cnt1, tmp_cnt2);
@@ -971,7 +987,7 @@ static void _layout_part_record(GtkTreeView *treeview,
 		case SORTID_CPUS:
 			convert_num_unit((float)part_ptr->total_cpus,
 					 tmp_cnt, sizeof(tmp_cnt),
-					 UNIT_NONE,
+					 UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 			temp_char = tmp_cnt;
 			break;
@@ -1042,7 +1058,7 @@ static void _layout_part_record(GtkTreeView *treeview,
 			convert_num_unit((float)sview_part_info->
 					 sub_part_total.mem_total,
 					 tmp_cnt, sizeof(tmp_cnt),
-					 UNIT_MEGA,
+					 UNIT_MEGA, NO_VAL,
 					 working_sview_config.convert_flags);
 			temp_char = tmp_cnt;
 			break;
@@ -1055,8 +1071,8 @@ static void _layout_part_record(GtkTreeView *treeview,
 		case SORTID_NODES:
 			if (cluster_flags & CLUSTER_FLAG_BG)
 				convert_num_unit((float)part_ptr->total_nodes,
-						 tmp_cnt,
-						 sizeof(tmp_cnt), UNIT_NONE,
+						 tmp_cnt, sizeof(tmp_cnt),
+						 UNIT_NONE, NO_VAL,
 						 working_sview_config.
 						 convert_flags);
 			else
@@ -1082,9 +1098,17 @@ static void _layout_part_record(GtkTreeView *treeview,
 				temp_uint16 =  slurm_get_preempt_mode();
 			temp_char = preempt_mode_string(temp_uint16);
 			break;
-		case SORTID_PRIORITY:
-			convert_num_unit((float)part_ptr->priority,
+		case SORTID_PRIORITY_JOB_FACTOR:
+			convert_num_unit((float)part_ptr->priority_job_factor,
 					 time_buf, sizeof(time_buf), UNIT_NONE,
+					 NO_VAL,
+					 working_sview_config.convert_flags);
+			temp_char = time_buf;
+			break;
+		case SORTID_PRIORITY_TIER:
+			convert_num_unit((float)part_ptr->priority_tier,
+					 time_buf, sizeof(time_buf), UNIT_NONE,
+					 NO_VAL,
 					 working_sview_config.convert_flags);
 			temp_char = time_buf;
 			break;
@@ -1101,7 +1125,7 @@ static void _layout_part_record(GtkTreeView *treeview,
 			else
 				yes_no = 0;
 			break;
-		case SORTID_SHARE:
+		case SORTID_OVER_SUBSCRIBE:
 			if (part_ptr->max_share & SHARED_FORCE) {
 				snprintf(tmp_buf, sizeof(tmp_buf), "force:%u",
 					 (part_ptr->max_share
@@ -1120,7 +1144,7 @@ static void _layout_part_record(GtkTreeView *treeview,
 			convert_num_unit(
 				(float)sview_part_info->sub_part_total.
 				disk_total,
-				time_buf, sizeof(time_buf), UNIT_NONE,
+				time_buf, sizeof(time_buf), UNIT_NONE, NO_VAL,
 				working_sview_config.convert_flags);
 			temp_char = time_buf;
 			break;
@@ -1154,8 +1178,8 @@ static void _layout_part_record(GtkTreeView *treeview,
 				temp_char = "infinite";
 			else {
 				convert_num_unit(
-					(float)limit_set,
-					time_buf, sizeof(time_buf), UNIT_NONE,
+					(float)limit_set, time_buf,
+					sizeof(time_buf), UNIT_NONE, NO_VAL,
 					working_sview_config.convert_flags);
 				temp_char = time_buf;
 			}
@@ -1182,13 +1206,14 @@ static void _layout_part_record(GtkTreeView *treeview,
 static void _update_part_record(sview_part_info_t *sview_part_info,
 				GtkTreeStore *treestore)
 {
-	char tmp_prio[40], tmp_size[40], tmp_share_buf[40], tmp_time[40];
+	char tmp_prio_job_factor[40], tmp_prio_tier[40];
+	char tmp_size[40], tmp_over_subscribe_buf[40], tmp_time[40];
 	char tmp_max_nodes[40], tmp_min_nodes[40], tmp_grace[40];
 	char tmp_cpu_cnt[40], tmp_node_cnt[40], tmp_max_cpus_per_node[40];
 	char *tmp_alt, *tmp_default, *tmp_accounts, *tmp_groups, *tmp_hidden;
 	char *tmp_deny_accounts, *tmp_qos_char, *tmp_exc_user;
 	char *tmp_qos, *tmp_deny_qos;
-	char *tmp_root, *tmp_share, *tmp_state;
+	char *tmp_root, *tmp_over_subscribe, *tmp_state;
 	uint16_t tmp_preempt;
 	partition_info_t *part_ptr = sview_part_info->part_ptr;
 	GtkTreeIter sub_iter;
@@ -1200,7 +1225,7 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
 		convert_num_unit((float)part_ptr->total_cpus, tmp_cpu_cnt,
-				 sizeof(tmp_cpu_cnt), UNIT_NONE,
+				 sizeof(tmp_cpu_cnt), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		sprintf(tmp_cpu_cnt, "%u", part_ptr->total_cpus);
@@ -1255,17 +1280,17 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 	if (part_ptr->max_nodes == (uint32_t) INFINITE)
 		snprintf(tmp_max_nodes, sizeof(tmp_max_nodes), "infinite");
 	else {
-		convert_num_unit((float)part_ptr->max_nodes,
-				 tmp_max_nodes, sizeof(tmp_max_nodes),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)part_ptr->max_nodes, tmp_max_nodes,
+				 sizeof(tmp_max_nodes), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	}
 
 	if (part_ptr->min_nodes == (uint32_t) INFINITE)
 		snprintf(tmp_min_nodes, sizeof(tmp_min_nodes), "infinite");
 	else {
-		convert_num_unit((float)part_ptr->min_nodes,
-				 tmp_min_nodes, sizeof(tmp_min_nodes),
-				 UNIT_NONE, working_sview_config.convert_flags);
+		convert_num_unit((float)part_ptr->min_nodes, tmp_min_nodes,
+				 sizeof(tmp_min_nodes), UNIT_NONE, NO_VAL,
+				 working_sview_config.convert_flags);
 	}
 
 	if (part_ptr->max_cpus_per_node == INFINITE) {
@@ -1277,7 +1302,7 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 
 	if (cluster_flags & CLUSTER_FLAG_BG)
 		convert_num_unit((float)part_ptr->total_nodes, tmp_node_cnt,
-				 sizeof(tmp_node_cnt), UNIT_NONE,
+				 sizeof(tmp_node_cnt), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	else
 		sprintf(tmp_node_cnt, "%u", part_ptr->total_nodes);
@@ -1306,22 +1331,27 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 	if (tmp_preempt == (uint16_t) NO_VAL)
 		tmp_preempt = slurm_get_preempt_mode();	/* use cluster param */
 
-	convert_num_unit((float)part_ptr->priority,
-			 tmp_prio, sizeof(tmp_prio), UNIT_NONE,
+	convert_num_unit((float)part_ptr->priority_job_factor,
+			 tmp_prio_job_factor, sizeof(tmp_prio_job_factor),
+			 UNIT_NONE, NO_VAL, working_sview_config.convert_flags);
+
+	convert_num_unit((float)part_ptr->priority_tier, tmp_prio_tier,
+			 sizeof(tmp_prio_tier), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	if (part_ptr->max_share & SHARED_FORCE) {
-		snprintf(tmp_share_buf, sizeof(tmp_share_buf), "force:%u",
-			 (part_ptr->max_share & ~(SHARED_FORCE)));
-		tmp_share = tmp_share_buf;
+		snprintf(tmp_over_subscribe_buf, sizeof(tmp_over_subscribe_buf),
+			 "force:%u", (part_ptr->max_share & ~(SHARED_FORCE)));
+		tmp_over_subscribe = tmp_over_subscribe_buf;
 	} else if (part_ptr->max_share == 0) {
-		tmp_share = "exclusive";
+		tmp_over_subscribe = "exclusive";
 	} else if (part_ptr->max_share > 1) {
-		snprintf(tmp_share_buf, sizeof(tmp_share_buf), "yes:%u",
+		snprintf(tmp_over_subscribe_buf,
+			 sizeof(tmp_over_subscribe_buf), "yes:%u",
 			 part_ptr->max_share);
-		tmp_share = tmp_share_buf;
+		tmp_over_subscribe = tmp_over_subscribe_buf;
 	} else
-		tmp_share = "no";
+		tmp_over_subscribe = "no";
 
 	if (part_ptr->max_time == INFINITE)
 		snprintf(tmp_time, sizeof(tmp_time), "infinite");
@@ -1346,6 +1376,7 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 			   SORTID_CPUS,       tmp_cpu_cnt,
 			   SORTID_DEFAULT,    tmp_default,
 			   SORTID_FEATURES,   "",
+			   SORTID_FEATURES_ACT, "",
 			   SORTID_GRACE_TIME, tmp_grace,
 			   SORTID_QOS_CHAR,   tmp_qos_char,
 			   SORTID_ALLOW_ACCOUNTS, tmp_accounts,
@@ -1367,13 +1398,14 @@ static void _update_part_record(sview_part_info_t *sview_part_info,
 			   SORTID_NODES_MIN,  tmp_min_nodes,
 			   SORTID_NODELIST,   part_ptr->nodes,
 			   SORTID_ONLY_LINE,  0,
+			   SORTID_OVER_SUBSCRIBE, tmp_over_subscribe,
 			   SORTID_PART_STATE, tmp_state,
 			   SORTID_PREEMPT_MODE,
 				preempt_mode_string(tmp_preempt),
-			   SORTID_PRIORITY,   tmp_prio,
+			   SORTID_PRIORITY_JOB_FACTOR, tmp_prio_job_factor,
+			   SORTID_PRIORITY_TIER, tmp_prio_tier,
 			   SORTID_REASON,     "",
 			   SORTID_ROOT,       tmp_root,
-			   SORTID_SHARE,      tmp_share,
 			   SORTID_TIMELIMIT,  tmp_time,
 			   SORTID_TMP_DISK,   "",
 			   SORTID_UPDATED,    1,
@@ -1409,7 +1441,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 		if (sview_part_sub->cpu_alloc_cnt) {
 			convert_num_unit((float)sview_part_sub->cpu_alloc_cnt,
 					 tmp_cnt,
-					 sizeof(tmp_cnt), UNIT_NONE,
+					 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 			xstrfmtcat(tmp_cpus, "Alloc:%s", tmp_cnt);
 			if (cluster_flags & CLUSTER_FLAG_BG) {
@@ -1417,7 +1449,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 					(float)(sview_part_sub->cpu_alloc_cnt
 						/ cpus_per_node),
 					tmp_cnt,
-					sizeof(tmp_cnt), UNIT_NONE,
+					sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					working_sview_config.convert_flags);
 				xstrfmtcat(tmp_nodes, "Alloc:%s", tmp_cnt);
 			}
@@ -1425,7 +1457,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 		if (sview_part_sub->cpu_error_cnt) {
 			convert_num_unit((float)sview_part_sub->cpu_error_cnt,
 					 tmp_cnt,
-					 sizeof(tmp_cnt), UNIT_NONE,
+					 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 			if (tmp_cpus)
 				xstrcat(tmp_cpus, " ");
@@ -1435,7 +1467,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 					(float)(sview_part_sub->cpu_error_cnt
 						/ cpus_per_node),
 					tmp_cnt,
-					sizeof(tmp_cnt), UNIT_NONE,
+					sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					working_sview_config.convert_flags);
 				if (tmp_nodes)
 					xstrcat(tmp_nodes, " ");
@@ -1445,7 +1477,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 		if (sview_part_sub->cpu_idle_cnt) {
 			convert_num_unit((float)sview_part_sub->cpu_idle_cnt,
 					 tmp_cnt,
-					 sizeof(tmp_cnt), UNIT_NONE,
+					 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					 working_sview_config.convert_flags);
 			if (tmp_cpus)
 				xstrcat(tmp_cpus, " ");
@@ -1455,7 +1487,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 					(float)(sview_part_sub->cpu_idle_cnt
 						/ cpus_per_node),
 					tmp_cnt,
-					sizeof(tmp_cnt), UNIT_NONE,
+					sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 					working_sview_config.convert_flags);
 				if (tmp_nodes)
 					xstrcat(tmp_nodes, " ");
@@ -1465,23 +1497,23 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 	} else {
 		tmp_cpus = xmalloc(20);
 		convert_num_unit((float)sview_part_sub->cpu_cnt,
-				 tmp_cpus, 20, UNIT_NONE,
+				 tmp_cpus, 20, UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 	}
 
 	if (!tmp_nodes) {
 		convert_num_unit((float)sview_part_sub->node_cnt, tmp_cnt,
-				 sizeof(tmp_cnt), UNIT_NONE,
+				 sizeof(tmp_cnt), UNIT_NONE, NO_VAL,
 				 working_sview_config.convert_flags);
 		tmp_nodes = xstrdup(tmp_cnt);
 	}
 
 	convert_num_unit((float)sview_part_sub->disk_total, tmp_disk,
-			 sizeof(tmp_disk), UNIT_NONE,
+			 sizeof(tmp_disk), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	convert_num_unit((float)sview_part_sub->mem_total, tmp_mem,
-			 sizeof(tmp_mem), UNIT_MEGA,
+			 sizeof(tmp_mem), UNIT_MEGA, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	tmp_nodelist = hostlist_ranged_string_xmalloc(sview_part_sub->hl);
@@ -1489,6 +1521,7 @@ static void _update_part_sub_record(sview_part_sub_t *sview_part_sub,
 	gtk_tree_store_set(treestore, iter,
 			   SORTID_CPUS,           tmp_cpus,
 			   SORTID_FEATURES,       sview_part_sub->features,
+			   SORTID_FEATURES_ACT,   sview_part_sub->features_act,
 			   SORTID_MEM,            tmp_mem,
 			   SORTID_NAME,           part_ptr->name,
 			   SORTID_NODE_STATE_NUM, sview_part_sub->node_state,
@@ -1548,7 +1581,7 @@ static void _update_info_part(List info_list,
 		if (sview_part_info->iter_set) {
 			gtk_tree_model_get(model, &sview_part_info->iter_ptr,
 					   SORTID_NAME, &name, -1);
-			if (strcmp(name, sview_part_info->part_name))
+			if (xstrcmp(name, sview_part_info->part_name))
 				/* Bad pointer */
 				sview_part_info->iter_set = false;
 			g_free(name);
@@ -1595,6 +1628,7 @@ static void _destroy_part_sub(void *object)
 
 	if (sview_part_sub) {
 		xfree(sview_part_sub->features);
+		xfree(sview_part_sub->features_act);
 		xfree(sview_part_sub->reason);
 		if (sview_part_sub->hl)
 			hostlist_destroy(sview_part_sub->hl);
@@ -1619,9 +1653,10 @@ static void _update_sview_part_sub(sview_part_sub_t *sview_part_sub,
 	xassert(sview_part_sub->hl);
 
 	if (sview_part_sub->node_cnt == 0) {	/* first node added */
-		sview_part_sub->node_state = node_ptr->node_state;
-		sview_part_sub->features   = xstrdup(node_ptr->features);
-		sview_part_sub->reason     = xstrdup(node_ptr->reason);
+		sview_part_sub->node_state   = node_ptr->node_state;
+		sview_part_sub->features     = xstrdup(node_ptr->features);
+		sview_part_sub->features_act = xstrdup(node_ptr->features_act);
+		sview_part_sub->reason       = xstrdup(node_ptr->reason);
 	} else if (hostlist_find(sview_part_sub->hl, node_ptr->name) != -1) {
 		/* we already have this node in this record,
 		 * just return, don't duplicate */
@@ -1747,7 +1782,8 @@ static int _sview_part_sort_aval_dec(void *a, void *b)
 		return 1;
 
 	if (rec_a->part_ptr->nodes && rec_b->part_ptr->nodes) {
-		size_a = strcmp(rec_a->part_ptr->nodes, rec_b->part_ptr->nodes);
+		size_a = xstrcmp(rec_a->part_ptr->nodes,
+				 rec_b->part_ptr->nodes);
 		if (size_a < 0)
 			return -1;
 		else if (size_a > 0)
@@ -1819,8 +1855,8 @@ static List _create_part_info_list(partition_info_msg_t *part_info_ptr,
 		if (last_list_itr) {
 			while ((sview_part_info =
 				list_next(last_list_itr))) {
-				if (!strcmp(sview_part_info->part_name,
-					    part_ptr->name)) {
+				if (!xstrcmp(sview_part_info->part_name,
+					     part_ptr->name)) {
 					list_remove(last_list_itr);
 					_part_info_free(sview_part_info);
 					break;
@@ -1903,6 +1939,8 @@ static List _create_part_info_list(partition_info_msg_t *part_info_ptr,
 				   in the others group */
 				sview_part_info->sub_part_total.features
 					= sview_part_sub->features;
+				sview_part_info->sub_part_total.features_act
+					= sview_part_sub->features_act;
 				sview_part_info->sub_part_total.reason
 					= sview_part_sub->reason;
 			}
@@ -1960,7 +1998,7 @@ need_refresh:
 	itr = list_iterator_create(info_list);
 	while ((sview_part_info = (sview_part_info_t*) list_next(itr))) {
 		part_ptr = sview_part_info->part_ptr;
-		if (!strcmp(part_ptr->name, name)) {
+		if (!xstrcmp(part_ptr->name, name)) {
 			j = 0;
 			while (part_ptr->node_inx[j] >= 0) {
 				change_grid_color(
@@ -2135,7 +2173,7 @@ extern bool visible_part(char* part_name)
 		get_new_info_part(&part_info_ptr, force_refresh);
 	for (i=0; i<g_part_info_ptr->record_count; i++) {
 		m_part_ptr = &(g_part_info_ptr->partition_array[i]);
-		if (!strcmp(m_part_ptr->name, part_name)) {
+		if (!xstrcmp(m_part_ptr->name, part_name)) {
 			if (m_part_ptr->flags & PART_FLAG_HIDDEN)
 				rc =  FALSE;
 			else
@@ -2229,20 +2267,20 @@ static GtkListStore *_create_model_part2(int type)
 		gtk_list_store_set(model, &iter,
 				   0, "no", 1, SORTID_DEFAULT, -1);
 		break;
-	case SORTID_SHARE:
+	case SORTID_OVER_SUBSCRIBE:
 		model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "no (default)", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "no (default)",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "yes", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter,  0, "yes",
+				  1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "force", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "force",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "exclusive", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "exclusive",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		break;
 	case SORTID_PART_STATE:
 		model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
@@ -2326,26 +2364,27 @@ extern GtkListStore *create_model_part(int type)
 				   0, "suspend", 1, SORTID_PREEMPT_MODE, -1);
 		break;
 	case SORTID_GRACE_TIME:
-	case SORTID_PRIORITY:
+	case SORTID_PRIORITY_JOB_FACTOR:
+	case SORTID_PRIORITY_TIER:
 	case SORTID_TIMELIMIT:
 	case SORTID_NODES_MIN:
 	case SORTID_NODES_MAX:
 	case SORTID_MAX_CPUS_PER_NODE:
 		break;
-	case SORTID_SHARE:
+	case SORTID_OVER_SUBSCRIBE:
 		model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "force", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "force",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "no", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "no",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "yes", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "yes",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		gtk_list_store_append(model, &iter);
-		gtk_list_store_set(model, &iter,
-				   0, "exclusive", 1, SORTID_SHARE, -1);
+		gtk_list_store_set(model, &iter, 0, "exclusive",
+				   1, SORTID_OVER_SUBSCRIBE, -1);
 		break;
 	case SORTID_ALLOW_ACCOUNTS:
 		break;
@@ -2384,7 +2423,7 @@ extern GtkListStore *create_model_part(int type)
 				   0, "resume", 1, SORTID_NODE_STATE, -1);
 		for(i = 0; i < NODE_STATE_END; i++) {
 			upper = node_state_string(i);
-			if (!strcmp(upper, "UNKNOWN"))
+			if (!xstrcmp(upper, "UNKNOWN"))
 				continue;
 
 			gtk_list_store_append(model, &iter);
@@ -2416,7 +2455,7 @@ extern void admin_edit_part(GtkCellRendererText *cell,
 	int column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
 						       "column"));
 
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -2448,7 +2487,7 @@ extern void admin_edit_part(GtkCellRendererText *cell,
 	}
 
 	if (column != SORTID_NODE_STATE && column != SORTID_FEATURES ) {
-		if (old_text && !strcmp(old_text, new_text)) {
+		if (old_text && !xstrcmp(old_text, new_text)) {
 			temp = g_strdup_printf("No change in value.");
 		} else if (slurm_update_partition(part_msg)
 			   == SLURM_SUCCESS) {
@@ -2761,7 +2800,7 @@ display_it:
 	while ((sview_part_info_ptr = list_next(itr))) {
 		i++;
 		part_ptr = sview_part_info_ptr->part_ptr;
-		switch(spec_info->type) {
+		switch (spec_info->type) {
 		case RESV_PAGE:
 		case NODE_PAGE:
 			if (!part_ptr->nodes)
@@ -2782,8 +2821,8 @@ display_it:
 				if (!spec_info->search_info->gchar_data)
 					continue;
 
-				if (strcmp(part_ptr->name,
-					   spec_info->search_info->gchar_data))
+				if (xstrcmp(part_ptr->name,
+					    spec_info->search_info->gchar_data))
 					continue;
 				break;
 			case SEARCH_PARTITION_STATE:
@@ -2803,8 +2842,8 @@ display_it:
 			if (!spec_info->search_info->gchar_data)
 				continue;
 
-			if (strcmp(part_ptr->name,
-				   spec_info->search_info->gchar_data))
+			if (xstrcmp(part_ptr->name,
+				    spec_info->search_info->gchar_data))
 				continue;
 			break;
 		default:
@@ -2939,7 +2978,7 @@ extern void popup_all_part(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -3053,7 +3092,7 @@ extern void admin_part(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 
 	part_msg->name = xstrdup(partid);
 
-	if (!strcasecmp("Change Partition State", type)) {
+	if (!xstrcasecmp("Change Partition State", type)) {
 		GtkCellRenderer *renderer = NULL;
 		GtkTreeModel *model2 = GTK_TREE_MODEL(
 			create_model_part(SORTID_PART_STATE));
@@ -3089,7 +3128,7 @@ extern void admin_part(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 			 partid);
 		label = gtk_label_new(tmp_char);
 		edit_type = EDIT_PART_STATE;
-	} else if (!strcasecmp("Remove Partition", type)) {
+	} else if (!xstrcasecmp("Remove Partition", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_YES, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
@@ -3101,7 +3140,7 @@ extern void admin_part(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 			 partid);
 		label = gtk_label_new(tmp_char);
 		edit_type = EDIT_REMOVE_PART;
-	} else if (!strcasecmp("Edit Partition", type)) {
+	} else if (!xstrcasecmp("Edit Partition", type)) {
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
 					      GTK_STOCK_OK, GTK_RESPONSE_OK);
 		gtk_window_set_default(GTK_WINDOW(popup), label);
@@ -3122,8 +3161,8 @@ extern void admin_part(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 		else
 			gtk_tree_model_get(model, iter, SORTID_FEATURES,
 					   &old_features, -1);
-		update_features_node(GTK_DIALOG(popup),
-				     nodelist, old_features);
+		update_avail_features_node(GTK_DIALOG(popup),
+					   nodelist, old_features);
 		if (got_features_edit_signal) {
 			got_features_edit_signal = NULL;
 			xfree(old_features);
@@ -3239,17 +3278,17 @@ extern void cluster_change_part(void)
 			}
 
 			if (!display_data->name) {
-			} else if (!strcmp(display_data->name, "Drain Nodes"))
+			} else if (!xstrcmp(display_data->name, "Drain Nodes"))
 				display_data->name = "Drain Midplanes";
-			else if (!strcmp(display_data->name, "Resume Nodes"))
+			else if (!xstrcmp(display_data->name, "Resume Nodes"))
 				display_data->name = "Resume Midplanes";
-			else if (!strcmp(display_data->name, "Put Nodes Down"))
+			else if (!xstrcmp(display_data->name, "Put Nodes Down"))
 				display_data->name = "Put Midplanes Down";
-			else if (!strcmp(display_data->name, "Make Nodes Idle"))
+			else if (!xstrcmp(display_data->name,"Make Nodes Idle"))
 				display_data->name =
 					"Make Midplanes Idle";
-			else if (!strcmp(display_data->name,
-					 "Update Node Features"))
+			else if (!xstrcmp(display_data->name,
+					  "Update Node Features"))
 				display_data->name =
 					"Update Midplanes Features";
 		} else {
@@ -3263,19 +3302,19 @@ extern void cluster_change_part(void)
 			}
 
 			if (!display_data->name) {
-			} else if (!strcmp(display_data->name,
+			} else if (!xstrcmp(display_data->name,
 					   "Drain Midplanes"))
 				display_data->name = "Drain Nodes";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Resume Midplanes"))
 				display_data->name = "Resume Nodes";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Put Midplanes Down"))
 				display_data->name = "Put Nodes Down";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Make Midplanes Idle"))
 				display_data->name = "Make Nodes Idle";
-			else if (!strcmp(display_data->name,
+			else if (!xstrcmp(display_data->name,
 					 "Update Node Features"))
 				display_data->name =
 					"Update Midplanes Features";
diff --git a/src/sview/popups.c b/src/sview/popups.c
index ef48764b4..571d4ab84 100644
--- a/src/sview/popups.c
+++ b/src/sview/popups.c
@@ -163,7 +163,7 @@ void _search_entry(sview_search_info_t *sview_search_info)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -451,14 +451,14 @@ extern void create_daemon_popup(GtkAction *action, gpointer user_data)
 
 	gethostname_short(me, MAX_SLURM_NAME);
 	if ((b = conf->backup_controller)) {
-		if ((strcmp(b, me) == 0) ||
-		    (strcasecmp(b, "localhost") == 0))
+		if ((xstrcmp(b, me) == 0) ||
+		    (xstrcasecmp(b, "localhost") == 0))
 			ctld = 1;
 	}
 	if ((c = conf->control_machine)) {
 		actld = 1;
-		if ((strcmp(c, me) == 0) ||
-		    (strcasecmp(c, "localhost") == 0))
+		if ((xstrcmp(c, me) == 0) ||
+		    (xstrcasecmp(c, "localhost") == 0))
 			ctld = 1;
 	}
 	slurm_conf_unlock();
@@ -517,7 +517,7 @@ extern void create_create_popup(GtkAction *action, gpointer user_data)
 			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 	gtk_window_set_default_size(GTK_WINDOW(popup), 400, 600);
 
-	if (!strcmp(name, "batch_job")) {
+	if (!xstrcmp(name, "batch_job")) {
 		sview_search_info.search_type = CREATE_BATCH_JOB;
 		label = gtk_label_new(
 			"Batch job submission specifications\n\n"
@@ -532,7 +532,7 @@ extern void create_create_popup(GtkAction *action, gpointer user_data)
 		if (!getcwd(job_msg->work_dir, 1024))
 			goto end_it;
 		entry = create_job_entry(job_msg, model, &iter);
-	} else if (!strcmp(name, "partition")) {
+	} else if (!xstrcmp(name, "partition")) {
 		sview_search_info.search_type = CREATE_PARTITION;
 		label = gtk_label_new(
 			"Partition creation specifications\n\n"
@@ -540,7 +540,7 @@ extern void create_create_popup(GtkAction *action, gpointer user_data)
 		part_msg = xmalloc(sizeof(update_part_msg_t));
 		slurm_init_part_desc_msg(part_msg);
 		entry = create_part_entry(part_msg, model, &iter);
-	} else if (!strcmp(name, "reservation")) {
+	} else if (!xstrcmp(name, "reservation")) {
 		sview_search_info.search_type = CREATE_RESERVATION;
 		label = gtk_label_new(
 			"Reservation creation specifications\n\n"
@@ -669,15 +669,15 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 	gtk_dialog_add_button(GTK_DIALOG(popup),
 			      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
 
-	if (!strcmp(name, "jobid")) {
+	if (!xstrcmp(name, "jobid")) {
 		sview_search_info.search_type = SEARCH_JOB_ID;
 		entry = create_entry();
 		label = gtk_label_new("Which job id?");
-	} else if (!strcmp(name, "user_jobs")) {
+	} else if (!xstrcmp(name, "user_jobs")) {
 		sview_search_info.search_type = SEARCH_JOB_USER;
 		entry = create_entry();
 		label = gtk_label_new("Which user?");
-	} else if (!strcmp(name, "state_jobs")) {
+	} else if (!xstrcmp(name, "state_jobs")) {
 		display_data_t pulldown_display_data[] = {
 			{G_TYPE_NONE, JOB_PENDING, "Pending", TRUE, -1},
 			{G_TYPE_NONE, JOB_CONFIGURING, "Configuring", TRUE, -1},
@@ -690,17 +690,18 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 			{G_TYPE_NONE, JOB_NODE_FAIL, "Node Failure", TRUE, -1},
 			{G_TYPE_NONE, JOB_PREEMPTED, "Preempted", TRUE, -1},
 			{G_TYPE_NONE, JOB_BOOT_FAIL, "Boot Failure", TRUE, -1},
+			{G_TYPE_NONE, JOB_DEADLINE, "Deadline", TRUE, -1},
 			{G_TYPE_NONE, -1, NULL, FALSE, -1}
 		};
 
 		sview_search_info.search_type = SEARCH_JOB_STATE;
 		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
-	} else if (!strcmp(name, "partition_name")) {
+	} else if (!xstrcmp(name, "partition_name")) {
 		sview_search_info.search_type = SEARCH_PARTITION_NAME;
 		entry = create_entry();
 		label = gtk_label_new("Which partition");
-	} else if (!strcmp(name, "partition_state")) {
+	} else if (!xstrcmp(name, "partition_state")) {
 		display_data_t pulldown_display_data[] = {
 			{G_TYPE_NONE, PARTITION_UP, "Up", TRUE, -1},
 			{G_TYPE_NONE, PARTITION_DOWN, "Down", TRUE, -1},
@@ -712,7 +713,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		sview_search_info.search_type = SEARCH_PARTITION_STATE;
 		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
-	} else if (!strcmp(name, "node_name")) {
+	} else if (!xstrcmp(name, "node_name")) {
 		sview_search_info.search_type = SEARCH_NODE_NAME;
 		entry = create_entry();
 		if (cluster_flags & CLUSTER_FLAG_BG)
@@ -721,7 +722,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		else
 			label = gtk_label_new("Which node(s)?\n"
 					      "(ranged or comma separated)");
-	} else if (!strcmp(name, "node_state")) {
+	} else if (!xstrcmp(name, "node_state")) {
 		display_data_t pulldown_display_data[] = {
 			{G_TYPE_NONE, NODE_STATE_ALLOCATED, "Allocated",
 			 TRUE, -1},
@@ -758,16 +759,16 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
 	} else if ((cluster_flags & CLUSTER_FLAG_BG)
-		   && !strcmp(name, "bg_block_name")) {
+		   && !xstrcmp(name, "bg_block_name")) {
 		sview_search_info.search_type = SEARCH_BLOCK_NAME;
 		entry = create_entry();
 		label = gtk_label_new("Which block?");
 	} else if ((cluster_flags & CLUSTER_FLAG_BG)
-		   && !strcmp(name, "bg_block_size")) {
+		   && !xstrcmp(name, "bg_block_size")) {
 		sview_search_info.search_type = SEARCH_BLOCK_SIZE;
 		entry = create_entry();
 		label = gtk_label_new("Which block size?");
-	} else if (!strcmp(name, "bg_block_state")) {
+	} else if (!xstrcmp(name, "bg_block_state")) {
 		display_data_t pulldown_display_data[] = {
 			{G_TYPE_NONE, BG_BLOCK_NAV, "Nav", TRUE, -1},
 			{G_TYPE_NONE, BG_BLOCK_FREE, "Free", TRUE, -1},
@@ -807,7 +808,7 @@ extern void create_search_popup(GtkAction *action, gpointer user_data)
 		sview_search_info.search_type = SEARCH_BLOCK_STATE;
 		entry = create_pulldown_combo(pulldown_display_data);
 		label = gtk_label_new("Which state?");
-	} else if (!strcmp(name, "reservation_name")) {
+	} else if (!xstrcmp(name, "reservation_name")) {
 		sview_search_info.search_type = SEARCH_RESERVATION_NAME;
 		entry = create_entry();
 		label = gtk_label_new("Which reservation");
diff --git a/src/sview/resv_info.c b/src/sview/resv_info.c
index d91af75fc..cb95db0dc 100644
--- a/src/sview/resv_info.c
+++ b/src/sview/resv_info.c
@@ -31,6 +31,7 @@
 #include "src/sview/sview.h"
 #include "src/common/parse_time.h"
 #include "src/common/proc_args.h"
+#include "src/common/slurm_strcasestr.h"
 
 #define _DEBUG 0
 
@@ -239,9 +240,9 @@ static void _set_active_combo_resv(GtkComboBox *combo,
 		goto end_it;
 	switch (type) {
 	case SORTID_ACTION:
-		if (!strcmp(temp_char, "none"))
+		if (!xstrcmp(temp_char, "none"))
 			action = 0;
-		else if (!strcmp(temp_char, "remove"))
+		else if (!xstrcmp(temp_char, "remove"))
 			action = 1;
 		else
 			action = 0;
@@ -261,9 +262,9 @@ static uint32_t _parse_watts(char * watts_str)
 	uint32_t watts_num = 0;
 	char *end_ptr = NULL;
 
-	if (!strcasecmp(watts_str, "n/a") || !strcasecmp(watts_str, "none"))
+	if (!xstrcasecmp(watts_str, "n/a") || !xstrcasecmp(watts_str, "none"))
 		return watts_num;
-	if (!strcasecmp(watts_str, "INFINITE"))
+	if (!xstrcasecmp(watts_str, "INFINITE"))
 		return INFINITE;
 	watts_num = strtol(watts_str, &end_ptr, 10);
 	if ((end_ptr[0] == 'k') || (end_ptr[0] == 'K')) {
@@ -277,6 +278,43 @@ static uint32_t _parse_watts(char * watts_str)
 	return watts_num;
 }
 
+/* Inspired by same func in src/scontrol/create_res.c, without error msgs */
+static int _parse_resv_core_cnt(resv_desc_msg_t *resv_msg_ptr, const char *val)
+{
+
+        char *endptr = NULL, *core_cnt = NULL, *tok = NULL;
+	char *type = NULL, *ptrptr = NULL;
+        int node_inx = 0;
+	uint32_t select_type = slurmdb_setup_plugin_id_select();
+
+	/* only have this on a cons_res machine */
+	if (select_type != SELECT_PLUGIN_CONS_RES &&
+	    select_type != SELECT_PLUGIN_CRAY_CONS_RES)
+		return SLURM_ERROR;
+
+        xfree(type);
+        core_cnt = xstrdup(val);
+        tok = strtok_r(core_cnt, ",", &ptrptr);
+        while (tok) {
+                xrealloc(resv_msg_ptr->core_cnt,
+                         sizeof(uint32_t) * (node_inx + 2));
+                resv_msg_ptr->core_cnt[node_inx] =
+                        strtol(tok, &endptr, 10);
+                if ((endptr == NULL) ||
+                    (endptr[0] != '\0') ||
+                    (tok[0] == '\0')) {
+                        xfree(core_cnt);
+                        return SLURM_ERROR;
+                }
+                node_inx++;
+                tok = strtok_r(NULL, ",", &ptrptr);
+        }
+
+        xfree(core_cnt);
+        return SLURM_SUCCESS;
+}
+
+
 /* don't free this char */
 static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 				 const char *new_text,
@@ -289,6 +327,8 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 
 	/* need to clear global_edit_error here (just in case) */
 	global_edit_error = 0;
+	if (global_edit_error_msg)
+		g_free(global_edit_error_msg);
 
 	if (!resv_msg)
 		return NULL;
@@ -300,7 +340,7 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 		break;
 	case SORTID_ACTION:
 		xfree(got_edit_signal);
-		if (!strcasecmp(new_text, "None"))
+		if (!xstrcasecmp(new_text, "None"))
 			got_edit_signal = NULL;
 		else
 			got_edit_signal = xstrdup(new_text);
@@ -309,6 +349,18 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 		resv_msg->burst_buffer = xstrdup(new_text);
 		type = "burst_buffer";
 		break;
+        case SORTID_CORE_CNT:
+		if (cluster_flags & CLUSTER_FLAG_BG)
+			type = "Cnode Count";
+		else
+			type = "Core Count";
+                if (_parse_resv_core_cnt(resv_msg, new_text) == SLURM_ERROR) {
+			global_edit_error_msg = g_strdup_printf(
+				"Can't use %s when system "
+				"is not running cons_res select plugin", type);
+			goto return_error;
+                }
+                break;
 	case SORTID_DURATION:
 		temp_int = time_str2mins((char *)new_text);
 		if (temp_int <= 0)
@@ -340,7 +392,10 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 		type = "name";
 		break;
 	case SORTID_NODE_CNT:
-		type = "Node Count";
+		if (cluster_flags & CLUSTER_FLAG_BG)
+			type = "Midplane Count";
+		else
+			type = "Node Count";
 		block_inx = 0;
 		tmp_text = xstrdup(new_text);
 		tok = strtok_r(tmp_text, ",", &last);
@@ -364,7 +419,10 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 		break;
 	case SORTID_NODELIST:
 		resv_msg->node_list = xstrdup(new_text);
-		type = "node list";
+		if (cluster_flags & CLUSTER_FLAG_BG)
+			type = "Midplane List";
+		else
+			type = "Node List";
 		break;
 	case SORTID_PARTITION:
 		resv_msg->partition = xstrdup(new_text);
@@ -387,7 +445,7 @@ static const char *_set_resv_msg(resv_desc_msg_t *resv_msg,
 		break;
 	}
 
-	if (strcmp(type, "unknown"))
+	if (xstrcmp(type, "unknown"))
 		global_send_update_msg = 1;
 
 	return type;
@@ -455,9 +513,7 @@ static gboolean _admin_focus_out_resv(GtkEntry *entry,
 		const char *name = gtk_entry_get_text(entry);
 		type -= DEFAULT_ENTRY_LENGTH;
 		col_name = _set_resv_msg(resv_msg, name, type);
-		if (global_edit_error) {
-			if (global_edit_error_msg)
-				g_free(global_edit_error_msg);
+		if (global_edit_error && !global_edit_error_msg) {
 			global_edit_error_msg = g_strdup_printf(
 				"Reservation %s %s can't be set to %s",
 				resv_msg->name,
@@ -536,7 +592,7 @@ static void _layout_resv_record(GtkTreeView *treeview,
 				   resv_ptr->burst_buffer);
 
 	convert_num_unit((float)resv_ptr->core_cnt,
-			 time_buf, sizeof(time_buf), UNIT_NONE,
+			 time_buf, sizeof(time_buf), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_resv,
@@ -569,7 +625,7 @@ static void _layout_resv_record(GtkTreeView *treeview,
 
 	/* NOTE: node_cnt in reservation info from slurmctld ONE number */
 	convert_num_unit((float)resv_ptr->node_cnt,
-			 time_buf, sizeof(time_buf), UNIT_NONE,
+			 time_buf, sizeof(time_buf), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 	add_display_treestore_line(update, treestore, &iter,
 				   find_col_name(display_data_resv,
@@ -645,11 +701,11 @@ static void _update_resv_record(sview_resv_info_t *sview_resv_info_ptr,
 	tmp_flags = reservation_flags_string(resv_ptr->flags);
 
 	convert_num_unit((float)resv_ptr->core_cnt,
-			 tmp_cores, sizeof(tmp_cores), UNIT_NONE,
+			 tmp_cores, sizeof(tmp_cores), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	convert_num_unit((float)resv_ptr->node_cnt,
-			 tmp_nodes, sizeof(tmp_nodes), UNIT_NONE,
+			 tmp_nodes, sizeof(tmp_nodes), UNIT_NONE, NO_VAL,
 			 working_sview_config.convert_flags);
 
 	slurm_make_time_str((time_t *)&resv_ptr->start_time, tmp_start,
@@ -727,7 +783,7 @@ static void _update_info_resv(List info_list,
 		if (sview_resv_info->iter_set) {
 			gtk_tree_model_get(model, &sview_resv_info->iter_ptr,
 					   SORTID_NAME, &name, -1);
-			if (strcmp(name, sview_resv_info->resv_name)) {
+			if (xstrcmp(name, sview_resv_info->resv_name)) {
 				/* Bad pointer */
 				sview_resv_info->iter_set = false;
 				//g_print("bad resv iter pointer\n");
@@ -766,8 +822,8 @@ static int _sview_resv_sort_aval_dec(void *s1, void *s2)
 		return 1;
 
 	if (rec_a->resv_ptr->node_list && rec_b->resv_ptr->node_list) {
-		size_a = strcmp(rec_a->resv_ptr->node_list,
-				rec_b->resv_ptr->node_list);
+		size_a = xstrcmp(rec_a->resv_ptr->node_list,
+				 rec_b->resv_ptr->node_list);
 		if (size_a < 0)
 			return -1;
 		else if (size_a > 0)
@@ -810,8 +866,8 @@ static List _create_resv_info_list(reserve_info_msg_t *resv_info_ptr)
 		if (last_list_itr) {
 			while ((sview_resv_info_ptr =
 				list_next(last_list_itr))) {
-				if (!strcmp(sview_resv_info_ptr->resv_name,
-					    resv_ptr->name)) {
+				if (!xstrcmp(sview_resv_info_ptr->resv_name,
+					     resv_ptr->name)) {
 					list_remove(last_list_itr);
 					_resv_info_free(sview_resv_info_ptr);
 					break;
@@ -872,7 +928,7 @@ need_refresh:
 	itr = list_iterator_create(info_list);
 	while ((sview_resv_info = (sview_resv_info_t*) list_next(itr))) {
 		resv_ptr = sview_resv_info->resv_ptr;
-		if (!strcmp(resv_ptr->name, name)) {
+		if (!xstrcmp(resv_ptr->name, name)) {
 			j=0;
 			while (resv_ptr->node_inx[j] >= 0) {
 				change_grid_color(
@@ -1064,7 +1120,7 @@ extern void admin_edit_resv(GtkCellRendererText *cell,
 	int column = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
 						       "column"));
 
-	if (!new_text || !strcmp(new_text, ""))
+	if (!new_text || !xstrcmp(new_text, ""))
 		goto no_input;
 
 	gtk_tree_model_get_iter(GTK_TREE_MODEL(treestore), &iter, path);
@@ -1089,7 +1145,7 @@ extern void admin_edit_resv(GtkCellRendererText *cell,
 		goto no_input;
 	}
 
-	if (old_text && !strcmp(old_text, new_text)) {
+	if (old_text && !xstrcmp(old_text, new_text)) {
 		temp = g_strdup_printf("No change in value.");
 	} else if (slurm_update_reservation(resv_msg)
 		   == SLURM_SUCCESS) {
@@ -1368,8 +1424,7 @@ display_it:
 			hostset_destroy(hostset);
 			break;
 		case JOB_PAGE:
-			if (strcmp(resv_ptr->name,
-				   search_info->gchar_data))
+			if (xstrcmp(resv_ptr->name, search_info->gchar_data))
 				continue;
 			break;
 		case RESV_PAGE:
@@ -1378,8 +1433,8 @@ display_it:
 				if (!search_info->gchar_data)
 					continue;
 
-				if (strcmp(resv_ptr->name,
-					   search_info->gchar_data))
+				if (xstrcmp(resv_ptr->name,
+					    search_info->gchar_data))
 					continue;
 				break;
 			default:
@@ -1497,7 +1552,7 @@ extern void popup_all_resv(GtkTreeModel *model, GtkTreeIter *iter, int id)
 	itr = list_iterator_create(popup_list);
 	while ((popup_win = list_next(itr))) {
 		if (popup_win->spec_info)
-			if (!strcmp(popup_win->spec_info->title, title)) {
+			if (!xstrcmp(popup_win->spec_info->title, title)) {
 				break;
 			}
 	}
@@ -1604,7 +1659,7 @@ static void _admin_resv(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 
 	resv_msg->name = xstrdup(resvid);
 
-	if (!strcasecmp("Remove Reservation", type)) {
+	if (!xstrcasecmp("Remove Reservation", type)) {
 		resv_name_msg.name = resvid;
 
 		label = gtk_dialog_add_button(GTK_DIALOG(popup),
@@ -1663,7 +1718,13 @@ static void _admin_resv(GtkTreeModel *model, GtkTreeIter *iter, char *type)
 			if (got_edit_signal)
 				goto end_it;
 
-			if (!global_send_update_msg) {
+			if (global_edit_error) {
+				temp = g_strdup_printf(
+					"Something was wrong with the "
+					"values you wanted to change: %s",
+					global_edit_error_msg ?
+					global_edit_error_msg : "unknown");
+			} else if (!global_send_update_msg) {
 				temp = g_strdup_printf("No change detected.");
 			} else if (slurm_update_reservation(resv_msg)
 				   == SLURM_SUCCESS) {
diff --git a/src/sview/sview.c b/src/sview/sview.c
index 0eea4a0c9..210b4bb90 100644
--- a/src/sview/sview.c
+++ b/src/sview/sview.c
@@ -1114,7 +1114,7 @@ extern void _change_cluster_main(GtkComboBox *combo, gpointer extra)
 	   going back to the same cluster we were just at.
 	*/
 	/* if (working_cluster_rec) { */
-	/*	if (!strcmp(cluster_rec->name, working_cluster_rec->name)) */
+	/*	if (!xstrcmp(cluster_rec->name, working_cluster_rec->name)) */
 	/*		return; */
 	/* } */
 
@@ -1153,7 +1153,7 @@ extern void _change_cluster_main(GtkComboBox *combo, gpointer extra)
 
 	if (!orig_cluster_name)
 		orig_cluster_name = slurm_get_cluster_name();
-	if (!strcmp(cluster_rec->name, orig_cluster_name))
+	if (!xstrcmp(cluster_rec->name, orig_cluster_name))
 		working_cluster_rec = NULL;
 	else
 		working_cluster_rec = cluster_rec;
@@ -1344,7 +1344,7 @@ static GtkWidget *_create_cluster_combo(void)
 					   1, cluster_rec,
 					   -1);
 		}
-		if (!strcmp(cluster_rec->name, orig_cluster_name)) {
+		if (!xstrcmp(cluster_rec->name, orig_cluster_name)) {
 			/* clear it since we found the current cluster */
 			working_cluster_rec = NULL;
 			spot = count;
diff --git a/src/sview/sview.h b/src/sview/sview.h
index 8dab73eae..c491e7242 100644
--- a/src/sview/sview.h
+++ b/src/sview/sview.h
@@ -510,8 +510,10 @@ extern void refresh_node(GtkAction *action, gpointer user_data);
 /* don't destroy the list from this function */
 extern List create_node_info_list(node_info_msg_t *node_info_ptr,
 				  bool by_partition);
-extern int update_features_node(GtkDialog *dialog, const char *nodelist,
-				const char *old_features);
+extern int update_active_features_node(GtkDialog *dialog, const char *nodelist,
+				      const char *old_features);
+extern int update_avail_features_node(GtkDialog *dialog, const char *nodelist,
+				      const char *old_features);
 extern int update_state_node(GtkDialog *dialog,
 			     const char *nodelist, const char *type);
 extern GtkListStore *create_model_node(int type);
diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
index c29759dcc..ef1fe8250 100644
--- a/testsuite/Makefile.in
+++ b/testsuite/Makefile.in
@@ -91,7 +91,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = testsuite
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -104,7 +105,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -117,6 +117,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -124,6 +125,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -132,7 +134,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -233,8 +234,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -334,6 +333,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -372,6 +375,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -415,6 +421,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -465,6 +474,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am
index 6afd8ab76..49a20a0a4 100644
--- a/testsuite/expect/Makefile.am
+++ b/testsuite/expect/Makefile.am
@@ -15,6 +15,7 @@ EXTRA_DIST = \
 	README				\
 	regression			\
 	regression.py			\
+	slurm_status			\
 	test1.1				\
 	test1.2				\
 	test1.3				\
@@ -126,6 +127,17 @@ EXTRA_DIST = \
 	test1.99			\
 	test1.100			\
 	test1.101			\
+	test1.102			\
+	test1.103			\
+	test1.104			\
+	test1.105			\
+	test1.106			\
+	test1.107			\
+	test1.108			\
+	test1.109			\
+	test1.110			\
+	test1.111			\
+	test1.112			\
 	test2.1				\
 	test2.2				\
 	test2.3				\
@@ -175,6 +187,7 @@ EXTRA_DIST = \
 	test3.13			\
 	test3.14			\
 	test3.15			\
+	test3.16			\
 	test4.1				\
 	test4.2				\
 	test4.3				\
@@ -370,6 +383,15 @@ EXTRA_DIST = \
 	test15.25			\
 	test15.26			\
 	test15.27			\
+	test15.30			\
+	test15.31			\
+	test15.32			\
+	test15.33			\
+	test15.34			\
+	test15.35			\
+	test15.36			\
+	test15.37			\
+	test15.38			\
 	test16.1			\
 	test16.2			\
 	test16.3			\
@@ -409,13 +431,28 @@ EXTRA_DIST = \
 	test17.32			\
 	test17.33			\
 	test17.34			\
+	test17.35			\
 	test17.36			\
 	test17.37			\
 	test17.38			\
 	test17.39			\
 	test17.40			\
 	test17.41			\
+	test17.42			\
 	test17.43			\
+	test17.44			\
+	test17.51			\
+	test17.52			\
+	test17.53			\
+	test17.54			\
+	test17.55			\
+	test17.56			\
+	test17.57			\
+	test17.58			\
+	test17.59			\
+	test17.60			\
+	test17.61			\
+	test17.62			\
 	test19.1			\
 	test19.2			\
 	test19.3			\
@@ -437,6 +474,7 @@ EXTRA_DIST = \
 	test20.10			\
 	test20.11			\
 	test20.12			\
+	test20.13			\
 	test21.1			\
 	test21.2			\
 	test21.3			\
@@ -470,8 +508,10 @@ EXTRA_DIST = \
 	test21.30                       \
 	test21.31			\
 	test21.32			\
+	test21.33			\
 	test21.34			\
 	test21.35			\
+	test21.36			\
 	inc21.30.1                      \
 	inc21.30.2                      \
 	inc21.30.3                      \
@@ -560,7 +600,11 @@ EXTRA_DIST = \
 	test34.1			\
 	test34.2			\
 	test35.1			\
-	test35.2
+	test35.2			\
+	test36.1			\
+	test36.2			\
+	test36.3			\
+	test36.4
 
 distclean-local:
 	rm -rf *error *output
diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in
index 27c4c20d5..623b1a6e3 100644
--- a/testsuite/expect/Makefile.in
+++ b/testsuite/expect/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = testsuite/expect
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -166,8 +167,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -267,6 +266,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -305,6 +308,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -348,6 +354,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -398,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -425,6 +435,7 @@ EXTRA_DIST = \
 	README				\
 	regression			\
 	regression.py			\
+	slurm_status			\
 	test1.1				\
 	test1.2				\
 	test1.3				\
@@ -536,6 +547,17 @@ EXTRA_DIST = \
 	test1.99			\
 	test1.100			\
 	test1.101			\
+	test1.102			\
+	test1.103			\
+	test1.104			\
+	test1.105			\
+	test1.106			\
+	test1.107			\
+	test1.108			\
+	test1.109			\
+	test1.110			\
+	test1.111			\
+	test1.112			\
 	test2.1				\
 	test2.2				\
 	test2.3				\
@@ -585,6 +607,7 @@ EXTRA_DIST = \
 	test3.13			\
 	test3.14			\
 	test3.15			\
+	test3.16			\
 	test4.1				\
 	test4.2				\
 	test4.3				\
@@ -780,6 +803,15 @@ EXTRA_DIST = \
 	test15.25			\
 	test15.26			\
 	test15.27			\
+	test15.30			\
+	test15.31			\
+	test15.32			\
+	test15.33			\
+	test15.34			\
+	test15.35			\
+	test15.36			\
+	test15.37			\
+	test15.38			\
 	test16.1			\
 	test16.2			\
 	test16.3			\
@@ -819,13 +851,28 @@ EXTRA_DIST = \
 	test17.32			\
 	test17.33			\
 	test17.34			\
+	test17.35			\
 	test17.36			\
 	test17.37			\
 	test17.38			\
 	test17.39			\
 	test17.40			\
 	test17.41			\
+	test17.42			\
 	test17.43			\
+	test17.44			\
+	test17.51			\
+	test17.52			\
+	test17.53			\
+	test17.54			\
+	test17.55			\
+	test17.56			\
+	test17.57			\
+	test17.58			\
+	test17.59			\
+	test17.60			\
+	test17.61			\
+	test17.62			\
 	test19.1			\
 	test19.2			\
 	test19.3			\
@@ -847,6 +894,7 @@ EXTRA_DIST = \
 	test20.10			\
 	test20.11			\
 	test20.12			\
+	test20.13			\
 	test21.1			\
 	test21.2			\
 	test21.3			\
@@ -880,8 +928,10 @@ EXTRA_DIST = \
 	test21.30                       \
 	test21.31			\
 	test21.32			\
+	test21.33			\
 	test21.34			\
 	test21.35			\
+	test21.36			\
 	inc21.30.1                      \
 	inc21.30.2                      \
 	inc21.30.3                      \
@@ -970,7 +1020,11 @@ EXTRA_DIST = \
 	test34.1			\
 	test34.2			\
 	test35.1			\
-	test35.2
+	test35.2			\
+	test36.1			\
+	test36.2			\
+	test36.3			\
+	test36.4
 
 all: all-am
 
diff --git a/testsuite/expect/README b/testsuite/expect/README
index ce1986aa8..e22cb4b68 100644
--- a/testsuite/expect/README
+++ b/testsuite/expect/README
@@ -111,7 +111,7 @@ test1.16   Confirm that srun buffering can be disabled (--unbuffered option).
 test1.17   Test of srun --open-mode (truncate or append) option.
 test1.18   Test of --licenses option
 test1.19   Test srun stdout/err file name formatting (--output and --error
-	   options with %j, %J, %n, %s and %t specifications).
+	   options with %%, %j, %J, %n, %s and %t specifications).
 test1.20   Test srun stdout/err disabling (--output and --error options with
 	   argument of "none").
 test1.21   Test srun stdin/out routing with specific task number (--input
@@ -180,10 +180,6 @@ test1.75   Test that --cpu-freq is enforced when using non-numeric values
 test1.76   Test that --cpu-freq sets min-max:gov
 test1.77   Test that job name specified at the command line overwrites
            the environment variable SLURM_JOB_NAME
-
-**NOTE**   The following tests attempt to utilize multiple CPUs or partitions,
-	   The test will print "WARNING" and terminate with an exit code of
-	   zero if the cluster configuration does not permit proper testing.
 test1.80   Confirm that a job executes with the proper task distribution
 	   (--nodes and --distribution options).
 test1.81   Confirm that a job executes with the proper node count
@@ -213,7 +209,17 @@ test1.98   AVAILBLE...
 test1.99   Validate that SrunPortRange is enforced when using srun
 test1.100  Test of pack/nopack task distribution.
 test1.101  Test of --bcast option.
-**NOTE**   The above tests for multiple processor/partition systems only
+test1.102  Test of --deadline option too late
+test1.103  Test of --deadline option too short
+test1.104  Test of --deadline option and time limit partition
+test1.105  Test of --deadline option and no time
+test1.106  Test of --deadline option and --time_min too long
+test1.107  Test of --deadline option and --time_min and time too long
+test1.108  Test of --deadline option and --begin option too late
+test1.109  Test of --deadline and --begin option and --time_min too long
+test1.110  Test of --deadline and --begin option and --time_min OK
+test1.111  Test of --deadline and --begin option and time to be changed
+test1.112  Test of --deadline and --begin option and time not changed
 
 test2.#    Testing of scontrol options (to be run as unprivileged user).
 ========================================================================
@@ -262,6 +268,7 @@ test3.12   Validate scontrol update command for front end nodes.
 test3.13   Validate scontrol update command for jobs by JobName and UserID.
 test3.14   Test of advanced reservation "replace" option.
 test3.15   Test of advanced reservation of licenses.
+test3.16   Test that licenses are sorted.
 UNTESTED   "scontrol abort"    would stop slurm
 UNTESTED   "scontrol shutdown" would stop slurm
 
@@ -505,6 +512,15 @@ test15.24  Test of --overcommit option.
 test15.25  Test of job account(--account option).
 test15.26  Test interruption of salloc while waiting for resource allocation.
 test15.27  Test salloc --exclusive allocates all cpus on node.
+test15.30  Test of --deadline option too late
+test15.31  Test of --deadline option too short
+test15.32  Test of --deadline option and time limit partition
+test15.33  Test of --deadline option and no time
+test15.34  Test of --deadline option and time_min too long
+test15.35  Test of --deadline option and time_min and time too long
+test15.36  Test of --deadline option and --begin option too late
+test15.37  Test of --deadline and --begin option and --time_min too long
+test15.38  Test of --deadline and --begin option and --time_min OK
 
 test16.#   Testing of sattach options.
 ======================================
@@ -537,15 +553,14 @@ test17.10  Test of processors, memory, and temporary disk space
 	   constraints options (--mincpus, --mem, and --tmp options).
 	   Also test that priority zero job is not started (--hold
 	   option).
-test17.11  Test of shared and contiguous options (--share and --contiguous).
-	   Also uses --hold option.
+test17.11  Test of oversubscribe and contiguous options, also uses --hold option.
 test17.12  Verify node configuration specification (--constraint option)
 test17.13  Verify the appropriate job environment variables are set
 test17.14  Verify that user environment variables are propagated to the job
 test17.15  Verify that user user limits are propagated to the job
 test17.16  Verify that command line arguments get forwarded to job script
-test17.17  Confirm that node sharing flags are respected  (--nodelist and
-	   --share options)
+test17.17  Confirm that oversubscribe flags are respected  (--nodelist and
+	   --oversubscribe options)
 test17.18  Test of job dependencies and deferred begin time (--dependency
 	   and --begin options).
 test17.19  Test of job submit to multiple partitions (--partition).
@@ -567,13 +582,28 @@ test17.32  Test of --overcommit option.
 test17.33  Test of --open-mode option.
 test17.34  Test of --core-spec option.
 test17.35  Test performance/timing of job submissions.
-test17.36  Test that the shared option in partitions is enforced.
+test17.36  Test that the OverSubscribe option in partitions is enforced.
 test17.37  Validate that afternotok dependency is enforced.
 test17.38  Test for sbatch --signal.
 test17.39  Validate dependecy OR option.
 test17.40  Test of --thread-spec option.
 test17.41  Validate that sbatch, srun, salloc return partition error message.
+test17.42  Test of sbatch --wait option.
 test17.43  Test sbatch handling of very long lines in script
+test17.44  Validate that aftercorr dependency is enforced.
+test17.51  Validate that the mcs plugin (mcs/user) is OK with sbatch
+test17.52  Validate that the mcs plugin (mcs/group) is OK with sbatch
+test17.53  Test of --deadline option too late
+test17.54  Test of --deadline option too short
+test17.55  Test of --deadline option and time limit partition
+test17.56  Test of --deadline option and no time
+test17.57  Test of --deadline option and time_min too long
+test17.58  Test of --deadline option and time_min and time too long
+test17.59  Test of --deadline option and --begin option too late
+test17.60  Test of --deadline and --begin option and --time_min too long
+test17.61  Test of --deadline and --begin option and --time_min OK
+test17.62  Test for #BSUB batch script entry
+
 
 test19.#   Testing of strigger options.
 =======================================
@@ -602,7 +632,7 @@ test20.9   Test for the qalter --man option
 test20.10  Test for the qrerun --help option
 test20.11  Test for the qrerun --man option
 test20.12  Test for qsub -V/-v arguments and their interaction with sbatch scripts
-
+test20.13  Test to test Grid Engine specific options
 
 test21.#   Testing of sacctmgr commands and options.
 ====================================================
@@ -626,8 +656,7 @@ test21.17  sacctmgr modify user
 test21.18  sacctmgr modify multiple users
 test21.19  sacctmgr add and delete coordinator
 test21.20  sacctmgr add and modify QoS
-test21.21  sacctmgr add an account to this cluster and try using it with
-	   salloc, sbatch and srun.
+test21.21  sacctmgr add an account to cluster; use with salloc, sbatch and srun
 test21.22  sacctmgr load file
 test21.23  sacctmgr wckey
 test21.24  sacctmgr dump file
@@ -639,8 +668,10 @@ test21.29  sacctmgr clear (modify) QoS values
 test21.30  sacctmgr test if the QoS values are enforced
 test21.31  sacctmgr modify Resource values
 test21.32  Validate that mod qos =,+=,-= change the preempt value
+test21.33  Validate that a resource can be added to a cluster after creation
 test21.34  Validate that partition and job qos limits are enforced
 test21.35  Validate DenyOnLimit QoS flag is enforced on QoS and Associations.
+test21.36  Validate that sacctmgr lost jobs fixes lost jobs.
 
 
 test22.#   Testing of sreport commands and options.
@@ -716,7 +747,7 @@ test29.8   Validate that the MaxSpareNodeCount is enforced
 
 test30.#   Test of RPM builds.
 ==============================
-test30.1   Validates that rpms are built with the correct prefix.
+test30.1   Validates that RPMs are built with the correct prefix.
 
 
 test31.#   Test of Slurm Epilog and Prolog.
@@ -753,3 +784,10 @@ test35.*   Burst buffer tests
 =============================
 test35.1   Cray persistent burst buffer creation
 test35.2   Cray job-specific burst buffer use
+
+test36.#   Testing of openlava/LSF wrappers and Perl APIs.
+==========================================================
+test36.1   lsid wrapper test
+test36.2   bjobs wrapper test
+test36.3   bkill wrapper test
+test36.4   bsub wrapper test
diff --git a/testsuite/expect/globals b/testsuite/expect/globals
index fbabd0ba2..dc118039d 100755
--- a/testsuite/expect/globals
+++ b/testsuite/expect/globals
@@ -112,6 +112,11 @@ cset qsub        "${slurm_dir}/bin/qsub"
 cset qalter      "${slurm_dir}/bin/qalter"
 cset qrerun      "${slurm_dir}/bin/qrerun"
 
+cset lsid      	 "${slurm_dir}/bin/lsid"
+cset bjobs     	 "${slurm_dir}/bin/bjobs"
+cset bkill     	 "${slurm_dir}/bin/bkill"
+cset bsub     	 "${slurm_dir}/bin/bsub"
+
 # If length of string partition is zero, use output of function
 #	default_partition, otherwise use the partition explicitly
 #	named in your globals.local file (or below) for poe commands
@@ -232,6 +237,7 @@ set number_with_suffix   "\[0-9\]+\[KM\]*"
 set slash                "/"
 set whitespace		 "\[ \t\n\r\f\v\]+"
 set alpha_numeric_nodelist "$alpha_numeric_under\\\[?\[$alpha_numeric_comma\]?\\\]?"
+set controlmachine_regex "\[a-zA-Z0-9,\-\.\]+"
 #
 # Cache SlurmUser to check for SuperUser requests
 #
@@ -598,6 +604,7 @@ proc wait_for_job { job_id desired_state } {
 		switch $state {
 			"NOT_FOUND" -
 			"CANCELLED" -
+			"DEADLINE" -
 			"FAILED" -
 			"TIMEOUT" -
 			"NODE_FAIL" -
@@ -883,6 +890,35 @@ proc test_limits_enforced { } {
 	return $enforced
 }
 
+################################################################
+#
+# Proc: test_enforce_part_limits
+#
+# Purpose: Return value of EnforcePartLimits
+#
+# Returns EnforcePartLimits value (ALL, ANY, or NO)
+#
+################################################################
+proc test_enforce_part_limits { } {
+	global alpha scontrol
+
+	log_user 0
+	set enforced "UNKNOWN"
+	spawn $scontrol show config
+	expect {
+		-re "EnforcePartLimits *= ($alpha)" {
+			set enforced $expect_out(1,string)
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+	return $enforced
+}
+
 ################################################################
 #
 # Proc: test_gang
@@ -1850,6 +1886,36 @@ proc test_launch_type { } {
 	return $type
 }
 
+################################################################
+#
+# Proc: test_node_features_plugin
+#
+# Purpose: Determine NodeFeaturesPlugin type.
+#
+# Returns the NodeFeaturesPlugin type
+#
+################################################################
+
+proc test_node_features_plugin { } {
+	global scontrol bin_bash bin_grep alpha_numeric_under
+
+	log_user 0
+	set type ""
+	spawn -noecho $bin_bash -c "exec $scontrol show config | $bin_grep NodeFeaturesPlugins"
+	expect {
+		-re "node_features/($alpha_numeric_under)" {
+			set type $expect_out(1,string)
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+
+	return $type
+}
+
 ################################################################
 #
 # Proc: test_emulated
@@ -2206,12 +2272,12 @@ proc available_nodes { partition state } {
 
 ################################################################
 #
-# Proc: partition_shared
+# Proc: partition_oversubscribe
 #
-# Purpose: Determine the shared configuration of the specified
+# Purpose: Determine the oversubscribe configuration of the specified
 #          partition
 #
-# Returns: Return the shared configuration of the specified
+# Returns: Return the oversubscribe configuration of the specified
 #          partition
 #
 #
@@ -2219,16 +2285,16 @@ proc available_nodes { partition state } {
 #
 ################################################################
 
-proc partition_shared { partition } {
+proc partition_oversubscribe { partition } {
 	global sinfo
 
-	set shared "No"
+	set oversubscribe "NO"
 	send_user "$sinfo --noheader --partition $partition --format %h\n"
 	set fd [open "|$sinfo --noheader --partition $partition --format %h"]
 	gets $fd line
 	catch {close $fd}
-	regexp {[a-zA-Z]+} $line shared
-	return $shared
+	regexp {[a-zA-Z]+} $line oversubscribe
+	return $oversubscribe
 }
 
 ################################################################
@@ -2274,8 +2340,8 @@ proc default_partition {} {
 
 proc default_part_exclusive {} {
 	set def_part [default_partition]
-	set shared [partition_shared $def_part]
-	if {[string compare $shared "EXCLUSIVE"] == 0} {
+	set oversubscribe [partition_oversubscribe $def_part]
+	if {[string compare $oversubscribe "EXCLUSIVE"] == 0} {
 		return 1
 	} else {
 		return 0
@@ -2348,13 +2414,19 @@ proc make_bash_script { script_name script_contents } {
 #
 # Purpose: Given a hostname, return it's numeric suffix
 #
-# Returns: numerical suffix for input 'hostname'
+# Returns: numerical suffix for input 'hostname' or -1 if not a number
 #
 # Input: hostname -- hostname for which to return suffix
 #
 ################################################################
 proc get_suffix { hostname } {
 	set host_len [string length $hostname]
+	set host_inx [expr $host_len-1]
+	set host_char [string index $hostname $host_inx]
+	if {[string compare $host_char "0"] < 0 || [string compare $host_char "9"] > 0} {
+		return -1
+	}
+
 	for {set host_inx [expr $host_len-1]} {$host_inx >= 0} {incr host_inx -1} {
 		set host_char [string index $hostname $host_inx]
 		if {[string compare $host_char "0"] < 0} { break }
@@ -2665,6 +2737,42 @@ proc get_cluster_name { } {
 	return $cluster_name
 }
 
+################################################################
+#
+# Proc: get_control_machine
+#
+# Purpose: get ControlMachine parameter
+#
+# Returns: ControlMachine value
+#
+################################################################
+proc get_control_machine { } {
+	global scontrol controlmachine_regex exit_code
+	#
+	# Use scontrol to find the ControlMachine
+	#
+	log_user 0
+	set control_machine ""
+	set scon_pid [spawn -noecho $scontrol show config]
+	expect {
+		-re "ControlMachine *= ($controlmachine_regex)" {
+			set control_machine $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			slow_kill $scon_pid
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+	return $control_machine
+}
+
 ################################################################
 #
 # Proc: get_bluegene_layout
@@ -3538,6 +3646,7 @@ proc available_nodes_hostnames { partition } {
 
 	log_user 0
 	set idle_nodelist ""
+	set sep ""
 	if {[string compare $partition ""] == 0} {
 		spawn $sinfo -tidle -h -o%N
 	} else {
@@ -3545,7 +3654,9 @@ proc available_nodes_hostnames { partition } {
 	}
 	expect {
 		-re "($alpha_numeric_nodelist)" {
-			set idle_nodelist $expect_out(1,string)
+			append idle_nodelist $sep
+			append idle_nodelist $expect_out(1,string)
+			set sep ","
 			exp_continue
 		}
 		timeout {
@@ -3605,3 +3716,225 @@ proc get_curr_line_num {frame_info} {
 	# returned by 'info frame'
 	set result [dict get [info frame $frame_info] line]
 }
+
+#####################################################################
+#
+# Proc: get_partition_nodes
+#
+# Purpose: Get the list of node names in a given partition/states
+#
+# Input:	partition - partition to get nodes off
+#		states - states to filter on nodes
+#
+# Returns: node names list, -1 on sinfo error
+#
+#####################################################################
+
+proc get_partition_nodes {partition states} {
+
+	global sinfo alpha_numeric_under
+	log_user 0
+	set node_list ""
+
+	if {[string length $partition] == 0} {
+		set partition [default_partition]
+	}
+
+	if {[string length $states] == 0} {
+		set sinfo_pid [spawn -noecho $sinfo -h -N -p $partition -o %N -e]
+	} else {
+		set sinfo_pid [spawn -noecho $sinfo -h -N -p $partition -o %N -t $states -e]
+	}
+
+	expect {
+		-re "($alpha_numeric_under)" {
+			lappend node_list $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sinfo not responding\n"
+			slow_kill $sinfo_pid
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+	return $node_list
+}
+
+#####################################################################
+#
+# Proc: get_partition_default_time_limit
+#
+# Purpose: Get the default time limit in a given partition
+#
+# Input:   partition - partition to default time limit of
+#
+# Returns: time limit in seconds, -1 if undefined or error
+#
+#####################################################################
+
+proc get_partition_default_time_limit {partition} {
+
+	global sinfo number
+
+	if {[string length $partition] == 0} {
+		set partition [default_partition]
+	}
+
+	set secs 0
+	log_user 0
+	set sinfo_pid [spawn -noecho $sinfo -h -p $partition -O defaulttime -e]
+	expect {
+		-re "n/a" {
+			set secs -1
+			exp_continue
+		}
+		-re "($number)-($number):($number):($number)" {
+			set days  [expr $expect_out(1,string) * 24 * 60 * 60]
+			set hours [expr $expect_out(2,string) * 60 * 60]
+			set mins  [expr $expect_out(3,string) * 60]
+			set secs  [expr $days + $hours + $mins + $expect_out(4,string)]
+			exp_continue
+		}
+		-re "($number):($number):($number)" {
+			set hours [expr $expect_out(1,string) * 60 * 60]
+			set mins  [expr $expect_out(2,string) * 60]
+			set secs  [expr $hours + $mins + $expect_out(3,string)]
+			exp_continue
+		}
+		-re "($number):($number)" {
+			set mins  [expr $expect_out(1,string) * 60]
+			set secs  [expr $mins + $expect_out(2,string)]
+			exp_continue
+		}
+		-re "($number)" {
+			set secs  [expr $expect_out(1,string) * 60]
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sinfo not responding\n"
+			slow_kill $sinfo_pid
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+	return $secs
+}
+
+#####################################################################
+#
+# Proc: get_node_cores
+#
+# Purpose:	Given a node, return its total number of cores
+#		(not the CoresPerSocket, but the total cores)
+#
+# Input: node - node to get cores from
+#
+# Returns: node cores if retrieved, -1 otherwise
+#
+#####################################################################
+
+proc get_node_cores {node} {
+
+	global sinfo number
+	set cores -1
+	set sockets_per_node 0
+	set cores_per_socket 0
+
+	if {[string length $node] == 0} {
+		return $cores
+	}
+
+	log_user 0
+	set sinfo_pid [spawn -noecho $sinfo -o "%X %Y" -h -n $node]
+
+	expect {
+		-re "($number)" {
+			if {$sockets_per_node == 0} {
+				set sockets_per_node $expect_out(1,string)
+			} else {
+				set cores_per_socket $expect_out(1,string)
+			}
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sinfo not responding\n"
+			slow_kill $sinfo_pid
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+
+	set cores [expr $sockets_per_node * $cores_per_socket]
+
+	return $cores
+}
+
+#####################################################################
+#
+# Proc: get_part_total_cores
+#
+# Purpose: Given a partition and/or states, return its total cores
+#
+# Input part - partition to check cores
+#	states - states to filter on partition cores
+#
+# Returns: partition cores
+#
+#####################################################################
+
+proc get_part_total_cores {part states} {
+	global sinfo number
+	log_user 0
+	set cores 0
+	set tmp 0
+	set i 0
+
+	if {[string length $part] == 0} {
+		set part [default_partition]
+	}
+
+	if {[string length $states] == 0} {
+		set sinfo_pid [spawn -noecho $sinfo -h -N -p $part -o "%X %Y"]
+	} else {
+		set sinfo_pid [spawn -noecho $sinfo -h -N -p $part -t $states -o "%X %Y"]
+	}
+
+	expect {
+		-re "($number)" {
+			set is_even [expr {($i % 2) == 0}]
+			if {$is_even == 1} {
+				set tmp $expect_out(1,string)
+			} else {
+				set tmp [expr $tmp * $expect_out(1,string)]
+				set cores [expr $cores + $tmp]
+			}
+			incr i
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sinfo not responding\n"
+			slow_kill $sinfo_pid
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	log_user 1
+	return $cores
+}
+
diff --git a/testsuite/expect/globals_accounting b/testsuite/expect/globals_accounting
index fd570f959..960a903a8 100644
--- a/testsuite/expect/globals_accounting
+++ b/testsuite/expect/globals_accounting
@@ -101,8 +101,7 @@ proc add_cluster { name clus_req_in } {
 	}
 
 	if {$matches != 1} {
-		send_user "\nFAILURE:  sacctmgr had a problem adding clusters
-	got $matches\n"
+		send_user "\nFAILURE:  sacctmgr had a problem adding clusters got $matches\n"
 		incr exit_code 1
 	}
 
@@ -1741,7 +1740,7 @@ proc check_resource_limits { name res_limits } {
 	set match 0
 	spawn $sacctmgr -p -n list resource $name $command
 	expect {
-		-re "$values" {
+		-nocase -re "$values" {
 			set match 1
 			exp_continue
 		}
diff --git a/testsuite/expect/inc21.21_tests b/testsuite/expect/inc21.21_tests
index 26465408d..39dd209a7 100644
--- a/testsuite/expect/inc21.21_tests
+++ b/testsuite/expect/inc21.21_tests
@@ -44,9 +44,15 @@ proc inc21_21_good { test_type limit } {
 	# Wait for old jobs to clean up
 	sleep 2
 
-	send_user "\n====== Test $test_type"
+	send_user "\n====== Test $test_type "
 	send_user "(Within: inc21.21_tests function: inc21_21_good) ======\n"
 
+	if { [string compare $test_type "maxcpus"] == 0 ||
+	     [string compare $test_type "maxcpumins"] == 0 &&
+             [default_part_exclusive] != 0} {
+		send_user "\nWARNING: Unable to perform test with exclusive node allocations\n"
+		return $exit_code
+	}	
 	if { [string compare $test_type "maxnode"] == 0 } {
 		set add "--exclusive"
 	} else {
@@ -54,7 +60,7 @@ proc inc21_21_good { test_type limit } {
 	}
 
 	set matches 0
-	spawn $srun -v $add -t1 [lindex $limit 0][lindex $limit 1] \
+	spawn $srun -v -t10 $add [lindex $limit 0][lindex $limit 1] \
 	    --account=$ta -I $bin_id
 	expect {
 		-re "launching ($number)" {
@@ -160,7 +166,12 @@ proc inc21_21_grp_test { test_type limit } {
 		return $exit_code
 	}
 
-	# Check and see if it is a cpu test
+	if { [default_part_exclusive] != 0} {
+		send_user "\nWARNING: This test can't be run Exclusive node allocations\n"
+		return $exit_code
+	}
+
+	# Check and see if it is a CPU test
 	if { [string compare $test_type "grpcpus"] == 0 ||
 	     [string compare $test_type "grpcpumins"] == 0 ||
 	     [string compare $test_type "grpcpurunmins"] == 0 } {
@@ -274,6 +285,12 @@ proc inc21_21_submit_test { limit } {
 	set limit_job ""
 	set limit_sub ""
 
+	if { [string compare $limit "grpjobsub"] == 0 &&
+	     [default_part_exclusive] != 0} {
+		send_user "\nWARNING: Unable to perform test with exclusive node allocations\n"
+		return $exit_code
+	}       
+
 	if { ![string compare $limit "maxjobsub"] } {
 		set limit_job "maxjob"
 		set limit_sub "maxsubmit"
@@ -363,7 +380,7 @@ proc inc21_21_submit_test { limit } {
 		       --error=/dev/null -t5 $file_in]
 	expect {
 		-re "Job violates accounting/QOS policy" {
-			send_user "\nThis error is expected, not a problem"
+			send_user "\nThis error is expected, not a problem "
 			print_err $limit "inc21_21_submit_test"
 			exp_continue
 		}
@@ -430,7 +447,11 @@ proc inc21_21_submit_test { limit } {
 		}
 	}
 
-	if { $matches != 4 } {
+	if { [string compare $limit "maxjobsub"] == 0 &&
+             $matches > 0 && $matches < 4 &&
+	     [default_part_exclusive] != 0} {
+		send_user "\nWARNING: Only started $matches of 4 possible jobs\n"
+	} elseif { $matches != 4 } {
 		send_user "\nFAILURE: jobs are not in the expected state "
 		send_user "expected ($matches != 4)"
 		print_err $limit "inc21_21_submit_test"
@@ -503,12 +524,12 @@ proc inc21_21_submit_test { limit } {
 		       --error=/dev/null -t5 $file_in]
 	expect {
 		-re "Job violates accounting/QOS policy" {
-			send_user "\n\[Job array test\] This error is expected, not a problem"
+			send_user "\n\[Job array test\] This error is expected, not a problem "
 			print_err $limit "inc21_21_submit_test"
 			exp_continue
 		}
 		-re "Submitted batch job ($number)" {
-			send_user "\nFAILURE:\[Job array test\] this job should not have ran."
+			send_user "\nFAILURE:\[Job array test\] this job should not have ran. "
 			print_err $limit "inc21_21_submit_test"
 			set exit_code 1
 			exp_continue
@@ -570,7 +591,11 @@ proc inc21_21_submit_test { limit } {
 		}
 	}
 
-	if { $matches != 4 } {
+	if { [string compare $limit "maxjobsub"] == 0 &&
+             $matches > 0 && $matches < 4 &&
+	     [default_part_exclusive] != 0} {
+		send_user "\nWARNING: Only started $matches of 4 possible jobs\n"
+	} elseif { $matches != 4 } {
 		send_user "\nFAILURE: jobs are not in the expected state "
 		send_user "expected ($matches != 4)"
 		print_err $limit "inc21_21_submit_test"
@@ -582,7 +607,6 @@ proc inc21_21_submit_test { limit } {
 	set acct_mod_assoc_test_vals($limit_sub) "-1"
 
 	return $exit_code
-
 }
 
 #
@@ -611,7 +635,7 @@ proc inc21_21_grpwall { test_type limit } {
 
 	set matches 0
 	send_user "Sleeping for a bit...hang tight\n"
-	spawn $srun -v [lindex $limit 0][lindex $limit 1] --account=$ta \
+	spawn $srun -v -t1 [lindex $limit 0][lindex $limit 1] --account=$ta \
 	    -I $file_in
 	expect {
 		-re "launching ($number)" {
@@ -648,7 +672,7 @@ proc inc21_21_grpwall { test_type limit } {
 	}
 
 	set matches 0
-	spawn $srun -v [lindex $limit 0][lindex $limit 1] --account=$ta \
+	spawn $srun -v -t1 [lindex $limit 0][lindex $limit 1] --account=$ta \
 	    -I $bin_id
 	expect {
 		-re "Job violates accounting/QOS policy" {
diff --git a/testsuite/expect/inc21.30.1 b/testsuite/expect/inc21.30.1
index f1090fab2..75668ac98 100644
--- a/testsuite/expect/inc21.30.1
+++ b/testsuite/expect/inc21.30.1
@@ -34,7 +34,7 @@ proc inc21_30_1 {} {
 	send_user "\nStarting GrpNode limit test (Within: inc21.30.1)\n\n"
 	set job_id1  0
 	set job_id2  0
-	spawn $salloc -N$grn_num --account=$acct --exclusive $srun $bin_sleep 10
+	spawn $salloc -N$grn_num --account=$acct --exclusive -t1 $srun $bin_sleep 10
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -63,7 +63,7 @@ proc inc21_30_1 {} {
 		return
 	}
 
-	spawn $salloc -N1 --account=$acct --exclusive $srun $bin_sleep 10
+	spawn $salloc -N1 --account=$acct --exclusive -t1 $srun $bin_sleep 10
 	expect {
 		-re "Pending job allocation ($number)" {
 			set job_id2 $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.2 b/testsuite/expect/inc21.30.2
index 175fa6db2..f1869b1e7 100644
--- a/testsuite/expect/inc21.30.2
+++ b/testsuite/expect/inc21.30.2
@@ -35,7 +35,7 @@ proc inc21_30_2 {} {
 
 	send_user "\nStarting GrpCPUs limit test (Within: inc21.30.2)\n\n"
 	set jobmatch 0
-	spawn $salloc --account=$acct -w$test_node -n$grcpu_num $srun $bin_sleep 5
+	spawn $salloc --account=$acct -w$test_node -t1 -n$grcpu_num $srun $bin_sleep 5
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -60,7 +60,7 @@ proc inc21_30_2 {} {
 		}
 	}
 
-	spawn $salloc --account=$acct -w$test_node -n[expr $grcpu_num + 1] $srun $bin_sleep 5
+	spawn $salloc --account=$acct -w$test_node -t1 -n[expr $grcpu_num + 1] $srun $bin_sleep 5
 	expect {
 		-re "Granted job allocation ($number)" {
 			send_user "\nFAILURE: Job should be pending, but is not. (Within: inc21.30.2)\n"
diff --git a/testsuite/expect/inc21.30.3 b/testsuite/expect/inc21.30.3
index 980514986..b1d63b91a 100644
--- a/testsuite/expect/inc21.30.3
+++ b/testsuite/expect/inc21.30.3
@@ -35,7 +35,7 @@ proc inc21_30_3 {} {
 
 	set jobmatch 0
 	for {set inx 0} {$inx <= $check_num} {incr inx} {
-		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		spawn $salloc --account=$acct -n1 -t1 $srun $bin_sleep 60
 		expect {
 			-re "Granted job allocation ($number)" {
 				set job_id($inx) $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.4 b/testsuite/expect/inc21.30.4
index 4f73999a2..279e101bc 100644
--- a/testsuite/expect/inc21.30.4
+++ b/testsuite/expect/inc21.30.4
@@ -39,7 +39,7 @@ proc inc21_30_4 {} {
 
 	set jobmatch 0
 	for {set inx 0} {$inx <= $check_num} {incr inx} {
-		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		spawn $salloc --account=$acct -t1 -n1 $srun $bin_sleep 60
 		expect {
 			-re "Granted job allocation ($number)" {
 				set job_id($inx) $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.5 b/testsuite/expect/inc21.30.5
index 4259196b3..a494d42e1 100644
--- a/testsuite/expect/inc21.30.5
+++ b/testsuite/expect/inc21.30.5
@@ -34,7 +34,7 @@ proc inc21_30_5 {} {
 	send_user "\nStarting MaxCPUs limit test (Within: inc21.30.5)\n\n"
 	set job_id1 0
 
-	spawn $salloc --account=$acct -w$test_node -n$maxcpu_num $srun $bin_sleep 2
+	spawn $salloc --account=$acct -t1 -w$test_node -n$maxcpu_num $srun $bin_sleep 2
 	expect {
 		-re "Granted job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
@@ -61,7 +61,7 @@ proc inc21_30_5 {} {
 	# Cancels remaining jobs
 	cancel_job $job_id1
 
-	spawn $salloc --account=$acct -w$test_node -n[expr $maxcpu_num + 1] $srun $bin_sleep 2
+	spawn $salloc --account=$acct -t1 -w$test_node -n[expr $maxcpu_num + 1] $srun $bin_sleep 2
 	expect {
 		-re "Pending job allocation ($number)" {
 			set job_id1 $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.7 b/testsuite/expect/inc21.30.7
index 8d74aee27..b3970f09a 100644
--- a/testsuite/expect/inc21.30.7
+++ b/testsuite/expect/inc21.30.7
@@ -35,7 +35,7 @@ proc inc21_30_7 {} {
 
 	set jobmatch 0
 	for {set inx 0} {$inx <= $check_num} {incr inx} {
-		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		spawn $salloc --account=$acct -t1 -n1 $srun $bin_sleep 60
 		expect {
 			-re "Granted job allocation ($number)" {
 				set job_id($inx) $expect_out(1,string)
diff --git a/testsuite/expect/inc21.30.8 b/testsuite/expect/inc21.30.8
index 100b87d31..43856b8fc 100644
--- a/testsuite/expect/inc21.30.8
+++ b/testsuite/expect/inc21.30.8
@@ -39,7 +39,7 @@ proc inc21_30_8 {} {
 
 	set jobmatch 0
 	for {set inx 0} {$inx <= $check_num} {incr inx} {
-		spawn $salloc --account=$acct -n1 $srun $bin_sleep 100
+		spawn $salloc --account=$acct -t1 -n1 $srun $bin_sleep 100
 		expect {
 			-re "Granted job allocation ($number)" {
 				set job_id($inx) $expect_out(1,string)
@@ -85,7 +85,7 @@ proc inc21_30_8 {} {
 
 	set upper_lim [expr $check_num - 1]
 	# Test limit with job array
-	spawn $sbatch --account=$acct -a0-$upper_lim -o/dev/null $file_in
+	spawn $sbatch --account=$acct -t1 -a0-$upper_lim -o/dev/null $file_in
 	expect {
 		-re "Submitted batch job ($number)" {
 			set tmp_job_id $expect_out(1,string)
@@ -106,7 +106,7 @@ proc inc21_30_8 {} {
 
 	# Add one more job, and check for error message
 	set match 0
-	spawn $sbatch --account=$acct -a0-$upper_lim -o/dev/null $file_in
+	spawn $sbatch --account=$acct -t1 -a0-$upper_lim -o/dev/null $file_in
 	expect {
 		-re "Job violates accounting/QOS policy" {
 			set match 1
diff --git a/testsuite/expect/inc21.34_tests b/testsuite/expect/inc21.34_tests
index 4bd8c3e87..fee893097 100644
--- a/testsuite/expect/inc21.34_tests
+++ b/testsuite/expect/inc21.34_tests
@@ -54,7 +54,7 @@ proc part_test { } {
 	global grpcpurunmin_num grpmem_num grpwall_num maxcpumin_num
 	global maxwall_num maxcpuspu_num maxnodespu_num
 	global exit_code part_qos mod_job_qos time_spacing selectparam
-	global nthreads job_qos mod_part_qos
+	global nthreads job_qos mod_part_qos prio_multifactor
 
 	# We will set qostest with the qos that we will test since the some of
 	# the 21.30 inc test require the qostest variable
@@ -207,19 +207,22 @@ proc part_test { } {
 
 	#
 	# Test GroupCPURunMins
+	# Requires priority/multifactor to properly handle decay well
 	#
-	set mod_job_qos(GrpCpuRunMin) 1
-	set mod_part_qos(GrpCpuRunMin) $grpcpurunmin_num
-	mod_qos $part_qos [array get mod_part_qos]
-	mod_qos $job_qos [array get mod_job_qos]
-	sleep $time_spacing
-	inc21_30_10
-	if {$exit_code != 0 } {
-		cleanup
-		exit 1
+	if { $prio_multifactor != 0 } {
+		set mod_job_qos(GrpCpuRunMin) 1
+		set mod_part_qos(GrpCpuRunMin) $grpcpurunmin_num
+		mod_qos $part_qos [array get mod_part_qos]
+		mod_qos $job_qos [array get mod_job_qos]
+		sleep $time_spacing
+		inc21_30_10
+		if {$exit_code != 0 } {
+			cleanup
+			exit 1
+		}
+		set mod_job_qos(GrpCpuRunMin) "-1"
+		set mod_part_qos(GrpCpuRunMin) "-1"
 	}
-	set mod_job_qos(GrpCpuRunMin) "-1"
-	set mod_part_qos(GrpCpuRunMin) "-1"
 
 	#
 	# Test Group Memory
@@ -239,19 +242,22 @@ proc part_test { } {
 
 	#
 	# Test Group wall
+	# Requires priority/multifactor to properly handle decay well
 	#
-	set mod_job_qos(GrpWall) 1
-	set mod_part_qos(GrpWall) $grpwall_num
-	mod_qos $part_qos [array get mod_part_qos]
-	mod_qos $job_qos [array get mod_job_qos]
-	sleep $time_spacing
-	inc21_34_2 $part_qos
-	if {$exit_code != 0 } {
-		cleanup
-		exit 1
+	if { $prio_multifactor != 0 } {
+		set mod_job_qos(GrpWall) 1
+		set mod_part_qos(GrpWall) $grpwall_num
+		mod_qos $part_qos [array get mod_part_qos]
+		mod_qos $job_qos [array get mod_job_qos]
+		sleep $time_spacing
+		inc21_34_2 $part_qos
+		if {$exit_code != 0 } {
+			cleanup
+			exit 1
+		}
+		set mod_job_qos(GrpWall) "-1"
+		set mod_part_qos(GrpWall) "-1"
 	}
-	set mod_job_qos(GrpWall) "-1"
-	set mod_part_qos(GrpWall) "-1"
 
 	#
 	# Test Max Cpu Mins
@@ -355,7 +361,7 @@ proc qos_test { } {
 	global grpcpurunmin_num grpmem_num grpwall_num maxcpumin_num
 	global maxwall_num maxcpuspu_num maxnodespu_num
 	global exit_code job_qos mod_job_qos time_spacing selectparam
-	global nthreads part_qos mod_part_qos
+	global nthreads part_qos mod_part_qos prio_multifactor
 
 	# We will set qostest with the qos that we will test since the some of
 	# the 21.30 inc test require the qostest variable
@@ -508,19 +514,22 @@ proc qos_test { } {
 
 	#
 	# Test GroupCPURunMins
+	# Requires priority/multifactor to properly handle decay well
 	#
-	set mod_job_qos(GrpCpuRunMin) $grpcpurunmin_num
-	set mod_part_qos(GrpCpuRunMin) 1
-	mod_qos $job_qos [array get mod_job_qos]
-	mod_qos $part_qos [array get mod_part_qos]
-	sleep $time_spacing
-	inc21_30_10
-	if {$exit_code != 0 } {
-		cleanup
-		exit 1
+	if { $prio_multifactor != 0 } {
+		set mod_job_qos(GrpCpuRunMin) $grpcpurunmin_num
+		set mod_part_qos(GrpCpuRunMin) 1
+		mod_qos $job_qos [array get mod_job_qos]
+		mod_qos $part_qos [array get mod_part_qos]
+		sleep $time_spacing
+		inc21_30_10
+		if {$exit_code != 0 } {
+			cleanup
+			exit 1
+		}
+		set mod_job_qos(GrpCpuRunMin) "-1"
+		set mod_part_qos(GrpCpuRunMin) "-1"
 	}
-	set mod_job_qos(GrpCpuRunMin) "-1"
-	set mod_part_qos(GrpCpuRunMin) "-1"
 
 	#
 	# Test Group Memory
@@ -540,19 +549,22 @@ proc qos_test { } {
 
 	#
 	# Test Group wall
-	#
-	set mod_job_qos(GrpWall) $grpwall_num
-	set mod_part_qos(GrpWall) 1
-	mod_qos $job_qos [array get mod_job_qos]
-	mod_qos $part_qos [array get mod_part_qos]
-	sleep $time_spacing
-	inc21_34_2 $job_qos
-	if {$exit_code != 0 } {
-		cleanup
-		exit 1
+	# Requires priority/multifactor to properly handle decay well
+	#
+	if { $prio_multifactor != 0 } {
+		set mod_job_qos(GrpWall) $grpwall_num
+		set mod_part_qos(GrpWall) 1
+		mod_qos $job_qos [array get mod_job_qos]
+		mod_qos $part_qos [array get mod_part_qos]
+		sleep $time_spacing
+		inc21_34_2 $job_qos
+		if {$exit_code != 0 } {
+			cleanup
+			exit 1
+		}
+		set mod_job_qos(GrpWall) "-1"
+		set mod_part_qos(GrpWall) "-1"
 	}
-	set mod_job_qos(GrpWall) "-1"
-	set mod_part_qos(GrpWall) "-1"
 
 	#
 	# Test Max Cpu Mins
diff --git a/testsuite/expect/inc22.1.1 b/testsuite/expect/inc22.1.1
index 58a86a099..4c4c53e3f 100644
--- a/testsuite/expect/inc22.1.1
+++ b/testsuite/expect/inc22.1.1
@@ -35,11 +35,13 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 ############################################################################
 
-proc inc22_1_1 {} {
+proc inc22_1_1 { } {
 
 	global account1 accounts users cluster_cpus job0_start user1
-	global node0_down_start node0_cpus node1_cpus cluster sreport
-	global exit_code wc_key_track wckey1 sql_rem
+	global node0_down_start node0_cpus node1_cpus sreport
+	global exit_code wc_key_track wckey1
+	global sql_in_clus1 sql_rem_clus1 sql_in_clus2 sql_rem_clus2
+	global cluster1 cluster2
 
 	# Mon Dec 31 23:00:00 2007
 	set start_time "Mon Dec 31 23:00:00 2007"
@@ -65,14 +67,15 @@ proc inc22_1_1 {} {
 	set reported [format "%d\\\(%.2f%%\\\)" $reported 100]
 
 	send_user "\nTesting sreport for first hour (Within: inc22.1.1)\n"
+
 	set matches 0
-	set my_pid [eval spawn $sreport cluster utilization cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,idle,down,alloc,res,reported]
+	set my_pid [eval spawn $sreport -M$cluster2 cluster utilization start=$start_str end=$end_str -tsecper -p -n format=cluster,idle,down,alloc,res,reported]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
-		    	incr exit_code 1
+			incr exit_code 1
 		}
-		-re "$cluster.$idle.$down.$alloc.$resv.$reported." {
+		-re "$cluster2.$idle.$down.$alloc.$resv.$reported." {
 			incr matches
 			exp_continue
 		}
@@ -92,22 +95,62 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		#incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 cluster utilization cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,idle,down,alloc,res,reported]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$idle.$down.$alloc.$resv.$reported." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$idle.$down.$alloc.$resv.$reported." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 2} {
+		send_user "\nFAILURE:  sreport didn't give good info. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		#incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the UserUtilizationByAccount report
 	set matches 0
-	set my_pid [eval spawn $sreport cluster UserUtilizationByAccount cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,login,account,used]
+	set my_pid [eval spawn $sreport -M$cluster2 cluster UserUtilizationByAccount start=$start_str end=$end_str -tsecper -p -n format=cluster,login,account,used]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$user1.$account1.$alloc." {
+		-re "$cluster2.$user1.$account1.$alloc." {
 			incr matches
 			exp_continue
 		}
@@ -127,30 +170,70 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 cluster UserUtilizationByAccount cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,login,account,used]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$user1.$account1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$user1.$account1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 2} {
+		send_user "\nFAILURE:  sreport didn't give good info 2. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the AccountUtilizationByUser report
 	set matches 0
-	set my_pid [eval spawn $sreport cluster AccountUtilizationByUser cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
+	set my_pid [eval spawn $sreport -M$cluster2 cluster AccountUtilizationByUser start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.root..$alloc." {
+		-re "$cluster2.root..$alloc." {
 			incr matches
 			exp_continue
 		}
-		-re "$cluster.$account1..$alloc." {
+		-re "$cluster2.$account1..$alloc." {
 			incr matches
 			exp_continue
 		}
-		-re "$cluster.$account1.$user1.$alloc." {
+		-re "$cluster2.$account1.$user1.$alloc." {
 			incr matches
 			exp_continue
 		}
@@ -170,22 +253,78 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 cluster AccountUtilizationByUser cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.root..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster1.$account1..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster1.$account1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.root..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$account1..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$account1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 6} {
+		send_user "\nFAILURE:  sreport didn't give good info 3. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the UserUtilizationByWcKey report
 	set matches 0
-	set my_pid [eval spawn $sreport cluster UserUtilizationByWckey cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,login,wckey,used]
+	set my_pid [eval spawn $sreport -M$cluster2 cluster UserUtilizationByWckey start=$start_str end=$end_str -tsecper -p -n format=cluster,login,wckey,used]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$user1.$wckey1.$alloc." {
+		-re "$cluster2.$user1.$wckey1.$alloc." {
 			incr matches
 			exp_continue
 		}
@@ -205,26 +344,66 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 cluster UserUtilizationByWckey cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,login,wckey,used]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$user1.$wckey1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$user1.$wckey1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$wc_key_track == 1 && $matches != 2} {
+		send_user "\nFAILURE:  sreport didn't give good info 4. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the WckeyUtilizationByUser report
 	set matches 0
-	set my_pid [eval spawn $sreport cluster WckeyUtilizationByUser cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,wckey,login,used]
+	set my_pid [eval spawn $sreport -M$cluster2 cluster WckeyUtilizationByUser start=$start_str end=$end_str -tsecper -p -n format=cluster,wckey,login,used]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$wckey1..$alloc." {
+		-re "$cluster2.$wckey1..$alloc." {
 			incr matches
 			exp_continue
 		}
-		-re "$cluster.$wckey1.$user1.$alloc." {
+		-re "$cluster2.$wckey1.$user1.$alloc." {
 			incr matches
 			exp_continue
 		}
@@ -244,22 +423,70 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 cluster WckeyUtilizationByUser cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,wckey,login,used]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$wckey1..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster1.$wckey1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$wckey1..$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$wckey1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sreport not responding\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$wc_key_track == 1 && $matches != 4} {
+		send_user "\nFAILURE:  sreport didn't give good info 5.\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the User Top report
 	set matches 0
-	set my_pid [eval spawn $sreport user top cluster='$cluster' start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
+	set my_pid [eval spawn $sreport -M$cluster2 user top start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$account1.$user1.$alloc." {
+		-re "$cluster2.$account1.$user1.$alloc." {
 			incr matches
 			exp_continue
 		}
@@ -279,22 +506,97 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 user top cluster='$cluster1' start=$start_str end=$end_str -tsecper -p -n format=cluster,account,login,used]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$account1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$account1.$user1.$alloc." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 2} {
+		send_user "\nFAILURE:  sreport didn't give good info 6. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the Job Size report
 	set matches 0
-	set my_pid [eval spawn $sreport job size grouping=2,4 cluster='$cluster' start=$start_str end=$end_str -tsec -p -n]
+	set my_pid [eval spawn $sreport -M$cluster2 job size grouping=2,4 start=$start_str end=$end_str -tsec -p -n]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster2.$account1.0.$alloc_sec.0." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 1} {
+		send_user "\nFAILURE:  sreport didn't give good info 7 $matches. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport job size grouping=2,4 cluster='$cluster1' start=$start_str end=$end_str -tsec -p -n]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$account1.0.$alloc_sec.0." {
+		-re "$cluster1.$account1.0.$alloc_sec.0." {
 			incr matches
 			exp_continue
 		}
@@ -314,22 +616,23 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
 	# test the Job Size by wckey report
 	set matches 0
-	set my_pid [eval spawn $sreport job sizesbywckey grouping=2,4 cluster='$cluster' start=$start_str end=$end_str -tsec -p -n]
+	set my_pid [eval spawn $sreport -M$cluster2 job sizesbywckey grouping=2,4 start=$start_str end=$end_str -tsec -p -n]
 	expect {
 		-re "There was a problem" {
 			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
 			incr exit_code 1
 		}
-		-re "$cluster.$wckey1.0.$wckey_alloc_sec.0." {
+		-re "$cluster2.$wckey1.0.$wckey_alloc_sec.0." {
 			incr matches
 			exp_continue
 		}
@@ -349,10 +652,50 @@ proc inc22_1_1 {} {
 	}
 
 	if {$exit_code} {
-		incr exit_code [archive_load $sql_rem]
+		incr exit_code [archive_load $sql_rem_clus1]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
+
+	set matches 0
+	set my_pid [eval spawn $sreport -M$cluster2 job sizesbywckey grouping=2,4 cluster='$cluster1' start=$start_str end=$end_str -tsec -p -n]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command (Within: inc22.1.1)\n"
+			incr exit_code 1
+		}
+		-re "$cluster1.$wckey1.0.$wckey_alloc_sec.0." {
+			incr matches
+			exp_continue
+		}
+		-re "$cluster2.$wckey1.0.$wckey_alloc_sec.0." {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding (Within: inc22.1.1)\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$matches != 2} {
+		send_user "\nFAILURE:  sreport didn't give good info 8 $matches. (Within: inc22.1.1)\n"
+		incr exit_code 1
+	}
+
+	if {$exit_code} {
+		incr exit_code [archive_load $sql_rem_clus1]
 		remove_user "" "" $users
 		remove_acct "" $accounts
-		remove_cluster "$cluster"
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
diff --git a/testsuite/expect/inc22.1.2 b/testsuite/expect/inc22.1.2
index 657f887b6..6cdd2c170 100644
--- a/testsuite/expect/inc22.1.2
+++ b/testsuite/expect/inc22.1.2
@@ -37,10 +37,14 @@
 
 proc inc22_1_2 {} {
 
-	global node0_down_end node0_cpus node1_cpus cluster sreport
-	global my_pid accounts users cluster_cpus
+	global node0_down_end node0_cpus node1_cpus cluster1 sreport
+	global cluster1 my_pid accounts users cluster_cpus
 	global job1_end job1_cpus job2_elig job2_cpus account1 user1
-	global sql_rem wckey1 wc_key_track exit_code
+	global sql_rem_clus1 wckey1 wc_key_track exit_code cluster2
+
+	#since there are 2 test clusters we will just use one
+	set cluster $cluster1
+	set sql_rm $sql_rem_clus1
 
 	# Tue Jan 1 00:00:00 2008
 	set start_time "Tue Jan 1 00:00:00 2008"
@@ -107,6 +111,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -150,6 +155,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -185,6 +191,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -224,6 +231,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -259,6 +267,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -294,6 +303,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -329,6 +339,7 @@ proc inc22_1_2 {} {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
diff --git a/testsuite/expect/inc22.1.3 b/testsuite/expect/inc22.1.3
index 66ffb452b..d16b1a39a 100644
--- a/testsuite/expect/inc22.1.3
+++ b/testsuite/expect/inc22.1.3
@@ -38,13 +38,17 @@
 proc inc22_1_3 { } {
 
 	global sreport exit_code node0_down_start node0_down_end node0_cpus
-	global node1_cpus cluster my_pid accounts users cluster_cpus
+	global node1_cpus cluster1 cluster2 my_pid accounts users cluster_cpus
 	global job0_start job1_end job1_cpus job1_alloc job2_start
 	global job2_end job2_cpus job2_alloc job2_elig job3_start
 	global job3_end job3_cpus job3_alloc job3_elig acct1_alloc acct2_alloc
 	global acct3_alloc total_alloc wckey1_alloc user1_wckey1_alloc
 	global user2_wckey1_alloc user1 user2 account1 account2 account3
-	global sql_rem wckey1 wc_key_track
+	global sql_rem_clus1 wckey1 wc_key_track
+
+	#since there are 2 test clusters we will just use one
+	set cluster $cluster1
+	set sql_rm $sql_rem_clus1
 
 	# Mon Dec 31 23:00:00 2007
 	set start_time "Mon Dec 31 23:00:00 2007"
@@ -132,6 +136,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -178,6 +183,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -237,6 +243,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -278,6 +285,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -321,6 +329,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -364,6 +373,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -403,6 +413,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -438,6 +449,7 @@ proc inc22_1_3 { } {
 		remove_user "" "" $users
 		remove_acct "" $accounts
 		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
 		exit $exit_code
 	}
 
@@ -462,4 +474,17 @@ proc inc22_1_3 { } {
 			wait
 		}
 	}
+	if {$matches != 1} {
+		send_user "\nFAILURE:  sreport didn't give good info 24 $matches. (Within: inc22.1.3)\n"
+		incr exit_code 1
+	}
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
 }
diff --git a/testsuite/expect/inc22.1.4 b/testsuite/expect/inc22.1.4
index 49ea6fde0..050e26434 100644
--- a/testsuite/expect/inc22.1.4
+++ b/testsuite/expect/inc22.1.4
@@ -40,15 +40,19 @@ proc inc22_1_4 {} {
 
 	global sacct job1_acct job2_acct job3_acct job1_start_str
 	global job1_end_str job2_start_str job2_end_str job3_start_str
-	global exit_code job3_end_str start_str end_str cluster
+	global exit_code job3_end_str start_str end_str cluster1 cluster2
+	global sql_rem_clus1 sql_rem_clus2 users accounts
+	global test_job1 test_job2 test_job3
 
+	#since there are 2 test clusters we will just use one
+	set cluster $cluster1
 
 	#Test for job 1
 	send_user "\nSearch for job1 on cluster $cluster (Within: inc21.1.4)\n"
 	set usermatch 0
-	spawn $sacct -p -C $cluster --state=completed --start=$job1_start_str --end=$job1_end_str --format=node,jobname,jobid
+	spawn $sacct -p -C $cluster --state=completed --start=$job1_start_str --end=$job1_end_str --format=jobname
 	expect {
-		-re "$job1_acct" {
+		-re "$test_job1." {
 			incr usermatch
 			exp_continue
 		}
@@ -64,13 +68,28 @@ proc inc22_1_4 {} {
 			set exit_code 1
 		}
 	}
+	# Job1 is submitted twice
+	if {$usermatch != 2} {
+		send_user "\nFAILURE:  sacct didn't give good info 25 $usermatch.\n"
+		incr exit_code 1
+	}
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem_clus1]
+		incr exit_code [archive_load $sql_rem_clus2]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
 
 	# Test for job2
 	send_user "\nSearch for job2 on cluster $cluster (Within: inc21.1.4)\n"
 	set usermatch 0
-	spawn $sacct -p -C $cluster --state=completed --start=$job2_start_str --end=$job2_end_str --format=node,jobname,jobid
+	spawn $sacct -p -C $cluster --state=completed --start=$job2_start_str --end=$job2_end_str --format=jobname
 	expect {
-		-re "$job2_acct" {
+		-re "$test_job2." {
 			incr usermatch
 			exp_continue
 		}
@@ -86,13 +105,27 @@ proc inc22_1_4 {} {
 			set exit_code 1
 		}
 	}
+	if {$usermatch != 1} {
+		send_user "\nFAILURE:  sacct didn't give good info 25 $usermatch.\n"
+		incr exit_code 1
+	}
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem_clus1]
+		incr exit_code [archive_load $sql_rem_clus2]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
 
 	# Test for job3
 	send_user "\nSearch for job3 on cluster $cluster (Within: inc21.1.4)\n"
 	set usermatch 0
-	spawn $sacct -p -C $cluster --state=completed --start=$job3_start_str --end=$job3_end_str --format=node,jobname,jobid
+	spawn $sacct -p -C $cluster --state=completed --start=$job3_start_str --end=$job3_end_str --format=jobname
 	expect {
-		-re "$job3_acct" {
+		-re "$test_job3." {
 			incr usermatch
 			exp_continue
 		}
@@ -108,4 +141,19 @@ proc inc22_1_4 {} {
 			set exit_code 1
 		}
 	}
+
+	if {$usermatch != 1} {
+		send_user "\nFAILURE:  sacct didn't give good info 25 $usermatch.\n"
+		incr exit_code 1
+	}
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem_clus1]
+		incr exit_code [archive_load $sql_rem_clus2]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster1"
+		remove_cluster "$cluster2"
+		exit $exit_code
+	}
 }
diff --git a/testsuite/expect/inc3.11.1 b/testsuite/expect/inc3.11.1
index 99f7087e6..2388aea5f 100644
--- a/testsuite/expect/inc3.11.1
+++ b/testsuite/expect/inc3.11.1
@@ -32,13 +32,10 @@
 ############################################################################
 
 proc inc3_11_1 {} {
-	global def_node user_name def_partition exit_code cluster_cpus res_name
-	global cons_res_actived def_node_name
-
-	set num_nodes [available_nodes $def_partition ""]
-
-	# First setting core_res_num greater than cores per node (assuming symmetric nodes)
-	set core_res_num [ expr ($cluster_cpus / $num_nodes) + 1 ]
+	global cons_res_actived def_node def_node_name
+	global def_partition exit_code
+	global part_cores part_node part_node_cnt part_node_cores
+	global res_name user_name
 
 	# TEST 1
 	# Make a list of lists with a series of parameters to test.  All the tests
@@ -64,7 +61,8 @@ proc inc3_11_1 {} {
 "
 	#{StartTime=now   Duration=5   Nodes=$def_node   Account=badaccountname}
 	if {$cons_res_actived == 1} {
-		set more_badtests "StartTime=now   Duration=5   NodeCnt=1 CoreCnt=$core_res_num  User=$user_name"
+		set corecnt [ expr $part_node_cores + 1 ]
+		set more_badtests "StartTime=now Duration=5 Nodes=$part_node CoreCnt=$corecnt User=$user_name"
 		lappend badtests $more_badtests
 	}
 
@@ -75,7 +73,7 @@ proc inc3_11_1 {} {
 			delete_res $res_name
 			exit 1
 		} else {
-			send_user "\033\[32mExpected error.  You can turn that frown upside-down. (Within: inc3.11.1)\033\[m\n"
+			send_user "\033\[32mExpected error. You can turn that frown upside-down. (Within: inc3.11.1)\033\[m\n"
 		}
 	}
 
@@ -84,7 +82,7 @@ proc inc3_11_1 {} {
 		exit $exit_code
 	}
 
-	set core_res_num [ expr $cluster_cpus / 2 ]
+	set corecnt [ expr $part_cores / 2 ]
 	set goodtests "
 	{StartTime=now   Duration=5   Nodes=$def_node   User=$user_name Flags=ignore_jobs}
 	{StartTime=now+5minutes   EndTime=now+10minutes   Nodes=$def_node   User=$user_name Flags=ignore_jobs}
@@ -96,7 +94,7 @@ proc inc3_11_1 {} {
 "
 	#{StartTime=now   Duration=5   NodeCnt=10 CoreCnt=11  User=$user_name}
 	if {$cons_res_actived == 1} {
-		set more_goodtests "StartTime=now   Duration=5   NodeCnt=$num_nodes CoreCnt=$core_res_num  User=$user_name"
+		set more_goodtests "StartTime=now Duration=5 NodeCnt=$part_node_cnt CoreCnt=$corecnt User=$user_name"
 		lappend goodtests $more_goodtests
 	}
 
diff --git a/testsuite/expect/inc3.11.5 b/testsuite/expect/inc3.11.5
index ff2482552..6b7d57a25 100644
--- a/testsuite/expect/inc3.11.5
+++ b/testsuite/expect/inc3.11.5
@@ -48,6 +48,7 @@ proc inc3_11_5 {} {
 	set ret_code [create_res "StartTime=now+60minutes Duration=60 NodeCnt=1 user=$user_name" 1]
 	if {$ret_code == 0} {
 		send_user "\n\033\[31mFAILURE: Reservation did not fail but should have (Within: inc3.11.5)\033\[m\n"
+		delete_res $res_name_save
 		delete_res $res_name
 		exit 1
 	} else {
diff --git a/testsuite/expect/inc3.11.7 b/testsuite/expect/inc3.11.7
index 15783cb70..c5a7fef27 100644
--- a/testsuite/expect/inc3.11.7
+++ b/testsuite/expect/inc3.11.7
@@ -31,16 +31,15 @@
 ############################################################################
 
 proc inc3_11_7 {} {
-	global user_name exit_code res_name res_nodes
-	global bin_rm file_in bin_sleep sbatch number scontrol
-	global alpha_numeric_under scancel
-	global cluster_cpus cores_per_node def_partition
-	global res_name res_thread_cnt wait_for_job
+	global alpha_numeric_under bin_rm bin_sleep cluster_cpus cores_per_node
+	global def_partition exit_code file_in number part_cores part_node
+	global part_node_cnt part_node_cores res_name res_name res_nodes
+	global res_thread_cnt sbatch scancel scontrol user_name wait_for_job
 
 	send_user "\n+++++ STARTING TEST 7 (Within: inc3.11.7) +++++\n"
 
 	# Make a reservation, just to get node size infomation
-	set ret_code [create_res "StartTime=now Duration=1 NodeCnt=1 User=$user_name" 0]
+	set ret_code [create_res "StartTime=now Duration=1 Nodes=$part_node User=$user_name" 0]
 	if {$ret_code != 0} {
 		send_user "\n\033\[31mFAILURE: Unable to create a valid reservation (Within inc3.11.7)\033\[m\n"
 		exit $ret_code
@@ -54,14 +53,13 @@ proc inc3_11_7 {} {
 	# Now make a reservation using half the cores on that node
 	# There is no way to specify a the Nodes in a reservation with CoreCnt,
 	# so hope that we get a node with the same size
-	set core_res_num   [ expr ($cores_per_node / 2) ]
-	set ret_code [create_res "StartTime=now Duration=60 NodeCnt=1 CoreCnt=$core_res_num User=$user_name" 0]
+	set corecnt [ expr ($part_node_cores / 2) ]
+	set ret_code [create_res "StartTime=now Duration=60 Nodes=$part_node CoreCnt=$corecnt User=$user_name" 0]
 	if {$ret_code != 0} {
 		send_user "\n\033\[31mFAILURE: Unable to create a valid reservation (Within: inc3.11.7)\033\[m\n"
 		exit $ret_code
 	}
-	set core_res_num   [ expr ($cores_per_node / 2) ]
-	set thread_res_num [ expr $core_res_num * $res_thread_cnt ]
+	set thread_res_num [ expr $corecnt * $res_thread_cnt ]
 
 	# Make the job script
 	exec $bin_rm -f $file_in
diff --git a/testsuite/expect/inc3.11.8 b/testsuite/expect/inc3.11.8
index e7f6923c4..348bd3e80 100644
--- a/testsuite/expect/inc3.11.8
+++ b/testsuite/expect/inc3.11.8
@@ -31,11 +31,10 @@
 ############################################################################
 
 proc inc3_11_8 {} {
-	global user_name exit_code res_name res_nodes res_nodecnt res_corecnt
+	global user_name exit_code res_name
 	global bin_rm file_in bin_sleep sbatch number scontrol
 	global alpha_numeric_under scancel
-	global cluster_cpus cores_per_node def_partition
-	global res_nodes res_thread_cnt
+	global cluster_cpus def_partition
 
 	send_user "\n+++++ STARTING TEST 8 (Within: inc3.11.8) +++++\n"
 
@@ -49,19 +48,73 @@ proc inc3_11_8 {} {
 		send_user "\n\033\[31mFAILURE: Unable to create a valid reservation (Within: inc3.11.8)\033\[m\n"
 		exit $ret_code
 	}
+	set host_name ""
+	spawn $scontrol show res $res_name
+	expect {
+		-re "Nodes=($alpha_numeric_under)" {
+			set host_name $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\n\033\[31mFAILURE: scontrol not responding (Within: inc3.11.8)\033\[m\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
 	# Delete the reservation
 	set ret_code [delete_res $res_name]
 	if {$ret_code != 0} {
 		exit $ret_code
 	}
+	if {[string compare $host_name ""] == 0} {
+		send_user "\n\033\[31mFAILURE: Failed to get host name (Within: inc3.11.8)\033\[m\n"
+		exit 1
+	}
 
-	set num_nodes [available_nodes $def_partition ""]
+	set cpu_tot 1
+	set boards  1
+	set sockets 1
+	set cores_per_socket 1
+	set threads_per_core 1
+	spawn $scontrol show node $host_name
+	expect {
+		-re " CoresPerSocket=($number)" {
+			set cores_per_socket $expect_out(1,string)
+			exp_continue
+		}
+		-re " CPUTot=($number)" {
+			set cpu_tot $expect_out(1,string)
+			exp_continue
+		}
+		-re " Sockets=($number)" {
+			set sockets $expect_out(1,string)
+			exp_continue
+		}
+		-re " Boards=($number)" {
+			set boards $expect_out(1,string)
+			exp_continue
+		}
+		-re " ThreadsPerCore=($number)" {
+			set threads_per_core $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\n\033\[31mFAILURE: scontrol not responding (Within: inc3.11.8)\033\[m\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	set cores_per_node [ expr $boards * $sockets * $cores_per_socket ]
 	set core_res_num   [ expr $cores_per_node / 2 ]
-	set thread_res_num [ expr $core_res_num * $res_thread_cnt ]
+	set cpu_res_num    [ expr $cpu_tot / 2 ]
 
-	# (First test) Submit the batch job: a simple job using half the threads on the nodes
+	# (First test) Submit the batch job: a simple job using half the CPUs on the selected node
 	set job_id 0
-	set sbatch_pid [spawn $sbatch --nodes=1-$num_nodes --time=10:00 --ntasks-per-node=$thread_res_num --output=/dev/null $file_in]
+	set sbatch_pid [spawn $sbatch -w $host_name --time=10:00 --ntasks-per-node=$cpu_res_num --output=/dev/null $file_in]
 	expect {
 		-re "Submitted batch job ($number)" {
 			set job_id $expect_out(1,string)
@@ -86,28 +139,15 @@ proc inc3_11_8 {} {
 		cancel_job $job_id
 		exit 1
 	}
-	send_user "\nJOB is running as expected\n"
+	send_user "\nJob is running as expected\n"
 
 	# Make the reservation using free cores in a node
-	set ret_code [create_res "StartTime=now Duration=60 NodeCnt=1 CoreCnt=$core_res_num User=$user_name" 0]
+	set ret_code [create_res "StartTime=now Duration=60 Nodes=$host_name CoreCnt=$core_res_num User=$user_name" 0]
 	if {$ret_code != 0} {
 		send_user "\n\033\[31mFAILURE: Unable to create a valid reservation (Within: inc3.11.8)\033\[m\n"
 		cancel_job $job_id
 		exit $ret_code
 	}
-
-	if {$res_nodecnt != 1} {
-		send_user "\n\033\[31mFAILURE: reservation created with $res_nodecnt nodes when just 1 was requested (Within: inc3.11.8)\033\[m\n"
-		cancel_job $job_id
-		exit 1
-	}
-
-	if {$res_corecnt != $core_res_num} {
-		send_user "\n\033\[31mFAILURE: reservation created with $res_corecnt cores when just $core_res_num was requested (Within: inc3.11.8)\033\[m\n"
-		cancel_job $job_id
-		exit 1
-	}
-
 	send_user "\n\033\[32mSUCCESS: reservation was created as expected (Within: inc3.11.8)\033\[m\n"
 
 	# Delete the reservation
@@ -119,7 +159,7 @@ proc inc3_11_8 {} {
 
 	set core_res_num  [expr $core_res_num + 1]
 	# Make the reservation using more cores then free in a node
-	set ret_code [create_res "StartTime=now Duration=60 NodeCnt=1 CoreCnt=$core_res_num User=$user_name" 1]
+	set ret_code [create_res "StartTime=now Duration=60 Nodes=$host_name CoreCnt=$core_res_num User=$user_name" 1]
 	if {$ret_code != 0} {
 		send_user "\n\033\[32mSUCCESS: Reservation can not be created as expected (Within: inc3.11.8)\033\[m\n"
 	} else {
@@ -132,7 +172,7 @@ proc inc3_11_8 {} {
 
 	# Make the reservation using more cores than free in a node (now)
 	# but those cores being free at reservation start time
-	set ret_code [create_res "StartTime=now+3600 Duration=60 NodeCnt=1 CoreCnt=$core_res_num User=$user_name" 0]
+	set ret_code [create_res "StartTime=now+3600 Duration=60 Nodes=$host_name CoreCnt=$core_res_num User=$user_name" 0]
 	if {$ret_code != 0} {
 		send_user "\n\033\[31mFAILURE: Reservation can not be created when it should (Within: inc3.11.8)\033\[m\n"
 		set exit_code 1
@@ -143,7 +183,7 @@ proc inc3_11_8 {} {
 	}
 
 	# Make the reservation using more cores than free at reservation start time
-	set ret_code [create_res "StartTime=now+300 Duration=60 NodeCnt=1 CoreCnt=$core_res_num User=$user_name" 1]
+	set ret_code [create_res "StartTime=now+300 Duration=60 Nodes=$host_name CoreCnt=$core_res_num User=$user_name" 1]
 	if {$ret_code != 0} {
 		send_user "\n\033\[32mSUCCESS: Reservation can not be created as expected (Within 3.11.8)\033\[m\n"
 	} else {
diff --git a/testsuite/expect/mpi-testscripts/script.slurm.sh b/testsuite/expect/mpi-testscripts/script.slurm.sh
index 87e06f7f0..675a3ce9b 100755
--- a/testsuite/expect/mpi-testscripts/script.slurm.sh
+++ b/testsuite/expect/mpi-testscripts/script.slurm.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/usr/bin/env bash
 export MP_RMPOOL=slurm
 export MP_NODES=$SLURM_NNODES
 export MP_PROCS=$SLURM_NTASKS
diff --git a/testsuite/expect/regression b/testsuite/expect/regression
index 5529d398b..73e23a680 100755
--- a/testsuite/expect/regression
+++ b/testsuite/expect/regression
@@ -34,6 +34,13 @@
 FAILURES=0
 COMPLETIONS=0
 
+# Clear any environment variables that could break the tests.
+# Cray sets some squeue format options that break tests
+unset SQUEUE_ALL
+unset SQUEUE_SORT
+unset SQUEUE_FORMAT
+unset SQUEUE_FORMAT2
+
 # Make sure we are in the desired directory before possibly
 # removing files the user does not want to lose.
 if [ ! -x ./regression ]; then
@@ -71,6 +78,7 @@ for major in `seq 1 100`; do
 			echo "$TEST FAILURE"
 			grep "$TEST " README >& 2
 			echo "=============" >& 2
+			if [ -f ./slurm_status ]; then ./slurm_status; fi
 		fi
 		/bin/echo "============================================"
 	done
diff --git a/testsuite/expect/regression.py b/testsuite/expect/regression.py
index cbc60c2c6..124640cd9 100755
--- a/testsuite/expect/regression.py
+++ b/testsuite/expect/regression.py
@@ -66,6 +66,13 @@ def main(argv=None):
         print >>sys.stderr, 'ERROR: "globals" not here as needed'
         return -1
 
+	# Clear any environment variables that could break the tests.
+	# Cray sets some squeue format options that break tests
+	del os.environ['SQUEUE_ALL']
+	del os.environ['SQUEUE_SORT']
+	del os.environ['SQUEUE_FORMAT']
+	del os.environ['SQUEUE_FORMAT2']
+
     # Read the current working directory and build a sorted list
     # of the available tests.
     test_re = re.compile('test(\d+)\.(\d+)$')
diff --git a/testsuite/expect/slurm_status b/testsuite/expect/slurm_status
new file mode 100755
index 000000000..86ca5190b
--- /dev/null
+++ b/testsuite/expect/slurm_status
@@ -0,0 +1,43 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Dump current slurm status after a test failure
+############################################################################
+# Copyright (C) 2016 SchedMD LLC
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+send_user "<<<<<<<<<<<<<<<<<<<< SLURM STATUS, START >>>>>>>>>>>>>>>>>>>>\n"
+spawn $sinfo -l
+expect {
+	eof {
+		wait
+	}
+}
+
+spawn $squeue -l
+expect {
+	eof {
+		wait
+	}
+}
+send_user "<<<<<<<<<<<<<<<<<<<< SLURM STATUS, END >>>>>>>>>>>>>>>>>>>>\n"
+
+exit 0
diff --git a/testsuite/expect/test1.100 b/testsuite/expect/test1.100
index 3cd2c14d5..77c524cc5 100755
--- a/testsuite/expect/test1.100
+++ b/testsuite/expect/test1.100
@@ -65,11 +65,7 @@ set tested_layout [list -1 -1 -1 -1]
 set timeout $max_job_delay
 set srun_pid [spawn $srun -O -N2 -n4 --exclusive -l --distribution=pack -t1 $bin_printenv $use_envvar]
 expect {
-	-re "More processors requested than permitted" {
-		send_user "\nWARNING: can't test srun task distribution\n"
-		exit 0
-	}
-	-re "Node count specification invalid" {
+	-re "srun: error" {
 		send_user "\nWARNING: can't test srun task distribution\n"
 		exit 0
 	}
diff --git a/testsuite/expect/test1.102 b/testsuite/expect/test1.102
new file mode 100755
index 000000000..f10663990
--- /dev/null
+++ b/testsuite/expect/test1.102
@@ -0,0 +1,71 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.102"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job that deadline is too late
+#
+set timeout $max_job_delay
+set srun_pid 0
+set srun_pid [spawn $srun -v --deadline 2015-03-27T04:30:00 -t1 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "unrecognized option '--deadline'" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Completed" {
+		send_user "\nFAILURE: srun is OK with a deadline too old\n"
+		set exit_code 1
+		exit 1
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.103 b/testsuite/expect/test1.103
new file mode 100755
index 000000000..a02e7e50a
--- /dev/null
+++ b/testsuite/expect/test1.103
@@ -0,0 +1,91 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too short
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.103"
+set job_id	0
+set exit_code   0
+
+print_header $test_id
+
+#
+# Spawn a job that deadline is too short
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v -N1 --deadline now+1hour -t120 --time-min=1 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "launching ($number).($number) on host" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: Job launch failed\n"
+	set exit_code 1
+} else {
+	spawn $scontrol show job $job_id
+	expect {
+		-re "TimeLimit=01:00:00" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=00:59:" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=" {
+			send_user "\nFAILURE: Timelimit not OK with deadline\n"
+			set exit_code 1
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.104 b/testsuite/expect/test1.104
new file mode 100755
index 000000000..e8a2a1d0b
--- /dev/null
+++ b/testsuite/expect/test1.104
@@ -0,0 +1,284 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time limit partition
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id        "1.104"
+set file_in        "test$test_id.bash"
+set test_srun      "test$test_id.test_srun"
+set job_id         0
+set authorized     1
+set exit_code      0
+set part_name      "QA_TEST"
+set test_script    "./test$test_id.bash"
+
+
+print_header $test_id
+
+if {[test_super_user] == 0} {
+	send_user "\nWARNING: can not test more unless SlurmUser or root\n"
+	exit $exit_code
+}
+
+#
+# Confirm the partition name does not already exist
+#
+set found -1
+spawn $scontrol -a show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == -1} {
+	send_user "\nFAILURE: scontrol output format error\n"
+	exit 1
+}
+if {$found == 1} {
+	send_user "\nFAILURE: partition $part_name already exists\n"
+	exit 1
+}
+
+#
+# Identify usable nodes in default partition
+#
+set def_node [get_idle_node_in_part [default_partition]]
+if {[string compare $def_node ""] == 0} {
+	send_user "\nFAILURE: default partition seems to have no idle nodes\n"
+	exit 1
+}
+
+#
+# Create a new partition
+#
+spawn $scontrol create PartitionName=$part_name Nodes=$def_node MaxTime=30
+expect {
+	-re "error" {
+		send_user "\nFAILURE: something bad happened on partition create\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition now exists
+#
+set allow  0
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 1} {
+	send_user "\nFAILURE: partition not created\n"
+	exit 1
+}
+
+set found 0
+
+# Check EnforcePartLimits value
+set enforcepartlimits [test_enforce_part_limits]
+send_user "\nEnforcePartLimits=$enforcepartlimits\n\n"
+
+#
+# Run a job in this new partition and validate the time limit
+#
+make_bash_script $test_srun "
+set -m
+$srun -N1 --deadline now+1hour -p $part_name -t100  -v $bin_sleep 1 &
+"
+
+make_bash_script $file_in "
+bash -i ./$test_srun
+"
+
+set timeout $max_job_delay
+spawn bash -i $file_in
+if {[string compare $enforcepartlimits "NO"] == 0} {
+
+	#
+	# Job is not rejected at submit time
+	#
+
+	expect {
+		-re "job ($number) queued and waiting for resources" {
+			set job_id $expect_out(1,string)
+			set exit_code 0
+		}
+		timeout {
+			send_user "\nFAILURE: srun not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	#
+	# verify time limit. Add a temporization to wait for update reason
+	#
+	if {$job_id == 0} {
+		send_user "\nFAILURE: job_id = 0 : salloc not OK\n"
+		set exit_code 1
+	} else {
+		set cycle_count 8
+		for {set inx 0} {$inx < $cycle_count} {incr inx} {
+			spawn $scontrol show job $job_id
+			expect {
+				-re "Reason=PartitionTimeLimit" {
+					set exit_code 0
+					break
+				}
+				-re "Reason=" {
+					sleep 5
+					set exit_code 1
+					exp_continue
+				}
+				timeout {
+					send_user "\nFAILURE: scontrol not responding\n"
+					set exit_code 1
+				}
+				eof {
+					wait
+				}
+			}
+		}
+		if {$exit_code == 1} {
+			if {$cycle_count == 8}  {
+				send_user "\nFAILURE: partition time limit not used \n"
+			}
+		}
+		cancel_job $job_id
+	}
+
+} else {
+	#
+	# Job should be rejected at submit time
+	#
+	expect {
+	        -re "Requested time limit is invalid (missing or exceeds some limit)" {
+	                set exit_code 0
+	                exp_continue
+	        }
+	        -re "unrecognized option '--deadline'" {
+	                set exit_code 1
+	                exp_continue
+	        }
+	        timeout {
+	                send_user "\nFAILURE: srun not responding\n"
+	                set exit_code 1
+	        }
+	        eof {
+	                wait
+	        }
+	}
+
+}
+
+#
+# Now delete the partition
+#
+spawn $scontrol delete PartitionName=$part_name
+expect {
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition is now gone
+#
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 0} {
+	send_user "\nFAILURE: partition not deleted\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm $test_srun $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.105 b/testsuite/expect/test1.105
new file mode 100755
index 000000000..39c972c3d
--- /dev/null
+++ b/testsuite/expect/test1.105
@@ -0,0 +1,98 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and no time
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.105"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+set part_name [default_partition]
+set default_time [get_partition_default_time_limit $part_name]
+if { $default_time != -1} {
+	send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
+	exit $exit_code
+}
+
+#
+# Spawn a job with a deadline and no time
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun --verbose -N1 --deadline now+600 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "launching ($number).($number) on host" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted\n"
+	exit 1
+} else {
+	spawn $scontrol show job $job_id
+	expect {
+		-re "TimeLimit=00:10:" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=00:09:" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=" {
+			send_user "\nFAILURE : Timelimit not OK with deadline\n"
+			set exit_code 1
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.106 b/testsuite/expect/test1.106
new file mode 100755
index 000000000..2e1e28ea4
--- /dev/null
+++ b/testsuite/expect/test1.106
@@ -0,0 +1,78 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.106"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time
+#
+set timeout $max_job_delay
+set time_error 0
+set srun_pid [spawn $srun -v -N1 --deadline now+1hour --time-min 120 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set time_error 1
+		exp_continue
+	}
+	-re "launching ($number).($number) on host" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id != 0} {
+	send_user "\nFAILURE: job submitted despite the deadline\n"
+	[cancel_job $job_id]
+	exit 1
+}
+if {$time_error == 0} {
+	send_user "\nFAILURE: No time limit error\n"
+	set exit_code 1
+} else {
+	send_user "\nTime limit error expected, no worries\n"
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.107 b/testsuite/expect/test1.107
new file mode 100755
index 000000000..d048e28c6
--- /dev/null
+++ b/testsuite/expect/test1.107
@@ -0,0 +1,96 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min and time too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.107"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v  -N1 --deadline now+1hour --time-min 20 -t120 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		send_user "\nFAILURE: time limit error\n"
+		set exit_code 1
+		exp_continue
+	}
+	-re "launching ($number).0 on host" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted\n"
+	send_user "FAILURE: This can be due to QOS or account time limit <120 minutes\n"
+	exit 1
+}
+
+#
+# verify time limit
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=01:00:00" {
+		exp_continue
+	}
+	-re "TimeLimit=00:59:" {
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: time limit is different from deadline\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.108 b/testsuite/expect/test1.108
new file mode 100755
index 000000000..f8b49d131
--- /dev/null
+++ b/testsuite/expect/test1.108
@@ -0,0 +1,76 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and --begin option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.108"
+set exit_code   0
+set job_id     0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v -N1 --begin now+2hour --deadline now+1hour $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "launching ($number).($number) on host" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id != 0} {
+	send_user "\nFAILURE: job submitted with a deadline too short\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.109 b/testsuite/expect/test1.109
new file mode 100755
index 000000000..5beb112a2
--- /dev/null
+++ b/testsuite/expect/test1.109
@@ -0,0 +1,80 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and --time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This fie is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.109"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time limit and a time-min too long
+#
+set timeout [expr $max_job_delay + 1]
+set invalid_tl 0
+set srun_pid [spawn $srun -v --begin now+5 --deadline now+600 --time-min 11 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set invalid_tl 1
+		exp_continue
+	}
+	-re "Force Terminated job ($number)" {
+		exp_continue
+	}
+	-re "job ($number) queued and waiting for resources" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id != 0} {
+	send_user "\nFAILURE: job submitted with a deadline too short\n"
+	cancel_job $job_id
+	exit 1
+}
+if {$invalid_tl == 0} {
+	send_user "\nFAILURE: failed to generate deadline error\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nFAILURE: job not with DEADLINE status.\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.110 b/testsuite/expect/test1.110
new file mode 100755
index 000000000..936e844f5
--- /dev/null
+++ b/testsuite/expect/test1.110
@@ -0,0 +1,87 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and -- begin option and --time_min OK
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.110"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v --begin now+5 --deadline now+600 --time-min 1 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Force Terminated job ($number)" {
+		set exit_code 1
+	}
+	-re "job (number) queued and waiting for resources" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	-re "launching ($number).0 on host" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted with a deadline and a time-min OK\n"
+	exit 1
+}
+
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.111 b/testsuite/expect/test1.111
new file mode 100755
index 000000000..adc273473
--- /dev/null
+++ b/testsuite/expect/test1.111
@@ -0,0 +1,101 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and time to be changed
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.111"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v --begin=now+5 --deadline=now+600 --time=100 --time-min=9 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "job ($number) queued and waiting for resources" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	-re "job ($number) has been allocated resources" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted\n"
+	exit 1
+}
+
+#
+# test timelimit in job
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=00:09:" {
+		exp_continue
+	}
+	-re "TimeLimit=00:10:" {
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: job submitted with a time limit different than calculated (00:09:00)\n"
+		set exit_code 1
+	}
+	timeout {
+		send_user "\nFAILURE: sacct not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.112 b/testsuite/expect/test1.112
new file mode 100755
index 000000000..c311d53bd
--- /dev/null
+++ b/testsuite/expect/test1.112
@@ -0,0 +1,100 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and -- begin option and time not changed
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "1.112"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job with a deadline and no time-min
+#
+set timeout $max_job_delay
+set srun_pid [spawn $srun -v --begin now+10 --deadline now+1hour -t 10 $bin_sleep 1 ]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "job ($number) queued and waiting for resources" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	-re "job ($number) has been allocated resources" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted\n"
+	exit 1
+}
+
+#
+# test timelimit in job
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=00:10:" {
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: job submitted with a time limit different than calculated (00:10:00)\n"
+		set exit_code 1
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test1.14 b/testsuite/expect/test1.14
index 9d046cc41..886e252e2 100755
--- a/testsuite/expect/test1.14
+++ b/testsuite/expect/test1.14
@@ -37,6 +37,7 @@ set exit_code        0
 set file_in         "test$test_id.input"
 set file_in2        "test$test_id.input2"
 set file_out        "test$test_id.output"
+set file_out2       "test$test_id.output2"
 set job_id           0
 set sleep_secs       10
 
@@ -60,7 +61,7 @@ if {[test_launch_poe]} {
 # Run one more step than allocated CPUs and make sure it waits
 # The "sleep 4" is meant to insure the earlier job steps start first
 #
-exec $bin_rm -f $file_in $file_in2 $file_out
+exec $bin_rm -f $file_in $file_in2 $file_out $file_out2
 make_bash_script $file_in "
   echo tasks_per_node=\$SLURM_TASKS_PER_NODE
   inx=0
@@ -166,7 +167,7 @@ make_bash_script $file_in "
 #
 # Spawn a job via sbatch
 #
-spawn $sbatch -N1 -t1 --gres=craynetwork:0 --output=$file_out $file_in
+spawn $sbatch -N1 -t1 --gres=craynetwork:0 --output=$file_out2 $file_in
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -198,12 +199,12 @@ if {[wait_for_job $job_id "DONE"] != 0} {
 #
 # Check for desired output
 #
-if {[wait_for_file $file_out] != 0} {
-	send_user "\nFAILURE: Output file $file_out is missing\n"
+if {[wait_for_file $file_out2] != 0} {
+	send_user "\nFAILURE: Output file $file_out2 is missing\n"
 	exit 1
 }
 set matches 0
-spawn $bin_cat $file_out
+spawn $bin_cat $file_out2
 expect {
 	-re "StepId=$job_id" {
 		send_user "\nFAILURE: Problem --exclusive and --immediate option for step\n"
@@ -226,7 +227,7 @@ if { $matches != 1 } {
 }
 
 if {$exit_code == 0} {
-	exec $bin_rm -f $file_in $file_in2 $file_out
+	exec $bin_rm -f $file_in $file_in2 $file_out $file_out2
 	send_user "\nSUCCESS\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test1.19 b/testsuite/expect/test1.19
index 7094322af..2932772aa 100755
--- a/testsuite/expect/test1.19
+++ b/testsuite/expect/test1.19
@@ -37,6 +37,8 @@ set test_id          "1.19"
 set exit_code        0
 set file_err_j       "test$test_id.j.%j.error"
 set file_in          "test$test_id.input"
+set file_out_perc    "test$test_id.%%.output"
+set file_out_perc_result "test$test_id.%.output"
 set file_out_J       "test$test_id.J.%J.output"
 set file_out_n       "test$test_id.n.%n.output"
 set file_out_s       "test$test_id.s.%s.output"
@@ -169,6 +171,37 @@ if {[wait_for_file $file_err_j_glob] == 0} {
 	set exit_code 1
 }
 
+#
+# Spawn a shell via srun that includes literal percent sign (%) in stdout
+#  file name and confirm it is created
+#
+set job_id   0
+set srun_pid [spawn $srun --output=$file_out_perc -N1 -v -t1 $bin_printenv $node_name_env]
+expect {
+	-re "jobid ($number).*" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun not responding\n"
+		slow_kill $srun_pid
+		exit 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job initiation failed\n"
+	exit 1
+}
+if {[wait_for_file $file_out_perc_result] != 0} {
+	send_user "\nFAILURE: file format of %% in stdout failed\n"
+	set exit_code 1
+} else {
+	exec $bin_rm -f $file_out_perc_result
+}
+
 #
 # Spawn a shell via srun that includes "job_id.step_id" (%J) in stdout
 #  file name and confirm it is created
diff --git a/testsuite/expect/test1.30 b/testsuite/expect/test1.30
index ad4fa143b..e8801077b 100755
--- a/testsuite/expect/test1.30
+++ b/testsuite/expect/test1.30
@@ -44,9 +44,9 @@ if { [test_xcpu] } {
 }
 
 # NOTE: One CPU per task emulation is not scalable to do via srun
-# so we use "--share" as a no-op for this argument
+# so we use "--oversubscribe" as a no-op for this argument
 if { [test_bluegene] } {
-	set srun_opts "--share"
+	set srun_opts "--oversubscribe"
 } else {
 	set srun_opts "-c1"
 }
diff --git a/testsuite/expect/test1.31 b/testsuite/expect/test1.31
index 04d04d7f8..273ef23c3 100755
--- a/testsuite/expect/test1.31
+++ b/testsuite/expect/test1.31
@@ -39,6 +39,7 @@ set env_flag_debug   0
 set env_name_debug   "SLURM_DEBUG"
 set env_valu_debug   1
 set env_name_nnodes  "SLURM_NNODES"
+set file_in          "test$test_id.input"
 
 print_header $test_id
 
@@ -84,10 +85,12 @@ set env($env_name_stdout)  $env_valu_stdout
 set env($env_name_overcom) $env_valu_overcom
 exec $bin_rm -f $env_valu_stdout
 
+make_bash_script $file_in "env | $bin_grep MP_; env | $bin_grep SLURM_"
+
 #
 # Spawn a job via srun using these environment variables
 #
-set srun_pid [spawn $srun -t1 $bin_env]
+set srun_pid [spawn $srun -t1 ./$file_in]
 expect {
 	-re "jobid ($number)" {
 		set job_id $expect_out(1,string)
@@ -118,6 +121,7 @@ if {[wait_for_file $env_valu_stdout] != 0} {
 	exit 1
 }
 
+set stale_cnt     0
 set task_cnt      0
 set max_node_val -1
 spawn $bin_sort $env_valu_stdout
@@ -147,6 +151,10 @@ expect {
 		incr task_cnt
 		exp_continue
 	}
+	-re "Stale file handle" {
+		incr stale_cnt
+		exp_continue
+	}
 
 	timeout {
 		send_user "\nFAILURE: $bin_sort not responding\n"
@@ -158,6 +166,10 @@ expect {
 	}
 }
 
+if {$stale_cnt != 0} {
+	send_user "\nWARNING: Stale file handles $task_cnt for $stale_cnt tasks\n"
+	incr task_cnt $stale_cnt
+}
 if {$task_cnt != $env_valu_nprocs} {
 	send_user "\nFAILURE: did not process"
 	send_user " $env_name_nprocs environment variable"
@@ -184,7 +196,7 @@ if {$max_node_val > $max_nodes} {
 # Post processing
 #
 if {$exit_code == 0} {
-	exec $bin_rm -f $env_valu_stdout
+	exec $bin_rm -f $env_valu_stdout $file_in
 	send_user "\nSUCCESS\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test1.42 b/testsuite/expect/test1.42
index bc7c5f476..ce97bec94 100755
--- a/testsuite/expect/test1.42
+++ b/testsuite/expect/test1.42
@@ -80,7 +80,7 @@ if {$job_id1 == 0} {
 # Submit a dependent job
 #
 set match_job_state 0
-set srun_pid [spawn $srun --dependency=afterany:$job_id1 $scontrol show job $job_id1]
+set srun_pid [spawn $srun -t1 --dependency=afterany:$job_id1 $scontrol show job $job_id1]
 expect {
 	-re "JobState=COMPLETED|COMPLETING" {
 		set match_job_state 1
diff --git a/testsuite/expect/test1.47 b/testsuite/expect/test1.47
index f5d0f4bca..46def8dfc 100755
--- a/testsuite/expect/test1.47
+++ b/testsuite/expect/test1.47
@@ -80,7 +80,7 @@ if {$job_id1 == 0} {
 # Submit a dependent job
 #
 set matches 0
-set srun_pid [spawn $srun -v --dependency=singleton --job-name=$job_name $scontrol show job $job_id1]
+set srun_pid [spawn $srun -v --dependency=singleton --job-name=$job_name -t1 $scontrol show job $job_id1]
 expect {
 	-re "launching ($number).0" {
 		set job_id2 $expect_out(1,string)
diff --git a/testsuite/expect/test1.59 b/testsuite/expect/test1.59
index 9412e0698..edced0d7c 100755
--- a/testsuite/expect/test1.59
+++ b/testsuite/expect/test1.59
@@ -86,7 +86,7 @@ make_bash_script $file_in "
 "
 
 set timeout $max_job_delay
-set salloc_pid [spawn $salloc -N$num_nodes -v -t1 ./$file_in]
+set salloc_pid [spawn $salloc -N$num_nodes -v -t2 ./$file_in]
 expect {
 	-re "salloc: Granted job allocation ($number)" {
 		set job_id $expect_out(1,string)
@@ -416,6 +416,7 @@ expect {
 	}
 	timeout {
 		send_user "\nFAILURE: srun not responding\n"
+		cancel_job $job_id
 		kill_srun
 		exit 1
 	}
diff --git a/testsuite/expect/test1.69 b/testsuite/expect/test1.69
index f307062e8..ff32b8d3c 100755
--- a/testsuite/expect/test1.69
+++ b/testsuite/expect/test1.69
@@ -41,6 +41,8 @@ set exit_code   0
 print_header $test_id
 
 set select_type [test_select_type]
+set def_part_name [default_partition]
+set nb_nodes [get_node_cnt_in_part $def_part_name]
 if {![string compare $select_type "bluegene"]} {
 	send_user "\nWARNING: This test is incompatible with Bluegene systems\n"
 	exit $exit_code
@@ -48,16 +50,20 @@ if {![string compare $select_type "bluegene"]} {
 	send_user "\nWARNING: This test is incompatible with Cray/ALPS systems\n"
 	exit $exit_code
 } elseif {![string compare $select_type "linear"]} {
-	set def_part_name [default_partition]
-	set nb_nodes [get_node_cnt_in_part $def_part_name]
 	if {$nb_nodes < 2} {
 		send_user "\nWARNING: This test is incompatible with select/linear and only one node\n"
 		exit $exit_code
 	}
+} elseif {[default_part_exclusive]} {
+	if {$nb_nodes < 2} {
+		send_user "\nWARNING: This test is incompatible with exclusive node allocations and only one node\n"
+		exit $exit_code
+	}
 } elseif {[test_launch_poe]} {
 	send_user "\nWARNING: This test is incompatible with POE systems\n"
 	exit $exit_code
 }
+
 if {[test_select_type_params "Memory"]} {
 	set mem_opt "--mem=10"
 } else {
diff --git a/testsuite/expect/test1.74 b/testsuite/expect/test1.74
index d5863a8df..43ec18c74 100755
--- a/testsuite/expect/test1.74
+++ b/testsuite/expect/test1.74
@@ -207,7 +207,7 @@ if {[add_child $acct_c1 $acct_c2 [expr $node_cnt - 2] -1]} {
 	exit 1
 }
 
-############################# Test QoS Limits #################################
+send_user "############################# Test QoS Limits #################################\n"
 
 if {[mod_acct $acct [array get mod_acct_desc_vals] [array get mod_acct_vals] [array get mod_acct_assoc_vals]] != 0} {
 	send_user "\nFAILURE: account was not modified\n"
@@ -232,12 +232,19 @@ if {[mod_acct $acct [array get mod_acct_desc_vals] [array get mod_acct_vals] [ar
 	exit 1
 }
 srun_test [expr $node_cnt-1] $acct
+
+# Reset acct maxnodes
 set mod_acct_assoc_vals(maxnodes) -1
+if {[mod_acct $acct [array get mod_acct_desc_vals] [array get mod_acct_vals] [array get mod_acct_assoc_vals]] != 0} {
+	send_user "\nFAILURE: account was not modified\n"
+	cleanup
+	exit 1
+}
 
 # Now run test using GrpNode limits of qos
 set mod_qos_vals(GrpNodes) [expr $node_cnt - 1]
-
 mod_qos $qos [array get mod_qos_vals]
+sleep 1
 
 srun_test [expr $node_cnt-1] $acct
 
@@ -264,7 +271,7 @@ srun_test 1 $acct
 set mod_acct_assoc_vals(maxnodes) -1
 
 
-##################### Test limits based on associations #####################
+send_user "##################### Test limits based on associations #####################\n"
 
 #
 # MaxNodes Limit
diff --git a/testsuite/expect/test1.76 b/testsuite/expect/test1.76
index d8ec0bdf4..f5408b198 100755
--- a/testsuite/expect/test1.76
+++ b/testsuite/expect/test1.76
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ############################################################################
 # Purpose:  Test of route/topology plugin
 #
diff --git a/testsuite/expect/test1.76.bash b/testsuite/expect/test1.76.bash
index 4ae5dd97c..b52fb01c1 100755
--- a/testsuite/expect/test1.76.bash
+++ b/testsuite/expect/test1.76.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # It is assumed this script runs on cpu $1
 # 
diff --git a/testsuite/expect/test1.76.batch b/testsuite/expect/test1.76.batch
index bc1a8188c..1d94360f2 100755
--- a/testsuite/expect/test1.76.batch
+++ b/testsuite/expect/test1.76.batch
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # It is assumed this script runs on cpu $1
 # $2 is the --cpu-freq parameter
diff --git a/testsuite/expect/test1.77 b/testsuite/expect/test1.77
index 3ad56b353..433795296 100755
--- a/testsuite/expect/test1.77
+++ b/testsuite/expect/test1.77
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ################################################################################
 # Purpose: Test of SLURM functionality
 #          Sets the job name environment variable, and changes it using srun,
@@ -53,7 +53,7 @@ make_bash_script $file_in "
 # Tests -J by using srun
 #
 set found 0
-set srun_pid [spawn $srun -J $name $file_in]
+set srun_pid [spawn $srun -J $name -t1 $file_in]
 expect {
         "SLURM_JOB_NAME=$name" {
             set found 1
@@ -78,7 +78,7 @@ send_user "SUCCESS\n"
 # Tests -J using sbatch
 #
 set found 0
-set sbatch_pid [spawn $sbatch -J $name -o $file_out --wrap=env]
+set sbatch_pid [spawn $sbatch -J $name -t1 -o $file_out --wrap=env]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -106,7 +106,7 @@ expect {
 	}
 }
 
-if  {$found != 1} {
+if {$found != 1} {
 	send_user "\nFAILURE: COULD NOT FIND SLURM_JOB_NAME=banana\n"
 	exit 1
 }
@@ -120,7 +120,7 @@ exec rm -f slurm-$job_id.out
 # Tests -J using salloc
 #
 set found 0
-set salloc_pid [spawn $salloc -J $name ./$file_in]
+set salloc_pid [spawn $salloc -J $name -t1 ./$file_in]
 expect {
         "SLURM_JOB_NAME=$name" {
 		set found 1
diff --git a/testsuite/expect/test1.80 b/testsuite/expect/test1.80
index 04bc47e68..4c04dbde1 100755
--- a/testsuite/expect/test1.80
+++ b/testsuite/expect/test1.80
@@ -69,11 +69,7 @@ set tested_layout [list -1 -1 -1 -1]
 set timeout $max_job_delay
 set srun_pid [spawn $srun -O -N2 -n4 -l --distribution=block -t1 $bin_printenv $use_envvar]
 expect {
-	-re "More processors requested than permitted" {
-		send_user "\nWARNING: can't test srun task distribution\n"
-		exit 0
-	}
-	-re "Node count specification invalid" {
+	-re "srun: error" {
 		send_user "\nWARNING: can't test srun task distribution\n"
 		exit 0
 	}
diff --git a/testsuite/expect/test1.81 b/testsuite/expect/test1.81
index 198c180da..25f3ca5f7 100755
--- a/testsuite/expect/test1.81
+++ b/testsuite/expect/test1.81
@@ -244,7 +244,7 @@ set host_3      ""
 set timeout $max_job_delay
 set srun_pid [spawn $srun -N2-3 -l -t1 $bin_printenv $use_envvar]
 expect {
-	-re "Node count specification invalid" {
+	-re "srun: error" {
 		send_user "\nWARNING: can't test srun task distribution\n"
 		exit $exit_code
 	}
diff --git a/testsuite/expect/test1.83 b/testsuite/expect/test1.83
index 5cbd451bd..927403863 100755
--- a/testsuite/expect/test1.83
+++ b/testsuite/expect/test1.83
@@ -143,6 +143,11 @@ set host_0_num [get_suffix $host_0_name]
 set host_1_num [get_suffix $host_1_name]
 set host_2_num [get_suffix $host_2_name]
 
+if {$host_0_num == -1 || $host_1_num == -1 || $host_2_num == -1} {
+	send_user "\nWARNING: node names lack numeric suffix\n"
+	exit $exit_code
+}
+
 if {$host_1_num != [expr $host_0_num + 1]} {
 	send_user "\nFAILURE: node sequence number not contiguous\n"
 	set exit_code   1
diff --git a/testsuite/expect/test1.84 b/testsuite/expect/test1.84
index 0d909a5c3..e0faddc34 100755
--- a/testsuite/expect/test1.84
+++ b/testsuite/expect/test1.84
@@ -85,7 +85,7 @@ set def_part [default_partition]
 log_user 0
 set def_hostlist ""
 set part_exclusive 0
-set part_share_force 0
+set part_oversubscribe_force 0
 spawn $scontrol show part $def_part
 expect {
 	-re " Nodes=($alpha_numeric_nodelist)"  {
@@ -96,12 +96,12 @@ expect {
 		set def_hostlist $expect_out(1,string)
 		exp_continue
 	}
-	-re " Shared=EXCLUSIVE" {
+	-re " OverSubscribe=EXCLUSIVE" {
 		set part_exclusive 1
 		exp_continue
 	}
-	-re " Shared=FORCE" {
-		set part_share_force 1
+	-re " OverSubscribe=FORCE" {
+		set part_oversubscribe_force 1
 		exp_continue
 	}
 	timeout {
@@ -112,7 +112,7 @@ expect {
 		wait
 	}
 }
-if {$part_share_force != 0} {
+if {$part_oversubscribe_force != 0} {
 	send_user "\nWARNING: This test is incompatible with forced sharing of nodes\n"
 	exit 0
 }
@@ -189,7 +189,7 @@ if {$cpu_cnt != $task_cnt} {
 if {$cpu_cnt != $task_cnt} {
 	send_user "FAILURE: Should have run $cpu_cnt tasks (one per core) "
 	send_user "instead of $task_cnt tasks\n"
-	send_user "NOTE: This could be due to memory limit per allocated CPU or Shared=FORCE\n\n"
+	send_user "NOTE: This could be due to memory limit per allocated CPU, MaxCPUsPerNode, or OverSubscribe=FORCE\n\n"
 	set exit_code 1
 }
 if {$cpu_cnt < 2} {
@@ -228,7 +228,7 @@ expect {
 #
 if {$task_cnt != [expr $cpu_cnt / 2]} {
 	send_user "\nFAILURE: Improper task count for given cpus-per-task\n"
-	send_user "NOTE: This could be due to memory limit per allocated CPU or Shared=FORCE\n\n"
+	send_user "NOTE: This could be due to memory limit per allocated CPU or OverSubscribe=FORCE\n\n"
 	set exit_code   1
 }
 
diff --git a/testsuite/expect/test1.86 b/testsuite/expect/test1.86
index 2c243b166..9394bd897 100755
--- a/testsuite/expect/test1.86
+++ b/testsuite/expect/test1.86
@@ -80,7 +80,7 @@ set env(PATH) "${slurm_dir}/bin:$env(PATH)"
 set timeout $max_job_delay
 set salloc_pid [spawn $salloc -N2 -t1 ./$file_in]
 expect {
-	-re "Node count specification invalid|More processors requested" {
+	-re "salloc: error" {
 		send_user "\nWARNING: can't test srun task distribution\n"
 		exec $bin_rm -f $file_in
 		exit $exit_code
diff --git a/testsuite/expect/test1.87 b/testsuite/expect/test1.87
index 646303880..80430fab9 100755
--- a/testsuite/expect/test1.87
+++ b/testsuite/expect/test1.87
@@ -80,7 +80,7 @@ expect {
 		exec $bin_rm -f $file_in
 		exit $exit_code
 	}
-	-re "configuration not available" {
+	-re "configuration is not available" {
 		send_user "WARNING: partition too small for test\n"
 		slow_kill $srun_pid
 		exit 0
diff --git a/testsuite/expect/test1.89 b/testsuite/expect/test1.89
index abe101cc3..b80f7c8f6 100755
--- a/testsuite/expect/test1.89
+++ b/testsuite/expect/test1.89
@@ -58,7 +58,7 @@ set force 0
 log_user 0
 spawn $scontrol show partition [default_partition]
 expect {
-	-re "Shared=FORCE" {
+	-re "OverSubscribe=FORCE" {
 		set force 1
 		exp_continue
 	}
@@ -68,7 +68,7 @@ expect {
 }
 log_user 1
 if {$force == 1} {
-	send_user "\nWARNING: This test is not compatible with Shared=FORCE\n"
+	send_user "\nWARNING: This test is not compatible with OverSubscribe=FORCE\n"
 	exit 0
 }
 
@@ -579,6 +579,6 @@ if {$exit_code == 0} {
 } else {
 	send_user "\nNOTE: This test can fail if the node configuration in slurm.conf \n"
 	send_user "  (sockets, cores, threads) differs from the actual configuration \n"
-	send_user "  or if Shared=FORCE for the default partition.\n"
+	send_user "  or if OverSubscribe=FORCE for the default partition.\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test1.89.prog.c b/testsuite/expect/test1.89.prog.c
index 52682cf2b..cdfcbd9c0 100644
--- a/testsuite/expect/test1.89.prog.c
+++ b/testsuite/expect/test1.89.prog.c
@@ -29,12 +29,12 @@
 #define _GNU_SOURCE
 #define __USE_GNU
 #include <errno.h>
+#include <inttypes.h>
 #include <sched.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
 
 #include "config.h"
 
@@ -58,9 +58,10 @@ static void _load_mask(cpu_set_t *mask)
 static uint64_t _mask_to_int(cpu_set_t *mask)
 {
 	uint64_t i, rc = 0;
-	for (i=0; i<CPU_SETSIZE; i++) {
+
+	for (i = 0; i < CPU_SETSIZE; i++) {
 		if (CPU_ISSET(i, mask))
-			rc += (1 << i);
+			rc += (((uint64_t) 1) << i);
 	}
 	return rc;
 }
diff --git a/testsuite/expect/test1.90 b/testsuite/expect/test1.90
index 38f91869e..ccd32e989 100755
--- a/testsuite/expect/test1.90
+++ b/testsuite/expect/test1.90
@@ -71,7 +71,7 @@ log_user 0
 set force 0
 spawn $scontrol show partition [default_partition]
 expect {
-	-re "Shared=FORCE" {
+	-re "OverSubscribe=FORCE" {
 		set force 1
 		exp_continue
 	}
diff --git a/testsuite/expect/test1.90.prog.c b/testsuite/expect/test1.90.prog.c
index 27a63fd9a..8263e504b 100644
--- a/testsuite/expect/test1.90.prog.c
+++ b/testsuite/expect/test1.90.prog.c
@@ -27,7 +27,9 @@
  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
 \*****************************************************************************/
 #define _GNU_SOURCE
+#include <inttypes.h>
 #include <numa.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -54,17 +56,17 @@ static void _load_mem_mask(MY_MASK *mem_mask)
 	*mem_mask = numa_get_membind();
 }
 
-static unsigned long _mask_to_int(MY_MASK *mask)
+static uint64_t _mask_to_int(MY_MASK *mask)
 {
-	int i;
-	unsigned long rc = 0;
-	for (i=0; i<NUMA_NUM_NODES; i++) {
+	uint64_t i, rc = 0;
+
+	for (i = 0; i < NUMA_NUM_NODES; i++) {
 #if (LIBNUMA_API_VERSION > 1)
 		if (MY_TEST(*mask, i))
 #else
 		if (MY_TEST(mask, i))
 #endif
-			rc += (1 << i);
+			rc += (((uint64_t) 1) << i);
 	}
 	return rc;
 }
@@ -90,7 +92,7 @@ int main (int argc, char **argv)
 	task_id = atoi(task_str);
 	_load_cpu_mask(&cpu_mask);
 	_load_mem_mask(&mem_mask);
-	printf("TASK_ID:%d,CPU_MASK:%lu,MEM_MASK:%lu\n",
+	printf("TASK_ID:%d,CPU_MASK:%"PRIu64",MEM_MASK:%lu\n",
 		task_id, _mask_to_int(&cpu_mask), _mask_to_int(&mem_mask));
 	exit(0);
 }
diff --git a/testsuite/expect/test1.91 b/testsuite/expect/test1.91
index 6d4a445f8..ac59b82b6 100755
--- a/testsuite/expect/test1.91
+++ b/testsuite/expect/test1.91
@@ -65,7 +65,7 @@ set force 0
 log_user 0
 spawn $scontrol show partition [default_partition]
 expect {
-	-re "Shared=FORCE" {
+	-re "OverSubscribe=FORCE" {
 		set force 1
 		exp_continue
 	}
@@ -75,7 +75,7 @@ expect {
 }
 log_user 1
 if {$force == 1} {
-	send_user "\nWARNING: This test is not compatible with Shared=FORCE\n"
+	send_user "\nWARNING: This test is not compatible with OverSubscribe=FORCE\n"
 	exit 0
 }
 
@@ -130,6 +130,14 @@ if {$num_sockets == 0 || $num_cores == 0 || $num_threads == 0} {
 	send_user "\nWARNING: Could not determine number of Sockets:Cores:Threads (saw $num_sockets:$num_cores:$num_threads)\n"
 	exit 0
 }
+# Intel KNL nodes with 272 threads generate huge numeric masks
+# which are too large for expect integer values to manage
+set total_thread_count [expr $num_sockets * $num_cores * $num_threads]
+if {$total_thread_count > 64} {
+	send_user "\nWARNING: Total thread count too large for Expect to process ($total_thread_count > 64)\n"
+	send_user "WARNING: Expect unable to work with more than 32-bit numbers\n"
+	exit 0
+}
 send_user "Node config: Sockets=$num_sockets Cores=$num_cores Threads=$num_threads\n\n"
 
 #
diff --git a/testsuite/expect/test1.91.prog.c b/testsuite/expect/test1.91.prog.c
index 7c4182e6f..d62e8e2fb 100644
--- a/testsuite/expect/test1.91.prog.c
+++ b/testsuite/expect/test1.91.prog.c
@@ -29,12 +29,12 @@
 #define _GNU_SOURCE
 #define __USE_GNU
 #include <errno.h>
+#include <inttypes.h>
 #include <sched.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
-#include <inttypes.h>
 
 #include "config.h"
 
@@ -55,20 +55,62 @@ static void _load_mask(cpu_set_t *mask)
 	}
 }
 
+int val_to_char(int v)
+{
+	if (v >= 0 && v < 10)
+		return '0' + v;
+	else if (v >= 10 && v < 16)
+		return ('a' - 10) + v;
+	else
+		return -1;
+}
+
+static char *_cpuset_to_str(const cpu_set_t *mask, char *str, int size)
+{
+	int base, cnt;
+	char *ptr = str;
+	char *ret = NULL;
+
+	for (base = CPU_SETSIZE - 4; base >= 0; base -= 4) {
+		char val = 0;
+		if (++cnt >= size)
+			break;
+		if (CPU_ISSET(base, mask))
+			val |= 1;
+		if (CPU_ISSET(base + 1, mask))
+			val |= 2;
+		if (CPU_ISSET(base + 2, mask))
+			val |= 4;
+		if (CPU_ISSET(base + 3, mask))
+			val |= 8;
+		if (!ret && val)
+			ret = ptr;
+		*ptr++ = val_to_char(val);
+	}
+	*ptr = '\0';
+	return ret ? ret : ptr - 1;
+}
 
 static uint64_t _mask_to_int(cpu_set_t *mask)
 {
 	uint64_t i, rc = 0;
-	for (i=0; i<CPU_SETSIZE; i++) {
-		if (CPU_ISSET(i, mask))
-			rc += (1 << i);
+
+	for (i = 0; i < CPU_SETSIZE; i++) {
+		if (CPU_ISSET(i, mask)) {
+			if (i > 63) {
+				printf("OVERFLOW\n");
+				rc = 999999999;
+				break;
+			}
+			rc += (((uint64_t) 1) << i);
+		}
 	}
 	return rc;
 }
 
 int main (int argc, char **argv)
 {
-	char *task_str;
+	char mask_str[2048], *task_str;
 	cpu_set_t mask;
 	int task_id;
 
@@ -80,6 +122,10 @@ int main (int argc, char **argv)
 		exit(1);
 	}
 	task_id = atoi(task_str);
-	printf("TASK_ID:%d,MASK:%"PRIu64"\n", task_id, _mask_to_int(&mask));
+	/* NOTE: The uint64_t number is subject to overflow if there are
+	 * >64 CPUs on a compute node, but the hex value will be valid */
+	printf("TASK_ID:%d,MASK:%"PRIu64":0x%s\n", task_id,
+	       _mask_to_int(&mask),
+	       _cpuset_to_str(&mask, mask_str, sizeof(mask_str)));
 	exit(0);
 }
diff --git a/testsuite/expect/test1.97 b/testsuite/expect/test1.97
index d11f82c19..4b0022a3b 100755
--- a/testsuite/expect/test1.97
+++ b/testsuite/expect/test1.97
@@ -235,7 +235,7 @@ proc submit_cpu {ntasks ncpus} {
 		-re "job ($number)" {
 			exp_continue
 		}
-		-re "($number) ($alpha_numeric_nodelist)" {
+		-re "  ($number) ($alpha_numeric_nodelist)" {
 			set tasks($x) $expect_out(1,string)
 			set nodes($x) $expect_out(2,string)
 			incr x 1
@@ -271,7 +271,7 @@ proc submit_tasks {ntasks ntaskpn} {
 		-re "job ($number)" {
 			exp_continue
 		}
-		-re "($number) ($alpha_numeric_nodelist)" {
+		-re "   ($number) ($alpha_numeric_nodelist)" {
 			set tasks($x) $expect_out(1,string)
 			set nodes($x) $expect_out(2,string)
 			incr x 1
diff --git a/testsuite/expect/test12.2 b/testsuite/expect/test12.2
index 13bd7e2d6..0f4ca210f 100755
--- a/testsuite/expect/test12.2
+++ b/testsuite/expect/test12.2
@@ -38,7 +38,7 @@ set file_in     "test$test_id.input"
 set file_out    "test$test_id.output"
 set file_err    "test$test_id.error"
 set file_prog   "test$test_id.prog"
-set file_name   "test$test_id.filename"
+set file_name   "/tmp/test$test_id.filename"
 set job_id      0
 set matches     0
 set aix         0
@@ -330,7 +330,6 @@ if {[wait_for_job $job_id "DONE"] != 0} {
 #
 # Report basic sacct info
 #
-
 spawn $sacct --noheader -P --job=$job_id.$step_id --format jobid,jobname,state,exitcode
 expect {
 	-re "$job_id\.$step_id" {
@@ -345,6 +344,11 @@ expect {
 		incr matches
 		exp_continue
 	}
+	-re "COMPLETING" {
+		send_user "\nWARNING: Step in completing state rather than FAILED\n"
+		incr matches
+		exp_continue
+	}
 	-re "$ret_code" {
 		incr matches
 		exp_continue
diff --git a/testsuite/expect/test12.4 b/testsuite/expect/test12.4
index 52e67ad1c..ae87a0c11 100755
--- a/testsuite/expect/test12.4
+++ b/testsuite/expect/test12.4
@@ -34,7 +34,7 @@ source ./globals
 
 set test_id     "12.4"
 set exit_code   0
-set test_acct   "test_acct"
+set test_acct   "test$test_id\_acct"
 set timeout 60
 print_header $test_id
 
@@ -522,49 +522,6 @@ proc sacct_vargs { soption vargs job_id} {
 set using_slurmdbd [test_using_slurmdbd]
 
 set cluster [get_cluster_name]
-#
-# Identify the user and his current default account
-#
-set acct_name ""
-set user_name ""
-set user_gid ""
-spawn $bin_id -u -n
-expect {
-	 -re "($alpha_numeric_under)" {
-		set user_name $expect_out(1,string)
-		exp_continue
-	}
-	eof {
-		wait
-	}
-}
-
-spawn $bin_id -u
-expect {
-	 -re "($alpha_numeric_under)" {
-		set user_gid $expect_out(1,string)
-		exp_continue
-	}
-	eof {
-		wait
-	}
-}
-
-set s_pid [spawn $sacctmgr show user $user_name]
-expect {
-	-re "$user_name *($alpha_numeric_under)" {
-		set acct_name $expect_out(1,string)
-		exp_continue
-	}
-	timeout {
-		send_user "FAILURE: sacctmgr add not responding\n"
-		slow_kill $s_pid
-		exit 1
-	}
-	eof {
-		wait
-	}
-}
 
 #
 # Use sacctmgr to add an account
diff --git a/testsuite/expect/test12.7 b/testsuite/expect/test12.7
index c52aa674d..5317e9426 100755
--- a/testsuite/expect/test12.7
+++ b/testsuite/expect/test12.7
@@ -32,7 +32,6 @@
 source ./globals
 
 set test_id    12.7
-set exit_code  0
 set job_id     0
 set node       ""
 set file_in    "test$test_id\_sc"
@@ -46,18 +45,25 @@ if {![test_accting_steps]} {
 }
 if { [test_super_user] == 0 } {
 	send_user "WARNING: Test can only be run as SlurmUser\n"
+	exit 0
+}
+
+proc endit { exit_code msg } {
+	global job_id bin_rm file_in
+	cancel_job $job_id
+	exec $bin_rm $file_in
+	send_user "\n$msg\n"
 	exit $exit_code
 }
 
 proc mod_state { state reason } {
 
-	global scontrol node exit_code
+	global scontrol node
 
 	spawn $scontrol update nodename=$node state=$state reason=$reason
 	expect {
 		timeout {
-			send_user "\nFAILURE: scontrol is not responding\n"
-			set exit_code 1
+			endit 1 "FAILURE: scontrol is not responding"
 		}
 		eof {
 			wait
@@ -67,7 +73,7 @@ proc mod_state { state reason } {
 
 proc check_step { num } {
 
-	global sacct job_id exit_code
+	global sacct job_id
 	set steps 0
 	spawn $sacct --job=$job_id\.batch -D --start=today --noheader --format=jobid -P
 	expect {
@@ -77,8 +83,7 @@ proc check_step { num } {
 			exp_continue
 		}
 		timeout {
-			send_user "\nFAILURE: sacct is not responding\n"
-			set exit_code 1
+			endit 1 "FAILURE: sacct is not responding"
 		}
 		eof {
 			wait
@@ -87,9 +92,7 @@ proc check_step { num } {
 	}
 
 	if {$num != $steps} {
-		send_user "\nFAILURE: found $steps step(s) when expecting "
-		send_user "$num steps\n"
-		set exit_code 1
+		endit 1 "FAILURE: found $steps step(s) when expecting $num steps"
 	}
 }
 
@@ -113,8 +116,7 @@ proc check_sacct_states { states log_it } {
 			exp_continue
 		}
 		timeout {
-			send_user "\nFAILURE: sacct is not responding\n"
-			set exit_code 1
+			endit 1 "FAILURE: sacct is not responding"
 		}
 		eof {
 			wait
@@ -132,7 +134,7 @@ if {[test_using_slurmdbd] != 1} {
 
 make_bash_script $file_in "sleep 2"
 
-# Start a batch job to get a  usable node
+# Start a batch job to identify a usable node
 spawn $sbatch -t1 --exclusive -o/dev/null $file_in
 expect {
 	-re "Submitted batch job ($number)" {
@@ -140,14 +142,12 @@ expect {
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: sbatch is not responding\n"
-		set exit_code 1
+		endit 1 "FAILURE: sbatch is not responding"
 	}
 	eof {
 		wait
 	}
 }
-
 if {$job_id == 0} {
 	send_user "\nFAILURE: sbatch did not submit job\n"
 	exit 1
@@ -164,16 +164,14 @@ expect {
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: scontrol is not responding\n"
-		set exit_code 1
+		endit 1 "FAILURE: scontrol is not responding"
 	}
 	eof {
 		wait
 	}
 }
-
 if {$found != 1} {
-	send_user "\nFAILURE: was not able to get usable node\n"
+	send_user "\nFAILURE: was not able to identify a usable node\n"
 	exit 1
 }
 
@@ -182,6 +180,7 @@ cancel_job $job_id
 make_bash_script $file_in "sleep 20"
 
 # Submit job to be requeued
+send_user "\n\nTest 1\n"
 set job_id 0
 spawn $sbatch -N1 -w$node --exclusive -o/dev/null --requeue $file_in
 expect {
@@ -190,8 +189,7 @@ expect {
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: sbatch is not responding\n"
-		set exit_code 1
+		endit 1 "FAILURE: sbatch is not responding"
 	}
 	eof {
 		wait
@@ -204,6 +202,8 @@ if {$job_id == 0} {
 }
 
 wait_for_job $job_id RUNNING
+# Wait for batch script to start (after message delays, prologs, etc.)
+sleep 5
 
 # Set the node that the job is running on to down
 mod_state "down" "test$test_id"
@@ -214,51 +214,41 @@ sleep 5
 # Set the node back to resume
 mod_state "resume" "test$test_id"
 
-# Check the number of steps
-check_step 0
 
 # Check the job state
-send_user "\n\nTest 1\n"
+send_user "\n\nTest 2\n"
 wait_for_job $job_id PENDING
 set fail_count [check_sacct_states "NODE_FAIL" 1]
 if {$fail_count != 1} {
-	send_user "\nFAILURE: Bad NODE_FAIL count ($fail_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad NODE_FAIL count ($fail_count != 1)"
 }
 set pend_count [check_sacct_states "PENDING" 0]
 if {$pend_count != 1} {
-	send_user "\nFAILURE: Bad PENDING count ($pend_count != 1)\n"
-	set exit_code 1
-}
-if {$exit_code == 0} {
-	send_user "So far, so good\n\n"
+	endit 1 "FAILURE: Bad PENDING count ($pend_count != 1)"
 }
+send_user "So far, so good\n\n"
 
 wait_for_job $job_id RUNNING
+# Wait for batch script to start (after message delays, prologs, etc.)
+sleep 5
 
-# Check the number of steps after job is running
-check_step 0
-send_user "\n\nTest 2\n"
+
+send_user "\n\nTest 3\n"
 set fail_count [check_sacct_states "NODE_FAIL" 1]
 if {$fail_count != 1} {
-	send_user "\nFAILURE: Bad NODE_FAIL count ($fail_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad NODE_FAIL count ($fail_count != 1)"
 }
 set run_count [check_sacct_states "RUNNING" 0]
 if {$run_count != 1} {
-	send_user "\nFAILURE: Bad RUNNING count ($run_count != 1)\n"
-	set exit_code 1
-}
-if {$exit_code == 0} {
-	send_user "So far, so good\n\n"
+	endit 1 "FAILURE: Bad RUNNING count ($run_count != 1)"
 }
+send_user "So far, so good\n\n"
 
 # Requeue the job
 spawn $scontrol requeue $job_id
 expect {
 	timeout {
-		send_user "\nFAILURE: scontrol is not responding\n"
-		set exit_code 1
+		endit 1 "FAILURE: scontrol is not responding"
 	}
 	eof {
 		wait
@@ -267,93 +257,72 @@ expect {
 
 # Wait a bit for the job to be requeued then check its state
 sleep 8
-send_user "\n\nTest 3\n"
+send_user "\n\nTest 4\n"
 set fail_count [check_sacct_states "NODE_FAIL" 1]
 if {$fail_count != 1} {
-	send_user "\nFAILURE: Bad NODE_FAIL count ($fail_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad NODE_FAIL count ($fail_count != 1)"
 }
 set req_count [check_sacct_states "REQUEUE" 0]
 if {$req_count != 1} {
-	send_user "\nFAILURE: Bad REQUEUE count ($req_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad REQUEUE count ($req_count != 1)"
 }
 set canc_count [check_sacct_states "CANCELLED" 0]
 if {$canc_count != 1} {
-	send_user "\nFAILURE: Bad CANCELLED count ($canc_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad CANCELLED count ($canc_count != 1)"
 }
 set pend_count [check_sacct_states "PENDING" 0]
 if {$pend_count != 1} {
-	send_user "\nFAILURE: Bad PENDING count ($pend_count != 1)\n"
-	set exit_code 1
-}
-if {$exit_code == 0} {
-	send_user "So far, so good\n\n"
+	endit 1 "FAILURE: Bad PENDING count ($pend_count != 1)"
 }
+send_user "So far, so good\n\n"
 
 wait_for_job $job_id RUNNING
+# Wait for batch script to start (after message delays, prologs, etc.)
+sleep 5
 
 # Check for steps after requeue
 check_step 1
-send_user "\n\nTest 4\n"
+
+
+send_user "\n\nTest 5\n"
 set fail_count [check_sacct_states "NODE_FAIL" 1]
 if {$fail_count != 1} {
-	send_user "\nFAILURE: Bad NODE_FAIL count ($fail_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad NODE_FAIL count ($fail_count != 1)"
 }
 set req_count [check_sacct_states "REQUEUE" 0]
 if {$req_count != 1} {
-	send_user "\nFAILURE: Bad REQUEUE count ($req_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad REQUEUE count ($req_count != 1)"
 }
 set canc_count [check_sacct_states "CANCELLED" 0]
 if {$canc_count != 1} {
-	send_user "\nFAILURE: Bad CANCELLED count ($canc_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad CANCELLED count ($canc_count != 1)"
 }
 set run_count [check_sacct_states "RUNNING" 0]
 if {$run_count != 1} {
-	send_user "\nFAILURE: Bad RUNNING count ($run_count != 1)\n"
-	set exit_code 1
-}
-if {$exit_code == 0} {
-	send_user "So far, so good\n\n"
+	endit 1 "FAILURE: Bad RUNNING count ($run_count != 1)"
 }
+send_user "So far, so good\n\n"
 
 wait_for_job $job_id DONE
 
 # Check steps after job has completed
 check_step 2
-send_user "\n\nTest 5\n"
+send_user "\n\nTest 6\n"
 set fail_count [check_sacct_states "NODE_FAIL" 1]
 if {$fail_count != 1} {
-	send_user "\nFAILURE: Bad NODE_FAIL count ($fail_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad NODE_FAIL count ($fail_count != 1)"
 }
 set req_count [check_sacct_states "REQUEUE" 0]
 if {$req_count != 1} {
-	send_user "\nFAILURE: Bad REQUEUE count ($req_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad REQUEUE count ($req_count != 1)"
 }
 set canc_count [check_sacct_states "CANCELLED" 0]
 if {$canc_count != 1} {
-	send_user "\nFAILURE: Bad CANCELLED count ($canc_count != 1)\n"
-	set exit_code 1
+	endit 1 "FAILURE: Bad CANCELLED count ($canc_count != 1)"
 }
 set comp_count [check_sacct_states "COMPLETED" 0]
 if {$comp_count != 2} {
-	send_user "\nFAILURE: Bad COMPLETED count ($comp_count != 2)\n"
-	set exit_code 1
-}
-if {$exit_code == 0} {
-	send_user "So far, so good\n\n"
+	endit 1 "FAILURE: Bad COMPLETED count ($comp_count != 2)"
 }
 
-cancel_job $job_id
-
-if {$exit_code == 0} {
-	exec $bin_rm $file_in
-	send_user "\nSUCCESS\n"
-}
-exit $exit_code
+endit 0 "SUCCESS"
diff --git a/testsuite/expect/test12.8 b/testsuite/expect/test12.8
index 452c7d438..f867c11bb 100755
--- a/testsuite/expect/test12.8
+++ b/testsuite/expect/test12.8
@@ -96,11 +96,19 @@ expect {
 	}
 }
 
-if {$failed_cnt != 2 && $timeout_cnt != 1} {
+if {$failed_cnt != 2 || $timeout_cnt != 1} {
 	send_user "\nFAILURE: batch job $job_id did not FAIL and/or the step "
-	send_user "did not TIMEOUT.  Count for FAILED was $failed_cnt and "
-	send_user "TIMEOUT was $timeout_cnt\n"
+	send_user "did not TIMEOUT.  Count for FAILED was $failed_cnt (not 2) and "
+	send_user "TIMEOUT was $timeout_cnt (not 1)\n"
 	set exit_code 1
+
+	send_user "\nGathering more job information:\n"
+	spawn $sacct --jobs=$job_id
+	expect {
+		eof {
+			wait
+		}
+	}
 }
 
 if {$exit_code == 0} {
diff --git a/testsuite/expect/test13.1 b/testsuite/expect/test13.1
index 46a45f8c4..8cd7513ed 100755
--- a/testsuite/expect/test13.1
+++ b/testsuite/expect/test13.1
@@ -55,20 +55,6 @@ log_user 0
 set step_delay 0
 spawn $scontrol show config
 expect {
-	-re "switch/elan" {
-		set windows_per_node 2048
-		set windows_iterations 50
-		set windows_used 48
-		set step_delay 10
-		exp_continue
-	}
-	-re "switch/federation" {
-		set windows_per_node 16
-		set windows_iterations 32
-		set windows_used 2
-		set step_delay 10
-		exp_continue
-	}
 	-re "switch/none" {
 		set windows_per_node 0
 		set windows_iterations 5
diff --git a/testsuite/expect/test14.10 b/testsuite/expect/test14.10
index a0b662c1a..9d117ae90 100755
--- a/testsuite/expect/test14.10
+++ b/testsuite/expect/test14.10
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
 #          Validate sbcast for a job step allocation (subset of job allocation).
@@ -85,10 +85,10 @@ $srun $bin_rm -fr /tmp/$node1
 $srun $bin_rm -f /tmp/$node2/test$test_id\_file
 $srun $bin_rm -fr /tmp/$node2
 
-$srun -w$node1 mkdir /tmp/$node1
-$srun -w$node2 mkdir /tmp/$node2
+$srun -N1 -n1 -w$node1 mkdir /tmp/$node1
+$srun -N1 -n1 -w$node2 mkdir /tmp/$node2
 
-$srun -N1 -n1 -r1 ./$file_in2
+$srun -N1 -n1 -w$node2 ./$file_in2
 
 echo -n \"Checking node 1: \"
 $srun -N1 -n1 -w$node2 ls /tmp/$node2/test$test_id\_file
diff --git a/testsuite/expect/test15.19 b/testsuite/expect/test15.19
index 95b4377cb..84e5a25d7 100755
--- a/testsuite/expect/test15.19
+++ b/testsuite/expect/test15.19
@@ -279,7 +279,7 @@ expect {
 		set job_id $expect_out(1,string)
 		exp_continue
 	}
-	-re "More processors requested than permitted|Node count specification invalid|configuration not available" {
+	-re "salloc: error" {
 		send_user "\nWARNING: can't test salloc task distribution\n"
 		if {$job_id != 0} {
 			cancel_job $job_id
diff --git a/testsuite/expect/test15.30 b/testsuite/expect/test15.30
new file mode 100755
index 000000000..cf50a5a7b
--- /dev/null
+++ b/testsuite/expect/test15.30
@@ -0,0 +1,68 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.30"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a job that deadline is too late
+#
+set timeout $max_job_delay
+set salloc_pid 0
+set salloc_pid [spawn $salloc -N1 --deadline 2015-03-27T04:30:00 -t1 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Granted job allocation " {
+		send_user "\nFAILURE: salloc is OK with a deadline too old\n"
+		set exit_code 1
+		exit 1
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.31 b/testsuite/expect/test15.31
new file mode 100755
index 000000000..254968e0e
--- /dev/null
+++ b/testsuite/expect/test15.31
@@ -0,0 +1,88 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too short
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.31"
+set job_id	0
+set exit_code   0
+
+print_header $test_id
+
+#
+# Spawn a job that deadline is too short
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc -N1 --deadline now+1hour -t120 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id != 0} {
+	spawn $scontrol show job $job_id
+	expect {
+		-re "TimeLimit=00:59" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=01:00:00" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=" {
+			send_user "\nFAILURE : Timelimit not OK with deadline\n"
+			set exit_code 1
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.32 b/testsuite/expect/test15.32
new file mode 100755
index 000000000..21a0a1b2f
--- /dev/null
+++ b/testsuite/expect/test15.32
@@ -0,0 +1,279 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time limit partition
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id        "15.32"
+set file_in        "test$test_id.bash"
+set test_salloc    "test$test_id.test_salloc"
+set job_id         0
+set authorized     1
+set exit_code      0
+set part_name      "QA_TEST"
+
+
+print_header $test_id
+
+if {[test_super_user] == 0} {
+	send_user "\nWARNING: can not test more unless SlurmUser or root\n"
+	exit $exit_code
+}
+
+#
+# Confirm the partition name does not already exist
+#
+set found -1
+spawn $scontrol -a show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == -1} {
+	send_user "\nFAILURE: scontrol output format error\n"
+	exit 1
+}
+if {$found == 1} {
+	send_user "\nFAILURE: partition $part_name already exists\n"
+	exit 1
+}
+
+#
+# Identify usable nodes in default partition
+#
+set def_node [get_idle_node_in_part [default_partition]]
+if {[string compare $def_node ""] == 0} {
+	send_user "\nFAILURE: default partition seems to have no nodes\n"
+	exit 1
+}
+
+#
+# Create a new partition
+#
+spawn $scontrol create PartitionName=$part_name Nodes=$def_node MaxTime=30
+expect {
+	-re "error" {
+		send_user "\nFAILURE: something bad happened on partition create\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition now exists
+#
+set allow  0
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 1} {
+	send_user "\nFAILURE: partition not created\n"
+	exit 1
+}
+
+set found 0
+
+# Check EnforcePartLimits value
+set enforcepartlimits [test_enforce_part_limits]
+send_user "\nEnforcePartLimits=$enforcepartlimits\n\n"
+
+#
+# Run a job in this new partition and validate the time limit
+#
+make_bash_script $test_salloc "
+set -m
+$salloc --no-shell -N1 --deadline now+1hour -p $part_name -t100 $bin_sleep 1 &
+"
+
+make_bash_script $file_in "
+bash -i ./$test_salloc
+"
+
+set timeout $max_job_delay
+spawn bash -i $file_in
+if {[string compare $enforcepartlimits "NO"] == 0} {
+	expect {
+		-re "Pending job allocation ($number)" {
+			set job_id $expect_out(1,string)
+			set exit_code 0
+		}
+
+		timeout {
+			send_user "\nFAILURE: salloc not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+
+	#
+	# verify time limit. Add a temporization to wait for update reason
+	#
+	if {$job_id == 0} {
+		send_user "\nFAILURE: job_id = 0 : salloc not OK \n"
+		set exit_code 1
+	} else {
+		set cycle_count 8
+		for {set inx 0} {$inx < $cycle_count} {incr inx} {
+			spawn $scontrol show job $job_id
+			expect {
+				-re "Reason=PartitionTimeLimit" {
+					set exit_code 0
+					break
+				}
+				-re "Reason=" {
+					set exit_code 1
+					sleep 5
+					exp_continue
+				}
+				timeout {
+					send_user "\nFAILURE: scontrol not responding\n"
+					set exit_code 1
+					exp_continue
+				}
+				eof {
+					wait
+				}
+			}
+		}
+		if {$exit_code == 1} {
+			send_user "\nFAILURE: partition time limit not used\n"
+			set exit_code 1
+		}
+		cancel_job $job_id
+	}
+} else {
+	#
+        # Job should be rejected at submit time
+        #
+        expect {
+                -re "Requested time limit is invalid (missing or exceeds some limit)" {
+                        set exit_code 0
+                        exp_continue
+                }
+                -re "unrecognized option '--deadline'" {
+                        set exit_code 1
+                        exp_continue
+                }
+                timeout {
+                        send_user "\nFAILURE: salloc not responding\n"
+                        set exit_code 1
+                }
+                eof {
+                        wait
+                }
+        }
+}
+
+#
+# Now delete the partition
+#
+spawn $scontrol delete PartitionName=$part_name
+expect {
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition is now gone
+#
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 0} {
+	send_user "\nFAILURE: partition not deleted\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm $test_salloc $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.33 b/testsuite/expect/test15.33
new file mode 100755
index 000000000..36ad0e921
--- /dev/null
+++ b/testsuite/expect/test15.33
@@ -0,0 +1,104 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and no time
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.33"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+set part_name [default_partition]
+set default_time [get_partition_default_time_limit $part_name]
+if { $default_time != -1} {
+	send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
+	exit $exit_code
+}
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc -N1 --deadline now+600 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted\n"
+	exit 1
+}
+
+if {$job_id != 0} {
+	spawn $scontrol show job $job_id
+	expect {
+		-re "TimeLimit=00:10:00" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=00:09:" {
+			send_user "\nTimelimit OK\n"
+		}
+		-re "TimeLimit=" {
+			send_user "\nFAILURE : Timelimit not OK with deadline\n"
+			set exit_code 1
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.34 b/testsuite/expect/test15.34
new file mode 100755
index 000000000..85b557cab
--- /dev/null
+++ b/testsuite/expect/test15.34
@@ -0,0 +1,72 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.34"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc -N1 --deadline now+1hour --time-min 120 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id != 0} {
+	send_user "\nFAILURE: batch submitted despite the deadline\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.35 b/testsuite/expect/test15.35
new file mode 100755
index 000000000..c048b302a
--- /dev/null
+++ b/testsuite/expect/test15.35
@@ -0,0 +1,96 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min and time too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.35"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc -N1 --deadline now+1hour --time-min 20 -t120 $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		send_user "FAILURE: This can be due to QOS or account time limit <120 minutes\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted\n"
+	exit 1
+}
+
+#
+# verify time limit
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=01:00:00" {
+		exp_continue
+	}
+	-re "TimeLimit=00:59:" {
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: time limit is different from deadline\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.36 b/testsuite/expect/test15.36
new file mode 100755
index 000000000..20017d53d
--- /dev/null
+++ b/testsuite/expect/test15.36
@@ -0,0 +1,77 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and --begin option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.36"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc -N1 --begin now+2hour --deadline now+1hour $bin_sleep 1]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id != 0} {
+	send_user "\nFAILURE: job submitted with a deadline too short\n"
+	cancel_job $job_id
+	exit 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.37 b/testsuite/expect/test15.37
new file mode 100755
index 000000000..7d21d372a
--- /dev/null
+++ b/testsuite/expect/test15.37
@@ -0,0 +1,157 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and --time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This fie is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.37"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout [expr $max_job_delay + 60]
+set salloc_pid [spawn $salloc --begin now+60 --deadline now+600 --time-min 10 $bin_sleep 1 ]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Job allocation ($number) has been revoked" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	-re "job ($number) queued and waiting for resources" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	-re "Pending job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted with a deadline too short\n"
+	exit 1
+}
+
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+#
+# test job status in scontrol and sacct
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "JobState=DEADLINE" {
+		exp_continue
+	}
+	-re "JobState=($alpha)" {
+		set current_state $expect_out(1,string)
+		send_user "\nFAILURE: invalid job state ($current_state != DEADLINE)\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+set cycle_count 8
+set not_support 0
+for {set inx 0} {$inx < $cycle_count} {incr inx} {
+	spawn $sacct  -n -P -X -j $job_id -o State
+	expect {
+		-re "SLURM accounting storage is disabled" {
+			set not_support 1
+			break
+		}
+		-re "DEADLINE" {
+			set exit_code 0
+			break
+		}
+		-re "COMPLETED" {
+			send_user "\nFAILURE: batch submitted with a deadline too short\n"
+			set exit_code 1
+			break
+		}
+		-re "PENDING" {
+			set exit_code 1
+			exp_continue
+		}
+		-re "CANCELLED by ($number)" {
+			send_user "\nFAILURE: batch killed by timeout before start\n"
+			set exit_code 1
+			break
+		}
+		timeout {
+			send_user "\nFAILURE: sacct not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+	sleep 5
+}
+
+if {$not_support != 0} {
+	send_user "\nWARNING: can not test without accounting enabled\n"
+	exit $exit_code
+}
+if {$exit_code == 1} {
+	send_user "\nFAILURE: batch submitted with a deadline too short\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test15.38 b/testsuite/expect/test15.38
new file mode 100755
index 000000000..fd389ef00
--- /dev/null
+++ b/testsuite/expect/test15.38
@@ -0,0 +1,135 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and --time_min OK
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "15.38"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+set salloc_pid [spawn $salloc --begin now+1 --deadline now+600 --time-min 5 $bin_sleep 1 ]
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Pending job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	-re "Granted job allocation ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: salloc not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job not submitted with a deadline and a time-min OK\n"
+	exit 1
+}
+
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+#
+# test job status in scontrol and sacct
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "JobState=COMPLETED" {
+		exp_continue
+	}
+	-re "JobState=" {
+		send_user "\nFAILURE: invalid job state\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+set not_support 0
+spawn $sacct  -n -P -X -j $job_id -o State
+expect {
+	-re "SLURM accounting storage is disabled" {
+		set not_support 1
+		exp_continue
+	}
+	-re "DEADLINE" {
+		send_user "\nFAILURE: job not submitted with a deadline and a time-min OK\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacct not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$not_support != 0} {
+	send_user "\nWARNING: can not test without accounting enabled\n"
+	exit 0
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.11 b/testsuite/expect/test17.11
index 6d451d791..8f20936bd 100755
--- a/testsuite/expect/test17.11
+++ b/testsuite/expect/test17.11
@@ -1,8 +1,7 @@
 #!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Test of shared and contiguous options (--shared and --contiguous).
-#          Also uses --hold option.
+#          Test of oversubscribe and contiguous options, also uses --hold option.
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
@@ -47,8 +46,8 @@ if {[test_alps]} {
 }
 
 set def_part [default_partition]
-set shared [partition_shared $def_part]
-if {[string compare $shared "FORCE"] == 0} {
+set oversubscribe [partition_oversubscribe $def_part]
+if {[string compare $oversubscribe "FORCE"] == 0} {
 	set force_part 1
 }
 
@@ -62,9 +61,9 @@ make_bash_script $file_in "
 "
 
 #
-# Spawn a sbatch job with shared option only
+# Spawn a sbatch job with oversubscribe option only
 #
-spawn $sbatch --share --hold -t1 $file_in
+spawn $sbatch --oversubscribe --hold -t1 $file_in
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -81,17 +80,14 @@ expect {
 }
 
 #
-# Confirm shared and contiguous flag values
+# Confirm oversubscribe and contiguous flag values
 #
 set matches 0
 if {$job_id != 0} {
 	spawn $scontrol show job $job_id
 	expect {
-		-re "Shared=($number)" {
-			set shared_val $expect_out(1,string)
-			if {$shared_val == 1} {
-				incr matches
-			}
+		-re "OverSubscribe=YES" {
+			incr matches
 			exp_continue
 		}
 		-re "Contiguous=($number)" {
@@ -117,7 +113,7 @@ if {$job_id != 0} {
 	set exit_code   1
 }
 if {$matches != 2} {
-	send_user "\nFAILURE: Did not properly set shared and contiguous flag ($matches != 2)\n"
+	send_user "\nFAILURE: Did not properly set oversubscribe and contiguous flag ($matches != 2)\n"
 	set exit_code   1
 }
 
@@ -141,19 +137,19 @@ expect {
 }
 
 #
-# Confirm shared and contiguous flag values
+# Confirm oversubscribe and contiguous flag values
 #
-set match_share 0
+set match_oversubscribe 0
 set match_cont  0
 if {$job_id != 0} {
 	spawn $scontrol show job $job_id
 	expect {
-		-re "Shared=0" {
-			set match_share 1
+		-re "OverSubscribe=NO" {
+			set match_oversubscribe 1
 			exp_continue
 		}
-		-re "Shared=OK" {
-			set match_share 1
+		-re "OverSubscribe=OK" {
+			set match_oversubscribe 1
 			exp_continue
 		}
 		-re "Contiguous=($number)" {
@@ -181,8 +177,8 @@ if {$match_cont != 1} {
 	send_user "\nFAILURE: Did not properly set contiguous flag\n"
 	set exit_code 1
 }
-if {$force_part == 0 && $match_share != 1} {
-	send_user "\nFAILURE: Did not properly set shared flag\n"
+if {$force_part == 0 && $match_oversubscribe != 1} {
+	send_user "\nFAILURE: Did not properly set oversubscribe flag\n"
 	set exit_code 1
 }
 
diff --git a/testsuite/expect/test17.12 b/testsuite/expect/test17.12
index 867f6725b..973feba9e 100755
--- a/testsuite/expect/test17.12
+++ b/testsuite/expect/test17.12
@@ -36,6 +36,11 @@ source ./globals
 set test_id     "17.12"
 set exit_code   0
 set file_in     "test$test_id.input"
+set test_part   "test$test_id\_part"
+set feat1       "test$test_id\_gpu"
+set feat2       "test$test_id\_mic"
+array set nodes {}
+array set def_node_feat {}
 
 print_header $test_id
 
@@ -45,13 +50,208 @@ if {[test_wiki_sched] == 1} {
 	exit $exit_code
 }
 
+proc check_job {nnode test_job} {
+	global exit_code sbatch test_part file_in bin_sleep
+	global feat1 feat2 number scontrol alpha_numeric_nodelist bin_bash
+	global bin_grep
+
+	set nodelist ""
+
+	wait_for_job $test_job "RUNNING"
+
+	# Check that job that the job used the correct nodes
+	spawn $scontrol show job $test_job
+	expect {
+		-re " NodeList=($alpha_numeric_nodelist)" {
+			set nodelist $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code
+		}
+		eof {
+			wait
+		}
+	}
+
+	set node_cnt 0
+	spawn $bin_bash -c "$scontrol show node $nodelist | $bin_grep AvailableFeatures"
+	expect {
+		-re "AvailableFeatures=$feat1|$feat2" {
+			incr node_cnt
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$node_cnt != $nnode} {
+		send_user "\nFAILURE: sbatch constraint option failed to "
+		send_user "get the correct nodes $node_cnt != $nnode\n"
+		set exit_code 1
+	}
+
+	cancel_job $test_job
+}
+
+proc sub_job_or {nnode fail_test} {
+	global exit_code sbatch test_part file_in bin_sleep
+	global feat1 feat2 number scontrol alpha_numeric_nodelist bin_bash
+	global bin_grep
+
+	set test_job 0
+	set fail_node_config 0
+
+	if {$fail_test} {
+		spawn $sbatch -C "$feat1|$feat2" -p$test_part -N$nnode $file_in
+		expect {
+			-re "Requested node configuration is not available" {
+				set fail_node_config 1
+				exp_continue
+			}
+			timeout {
+				send_user "\nFAILURE: sbatch is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
+		}
+
+		if {$fail_node_config == $fail_test} {
+			send_user "\nThis error is expected do not worry\n"
+		}
+	} else {
+		spawn $sbatch -C "$feat1|$feat2" -p$test_part -N$nnode $file_in
+		expect {
+			-re "Submitted batch job ($number)" {
+				set test_job $expect_out(1,string)
+				exp_continue
+			}
+			timeout {
+				send_user "\nFAILURE: sbatch is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
+		}
+
+		# Check that nodes have the correct features
+		if {$test_job != 0} {
+			check_job $nnode $test_job
+		}
+	}
+}
+
+proc sub_job_xor {nnode fail_test} {
+	global exit_code sbatch test_part file_in bin_sleep
+	global feat1 feat2 number scontrol alpha_numeric_nodelist bin_bash
+	global bin_grep
+
+	set test_job 0
+	set fail_node_config 0
+
+	if {$fail_test} {
+		spawn $sbatch -C "\[$feat1|$feat2\]" -p$test_part -N$nnode $file_in
+		expect {
+			-re "Requested node configuration is not available" {
+				set fail_node_config 1
+				exp_continue
+			}
+			timeout {
+				send_user "\nFAILURE: sbatch is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
+		}
+
+		if {$fail_node_config == $fail_test} {
+			send_user "\nThis error is expected do not worry\n"
+		}
+	} else {
+		spawn $sbatch -C "\[$feat1|$feat2\]" -p$test_part -N$nnode $file_in
+		expect {
+			-re "Submitted batch job ($number)" {
+				set test_job $expect_out(1,string)
+				exp_continue
+			}
+			timeout {
+				send_user "\nFAILURE: sbatch is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
+		}
+
+		# Check that nodes have the correct features
+		if {$test_job != 0} {
+			check_job $nnode $test_job
+		}
+	}
+}
+
+proc set_node_feature {node_name new_feature} {
+	global scontrol exit_code
+
+	spawn $scontrol update node=$node_name AvailableFeatures=$new_feature
+	expect {
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+proc clean_up {} {
+	global test_part scontrol def_node_feat nodes exit_code
+
+	spawn $scontrol delete partition=$test_part
+	expect {
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	# Reset nodes back to normal
+	foreach option [array names nodes] {
+		set node $nodes($option)
+		spawn $scontrol update node=$node AvailableFeatures=$def_node_feat($node)
+		expect {
+			timeout {
+				send_user "\nFAILURE: scontrol is not responding\n"
+				set exit_code 1
+			}
+			eof {
+				wait
+			}
+		}
+	}
+}
+
 #
 # Delete left-over input script
 # Build input script file
 #
 exec $bin_rm -f $file_in
 make_bash_script $file_in "
-  $bin_sleep 10
+  $bin_sleep 2
 "
 
 #
@@ -86,8 +286,144 @@ if {$err_msg != 1} {
 	set exit_code   1
 }
 
+# Must be root and no NodeFeaturesPlugin to proceed */
+if {[test_super_user] == 0 || [string compare [test_node_features_plugin] ""]} {
+	send_user "\nWARNING: Configuration not compatible with additional tests\n"
+	exit $exit_code
+}
+
+# Run job to get available nodes
+log_user 0
+set job_id 0
+set srun_pid [spawn $srun -N1-4 -t1 -l printenv SLURM_JOB_ID]
+expect {
+	-re "\[0-3\]: ($number)" {
+#		set nodes($i) $expect_out(1,string)
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: srun is not responding\n"
+		slow_kill $srun_pid
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	log_user 1
+	send_user "\nFAILURE: Job submission failed\n"
+	exit 1
+}
+
+set nodelist ""
+spawn $scontrol show job $job_id
+expect {
+	-re " NodeList=($alpha_numeric_nodelist)" {
+		set nodelist $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+set i 0
+spawn $scontrol show hostnames $nodelist
+expect {
+	-re "($alpha_numeric_under)" {
+		set nodes($i) $expect_out(1,string)
+		incr i
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+log_user 1
+if {$i != 4} {
+	send_user "\nWARNING: There are not enough nodes to run the remaining tests ($i != 4)\n"
+	exit $exit_code
+}
+
+set node_save 0
+foreach option [array names nodes] {
+	# Save the original features that are on the node.
+	log_user 0
+	set node $nodes($option)
+	set def_node_feat($node) ""
+	spawn $bin_bash -c "$scontrol show node $node | $bin_grep Features"
+	expect {
+		-re "AvailableFeatures=($alpha_numeric_comma)" {
+			set def_node_feat($node) $expect_out(1,string)
+			incr node_save
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+}
+
+set_node_feature $nodes(0) $feat1
+set_node_feature $nodes(1) $feat2
+set_node_feature $nodes(2) $feat1
+set_node_feature $nodes(3) $feat1
+
+# Create a test partition
+spawn $scontrol create partition=$test_part \
+    nodes=$nodes(0)\,$nodes(1)\,$nodes(2)\,$nodes(3)
+expect {
+	-re "Error" {
+		set exit_code 1
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+# Test eXclusive OR (XOR) with 2 nodes
+send_user "\n\n==========Test XOR 2 nodes==========\n"
+sub_job_xor 2 0
+
+# Test eXclusive OR (XOR) with 3 nodes
+send_user "\n\n==========Test XOR 3 nodes==========\n"
+sub_job_xor 3 0
+
+# Test eXclusive OR (XOR) with 4 nodes (This is expected to fail)
+send_user "\n\n==========Test XOR 4 nodes==========\n"
+sub_job_xor 4 1
+
+# Test OR with 4 nodes
+send_user "\n\n==========Test OR 4 nodes==========\n"
+sub_job_or 4 0
+
+# Reset node features and remove test part
+send_user "\n\n==========Clean Up==========\n"
+clean_up
+
 if {$exit_code == 0} {
 	exec $bin_rm -f $file_in
 	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nFAILURE\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test17.17 b/testsuite/expect/test17.17
index 0aceed97e..51cd4e416 100755
--- a/testsuite/expect/test17.17
+++ b/testsuite/expect/test17.17
@@ -2,7 +2,7 @@
 ############################################################################
 # Purpose: Test of SLURM functionality
 #          Confirm that node sharing flags are respected  (--nodelist and
-#          --share options).
+#          --oversubscribe options).
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "WARNING: ..." with an explanation of why the test can't be made, OR
@@ -118,7 +118,7 @@ if {$job_id1 == 0} {
 set partition "dummy"
 set waited 1
 set timeout [expr $max_job_delay + 5]
-set srun_pid [spawn $srun -N1 --nodelist=$nodelist_name -t1 --share $scontrol -o show job $job_id1]
+set srun_pid [spawn $srun -N1 --nodelist=$nodelist_name -t1 --oversubscribe $scontrol -o show job $job_id1]
 expect {
 	-re "JobState=RUN" {
 		set waited 0
@@ -141,8 +141,8 @@ expect {
 if {$waited == 0} {
 	spawn $scontrol show partition
 	expect {
-		-re "Shared=FORCE" {
-			send_user "\nWARNING: Test incompatible with Shared=FORCE\n"
+		-re "OverSubscribe=FORCE" {
+			send_user "\nWARNING: Test incompatible with OverSubscribe=FORCE\n"
 			set waited 1
 			exp_continue
 		}
diff --git a/testsuite/expect/test17.21 b/testsuite/expect/test17.21
index 3e8a864d1..4a97e843e 100755
--- a/testsuite/expect/test17.21
+++ b/testsuite/expect/test17.21
@@ -42,6 +42,12 @@ set delay       10
 
 print_header $test_id
 
+set enforce [test_enforce_part_limits]
+if {![string compare $enforce "NO"]} {
+	send_user "\nWARNING: This test is incompatible EnforcePartLimits = $enforce\n"
+	exit 0
+}
+
 make_bash_script $file_in "
 #SBATCH --job-name='$job_name'
 $bin_sleep $delay
@@ -88,8 +94,7 @@ if {$matches != 1} {
 #
 # Build input script file
 #
-make_bash_script $file_in "
-#SBATCH -N1000000k
+make_bash_script $file_in "#SBATCH -N1000000k
 $bin_sleep $delay
 "
 set match 0
@@ -105,7 +110,7 @@ expect {
 		send_user "\nFAILURE: Test B was supposed to fail submission\n"
 		set exit_code 1
 		cancel_job $job_id
-	    exit 1
+		exit 1
 	}
 	timeout {
 		send_user "\nFAILURE: sbatch not responding\n"
diff --git a/testsuite/expect/test17.28 b/testsuite/expect/test17.28
index c3189ca77..f1d6c624e 100755
--- a/testsuite/expect/test17.28
+++ b/testsuite/expect/test17.28
@@ -42,6 +42,12 @@ set delay       1
 
 print_header $test_id
 
+set enforce [test_enforce_part_limits]
+if {![string compare $enforce "NO"]} {
+	send_user "\nWARNING: This test is incompatible EnforcePartLimits = $enforce\n"
+	exit 0
+}
+
 make_bash_script $file_in "
 #SBATCH --job-name=$job_name
 $bin_sleep $delay
@@ -95,8 +101,7 @@ cancel_job $job_id
 #   to occur before contending with a multitude of job step creations.
 #   This is especially important on very slow systems (e.g. AIX).
 #
-make_bash_script $file_in "
-#SBATCH -N1000000k
+make_bash_script $file_in "#SBATCH -N1000000k
 $bin_sleep $delay
 "
 set job_id  0
diff --git a/testsuite/expect/test17.36 b/testsuite/expect/test17.36
index ff5f18078..b9cf62dac 100755
--- a/testsuite/expect/test17.36
+++ b/testsuite/expect/test17.36
@@ -1,7 +1,7 @@
 #!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Test that the shared option in partitions is being enforced.
+#          Test that the OverSubscribe option in partitions is being enforced.
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
@@ -42,7 +42,7 @@ set cr_socket     0
 set cpu_cnt       0
 set socket_cnt    0
 set thread_cnt    0
-set shared_j_cnt  2
+set oversubscribe_j_cnt  2
 set job_id        0
 set node_name     ""
 set exit_code     0
@@ -128,11 +128,36 @@ proc cr_core_cpu { node } {
 
 }
 
-proc create_part {part shared node} {
+# Get default_queue_depth to see how many jobs will start at one time
+proc default_queue_depth { } {
+	global scontrol exit_coode number
+
+	set depth 100
+	log_user 0
+	spawn $scontrol show config
+	expect {
+		-re "default_queue_depth=($number)" {
+			set depth $expect_out(1,string)
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+
+	return $depth
+}
+
+proc create_part {part oversubscribe node} {
 
 	global scontrol exit_code
 
-	spawn $scontrol create partitionname=$part shared=$shared nodes=$node
+	spawn $scontrol create partitionname=$part OverSubscribe=$oversubscribe nodes=$node
 	expect {
 		timeout {
 			send_user "\nFAILURE: scontrol is not responding\n"
@@ -160,12 +185,12 @@ proc delete_part {part} {
 	}
 }
 
-proc sub_job { job shared part } {
+proc sub_job { job oversubscribe part } {
 	global sbatch file_in number job_id exit_code job_mem_opt
 
 	set job_id 0
-	if { $shared } {
-		spawn $sbatch -a$job -t1 $job_mem_opt -p$part --share -o/dev/null $file_in
+	if { $oversubscribe } {
+		spawn $sbatch -a$job -t1 $job_mem_opt -p$part --oversubscribe -o/dev/null $file_in
 		expect {
 			-re "Submitted batch job ($number)" {
 				set job_id $expect_out(1,string)
@@ -322,25 +347,30 @@ cancel_job $job_id
 
 ####################################
 #
-# Test partition with shared=NO
+# Test partition with oversubscribe=NO
 #
 ####################################
-send_user "\n\nTest partition with shared=NO\n"
+send_user "\n\nTest partition with overoubscribe=NO\n"
 
 # Determine the number of cores or CPUs
 set num_jobs [cr_core_cpu $node_name]
+set job_start [default_queue_depth]
+if { $num_jobs >= $job_start } {
+	send_user "\nWARNING: default_queue_depth less than core count ($num_jobs < $job_start), can not run this test\n"
+	exit $exit_code
+}
 
 # Create first test partition
 create_part $test_part_1 NO $node_name
 
-# Submit a job with shared
+# Submit a job with oversubscribe
 sub_job "0-$num_jobs" 1 $test_part_1
 
 # Check that the correct number of jobs are running
 check_job $num_jobs
 cancel_job $job_id
 
-# Submit a job without shared
+# Submit a job without oversubscribe
 sub_job "0-$num_jobs" 0 $test_part_1
 check_job $num_jobs
 cancel_job $job_id
@@ -348,23 +378,26 @@ delete_part $test_part_1
 
 ####################################
 #
-# Test partition with shared=YES:2
+# Test partition with oversubscribe=YES:2
 #
 ####################################
+set new_job_limit [expr $num_jobs * 2]
 if { [test_gang] == 1 } {
-	send_user "\n\nTest partition with shared=YES:2 incompatible with gang scheduling\n"
+	send_user "\n\nTest partition with oversubscribe=YES:2 incompatible with gang scheduling\n"
+} elseif { $new_job_limit >= $job_start } {
+        send_user "\nWARNING: default_queue_depth less than desired job count ($new_job_limit < $job_start), can not run oversubscribe=YES:2\n"
+
 } else {
-	send_user "\n\nTest partition with shared=YES:2\n"
-#	Make a new partition with shared=yes:2
-	create_part $test_part_2 "YES:$shared_j_cnt" $node_name
+	send_user "\n\nTest partition with oversubscribe=YES:2\n"
+#	Make a new partition with oversubscribe=yes:2
+	create_part $test_part_2 "YES:$oversubscribe_j_cnt" $node_name
 
-#	Submit a job with shared (expect 2 jobs per core/CPU)
-	set new_job_limit [expr $num_jobs * 2]
+#	Submit a job with oversubscribe (expect 2 jobs per core/CPU)
 	sub_job "0-$new_job_limit" 1 $test_part_2
 	check_job $new_job_limit
 	cancel_job $job_id
 
-#	Submit a job without shared (expect 1 job per core/CPU)
+#	Submit a job without oversubscribe (expect 1 job per core/CPU)
 	sub_job "0-$num_jobs" 0 $test_part_2
 	check_job $num_jobs
 	cancel_job $job_id
@@ -373,20 +406,20 @@ if { [test_gang] == 1 } {
 
 ########################################
 #
-# Test partition with shared=EXCLUSIVE
+# Test partition with oversubscribe=EXCLUSIVE
 #
 ########################################
-send_user "\n\nTest partition with shared=EXCLUSIVE\n"
+send_user "\n\nTest partition with oversubscribe=EXCLUSIVE\n"
 
-# Make a new partition with shared=EXCLUSIVE
+# Make a new partition with oversubscribe=EXCLUSIVE
 create_part $test_part_3 "EXCLUSIVE" $node_name
 
-# Submit a job with shared (expected 1 job per node)
+# Submit a job with oversubscribe (expected 1 job per node)
 sub_job "0-$num_jobs" 1 $test_part_3
 check_job 1
 cancel_job $job_id
 
-# Submit a job with shared (expected 1 job per node)
+# Submit a job with oversubscribe (expected 1 job per node)
 sub_job "0-$num_jobs" 0 $test_part_3
 check_job 1
 cancel_job $job_id
diff --git a/testsuite/expect/test17.37 b/testsuite/expect/test17.37
index 8c54837dd..56f7d4568 100755
--- a/testsuite/expect/test17.37
+++ b/testsuite/expect/test17.37
@@ -1,9 +1,7 @@
 #!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Validates that the afternotok dependency is enforced
-#          when a job runs to completion
-#
+#          Validate that afternotok dependency is enforced.
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
@@ -45,10 +43,6 @@ make_bash_script $script "sleep 10"
 # Submit a job to depend on
 spawn $sbatch -t1 -o/dev/null $script
 expect {
-	-re "Node count specification invalid" {
-		send_user "\nWARNING: can't this test with less than two nodes\n"
-		exit 0
-	}
 	-re "Submitted batch job ($number)" {
 		set job_id1 $expect_out(1,string)
 		exp_continue
@@ -107,7 +101,8 @@ expect {
 	}
 }
 if { $match != 1 } {
-	send_user "\nFAILURE: job $job_id1 did not exit with exit code 0\n"
+	send_user "\nFAILURE: Job $job_id1 did not exit with exit code 0\n"
+	send_user "\nFAILURE: Could be due to small configured MinJobAge value\n"
 	set exit_code 1
 }
 
@@ -132,8 +127,9 @@ expect {
 	}
 }
 if { $match != 2 } {
-	send_user "\nFAILURE: job $job_id2 should be in pending state and "
+	send_user "\nFAILURE: Job $job_id2 should be in pending state and "
 	send_user "should have DependencyNeverSatisfied for a reason\n"
+	send_user "\nFAILURE: Could be due to small configured MinJobAge value\n"
 	set exit_code 1
 }
 if {[cancel_job $job_id2] != 0} {
diff --git a/testsuite/expect/test17.39 b/testsuite/expect/test17.39
index 8e971f68a..b98e01fde 100755
--- a/testsuite/expect/test17.39
+++ b/testsuite/expect/test17.39
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
 #          Validates that the OR dependency option is enforced
@@ -42,13 +42,18 @@ set exit_code     0
 print_header $test_id
 
 set select_type [test_select_type]
+set def_part_name [default_partition]
+set nb_nodes [get_node_cnt_in_part $def_part_name]
 if {![string compare $select_type "linear"]} {
-	set def_part_name [default_partition]
-	set nb_nodes [get_node_cnt_in_part $def_part_name]
 	if {$nb_nodes < 2} {
 		send_user "\nWARNING: This test is incompatible with select/linear and only one node\n"
 		exit $exit_code
 	}
+} elseif {[default_part_exclusive]} {
+	if {$nb_nodes < 2} {
+		send_user "\nWARNING: This test is incompatible with exclusive node allocations and only one node\n"
+		exit $exit_code
+	}
 }
 
 make_bash_script $slow_job "sleep 120"
@@ -80,8 +85,8 @@ proc check_state {id state} {
 	}
 }
 
-# Submit job 1 of 2
-spawn $sbatch -t3 -o/dev/null $slow_job
+# Submit job 1 of 3
+spawn $sbatch -t3 -o/dev/null --mem=10 $slow_job
 expect {
 	-re "Submitted batch job ($number)" {
 		set slow_id $expect_out(1,string)
@@ -100,8 +105,8 @@ if {$slow_id == 0} {
 	exit 1
 }
 
-# Submit job 2 of 2
-spawn $sbatch -t3 -o/dev/null $fast_job
+# Submit job 2 of 3
+spawn $sbatch -t3 -o/dev/null --mem=10 $fast_job
 expect {
 	-re "Node count specification invalid" {
 		send_user "\nWARNING: can't test with less than two nodes\n"
@@ -124,8 +129,8 @@ if {$fast_id == 0} {
 	exit 1
 }
 
-# Submit dependency job
-spawn $sbatch --dependency=afterok:$slow_id?afterok:$fast_id -o/dev/null $slow_job
+# Submit dependency job, 3 of 3
+spawn $sbatch --dependency=afterok:$slow_id?afterok:$fast_id -o/dev/null --mem=10 $slow_job
 expect {
 	-re "Submitted batch job ($number)" {
 		set dep_id $expect_out(1,string)
diff --git a/testsuite/expect/test17.42 b/testsuite/expect/test17.42
new file mode 100755
index 000000000..b60cdfcdd
--- /dev/null
+++ b/testsuite/expect/test17.42
@@ -0,0 +1,92 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of sbatch --wait option.
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 SchedMD LLC
+# Written by Morris Jete <jette@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id    "17.42"
+set exit_code   0
+set file_in     "test$test_id.in"
+set job_id      0
+
+print_header $test_id
+
+#
+# Submit simple "sleep" batch job with --wait option
+#
+make_bash_script $file_in "$bin_sleep 14"
+set timeout [expr $max_job_delay + 14]
+spawn $sbatch -t1 -N1 --wait -o/dev/null $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: sbatch did not submit job\n"
+	exit 1
+}
+
+#
+# Make sure job is COMPLETED when sbatch returns
+#
+set match 0
+spawn $squeue -tall -j $job_id --Format=state
+expect {
+	-re "COMPLETED" {
+		incr match
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$match != 1} {
+	send_user "\nFAILURE: job not in state COMPLETED\n"
+	send_user "\nFAILURE: Could be due to small configured MinJobAge value\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.44 b/testsuite/expect/test17.44
new file mode 100755
index 000000000..32a36d3c6
--- /dev/null
+++ b/testsuite/expect/test17.44
@@ -0,0 +1,131 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Validate that aftercorr dependency is enforced.
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2014 SchedMD LLC
+# Written by Nathan Yee <nyee32@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id       17.44
+set exit_code     0
+set job_id1       0
+set job_id2       0
+set output        "test$test_id\_out_%a"
+set output_base   "test$test_id\_out_"
+set script1       "test$test_id\_sc1"
+set script2       "test$test_id\_sc2"
+set tasks         10
+
+print_header $test_id
+
+for {set task_id 1} {$task_id <= $tasks} {incr task_id} {
+	set file_out_glob "${output_base}${task_id}"
+	exec $bin_rm -f $file_out_glob
+}
+
+make_bash_script $script1 "sleep 5"
+
+# Submit a job to depend on
+spawn $sbatch -t1 --nice=100 --array=1-$tasks%2 -o/dev/null $script1
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id1 $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if { $job_id1 == 0 } {
+	send_user "\nFAILURE: sbatch did not submit job\n"
+	exit 1
+}
+
+make_bash_script $script2 "$scontrol show job ${job_id1}_\$SLURM_ARRAY_TASK_ID"
+
+# Submit a job that depends on job above
+spawn $sbatch -t1 -daftercorr:$job_id1 --array=1-$tasks -o$output $script2
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id2 $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if { $job_id2 == 0 } {
+	send_user "\nFAILURE: sbatch did not submit job\n"
+	cancel_job $job_id1
+	exit 1
+}
+
+send_user "\nWaiting for output files...\n"
+for {set task_id 1} {$task_id <= $tasks} {incr task_id} {
+	set file_out_glob "${output_base}${task_id}"
+	if {[wait_for_file $file_out_glob] != 0} {
+		send_user "\nFAILURE: output file for task $task_id missing\n"
+		set exit_code 1
+		break
+	} else {
+		set match 0
+		spawn cat $file_out_glob
+		expect {
+			-re "COMPLETED" {
+				set match 1
+				exp_continue
+			}
+			eof {
+				wait
+			}
+		}
+		if {$match == 0} {
+			send_user "\nFAILURE: bad job state for task $task_id\n"
+			set exit_code 1
+		}
+	}
+	if {$exit_code == 0} {
+		exec $bin_rm -f $file_out_glob
+	}
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $script1 $script2
+	send_user "\nSUCCESS\n"
+} else {
+	cancel_job $job_id1
+	cancel_job $job_id2
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.5 b/testsuite/expect/test17.5
index f036ef6f8..e56f8105b 100755
--- a/testsuite/expect/test17.5
+++ b/testsuite/expect/test17.5
@@ -40,6 +40,10 @@ set file_in     "test$test_id.input"
 set file_script "test$test_id.bash"
 set file_out    "test$test_id.output"
 set file_err    "test$test_id.error"
+set file_err_perc        "test$test_id.%%.error"
+set file_err_perc_result "test$test_id.%.error"
+set file_out_perc        "test$test_id.%%.output"
+set file_out_perc_result "test$test_id.%.output"
 set file_out_j  "test$test_id.j.%j.output"
 set file_err_j  "test$test_id.j.%j.error"
 set file_out_u  "test$test_id.%u.output"
@@ -263,6 +267,54 @@ if {$got_stderr == 0} {
 	set exit_code 1
 }
 
+#
+# Spawn a shell via sbatch that uses literal %% in their file names
+#
+set job_id 0
+spawn $sbatch -N1 --output=$file_out_perc --error=$file_err_perc -t1 $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if { $job_id == 0 } {
+	send_user "\nFAILURE: failed to submit job\n"
+	exit 1
+}
+
+#
+# Wait for job to complete
+#
+if {[wait_for_job $job_id "DONE"] != 0} {
+	send_user "\nFAILURE: waiting for job to complete\n"
+	set exit_code 1
+}
+
+#
+# Check for desired output
+#
+if {[wait_for_file $file_out_perc_result] == 0} {
+	exec $bin_rm -f $file_out_perc_result
+} else {
+	send_user "\nFAILURE: file format of %% in stdout failed\n"
+	set exit_code 1
+}
+if {[wait_for_file $file_err_perc_result] == 0} {
+	exec $bin_rm -f $file_err_perc_result
+} else {
+	send_user "\nFAILURE: file format of %% in stderr failed\n"
+	set exit_code 1
+}
+
 #
 # Spawn a shell via sbatch that uses stdout/err with %j in their names
 #
diff --git a/testsuite/expect/test17.51 b/testsuite/expect/test17.51
new file mode 100755
index 000000000..4673e9c1b
--- /dev/null
+++ b/testsuite/expect/test17.51
@@ -0,0 +1,461 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Validate that the mcs plugin (mcs/user) is OK with sbatch
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id      17.51
+set exit_code    0
+set cwd          "[$bin_pwd]"
+set config_path  ""
+set tmp_job      "test$test_id\_tmp_job"
+
+print_header $test_id
+
+#
+# Get the slurm.conf path
+#
+proc get_conf_path { } {
+
+	global scontrol config_path alpha exit_code
+
+	set got_config 0
+	log_user 0
+	spawn $scontrol show config
+	expect {
+		-re "SLURM_CONF.*= (/.*)/($alpha).*SLURM_VERSION" {
+			set config_path $expect_out(1,string)
+			set got_config 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+
+	if {$got_config != 1} {
+		send_user "\nFAILURE: did not get slurm.conf path\n"
+		exit 0
+	}
+}
+
+#
+# Do an scontrol reconfig to update MCS params
+#
+proc update_conf { } {
+	global scontrol exit_code
+
+	spawn $scontrol reconfigure
+	expect {
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	# Wait for the reconfigure to complete (especially with valgrind)
+	sleep 5
+}
+
+#
+# Copy slurm.conf file
+#
+proc copy_conf { } {
+	global bin_cp exit_code config_path cwd
+
+	spawn $bin_cp -v $config_path/slurm.conf $cwd/slurm.conf.orig
+	expect {
+		timeout {
+			send_user "\nFAILURE: slurm.conf was not copied\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+if {[is_super_user] == 0} {
+	send_user "\nWARNING: This test can't be run except as SlurmUser\n"
+	exit 0
+}
+
+get_conf_path
+copy_conf
+
+send_user "\n---Checking sbatch uses mcs-label only for some jobs (ondemand mode)---\n"
+
+#
+# Change the slurm.conf MCSparameters and MCSPlugin
+#
+exec $bin_sed -i /MCS/d $config_path/slurm.conf
+exec $bin_sed -i /mcs/d $config_path/slurm.conf
+exec $bin_sed -i /PrivateData/d $config_path/slurm.conf
+exec $bin_echo MCSPlugin=mcs/user >> $config_path/slurm.conf
+exec $bin_echo MCSParameters=ondemand,select,privatedata >> $config_path/slurm.conf
+exec $bin_echo PrivateData=jobs,nodes >> $config_path/slurm.conf
+update_conf
+
+#
+# verify slurm conf parameters MCS
+#
+set found 0
+spawn -noecho $bin_bash -c "exec $scontrol show config | $bin_grep MCS"
+expect {
+	-re "MCSPlugin               = mcs/user" {
+		send_user "\n MCSPlugin=mcs/user OK\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == 0} {
+	send_user "\nFAILURE: MCSPlugin parameter in scontrol show config is not mcs/user\n"
+	set exit_code 1
+}
+
+###### Check that sbatch fails with a bad mcs-label ######
+send_user "\n---Checking sbatch fails with a bad mcs-label ---\n"
+
+set timeout $max_job_delay
+make_bash_script $tmp_job "sleep 10"
+
+spawn $sbatch -N1 --mcs-label=foo -t1 $tmp_job
+expect {
+	-re "Batch job submission failed: Invalid mcs_label specified" {
+		send_user "\nThis error is expected, no worries\n"
+		exp_continue
+	}
+	timeout {
+	send_user "\nFAILURE: sbatch not responding\n"
+	exit 1
+	}
+	eof {
+	wait
+	}
+}
+
+
+###### Check that sbatch uses mcs-label=user ######
+send_user "\n---Checking sbatch uses mcs-label=user---\n"
+
+make_bash_script $tmp_job "sleep 10"
+set job_id 0
+spawn $sbatch -N1 -o/dev/null --exclusive=mcs -t1 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+	exit 1
+}
+
+spawn $bin_id -un
+expect {
+	-re "($alpha_numeric_under)" {
+		set user_name $expect_out(1,string)
+	}
+	eof {
+		wait
+	}
+}
+
+set found 0
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "(null)" {
+		send_user "\nNO MCS-label for this job : this is not expected\n"
+		exp_continue
+	}
+	-re "$user_name" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	set exit_code 1
+}
+
+cancel_job $job_id
+
+make_bash_script $tmp_job "sleep 30"
+set job_id 0
+spawn $sbatch -N1 --mcs-label=$user_name --exclusive=mcs -o/dev/null -t10 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+}
+set found 0
+sleep 5
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "$user_name" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	-re "Invalid job format specification" {
+		send_user "\nFAILURE Invalid job format specification mcslabel\n"
+		set exit_code 1
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == 0} {
+	 send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	 set exit_code 1
+}
+
+set found 0
+set node 0
+spawn $squeue --jobs=$job_id --noheader -O "nodelist"
+expect {
+	-re "($alpha_numeric_under)" {
+		set node $expect_out(1,string)
+		send_user "\nNode for this job : $node\n"
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: no node found in squeue command\n"
+	set exit_code 1
+}
+
+#
+# verify MCS of nodes
+#
+set found 0
+spawn -noecho $bin_bash -c "exec $scontrol show node=$node | $bin_grep MCS"
+expect {
+	-re "MCS_label=$user_name" {
+		send_user "\n mcs_label OK for node $node\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with node with bad mcs-label\n"
+	set exit_code 1
+}
+cancel_job $job_id
+
+#
+# Change the slurm.conf MCSparameters and MCSPlugin
+# test with enforced
+#
+send_user "\n---Checking sbatch uses mcs-label with all jobs (enforced mode)---\n"
+exec $bin_sed -i /MCS/d $config_path/slurm.conf
+exec $bin_sed -i /mcs/d $config_path/slurm.conf
+exec $bin_sed -i /PrivateData/d $config_path/slurm.conf
+exec $bin_echo MCSPlugin=mcs/user >> $config_path/slurm.conf
+exec $bin_echo MCSParameters=enforced,noselect,privatedata >> $config_path/slurm.conf
+exec $bin_echo PrivateData=jobs,nodes >> $config_path/slurm.conf
+update_conf
+
+###### Check that sbatch uses mcs-label=user ######
+send_user "\n---Checking sbatch uses mcs-label=user---\n"
+
+make_bash_script $tmp_job "sleep 10"
+
+spawn $sbatch -N1 -o/dev/null -t1 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+}
+
+set found 0
+sleep 3
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "$user_name" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	-re "(null)" {
+		send_user "\nFAILURE: NO MCS-label for this job\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	set exit_code 1
+}
+
+set found 0
+set node 0
+spawn $squeue --jobs=$job_id --noheader -O "nodelist"
+expect {
+	-re "($alpha_numeric_under)" {
+		set node $expect_out(1,string)
+		send_user "\nNode for this job : $node\n"
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: no node found in squeue command\n"
+	set exit_code 1
+}
+
+#
+# verify MCS of nodes
+#
+set found 0
+spawn -noecho $bin_bash -c "exec $scontrol show node=$node | $bin_grep MCS"
+expect {
+	-re "MCS_label=$user_name" {
+		send_user "\nFAILURE: a mcs_label is found for this job. It was not expected\n"
+		set exit_code 1
+	}
+	-re "MCS_label=N/A" {
+		send_user "\nNo mcs_label for this node. It was expected\n"
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+cancel_job $job_id
+
+# Clean up vestigial files and restore original slurm.conf file
+send_user "\nChanging slurm.conf back\n"
+exec $bin_cp -v $cwd/slurm.conf.orig $config_path/slurm.conf
+update_conf
+
+if {$exit_code == 0} {
+	exec $bin_rm $tmp_job $cwd/slurm.conf.orig
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.52 b/testsuite/expect/test17.52
new file mode 100755
index 000000000..2d8595214
--- /dev/null
+++ b/testsuite/expect/test17.52
@@ -0,0 +1,477 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Validate that the mcs plugin (mcs/group) is OK with sbatch
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id      17.52
+set exit_code    0
+set cwd          "[$bin_pwd]"
+set config_path  ""
+set tmp_job      "test$test_id\_tmp_job"
+set file_in	 "test${test_id}.in"
+set file_out     "test${test_id}.out"
+
+print_header $test_id
+
+#
+# Get the slurm.conf path
+#
+proc get_conf_path { } {
+
+	global scontrol config_path alpha exit_code
+
+	set got_config 0
+	log_user 0
+	spawn $scontrol show config
+	expect {
+		-re "SLURM_CONF.*= (/.*)/($alpha).*SLURM_VERSION" {
+			set config_path $expect_out(1,string)
+			set got_config 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+
+	if {$got_config != 1} {
+		send_user "\nFAILURE: did not get slurm.conf path\n"
+		exit 0
+	}
+}
+
+#
+# Do an scontrol reconfig to update MCS params
+#
+proc update_conf { } {
+	global scontrol exit_code
+
+	spawn $scontrol reconfigure
+	expect {
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	# Wait for the reconfigure to complete (especially with valgrind)
+	sleep 5
+}
+
+#
+# Copy slurm.conf file
+#
+proc copy_conf { } {
+	global bin_cp exit_code config_path cwd
+
+	spawn $bin_cp -v $config_path/slurm.conf $cwd/slurm.conf.orig
+	expect {
+		timeout {
+			send_user "\nFAILURE: slurm.conf was not copied\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+}
+
+if {[is_super_user] == 0} {
+	send_user "\nWARNING: This test can't be run except as SlurmUser\n"
+	exit 0
+}
+
+get_conf_path
+copy_conf
+
+send_user "\n---Checking sbatch uses mcs-label only for some jobs (ondemand mode)---\n"
+
+#
+# Change the slurm.conf MCSparameters and MCSPlugin
+#
+set alpha_numeric_pipe        "\[a-zA-Z0-9|\]+"
+set groups_name 0
+send_user "\n groups=$groups_name\n"
+spawn $bin_bash -c "exec groups \| sed \"s/ /\|/g\""
+expect {
+	-re "($alpha_numeric_pipe)" {
+		set groups_name $expect_out(1,string)
+	}
+	eof {
+		wait
+	}
+}
+
+exec $bin_sed -i /MCS/d $config_path/slurm.conf
+exec $bin_sed -i /mcs/d $config_path/slurm.conf
+exec $bin_sed -i /PrivateData/d $config_path/slurm.conf
+exec $bin_echo MCSPlugin=mcs/group >> $config_path/slurm.conf
+exec $bin_echo MCSParameters=ondemand,select,privatedata:$groups_name >> $config_path/slurm.conf
+exec $bin_echo PrivateData=jobs,nodes >> $config_path/slurm.conf
+update_conf
+
+#
+# verify slurm conf parameters MCS
+#
+set found 0
+spawn -noecho $bin_bash -c "exec $scontrol show config | $bin_grep MCS"
+expect {
+	-re "MCSPlugin               = mcs/group" {
+		send_user "\n MCSPlugin=mcs/group OK\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: MCSPlugin parameter in scontrol show config is not mcs/group\n"
+	set exit_code 1
+}
+
+###### Check that sbatch fails with a bad mcs-label ######
+send_user "\n---Checking sbatch fails with a bad mcs-label ---\n"
+
+set timeout $max_job_delay
+make_bash_script $tmp_job "sleep 10"
+
+spawn $sbatch -N1 --mcs-label=foo -t1 $tmp_job
+expect {
+	-re "Batch job submission failed: Invalid mcs_label specified" {
+		send_user "\nThis error is expected, no worries\n"
+		exp_continue
+	}
+	timeout {
+	send_user "\nFAILURE: sbatch not responding\n"
+	exit 1
+	}
+	eof {
+	wait
+	}
+}
+
+
+###### Check that sbatch uses mcs-label=group ######
+send_user "\n---Checking sbatch uses mcs-label=group---\n"
+
+make_bash_script $tmp_job "sleep 10"
+set job_id 0
+spawn $sbatch -N1 -o/dev/null --exclusive=mcs -t1 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+	exit 1
+}
+
+ spawn $bin_bash -c "exec groups \| sed \"s/ /\|/g\""
+ expect {
+	 -re "($alpha_numeric_under)" {
+		set group1 $expect_out(1,string)
+	}
+	eof {
+		wait
+	}
+}
+
+
+set found 0
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "(null)" {
+		send_user "\nNO MCS-label for this job : this is not expected\n"
+		exp_continue
+	}
+	-re "$group1" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	set exit_code 1
+}
+
+cancel_job $job_id
+
+make_bash_script $tmp_job "sleep 30"
+set job_id 0
+spawn $sbatch -N1 --mcs-label=$group1 --exclusive=mcs -o/dev/null -t10 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+}
+set found 0
+sleep 5
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "$group1" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	-re "Invalid job format specification" {
+		send_user "\nFAILURE Invalid job format specification mcslabel\n"
+		set exit_code 1
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == 0} {
+	 send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	 set exit_code 1
+}
+
+set found 0
+set node 0
+spawn $squeue --jobs=$job_id --noheader -O "nodelist"
+expect {
+	-re "($alpha_numeric_under)" {
+		set node $expect_out(1,string)
+		send_user "\nNode for this job : $node\n"
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: no node found in squeue command\n"
+	set exit_code 1
+}
+
+#
+# verify MCS of nodes
+#
+set found 0
+spawn -noecho $bin_bash -c "exec $scontrol show node=$node | $bin_grep MCS"
+expect {
+	-re "MCS_label=$group1" {
+		send_user "\n mcs_label OK for node $node\n"
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with node with bad mcs-label\n"
+	set exit_code 1
+}
+cancel_job $job_id
+
+#
+# Change the slurm.conf MCSparameters and MCSPlugin
+# test with enforced
+#
+send_user "\n---Checking sbatch uses mcs-label with all jobs (enforced mode)---\n"
+exec $bin_sed -i /MCS/d $config_path/slurm.conf
+exec $bin_sed -i /mcs/d $config_path/slurm.conf
+exec $bin_sed -i /PrivateData/d $config_path/slurm.conf
+exec $bin_echo MCSPlugin=mcs/group >> $config_path/slurm.conf
+exec $bin_echo MCSParameters=enforced,noselect,privatedata:$groups_name >> $config_path/slurm.conf
+exec $bin_echo PrivateData=jobs,nodes >> $config_path/slurm.conf
+update_conf
+
+###### Check that sbatch uses mcs-label=group ######
+send_user "\n---Checking sbatch uses mcs-label=group---\n"
+
+make_bash_script $tmp_job "sleep 10"
+
+spawn $sbatch -N1 -o/dev/null -t1 $tmp_job
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: job was not submitted\n"
+	set exit_code 1
+}
+
+set found 0
+sleep 3
+spawn $squeue --jobs=$job_id --noheader -O "mcslabel"
+expect {
+	-re "$group1" {
+		send_user "\nMCS-label OK for this job\n"
+		set found 1
+		exp_continue
+	}
+	-re "(null)" {
+		send_user "\nFAILURE: NO MCS-label for this job\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: job was submitted with a bad mcs-label\n"
+	set exit_code 1
+}
+
+set found 0
+set node 0
+spawn $squeue --jobs=$job_id --noheader -O "nodelist"
+expect {
+	-re "($alpha_numeric_under)" {
+		set node $expect_out(1,string)
+		send_user "\nNode for this job : $node\n"
+		set found 1
+	}
+	timeout {
+		send_user "\nFAILURE: squeue is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$found == 0} {
+	send_user "\nFAILURE: no node found in squeue command\n"
+	set exit_code 1
+}
+
+#
+# verify MCS of nodes
+#
+spawn -noecho $bin_bash -c "exec $scontrol show node=$node | $bin_grep MCS"
+expect {
+	-re "MCS_label=$group1" {
+		send_user "\nFAILURE: a mcs_label is found for this job. It was not expected\n"
+		set exit_code 1
+	}
+	-re "MCS_label=N/A" {
+		send_user "\nNo mcs_label for this node. It was expected\n"
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+cancel_job $job_id
+
+# Clean up vestigial files and restore original slurm.conf file
+send_user "\nChanging slurm.conf back\n"
+exec $bin_cp -v $cwd/slurm.conf.orig $config_path/slurm.conf
+update_conf
+
+if {$exit_code == 0} {
+	exec $bin_rm $tmp_job $cwd/slurm.conf.orig
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.53 b/testsuite/expect/test17.53
new file mode 100755
index 000000000..dfcf0775e
--- /dev/null
+++ b/testsuite/expect/test17.53
@@ -0,0 +1,80 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.53"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job that deadline is too late
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --deadline 2015-03-27T04:30:00 -t1 $file_in
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id != 0} {
+	send_user "\nFAILURE: batch submit with a deadline too old\n"
+	cancel_job $job_id
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.54 b/testsuite/expect/test17.54
new file mode 100755
index 000000000..9364412f3
--- /dev/null
+++ b/testsuite/expect/test17.54
@@ -0,0 +1,109 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option too short
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.54"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 1"
+
+#
+# Spawn a batch job that deadline is too late
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --deadline now+1hour $file_in
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: job submission failed\n"
+	exit 1
+}
+
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+#
+# verify time limit
+#
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=00:59:" {
+		exp_continue
+	}
+	-re "TimeLimit=01:00:00" {
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: time limit is different from deadline\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.55 b/testsuite/expect/test17.55
new file mode 100755
index 000000000..b8b04d9e6
--- /dev/null
+++ b/testsuite/expect/test17.55
@@ -0,0 +1,261 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time limit partition
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id        "17.55"
+set job_id	   0
+set authorized     1
+set exit_code      0
+set part_name      "QA_TEST"
+set file_in        "test$test_id.input"
+
+print_header $test_id
+
+if {[test_super_user] == 0} {
+	send_user "\nWARNING: can not test more unless SlurmUser or root\n"
+	exit $exit_code
+}
+
+#
+# Confirm the partition name does not already exist
+#
+set found -1
+spawn $scontrol -a show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found == -1} {
+	send_user "\nFAILURE: scontrol output format error\n"
+	exit 1
+}
+if {$found == 1} {
+	send_user "\nFAILURE: partition $part_name already exists\n"
+	exit 1
+}
+
+#
+# Identify usable nodes in default partition
+#
+set def_node [get_idle_node_in_part [default_partition]]
+if {[string compare $def_node ""] == 0} {
+	send_user "\nFAILURE:default partition seems to have no nodes\n"
+	exit 1
+}
+
+#
+# Create a new partition
+#
+spawn $scontrol create PartitionName=$part_name Nodes=$def_node MaxTime=30
+expect {
+	-re "error" {
+		send_user "\nFAILURE: something bad happened on partition create\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition now exists
+#
+set allow  0
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 1} {
+	send_user "\nFAILURE: partition not created\n"
+	exit 1
+}
+
+set found 0
+
+# Check EnforcePartLimits value
+set enforcepartlimits [test_enforce_part_limits]
+send_user "\nEnforcePartLimits=$enforcepartlimits\n\n"
+
+#
+# Run a job in this new partition and validate the time limit
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+set srun_pid [spawn $sbatch --output=/dev/null --error=/dev/null -t100 --deadline now+3hour -p $part_name $file_in]
+
+if {[string compare $enforcepartlimits "NO"] == 0} {
+	expect {
+		-re "Submitted batch job ($number)" {
+			set job_id $expect_out(1,string)
+			set exit_code 0
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sbatch not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+
+	#
+	# verify time limit
+	#
+	sleep 5
+	set matches 0
+	spawn $scontrol show job $job_id
+	expect {
+		-re "Reason=PartitionTimeLimit" {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol not responding\n"
+			set exit_code 1
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+	if {$matches != 1} {
+		send_user "\nFAILURE: partition time limit not used \n"
+		set exit_code 1
+	}
+} else {
+	#
+        # Job should be rejected at submit time
+        #
+        expect {
+                -re "Requested time limit is invalid (missing or exceeds some limit)" {
+                        set exit_code 0
+                        exp_continue
+                }
+                -re "unrecognized option '--deadline'" {
+                        set exit_code 1
+                        exp_continue
+                }
+                timeout {
+                        send_user "\nFAILURE: sbatch not responding\n"
+                        set exit_code 1
+                }
+                eof {
+                        wait
+                }
+        }
+}
+
+cancel_job $job_id
+
+#
+# Now delete the partition
+#
+spawn $scontrol delete PartitionName=$part_name
+expect {
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+#
+# Confirm the partition is now gone
+#
+set found -1
+spawn $scontrol show part $part_name
+expect {
+	-re "not found" {
+		send_user "This error was expected, no worries\n"
+		set found 0
+		exp_continue
+	}
+	-re "PartitionName" {
+		set found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$found != 0} {
+	send_user "\nFAILURE: partition not deleted\n"
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.56 b/testsuite/expect/test17.56
new file mode 100755
index 000000000..c1e04062b
--- /dev/null
+++ b/testsuite/expect/test17.56
@@ -0,0 +1,113 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and no time
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.56"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+set part_name [default_partition]
+set default_time [get_partition_default_time_limit $part_name]
+if { $default_time != -1} {
+	send_user "\nWARNING: This test is not compatible with default partition having a default time limit ($part_name $default_time)\n"
+	exit $exit_code
+}
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --deadline now+600 $file_in
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch job not submitted\n"
+	exit 1
+}
+
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=00:10:00" {
+		send_user "\nTimelimit OK\n"
+	}
+	-re "TimeLimit=00:09:" {
+		send_user "\nTimelimit OK\n"
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE : Timelimit not OK with deadline\n"
+		set exit_code 1
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.57 b/testsuite/expect/test17.57
new file mode 100755
index 000000000..1cb738e2e
--- /dev/null
+++ b/testsuite/expect/test17.57
@@ -0,0 +1,80 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.57"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --deadline now+1hour --time-min 120 $file_in
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id != 0} {
+	send_user "\nFAILURE: batch submitted despite the deadline\n"
+	cancel_job $job_id
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.58 b/testsuite/expect/test17.58
new file mode 100755
index 000000000..448c2c26b
--- /dev/null
+++ b/testsuite/expect/test17.58
@@ -0,0 +1,113 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and time_min and time too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.58"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --deadline now+1hour --time-min 20 -t 120 $file_in
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted\n"
+	exit 1
+}
+
+#
+# verify time limit
+#
+if {[wait_for_job $job_id DONE] != 0} {
+	cancel_job $job_id
+	send_user "\nFAILURE: job failed to run to completion\n"
+	send_user "FAILURE: This can be due to QOS or account time limit <120 minutes\n"
+	exit 1
+}
+spawn $scontrol show job $job_id
+expect {
+	-re "TimeLimit=01:00:00" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "TimeLimit=00:59:" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "TimeLimit=" {
+		send_user "\nFAILURE: time limit is different from deadline\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.59 b/testsuite/expect/test17.59
new file mode 100755
index 000000000..4d230ad52
--- /dev/null
+++ b/testsuite/expect/test17.59
@@ -0,0 +1,84 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline option and --begin option too late
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.59"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --begin now+2hour --deadline now+1hour $file_in
+expect {
+	-re "Requested time limit is invalid" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 0
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id != 0} {
+	send_user "\nFAILURE: batch submitted with a deadline too short\n"
+	cancel_job $job_id
+	exit 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.60 b/testsuite/expect/test17.60
new file mode 100755
index 000000000..e05e6aa30
--- /dev/null
+++ b/testsuite/expect/test17.60
@@ -0,0 +1,143 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and --time_min too long
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.60"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout [expr $max_job_delay + 60]
+spawn $sbatch --output=/dev/null --error=/dev/null --begin now+60 --deadline now+600 --time-min 10 $file_in
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted with a deadline too short\n"
+	exit 1
+}
+
+#
+# test status deadline in scontrol and sacct
+#
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+spawn $scontrol show job $job_id
+expect {
+	-re "JobState=DEADLINE" {
+		exp_continue
+	}
+	-re "JobState=" {
+		send_user "\nFAILURE: invalid job state\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+set cycle_count 8
+set not_support 0
+for {set inx 0} {$inx < $cycle_count} {incr inx} {
+	spawn $sacct  -n -P -X -j $job_id -o State
+	expect {
+		-re "SLURM accounting storage is disabled" {
+			set not_support 1
+			exp_continue
+		}
+		-re "DEADLINE" {
+			break
+		}
+		-re "COMPLETED" {
+			set exit_code 1
+			break
+		}
+		timeout {
+			send_user "\nFAILURE: sacct not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	sleep 10
+}
+if {$not_support != 0} {
+	send_user "\nWARNING: can not test without accounting enabled\n"
+	exit 0
+}
+
+if {$exit_code == 1} {
+	send_user "\nFAILURE: batch submitted with a deadline too short\n"
+} else {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.61 b/testsuite/expect/test17.61
new file mode 100755
index 000000000..1ac177c59
--- /dev/null
+++ b/testsuite/expect/test17.61
@@ -0,0 +1,136 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test of --deadline and --begin option and --time_min OK
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 CEA/DAM/DIF
+# Written by Aline Roy <aline.roy@cea.fr>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
+############################################################################
+source ./globals
+
+set test_id     "17.61"
+set file_in     "test$test_id.input"
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+#
+# Build input script file
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "$bin_sleep 5"
+
+#
+# Spawn a batch job with a deadline and no time
+#
+set timeout $max_job_delay
+spawn $sbatch --output=/dev/null --error=/dev/null --begin now+1 --deadline now+600 --time-min 5 $file_in
+expect {
+	-re "Requested time limit is invalid (missing or exceeds some limit)" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Incompatible begin and deadline time specification" {
+		set exit_code 1
+		exp_continue
+	}
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		set exit_code 0
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch not submitted with a deadline too short\n"
+	exit 1
+}
+
+#
+# test status deadline in scontrol and sacct
+#
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: job failed to run to completion\n"
+	exit 1
+}
+
+spawn $scontrol show job $job_id
+expect {
+	-re "JobState=COMPLETED" {
+		exp_continue
+	}
+	-re "JobState=" {
+		send_user "\nFAILURE: invalid job state\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+
+set not_support 0
+spawn $sacct  -n -P -X -j $job_id -o State
+expect {
+	-re "SLURM accounting storage is disabled" {
+		set not_support 1
+		exp_continue
+	}
+	-re "DEADLINE" {
+		send_user "\nFAILURE: batch not submitted with a deadline and a time-min OK\n"
+		set exit_code 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacct not responding\n"
+		set exit_code 1
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$not_support != 0} {
+	send_user "\nWARNING: can not fully test without accounting enabled\n"
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test17.62 b/testsuite/expect/test17.62
new file mode 100755
index 000000000..5228c77c8
--- /dev/null
+++ b/testsuite/expect/test17.62
@@ -0,0 +1,126 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          test for #BSUB entry functionality
+#
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 SchedMD LLC
+# Written by Nathan Yee <nyee32@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id       17.62
+set exit_code     0
+set file_in       "test$test_id\.sh"
+set job_name      "test$test_id\_job"
+set job_mem       100
+set partition     [default_partition]
+set job_time      1
+set stdout        "/dev/null"
+set stderr        "/tmp/err"
+set job_id        0
+set node_list     [get_idle_node_in_part [default_partition]]
+
+array set check_list { }
+set check_list(JobName)      $job_name
+set check_list(TimeLimit)    00:0$job_time\:00
+set check_list(Partition)    $partition
+set check_list(BatchHost)    $node_list
+set check_list(MinMemoryCPU) $job_mem
+set check_list(StdErr)       $stderr
+set check_list(StdOut)       $stdout
+
+make_bash_script $file_in "
+
+#BSUB -o$stdout -e$stderr
+#BSUB -m\"$node_list\"
+#BSUB -J$job_name -M$job_mem
+#BSUB -W$job_time -x -q$partition
+sleep 10
+"
+
+# Run the job with sbatch
+spawn $sbatch $file_in
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$job_id == 0} {
+	send_user "\nFailure: sbatch did not submit job\n"
+	exec $bin_rm -fr $file_in
+	exit 1
+}
+
+# Wait for the job to finish
+wait_for_job $job_id DONE
+
+foreach option [array names check_list] {
+	#send_user "\n$option=$check_list($option)\n"
+	if {[string compare $option "BatchHost"] == 0 && [test_front_end] != 0} {
+		continue
+	}
+
+	set match 0
+	log_user 0
+	spawn $scontrol show job $job_id
+	expect {
+		-re "$option=$check_list($option)" {
+			set match 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: scontrol is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+	log_user 1
+
+	# Check that each value is found
+	if {$match != 1} {
+		send_user "\nFAILURE: $option was not found\n"
+		send_user "\nFAILURE: Could be due to small configured MinJobAge value\n"
+		set exit_code 1
+	}
+}
+
+cancel_job $job_id
+if {$exit_code == 0} {
+	exec $bin_rm -fr $file_in
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test2.25 b/testsuite/expect/test2.25
index 4c3904f5c..b8bbb4629 100755
--- a/testsuite/expect/test2.25
+++ b/testsuite/expect/test2.25
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
 #          Validate that scontrol show assoc_mgr shows the data cached in
diff --git a/testsuite/expect/test2.7 b/testsuite/expect/test2.7
index e9da3f0d2..e769c8922 100755
--- a/testsuite/expect/test2.7
+++ b/testsuite/expect/test2.7
@@ -108,7 +108,7 @@ if {$rem_time > 60} {
 	send_user "\nFAILURE: job remaining time is wrong $rem_time\n"
 	set exit_code 1
 }
-if {$rem_time < 56} {
+if {$rem_time < 55} {
 	send_user "\nFAILURE: job remaining time seems too small\n"
 	set exit_code 1
 }
diff --git a/testsuite/expect/test2.8 b/testsuite/expect/test2.8
index a0918e71a..bb26da67e 100755
--- a/testsuite/expect/test2.8
+++ b/testsuite/expect/test2.8
@@ -43,15 +43,20 @@ set job_id2     0
 print_header $test_id
 
 set select_type [test_select_type]
+set def_part_name [default_partition]
+set nb_nodes [get_node_cnt_in_part $def_part_name]
 if {![string compare $select_type "bluegene"]} {
 	set is_bluegene 1
 } elseif {![string compare $select_type "linear"]} {
-	set def_part_name [default_partition]
-	set nb_nodes [get_node_cnt_in_part $def_part_name]
 	if {$nb_nodes < 2} {
 		send_user "\nWARNING: This test is incompatible with select/linear and only one node\n"
 		exit $exit_code
 	}
+} elseif {[default_part_exclusive]} {
+	if {$nb_nodes < 2} {
+		send_user "\nWARNING: This test is incompatible with exclusive node allocations and only one node\n"
+		exit $exit_code
+	}
 }
 
 if {[test_launch_poe]} {
@@ -64,14 +69,14 @@ if {[test_launch_poe]} {
 # Build input script file
 #
 make_bash_script $file_in "
-  $srun $bin_sleep 60 &
-  $srun $bin_sleep 60
+  $srun --mem=10 $bin_sleep 60 &
+  $srun --mem=10 $bin_sleep 60
 "
 
 #
 # Submit a couple jobs so we have something to work with
 #
-set sbatch_pid [spawn $sbatch --output=/dev/null --error=/dev/null -t5 $file_in]
+set sbatch_pid [spawn $sbatch --output=/dev/null --error=/dev/null -t5 --mem=20 $file_in]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id1 $expect_out(1,string)
@@ -91,7 +96,7 @@ if {$job_id1 == 0} {
 	exit 1
 }
 
-set sbatch_pid [spawn $sbatch --output=/dev/null --error=/dev/null -t5 $file_in]
+set sbatch_pid [spawn $sbatch --output=/dev/null --error=/dev/null -t5 --mem=20 $file_in]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id2 $expect_out(1,string)
@@ -183,8 +188,6 @@ expect {
 		wait
 	}
 }
-
-
 if {$matches != 2} {
 	send_user "\nFAILURE: scontrol failed to find matching job ($matches != 2)\n"
 	set exit_code 1
@@ -343,13 +346,9 @@ if {$matches != 1} {
 }
 
 #
-# Wait for job to start running then give the step a chance to start tasks
+# Wait for step to start
 #
-if {[wait_for_job $job_id1 RUNNING] != 0} {
-	send_user "\nFAILURE: waiting for job $job_id1 to run\n"
-	set exit_code 1
-}
-exec $bin_sleep 10
+sleep 10
 
 #
 # Look at all job steps with scontrol
diff --git a/testsuite/expect/test20.13 b/testsuite/expect/test20.13
new file mode 100755
index 000000000..1599563de
--- /dev/null
+++ b/testsuite/expect/test20.13
@@ -0,0 +1,227 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          qsub command tests for Grid Engine options
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2016 SchedMD LLC.
+# Written by Danny Auble <da@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id     "20.13"
+set exit_code   0
+set file_err	"test$test_id.error"
+set file_in	"test$test_id.input"
+set file_out	"test$test_id.output"
+
+print_header $test_id
+
+if {[file executable $qsub] == 0} {
+	send_user "\nWARNING: $qsub not found\n"
+	exit 0
+}
+
+set exe "hostname"
+set qsub_default "--sbatchline $exe"
+
+# test -b option (sbatch --wrap)
+set matches 0
+eval spawn $qsub -b y $qsub_default
+expect {
+	-re "--wrap=\"${exe}\"" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -b option did not set up correctly\n"
+	set exit_code 1
+}
+
+# test -pe option (sbatch -c|--cpus-per-task)
+set param 7
+set matches 0
+eval spawn $qsub -pe shm $param $qsub_default
+expect {
+	-re "--cpus-per-task=$param" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -pe option did not set up correctly\n"
+	set exit_code 1
+}
+
+# test -P option (sbatch --wckey)
+set param "test_wckey"
+set matches 0
+eval spawn $qsub -P $param $qsub_default
+expect {
+	-re "--wckey=$param" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+# test -r option (sbatch --requeue)
+set matches 0
+eval spawn $qsub -r y $qsub_default
+expect {
+	-re "--requeue" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+# test -wd option (sbatch -D)
+set param "/new/dir"
+set matches 0
+eval spawn $qsub -wd $param $qsub_default
+expect {
+	-re "-D$param" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -D option did not set up correctly\n"
+	set exit_code 1
+}
+
+# test -l h_rt option (sbatch -t)
+set param "300"
+set matches 0
+eval spawn $qsub -l h_rt=$param $qsub_default
+set param [expr $param / 60]
+expect {
+	-re "-t$param" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -l h_rt option did not set up correctly\n"
+	set exit_code 1
+}
+
+# test -l h_rt option (sbatch -t)
+set param "00:05:00"
+set matches 0
+eval spawn $qsub -l h_rt=$param $qsub_default
+expect {
+	-re "-t5" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -l h_rt option did not set up correctly\n"
+	set exit_code 1
+}
+
+# test -l h_vmem option (sbatch --mem)
+set param "3000"
+set matches 0
+eval spawn $qsub -l h_vmem=$param $qsub_default
+expect {
+	-re "--mem=$param" {
+		incr matches
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: qsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$matches != 1} {
+	send_user "\nFAILURE: qsub -l h_vmem option did not set up correctly\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in $file_out $file_err
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test21.21 b/testsuite/expect/test21.21
index 1bd4e4c8d..a4de7ab2f 100755
--- a/testsuite/expect/test21.21
+++ b/testsuite/expect/test21.21
@@ -115,8 +115,7 @@ if {$got_node != 1} {
 	exit 0
 }
 
-# Get the number of cpus on a node
-
+# Get the number of CPUs on a node
 spawn $scontrol show node $test_node
 expect {
 	-re "CPUTot=($number)" {
@@ -149,8 +148,6 @@ if {$totcpus == 0} {
 }
 
 
-
-
 proc assoc_setup { limit_type limit_val } {
 
 	global acct_mod_assoc_test_vals
@@ -382,7 +379,6 @@ expect {
 		wait
 	}
 }
-
 if {$match != 1} {
 	send_user "\nFAILURE: $test_qos was not created\n"
 	exit 1
diff --git a/testsuite/expect/test21.30 b/testsuite/expect/test21.30
index 8da3e1fed..9196a15f2 100755
--- a/testsuite/expect/test21.30
+++ b/testsuite/expect/test21.30
@@ -141,12 +141,17 @@ expect {
 		wait
 	}
 }
-
 if {$tmpc == 0 || $tmpn == 0} {
 	send_user "\nWARNING: not enough Nodes and/or CPUs\n"
 	exit 0
 }
 
+if { ![string compare [priority_type] "multifactor"] } {
+	set prio_multifactor 1
+} else {
+	set prio_multifactor 0
+}
+
 # Checks the state of the job
 proc check_state { job } {
 
@@ -549,15 +554,18 @@ set mod_qos_vals(GrpCpuMin) "-1"
 
 #
 # Test GroupCPURunMins
+# Requires priority/multifactor to properly handle decay well
 #
-set mod_qos_vals(GrpCpuRunMin) $grpcpurunmin_num
-mod_qos $qostest [array get mod_qos_vals]
-sleep $time_spacing
-inc21_30_10
-if {$exit_code != 0 } {
-	endit
+if { $prio_multifactor != 0 } {
+	set mod_qos_vals(GrpCpuRunMin) $grpcpurunmin_num
+	mod_qos $qostest [array get mod_qos_vals]
+	sleep $time_spacing
+	inc21_30_10
+	if {$exit_code != 0 } {
+		endit
+	}
+	set mod_qos_vals(GrpCpuRunMin) "-1"
 }
-set mod_qos_vals(GrpCpuRunMin) "-1"
 
 #
 # Test Group Memory
@@ -573,15 +581,18 @@ set mod_qos_vals(GrpMem) "-1"
 
 #
 # Test Group wall
+# Requires priority/multifactor to properly handle decay well
 #
-set mod_qos_vals(GrpWall) $grpwall_num
-mod_qos $qostest [array get mod_qos_vals]
-sleep $time_spacing
-inc21_30_12
-if {$exit_code != 0 } {
-	endit
+if { $prio_multifactor != 0 } {
+	set mod_qos_vals(GrpWall) $grpwall_num
+	mod_qos $qostest [array get mod_qos_vals]
+	sleep $time_spacing
+	inc21_30_12
+	if {$exit_code != 0 } {
+		endit
+	}
+	set mod_qos_vals(GrpWall) "-1"
 }
-set mod_qos_vals(GrpWall) "-1"
 
 #
 # Test Max Cpu Mins
diff --git a/testsuite/expect/test21.33 b/testsuite/expect/test21.33
new file mode 100755
index 000000000..be031316a
--- /dev/null
+++ b/testsuite/expect/test21.33
@@ -0,0 +1,234 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Validates that a resource can be added to a cluster after
+#          it has been created
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 SchedMD LLC
+# Written by Nathan Yee <nyee32@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals_accounting
+
+set test_id                          21.33
+set exit_code                        0
+set test_cluster                     "test$test_id\_cluster"
+set test_res1                        "test$test_id\_res1"
+set test_res2                        "test$test_id\_res2"
+set access_err                       0
+
+array set res1 {}
+set res1(count)                      50
+set res1(server)                     "test$test_id\_server1"
+set res1(servertype)                 "test$test_id\_server_type1"
+set res1(type)                       "license"
+
+
+array set res2 {}
+set res2(count)                      25
+set res2(server)                     "test$test_id\_server2"
+set res2(servertype)                 "test$test_id\_server_type2"
+set res2(type)                       "license"
+
+array set res1_cluster {}
+set res1_cluster(cluster)            $test_cluster
+set res1_cluster(server)             "test$test_id\_server1"
+set res1_cluster(percentallowed)     25
+
+
+array set res2_cluster {}
+set res2_cluster(cluster)            $test_cluster
+set res2_cluster(server)             "test$test_id\_server2"
+set res2_cluster(percentallowed)     25
+
+proc clean_up { } {
+	global test_res1 test_res2 test_cluster
+
+	remove_res $test_res1
+	remove_res $test_res2
+	remove_cluster $test_cluster
+}
+
+proc check_val { res_name } {
+
+	global sacctmgr test_cluster exit_code
+
+	set rc 0
+	spawn $sacctmgr -n show resource withcluster cluster=$test_cluster \
+	    format=name%-30
+	expect {
+		-re "$res_name" {
+			set rc 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	return $rc
+}
+
+print_header $test_id
+
+if { [test_using_slurmdbd] == 0 } {
+        send_user "\nWARNING: This test can't be run without AccountStorageType=slurmdbd\n"
+        exit $exit_code
+} elseif { [test_super_user] == 0} {
+        send_user "\nWARNING: This test can't be run without superuser permissions\n"
+        exit $exit_code
+}
+
+# Delete any vestigial data
+clean_up
+
+set added 0
+spawn $sacctmgr add -i cluster $test_cluster
+expect {
+	-re "Adding Cluster" {
+		set added 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacctmgr is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$added != 1} {
+	send_user "\nFAILURE: test cluster was not added\n"
+	exit 1
+}
+
+#
+# Add resources
+#
+add_resource $test_res1 [array get res1]
+if {[check_resource_limits $test_res1 [array get res1]]} {
+	send_user "\nFAILURE: $test_res1 has bad values\n"
+	clean_up
+}
+
+add_resource $test_res2 [array get res2]
+if {[check_resource_limits $test_res2 [array get res2]]} {
+	send_user "\nFAILURE: $test_res2 has bad values\n"
+	clean_up
+}
+
+#
+# Add a resources to the cluster
+#
+add_resource $test_res1 [array get res1_cluster]
+
+if {[check_val $test_res1] != 1} {
+	send_user "\nFAILURE: sacctmgr did not add resource $test_res1 to "
+	send_user "cluster $test_cluster\n"
+	set exit_code 1
+}
+
+#
+# Add another resource to the cluster
+#
+add_resource $test_res2 [array get res2_cluster]
+
+if {[check_val $test_res2] != 1} {
+	send_user "\nFAILURE: sacctmgr did not add resource $test_res2 to "
+	send_user "cluster $test_cluster\n"
+	set exit_code 1
+}
+
+#
+# Remove resource from the cluster
+#
+set deleted 0
+spawn $sacctmgr delete resource -i where name=$test_res1 \
+    server=$res1(server) cluster=$test_cluster
+expect {
+	-re "Deleting" {
+		set deleted 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacctmgr is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$deleted != 1} {
+	send_user "\nFAILURE: resource $test_res1 was not deleted\n"
+	set exit_code 1
+}
+
+if {[check_val $test_res2] != 1} {
+	send_user "\nFAILURE: only $test_res2 should be associated with "
+	send_user "cluster $test_cluster\n"
+	set exit_code 1
+}
+
+remove_res $test_res1
+remove_res $test_res2
+
+set match 0
+spawn $sacctmgr show resource -n withcluster cluster=$test_cluster
+expect {
+	-re "$test_res1" {
+		set match 1
+		exp_continue
+	}
+	-re "$test_res2" {
+		set match 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacctmgr is not reponding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {$match != 0} {
+	send_user "\nFAILURE: $test_res1 and $test_res2 were not deleted\n"
+	set exit_code 1
+}
+
+remove_cluster $test_cluster
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nFAILURE\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test21.34 b/testsuite/expect/test21.34
index b3db1471c..14dae5fdf 100755
--- a/testsuite/expect/test21.34
+++ b/testsuite/expect/test21.34
@@ -237,6 +237,11 @@ if {[test_super_user] == 0} {
 	send_user "\nWARNING Test can only be ran as SlurmUser\n"
 	exit 0
 }
+if { ![string compare [priority_type] "multifactor"] } {
+	set prio_multifactor 1
+} else {
+	set prio_multifactor 0
+}
 
 # Remove any vestigial data
 cleanup
diff --git a/testsuite/expect/test21.36 b/testsuite/expect/test21.36
new file mode 100755
index 000000000..434755269
--- /dev/null
+++ b/testsuite/expect/test21.36
@@ -0,0 +1,253 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Validates that sacctmgr lost jobs returns lost jobs
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2016 SchedMD LLC
+# Written by Nathan Yee <nyee32@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+source ./globals_accounting
+
+set test_id          21.36
+set sql_query        "test$test_id\-query.sql"
+set sql_query_rem    "test$test_id\-query-rem.sql"
+set cluster          "test$test_id\_clus"
+set account          "test$test_id\_acct"
+set user             "test$test_id\_user"
+set config_dir       ""
+set exit_code        1
+set access_err       0
+set test_conf_file   "/tmp/slurm.conf\_$test_id"
+
+# Cluster requirments
+array set clus_req {}
+
+# Account requirments
+set acct_req(cluster) $cluster
+
+# User requirments
+set user_req(account) $account
+set user_req(cluster) $cluster
+
+# Remove pre-existing items
+proc cleanup { } {
+	global cluster account user bin_rm sql_query sql_query_rem
+	remove_cluster "$cluster"
+	remove_acct "" $account
+	remove_user "" "" $user
+	exec $bin_rm -f $sql_query $sql_query_rem
+}
+
+proc endit { } {
+	global exit_code
+	cleanup
+
+	if {$exit_code == 0} {
+		send_user "\nSUCCESS\n"
+	} else {
+		send_user "\nFAILURE\n"
+	}
+
+	exit $exit_code
+}
+
+
+print_header $test_id
+
+if {[test_using_slurmdbd] == 0} {
+	send_user "\nThis test can't be run without AccountStorageType=slurmdbd\n"
+	exit 0
+}
+
+# Remove pre-existing items
+cleanup
+
+# DON'T MESS WITH THIS UNLESS YOU REALLY UNDERSTAND WHAT YOU ARE DOING!!!!!
+# THIS COULD SERIOUSLY MESS UP YOUR DATABASE IF YOU ALTER THIS INCORRECTLY
+# JUST A FRIENDLY REMINDER ;)
+
+# Insert a job that has no end time and is still in running state
+set file [open $sql_query "w"]
+puts $file "insert into job_table (jobid, associd, wckey, wckeyid, uid, gid, `partition`, blockid, cluster, account, eligible, submit, start, end, suspended, name, track_steps, state, comp_code, priority, req_cpus, tres_alloc, nodelist, kill_requid, qos, deleted) values"
+puts $file "('65536', '6', 'test21-36wckey', '1', '1002', '1002', 'debug', '', '$cluster', '$account', 1199170800, 1199170800, 1199170800, 0, '0', 'test21.32_job1', '0', '1', '0', '2', 2, '1=2', 'test21.36_node', '0', '0', '0')"
+puts $file "on duplicate key update id=LAST_INSERT_ID(id), eligible=VALUES(eligible), submit=VALUES(submit), start=VALUES(start), end=VALUES(end), associd=VALUES(associd), tres_alloc=VALUES(tres_alloc), wckey=VALUES(wckey), wckeyid=VALUES(wckeyid);"
+close $file
+
+# Make SQL file to remove the inserted job
+set file [open $sql_query_rem "w"]
+puts $file [format "%s%s%s" "truncate table \"" $cluster "_job_table\";"]
+close $file
+
+# Add Test Cluster
+if {[add_cluster $cluster [array get clus_req]]} {
+	endit
+}
+
+# Add Test Account
+if {[add_acct $account [array get acct_req]]} {
+	endit
+}
+
+# Add Test User
+if {[add_user $user [array get user_req]]} {
+	endit
+}
+
+#
+# Get the slurm.conf path
+#
+set got_config 0
+log_user 0
+spawn $scontrol show config
+expect {
+	-re "SLURM_CONF.*= (/.*)/($alpha).*SLURM_VERSION" {
+		set config_dir $expect_out(1,string)
+		set got_config 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+log_user 1
+if {$got_config == 0} {
+	send_user "\nFAILURE: Could not find configuration file location\n"
+	endit
+
+}
+
+# Get the current working directory
+set cwd "[$bin_pwd]"
+
+#
+# Copy the original slurm.conf file
+#
+spawn $bin_cp -v $config_dir/slurm.conf $test_conf_file
+expect {
+	timeout {
+		send_user "\nFAILURE: slurm.conf was not copied\n"
+		endit
+	}
+	eof {
+		wait
+	}
+}
+if {![file exists $test_conf_file]} {
+	send_user "\nFAILURE: slurm.conf was not copied\n"
+	endit
+}
+
+#
+# Add test cluster name to the slurm.conf
+#
+spawn $bin_sed -i "s/\\(ClusterName=\\).*/\\1$cluster/gI" $test_conf_file
+expect {
+	-re "sed:" {
+		send_user "\nERROR: Unable to make temp slurm.conf\n"
+		endit
+	}
+	eof {
+		wait
+	}
+}
+
+# Double check that cluster name was set correctly.
+set match 0
+spawn $bin_grep -i "^ClusterName=$cluster" $test_conf_file
+expect {
+        -nocase "ClusterName=$cluster" {
+		incr match
+	}
+	eof {
+		wait
+	}
+}
+
+if {$match == 0} {
+	send_user "\nERROR: $test_conf_file doesn't have correct cluster name\n"
+	endit
+}
+
+# Load a job to the database that has no end time.
+if {[archive_load $sql_query]} {
+	archive_load $sql_query_rem
+	endit
+}
+
+# Test sacctmgr show lost jobs
+set list_job 0
+# Use temp conf file to use different cluster name.
+set env(SLURM_CONF) $test_conf_file
+spawn $sacctmgr show -i lost jobs
+expect {
+	-re "NOTE: Lost jobs" {
+		set list_job 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacctmgr is not responding\n"
+		endit
+	}
+	eof {
+		wait
+	}
+}
+
+if {$list_job != 1} {
+	send_user "\nFAILURE: sacctmgr did not find any lost jobs when "
+	send_user "it should have\n"
+	endit
+}
+
+# Check that jobs were fixed
+set list_job 0
+spawn $sacctmgr show -i lost jobs
+expect {
+	-re "No lost jobs found" {
+		set list_job 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sacctmgr is not responding\n"
+		endit
+	}
+	eof {
+		wait
+	}
+}
+
+if {$list_job != 1} {
+	send_user "\nFAILURE: sacctmgr found lost jobs when "
+	send_user "it should not have\n"
+	endit
+}
+
+set exit_code 0
+endit
diff --git a/testsuite/expect/test22.1 b/testsuite/expect/test22.1
index 76192af4c..c15388a31 100755
--- a/testsuite/expect/test22.1
+++ b/testsuite/expect/test22.1
@@ -1,7 +1,8 @@
 #!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Test sreport cluster utilization.
+#          Test sreport cluster utilization. Also test for
+#          sreport -M option
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
 #          "FAILURE: ..." otherwise with an explanation of the failure, OR
@@ -38,15 +39,19 @@ source ./inc22.1.2
 source ./inc22.1.3
 source ./inc22.1.4
 
-set test_id     "test22.1"
+set test_id     "22.1"
+set test_name   "test22.1"
 set test_nu     "test22-1"
 set exit_code   0
 set matches     0
 set not_support 0
-set sql_in     "$test_id-in.sql"
-set sql_rem    "$test_id-rem.sql"
-set sql_out    "$test_id-out.sql"
-set cluster    [format "%s%s" $test_nu "clus"]
+set sql_in_clus1     "$test_name-clus1-in.sql"
+set sql_rem_clus1    "$test_name-clus1-rem.sql"
+set sql_in_clus2     "$test_name-clus2-in.sql"
+set sql_rem_clus2    "$test_name-clus2-rem.sql"
+set sql_out    "$test_name-out.sql"
+set cluster1    [format "%s%s" $test_nu "clus1"]
+set cluster2    [format "%s%s" $test_nu "clus2"]
 set account1   [format "%s%s" $test_nu "acct1"]
 set account2   [format "%s%s" $test_nu "acct2"]
 set account3   [format "%s%s" $test_nu "acct3"]
@@ -55,11 +60,14 @@ set wckey1     [format "%s%s" $test_nu "wckey"]
 set user1      [format "%s%s" $test_nu "user1"]
 set user2      [format "%s%s" $test_nu "user2"]
 set users      [format "%s,%s" $user1 $user2]
-set node0      [format "%s%d" $cluster 0]
-set node1      [format "%s%d" $cluster 1]
-set node_list  [format "%s%s" $cluster "\[0-1\]"]
+set node0      [format "%s%d" $cluster1 0]
+set node1      [format "%s%d" $cluster1 1]
+set node_list  [format "%s%s" $cluster1 "\[0-1\]"]
 set node0_cpus 2
 set node1_cpus 2
+set test_job1  "$test_name\_job1"
+set test_job2  "$test_name\_job2"
+set test_job3  "$test_name\_job3"
 set cluster_cpus [expr $node0_cpus + $node1_cpus]
 set access_err  0
 set uid [get_my_uid]
@@ -69,18 +77,18 @@ set timeout 120
 # Cluster
 array set clus_req {}
 
-# Account 1
+# Account 1 Cluster 1
 array set acct_req1 {}
-set acct_req1(cluster) $cluster
+set acct_req1(cluster) "$cluster1,$cluster2"
 
-# Account 2
+# Account 2 Cluster 1
 array set acct_req2 {}
-set acct_req2(cluster) $cluster
+set acct_req2(cluster) "$cluster1,$cluster2"
 set acct_req2(parent) $account2
 
-# User
+# User Cluster 1
 array set user_req {}
-set user_req(cluster) $cluster
+set user_req(cluster) "$cluster1,$cluster2"
 set user_req(account) $accounts
 set user_req(wckey) $wckey1
 
@@ -90,7 +98,7 @@ print_header $test_id
 # Fri Thu Jan 31 00:00:00 2008 - Needed only for the 00:00:00 for timing purposes
 set midnight_time "Thu Jan 31 00:00:00 2008"
 set midnight [exec date -d $midnight_time +%s]
- 
+
 # Mon Dec 31 23:00:00 2007
 set start_date "Mon Dec 31 23:00:00 2007"
 set period_start [exec date -d $start_date +%s]
@@ -131,7 +139,7 @@ set job2_end [expr $job2_start+$job2_run]
 set job2_diff_str "1-00:00:00"
 set job2_start_str [timestamp -format %Y-%m-%dT%X -seconds $job2_start]
 set job2_end_str [timestamp -format %Y-%m-%dT%X -seconds $job2_end]
-set job2_nodes [format "%s\[%s\]" $cluster "0-1"]
+set job2_nodes [format "%s\[%s\]" $cluster1 "0-1"]
 set job2_cpus [expr $node0_cpus + $node1_cpus]
 set job2_alloc [expr $job2_run * $job2_cpus]
 set job2_acct $account3
@@ -190,11 +198,14 @@ if { [string compare [check_accounting_admin_level] "Administrator"] } {
 
 remove_user "" "" $users
 remove_acct "" $accounts
-remove_cluster "$cluster"
+remove_cluster "$cluster1"
+remove_cluster "$cluster2"
 #add cluster
-incr exit_code [add_cluster $cluster [array get clus_req]]
+incr exit_code [add_cluster $cluster1 [array get clus_req]]
+incr exit_code [add_cluster $cluster2 [array get clus_req]]
 if { $exit_code } {
- 	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
+	remove_cluster "$cluster2"
 	exit $exit_code
 }
 
@@ -202,7 +213,8 @@ if { $exit_code } {
 incr exit_code [add_acct "$account1,$account2" [array get acct_req1]]
 if { $exit_code } {
 	remove_acct "" "$account1,$account2"
-	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
+	remove_cluster "$cluster2"
 	exit $exit_code
 }
 
@@ -210,7 +222,8 @@ if { $exit_code } {
 incr exit_code [add_acct $account3 [array get acct_req2]]
 if { $exit_code } {
 	remove_acct "" $accounts
-	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
+	remove_cluster "$cluster2"
 	exit $exit_code
 }
 
@@ -219,7 +232,8 @@ incr exit_code [add_user $users [array get user_req]]
 if { $exit_code } {
 	remove_user "" "" $users
 	remove_acct "" $accounts
-	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
+	remove_cluster "$cluster2"
 	exit $exit_code
 }
 
@@ -230,11 +244,11 @@ set user1acct3 0
 set user2acct1 0
 set user2acct2 0
 set user2acct3 0
-set my_pid [eval spawn $sacctmgr -n -p list assoc users=$users account=$accounts cluster=$cluster format="User,account,id"]
+set my_pid [eval spawn $sacctmgr -n -p list assoc users=$users account=$accounts cluster=$cluster2 format="User,account,id"]
 expect {
 	-re "There was a problem" {
 		send_user "FAILURE: there was a problem with the sacctmgr command\n"
-	    	incr exit_code 1
+		incr exit_code 1
 	}
 	-re "$user1.$account1.($number)." {
 		set user1acct1 $expect_out(1,string)
@@ -275,18 +289,18 @@ if {!$user1acct1 || !$user1acct2 || !$user1acct3 || !$user2acct1 || !$user2acct2
 	incr exit_code 1
 	remove_user "" "" $users
 	remove_acct "" $accounts
-	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
 	exit $exit_code
 }
 
 #get the user association ids for the jobs we plan to add
 set user1wckey1 0
 set user2wckey1 0
-set my_pid [eval spawn $sacctmgr -n -p list wckeys users=$users wckeys=$wckey1 cluster=$cluster format="user,wckey,id"]
+set my_pid [eval spawn $sacctmgr -n -p list wckeys users=$users wckeys=$wckey1 cluster=$cluster1 format="user,wckey,id"]
 expect {
 	-re "There was a problem" {
 		send_user "FAILURE: there was a problem with the sacctmgr command\n"
-	    	incr exit_code 1
+		incr exit_code 1
 	}
 	-re "$user1.$wckey1.($number)." {
 		set user1wckey1 $expect_out(1,string)
@@ -311,204 +325,224 @@ if {!$user1wckey1 || !$user1wckey1} {
 	incr exit_code 1
 	remove_user "" "" $users
 	remove_acct "" $accounts
-	remove_cluster "$cluster"
+	remove_cluster "$cluster1"
 	exit $exit_code
 }
 
-exec $bin_rm -f $sql_in
-set file [open $sql_in "w"]
-
-
-
-# DON'T MESS WITH THIS UNLESS YOU REALLY UNDERSTAND WHAT YOU ARE DOING!!!!!
-# THIS COULD SERIOUSLY MESS UP YOUR DATABASE IF YOU ALTER THIS INCORRECTLY
-# JUST A FRIENDLY REMINDER ;)
-
-# put in the cluster for back in the day before accounting was made here for us we are using 'Tue Jan  1 00:00:00 2008' = 1199174400 as the start
-
-puts $file "insert into cluster_event_table (node_name, cluster, tres, period_start, period_end, reason, cluster_nodes) values"
-puts $file "('', '$cluster', '1=$cluster_cpus', $period_start, $period_end, 'Cluster processor count', '$node_list' )"
-
-#put a node down for 30 minutes starting at 45 minutes after the start to make sure our rollups work so we should get 15 minutes on one hour and 15 on the other
-puts $file ", ('$node0', '$cluster', '1=$node0_cpus', $node0_down_start, $node0_down_end, 'down','')"
-#puts $file ", ('$node1', '$cluster', '1=$node1_cpus', $period_start, $period_end, 'down')"
-puts $file "on duplicate key update period_start=VALUES(period_start), period_end=VALUES(period_end);"
-
-#now we will put in a job running for an hour and 5 minutes
-puts $file "insert into job_table (jobid, associd, wckey, wckeyid, uid, gid, `partition`, blockid, cluster, account, eligible, submit, start, end, suspended, name, track_steps, state, comp_code, priority, req_cpus, tres_alloc, nodelist, kill_requid, qos, deleted) values"
-puts $file "('65536', '$user1acct1', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job1_acct', $job0_start, $job0_start, $job0_start, $job0_end, '0', 'test_job1', '0', '3', '0', '$job1_cpus', $job1_cpus, '1=$job1_cpus', '$job1_nodes', '0', '0', '0')"
-puts $file "('65537', '$user1acct1', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job1_acct', $job1_start, $job1_start, $job1_start, $job1_end, '0', 'test_job1', '0', '3', '0', '$job1_cpus', $job1_cpus, '1=$job1_cpus', '$job1_nodes', '0', '0', '0')"
-puts $file ", ('65538', '$user2acct3', '$wckey1', '$user2wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job2_acct', $job2_elig, $job2_elig, $job2_start, $job2_end, '0', 'test_job2', '0', '3', '0', '$job2_cpus', '$job2_cpus', '1=$job2_cpus', '$job2_nodes', '0', '0', '0')"
-puts $file ", ('65539', '$user1acct2', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job3_acct', $job3_elig, $job3_elig, $job3_start, $job3_end, '0', 'test_job3', '0', '3', '0', '$job3_cpus', '$job3_cpus', '1=$job3_cpus', '$job3_nodes', '0', '0', '0')"
-puts $file "on duplicate key update id=LAST_INSERT_ID(id), eligible=VALUES(eligible), submit=VALUES(submit), start=VALUES(start), end=VALUES(end), associd=VALUES(associd), tres_alloc=VALUES(tres_alloc), wckey=VALUES(wckey), wckeyid=VALUES(wckeyid);";
-close $file
-
-exec $bin_rm -f $sql_rem
-set file [open $sql_rem "w"]
-
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_event_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_job_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_step_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_day_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_hour_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_month_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_day_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_hour_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_month_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_day_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_hour_table\";"]
-puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_month_table\";"]
-close $file
-
-#
-# Use sacctmgr to load info
-#
-incr exit_code [archive_load $sql_in]
-
-if { $exit_code } {
-	incr exit_code [archive_load $sql_rem]
-	remove_user "" "" $users
-	remove_acct "" $accounts
-	remove_cluster "$cluster"
-	exit $exit_code
-}
-
-
-#
-# Use sacct to see if the job loaded
-#
-set matches 0
-set my_pid [eval spawn $sacct -p -C $cluster --format=cluster,account,associd,wckey,wckeyid,start,end,elapsed --noheader --start=$start_str --end=$end_str]
-expect {
-	-re "There was a problem" {
-		send_user "FAILURE: there was a problem with the sacct command\n"
-	    	incr exit_code 1
-	}
-	-re "$cluster.$account1.$user1acct1.$wckey1.$user1wckey1.$job1_start_str.$job1_end_str.$job1_diff_str." {
-		send_user "got 1\n"
-		incr matches
-		exp_continue
-	}
-	-re "$cluster.$account3.$user2acct3.$wckey1.$user2wckey1.$job2_start_str.$job2_end_str.$job2_diff_str." {
-		send_user "got 2\n"
-		incr matches
-		exp_continue
-	}
-	-re "$cluster.$account2.$user1acct2.$wckey1.$user1wckey1.$job3_start_str.$job3_end_str.$job3_diff_str." {
-		send_user "got 3\n"
-		incr matches
-		exp_continue
+proc create_sql {cluster sql_in sql_rem} {
+
+	global bin_rm cluster_cpus period_start period_end node_list exit_code
+	global node0 node0_cpus node0_down_start node0_down_end
+	global user1acct1 wckey1 user1wckey1 uid gid debug job1_acct job0_start job0_end
+	global job1_cpus job1_nodes job1_start job1_end user2acct3 user2wckey1
+	global job2_acct job2_elig job2_start job2_end job2_cpus job2_nodes
+	global user1acct2 job3_acct job3_elig job3_start job3_end job3_cpus
+	global job3_nodes sacct start_str end_str account1 job1_start_str
+	global job1_end_str job1_diff_str account3 job2_start_str
+	global job2_end_str job2_diff_str account2 job3_start_str
+	global job3_end_str job3_diff_str sacctmgr node0_start_str
+	global node0_end_str matches users accounts
+	global test_job1 test_job2 test_job3
+
+
+	exec $bin_rm -f $sql_in
+	set file [open $sql_in "w"]
+
+
+	# DON'T MESS WITH THIS UNLESS YOU REALLY UNDERSTAND WHAT YOU ARE DOING!!!!!
+	# THIS COULD SERIOUSLY MESS UP YOUR DATABASE IF YOU ALTER THIS INCORRECTLY
+	# JUST A FRIENDLY REMINDER ;)
+
+	# put in the cluster for back in the day before accounting was made here for us we are using 'Tue Jan  1 00:00:00 2008' = 1199174400 as the start
+
+	puts $file "insert into cluster_event_table (node_name, cluster, tres, period_start, period_end, reason, cluster_nodes) values"
+	puts $file "('', '$cluster', '1=$cluster_cpus', $period_start, $period_end, 'Cluster processor count', '$node_list' )"
+
+	#put a node down for 30 minutes starting at 45 minutes after the start to make sure our rollups work so we should get 15 minutes on one hour and 15 on the other
+	puts $file ", ('$node0', '$cluster', '1=$node0_cpus', $node0_down_start, $node0_down_end, 'down','')"
+	#puts $file ", ('$node1', '$cluster', '1=$node1_cpus', $period_start, $period_end, 'down')"
+	puts $file "on duplicate key update period_start=VALUES(period_start), period_end=VALUES(period_end);"
+
+	#now we will put in a job running for an hour and 5 minutes
+	puts $file "insert into job_table (jobid, associd, wckey, wckeyid, uid, gid, `partition`, blockid, cluster, account, eligible, submit, start, end, suspended, name, track_steps, state, comp_code, priority, req_cpus, tres_alloc, nodelist, kill_requid, qos, deleted) values"
+	puts $file "('65536', '$user1acct1', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job1_acct', $job0_start, $job0_start, $job0_start, $job0_end, '0', '$test_job1', '0', '3', '0', '$job1_cpus', $job1_cpus, '1=$job1_cpus', '$job1_nodes', '0', '0', '0')"
+	puts $file "('65537', '$user1acct1', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job1_acct', $job1_start, $job1_start, $job1_start, $job1_end, '0', '$test_job1', '0', '3', '0', '$job1_cpus', $job1_cpus, '1=$job1_cpus', '$job1_nodes', '0', '0', '0')"
+	puts $file ", ('65538', '$user2acct3', '$wckey1', '$user2wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job2_acct', $job2_elig, $job2_elig, $job2_start, $job2_end, '0', '$test_job2', '0', '3', '0', '$job2_cpus', '$job2_cpus', '1=$job2_cpus', '$job2_nodes', '0', '0', '0')"
+	puts $file ", ('65539', '$user1acct2', '$wckey1', '$user1wckey1', '$uid', '$gid', 'debug', '', '$cluster', '$job3_acct', $job3_elig, $job3_elig, $job3_start, $job3_end, '0', '$test_job3', '0', '3', '0', '$job3_cpus', '$job3_cpus', '1=$job3_cpus', '$job3_nodes', '0', '0', '0')"
+	puts $file "on duplicate key update id=LAST_INSERT_ID(id), eligible=VALUES(eligible), submit=VALUES(submit), start=VALUES(start), end=VALUES(end), associd=VALUES(associd), tres_alloc=VALUES(tres_alloc), wckey=VALUES(wckey), wckeyid=VALUES(wckeyid);";
+	close $file
+
+	exec $bin_rm -f $sql_rem
+	set file [open $sql_rem "w"]
+
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_event_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_job_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_step_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_day_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_hour_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_usage_month_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_day_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_hour_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_assoc_usage_month_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_day_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_hour_table\";"]
+	puts $file [format "%s%s%s" "truncate table \"" $cluster "_wckey_usage_month_table\";"]
+	close $file
+
+
+	#
+	# Use sacctmgr to load info
+	#
+	incr exit_code [archive_load $sql_in]
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster"
+		exit $exit_code
 	}
 
-	timeout {
-		send_user "\nFAILURE: sacctmgr archive load not responding\n"
-		slow_kill $my_pid
-		incr exit_code 1
+	#
+	# Use sacct to see if the job loaded
+	#
+	set matches 0
+	set my_pid [eval spawn $sacct -p -C $cluster --format=cluster,account,associd,wckey,wckeyid,start,end,elapsed --noheader --start=$start_str --end=$end_str]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacct command\n"
+			incr exit_code 1
+		}
+		-re "$cluster.$account1.$user1acct1.$wckey1.$user1wckey1.$job1_start_str.$job1_end_str.$job1_diff_str." {
+			send_user "got 1\n"
+			incr matches
+			exp_continue
+		}
+		-re "$cluster.$account3.$user2acct3.$wckey1.$user2wckey1.$job2_start_str.$job2_end_str.$job2_diff_str." {
+			send_user "got 2\n"
+			incr matches
+			exp_continue
+		}
+		-re "$cluster.$account2.$user1acct2.$wckey1.$user1wckey1.$job3_start_str.$job3_end_str.$job3_diff_str." {
+			send_user "got 3\n"
+			incr matches
+			exp_continue
+		}
+
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
 	}
-	eof {
-		wait
-	}
-}
 
-if {$matches != 3} {
-	send_user "\nFAILURE:  job wasn't loaded correctly with only $matches.\n"
-	incr exit_code 1
-}
-
-if { $exit_code } {
-	#incr exit_code [archive_load $sql_rem]
-	remove_user "" "" $users
-	remove_acct "" $accounts
-	remove_cluster "$cluster"
-	exit $exit_code
-}
-
-#
-# Use sacctmgr to see if node event loaded
-#
-
-send_user "$cluster..$start_str.$end_str.$cluster_cpus.$node_list.\n"
-
-set matches 0
-set my_pid [eval spawn $sacctmgr -p list events cluster=$cluster format=cluster,noden,start,end,cpu --noheader start=$start_str end=$end_str]
-expect {
-	-re "There was a problem" {
-		send_user "FAILURE: there was a problem with the sacctmgr command\n"
+	if {$matches != 3} {
+		send_user "\nFAILURE:  job wasn't loaded correctly with only $matches.\n"
 		incr exit_code 1
 	}
-	-re "($cluster..$start_str.$end_str.$cluster_cpus.)" {
-		send_user "got 1\n"
-		incr matches
-		exp_continue
+
+	if { $exit_code } {
+		#incr exit_code [archive_load $sql_rem]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster"
+		exit $exit_code
 	}
-	-re "($cluster.$node0.$node0_start_str.$node0_end_str.$node0_cpus.)" {
-		send_user "got 2\n"
-		incr matches
-		exp_continue
+
+	#
+	# Use sacctmgr to see if node event loaded
+	#
+
+	send_user "$cluster..$start_str.$end_str.$cluster_cpus.$node_list.\n"
+
+	set matches 0
+	set my_pid [eval spawn $sacctmgr -p list events cluster=$cluster format=cluster,noden,start,end,cpu --noheader start=$start_str end=$end_str]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command\n"
+			incr exit_code 1
+		}
+		-re "($cluster..$start_str.$end_str.$cluster_cpus.)" {
+			send_user "got 1\n"
+			incr matches
+			exp_continue
+		}
+		-re "($cluster.$node0.$node0_start_str.$node0_end_str.$node0_cpus.)" {
+			send_user "got 2\n"
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
 	}
-	timeout {
-		send_user "\nFAILURE: sacctmgr archive load not responding\n"
-		slow_kill $my_pid
+
+	if {$matches != 2} {
+		send_user "\nFAILURE:  cluster env wasn't loaded correctly with only $matches.\n"
 		incr exit_code 1
 	}
-	eof {
-		wait
-	}
-}
 
-if {$matches != 2} {
-	send_user "\nFAILURE:  cluster env wasn't loaded correctly with only $matches.\n"
-	incr exit_code 1
-}
-
-if { $exit_code } {
-	#incr exit_code [archive_load $sql_rem]
-	remove_user "" "" $users
-	remove_acct "" $accounts
-	remove_cluster "$cluster"
-	exit $exit_code
-}
-
-#
-# Use sacctmgr to roll up that time period
-#
-set matches 0
-set my_pid [eval spawn $sacctmgr -i roll $start_str $end_str]
-expect {
-	-re "There was a problem" {
-		send_user "FAILURE: there was a problem with the sacctmgr command\n"
-	    	incr exit_code 1
+	if { $exit_code } {
+		#incr exit_code [archive_load $sql_rem]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster"
+		exit $exit_code
 	}
-	-re "$cluster" {
-		incr matches
-		exp_continue
-	}
-	-re "SUCCESS" {
-		incr matches
-		exp_continue
+
+	#
+	# Use sacctmgr to roll up that time period
+	#
+	set matches 0
+	set my_pid [eval spawn $sacctmgr -i roll $start_str $end_str]
+	expect {
+		-re "There was a problem" {
+			send_user "FAILURE: there was a problem with the sacctmgr command\n"
+			incr exit_code 1
+		}
+		-re "$cluster" {
+			incr matches
+			exp_continue
+		}
+		-re "SUCCESS" {
+			incr matches
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr archive load not responding\n"
+			slow_kill $my_pid
+			incr exit_code 1
+		}
+		eof {
+			wait
+		}
 	}
-	timeout {
-		send_user "\nFAILURE: sacctmgr archive load not responding\n"
-		slow_kill $my_pid
+
+	if {$matches != 1} {
+		send_user "\nFAILURE:  sacctmgr wasn't able to roll data.\n"
 		incr exit_code 1
 	}
-	eof {
-		wait
+
+	if { $exit_code } {
+		incr exit_code [archive_load $sql_rem]
+		remove_user "" "" $users
+		remove_acct "" $accounts
+		remove_cluster "$cluster"
+		exit $exit_code
 	}
 }
 
-if {$matches != 1} {
-	send_user "\nFAILURE:  sacctmgr wasn't able to roll data.\n"
-	incr exit_code 1
-}
+create_sql $cluster1 $sql_in_clus1 $sql_rem_clus1
+create_sql $cluster2 $sql_in_clus2 $sql_rem_clus2
 
-if { $exit_code } {
-	incr exit_code [archive_load $sql_rem]
-	remove_user "" "" $users
-	remove_acct "" $accounts
-	remove_cluster "$cluster"
-	exit $exit_code
-}
 
 #
 # Execute sub-test
@@ -521,27 +555,18 @@ inc22_1_3
 
 inc22_1_4
 
-if {$matches != 1} {
-	send_user "\nFAILURE:  sreport didn't give good info 25 $matches.\n"
-	incr exit_code 1
-}
-
-if { $exit_code } {
-	incr exit_code [archive_load $sql_rem]
-	remove_user "" "" $users
-	remove_acct "" $accounts
-	remove_cluster "$cluster"
-	exit $exit_code
-}
-
 if {$exit_code == 0} {
-	incr exit_code [archive_load $sql_rem]
+	incr exit_code [archive_load $sql_rem_clus1]
+	incr exit_code [archive_load $sql_rem_clus2]
 	incr exit_code [remove_user "" "" $users]
 	incr exit_code [remove_acct "" $accounts]
-	incr exit_code [remove_cluster "$cluster"]
+	incr exit_code [remove_cluster "$cluster1"]
+	incr exit_code [remove_cluster "$cluster2"]
 
- 	exec $bin_rm -f $sql_in
- 	exec $bin_rm -f $sql_rem
+	exec $bin_rm -f $sql_in_clus1
+	exec $bin_rm -f $sql_rem_clus1
+	exec $bin_rm -f $sql_in_clus2
+	exec $bin_rm -f $sql_rem_clus2
 	if {$exit_code == 0} {
 		send_user "\nSUCCESS\n"
 	} else {
diff --git a/testsuite/expect/test23.2 b/testsuite/expect/test23.2
index a8c9f8469..90c2dc0b2 100755
--- a/testsuite/expect/test23.2
+++ b/testsuite/expect/test23.2
@@ -37,7 +37,7 @@ set exit_code   0
 set file_in1    "test$test_id.input1"
 set file_in2    "test$test_id.input2"
 set file_in3    "test$test_id.input3"
-set test_acct   "test_acct"
+set test_acct   "test$test_id\_acct"
 set timeout     $max_job_delay
 
 print_header $test_id
@@ -182,7 +182,7 @@ expect {
 log_user 1
 if {$real_memory < 100} {
 	set job_mem_opt  "--comment=no_mem_limit"
-	set step_mem_opt ""
+	set step_mem_opt "-t1"
 } else {
 	set job_mem_opt  "--mem=100"
 	set step_mem_opt "--mem=20"
@@ -192,9 +192,9 @@ if {$real_memory < 100} {
 # Build input script file1
 #
 make_bash_script $file_in1 "
-  $srun $step_mem_opt sleep 60 &
-  $srun $step_mem_opt sleep 60 &
-  $srun $step_mem_opt sleep 60
+  $srun $step_mem_opt --gres=craynetwork:0 sleep 60 &
+  $srun $step_mem_opt --gres=craynetwork:0 sleep 60 &
+  $srun $step_mem_opt --gres=craynetwork:0 sleep 60
 "
 #
 # Spawn a job via srun using this account
@@ -202,7 +202,7 @@ make_bash_script $file_in1 "
 #       step per job if DefMemPerCPU or DefMemPerNode is configured.
 #
 set job_id3 0
-spawn $sbatch -N1 -t1 -v $job_mem_opt --account=$test_acct --output=/dev/null $file_in1
+spawn $sbatch -N1 -t1 -v $job_mem_opt --gres=craynetwork:0 --account=$test_acct --output=/dev/null $file_in1
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id3 $expect_out(1,string)
@@ -534,7 +534,7 @@ proc sstat_vargs { soption vargs job_id} {
 ################################################################
 set matches [sstat_job a $job_id3]
 if {$matches != 3} {
-	send_user "\nFAILURE: sstat -a failed ($matches)\n"
+	send_user "\nFAILURE: sstat -a failed ($matches != 3)\n"
 	set exit_code 1
 }
 
diff --git a/testsuite/expect/test28.6 b/testsuite/expect/test28.6
index 078fdef0a..812d07e15 100755
--- a/testsuite/expect/test28.6
+++ b/testsuite/expect/test28.6
@@ -32,11 +32,12 @@
 ############################################################################
 source ./globals
 
-set test_id	 "test28.6"
+set test_id	 "28.6"
+set test_name	 "test28.6"
 set job_id	 0
 set def_part	 ""
-set test_part	 "$test_id\_part"
-set script	 "$test_id\_script"
+set test_part	 "$test_name\_part"
+set script	 "$test_name\_script"
 set array_size	 2
 set exit_code	 0
 
diff --git a/testsuite/expect/test28.7 b/testsuite/expect/test28.7
index 404eedd18..2eb19aa93 100755
--- a/testsuite/expect/test28.7
+++ b/testsuite/expect/test28.7
@@ -50,7 +50,7 @@ make_bash_script $script "sleep \$(( ( RANDOM % 10 ) + 1 ))"
 # Submit a job array for first dependency test
 #
 set job_id 0
-spawn $sbatch -N1 -t1 -a 0-$top_array_task_id -o /dev/null -e /dev/null $script
+spawn $sbatch -N1 -t1 -a 0-$top_array_task_id -o /dev/null -e /dev/null --mem=10 $script
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -74,7 +74,7 @@ if { $job_id == 0 } {
 #
 set timeout $max_job_delay
 set match_job_state 0
-set srun_pid [spawn $srun -t1 --dependency=afterany:$job_id\_$top_array_task_id $scontrol show job $job_id\_$top_array_task_id]
+set srun_pid [spawn $srun -t1 --dependency=afterany:$job_id\_$top_array_task_id --mem=10 $scontrol show job $job_id\_$top_array_task_id]
 expect {
 	-re "JobState=COMPLETED|COMPLETING" {
 		set match_job_state 1
@@ -102,7 +102,7 @@ send_user "\nSo far, so good\n\n\n"
 # Submit a job array for second dependency test
 #
 set job_id 0
-spawn $sbatch -N1 -t1 -a 0-[expr $array_size - 1] -o /dev/null -e /dev/null $script
+spawn $sbatch -N1 -t1 -a 0-[expr $array_size - 1] -o /dev/null -e /dev/null --mem=10 $script
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -126,7 +126,7 @@ if { $job_id == 0 } {
 #
 set timeout $max_job_delay
 set match_job_state 0
-set srun_pid [spawn $srun -t1 --dependency=afterany:$job_id $scontrol show job $job_id]
+set srun_pid [spawn $srun -t1 --dependency=afterany:$job_id --mem=10 $scontrol show job $job_id]
 expect {
 	-re "JobState=COMPLETED|COMPLETING" {
 		incr match_job_state
diff --git a/testsuite/expect/test3.11 b/testsuite/expect/test3.11
index 962d310c4..cba2d4a0b 100755
--- a/testsuite/expect/test3.11
+++ b/testsuite/expect/test3.11
@@ -51,9 +51,9 @@ set res_nodes		""
 set res_nodecnt		0
 set res_thread_cnt	0
 set user_name		""
-set def_partition 	""
+set def_oversubscribe_force 0
+set def_partition	""
 set def_node		""
-set def_share_force     0
 set def_node_name	""
 set def_node_inx_min	-1
 set def_node_inx_max	-1
@@ -327,8 +327,8 @@ if {[string compare $def_partition ""] == 0} {
 
 spawn $scontrol show partition $def_partition
 expect {
-	-re " Shared=FORCE" {
-		set def_share_force 1
+	-re " OverSubscribe=FORCE" {
+		set def_oversubscribe_force 1
 		exp_continue
 	}
 	eof {
@@ -376,18 +376,23 @@ if {[string compare $def_node_name ""] == 0} {
 set core_spec 0
 set cores_per_socket 0
 set sockets_per_node 0
+set heterogeneous 0
 log_user 0
 spawn $scontrol show node -o
 expect {
 	-re "CoresPerSocket=($number)" {
 		if {$cores_per_socket == 0} {
 			set cores_per_socket $expect_out(1,string)
+		} elseif {$cores_per_socket != $expect_out(1,string)} {
+			set heterogeneous 1
 		}
 		exp_continue
 	}
 	-re "Sockets=($number)" {
 		if {$sockets_per_node == 0} {
 			set sockets_per_node $expect_out(1,string)
+		} elseif {$sockets_per_node != $expect_out(1,string)} {
+			set heterogeneous 1
 		}
 		exp_continue
 	}
@@ -406,6 +411,9 @@ expect {
 	}
 }
 log_user 1
+if {$heterogeneous != 0} {
+	send_user "\nWARNING: Cluster is heterogeneous and some tests may fail\n"
+}
 set cores_per_node [expr $cores_per_socket * $sockets_per_node]
 set node_count [available_nodes $def_partition ""]
 set cluster_cpus [expr $cores_per_node * $node_count]
@@ -415,6 +423,27 @@ if {[test_select_type_params "CR_SOCKET"]} {
 	set cr_socket 1
 }
 
+# Retrieve a node from partition and total cores in partition
+set states "idle"
+set node_list [get_partition_nodes $def_partition $states]
+set part_node_cnt [llength $node_list]
+if {$part_node_cnt == 0} {
+	send_user "\n\033\[34mWARNING: unable to get $states nodes in partition $def_partition"
+	exit $exit_code
+}
+
+set part_node [lindex $node_list 0]
+set part_node_cores [get_node_cores $part_node]
+if {$part_node_cores == -1} {
+	send_user "\n\033\[34mWARNING: unable to get cores from $part_node"
+	exit $exit_code
+}
+set part_cores [get_part_total_cores $def_partition $states]
+if {$part_cores == 0} {
+	send_user "\n\033\[34mWARNING: unable to get cores from $states nodes in $def_partition"
+	exit $exit_code
+}
+
 #
 # Get the user name
 #
@@ -429,7 +458,7 @@ expect {
 }
 
 set cons_res_actived 0
-if {$def_share_force == 0} {
+if {$def_oversubscribe_force == 0} {
 	set select_type [test_select_type]
 	if {![string compare $select_type "cons_res"]} {
 		set cons_res_actived 1
@@ -444,11 +473,11 @@ inc3_11_3
 inc3_11_4
 inc3_11_5
 inc3_11_6
-if {$cons_res_actived == 1 && $cores_per_node > 1 && $core_spec == 0 && $exclusive == 0 && $cr_socket == 0} {
+if {$cons_res_actived == 1 && $part_node_cores > 1 && $core_spec == 0 && $exclusive == 0 && $cr_socket == 0} {
 	inc3_11_7
 	inc3_11_8
 }
-if {$cons_res_actived == 1 && $cores_per_node > 1 && $core_spec == 0 && $exclusive == 0 && $cr_socket == 0 && $irregular_node_name == 0} {
+if {$cons_res_actived == 1 && $part_node_cores > 1 && $core_spec == 0 && $exclusive == 0 && $cr_socket == 0 && $irregular_node_name == 0 && $heterogeneous == 0} {
 	inc3_11_9
 }
 
diff --git a/testsuite/expect/test3.15 b/testsuite/expect/test3.15
index a16c1dc54..940e950e9 100755
--- a/testsuite/expect/test3.15
+++ b/testsuite/expect/test3.15
@@ -60,7 +60,7 @@ proc submit_job { license_count } {
 	global script_name bin_sleep license_name sbatch number exit_code
 	set job_id 0
 	make_bash_script $script_name "$bin_sleep 300"
-	spawn $sbatch -n1 -t1 -o /dev/null -L $license_name:$license_count $script_name
+	spawn $sbatch -n1 -t1 -o /dev/null -L $license_name:$license_count --mem=10 $script_name
 	expect {
 		-re "Submitted batch job ($number)" {
 			set job_id $expect_out(1,string)
@@ -177,6 +177,16 @@ if {[is_super_user] == 0} {
 	exit 0
 }
 
+set select_type [test_select_type]
+set def_part_name [default_partition]
+if {![string compare $select_type "linear"]} {
+	send_user "\nWARNING: This test is incompatible with select/linear\n"
+	exit $exit_code
+} elseif {[default_part_exclusive]} {
+	send_user "\nWARNING: This test is incompatible with exclusive node allocations\n"
+	exit $exit_code
+}
+
 spawn $bin_id -un
 expect {
 	-re "($alpha_numeric_under)" {
diff --git a/testsuite/expect/test3.16 b/testsuite/expect/test3.16
new file mode 100755
index 000000000..c49c0438b
--- /dev/null
+++ b/testsuite/expect/test3.16
@@ -0,0 +1,149 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test that scontrol show license is sorted
+#
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2015 SchedMD LLC
+# Written by Nathan Yee <nyee32@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id         "3.16"
+set exit_code       0
+set lic_a           "lic_a_test$test_id"
+set lic_b           "lic_b_test$test_id"
+set lic_c           "lic_c_test$test_id"
+
+print_header $test_id
+
+set cluster [get_cluster_name]
+
+proc add_lic { license } {
+
+	global sacctmgr exit_code cluster
+
+	set added 0
+	spawn $sacctmgr -i add resource name=$license cluster=$cluster count=50 \
+	    percentallowed=10 type=license
+	expect {
+		-re "Adding Resource" {
+			set added 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr is not reponding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if {$added != 1} {
+		send_user "\nFAILURE: sacctmgr did not add license: $license\n"
+		set exit_code 1
+	}
+}
+
+proc delete_lic { license } {
+
+	global sacctmgr exit_code 1
+
+	set deleted 0
+	spawn $sacctmgr -i delete resource name=$license
+	expect {
+		-re "Deleting resource" {
+			set deleted 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: sacctmgr is not responding\n"
+			set exit_code 1
+		}
+		eof {
+			wait
+		}
+	}
+
+	if { $deleted != 1 } {
+		send_user "\nFailure: sacctmgr could not delete "
+		send_user "license: $license\n"
+		set exit_code 1
+	}
+}
+
+print_header $test_id
+
+if { [test_using_slurmdbd] == 0 } {
+        send_user "\nWARNING: This test can't be run without AccountStorageType=slurmdbd\n"
+        exit $exit_code
+} elseif { [test_super_user] == 0} {
+        send_user "\nWARNING: This test can't be run without superuser permissions\n"
+        exit $exit_code
+}
+
+# Add the licenses in random order
+add_lic $lic_c
+add_lic $lic_a
+add_lic $lic_b
+
+set match 0
+spawn $scontrol show lic
+expect {
+	-re "LicenseName=$lic_a" {
+		incr match 1
+		exp_continue
+	}
+	-re "LicenseName=$lic_b" {
+		incr match 1
+		exp_continue
+	}
+	-re "LicenseName=$lic_c" {
+		incr match 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: scontrol is not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if { $match != 3 } {
+	send_user "\nFAILURE: licenses are not sorted\n"
+	set exit_code 1
+}
+
+delete_lic $lic_a
+delete_lic $lic_b
+delete_lic $lic_c
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test3.7 b/testsuite/expect/test3.7
index ad677f372..4114f2e57 100755
--- a/testsuite/expect/test3.7
+++ b/testsuite/expect/test3.7
@@ -151,15 +151,15 @@ exec $bin_chmod 700 $file_prog
 # Submit two jobs to the same node,.
 # The first job includes srun, second only the application
 #
-set srun_pid [spawn $sbatch -N1 -t2 --output=$file_out1 $file_prog_sh1]
+set sbatch_pid [spawn $sbatch -N1 -t2 --output=$file_out1 --mem=10 $file_prog_sh1]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id1 $expect_out(1,string)
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: srun not responding\n"
-		slow_kill $srun_pid
+		send_user "\nFAILURE: sbatch not responding\n"
+		slow_kill $sbatch_pid
 		exit 1
 	}
 	eof {
@@ -167,7 +167,7 @@ expect {
 	}
 }
 if {$job_id1 == 0} {
-	send_user "\nFAILURE: srun failed to report jobid\n"
+	send_user "\nFAILURE: sbatch failed to report jobid\n"
 	exit 1
 }
 # Get the job's allocate host name
@@ -200,14 +200,14 @@ if {[string compare $host_name ""] == 0} {
 	exit 1
 }
 # Submit another job to that same node
-set srun_pid [spawn $sbatch -N1 -t2 --output=$file_out2 $file_prog_sh2]
+set sbatch_pid [spawn $sbatch -N1 -t2 --output=$file_out2 --mem=10 $file_prog_sh2]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id2 $expect_out(1,string)
 		exp_continue
 	}
 	timeout {
-		send_user "\nFAILURE: srun not responding\n"
+		send_user "\nFAILURE: sbatch not responding\n"
 		slow_kill $srun_pid
 		exit 1
 	}
@@ -216,7 +216,7 @@ expect {
 	}
 }
 if {$job_id2 == 0} {
-	send_user "\nFAILURE: srun failed to report jobid\n"
+	send_user "\nFAILURE: sbatch failed to report jobid\n"
 	cancel_job $job_id1
 	exit 1
 }
diff --git a/testsuite/expect/test30.1 b/testsuite/expect/test30.1
index 37d804acc..cef3e0cae 100755
--- a/testsuite/expect/test30.1
+++ b/testsuite/expect/test30.1
@@ -1,8 +1,7 @@
 #!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
-#          Validates the rpm build is accepting the prefix and that
-#          Slurm is being built in the correct directories.
+#          Validates that RPMs are built with the correct prefix.
 #
 #
 # Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
@@ -32,7 +31,7 @@
 ############################################################################
 source ./globals
 
-set test_id      "test30.1"
+set test_id      "30.1"
 set tar_name     "Slurm-0-0.tar.bz2"
 set prefix_loc   "_prefix /opt/slurm"
 set rpm_loc      "/opt/slurm"
@@ -82,7 +81,7 @@ if { [catch {exec which rpmbuild}]} {
 }
 
 
-set timeout 1000
+set timeout 1200
 exec $bin_rm -fr /tmp/slurm $tar_name /tmp/built_rpms
 spawn $bin_cp -L -R -v $src_dir /tmp/slurm
 expect {
@@ -180,7 +179,7 @@ expect {
 	}
 }
 set rpm_path "${rpm_base}/${sub_dir}/Slurm-0-0.${sub_dir}.rpm"
-set timeout 1000
+set timeout 1200
 
 # Check to see that srun man pages are in the correct directory.
 check_path /opt/slurm srun.1
diff --git a/testsuite/expect/test31.1 b/testsuite/expect/test31.1
index 78616dc8d..75c56a3ee 100755
--- a/testsuite/expect/test31.1
+++ b/testsuite/expect/test31.1
@@ -31,11 +31,12 @@
 ############################################################################
 source ./globals
 
-set test_id          "test31.1"
+set test_id          "31.1"
+set test_name        "test31.1"
 set config_dir       ""
 set conf_path        "$config_dir/slurm.conf"
-set inc_slurm        "pro_epi_$test_id"
-set pro_epi_prog     "$test_id\_prog"
+set inc_slurm        "pro_epi_$test_name"
+set pro_epi_prog     "$test_name\_prog"
 set proc             ""
 set run_host         ""
 set make_file        0
@@ -58,7 +59,7 @@ if { [string compare [test_launch_type] "slurm"] } {
 
 proc change_pro_epi { arg program_name conf_change task_pro } {
 
-	global inc_slurm bin_chmod bin_rm config_dir pro_epi_prog bin_echo test_id bin_pwd alpha_numeric_under make_file bin_bash exit_code cwd file_dir bin_ln
+	global inc_slurm bin_chmod bin_rm config_dir pro_epi_prog bin_echo test_name bin_pwd alpha_numeric_under make_file bin_bash exit_code cwd file_dir bin_ln
 
 	if {$conf_change == 0} {
 		exec $bin_echo $arg=$config_dir/$pro_epi_prog > $config_dir/$inc_slurm
@@ -86,9 +87,9 @@ proc change_pro_epi { arg program_name conf_change task_pro } {
 		set exit_code 1
 	}
 
-	exec $bin_echo "#!/bin/bash\n" > $config_dir/$pro_epi_prog
+	exec $bin_echo "#!$bin_bash\n" > $config_dir/$pro_epi_prog
 	if {$make_file == 1} {
-		exec $bin_echo "touch $file_dir/$arg.$test_id.txt" >> $config_dir/$pro_epi_prog
+		exec $bin_echo "touch $file_dir/$arg.$test_name.txt" >> $config_dir/$pro_epi_prog
 	}
 
 	# task prologs are ran with fork_wait so don't do the sleep
@@ -101,7 +102,7 @@ proc change_pro_epi { arg program_name conf_change task_pro } {
 }
 
 proc check_file { file_name } {
-	global test_id exit_code file_dir run_host pcmd_prog
+	global test_name exit_code file_dir run_host pcmd_prog
 
 	sleep 1
 
@@ -157,7 +158,7 @@ proc check_proc {program_name} {
 
 proc run_job { file_type program_name conf_change task_pro} {
 
-	global srun run_host make_file exit_code bin_rm bin_printenv bin_sleep cwd test_id
+	global srun run_host make_file exit_code bin_rm bin_printenv bin_sleep cwd test_name
 
 	# Change the included file to epilog in the slurm.conf
 	change_pro_epi $file_type $program_name $conf_change $task_pro
@@ -192,7 +193,7 @@ proc run_job { file_type program_name conf_change task_pro} {
 	# wait for file
 	if {$make_file == 1} {
 		# Check to see that the epilog or prolog file has been removed
-		check_file $file_type.$test_id.txt
+		check_file $file_type.$test_name.txt
 	}
 
 	if {$task_pro != 1} {
@@ -294,7 +295,7 @@ expect {
 #
 # Test srun --task-epilog
 #
-change_pro_epi srun-task-epilog srun--task-epilog_$test_id 1 0
+change_pro_epi srun-task-epilog srun--task-epilog_$test_name 1 0
 
 update_conf
 
@@ -320,15 +321,15 @@ if {$sub_job != 1} {
 }
 
 if {$make_file == 1} {
-	check_file srun-task-epilog.$test_id.txt
+	check_file srun-task-epilog.$test_name.txt
 }
 
 
 # Check to see if the child process still exist
-check_proc srun--task-epilog_$test_id
+check_proc srun--task-epilog_$test_name
 
 # Remove link
-exec $bin_rm -rf $cwd/srun--task-epilog_$test_id
+exec $bin_rm -rf $cwd/srun--task-epilog_$test_name
 
 #
 # Task Prolog Test
@@ -343,12 +344,12 @@ exec $bin_rm -rf $cwd/srun--task-epilog_$test_id
 if {$make_file == 1} {
 
 	# Test srun --task-prolog
-	change_pro_epi srun-task-prolog srun--task-prolog_$test_id 1 1
+	change_pro_epi srun-task-prolog srun--task-prolog_$test_name 1 1
 
 	update_conf
 
 	set sub_job 0
-	set sbcast_file      "$file_dir/${test_id}_sbcast"
+	set sbcast_file      "$file_dir/${test_name}_sbcast"
 
 	spawn $salloc -t1 -w$run_host $bin_bash
 	expect {
@@ -375,12 +376,12 @@ if {$make_file == 1} {
 		set exit_code 1
 	}
 
-	check_file ${test_id}_sbcast
+	check_file ${test_name}_sbcast
 
-	check_file srun-task-prolog.$test_id.txt
+	check_file srun-task-prolog.$test_name.txt
 
 	# Remove link
-	exec $bin_rm -rf $cwd/srun--task-prolog_$test_id
+	exec $bin_rm -rf $cwd/srun--task-prolog_$test_name
 
 	# Add a line in the slurm.conf file to include the epilogs and prologs
 	exec $bin_echo include $config_dir/$inc_slurm >> $config_dir/slurm.conf
@@ -388,7 +389,7 @@ if {$make_file == 1} {
 	#
 	# Test TaskProlog
 	#
-	run_job taskprolog taskprolog_$test_id 0 1
+	run_job taskprolog taskprolog_$test_name 0 1
 
 } else {
 	# Add a line in the slurm.conf file to include the epilogs and prologs
@@ -400,19 +401,19 @@ if {$make_file == 1} {
 #
 # Test Epilog param
 #
-run_job epilog epilog_$test_id 0 0
+run_job epilog epilog_$test_name 0 0
 
 #
 # Test TaskEpilog param
 #
-run_job taskepilog taskepilog_$test_id 0 0
+run_job taskepilog taskepilog_$test_name 0 0
 
 ###############Prolog Test###############
 
 #
 # Test Prolog param
 #
-run_job prolog prolog_$test_id 0 0
+run_job prolog prolog_$test_name 0 0
 
 # Clean up vestigial files and restore original slurm.conf file
 exec $bin_cp $cwd/slurm.conf.orig $config_dir/slurm.conf
diff --git a/testsuite/expect/test33.1.prog.c b/testsuite/expect/test33.1.prog.c
index 1f81a3ece..bac10e1bf 100644
--- a/testsuite/expect/test33.1.prog.c
+++ b/testsuite/expect/test33.1.prog.c
@@ -185,7 +185,7 @@ int _measure_api(char* measure_case)
 	nodes = measure_case;
 	hl = hostlist_create(nodes);
 	START_TIMER;
-	if (route_g_split_hostlist(hl, &sp_hl, &hl_count) ) {
+	if (route_g_split_hostlist(hl, &sp_hl, &hl_count, 0)) {
 		hostlist_destroy(hl);
 		fatal("unable to split forward hostlist");
 	}
@@ -230,7 +230,7 @@ int _run_test(char** testcase, int lines)
 	char *nodes;
 	nodes = testcase[0];
 	hostlist_t hl = hostlist_create(nodes);
-	if (route_g_split_hostlist(hl, &hll, &hl_count)) {
+	if (route_g_split_hostlist(hl, &hll, &hl_count, 0)) {
 		info("Unable to split forward hostlist");
 		_print_test(testcase,lines);
 		rc = SLURM_FAILURE;
diff --git a/testsuite/expect/test36.1 b/testsuite/expect/test36.1
new file mode 100755
index 000000000..62058acb6
--- /dev/null
+++ b/testsuite/expect/test36.1
@@ -0,0 +1,85 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          lsid wrapper test
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2011-2016 SchedMD LLC
+# Written by Alejandro Sanchez <alex@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id     "36.1"
+set exit_code   0
+
+print_header $test_id
+
+if {[file executable $lsid] == 0} {
+	send_user "\nWARNING: $lsid does not exist\n"
+	exit 0
+}
+
+set cluster_name [get_cluster_name]
+set control_machine [get_control_machine]
+set lsid_cluster_name ""
+set lsid_control_machine ""
+set cluster_name_ok 0
+set control_machine_ok 0
+
+spawn $lsid
+expect {
+	-re "My cluster name is ($alpha_numeric_under)" {
+		set lsid_cluster_name $expect_out(1,string)
+		exp_continue
+	}
+	-re "My master name is ($controlmachine_regex)" {
+		set lsid_control_machine $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: lsid not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+
+if {[string compare $cluster_name $lsid_cluster_name]} {
+	send_user "\nFAILURE: lsid's cluster name does not match the configured parameter\n"
+	set exit_code 1
+}
+
+if {[string compare $control_machine $lsid_control_machine]} {
+	send_user "\nFAILURE: lsid's master name does not match the configured parameter\n"
+	set exit_code 1
+}
+
+if {!$exit_code} {
+	send_user "\nSUCCESS\n"
+} else {
+	send_user "\nFAILURE\n"
+}
+
+exit $exit_code
diff --git a/testsuite/expect/test36.2 b/testsuite/expect/test36.2
new file mode 100755
index 000000000..90f7f3c7a
--- /dev/null
+++ b/testsuite/expect/test36.2
@@ -0,0 +1,127 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          bjobs wrapper test
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2011-2016 SchedMD LLC
+# Written by Alejandro Sanchez <alex@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id     "36.2"
+set file_in     "test$test_id.input"
+set job_id      0
+set exit_code   0
+
+print_header $test_id
+
+if {[file executable $sbatch] == 0} {
+	send_user "\nWARNING: $sbatch does not exist\n"
+	exit 0
+}
+
+if {[file executable $bjobs] == 0} {
+	send_user "\nWARNING: $bjobs does not exist\n"
+	exit 0
+}
+
+spawn $bjobs
+expect {
+	-re "No unfinished job found" {
+		exp_continue
+	}
+	-re "Problem loading jobs" {
+		send_user "\nFAILURE: problem loading jobs.\n"
+		exit 1
+	}
+	timeout {
+		send_user "\nFAILURE: bjobs not responding\n"
+		exit 1
+	}
+	eof {
+		wait
+	}
+}
+
+
+#
+# Submit a slurm job
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "
+  $bin_sleep 10
+"
+
+spawn $sbatch -N1 -o /dev/null -t1 $file_in
+expect {
+        -re "Submitted batch job ($number)" {
+                set job_id $expect_out(1,string)
+                exp_continue
+        }
+        timeout {
+                send_user "\nFAILURE: sbatch not responding\n"
+                set exit_code 1
+                exp_continue
+        }
+        eof {
+                wait
+        }
+}
+if { $job_id == 0 } {
+        send_user "\nFAILURE: failed to submit job\n"
+        exit 1
+}
+
+#
+# Test bjobs <jobid> wrapper
+#
+set job_found 0
+spawn $bjobs $job_id
+expect {
+	-re "$job_id" {
+		set job_found 1
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: bjobs not responding\n"
+		slow_kill $sbatch_pid
+		exit 1
+	}
+	eof {
+		wait
+	}
+}
+
+cancel_job $job_id
+if {$exit_code == 0} {
+	if {$job_found == 1} {
+		send_user "\nSUCCESS\n"
+	} else {
+		send_user "\nFAILURE: bjobs $job_id does not work\n"
+		exit 1
+	}
+}
+
+exit $exit_code
diff --git a/testsuite/expect/test36.3 b/testsuite/expect/test36.3
new file mode 100755
index 000000000..76bd24e72
--- /dev/null
+++ b/testsuite/expect/test36.3
@@ -0,0 +1,158 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          bkill wrapper test
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2011-2016 SchedMD LLC
+# Written by Alejandro Sanchez <alex@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id     "36.3"
+set file_in     "test$test_id.input"
+set job_id      0
+set exit_code   0
+
+print_header $test_id
+
+if {[file executable $sbatch] == 0} {
+	send_user "\nWARNING: $sbatch does not exist\n"
+	exit 0
+}
+
+if {[file executable $bkill] == 0} {
+	send_user "\nWARNING: $bkill does not exist\n"
+	exit 0
+}
+
+if {[file executable $scontrol] == 0} {
+	send_user "\nWARNING: $scontrol does not exist\n"
+	exit 0
+}
+
+#
+# Submit a slurm job
+#
+exec $bin_rm -f $file_in
+make_bash_script $file_in "
+  $bin_sleep 20
+"
+
+set job_submitted 0
+spawn $sbatch -N1 $file_in
+expect {
+        -re "Submitted batch job ($number)" {
+                set job_id $expect_out(1,string)
+		set job_submitted 1
+                exp_continue
+        }
+        timeout {
+                send_user "\nFAILURE: sbatch not responding\n"
+                set exit_code 1
+                exp_continue
+        }
+        eof {
+                wait
+        }
+}
+if { $job_id == 0 } {
+        send_user "\nFAILURE: failed to submit job\n"
+        exit 1
+}
+
+if {$job_submitted == 1} {
+	#
+	# Test bkill $job_id
+	#
+	set job_sent_kill 0
+	spawn $bkill $job_id
+	expect {
+		-re "Job <$job_id> is being terminated" {
+			set job_sent_kill 1
+			exp_continue
+		}
+		timeout {
+			send_user "\nFAILURE: bkill not responding\n"
+			exit 1
+		}
+		eof {
+			wait
+		}
+	}
+} else {
+	send_user "\nFAILURE: unable to submit a test job through sbatch\n"
+	exit 1
+}
+
+if {$job_sent_kill == 1} {
+	#
+	# Test job state is now CANCELLED
+	#
+	set state_match 0
+	set cycle_count 8
+	for {set inx 0} {$inx < $cycle_count} {incr inx} {
+        	spawn $scontrol show job $job_id
+        	expect {
+        	        -re "JobState=CANCELLED" {
+        	                incr state_match
+				set exit_code 0
+				break
+        	        }
+			-re "JobState=" {
+				sleep 2
+				set exit_code 1
+				exp_continue
+			}
+        	        timeout {
+        	                send_user "\nFAILURE scontrol not responding\n"
+        	                set exit_code 1
+        	        }
+        	        eof {
+        	                wait
+        	        }
+        	}
+	}
+	if {$exit_code == 1} {
+		if {$cycle_count == 8} {
+			send_user "\nFAILURE: job not switched to CANCELLED\n"
+			exit 1
+		}
+	}
+} else {
+	send_user "\nFAILURE: unable bkill $job_id\n"
+	cancel_job $job_id
+	exit 1
+}
+
+if {$state_match != 1} {
+	send_user "\nFAILURE job should be CANCELLED, but is not\n"
+        set exit_code 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+}
+
+exit $exit_code
diff --git a/testsuite/expect/test36.4 b/testsuite/expect/test36.4
new file mode 100755
index 000000000..47d55760b
--- /dev/null
+++ b/testsuite/expect/test36.4
@@ -0,0 +1,121 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          bsub wrapper test
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+############################################################################
+# Copyright (C) 2016 SchedMD LLC
+# Written by Alejandro Sanchez <alex@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+
+source ./globals
+
+set test_id     "36.4"
+set exit_code   0
+set file_err	"test$test_id.error"
+set file_in	"test$test_id.input"
+set file_out	"test$test_id.output"
+
+print_header $test_id
+
+if {[file executable $bsub] == 0} {
+	send_user "\nWARNING: $bsub not found\n"
+	exit 0
+}
+
+if {[file executable $bkill] == 0} {
+	send_user "\nWARNING: $bkill not found\n"
+	exit 0
+}
+
+set job_id 0
+exec rm -f $file_out $file_err
+make_bash_script $file_in "$bin_echo HELLO; $bin_cat /dummy_file"
+spawn $bsub -W 01:00 -e $file_err -o $file_out ./$file_in
+expect {
+	-re "($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: bsub not responding\n"
+		set exit_code 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: bsub failed to submit job\n"
+	exit 1
+}
+
+if {[wait_for_file $file_out] != 0} {
+	send_user "\nFAILURE: bsub output file not found\n"
+	catch {exec $bkill $job_id}
+	exit 1
+}
+set matches 0
+spawn $bin_cat $file_out
+expect {
+	-re "HELLO" {
+		incr matches
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: unexpected bsub output file contents\n"
+	set exit_code 1
+}
+
+if {[wait_for_file $file_err] != 0} {
+	send_user "\nFAILURE: bsub error file not found\n"
+	catch {exec $qdel $job_id}
+	exit 1
+}
+set matches 0
+spawn $bin_cat $file_err
+expect {
+	-re "No such file" {
+		send_user "message from cat expected, no worries.\n"
+		incr matches
+		exp_continue
+	}
+	eof {
+		wait
+	}
+}
+if {$matches != 1} {
+	send_user "\nFAILURE: unexpected bsub error file contents\n"
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	exec $bin_rm -f $file_in $file_out $file_err
+	send_user "\nSUCCESS\n"
+}
+exit $exit_code
diff --git a/testsuite/expect/test4.12 b/testsuite/expect/test4.12
index 1046f6d0e..7a06aafaf 100755
--- a/testsuite/expect/test4.12
+++ b/testsuite/expect/test4.12
@@ -325,7 +325,7 @@ expect {
 		set def_hostlist $expect_out(1,string)
 		exp_continue
 	}
-	-re " Shared=EXCLUSIVE" {
+	-re " OverSubscribe=EXCLUSIVE" {
 		set part_exclusive 1
 		exp_continue
 	}
diff --git a/testsuite/expect/test4.13 b/testsuite/expect/test4.13
index c599209b1..8990ae8e2 100755
--- a/testsuite/expect/test4.13
+++ b/testsuite/expect/test4.13
@@ -67,12 +67,14 @@ array set part_info {
 	Nodes              nodelist
 	TotalNodes         nodes
 	PreemptMode        preemptmode
-	Priority           priority
-	Shared             share
+	PriorityJobFactor  priorityjobfactor
+	PriorityTier       prioritytier
+	OverSubscribe      oversubscribe
 	RootOnly           root
 }
 
 print_header $test_id
+set def_part [default_partition]
 
 proc cleanup { } {
 
diff --git a/testsuite/expect/test4.14 b/testsuite/expect/test4.14
index aa0b96780..d4fbde4d1 100755
--- a/testsuite/expect/test4.14
+++ b/testsuite/expect/test4.14
@@ -1,4 +1,4 @@
-#!/usr/bin/expect
+#!/usr/bin/env expect
 ############################################################################
 # Purpose: Test of SLURM functionality
 #          Validate that multiple partitions can be specified
diff --git a/testsuite/expect/test4.3 b/testsuite/expect/test4.3
index f0bcabf77..b05f8a7a3 100755
--- a/testsuite/expect/test4.3
+++ b/testsuite/expect/test4.3
@@ -172,7 +172,7 @@ expect {
 		incr matches -10
 		exp_continue
 	}
-	-re "SHARE" {
+	-re "OVERSUBS" {
 		incr matches -10
 		exp_continue
 	}
@@ -223,7 +223,7 @@ expect {
 		incr matches
 		exp_continue
 	}
-	-re "SHARE" {
+	-re "OVERSUBS" {
 		incr matches
 		exp_continue
 	}
diff --git a/testsuite/expect/test5.11 b/testsuite/expect/test5.11
index ea95c1353..7651aef47 100755
--- a/testsuite/expect/test5.11
+++ b/testsuite/expect/test5.11
@@ -98,7 +98,7 @@ proc check_node_cnt { exp_nodes } {
 	}
 
 	if {!$match} {
-		send_user "\nFAILURE: job did not make proper node estimationexpected = $exp_nodes\n"
+		send_user "\nFAILURE: job did not make proper node estimation, expected = $exp_nodes\n"
 		set exit_code 1
 	}
 }
diff --git a/testsuite/expect/test5.9 b/testsuite/expect/test5.9
index e8c963380..12266727b 100755
--- a/testsuite/expect/test5.9
+++ b/testsuite/expect/test5.9
@@ -286,6 +286,8 @@ if {[wait_for_job $job_id RUNNING] != 0} {
 	send_user "\nFAILURE: error waiting for job $job_id to start\n"
 	set exit_code 1
 }
+# Wait for steps to start too
+sleep 5
 
 # The number of allocated CPUs can vary depending upon the allocation unit
 set match 0
diff --git a/testsuite/expect/test6.15 b/testsuite/expect/test6.15
new file mode 100755
index 000000000..f32711dba
--- /dev/null
+++ b/testsuite/expect/test6.15
@@ -0,0 +1,173 @@
+#!/usr/bin/env expect
+############################################################################
+# Purpose: Test of SLURM functionality
+#          Test scancel signal of full job including batch script (--full option).
+#
+# Output:  "TEST: #.#" followed by "SUCCESS" if test was successful, OR
+#          "FAILURE: ..." otherwise with an explanation of the failure, OR
+#          anything else indicates a failure mode that must be investigated.
+#
+# Note:    This script generates and then deletes files in the working directory
+#          named test6.12.input, test6.12.output, and test6.12.error
+############################################################################
+# Copyright (C) 2015 SchedMD LLC.
+# Written by Morris Jette <jette@schedmd.com>
+#
+# This file is part of SLURM, a resource management program.
+# For details, see <http://slurm.schedmd.com/>.
+# Please also read the included file: DISCLAIMER.
+#
+# SLURM is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with SLURM; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA.
+############################################################################
+source ./globals
+
+set test_id     "6.15"
+set file_in1    "test$test_id.input1"
+set file_in2    "test$test_id.input2"
+set file_out    "test$test_id.output"
+
+set exit_code   0
+set job_id      0
+
+print_header $test_id
+
+if { [test_xcpu] } {
+	send_user "\nWARNING: This test is incompatible with XCPU system\n"
+	exit $exit_code
+} elseif {[test_alps]} {
+	send_user "\nWARNING: This test is incompatible with Cray systems\n"
+	exit $exit_code
+} elseif {[test_launch_poe]} {
+	send_user "\nWARNING: This test is incompatible with POE systems\n"
+	exit $exit_code
+	set step_id 1
+} else {
+	set step_id 0
+}
+
+#
+# Delete vestigial files
+#
+file delete $file_out
+
+#
+# Build input script files
+#
+make_bash_script $file_in1 "
+$bin_sleep 5
+$bin_sleep 5
+$bin_sleep 5
+$bin_sleep 5
+"
+
+make_bash_script $file_in2 "
+time ./$file_in1 &
+time $srun $file_in1 &
+wait
+"
+
+#
+# Spawn a sbatch job
+#
+set timeout $max_job_delay
+set sbatch_pid [spawn $sbatch --output=$file_out -t2 $file_in2]
+expect {
+	-re "Submitted batch job ($number)" {
+		set job_id $expect_out(1,string)
+		exp_continue
+	}
+	timeout {
+		send_user "\nFAILURE: sbatch not responding\n"
+		slow_kill $sbatch_pid
+		exit 1
+	}
+	eof {
+		wait
+	}
+}
+if {$job_id == 0} {
+	send_user "\nFAILURE: batch submit failure\n"
+	exit 1
+}
+
+#
+# Wait for job to start running, then STOP it for a while and CONTINUE
+#
+if {[wait_for_job $job_id "RUNNING"] != 0} {
+	send_user "\nFAILURE: waiting for job to start running\n"
+	exit 1
+}
+exec $bin_sleep 2
+
+send_user "\nStop the full job\n"
+spawn $scancel --full -s STOP $job_id
+expect {
+	eof {
+		wait
+	}
+}
+send_user "\nWait a while\n"
+exec $bin_sleep 20
+send_user "\nNow resume the job\n"
+spawn $scancel --full -s CONT $job_id
+expect {
+	eof {
+		wait
+	}
+}
+
+#
+# Wait for completion and confirm run times
+#
+if {[wait_for_job $job_id DONE] != 0} {
+	send_user "\nFAILURE: error completing job $job_id\n"
+	cancel_job $job_id
+	exit 1
+}
+
+# Now make sure that both the script and the step processes are stopped.
+# Both should run for at least 35 seconds (20 seconds between SIGSTOP and
+# SIGCONT) plus 15 to 20 seconds for $file_in1.
+if {[wait_for_file $file_out] == 0} {
+	set matches 0
+	set real_time 0
+	spawn cat $file_out
+	expect {
+		-re "real($whitespace)0m($number)" {
+			set real_time $expect_out(2,string)
+			if {$real_time < 35} {
+				send_user "\nFAILURE: Job not stopped\n"
+				set exit_code 1
+			}
+			incr matches
+			exp_continue
+		}
+		eof {
+			wait
+		}
+	}
+	if {$matches < 2} {
+		send_user "\nFAILURE: Missing run time messages ($matches < 2)\n"
+		set exit_code 1
+	}
+} else {
+	set exit_code 1
+}
+
+if {$exit_code == 0} {
+	send_user "\nSUCCESS\n"
+	exec $bin_rm -f $file_in1 $file_in2 $file_out
+}
+exit $exit_code
diff --git a/testsuite/expect/test6.7 b/testsuite/expect/test6.7
index 9d095f9ec..5ab9370fd 100755
--- a/testsuite/expect/test6.7
+++ b/testsuite/expect/test6.7
@@ -36,6 +36,7 @@ set test_id      "6.7"
 set exit_code    0
 set file_in      "test$test_id.input"
 set file_out     "test$test_id.output"
+set file_out2    "test$test_id.output2"
 set file_prog    "test$test_id.prog"
 
 print_header $test_id
@@ -45,7 +46,7 @@ print_header $test_id
 # We use our own program to get ulimit values since the output
 # of the ulimit program is inconsistent across systems.
 #
-exec rm -f $file_prog $file_in $file_out
+exec rm -f $file_prog $file_in $file_out2
 exec $bin_cc -o $file_prog $file_prog.c
 make_bash_script $file_in "
  $srun ./$file_prog
@@ -168,7 +169,7 @@ make_bash_script $file_in "
 # Submit a job so we have something to work with
 #
 set job_id 0
-set sbatch_pid [spawn $sbatch --output=$file_out -t1 $file_in]
+set sbatch_pid [spawn $sbatch --output=$file_out2 -t1 $file_in]
 expect {
 	-re "Submitted batch job ($number)" {
 		set job_id $expect_out(1,string)
@@ -233,8 +234,8 @@ if {[wait_for_job $job_id DONE] != 0} {
 #
 # Test output file
 #
-if {[wait_for_file $file_out] == 0} {
-	spawn cat $file_out
+if {[wait_for_file $file_out2] == 0} {
+	spawn cat $file_out2
 	expect {
 		-re "FINI" {
 			send_user "\nFAILURE: Job not stopped\n"
@@ -250,7 +251,7 @@ if {[wait_for_file $file_out] == 0} {
 }
 
 if {$exit_code == 0} {
-	exec rm -f $file_in $file_out $file_prog
+	exec rm -f $file_in $file_out2 $file_prog
 	send_user "\nSUCCESS\n"
 }
 exit $exit_code
diff --git a/testsuite/expect/test7.12.prog.c b/testsuite/expect/test7.12.prog.c
index ca5d53b8e..21852cef6 100644
--- a/testsuite/expect/test7.12.prog.c
+++ b/testsuite/expect/test7.12.prog.c
@@ -48,7 +48,8 @@ int main(int argc, char **argv)
 	step_id = atoi(argv[2]);
 	printf("job_id:%u step_id:%u\n", job_id, step_id);
 
-	rc = slurm_job_step_stat(job_id, step_id, NULL, &resp);
+	rc = slurm_job_step_stat(job_id, step_id, NULL, (uint16_t)NO_VAL,
+				 &resp);
 	if (rc != SLURM_SUCCESS) {
 		slurm_perror("slurm_job_step_stat");
 		exit(1);
diff --git a/testsuite/expect/test7.17 b/testsuite/expect/test7.17
index 78441a389..1285e7c7d 100755
--- a/testsuite/expect/test7.17
+++ b/testsuite/expect/test7.17
@@ -41,16 +41,10 @@ print_header $test_id
 #
 file delete $test_prog
 
-if {[test_aix]} {
-	send_user "$bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl\n"
-	exec       $bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl
-} elseif [file exists ${slurm_dir}/lib64/libslurm.so] {
-	send_user "$bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl\n"
-	exec       $bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl
-} else {
-	send_user "$bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl\n"
-	exec       $bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl
-}
+set cmd "$bin_cc ${test_prog}.c -g -pthread -export-dynamic -o ${test_prog} -I${src_dir} -I${build_dir} ${build_dir}/src/api/libslurm.o -ldl"
+send_user "$cmd\n"
+eval exec $cmd
+
 exec $bin_chmod 700 $test_prog
 
 send_user "\n====test7.17.1====\n"
diff --git a/testsuite/expect/test7.4 b/testsuite/expect/test7.4
index b17aab7b6..8d6862e83 100755
--- a/testsuite/expect/test7.4
+++ b/testsuite/expect/test7.4
@@ -142,10 +142,6 @@ expect {
 		incr matches
 		exp_continue
 	}
-	-re "elan_init: No capability, can't continue" {
-		incr no_capability
-		exp_continue
-	}
 	-re "Process 1 has exited.*" {
 		incr matches
 		exec sleep 2
@@ -229,10 +225,6 @@ expect {
 		incr matches
 		exp_continue
 	}
-	-re "elan_init: No capability, can't continue" {
-		incr no_capability
-		exp_continue
-	}
 	-re "Process 1 has exited.*" {
 		incr matches
 		exec sleep 2
diff --git a/testsuite/expect/test7.6 b/testsuite/expect/test7.6
index c8944a300..b6c7d65ee 100755
--- a/testsuite/expect/test7.6
+++ b/testsuite/expect/test7.6
@@ -172,10 +172,6 @@ expect {
 		incr matches
 		exp_continue
 	}
-	-re "elan_init: No capability, can't continue" {
-		incr no_capability
-		exp_continue
-	}
 	-re "Process 1 has exited.*" {
 		incr matches
 		exec sleep 2
diff --git a/testsuite/expect/test7.9 b/testsuite/expect/test7.9
index 3e7360801..4e79a9ae7 100755
--- a/testsuite/expect/test7.9
+++ b/testsuite/expect/test7.9
@@ -49,11 +49,10 @@ if {![test_accting_steps]} {
 }
 #
 # Test is incompatible with proctrack/aix, proctrack/rms, proctrack/sgi_job,
-# proctrack/cray, and switch/elan
+# and proctrack/cray
 #
 # Each leave open files, although we could clear the proctrack related files
-# by just closing all files after fd=3. Closing all files from switch/elan
-# would disable its use.
+# by just closing all files after fd=3.
 #
 set invalid 0
 log_user 0
@@ -84,11 +83,6 @@ expect {
 		set invalid 1
 		exp_continue
 	}
-	-re "switch/elan" {
-		send_user "\nWARNING: test incompatible with switch/elan\n"
-		set invalid 1
-		exp_continue
-	}
 	-re "pmi2" {
 		send_user "\nWARNING: test incompatible with mpi/pmi2\n"
 		set invalid 1
diff --git a/testsuite/expect/test8.5 b/testsuite/expect/test8.5
index ba20cc9c5..344e85409 100755
--- a/testsuite/expect/test8.5
+++ b/testsuite/expect/test8.5
@@ -182,9 +182,9 @@ if {[string compare [get_bluegene_layout] Dynamic]} {
 }
 
 set part_name [default_partition]
-set shared [partition_shared $part_name]
-if {[string compare $shared FORCE]} {
-	send_user "\nFAILURE: System configured Dynamic, but Partition $part_name has Shared=$shared\n"
+set oversubscribe [partition_oversubscribe $part_name]
+if {[string compare $oversubscribe FORCE]} {
+	send_user "\nFAILURE: System configured Dynamic, but Partition $part_name has OverSubscribe=$oversubscribe\n"
 	exit 1
 }
 
diff --git a/testsuite/expect/test9.8 b/testsuite/expect/test9.8
index b7051e917..892a18826 100755
--- a/testsuite/expect/test9.8
+++ b/testsuite/expect/test9.8
@@ -56,7 +56,7 @@ if {![test_select_type_params "Memory"]} {
 } elseif {[test_launch_poe]} {
 	set mem_per_step 200
 } else {
-	set mem_per_step 4
+	set mem_per_step 8
 }
 
 #
@@ -91,7 +91,7 @@ $srun -N1 -n1 --mem=0 $bin_sleep $sleep_time
 set start_cnt 0
 set timeout 30
 for {set inx 0} {$inx < $job_cnt} {incr inx} {
-	set sbatch_pid [spawn $sbatch --job-name=$job_name --mem-per-cpu=[expr $mem_per_step * 10] --output=/dev/null --error=/dev/null -t5 $file_in]
+	set sbatch_pid [spawn $sbatch --gres=craynetwork:0 --job-name=$job_name --mem-per-cpu=[expr $mem_per_step * 10] --output=/dev/null --error=/dev/null -t5 $file_in]
 	expect {
 		-re "Submitted batch job ($number)" {
 			incr start_cnt
@@ -118,13 +118,8 @@ if {$start_cnt < $job_cnt} {
 	send_user "\nAll $start_cnt jobs submitted\n"
 }
 
-#
-# Give the jobs a few seconds to get initiated, check for steps,
-# then kill them all
-#
 set user_name ""
 
-exec $bin_sleep $delay
 spawn $bin_id -un
 expect {
 	-re "($alpha_numeric_under)" {
@@ -135,26 +130,24 @@ expect {
 	}
 
 }
+
 #
 # There could be hundreds of job steps, we don't want to see
 # the details, but want to make sure that we did start many
 #
-# Determine if this is AIX (for task count, federation switch
-# prevents each node from running more than 16 tasks)
+set desired_tasks [expr $task_cnt * 2 / 3]
+
 #
-if {[test_aix]} {
-	set desired_tasks 15
-} else {
-	set desired_tasks [expr $task_cnt * 2 / 3]
-}
+# Give the jobs a few seconds to get initiated, check for steps,
+# then kill them all
+#
+exec $bin_sleep $delay
 
 set job_count  0
 set step_count 0
 set timeout    60
 log_user 0
 while { 1 } {
-	exec $bin_sleep 3
-
 	set job_count 0
 	spawn $squeue --state R --name $job_name --user $user_name
 	expect {
@@ -199,7 +192,7 @@ while { 1 } {
 		send_user "\nOnly started $job_count jobs, reducing step count target to $scaled_task_cnt\n"
 		set desired_tasks $scaled_task_cnt
 	}
-	
+	exec $bin_sleep 3
 }
 if {[test_aix]} {
 	sleep 5
diff --git a/testsuite/slurm_unit/Makefile.in b/testsuite/slurm_unit/Makefile.in
index 8d8281ac0..ff9bacd5a 100644
--- a/testsuite/slurm_unit/Makefile.in
+++ b/testsuite/slurm_unit/Makefile.in
@@ -90,7 +90,8 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = testsuite/slurm_unit
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -103,7 +104,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -116,6 +116,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -123,6 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -131,7 +133,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -226,8 +227,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -327,6 +326,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -365,6 +368,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -408,6 +414,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -458,6 +467,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/testsuite/slurm_unit/api/Makefile.in b/testsuite/slurm_unit/api/Makefile.in
index f3b05d860..8ba052caa 100644
--- a/testsuite/slurm_unit/api/Makefile.in
+++ b/testsuite/slurm_unit/api/Makefile.in
@@ -92,7 +92,8 @@ check_PROGRAMS = $(am__EXEEXT_1)
 TESTS = api-test$(EXEEXT)
 subdir = testsuite/slurm_unit/api
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -105,7 +106,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -118,6 +118,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -125,6 +126,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -133,7 +135,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -464,8 +465,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -565,6 +564,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -603,6 +606,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -646,6 +652,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -696,6 +705,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/testsuite/slurm_unit/api/manual/Makefile.in b/testsuite/slurm_unit/api/manual/Makefile.in
index effc87388..67c572981 100644
--- a/testsuite/slurm_unit/api/manual/Makefile.in
+++ b/testsuite/slurm_unit/api/manual/Makefile.in
@@ -94,7 +94,8 @@ check_PROGRAMS = cancel-tst$(EXEEXT) complete-tst$(EXEEXT) \
 	submit-tst$(EXEEXT) update_config-tst$(EXEEXT)
 subdir = testsuite/slurm_unit/api/manual
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -107,7 +108,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -120,6 +120,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -127,6 +128,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -135,7 +137,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -250,8 +251,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -351,6 +350,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -389,6 +392,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -432,6 +438,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -482,6 +491,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/testsuite/slurm_unit/common/Makefile.in b/testsuite/slurm_unit/common/Makefile.in
index 8bd088b5d..0939aebcf 100644
--- a/testsuite/slurm_unit/common/Makefile.in
+++ b/testsuite/slurm_unit/common/Makefile.in
@@ -96,7 +96,8 @@ TESTS = pack-test$(EXEEXT) log-test$(EXEEXT) bitstring-test$(EXEEXT) \
 
 subdir = testsuite/slurm_unit/common
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_check_zlib.m4 \
+	$(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/ax_pthread.m4 \
 	$(top_srcdir)/auxdir/libtool.m4 \
 	$(top_srcdir)/auxdir/ltoptions.m4 \
@@ -109,7 +110,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_aix.m4 \
 	$(top_srcdir)/auxdir/x_ac_blcr.m4 \
 	$(top_srcdir)/auxdir/x_ac_bluegene.m4 \
-	$(top_srcdir)/auxdir/x_ac_cflags.m4 \
 	$(top_srcdir)/auxdir/x_ac_cray.m4 \
 	$(top_srcdir)/auxdir/x_ac_curl.m4 \
 	$(top_srcdir)/auxdir/x_ac_databases.m4 \
@@ -122,6 +122,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_iso.m4 \
 	$(top_srcdir)/auxdir/x_ac_json.m4 \
 	$(top_srcdir)/auxdir/x_ac_lua.m4 \
+	$(top_srcdir)/auxdir/x_ac_lz4.m4 \
 	$(top_srcdir)/auxdir/x_ac_man2html.m4 \
 	$(top_srcdir)/auxdir/x_ac_munge.m4 \
 	$(top_srcdir)/auxdir/x_ac_ncurses.m4 \
@@ -129,6 +130,7 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_nrt.m4 \
 	$(top_srcdir)/auxdir/x_ac_ofed.m4 \
 	$(top_srcdir)/auxdir/x_ac_pam.m4 \
+	$(top_srcdir)/auxdir/x_ac_pmix.m4 \
 	$(top_srcdir)/auxdir/x_ac_printf_null.m4 \
 	$(top_srcdir)/auxdir/x_ac_ptrace.m4 \
 	$(top_srcdir)/auxdir/x_ac_readline.m4 \
@@ -137,7 +139,6 @@ am__aclocal_m4_deps = $(top_srcdir)/auxdir/ax_lib_hdf5.m4 \
 	$(top_srcdir)/auxdir/x_ac_setproctitle.m4 \
 	$(top_srcdir)/auxdir/x_ac_sgi_job.m4 \
 	$(top_srcdir)/auxdir/x_ac_slurm_ssl.m4 \
-	$(top_srcdir)/auxdir/x_ac_sun_const.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
@@ -457,8 +458,6 @@ ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
 AR = @AR@
-AUTHD_CFLAGS = @AUTHD_CFLAGS@
-AUTHD_LIBS = @AUTHD_LIBS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -558,6 +557,10 @@ LIB_LDFLAGS = @LIB_LDFLAGS@
 LIPO = @LIPO@
 LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+LZ4_CPPFLAGS = @LZ4_CPPFLAGS@
+LZ4_LDFLAGS = @LZ4_LDFLAGS@
+LZ4_LIBS = @LZ4_LIBS@
 MAINT = @MAINT@
 MAKEINFO = @MAKEINFO@
 MANIFEST_TOOL = @MANIFEST_TOOL@
@@ -596,6 +599,9 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PMIX_CPPFLAGS = @PMIX_CPPFLAGS@
+PMIX_LDFLAGS = @PMIX_LDFLAGS@
+PMIX_LIBS = @PMIX_LIBS@
 PROCTRACKDIR = @PROCTRACKDIR@
 PROJECT = @PROJECT@
 PTHREAD_CC = @PTHREAD_CC@
@@ -639,6 +645,9 @@ STRIP = @STRIP@
 SUCMD = @SUCMD@
 UTIL_LIBS = @UTIL_LIBS@
 VERSION = @VERSION@
+ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@
+ZLIB_LDFLAGS = @ZLIB_LDFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
 _libcurl_config = @_libcurl_config@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -689,6 +698,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
diff --git a/testsuite/slurm_unit/common/pack-test.c b/testsuite/slurm_unit/common/pack-test.c
index 9b6ce7c41..2a9b56235 100644
--- a/testsuite/slurm_unit/common/pack-test.c
+++ b/testsuite/slurm_unit/common/pack-test.c
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 #if HAVE_CONFIG_H
 #  include <config.h>
 #endif
diff --git a/testsuite/slurm_unit/common/runqsw.c b/testsuite/slurm_unit/common/runqsw.c
deleted file mode 100644
index 634023b34..000000000
--- a/testsuite/slurm_unit/common/runqsw.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * $Id$
- * $Source$
- *
- * Demo the routines in common/qsw.c
- * This can run mping on the local node (uses shared memory comms).
- * ./runqsw /usr/lib/mpi-test/mping 1 1024
- */
-
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-
-#include "src/plugins/switch/elan/qsw.h"
-#include "slurm/slurm_errno.h"
-#include "src/common/slurm_xlator.h"
-
-/* Boolean option to pack/unpack jobinfo struct
- * (good test for qsw pack routines)
- */
-bool pack_jobinfo = false;
-
-/*
- * Set a variable in the callers environment.  Args are printf style.
- * XXX Space is allocated on the heap and will never be reclaimed.
- * Example: setenvf("RMS_RANK=%d", rank);
- */
-static int
-setenvf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
-static int
-setenvf(const char *fmt, ...) 
-{
-	va_list ap;
-	char buf[BUFSIZ];
-	char *bufcpy;
-		    
-	va_start(ap, fmt);
-	vsnprintf(buf, sizeof(buf), fmt, ap);
-	va_end(ap);
-
-	bufcpy = strdup(buf);
-	if (bufcpy == NULL)
-		return -1;
-	return putenv(bufcpy);
-}
-
-/*
- * Set environment variables needed by QSW MPICH / libelan.
- */
-static int
-do_env(int nodeid, int procid, int nprocs)
-{
-	if (setenvf("RMS_RANK=%d", procid) < 0)
-		return -1;
-	if (setenvf("RMS_NODEID=%d", nodeid) < 0)
-		return -1;
-	if (setenvf("RMS_PROCID=%d", procid) < 0)
-		return -1;
-	if (setenvf("RMS_NNODES=%d", 1) < 0)
-		return -1;
-	if (setenvf("RMS_NPROCS=%d", nprocs) < 0)
-		return -1;
-	return 0;
-}
-
-/*
- * Set up and run 'nprocs' copies of the parallel job.
- */
-void
-slurmd(qsw_jobinfo_t job, uid_t uid, int nodeid, int nprocs, char *cmdbuf)
-{
-	pid_t pid;
-	int cpid[QSW_MAX_TASKS];
-	int i;
-
-	/* Process 1: */
-	switch ((pid = fork())) {
-		case -1:
-			slurm_perror("fork");
-			exit(1);
-		case 0: /* child falls thru */
-			break;
-		default: /* parent */
-			if (waitpid(pid, NULL, 0) < 0) {
-				slurm_perror("wait");
-				exit(1);
-			}
-			if (qsw_prgdestroy(job) < 0) {
-				slurm_perror("qsw_prgdestroy");
-				exit(1);
-			}
-			exit(0);
-	}
-
-	/* Process 2: */
-	if (qsw_prog_init(job, uid) < 0) {
-		slurm_perror("qsw_prog_init");
-		exit(1);
-	}
-	for (i = 0; i < nprocs; i++) {
-		cpid[i] = fork();
-		if (cpid[i] < 0) {
-			slurm_perror("fork");
-			exit(1);
-		} else if (cpid[i] == 0)
-			break;
-	}
-	/* still in parent */
-	if (i == nprocs) {
-		int waiting = nprocs;
-		int j;
-
-		while (waiting > 0) {
-			pid = waitpid(0, NULL, 0);
-			if (pid < 0) {
-				slurm_perror("waitpid");
-				exit(1);
-			}
-			for (j = 0; j < nprocs; j++) {
-				if (cpid[j] == pid)
-					waiting--;
-			}
-		}
-		exit(0);
-	}
-
-	/* Process 3: (there are nprocs instances of us) */
-	if (qsw_setcap(job, i) < 0) {
-		slurm_perror("qsw_setcap");
-		exit(1);
-	}
-	if (do_env(i, nodeid, nprocs) < 0) {
-		slurm_perror("do_env");
-		exit(1);
-	}
-
-	pid = fork();
-	switch (pid) {
-		case -1:        /* error */
-			slurm_perror("fork");
-			exit(1);
-		case 0:         /* child falls thru */
-			break;
-		default:        /* parent */
-			if (waitpid(pid, NULL, 0) < 0) {
-				slurm_perror("waitpid");
-				exit(1);
-			}
-			exit(0);
-	}
-	/* child continues here */
-
-	/* Process 4: execs the job */
-	if (setuid(uid) < 0) {
-		slurm_perror("setuid");
-		exit(1);
-	}
-	execl("/bin/bash", "bash", "-c", cmdbuf, 0);
-	slurm_perror("execl");
-	exit(1);
-}
-
-/*
- * Print usage message and exit.
- */
-void
-usage(void)
-{
-	printf("Usage: runqsw [-p] [-u uid] [-i elanid] [-n nprocs] exec args\n");
-	exit(1);
-}
-
-int
-main(int argc, char *argv[])
-{
-	extern char *optarg;
-	qsw_jobinfo_t job, j;
-	int c;
-	int nprocs = 0;
-	int nodeid = -1;
-	uid_t uid = getuid();
-	bitstr_t bit_decl(nodeset, QSW_MAX_TASKS);
-	char cmdbuf[1024] = { 0 }; 
-
-	/*
-	 * Handle arguments.
-	 */
-	while ((c = getopt(argc, argv, "pi:u:n:")) != EOF) {
-		switch (c) {
-			case 'n':
-				nprocs = atoi(optarg);
-				break;
-			case 'u':
-				uid = atoi(optarg);
-				break;
-			case 'i':
-				nodeid = atoi(optarg);
-				break;
-			case 'p':
-				pack_jobinfo = true;
-				break;
-			default:
-				usage();
-		}
-	}
-	if (optind == argc)
-		usage();
-	if (nprocs == 0)
-		nprocs = 2;
-	if (nodeid < 0) {
-		if ((nodeid = qsw_getnodeid()) < 0) {
-			slurm_perror("qsw_getnodeid");
-			exit(1);
-		}
-	}
-	while (optind < argc)
-		sprintf(cmdbuf + strlen(cmdbuf), "%s ", argv[optind++]);
-	cmdbuf[strlen(cmdbuf) - 1] = '\0';
-	bit_set(nodeset, nodeid);
-
-	/*
-	 * Set up 'job' to describe the parallel program.
-	 * Srun would do this when running without slurmctld,
-	 * otherwise slurmctld would do this after having calling
-	 * qsw_init to establish a persistant state in the library.
-	 */
-	if (qsw_alloc_jobinfo(&job) < 0) {
-		slurm_perror("qsw_alloc_jobinfo");
-		exit(1);
-	}
-	if (qsw_setup_jobinfo(job, nprocs, nodeset, 0) < 0) {
-		slurm_perror("qsw_setup_jobinfo");
-		exit(1);
-	}
-
-	/*
-	 * pack and unpack job if requested
-	 * print jobinfo struct regardless.
-	 */
-	qsw_print_jobinfo(stderr, job);
-	if (pack_jobinfo) {
-		Buf buffer;
-		buffer = init_buf(8096);
-		qsw_pack_jobinfo(job, buffer);
-		qsw_alloc_jobinfo(&j);
-		set_buf_offset(buffer,0);
-		qsw_unpack_jobinfo(j, buffer);
-		qsw_print_jobinfo(stderr, j);
-	} else 
-		j = job;
-
-
-	/* 
-	 * Now execute the parallel job like slurmd will.
-	 */
-	slurmd(j, uid, nodeid, nprocs, cmdbuf);
-
-	/*
-	 * Free the 'job' information.
-	 */
-	qsw_free_jobinfo(job);
-
-	exit(0);
-}
-- 
GitLab